-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix erroneous span for borrowck error
- Loading branch information
1 parent
37a4225
commit ccf6124
Showing
4 changed files
with
51 additions
and
11 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,16 @@ | ||
trait Foo { | ||
const ASSOC: bool = true; | ||
} | ||
impl<T> Foo for fn(T) {} | ||
|
||
fn foo(_x: i32) {} | ||
|
||
fn impls_foo<T: Foo>(_x: T) {} | ||
|
||
fn main() { | ||
impls_foo(foo as fn(i32)); | ||
|
||
<fn(&u8) as Foo>::ASSOC; | ||
//~^ ERROR implementation of `Foo` is not general enough | ||
//~| ERROR implementation of `Foo` is not general enough | ||
} |
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 @@ | ||
error: implementation of `Foo` is not general enough | ||
--> $DIR/issue-97997.rs:13:5 | ||
| | ||
LL | <fn(&u8) as Foo>::ASSOC; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough | ||
| | ||
= note: `Foo` would have to be implemented for the type `for<'r> fn(&'r u8)` | ||
= note: ...but `Foo` is actually implemented for the type `fn(&'0 u8)`, for some specific lifetime `'0` | ||
|
||
error: implementation of `Foo` is not general enough | ||
--> $DIR/issue-97997.rs:13:5 | ||
| | ||
LL | <fn(&u8) as Foo>::ASSOC; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough | ||
| | ||
= note: `Foo` would have to be implemented for the type `for<'r> fn(&'r u8)` | ||
= note: ...but `Foo` is actually implemented for the type `fn(&'0 u8)`, for some specific lifetime `'0` | ||
|
||
error: aborting due to 2 previous errors | ||
|