-
-
Save trixnz/ad11e68687529e164427df8f8eb63116 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut err = struct_span_err!(self.tcx.sess, | |
field.name.span, | |
E0062, | |
"field `{}` specified more than once", | |
field.name.node); | |
err.span_label(field.name.span, &format!("used more than once")); | |
if let Some(prev_span) = seen_fields.get(&field.name.node) { | |
err.span_label(*prev_span, &format!("first use of `{}`", field.name.node)); | |
} | |
err.emit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error[E0062]: field `x` specified more than once | |
--> src\test\compile-fail\E0062.rs:18:9 | |
| | |
17 | x: 0, | |
| ---- first use of `x` | |
18 | x: 0, //~ ERROR E0062 | |
| ^ used more than once |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src\test\compile-fail\E0062.rs:18:9: 18:10 error: field `x` specified more than once [E0062] | |
src\test\compile-fail\E0062.rs:18 x: 0, | |
^~~~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src\test\compile-fail\E0062.rs:18:9: 18:10 error: field `x` specified more than once [E0062] | |
src\test\compile-fail\E0062.rs:18 x: 0, //~ ERROR E0062 | |
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment