Merge pull request #3049 from mikerite/fix-2799

Add a test to ensure that #2799 is fixed
This commit is contained in:
Philipp Krones 2018-08-14 12:55:13 +02:00 committed by GitHub
commit 72b8c9b211
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 10 deletions

View File

@ -49,6 +49,9 @@ fn main() {
let _ = ..=end;
let _ = start..=end;
// Issue #2799
let _: Vec<_> = (start..end).collect();
// hand-written Range family structs are linted
let _ = RangeFrom { start: start };
let _ = RangeTo { end: end };

View File

@ -13,33 +13,33 @@ error: redundant field names in struct initialization
| ^^^^^^^^ help: replace it with: `age`
error: redundant field names in struct initialization
--> $DIR/redundant_field_names.rs:53:25
--> $DIR/redundant_field_names.rs:56:25
|
53 | let _ = RangeFrom { start: start };
56 | let _ = RangeFrom { start: start };
| ^^^^^^^^^^^^ help: replace it with: `start`
error: redundant field names in struct initialization
--> $DIR/redundant_field_names.rs:54:23
--> $DIR/redundant_field_names.rs:57:23
|
54 | let _ = RangeTo { end: end };
57 | let _ = RangeTo { end: end };
| ^^^^^^^^ help: replace it with: `end`
error: redundant field names in struct initialization
--> $DIR/redundant_field_names.rs:55:21
--> $DIR/redundant_field_names.rs:58:21
|
55 | let _ = Range { start: start, end: end };
58 | let _ = Range { start: start, end: end };
| ^^^^^^^^^^^^ help: replace it with: `start`
error: redundant field names in struct initialization
--> $DIR/redundant_field_names.rs:55:35
--> $DIR/redundant_field_names.rs:58:35
|
55 | let _ = Range { start: start, end: end };
58 | let _ = Range { start: start, end: end };
| ^^^^^^^^ help: replace it with: `end`
error: redundant field names in struct initialization
--> $DIR/redundant_field_names.rs:57:32
--> $DIR/redundant_field_names.rs:60:32
|
57 | let _ = RangeToInclusive { end: end };
60 | let _ = RangeToInclusive { end: end };
| ^^^^^^^^ help: replace it with: `end`
error: aborting due to 7 previous errors