Don't compute name of associated item if it's an RPITIT
This commit is contained in:
parent
40dacd50b7
commit
11e5987d01
3 changed files with 22 additions and 2 deletions
12
tests/ui/impl-trait/in-trait/dont-probe-missing-item-name.rs
Normal file
12
tests/ui/impl-trait/in-trait/dont-probe-missing-item-name.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
// Regression test for <https://github.com/rust-lang/rust/issues/139873>.
|
||||
|
||||
// Test that we don't try to get the (nonexistent) name of the RPITIT in `Trait::foo`
|
||||
// when emitting an error for a missing associated item `Trait::Output`.
|
||||
|
||||
trait Trait {
|
||||
fn foo() -> impl Sized;
|
||||
fn bar() -> Self::Output;
|
||||
//~^ ERROR associated type `Output` not found for `Self`
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,9 @@
|
|||
error[E0220]: associated type `Output` not found for `Self`
|
||||
--> $DIR/dont-probe-missing-item-name.rs:8:23
|
||||
|
|
||||
LL | fn bar() -> Self::Output;
|
||||
| ^^^^^^ associated type `Output` not found
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0220`.
|
Loading…
Add table
Add a link
Reference in a new issue