forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discard overflow obligations in impl_may_apply
- Loading branch information
1 parent
f65f84f
commit 87a387a
Showing
4 changed files
with
55 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
trait Hello {} | ||
|
||
struct Foo<'a, T: ?Sized>(&'a T); | ||
|
||
impl<'a, T: ?Sized> Hello for Foo<'a, &'a T> where Foo<'a, T>: Hello {} | ||
|
||
impl Hello for Foo<'static, i32> {} | ||
|
||
fn hello<T: ?Sized + Hello>() {} | ||
|
||
fn main() { | ||
hello(); | ||
//~^ ERROR type annotations needed | ||
} |
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 @@ | ||
error[E0283]: type annotations needed | ||
--> $DIR/overflow-computing-ambiguity.rs:12:5 | ||
| | ||
LL | hello(); | ||
| ^^^^^ cannot infer type of the type parameter `T` declared on the function `hello` | ||
| | ||
= note: cannot satisfy `_: Hello` | ||
= help: the following types implement trait `Hello`: | ||
Foo<'a, &'a T> | ||
Foo<'static, i32> | ||
note: required by a bound in `hello` | ||
--> $DIR/overflow-computing-ambiguity.rs:9:22 | ||
| | ||
LL | fn hello<T: ?Sized + Hello>() {} | ||
| ^^^^^ required by this bound in `hello` | ||
help: consider specifying the generic argument | ||
| | ||
LL | hello::<T>(); | ||
| +++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0283`. |