forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
delay bug in RPITIT refinement checking with resolution errors
- Loading branch information
Showing
3 changed files
with
43 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
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,23 @@ | ||
// This is a non-regression test for issue #126670 where RPITIT refinement checking encountered | ||
// errors during resolution and ICEd. | ||
|
||
//@ edition: 2018 | ||
|
||
pub trait Mirror { | ||
type Assoc; | ||
} | ||
impl<T: ?Sized> Mirror for () { | ||
//~^ ERROR the type parameter `T` is not constrained | ||
type Assoc = T; | ||
} | ||
|
||
pub trait First { | ||
async fn first() -> <() as Mirror>::Assoc; | ||
//~^ ERROR type annotations needed | ||
} | ||
|
||
impl First for () { | ||
async fn first() {} | ||
} | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
tests/ui/impl-trait/in-trait/refine-resolution-errors.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,16 @@ | ||
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates | ||
--> $DIR/refine-resolution-errors.rs:9:6 | ||
| | ||
LL | impl<T: ?Sized> Mirror for () { | ||
| ^ unconstrained type parameter | ||
|
||
error[E0282]: type annotations needed | ||
--> $DIR/refine-resolution-errors.rs:15:5 | ||
| | ||
LL | async fn first() -> <() as Mirror>::Assoc; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0207, E0282. | ||
For more information about an error, try `rustc --explain E0207`. |