mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
Fix formatting ellipses at the end of some diagnostics
This commit is contained in:
@@ -209,13 +209,13 @@ fn maybe_recover_unexpected_comma(&mut self, lo: Span, rc: RecoverComma) -> PRes
|
||||
if let Ok(seq_snippet) = self.span_to_snippet(seq_span) {
|
||||
err.span_suggestion(
|
||||
seq_span,
|
||||
"try adding parentheses to match on a tuple..",
|
||||
"try adding parentheses to match on a tuple...",
|
||||
format!("({})", seq_snippet),
|
||||
Applicability::MachineApplicable,
|
||||
)
|
||||
.span_suggestion(
|
||||
seq_span,
|
||||
"..or a vertical bar to match on multiple alternatives",
|
||||
"...or a vertical bar to match on multiple alternatives",
|
||||
format!("{}", seq_snippet.replace(",", " |")),
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
|
||||
@@ -1057,7 +1057,7 @@ fn contains_macro_use(&mut self, attrs: &[ast::Attribute]) -> bool {
|
||||
let msg = "`#[macro_escape]` is a deprecated synonym for `#[macro_use]`";
|
||||
let mut err = self.r.session.struct_span_warn(attr.span, msg);
|
||||
if let ast::AttrStyle::Inner = attr.style {
|
||||
err.help("consider an outer attribute, `#[macro_use]` mod ...").emit();
|
||||
err.help("try an outer attribute: `#[macro_use]`").emit();
|
||||
} else {
|
||||
err.emit();
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
|
||||
LL | #![macro_escape]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider an outer attribute, `#[macro_use]` mod ...
|
||||
= help: try an outer attribute: `#[macro_use]`
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ error: unexpected `,` in pattern
|
||||
LL | while let b1, b2, b3 = reading_frame.next().expect("there should be a start codon") {
|
||||
| ^
|
||||
|
|
||||
help: try adding parentheses to match on a tuple..
|
||||
help: try adding parentheses to match on a tuple...
|
||||
|
|
||||
LL | while let (b1, b2, b3) = reading_frame.next().expect("there should be a start codon") {
|
||||
| ^^^^^^^^^^^^
|
||||
help: ..or a vertical bar to match on multiple alternatives
|
||||
help: ...or a vertical bar to match on multiple alternatives
|
||||
|
|
||||
LL | while let b1 | b2 | b3 = reading_frame.next().expect("there should be a start codon") {
|
||||
| ^^^^^^^^^^^^
|
||||
@@ -19,11 +19,11 @@ error: unexpected `,` in pattern
|
||||
LL | if let b1, b2, b3 = reading_frame.next().unwrap() {
|
||||
| ^
|
||||
|
|
||||
help: try adding parentheses to match on a tuple..
|
||||
help: try adding parentheses to match on a tuple...
|
||||
|
|
||||
LL | if let (b1, b2, b3) = reading_frame.next().unwrap() {
|
||||
| ^^^^^^^^^^^^
|
||||
help: ..or a vertical bar to match on multiple alternatives
|
||||
help: ...or a vertical bar to match on multiple alternatives
|
||||
|
|
||||
LL | if let b1 | b2 | b3 = reading_frame.next().unwrap() {
|
||||
| ^^^^^^^^^^^^
|
||||
@@ -34,11 +34,11 @@ error: unexpected `,` in pattern
|
||||
LL | Nucleotide::Adenine, Nucleotide::Cytosine, _ => true
|
||||
| ^
|
||||
|
|
||||
help: try adding parentheses to match on a tuple..
|
||||
help: try adding parentheses to match on a tuple...
|
||||
|
|
||||
LL | (Nucleotide::Adenine, Nucleotide::Cytosine, _) => true
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: ..or a vertical bar to match on multiple alternatives
|
||||
help: ...or a vertical bar to match on multiple alternatives
|
||||
|
|
||||
LL | Nucleotide::Adenine | Nucleotide::Cytosine | _ => true
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -49,11 +49,11 @@ error: unexpected `,` in pattern
|
||||
LL | for x, _barr_body in women.iter().map(|woman| woman.allosomes.clone()) {
|
||||
| ^
|
||||
|
|
||||
help: try adding parentheses to match on a tuple..
|
||||
help: try adding parentheses to match on a tuple...
|
||||
|
|
||||
LL | for (x, _barr_body) in women.iter().map(|woman| woman.allosomes.clone()) {
|
||||
| ^^^^^^^^^^^^^^^
|
||||
help: ..or a vertical bar to match on multiple alternatives
|
||||
help: ...or a vertical bar to match on multiple alternatives
|
||||
|
|
||||
LL | for x | _barr_body in women.iter().map(|woman| woman.allosomes.clone()) {
|
||||
| ^^^^^^^^^^^^^^
|
||||
@@ -64,11 +64,11 @@ error: unexpected `,` in pattern
|
||||
LL | for x, y @ Allosome::Y(_) in men.iter().map(|man| man.allosomes.clone()) {
|
||||
| ^
|
||||
|
|
||||
help: try adding parentheses to match on a tuple..
|
||||
help: try adding parentheses to match on a tuple...
|
||||
|
|
||||
LL | for (x, y @ Allosome::Y(_)) in men.iter().map(|man| man.allosomes.clone()) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: ..or a vertical bar to match on multiple alternatives
|
||||
help: ...or a vertical bar to match on multiple alternatives
|
||||
|
|
||||
LL | for x | y @ Allosome::Y(_) in men.iter().map(|man| man.allosomes.clone()) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -79,11 +79,11 @@ error: unexpected `,` in pattern
|
||||
LL | let women, men: (Vec<Genome>, Vec<Genome>) = genomes.iter().cloned()
|
||||
| ^
|
||||
|
|
||||
help: try adding parentheses to match on a tuple..
|
||||
help: try adding parentheses to match on a tuple...
|
||||
|
|
||||
LL | let (women, men): (Vec<Genome>, Vec<Genome>) = genomes.iter().cloned()
|
||||
| ^^^^^^^^^^^^
|
||||
help: ..or a vertical bar to match on multiple alternatives
|
||||
help: ...or a vertical bar to match on multiple alternatives
|
||||
|
|
||||
LL | let women | men: (Vec<Genome>, Vec<Genome>) = genomes.iter().cloned()
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
@@ -184,7 +184,7 @@ warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
|
||||
LL | mod inner { #![macro_escape] }
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider an outer attribute, `#[macro_use]` mod ...
|
||||
= help: try an outer attribute: `#[macro_use]`
|
||||
|
||||
warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:221:17
|
||||
|
||||
@@ -4,5 +4,5 @@ warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
|
||||
LL | #![macro_escape]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider an outer attribute, `#[macro_use]` mod ...
|
||||
= help: try an outer attribute: `#[macro_use]`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user