From 94a0819fe3a0d679c3042a77bfe6a2afc505daea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:28 +0200 Subject: Adding upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/traits/unspecified-self-in-trait-ref.rs | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/test/ui/traits/unspecified-self-in-trait-ref.rs (limited to 'src/test/ui/traits/unspecified-self-in-trait-ref.rs') diff --git a/src/test/ui/traits/unspecified-self-in-trait-ref.rs b/src/test/ui/traits/unspecified-self-in-trait-ref.rs new file mode 100644 index 000000000..158b5a985 --- /dev/null +++ b/src/test/ui/traits/unspecified-self-in-trait-ref.rs @@ -0,0 +1,30 @@ +pub trait Foo { + fn foo(&self); +} + +pub trait Bar { + fn foo(&self); +} + +fn main() { + let a = Foo::lol(); + //~^ ERROR no function or associated item named + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition + let b = Foo::<_>::lol(); + //~^ ERROR no function or associated item named + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition + let c = Bar::lol(); + //~^ ERROR no function or associated item named + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition + let d = Bar::::lol(); + //~^ ERROR no function or associated item named + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition + let e = Bar::::lol(); + //~^ ERROR must be explicitly specified + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition +} -- cgit v1.2.3