-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure RPITITs are created before def-id freezing
- Loading branch information
1 parent
fd27e87
commit 571f945
Showing
3 changed files
with
24 additions
and
0 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
13 changes: 13 additions & 0 deletions
13
tests/ui/impl-trait/in-trait/ensure-rpitits-are-created-before-freezing.rs
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,13 @@ | ||
trait Iterable { | ||
type Item; | ||
fn iter(&self) -> impl Sized; | ||
} | ||
|
||
// `ty::Error` in a trait ref will silence any missing item errors, but will also | ||
// prevent the `associated_items` query from being called before def ids are frozen. | ||
impl Iterable for Missing { | ||
//~^ ERROR cannot find type `Missing` in this scope | ||
fn iter(&self) -> Self::Item {} | ||
} | ||
|
||
fn main() {} |
9 changes: 9 additions & 0 deletions
9
tests/ui/impl-trait/in-trait/ensure-rpitits-are-created-before-freezing.stderr
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[E0412]: cannot find type `Missing` in this scope | ||
--> $DIR/ensure-rpitits-are-created-before-freezing.rs:8:19 | ||
| | ||
LL | impl Iterable for Missing { | ||
| ^^^^^^^ not found in this scope | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |