This commit is contained in:
Alex Crichton 2018-08-02 14:14:48 -07:00
parent 5d9ca00d94
commit ae6ea84924
2 changed files with 32 additions and 10 deletions

View file

@ -33,15 +33,7 @@ error: you seem to be trying to use match for destructuring a single pattern. Co
41 | | &(v, 1) => println!("{}", v),
42 | | _ => println!("none"),
43 | | }
| |_____^
help: try this
|
40 | if let &(v, 1) = tup {
41 | # [ cfg ( not ( stage0 ) ) ] {
42 | ( $ crate :: io :: _print ( format_args_nl ! ( $ ( $ arg ) * ) ) ) ; } # [
43 | cfg ( stage0 ) ] { print ! ( "{}/n" , format_args ! ( $ ( $ arg ) * ) ) } } else {
44 | ( $ crate :: io :: _print ( format_args_nl ! ( $ ( $ arg ) * ) ) ) ; }
|
| |_____^ help: try this: `if let &(v, 1) = tup { $ crate :: io :: _print ( format_args_nl ! ( $ ( $ arg ) * ) ) ; } else { $ crate :: io :: _print ( format_args_nl ! ( $ ( $ arg ) * ) ) ; }`
error: you don't need to add `&` to all patterns
--> $DIR/matches.rs:40:5

View file

@ -12,6 +12,36 @@ error: redundant field names in struct initialization
35 | age: age,
| ^^^^^^^^ help: replace it with: `age`
error: redundant field names in struct initialization
--> $DIR/redundant_field_names.rs:45:13
|
45 | let _ = start..;
| ^^^^^ help: replace it with: `start`
error: redundant field names in struct initialization
--> $DIR/redundant_field_names.rs:46:15
|
46 | let _ = ..end;
| ^^^ help: replace it with: `end`
error: redundant field names in struct initialization
--> $DIR/redundant_field_names.rs:47:13
|
47 | let _ = start..end;
| ^^^^^ help: replace it with: `start`
error: redundant field names in struct initialization
--> $DIR/redundant_field_names.rs:47:20
|
47 | let _ = start..end;
| ^^^ help: replace it with: `end`
error: redundant field names in struct initialization
--> $DIR/redundant_field_names.rs:49:16
|
49 | let _ = ..=end;
| ^^^ help: replace it with: `end`
error: redundant field names in struct initialization
--> $DIR/redundant_field_names.rs:53:25
|
@ -42,5 +72,5 @@ error: redundant field names in struct initialization
57 | let _ = RangeToInclusive { end: end };
| ^^^^^^^^ help: replace it with: `end`
error: aborting due to 7 previous errors
error: aborting due to 12 previous errors