-
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.
Delay a bug when encountering an impl with unconstrained generics in …
…codegen_select
- Loading branch information
1 parent
f5be3ca
commit 50fb40a
Showing
4 changed files
with
44 additions
and
24 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 was deleted.
Oops, something went wrong.
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,20 @@ | ||
// Need a different module so we try to build the mir for `test` | ||
// before analyzing `mod foo`. | ||
|
||
mod foo { | ||
pub trait Callable { | ||
fn call(); | ||
} | ||
|
||
impl<V: ?Sized> Callable for () { | ||
//~^ ERROR the type parameter `V` is not constrained by the impl trait, self type, or predicates | ||
fn call() {} | ||
} | ||
} | ||
use foo::*; | ||
|
||
fn test() -> impl Sized { | ||
<() as Callable>::call() | ||
} | ||
|
||
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[E0207]: the type parameter `V` is not constrained by the impl trait, self type, or predicates | ||
--> $DIR/resolve-impl-before-constrain-check.rs:9:10 | ||
| | ||
LL | impl<V: ?Sized> Callable for () { | ||
| ^ unconstrained type parameter | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0207`. |