-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #99890 - compiler-errors:issue-99828, r=lcnr
Do not allow bad projection term to leak into the type checker Fixes #99828
- Loading branch information
Showing
5 changed files
with
55 additions
and
10 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
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 @@ | ||
fn get_iter(vec: &[i32]) -> impl Iterator<Item = {}> + '_ { | ||
//~^ ERROR expected associated type bound, found constant | ||
//~| ERROR associated const equality is incomplete | ||
vec.iter() | ||
} | ||
|
||
fn main() { | ||
let vec = Vec::new(); | ||
let mut iter = get_iter(&vec); | ||
iter.next(); | ||
} |
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,24 @@ | ||
error[E0658]: associated const equality is incomplete | ||
--> $DIR/issue-99828.rs:1:43 | ||
| | ||
LL | fn get_iter(vec: &[i32]) -> impl Iterator<Item = {}> + '_ { | ||
| ^^^^^^^^^ | ||
| | ||
= note: see issue #92827 <https://github.com/rust-lang/rust/issues/92827> for more information | ||
= help: add `#![feature(associated_const_equality)]` to the crate attributes to enable | ||
|
||
error: expected associated type bound, found constant | ||
--> $DIR/issue-99828.rs:1:43 | ||
| | ||
LL | fn get_iter(vec: &[i32]) -> impl Iterator<Item = {}> + '_ { | ||
| ^^^^^^^^^ | ||
| | ||
note: associated type defined here | ||
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | ||
| | ||
LL | type Item; | ||
| ^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |