forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#114147 - compiler-errors:missing-rpitits, r…
…=spastorino Insert RPITITs that were shadowed by missing ADTs that resolve to [type error] Comment inline explains how this can happen. Fixes rust-lang#113903
- Loading branch information
Showing
3 changed files
with
49 additions
and
4 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
18 changes: 18 additions & 0 deletions
18
tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.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,18 @@ | ||
// issue: 113903 | ||
|
||
#![feature(return_position_impl_trait_in_trait)] | ||
|
||
use std::ops::Deref; | ||
|
||
pub trait Tr { | ||
fn w() -> impl Deref<Target = Missing<impl Sized>>; | ||
//~^ ERROR cannot find type `Missing` in this scope | ||
} | ||
|
||
impl Tr for () { | ||
fn w() -> &'static () { | ||
&() | ||
} | ||
} | ||
|
||
fn main() {} |
9 changes: 9 additions & 0 deletions
9
tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.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/rpitit-shadowed-by-missing-adt.rs:8:35 | ||
| | ||
LL | fn w() -> impl Deref<Target = Missing<impl Sized>>; | ||
| ^^^^^^^ not found in this scope | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |