Fix formatting ellipses at the end of some diagnostics

This commit is contained in:
varkor
2020-01-10 15:13:56 +00:00
parent e84248921b
commit 3de9b8a3b7
6 changed files with 18 additions and 18 deletions
+2 -2
View File
@@ -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,
);
+1 -1
View File
@@ -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]`