mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-19 02:13:57 +00:00

When an associated type with GATs isn't specified in a `dyn Trait`, emit an object safety error instead of only complaining about the missing associated type, as it will lead the user down a path of three different errors before letting them know that what they were trying to do is impossible to begin with. Fix #103155.
14 lines
261 B
Rust
14 lines
261 B
Rust
// Test that a partially specified trait object with unspecified associated
|
|
// type does not type-check.
|
|
|
|
trait Foo {
|
|
type A;
|
|
|
|
fn dummy(&self) { }
|
|
}
|
|
|
|
fn bar(x: &dyn Foo) {}
|
|
//~^ ERROR the associated type `A` in `Foo` must be specified
|
|
|
|
pub fn main() {}
|