-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use
unwrap()
in ArrayIntoIter
lint when typeck fails
- Loading branch information
Showing
3 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Regression test for #121532 | ||
// Checks the we don't ICE in ArrayIntoIter | ||
// lint when typeck has failed | ||
|
||
// Typeck fails for the arg type as | ||
// `Self` makes no sense here | ||
fn func(a: Self::ItemsIterator) { //~ ERROR failed to resolve: `Self` is only available in impls, traits, and type definitions | ||
a.into_iter(); | ||
} | ||
|
||
fn main() {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions | ||
--> $DIR/ice-array-into-iter-lint-issue-121532.rs:7:12 | ||
| | ||
LL | fn func(a: Self::ItemsIterator) { | ||
| ^^^^ `Self` is only available in impls, traits, and type definitions | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0433`. |