-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't call fn_arg_names for non-fn in resolver
- Loading branch information
1 parent
59d4114
commit 29f31c5
Showing
4 changed files
with
53 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 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,3 @@ | ||
pub trait Foo { | ||
type Bar; | ||
} |
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,11 @@ | ||
//@ aux-build:foreign-trait-with-assoc.rs | ||
|
||
extern crate foreign_trait_with_assoc; | ||
use foreign_trait_with_assoc::Foo; | ||
|
||
// Make sure we don't try to call `fn_arg_names` on a non-fn item. | ||
|
||
impl Foo for Bar {} | ||
//~^ ERROR cannot find type `Bar` in this scope | ||
|
||
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,14 @@ | ||
error[E0412]: cannot find type `Bar` in this scope | ||
--> $DIR/dont-compute-arg-names-for-non-fn.rs:8:14 | ||
| | ||
LL | impl Foo for Bar {} | ||
| ^^^ | ||
| | ||
help: you might have meant to use the associated type | ||
| | ||
LL | impl Foo for Self::Bar {} | ||
| ++++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |