diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs index 1fe82bc7ff6b8..55efb87a582fd 100644 --- a/compiler/rustc_hir_typeck/src/method/suggest.rs +++ b/compiler/rustc_hir_typeck/src/method/suggest.rs @@ -1177,15 +1177,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let is_method = mode == Mode::MethodCall; let item_kind = if is_method { "method" - } else if rcvr_ty.is_enum() { - "variant or associated item" + } else if rcvr_ty.is_enum() || rcvr_ty.is_fresh_ty() { + "variant, associated function, or constant" } else { - match (item_ident.as_str().chars().next(), rcvr_ty.is_fresh_ty()) { - (Some(name), false) if name.is_lowercase() => "function or associated item", - (Some(_), false) => "associated item", - (Some(_), true) | (None, false) => "variant or associated item", - (None, true) => "variant", - } + "associated function or constant" }; if let Err(guar) = self.report_failed_method_call_on_numerical_infer_var( diff --git a/tests/ui/associated-consts/associated-const-no-item.rs b/tests/ui/associated-consts/associated-const-no-item.rs index 024d14e21b5fd..116f1aab3f48e 100644 --- a/tests/ui/associated-consts/associated-const-no-item.rs +++ b/tests/ui/associated-consts/associated-const-no-item.rs @@ -3,7 +3,7 @@ trait Foo { } const X: i32 = ::ID; -//~^ ERROR no associated item named `ID` found +//~^ ERROR no associated function or constant named `ID` found fn main() { assert_eq!(1, X); diff --git a/tests/ui/associated-consts/associated-const-no-item.stderr b/tests/ui/associated-consts/associated-const-no-item.stderr index 7ded05b7b48e1..40cd7791399b0 100644 --- a/tests/ui/associated-consts/associated-const-no-item.stderr +++ b/tests/ui/associated-consts/associated-const-no-item.stderr @@ -1,8 +1,8 @@ -error[E0599]: no associated item named `ID` found for type `i32` in the current scope +error[E0599]: no associated function or constant named `ID` found for type `i32` in the current scope --> $DIR/associated-const-no-item.rs:5:23 | LL | const X: i32 = ::ID; - | ^^ associated item not found in `i32` + | ^^ associated function or constant not found in `i32` | = help: items from traits can only be used if the trait is implemented and in scope note: `Foo` defines an item `ID`, perhaps you need to implement it diff --git a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.rs b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.rs index a33d4928f0145..0de982142df44 100644 --- a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.rs +++ b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.rs @@ -7,5 +7,5 @@ impl Fail { fn main() { Fail::<()>::C - //~^ ERROR no associated item named `C` found for struct `Fail<()>` in the current scope + //~^ ERROR no associated function or constant named `C` found for struct `Fail<()>` in the current scope } diff --git a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.stderr b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.stderr index c581639310711..99839e842bea1 100644 --- a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.stderr +++ b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.stderr @@ -7,16 +7,16 @@ LL | struct Fail; = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead -error[E0599]: no associated item named `C` found for struct `Fail<()>` in the current scope +error[E0599]: no associated function or constant named `C` found for struct `Fail<()>` in the current scope --> $DIR/wrong-projection-self-ty-invalid-bivariant-arg.rs:9:17 | LL | struct Fail; - | -------------- associated item `C` not found for this struct + | -------------- associated function or constant `C` not found for this struct ... LL | Fail::<()>::C - | ^ associated item not found in `Fail<()>` + | ^ associated function or constant not found in `Fail<()>` | - = note: the associated item was found for + = note: the associated function or constant was found for - `Fail` error: aborting due to 2 previous errors diff --git a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.rs b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.rs index d891b7bd62b4a..e4f2bbf24e6b4 100644 --- a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.rs +++ b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.rs @@ -14,5 +14,5 @@ impl Fail { fn main() { Fail::::C //~^ ERROR: type mismatch - //~| ERROR no associated item named `C` found for struct `Fail` in the current scope + //~| ERROR no associated function or constant named `C` found for struct `Fail` in the current scope } diff --git a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.stderr b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.stderr index 165e89010b687..193e75958648b 100644 --- a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.stderr +++ b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.stderr @@ -15,16 +15,16 @@ note: required by a bound in `Fail` LL | struct Fail, U>(T); | ^^^^^^^^^ required by this bound in `Fail` -error[E0599]: no associated item named `C` found for struct `Fail` in the current scope +error[E0599]: no associated function or constant named `C` found for struct `Fail` in the current scope --> $DIR/wrong-projection-self-ty-invalid-bivariant-arg2.rs:15:23 | LL | struct Fail, U>(T); - | ---------------------------------- associated item `C` not found for this struct + | ---------------------------------- associated function or constant `C` not found for this struct ... LL | Fail::::C - | ^ associated item not found in `Fail` + | ^ associated function or constant not found in `Fail` | - = note: the associated item was found for + = note: the associated function or constant was found for - `Fail` error: aborting due to 2 previous errors diff --git a/tests/ui/associated-item/associated-item-enum.rs b/tests/ui/associated-item/associated-item-enum.rs index 30ba258155bb9..3a5c058f5ec20 100644 --- a/tests/ui/associated-item/associated-item-enum.rs +++ b/tests/ui/associated-item/associated-item-enum.rs @@ -14,7 +14,7 @@ impl Trait for Enum { } fn main() { - Enum::mispellable(); //~ ERROR no variant or associated item - Enum::mispellable_trait(); //~ ERROR no variant or associated item - Enum::MISPELLABLE; //~ ERROR no variant or associated item + Enum::mispellable(); //~ ERROR no variant, associated function, or constant + Enum::mispellable_trait(); //~ ERROR no variant, associated function, or constant + Enum::MISPELLABLE; //~ ERROR no variant, associated function, or constant } diff --git a/tests/ui/associated-item/associated-item-enum.stderr b/tests/ui/associated-item/associated-item-enum.stderr index c3ce7c34d0569..6cb53e5cd0cce 100644 --- a/tests/ui/associated-item/associated-item-enum.stderr +++ b/tests/ui/associated-item/associated-item-enum.stderr @@ -1,39 +1,39 @@ -error[E0599]: no variant or associated item named `mispellable` found for enum `Enum` in the current scope +error[E0599]: no variant, associated function, or constant named `mispellable` found for enum `Enum` in the current scope --> $DIR/associated-item-enum.rs:17:11 | LL | enum Enum { Variant } - | --------- variant or associated item `mispellable` not found for this enum + | --------- variant, associated function, or constant `mispellable` not found for this enum ... LL | Enum::mispellable(); - | ^^^^^^^^^^^ variant or associated item not found in `Enum` + | ^^^^^^^^^^^ variant, associated function, or constant not found in `Enum` | help: there is an associated function `misspellable` with a similar name | LL | Enum::misspellable(); | + -error[E0599]: no variant or associated item named `mispellable_trait` found for enum `Enum` in the current scope +error[E0599]: no variant, associated function, or constant named `mispellable_trait` found for enum `Enum` in the current scope --> $DIR/associated-item-enum.rs:18:11 | LL | enum Enum { Variant } - | --------- variant or associated item `mispellable_trait` not found for this enum + | --------- variant, associated function, or constant `mispellable_trait` not found for this enum ... LL | Enum::mispellable_trait(); - | ^^^^^^^^^^^^^^^^^ variant or associated item not found in `Enum` + | ^^^^^^^^^^^^^^^^^ variant, associated function, or constant not found in `Enum` | help: there is an associated function `misspellable_trait` with a similar name | LL | Enum::misspellable_trait(); | + -error[E0599]: no variant or associated item named `MISPELLABLE` found for enum `Enum` in the current scope +error[E0599]: no variant, associated function, or constant named `MISPELLABLE` found for enum `Enum` in the current scope --> $DIR/associated-item-enum.rs:19:11 | LL | enum Enum { Variant } - | --------- variant or associated item `MISPELLABLE` not found for this enum + | --------- variant, associated function, or constant `MISPELLABLE` not found for this enum ... LL | Enum::MISPELLABLE; - | ^^^^^^^^^^^ variant or associated item not found in `Enum` + | ^^^^^^^^^^^ variant, associated function, or constant not found in `Enum` | help: there is an associated constant `MISSPELLABLE` with a similar name | diff --git a/tests/ui/associated-types/associated-type-as-value-in-impl-issue-142797.rs b/tests/ui/associated-types/associated-type-as-value-in-impl-issue-142797.rs new file mode 100644 index 0000000000000..f588d6d0a43f7 --- /dev/null +++ b/tests/ui/associated-types/associated-type-as-value-in-impl-issue-142797.rs @@ -0,0 +1,21 @@ +// issue: + +struct SomeStruct { + some_field: u64, +} + +trait SomeTrait { + type SomeType; + fn foo(); +} + +impl SomeTrait for bool { + type SomeType = SomeStruct; + + fn foo() { + let ss = Self::SomeType; + //~^ ERROR no associated function or constant named `SomeType` found for type `bool` in the current scope + } +} + +fn main() {} diff --git a/tests/ui/associated-types/associated-type-as-value-in-impl-issue-142797.stderr b/tests/ui/associated-types/associated-type-as-value-in-impl-issue-142797.stderr new file mode 100644 index 0000000000000..83b915c2684e4 --- /dev/null +++ b/tests/ui/associated-types/associated-type-as-value-in-impl-issue-142797.stderr @@ -0,0 +1,9 @@ +error[E0599]: no associated function or constant named `SomeType` found for type `bool` in the current scope + --> $DIR/associated-type-as-value-in-impl-issue-142797.rs:16:24 + | +LL | let ss = Self::SomeType; + | ^^^^^^^^ associated function or constant not found in `bool` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/tests/ui/associated-types/associated-type-as-value.rs b/tests/ui/associated-types/associated-type-as-value.rs index ddc8082366584..7fefc48eb3378 100644 --- a/tests/ui/associated-types/associated-type-as-value.rs +++ b/tests/ui/associated-types/associated-type-as-value.rs @@ -1,7 +1,7 @@ //! regression test for fn foo() { - T::Item; //~ ERROR no associated item named `Item` found + T::Item; //~ ERROR no associated function or constant named `Item` found } fn main() { } diff --git a/tests/ui/associated-types/associated-type-as-value.stderr b/tests/ui/associated-types/associated-type-as-value.stderr index c553582b39077..0015ebe767dd5 100644 --- a/tests/ui/associated-types/associated-type-as-value.stderr +++ b/tests/ui/associated-types/associated-type-as-value.stderr @@ -1,10 +1,10 @@ -error[E0599]: no associated item named `Item` found for type parameter `T` in the current scope +error[E0599]: no associated function or constant named `Item` found for type parameter `T` in the current scope --> $DIR/associated-type-as-value.rs:4:8 | LL | fn foo() { - | - associated item `Item` not found for this type parameter + | - associated function or constant `Item` not found for this type parameter LL | T::Item; - | ^^^^ associated item not found in `T` + | ^^^^ associated function or constant not found in `T` error: aborting due to 1 previous error diff --git a/tests/ui/associated-types/associated-type-call.fixed b/tests/ui/associated-types/associated-type-call.fixed index d450b3b82c96f..f2df7807b31ec 100644 --- a/tests/ui/associated-types/associated-type-call.fixed +++ b/tests/ui/associated-types/associated-type-call.fixed @@ -15,7 +15,7 @@ impl Trait for () { fn f() { T(); - //~^ ERROR no associated item named `Assoc` found for unit type `()` in the current scope + //~^ ERROR no associated function or constant named `Assoc` found for unit type `()` in the current scope } } diff --git a/tests/ui/associated-types/associated-type-call.rs b/tests/ui/associated-types/associated-type-call.rs index ffe540c329eb9..88d017219b78b 100644 --- a/tests/ui/associated-types/associated-type-call.rs +++ b/tests/ui/associated-types/associated-type-call.rs @@ -15,7 +15,7 @@ impl Trait for () { fn f() { ::Assoc(); - //~^ ERROR no associated item named `Assoc` found for unit type `()` in the current scope + //~^ ERROR no associated function or constant named `Assoc` found for unit type `()` in the current scope } } diff --git a/tests/ui/associated-types/associated-type-call.stderr b/tests/ui/associated-types/associated-type-call.stderr index eaef775e30406..94cfc24465620 100644 --- a/tests/ui/associated-types/associated-type-call.stderr +++ b/tests/ui/associated-types/associated-type-call.stderr @@ -1,8 +1,8 @@ -error[E0599]: no associated item named `Assoc` found for unit type `()` in the current scope +error[E0599]: no associated function or constant named `Assoc` found for unit type `()` in the current scope --> $DIR/associated-type-call.rs:17:17 | LL | ::Assoc(); - | ^^^^^ associated item not found in `()` + | ^^^^^ associated function or constant not found in `()` | help: to construct a value of type `T`, use the explicit path | diff --git a/tests/ui/associated-types/invalid-ctor.fixed b/tests/ui/associated-types/invalid-ctor.fixed index eba3820de0c1c..75980101f045b 100644 --- a/tests/ui/associated-types/invalid-ctor.fixed +++ b/tests/ui/associated-types/invalid-ctor.fixed @@ -15,7 +15,7 @@ impl Trait for () { fn mk() -> Self::Out { Constructor(1) - //~^ ERROR no associated item named `Out` found for unit type `()` + //~^ ERROR no associated function or constant named `Out` found for unit type `()` } } diff --git a/tests/ui/associated-types/invalid-ctor.rs b/tests/ui/associated-types/invalid-ctor.rs index 73335c065c2ae..82ec17df430fc 100644 --- a/tests/ui/associated-types/invalid-ctor.rs +++ b/tests/ui/associated-types/invalid-ctor.rs @@ -15,7 +15,7 @@ impl Trait for () { fn mk() -> Self::Out { Self::Out(1) - //~^ ERROR no associated item named `Out` found for unit type `()` + //~^ ERROR no associated function or constant named `Out` found for unit type `()` } } diff --git a/tests/ui/associated-types/invalid-ctor.stderr b/tests/ui/associated-types/invalid-ctor.stderr index 0b3bf316f60fa..50dc7188b6812 100644 --- a/tests/ui/associated-types/invalid-ctor.stderr +++ b/tests/ui/associated-types/invalid-ctor.stderr @@ -1,8 +1,8 @@ -error[E0599]: no associated item named `Out` found for unit type `()` in the current scope +error[E0599]: no associated function or constant named `Out` found for unit type `()` in the current scope --> $DIR/invalid-ctor.rs:17:15 | LL | Self::Out(1) - | ^^^ associated item not found in `()` + | ^^^ associated function or constant not found in `()` | help: to construct a value of type `Constructor`, use the explicit path | diff --git a/tests/ui/associated-types/issue-43924.rs b/tests/ui/associated-types/issue-43924.rs index 63ebbddea76ff..dfc84611e8f60 100644 --- a/tests/ui/associated-types/issue-43924.rs +++ b/tests/ui/associated-types/issue-43924.rs @@ -13,5 +13,5 @@ impl Foo for () {} fn main() { assert_eq!(<() as Foo>::Out::default().to_string(), "false"); - //~^ ERROR no function or associated item named `default` found for trait object + //~^ ERROR no associated function or constant named `default` found for trait object } diff --git a/tests/ui/associated-types/issue-43924.stderr b/tests/ui/associated-types/issue-43924.stderr index 196ad85f084e2..5bf8ee730e618 100644 --- a/tests/ui/associated-types/issue-43924.stderr +++ b/tests/ui/associated-types/issue-43924.stderr @@ -10,11 +10,11 @@ note: required by a bound in `Foo::Out` LL | type Out: Default + ToString + ?Sized = dyn ToString; | ^^^^^^^ required by this bound in `Foo::Out` -error[E0599]: no function or associated item named `default` found for trait object `(dyn ToString + 'static)` in the current scope +error[E0599]: no associated function or constant named `default` found for trait object `(dyn ToString + 'static)` in the current scope --> $DIR/issue-43924.rs:15:39 | LL | assert_eq!(<() as Foo>::Out::default().to_string(), "false"); - | ^^^^^^^ function or associated item not found in `(dyn ToString + 'static)` + | ^^^^^^^ associated function or constant not found in `(dyn ToString + 'static)` error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.rs b/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.rs index e364368b8a4cf..3f092d08274c5 100644 --- a/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.rs +++ b/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.rs @@ -15,5 +15,5 @@ impl Wrapper<{ bar() }> { fn main() { Wrapper::::call; - //~^ ERROR: the function or associated item `call` exists for struct `Wrapper`, + //~^ ERROR: the associated function or constant `call` exists for struct `Wrapper`, } diff --git a/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.stderr b/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.stderr index b13f76eabadbc..4d469deb00c01 100644 --- a/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.stderr +++ b/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.stderr @@ -15,14 +15,14 @@ error[E0741]: using function pointers as const generic parameters is forbidden LL | struct Wrapper; | ^^^^ -error[E0599]: the function or associated item `call` exists for struct `Wrapper`, but its trait bounds were not satisfied +error[E0599]: the associated function or constant `call` exists for struct `Wrapper`, but its trait bounds were not satisfied --> $DIR/non_valtreeable_const_arg-2.rs:17:26 | LL | struct Wrapper; - | ----------------------------- function or associated item `call` not found for this struct because it doesn't satisfy `Wrapper: Fn<_>` + | ----------------------------- associated function or constant `call` not found for this struct because it doesn't satisfy `Wrapper: Fn<_>` ... LL | Wrapper::::call; - | ^^^^ function or associated item cannot be called on `Wrapper` due to unsatisfied trait bounds + | ^^^^ associated function or constant cannot be called on `Wrapper` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `Wrapper: Fn<_>` diff --git a/tests/ui/const-generics/generic_const_exprs/issue-69654.rs b/tests/ui/const-generics/generic_const_exprs/issue-69654.rs index 9b36699bbf112..058f404df5783 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-69654.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-69654.rs @@ -15,5 +15,5 @@ where fn main() { Foo::foo(); - //~^ ERROR the function or associated item + //~^ ERROR the associated function or constant } diff --git a/tests/ui/const-generics/generic_const_exprs/issue-69654.stderr b/tests/ui/const-generics/generic_const_exprs/issue-69654.stderr index 7fa0d8c7dbaa9..9b5e556b94ee9 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-69654.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-69654.stderr @@ -11,14 +11,14 @@ help: you might have meant to write a const parameter here LL | impl Bar for [u8; T] {} | +++++ ++++++++++++ -error[E0599]: the function or associated item `foo` exists for struct `Foo<_>`, but its trait bounds were not satisfied +error[E0599]: the associated function or constant `foo` exists for struct `Foo<_>`, but its trait bounds were not satisfied --> $DIR/issue-69654.rs:17:10 | LL | struct Foo {} - | -------------------------- function or associated item `foo` not found for this struct + | -------------------------- associated function or constant `foo` not found for this struct ... LL | Foo::foo(); - | ^^^ function or associated item cannot be called on `Foo<_>` due to unsatisfied trait bounds + | ^^^ associated function or constant cannot be called on `Foo<_>` due to unsatisfied trait bounds | note: trait bound `[u8; _]: Bar<[(); _]>` was not satisfied --> $DIR/issue-69654.rs:11:14 diff --git a/tests/ui/const-generics/generic_const_exprs/issue-80742.rs b/tests/ui/const-generics/generic_const_exprs/issue-80742.rs index 0d392902be871..99decb368e1d0 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-80742.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-80742.rs @@ -27,5 +27,5 @@ where fn main() { let dst = Inline::::new(0); //~^ ERROR the size for values of type `dyn Debug` cannot be known at compilation time - //~| ERROR the function or associated item `new` exists for struct `Inline` + //~| ERROR the associated function or constant `new` exists for struct `Inline` } diff --git a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr index ac1bfc8d7a1b9..bad736b45685c 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr @@ -15,14 +15,14 @@ help: consider relaxing the implicit `Sized` restriction LL | struct Inline | ++++++++ -error[E0599]: the function or associated item `new` exists for struct `Inline`, but its trait bounds were not satisfied +error[E0599]: the associated function or constant `new` exists for struct `Inline`, but its trait bounds were not satisfied --> $DIR/issue-80742.rs:28:36 | LL | struct Inline - | ---------------- function or associated item `new` not found for this struct + | ---------------- associated function or constant `new` not found for this struct ... LL | let dst = Inline::::new(0); - | ^^^ function or associated item cannot be called on `Inline` due to unsatisfied trait bounds + | ^^^ associated function or constant cannot be called on `Inline` due to unsatisfied trait bounds | note: trait bound `dyn Debug: Sized` was not satisfied --> $DIR/issue-80742.rs:18:6 diff --git a/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-3.rs b/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-3.rs index afb086a41305b..1e1ef0d73b458 100644 --- a/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-3.rs +++ b/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-3.rs @@ -17,5 +17,5 @@ where fn main() { let dst = Inline::::new(0); //~^ ERROR the size for values of type `dyn Debug` cannot be known at compilation time - //~| ERROR no function or associated item named `new` found for struct `Inline` + //~| ERROR no associated function or constant named `new` found for struct `Inline` } diff --git a/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-3.stderr b/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-3.stderr index bcc253ed96705..c73c2167dd754 100644 --- a/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-3.stderr +++ b/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-3.stderr @@ -15,14 +15,14 @@ help: consider relaxing the implicit `Sized` restriction LL | struct Inline | ++++++++ -error[E0599]: no function or associated item named `new` found for struct `Inline` in the current scope +error[E0599]: no associated function or constant named `new` found for struct `Inline` in the current scope --> $DIR/size_of-dyn-trait-3.rs:18:36 | LL | struct Inline - | ---------------- function or associated item `new` not found for this struct + | ---------------- associated function or constant `new` not found for this struct ... LL | let dst = Inline::::new(0); - | ^^^ function or associated item not found in `Inline` + | ^^^ associated function or constant not found in `Inline` error: aborting due to 2 previous errors diff --git a/tests/ui/consts/const-needs_drop-monomorphic.rs b/tests/ui/consts/const-needs_drop-monomorphic.rs index 7402c680985b0..f68eb4bed6135 100644 --- a/tests/ui/consts/const-needs_drop-monomorphic.rs +++ b/tests/ui/consts/const-needs_drop-monomorphic.rs @@ -9,7 +9,7 @@ impl Bool { } fn f() { Bool::<{ std::mem::needs_drop::() }>::assert(); - //~^ ERROR no function or associated item named `assert` found + //~^ ERROR no associated function or constant named `assert` found //~| ERROR unconstrained generic constant } fn main() { diff --git a/tests/ui/consts/const-needs_drop-monomorphic.stderr b/tests/ui/consts/const-needs_drop-monomorphic.stderr index 17f197cdd5d2b..12ea559127ae0 100644 --- a/tests/ui/consts/const-needs_drop-monomorphic.stderr +++ b/tests/ui/consts/const-needs_drop-monomorphic.stderr @@ -9,14 +9,14 @@ help: try adding a `where` bound LL | fn f() where [(); { std::mem::needs_drop::() } as usize]: { | +++++++++++++++++++++++++++++++++++++++++++++++++++++ -error[E0599]: no function or associated item named `assert` found for struct `Bool<{ std::mem::needs_drop::() }>` in the current scope +error[E0599]: no associated function or constant named `assert` found for struct `Bool<{ std::mem::needs_drop::() }>` in the current scope --> $DIR/const-needs_drop-monomorphic.rs:11:46 | LL | struct Bool {} - | -------------------------- function or associated item `assert` not found for this struct + | -------------------------- associated function or constant `assert` not found for this struct ... LL | Bool::<{ std::mem::needs_drop::() }>::assert(); - | ^^^^^^ function or associated item cannot be called on `Bool<{ std::mem::needs_drop::() }>` due to unsatisfied trait bounds + | ^^^^^^ associated function or constant cannot be called on `Bool<{ std::mem::needs_drop::() }>` due to unsatisfied trait bounds error: aborting due to 2 previous errors diff --git a/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.rs b/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.rs index 0a7ec5ab5c1be..5d801f26de168 100644 --- a/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.rs +++ b/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.rs @@ -7,7 +7,7 @@ pub struct InvariantRef<'a, T: ?Sized>(&'a T, PhantomData<&'a mut &'a T>); impl<'a> InvariantRef<'a, ()> { pub const NEW: Self = InvariantRef::new(&()); - //~^ ERROR: no function or associated item named `new` found + //~^ ERROR: no associated function or constant named `new` found } trait Trait { diff --git a/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.stderr b/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.stderr index ae5d0e8fa2965..6cf844f29b06f 100644 --- a/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.stderr +++ b/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.stderr @@ -43,14 +43,14 @@ help: consider introducing lifetime `'a` here LL | impl<'a> Trait for Z { | ++++ -error[E0599]: no function or associated item named `new` found for struct `InvariantRef<'a, T>` in the current scope +error[E0599]: no associated function or constant named `new` found for struct `InvariantRef<'a, T>` in the current scope --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:9:41 | LL | pub struct InvariantRef<'a, T: ?Sized>(&'a T, PhantomData<&'a mut &'a T>); - | -------------------------------------- function or associated item `new` not found for this struct + | -------------------------------------- associated function or constant `new` not found for this struct ... LL | pub const NEW: Self = InvariantRef::new(&()); - | ^^^ function or associated item not found in `InvariantRef<'_, _>` + | ^^^ associated function or constant not found in `InvariantRef<'_, _>` error[E0277]: the trait bound `u8: Trait` is not satisfied --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:12 diff --git a/tests/ui/did_you_mean/bad-assoc-pat.rs b/tests/ui/did_you_mean/bad-assoc-pat.rs index 3f912f7ffc63e..911eeb0994e45 100644 --- a/tests/ui/did_you_mean/bad-assoc-pat.rs +++ b/tests/ui/did_you_mean/bad-assoc-pat.rs @@ -2,25 +2,25 @@ fn main() { match 0u8 { [u8]::AssocItem => {} //~^ ERROR missing angle brackets in associated item path - //~| ERROR no associated item named `AssocItem` found + //~| ERROR no associated function or constant named `AssocItem` found (u8, u8)::AssocItem => {} //~^ ERROR missing angle brackets in associated item path - //~| ERROR no associated item named `AssocItem` found + //~| ERROR no associated function or constant named `AssocItem` found _::AssocItem => {} //~^ ERROR missing angle brackets in associated item path - //~| ERROR no associated item named `AssocItem` found + //~| ERROR no associated function or constant named `AssocItem` found } match &0u8 { &(u8,)::AssocItem => {} //~^ ERROR missing angle brackets in associated item path - //~| ERROR no associated item named `AssocItem` found + //~| ERROR no associated function or constant named `AssocItem` found } } macro_rules! pat { ($ty: ty) => ($ty::AssocItem) //~^ ERROR missing angle brackets in associated item path - //~| ERROR no associated item named `AssocItem` found + //~| ERROR no associated function or constant named `AssocItem` found } macro_rules! ty { () => (u8) @@ -31,6 +31,6 @@ fn check_macros() { pat!(u8) => {} ty!()::AssocItem => {} //~^ ERROR missing angle brackets in associated item path - //~| ERROR no associated item named `AssocItem` found + //~| ERROR no associated function or constant named `AssocItem` found } } diff --git a/tests/ui/did_you_mean/bad-assoc-pat.stderr b/tests/ui/did_you_mean/bad-assoc-pat.stderr index 8bdeb8ffdd0a8..aff3d97eadaeb 100644 --- a/tests/ui/did_you_mean/bad-assoc-pat.stderr +++ b/tests/ui/did_you_mean/bad-assoc-pat.stderr @@ -68,46 +68,46 @@ help: types that don't start with an identifier need to be surrounded with angle LL | ($ty: ty) => (<$ty>::AssocItem) | + + -error[E0599]: no associated item named `AssocItem` found for slice `[u8]` in the current scope +error[E0599]: no associated function or constant named `AssocItem` found for slice `[u8]` in the current scope --> $DIR/bad-assoc-pat.rs:3:15 | LL | [u8]::AssocItem => {} - | ^^^^^^^^^ associated item not found in `[u8]` + | ^^^^^^^^^ associated function or constant not found in `[u8]` -error[E0599]: no associated item named `AssocItem` found for tuple `(u8, u8)` in the current scope +error[E0599]: no associated function or constant named `AssocItem` found for tuple `(u8, u8)` in the current scope --> $DIR/bad-assoc-pat.rs:6:19 | LL | (u8, u8)::AssocItem => {} - | ^^^^^^^^^ associated item not found in `(u8, u8)` + | ^^^^^^^^^ associated function or constant not found in `(u8, u8)` -error[E0599]: no associated item named `AssocItem` found for type `_` in the current scope +error[E0599]: no associated function or constant named `AssocItem` found for type `_` in the current scope --> $DIR/bad-assoc-pat.rs:9:12 | LL | _::AssocItem => {} - | ^^^^^^^^^ associated item not found in `_` + | ^^^^^^^^^ associated function or constant not found in `_` -error[E0599]: no associated item named `AssocItem` found for tuple `(u8,)` in the current scope +error[E0599]: no associated function or constant named `AssocItem` found for tuple `(u8,)` in the current scope --> $DIR/bad-assoc-pat.rs:14:17 | LL | &(u8,)::AssocItem => {} - | ^^^^^^^^^ associated item not found in `(u8,)` + | ^^^^^^^^^ associated function or constant not found in `(u8,)` -error[E0599]: no associated item named `AssocItem` found for type `u8` in the current scope +error[E0599]: no associated function or constant named `AssocItem` found for type `u8` in the current scope --> $DIR/bad-assoc-pat.rs:21:24 | LL | ($ty: ty) => ($ty::AssocItem) - | ^^^^^^^^^ associated item not found in `u8` + | ^^^^^^^^^ associated function or constant not found in `u8` ... LL | pat!(u8) => {} | -------- in this macro invocation | = note: this error originates in the macro `pat` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0599]: no associated item named `AssocItem` found for type `u8` in the current scope +error[E0599]: no associated function or constant named `AssocItem` found for type `u8` in the current scope --> $DIR/bad-assoc-pat.rs:32:16 | LL | ty!()::AssocItem => {} - | ^^^^^^^^^ associated item not found in `u8` + | ^^^^^^^^^ associated function or constant not found in `u8` error: aborting due to 12 previous errors diff --git a/tests/ui/empty/empty-struct-braces-expr.rs b/tests/ui/empty/empty-struct-braces-expr.rs index c10f76b92196b..f6a174290e341 100644 --- a/tests/ui/empty/empty-struct-braces-expr.rs +++ b/tests/ui/empty/empty-struct-braces-expr.rs @@ -22,8 +22,8 @@ fn main() { let xe1 = XEmpty1; //~ ERROR expected value, found struct `XEmpty1` let xe1 = XEmpty1(); //~^ ERROR expected function, tuple struct or tuple variant, found struct `XEmpty1` - let xe3 = XE::Empty3; //~ ERROR no variant or associated item named `Empty3` found for enum - let xe3 = XE::Empty3(); //~ ERROR no variant or associated item named `Empty3` found for enum + let xe3 = XE::Empty3; //~ ERROR no variant, associated function, or constant named `Empty3` found for enum + let xe3 = XE::Empty3(); //~ ERROR no variant, associated function, or constant named `Empty3` found for enum XE::Empty1 {}; //~ ERROR no variant named `Empty1` found for enum `empty_struct::XE` } diff --git a/tests/ui/empty/empty-struct-braces-expr.stderr b/tests/ui/empty/empty-struct-braces-expr.stderr index a176107a06e24..f496708512a4d 100644 --- a/tests/ui/empty/empty-struct-braces-expr.stderr +++ b/tests/ui/empty/empty-struct-braces-expr.stderr @@ -117,22 +117,22 @@ LL - let xe1 = XEmpty1(); LL + let xe1 = XEmpty2(); | -error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope +error[E0599]: no variant, associated function, or constant named `Empty3` found for enum `empty_struct::XE` in the current scope --> $DIR/empty-struct-braces-expr.rs:25:19 | LL | let xe3 = XE::Empty3; - | ^^^^^^ variant or associated item not found in `empty_struct::XE` + | ^^^^^^ variant, associated function, or constant not found in `empty_struct::XE` | help: there is a variant with a similar name | LL | let xe3 = XE::XEmpty3; | + -error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope +error[E0599]: no variant, associated function, or constant named `Empty3` found for enum `empty_struct::XE` in the current scope --> $DIR/empty-struct-braces-expr.rs:26:19 | LL | let xe3 = XE::Empty3(); - | ^^^^^^ variant or associated item not found in `empty_struct::XE` + | ^^^^^^ variant, associated function, or constant not found in `empty_struct::XE` | help: there is a variant with a similar name | diff --git a/tests/ui/enum/enum-discriminant-missing-variant.rs b/tests/ui/enum/enum-discriminant-missing-variant.rs index 1bdbfb1fbcd42..45c2b37444345 100644 --- a/tests/ui/enum/enum-discriminant-missing-variant.rs +++ b/tests/ui/enum/enum-discriminant-missing-variant.rs @@ -1,6 +1,6 @@ //! regression test for issue pub enum SomeEnum { - B = SomeEnum::A, //~ ERROR no variant or associated item named `A` found + B = SomeEnum::A, //~ ERROR no variant, associated function, or constant named `A` found } fn main() {} diff --git a/tests/ui/enum/enum-discriminant-missing-variant.stderr b/tests/ui/enum/enum-discriminant-missing-variant.stderr index ef98a93e86f66..653a87a5ebd8b 100644 --- a/tests/ui/enum/enum-discriminant-missing-variant.stderr +++ b/tests/ui/enum/enum-discriminant-missing-variant.stderr @@ -1,10 +1,10 @@ -error[E0599]: no variant or associated item named `A` found for enum `SomeEnum` in the current scope +error[E0599]: no variant, associated function, or constant named `A` found for enum `SomeEnum` in the current scope --> $DIR/enum-discriminant-missing-variant.rs:3:19 | LL | pub enum SomeEnum { - | ----------------- variant or associated item `A` not found for this enum + | ----------------- variant, associated function, or constant `A` not found for this enum LL | B = SomeEnum::A, - | ^ variant or associated item not found in `SomeEnum` + | ^ variant, associated function, or constant not found in `SomeEnum` | help: there is a variant with a similar name | diff --git a/tests/ui/error-codes/E0599.stderr b/tests/ui/error-codes/E0599.stderr index 5c1c71d39f719..724bce4502b7e 100644 --- a/tests/ui/error-codes/E0599.stderr +++ b/tests/ui/error-codes/E0599.stderr @@ -1,11 +1,11 @@ -error[E0599]: no associated item named `NotEvenReal` found for struct `Foo` in the current scope +error[E0599]: no associated function or constant named `NotEvenReal` found for struct `Foo` in the current scope --> $DIR/E0599.rs:4:20 | LL | struct Foo; - | ---------- associated item `NotEvenReal` not found for this struct + | ---------- associated function or constant `NotEvenReal` not found for this struct ... LL | || if let Foo::NotEvenReal() = Foo {}; - | ^^^^^^^^^^^ associated item not found in `Foo` + | ^^^^^^^^^^^ associated function or constant not found in `Foo` error: aborting due to 1 previous error diff --git a/tests/ui/expr/issue-22933-2.rs b/tests/ui/expr/issue-22933-2.rs index dfd84b9a79d40..3f593cae6dfc9 100644 --- a/tests/ui/expr/issue-22933-2.rs +++ b/tests/ui/expr/issue-22933-2.rs @@ -2,7 +2,7 @@ enum Delicious { Pie = 0x1, Apple = 0x2, ApplePie = Delicious::Apple as isize | Delicious::PIE as isize, - //~^ ERROR no variant or associated item named `PIE` found + //~^ ERROR no variant, associated function, or constant named `PIE` found } fn main() {} diff --git a/tests/ui/expr/issue-22933-2.stderr b/tests/ui/expr/issue-22933-2.stderr index 07f095f643ee5..0b7416b77c048 100644 --- a/tests/ui/expr/issue-22933-2.stderr +++ b/tests/ui/expr/issue-22933-2.stderr @@ -1,11 +1,11 @@ -error[E0599]: no variant or associated item named `PIE` found for enum `Delicious` in the current scope +error[E0599]: no variant, associated function, or constant named `PIE` found for enum `Delicious` in the current scope --> $DIR/issue-22933-2.rs:4:55 | LL | enum Delicious { - | -------------- variant or associated item `PIE` not found for this enum + | -------------- variant, associated function, or constant `PIE` not found for this enum ... LL | ApplePie = Delicious::Apple as isize | Delicious::PIE as isize, - | ^^^ variant or associated item not found in `Delicious` + | ^^^ variant, associated function, or constant not found in `Delicious` | help: there is a variant with a similar name | diff --git a/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs b/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs index d7dff329df1e6..ec6dfb87f61bf 100644 --- a/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs +++ b/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs @@ -29,5 +29,5 @@ where fn main() { let mut list = RcNode::::new(); - //~^ ERROR the variant or associated item `new` exists for enum `Node`, but its trait bounds were not satisfied + //~^ ERROR the variant, associated function, or constant `new` exists for enum `Node`, but its trait bounds were not satisfied } diff --git a/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.stderr b/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.stderr index b31689dbf7365..674e28829073f 100644 --- a/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.stderr +++ b/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.stderr @@ -15,14 +15,14 @@ help: consider relaxing the implicit `Sized` restriction LL | type Pointer: Deref + ?Sized; | ++++++++ -error[E0599]: the variant or associated item `new` exists for enum `Node`, but its trait bounds were not satisfied +error[E0599]: the variant, associated function, or constant `new` exists for enum `Node`, but its trait bounds were not satisfied --> $DIR/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs:31:35 | LL | enum Node { - | ------------------------------ variant or associated item `new` not found for this enum + | ------------------------------ variant, associated function, or constant `new` not found for this enum ... LL | let mut list = RcNode::::new(); - | ^^^ variant or associated item cannot be called on `Node` due to unsatisfied trait bounds + | ^^^ variant, associated function, or constant cannot be called on `Node` due to unsatisfied trait bounds | note: trait bound `(dyn Deref> + 'static): Sized` was not satisfied --> $DIR/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs:23:29 diff --git a/tests/ui/impl-trait/issues/issue-62742.rs b/tests/ui/impl-trait/issues/issue-62742.rs index c64278c2c5bec..052917085abcb 100644 --- a/tests/ui/impl-trait/issues/issue-62742.rs +++ b/tests/ui/impl-trait/issues/issue-62742.rs @@ -2,7 +2,7 @@ use std::marker::PhantomData; fn a() { WrongImpl::foo(0i32); - //~^ ERROR the function or associated item `foo` exists for struct `SafeImpl<_, RawImpl<_>>`, but its trait bounds were not satisfied + //~^ ERROR the associated function or constant `foo` exists for struct `SafeImpl<_, RawImpl<_>>`, but its trait bounds were not satisfied //~| ERROR the trait bound `RawImpl<_>: Raw<_>` is not satisfied } diff --git a/tests/ui/impl-trait/issues/issue-62742.stderr b/tests/ui/impl-trait/issues/issue-62742.stderr index a1fedb8fb7b8b..4899a96aece65 100644 --- a/tests/ui/impl-trait/issues/issue-62742.stderr +++ b/tests/ui/impl-trait/issues/issue-62742.stderr @@ -16,17 +16,17 @@ note: required by a bound in `SafeImpl` LL | pub struct SafeImpl>(PhantomData<(A, T)>); | ^^^^^^ required by this bound in `SafeImpl` -error[E0599]: the function or associated item `foo` exists for struct `SafeImpl<_, RawImpl<_>>`, but its trait bounds were not satisfied +error[E0599]: the associated function or constant `foo` exists for struct `SafeImpl<_, RawImpl<_>>`, but its trait bounds were not satisfied --> $DIR/issue-62742.rs:4:16 | LL | WrongImpl::foo(0i32); - | ^^^ function or associated item cannot be called on `SafeImpl<_, RawImpl<_>>` due to unsatisfied trait bounds + | ^^^ associated function or constant cannot be called on `SafeImpl<_, RawImpl<_>>` due to unsatisfied trait bounds ... LL | pub struct RawImpl(PhantomData); | --------------------- doesn't satisfy `RawImpl<_>: Raw<_>` ... LL | pub struct SafeImpl>(PhantomData<(A, T)>); - | ----------------------------------------- function or associated item `foo` not found for this struct + | ----------------------------------------- associated function or constant `foo` not found for this struct | note: trait bound `RawImpl<_>: Raw<_>` was not satisfied --> $DIR/issue-62742.rs:35:20 @@ -60,17 +60,17 @@ note: required by a bound in `SafeImpl` LL | pub struct SafeImpl>(PhantomData<(A, T)>); | ^^^^^^ required by this bound in `SafeImpl` -error[E0599]: the function or associated item `foo` exists for struct `SafeImpl<(), RawImpl<()>>`, but its trait bounds were not satisfied +error[E0599]: the associated function or constant `foo` exists for struct `SafeImpl<(), RawImpl<()>>`, but its trait bounds were not satisfied --> $DIR/issue-62742.rs:10:22 | LL | WrongImpl::<()>::foo(0i32); - | ^^^ function or associated item cannot be called on `SafeImpl<(), RawImpl<()>>` due to unsatisfied trait bounds + | ^^^ associated function or constant cannot be called on `SafeImpl<(), RawImpl<()>>` due to unsatisfied trait bounds ... LL | pub struct RawImpl(PhantomData); | --------------------- doesn't satisfy `RawImpl<()>: Raw<()>` ... LL | pub struct SafeImpl>(PhantomData<(A, T)>); - | ----------------------------------------- function or associated item `foo` not found for this struct + | ----------------------------------------- associated function or constant `foo` not found for this struct | note: trait bound `RawImpl<()>: Raw<()>` was not satisfied --> $DIR/issue-62742.rs:35:20 diff --git a/tests/ui/invalid/invalid-path-in-const.rs b/tests/ui/invalid/invalid-path-in-const.rs index 51eb860721190..a3c622aa5a968 100644 --- a/tests/ui/invalid/invalid-path-in-const.rs +++ b/tests/ui/invalid/invalid-path-in-const.rs @@ -1,4 +1,4 @@ fn main() { fn f(a: [u8; u32::DOESNOTEXIST]) {} - //~^ ERROR no associated item named `DOESNOTEXIST` found for type `u32` + //~^ ERROR no associated function or constant named `DOESNOTEXIST` found for type `u32` } diff --git a/tests/ui/invalid/invalid-path-in-const.stderr b/tests/ui/invalid/invalid-path-in-const.stderr index 31528ab856e61..83c90a24d70bd 100644 --- a/tests/ui/invalid/invalid-path-in-const.stderr +++ b/tests/ui/invalid/invalid-path-in-const.stderr @@ -1,8 +1,8 @@ -error[E0599]: no associated item named `DOESNOTEXIST` found for type `u32` in the current scope +error[E0599]: no associated function or constant named `DOESNOTEXIST` found for type `u32` in the current scope --> $DIR/invalid-path-in-const.rs:2:23 | LL | fn f(a: [u8; u32::DOESNOTEXIST]) {} - | ^^^^^^^^^^^^ associated item not found in `u32` + | ^^^^^^^^^^^^ associated function or constant not found in `u32` error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-28586.rs b/tests/ui/issues/issue-28586.rs index c543ef9b0e3d8..9520e0e51a15a 100644 --- a/tests/ui/issues/issue-28586.rs +++ b/tests/ui/issues/issue-28586.rs @@ -2,6 +2,6 @@ pub trait Foo {} impl Foo for [u8; usize::BYTES] {} -//~^ ERROR no associated item named `BYTES` found +//~^ ERROR no associated function or constant named `BYTES` found fn main() { } diff --git a/tests/ui/issues/issue-28586.stderr b/tests/ui/issues/issue-28586.stderr index 33f40a341c8f0..dda147954facd 100644 --- a/tests/ui/issues/issue-28586.stderr +++ b/tests/ui/issues/issue-28586.stderr @@ -1,8 +1,8 @@ -error[E0599]: no associated item named `BYTES` found for type `usize` in the current scope +error[E0599]: no associated function or constant named `BYTES` found for type `usize` in the current scope --> $DIR/issue-28586.rs:4:26 | LL | impl Foo for [u8; usize::BYTES] {} - | ^^^^^ associated item not found in `usize` + | ^^^^^ associated function or constant not found in `usize` error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-28971.rs b/tests/ui/issues/issue-28971.rs index 8e7a2fe0ef209..e6a504f52e0cd 100644 --- a/tests/ui/issues/issue-28971.rs +++ b/tests/ui/issues/issue-28971.rs @@ -5,7 +5,7 @@ fn main(){ foo(|| { match Foo::Bar(1) { Foo::Baz(..) => (), - //~^ ERROR no variant or associated item named `Baz` found + //~^ ERROR no variant, associated function, or constant named `Baz` found _ => (), } }); diff --git a/tests/ui/issues/issue-28971.stderr b/tests/ui/issues/issue-28971.stderr index fd689a2b36eeb..de3fff0a49e30 100644 --- a/tests/ui/issues/issue-28971.stderr +++ b/tests/ui/issues/issue-28971.stderr @@ -1,11 +1,11 @@ -error[E0599]: no variant or associated item named `Baz` found for enum `Foo` in the current scope +error[E0599]: no variant, associated function, or constant named `Baz` found for enum `Foo` in the current scope --> $DIR/issue-28971.rs:7:18 | LL | enum Foo { - | -------- variant or associated item `Baz` not found for this enum + | -------- variant, associated function, or constant `Baz` not found for this enum ... LL | Foo::Baz(..) => (), - | ^^^ variant or associated item not found in `Foo` + | ^^^ variant, associated function, or constant not found in `Foo` | help: there is a variant with a similar name | diff --git a/tests/ui/issues/issue-30123.rs b/tests/ui/issues/issue-30123.rs index f6511b5f290d2..88fab44741f2e 100644 --- a/tests/ui/issues/issue-30123.rs +++ b/tests/ui/issues/issue-30123.rs @@ -5,5 +5,5 @@ use issue_30123_aux::*; fn main() { let ug = Graph::::new_undirected(); - //~^ ERROR no function or associated item named `new_undirected` found + //~^ ERROR no associated function or constant named `new_undirected` found } diff --git a/tests/ui/issues/issue-30123.stderr b/tests/ui/issues/issue-30123.stderr index 3ed1f34c44aaa..872c612473884 100644 --- a/tests/ui/issues/issue-30123.stderr +++ b/tests/ui/issues/issue-30123.stderr @@ -1,15 +1,15 @@ -error[E0599]: no function or associated item named `new_undirected` found for struct `issue_30123_aux::Graph` in the current scope +error[E0599]: no associated function or constant named `new_undirected` found for struct `issue_30123_aux::Graph` in the current scope --> $DIR/issue-30123.rs:7:33 | LL | let ug = Graph::::new_undirected(); - | ^^^^^^^^^^^^^^ function or associated item not found in `issue_30123_aux::Graph` + | ^^^^^^^^^^^^^^ associated function or constant not found in `issue_30123_aux::Graph` | note: if you're trying to build a new `issue_30123_aux::Graph`, consider using `issue_30123_aux::Graph::::new` which returns `issue_30123_aux::Graph<_, _>` --> $DIR/auxiliary/issue-30123-aux.rs:14:5 | LL | pub fn new() -> Self { | ^^^^^^^^^^^^^^^^^^^^ - = note: the function or associated item was found for + = note: the associated function or constant was found for - `issue_30123_aux::Graph` error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-42880.rs b/tests/ui/issues/issue-42880.rs index b61ba80e27abd..36d15fc35b48a 100644 --- a/tests/ui/issues/issue-42880.rs +++ b/tests/ui/issues/issue-42880.rs @@ -1,7 +1,7 @@ type Value = String; fn main() { - let f = |&Value::String(_)| (); //~ ERROR no associated item named + let f = |&Value::String(_)| (); //~ ERROR no associated function or constant named let vec: Vec = Vec::new(); vec.last().map(f); diff --git a/tests/ui/issues/issue-42880.stderr b/tests/ui/issues/issue-42880.stderr index f174f42b2398f..8743b1cfdef77 100644 --- a/tests/ui/issues/issue-42880.stderr +++ b/tests/ui/issues/issue-42880.stderr @@ -1,8 +1,8 @@ -error[E0599]: no associated item named `String` found for struct `String` in the current scope +error[E0599]: no associated function or constant named `String` found for struct `String` in the current scope --> $DIR/issue-42880.rs:4:22 | LL | let f = |&Value::String(_)| (); - | ^^^^^^ associated item not found in `String` + | ^^^^^^ associated function or constant not found in `String` error: aborting due to 1 previous error diff --git a/tests/ui/let-else/let-else-no-double-error.rs b/tests/ui/let-else/let-else-no-double-error.rs index 91fcc5d7e91e8..7b695595483fc 100644 --- a/tests/ui/let-else/let-else-no-double-error.rs +++ b/tests/ui/let-else/let-else-no-double-error.rs @@ -8,5 +8,5 @@ fn main() { let foo = 22; - let u32::XXX = foo else { return }; //~ ERROR: no associated item named `XXX` found for type `u32` in the current scope [E0599] + let u32::XXX = foo else { return }; //~ ERROR: no associated function or constant named `XXX` found for type `u32` in the current scope [E0599] } diff --git a/tests/ui/let-else/let-else-no-double-error.stderr b/tests/ui/let-else/let-else-no-double-error.stderr index 05668a23138ea..4fd6a14ca911a 100644 --- a/tests/ui/let-else/let-else-no-double-error.stderr +++ b/tests/ui/let-else/let-else-no-double-error.stderr @@ -1,8 +1,8 @@ -error[E0599]: no associated item named `XXX` found for type `u32` in the current scope +error[E0599]: no associated function or constant named `XXX` found for type `u32` in the current scope --> $DIR/let-else-no-double-error.rs:11:14 | LL | let u32::XXX = foo else { return }; - | ^^^ associated item not found in `u32` + | ^^^ associated function or constant not found in `u32` error: aborting due to 1 previous error diff --git a/tests/ui/methods/ident-from-macro-expansion.rs b/tests/ui/methods/ident-from-macro-expansion.rs index 38d2fee0e53c0..2bdf5fc17b14d 100644 --- a/tests/ui/methods/ident-from-macro-expansion.rs +++ b/tests/ui/methods/ident-from-macro-expansion.rs @@ -14,5 +14,5 @@ fn main() { dot!(hello); //~^ ERROR no method named `hello` found for unit type `()` in the current scope dispatch!(hello); - //~^ ERROR no function or associated item named `hello` found for unit type `()` in the current scope + //~^ ERROR no associated function or constant named `hello` found for unit type `()` in the current scope } diff --git a/tests/ui/methods/ident-from-macro-expansion.stderr b/tests/ui/methods/ident-from-macro-expansion.stderr index b596ce29f6fee..5fc8be865c4a9 100644 --- a/tests/ui/methods/ident-from-macro-expansion.stderr +++ b/tests/ui/methods/ident-from-macro-expansion.stderr @@ -7,14 +7,14 @@ LL | ().$id(); LL | dot!(hello); | ^^^^^ method not found in `()` -error[E0599]: no function or associated item named `hello` found for unit type `()` in the current scope +error[E0599]: no associated function or constant named `hello` found for unit type `()` in the current scope --> $DIR/ident-from-macro-expansion.rs:16:15 | LL | <()>::$id(); | --- due to this macro variable ... LL | dispatch!(hello); - | ^^^^^ function or associated item not found in `()` + | ^^^^^ associated function or constant not found in `()` error: aborting due to 2 previous errors diff --git a/tests/ui/methods/issue-7950.rs b/tests/ui/methods/issue-7950.rs index d3dcb3380bbcc..d87618a15ef36 100644 --- a/tests/ui/methods/issue-7950.rs +++ b/tests/ui/methods/issue-7950.rs @@ -4,5 +4,5 @@ struct Foo; fn main() { Foo::bar(); - //~^ ERROR no function or associated item named `bar` found for struct `Foo` + //~^ ERROR no associated function or constant named `bar` found for struct `Foo` } diff --git a/tests/ui/methods/issue-7950.stderr b/tests/ui/methods/issue-7950.stderr index 80504c070a3c4..84e6dfee77577 100644 --- a/tests/ui/methods/issue-7950.stderr +++ b/tests/ui/methods/issue-7950.stderr @@ -1,11 +1,11 @@ -error[E0599]: no function or associated item named `bar` found for struct `Foo` in the current scope +error[E0599]: no associated function or constant named `bar` found for struct `Foo` in the current scope --> $DIR/issue-7950.rs:6:10 | LL | struct Foo; - | ---------- function or associated item `bar` not found for this struct + | ---------- associated function or constant `bar` not found for this struct ... LL | Foo::bar(); - | ^^^ function or associated item not found in `Foo` + | ^^^ associated function or constant not found in `Foo` error: aborting due to 1 previous error diff --git a/tests/ui/methods/missing-method-on-type-parameter.stderr b/tests/ui/methods/missing-method-on-type-parameter.stderr index 0b58fbfa4af11..0289904effa3b 100644 --- a/tests/ui/methods/missing-method-on-type-parameter.stderr +++ b/tests/ui/methods/missing-method-on-type-parameter.stderr @@ -1,10 +1,10 @@ -error[E0599]: no function or associated item named `try_from` found for type parameter `T` in the current scope +error[E0599]: no associated function or constant named `try_from` found for type parameter `T` in the current scope --> $DIR/missing-method-on-type-parameter.rs:4:8 | LL | fn x() { - | - function or associated item `try_from` not found for this type parameter + | - associated function or constant `try_from` not found for this type parameter LL | T::try_from(); - | ^^^^^^^^ function or associated item not found in `T` + | ^^^^^^^^ associated function or constant not found in `T` | = help: items from traits can only be used if the trait is in scope help: there is an associated function `from` with a similar name diff --git a/tests/ui/methods/receiver-equality.rs b/tests/ui/methods/receiver-equality.rs index 891435a425eb9..d409edc864afc 100644 --- a/tests/ui/methods/receiver-equality.rs +++ b/tests/ui/methods/receiver-equality.rs @@ -10,7 +10,7 @@ impl B { fn foo(y: B) { B:: fn(&'a ())>::method(y); - //~^ ERROR no function or associated item named `method` found + //~^ ERROR no associated function or constant named `method` found } fn main() {} diff --git a/tests/ui/methods/receiver-equality.stderr b/tests/ui/methods/receiver-equality.stderr index bf149cc2eb4d7..9dd4d71c367b0 100644 --- a/tests/ui/methods/receiver-equality.stderr +++ b/tests/ui/methods/receiver-equality.stderr @@ -1,11 +1,11 @@ -error[E0599]: no function or associated item named `method` found for struct `B fn(&'a ())>` in the current scope +error[E0599]: no associated function or constant named `method` found for struct `B fn(&'a ())>` in the current scope --> $DIR/receiver-equality.rs:12:30 | LL | struct B(T); - | ----------- function or associated item `method` not found for this struct + | ----------- associated function or constant `method` not found for this struct ... LL | B:: fn(&'a ())>::method(y); - | ^^^^^^ function or associated item not found in `B fn(&'a ())>` + | ^^^^^^ associated function or constant not found in `B fn(&'a ())>` error: aborting due to 1 previous error diff --git a/tests/ui/nll/issue-57362-2.rs b/tests/ui/nll/issue-57362-2.rs index 664cdf89a3886..1f723be6794b5 100644 --- a/tests/ui/nll/issue-57362-2.rs +++ b/tests/ui/nll/issue-57362-2.rs @@ -21,7 +21,7 @@ impl<'a> X for fn(&'a ()) { // FIXME(@compiler-errors): This error message is less than helpful. fn g() { let x = ::make_g(); - //~^ ERROR no function or associated item named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope + //~^ ERROR no associated function or constant named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope } fn main() {} diff --git a/tests/ui/nll/issue-57362-2.stderr b/tests/ui/nll/issue-57362-2.stderr index 8a1a4d6b22c1e..1b962b16bdc8f 100644 --- a/tests/ui/nll/issue-57362-2.stderr +++ b/tests/ui/nll/issue-57362-2.stderr @@ -1,8 +1,8 @@ -error[E0599]: no function or associated item named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope +error[E0599]: no associated function or constant named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope --> $DIR/issue-57362-2.rs:23:25 | LL | let x = ::make_g(); - | ^^^^^^ function or associated item not found in `for<'a> fn(&'a ())` + | ^^^^^^ associated function or constant not found in `for<'a> fn(&'a ())` | = help: items from traits can only be used if the trait is implemented and in scope note: `X` defines an item `make_g`, perhaps you need to implement it diff --git a/tests/ui/nll/issue-57642-higher-ranked-subtype.rs b/tests/ui/nll/issue-57642-higher-ranked-subtype.rs index 69187cab34227..059a2beb92f46 100644 --- a/tests/ui/nll/issue-57642-higher-ranked-subtype.rs +++ b/tests/ui/nll/issue-57642-higher-ranked-subtype.rs @@ -29,11 +29,12 @@ impl Y for fn(T) { fn higher_ranked_region_has_lost_its_binder() { let x = ::make_g(); - //~^ ERROR no function or associated item named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope + //~^ ERROR no associated function or constant named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope } fn magical() { - let x = ::make_f(); //~ ERROR no function + let x = ::make_f(); + //~^ ERROR no associated function or constant named `make_f` found for fn pointer `for<'a> fn(&'a ())` in the current scope } fn main() {} diff --git a/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr b/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr index 27a887e860047..0a56d1bc72031 100644 --- a/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr +++ b/tests/ui/nll/issue-57642-higher-ranked-subtype.stderr @@ -1,8 +1,8 @@ -error[E0599]: no function or associated item named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope +error[E0599]: no associated function or constant named `make_g` found for fn pointer `for<'a> fn(&'a ())` in the current scope --> $DIR/issue-57642-higher-ranked-subtype.rs:31:25 | LL | let x = ::make_g(); - | ^^^^^^ function or associated item not found in `for<'a> fn(&'a ())` + | ^^^^^^ associated function or constant not found in `for<'a> fn(&'a ())` | = help: items from traits can only be used if the trait is implemented and in scope note: `X` defines an item `make_g`, perhaps you need to implement it @@ -11,11 +11,11 @@ note: `X` defines an item `make_g`, perhaps you need to implement it LL | trait X { | ^^^^^^^ -error[E0599]: no function or associated item named `make_f` found for fn pointer `for<'a> fn(&'a ())` in the current scope +error[E0599]: no associated function or constant named `make_f` found for fn pointer `for<'a> fn(&'a ())` in the current scope --> $DIR/issue-57642-higher-ranked-subtype.rs:36:25 | LL | let x = ::make_f(); - | ^^^^^^ function or associated item not found in `for<'a> fn(&'a ())` + | ^^^^^^ associated function or constant not found in `for<'a> fn(&'a ())` | = help: items from traits can only be used if the trait is implemented and in scope note: `Y` defines an item `make_f`, perhaps you need to implement it diff --git a/tests/ui/parallel-rustc/ty-variance-issue-124423.rs b/tests/ui/parallel-rustc/ty-variance-issue-124423.rs index 8d7f29f77641b..501b0fca7bf5e 100644 --- a/tests/ui/parallel-rustc/ty-variance-issue-124423.rs +++ b/tests/ui/parallel-rustc/ty-variance-issue-124423.rs @@ -43,7 +43,7 @@ fn x<'b>(_: &'a impl Copy + 'a) -> Box { Box::u32(x) } //~| ERROR use of undeclared lifetime name `'a` //~| ERROR use of undeclared lifetime name `'a` //~| ERROR at least one trait is required for an object type -//~| ERROR no function or associated item named `u32` found for struct `Box<_, _>` in the current scope +//~| ERROR no associated function or constant named `u32` found for struct `Box<_, _>` in the current scope fn elided4(_: &impl Copy + 'a) -> new { x(x) } //~^ ERROR ambiguous `+` in a type diff --git a/tests/ui/parallel-rustc/ty-variance-issue-124423.stderr b/tests/ui/parallel-rustc/ty-variance-issue-124423.stderr index bf9ad85dfc5c6..b22650cc49461 100644 --- a/tests/ui/parallel-rustc/ty-variance-issue-124423.stderr +++ b/tests/ui/parallel-rustc/ty-variance-issue-124423.stderr @@ -267,11 +267,9 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures LL | fn elided(_: &impl Copy + 'a) -> _ { x } | ^ not allowed in type signatures -error[E0599]: no function or associated item named `u32` found for struct `Box<_, _>` in the current scope --> $DIR/ty-variance-issue-124423.rs:41:55 | LL | fn x<'b>(_: &'a impl Copy + 'a) -> Box { Box::u32(x) } - | ^^^ function or associated item not found in `Box<_, _>` | note: if you're trying to build a new `Box<_, _>` consider using one of the following associated functions: Box::::new @@ -283,4 +281,4 @@ note: if you're trying to build a new `Box<_, _>` consider using one of the foll error: aborting due to 30 previous errors Some errors have detailed explanations: E0121, E0224, E0261, E0425, E0599. -For more information about an error, try `rustc --explain E0121`. +For more information about an error, try `rustc --explain E0121`. \ No newline at end of file diff --git a/tests/ui/parallel-rustc/ty-variance-issue-127971.rs b/tests/ui/parallel-rustc/ty-variance-issue-127971.rs index a17916843e70a..db2dc8e4c8567 100644 --- a/tests/ui/parallel-rustc/ty-variance-issue-127971.rs +++ b/tests/ui/parallel-rustc/ty-variance-issue-127971.rs @@ -20,6 +20,6 @@ fn x<'b>(_: &'a impl Copy + 'a) -> Box { Box::u32(x) } //~| ERROR use of undeclared lifetime name `'a` //~| ERROR use of undeclared lifetime name `'a` //~| ERROR at least one trait is required for an object type -//~| ERROR no function or associated item named `u32` found for struct `Box<_, _>` in the current scope +//~| ERROR no associated function or constant named `u32` found for struct `Box<_, _>` in the current scope fn main() {} diff --git a/tests/ui/parallel-rustc/ty-variance-issue-127971.stderr b/tests/ui/parallel-rustc/ty-variance-issue-127971.stderr index 55d52d35f4a8d..170e2e105cee8 100644 --- a/tests/ui/parallel-rustc/ty-variance-issue-127971.stderr +++ b/tests/ui/parallel-rustc/ty-variance-issue-127971.stderr @@ -93,11 +93,9 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures LL | fn elided(_: &impl Copy + 'a) -> _ { x } | ^ not allowed in type signatures -error[E0599]: no function or associated item named `u32` found for struct `Box<_, _>` in the current scope --> $DIR/ty-variance-issue-127971.rs:18:55 | LL | fn x<'b>(_: &'a impl Copy + 'a) -> Box { Box::u32(x) } - | ^^^ function or associated item not found in `Box<_, _>` | note: if you're trying to build a new `Box<_, _>` consider using one of the following associated functions: Box::::new diff --git a/tests/ui/parser/emoji-identifiers.rs b/tests/ui/parser/emoji-identifiers.rs index b50c046bcb204..cbd2e54c55229 100644 --- a/tests/ui/parser/emoji-identifiers.rs +++ b/tests/ui/parser/emoji-identifiers.rs @@ -6,7 +6,7 @@ impl 👀 { } } fn i_like_to_😅_a_lot() -> 👀 { //~ ERROR identifiers cannot contain emoji - 👀::full_of✨() //~ ERROR no function or associated item named `full_of✨` found for struct `👀` + 👀::full_of✨() //~ ERROR no associated function or constant named `full_of✨` found for struct `👀` //~^ ERROR identifiers cannot contain emoji } fn main() { diff --git a/tests/ui/parser/emoji-identifiers.stderr b/tests/ui/parser/emoji-identifiers.stderr index 016ed0401caf8..a6532f9c51b00 100644 --- a/tests/ui/parser/emoji-identifiers.stderr +++ b/tests/ui/parser/emoji-identifiers.stderr @@ -65,14 +65,14 @@ LL | let 🦀 = 1; LL | dbg!(🦀); | ^^ -error[E0599]: no function or associated item named `full_of✨` found for struct `👀` in the current scope +error[E0599]: no associated function or constant named `full_of✨` found for struct `👀` in the current scope --> $DIR/emoji-identifiers.rs:9:8 | LL | struct 👀; - | --------- function or associated item `full_of✨` not found for this struct + | --------- associated function or constant `full_of✨` not found for this struct ... LL | 👀::full_of✨() - | ^^^^^^^^^ function or associated item not found in `👀` + | ^^^^^^^^^ associated function or constant not found in `👀` | note: if you're trying to build a new `👀`, consider using `👀::full_of_✨` which returns `👀` --> $DIR/emoji-identifiers.rs:4:5 diff --git a/tests/ui/pattern/pattern-match-invalid-variant.stderr b/tests/ui/pattern/pattern-match-invalid-variant.stderr index 08a99f696f6d6..94373afeb2e62 100644 --- a/tests/ui/pattern/pattern-match-invalid-variant.stderr +++ b/tests/ui/pattern/pattern-match-invalid-variant.stderr @@ -1,11 +1,11 @@ -error[E0599]: no variant or associated item named `Hsl` found for enum `Color` in the current scope +error[E0599]: no variant, associated function, or constant named `Hsl` found for enum `Color` in the current scope --> $DIR/pattern-match-invalid-variant.rs:14:16 | LL | enum Color { - | ---------- variant or associated item `Hsl` not found for this enum + | ---------- variant, associated function, or constant `Hsl` not found for this enum ... LL | Color::Hsl(h, s, l) => { - | ^^^ variant or associated item not found in `Color` + | ^^^ variant, associated function, or constant not found in `Color` error: aborting due to 1 previous error diff --git a/tests/ui/privacy/ufc-method-call.different_name.stderr b/tests/ui/privacy/ufc-method-call.different_name.stderr index 16496c480dd12..9b2ffa66c13e7 100644 --- a/tests/ui/privacy/ufc-method-call.different_name.stderr +++ b/tests/ui/privacy/ufc-method-call.different_name.stderr @@ -1,13 +1,13 @@ -error[E0599]: no function or associated item named `foo` found for struct `Foo` in the current scope +error[E0599]: no associated function or constant named `foo` found for struct `Foo` in the current scope --> $DIR/ufc-method-call.rs:27:27 | LL | pub struct Foo(T); - | ----------------- function or associated item `foo` not found for this struct + | ----------------- associated function or constant `foo` not found for this struct ... LL | test::Foo::::foo(); - | ^^^ function or associated item not found in `Foo` + | ^^^ associated function or constant not found in `Foo` | - = note: the function or associated item was found for + = note: the associated function or constant was found for - `Foo` error: aborting due to 1 previous error diff --git a/tests/ui/privacy/ufc-method-call.rs b/tests/ui/privacy/ufc-method-call.rs index 525d9a9eee904..87efbc79ea242 100644 --- a/tests/ui/privacy/ufc-method-call.rs +++ b/tests/ui/privacy/ufc-method-call.rs @@ -26,5 +26,5 @@ pub mod test { fn main() { test::Foo::::foo(); //[same_name]~^ ERROR associated function `foo` is private - //[different_name]~^^ ERROR no function or associated item named `foo` found for struct `Foo` + //[different_name]~^^ ERROR no associated function or constant named `foo` found for struct `Foo` } diff --git a/tests/ui/resolve/issue-82865.rs b/tests/ui/resolve/issue-82865.rs index 545ca63e0b82b..230725155d8aa 100644 --- a/tests/ui/resolve/issue-82865.rs +++ b/tests/ui/resolve/issue-82865.rs @@ -6,7 +6,7 @@ use x::y::z; //~ ERROR: cannot find module or crate `x` macro mac () { - Box::z //~ ERROR: no function or associated item + Box::z //~ ERROR: no associated function or constant } fn main() { diff --git a/tests/ui/resolve/issue-82865.stderr b/tests/ui/resolve/issue-82865.stderr index 90059ad5a9659..198f7f8e32aa4 100644 --- a/tests/ui/resolve/issue-82865.stderr +++ b/tests/ui/resolve/issue-82865.stderr @@ -9,11 +9,11 @@ help: you might be missing a crate named `x`, add it to your project and import LL + extern crate x; | -error[E0599]: no function or associated item named `z` found for struct `Box<_, _>` in the current scope +error[E0599]: no associated function or constant named `z` found for struct `Box<_, _>` in the current scope --> $DIR/issue-82865.rs:9:10 | LL | Box::z - | ^ function or associated item not found in `Box<_, _>` + | ^ associated function or constant not found in `Box<_, _>` ... LL | mac!(); | ------ in this macro invocation diff --git a/tests/ui/resolve/missing-associated-items.rs b/tests/ui/resolve/missing-associated-items.rs index 72d6cbb3f1497..1308ce5f592c3 100644 --- a/tests/ui/resolve/missing-associated-items.rs +++ b/tests/ui/resolve/missing-associated-items.rs @@ -14,8 +14,8 @@ fn use_token(token: &Token) { } fn main() { - use_token(&Token::Homura); //~ ERROR no variant or associated item named `Homura` - Struct::method(); //~ ERROR no function or associated item named `method` found - Struct::method; //~ ERROR no function or associated item named `method` found - Struct::Assoc; //~ ERROR no associated item named `Assoc` found + use_token(&Token::Homura); //~ ERROR no variant, associated function, or constant named `Homura` + Struct::method(); //~ ERROR no associated function or constant named `method` found + Struct::method; //~ ERROR no associated function or constant named `method` found + Struct::Assoc; //~ ERROR no associated function or constant named `Assoc` found } diff --git a/tests/ui/resolve/missing-associated-items.stderr b/tests/ui/resolve/missing-associated-items.stderr index d27a3a644aee5..3bc63ded6bc8d 100644 --- a/tests/ui/resolve/missing-associated-items.stderr +++ b/tests/ui/resolve/missing-associated-items.stderr @@ -1,38 +1,38 @@ -error[E0599]: no variant or associated item named `Homura` found for enum `Token` in the current scope +error[E0599]: no variant, associated function, or constant named `Homura` found for enum `Token` in the current scope --> $DIR/missing-associated-items.rs:17:23 | LL | enum Token { - | ---------- variant or associated item `Homura` not found for this enum + | ---------- variant, associated function, or constant `Homura` not found for this enum ... LL | use_token(&Token::Homura); - | ^^^^^^ variant or associated item not found in `Token` + | ^^^^^^ variant, associated function, or constant not found in `Token` -error[E0599]: no function or associated item named `method` found for struct `Struct` in the current scope +error[E0599]: no associated function or constant named `method` found for struct `Struct` in the current scope --> $DIR/missing-associated-items.rs:18:13 | LL | struct Struct { - | ------------- function or associated item `method` not found for this struct + | ------------- associated function or constant `method` not found for this struct ... LL | Struct::method(); - | ^^^^^^ function or associated item not found in `Struct` + | ^^^^^^ associated function or constant not found in `Struct` -error[E0599]: no function or associated item named `method` found for struct `Struct` in the current scope +error[E0599]: no associated function or constant named `method` found for struct `Struct` in the current scope --> $DIR/missing-associated-items.rs:19:13 | LL | struct Struct { - | ------------- function or associated item `method` not found for this struct + | ------------- associated function or constant `method` not found for this struct ... LL | Struct::method; - | ^^^^^^ function or associated item not found in `Struct` + | ^^^^^^ associated function or constant not found in `Struct` -error[E0599]: no associated item named `Assoc` found for struct `Struct` in the current scope +error[E0599]: no associated function or constant named `Assoc` found for struct `Struct` in the current scope --> $DIR/missing-associated-items.rs:20:13 | LL | struct Struct { - | ------------- associated item `Assoc` not found for this struct + | ------------- associated function or constant `Assoc` not found for this struct ... LL | Struct::Assoc; - | ^^^^^ associated item not found in `Struct` + | ^^^^^ associated function or constant not found in `Struct` error: aborting due to 4 previous errors diff --git a/tests/ui/resolve/suggestions/suggest-builder-fn.rs b/tests/ui/resolve/suggestions/suggest-builder-fn.rs index 959675ef2c998..4552ed5382e9a 100644 --- a/tests/ui/resolve/suggestions/suggest-builder-fn.rs +++ b/tests/ui/resolve/suggestions/suggest-builder-fn.rs @@ -50,15 +50,15 @@ mod SomeMod { fn main() { // `new` not found on `TcpStream` and `connect` should be suggested let _stream = TcpStream::new(); - //~^ ERROR no function or associated item named `new` found + //~^ ERROR no associated function or constant named `new` found // Although `new` is found on `>` it should not be // suggested because `u8` does not meet the `T: SomeTrait` constraint let _foo = Foo::::new(); - //~^ ERROR the function or associated item `new` exists for struct `Foo`, but its trait bounds were not satisfied + //~^ ERROR the associated function or constant `new` exists for struct `Foo`, but its trait bounds were not satisfied // Should suggest only `::build()` and `SomeMod::::build_public()`. // Other methods should not suggested because they are private or are not a builder let _bar = Bar::new(); - //~^ ERROR no function or associated item named `new` found + //~^ ERROR no associated function or constant named `new` found } diff --git a/tests/ui/resolve/suggestions/suggest-builder-fn.stderr b/tests/ui/resolve/suggestions/suggest-builder-fn.stderr index 9c5eed35ccff1..1eabb8effac9b 100644 --- a/tests/ui/resolve/suggestions/suggest-builder-fn.stderr +++ b/tests/ui/resolve/suggestions/suggest-builder-fn.stderr @@ -1,22 +1,22 @@ -error[E0599]: no function or associated item named `new` found for struct `TcpStream` in the current scope +error[E0599]: no associated function or constant named `new` found for struct `TcpStream` in the current scope --> $DIR/suggest-builder-fn.rs:52:29 | LL | let _stream = TcpStream::new(); - | ^^^ function or associated item not found in `TcpStream` + | ^^^ associated function or constant not found in `TcpStream` | note: if you're trying to build a new `TcpStream` consider using one of the following associated functions: TcpStream::connect TcpStream::connect_timeout --> $SRC_DIR/std/src/net/tcp.rs:LL:COL -error[E0599]: the function or associated item `new` exists for struct `Foo`, but its trait bounds were not satisfied +error[E0599]: the associated function or constant `new` exists for struct `Foo`, but its trait bounds were not satisfied --> $DIR/suggest-builder-fn.rs:57:27 | LL | struct Foo { - | ------------- function or associated item `new` not found for this struct + | ------------- associated function or constant `new` not found for this struct ... LL | let _foo = Foo::::new(); - | ^^^ function or associated item cannot be called on `Foo` due to unsatisfied trait bounds + | ^^^ associated function or constant cannot be called on `Foo` due to unsatisfied trait bounds | note: trait bound `u8: SomeTrait` was not satisfied --> $DIR/suggest-builder-fn.rs:12:9 @@ -26,14 +26,14 @@ LL | impl Foo { | | | unsatisfied trait bound introduced here -error[E0599]: no function or associated item named `new` found for struct `Bar` in the current scope +error[E0599]: no associated function or constant named `new` found for struct `Bar` in the current scope --> $DIR/suggest-builder-fn.rs:62:21 | LL | struct Bar; - | ---------- function or associated item `new` not found for this struct + | ---------- associated function or constant `new` not found for this struct ... LL | let _bar = Bar::new(); - | ^^^ function or associated item not found in `Bar` + | ^^^ associated function or constant not found in `Bar` | note: if you're trying to build a new `Bar` consider using one of the following associated functions: Bar::build diff --git a/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs b/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs index 706564dc9b212..dfbb8f1e0a511 100644 --- a/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs +++ b/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs @@ -1,5 +1,5 @@ struct Struct; -//~^ NOTE function or associated item `fob` not found for this struct +//~^ NOTE associated function or constant `fob` not found for this struct impl Struct { fn foo() { } @@ -21,8 +21,8 @@ trait Trait { fn main() { Struct::fob(); - //~^ ERROR no function or associated item named `fob` found for struct `Struct` in the current scope - //~| NOTE function or associated item not found in `Struct` + //~^ ERROR no associated function or constant named `fob` found for struct `Struct` in the current scope + //~| NOTE associated function or constant not found in `Struct` Struc::foo(); //~^ ERROR cannot find type `Struc` diff --git a/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr b/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr index b1afa703eb039..98412559d666f 100644 --- a/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr +++ b/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr @@ -9,14 +9,14 @@ help: a struct with a similar name exists LL | module::Struct::foo(); | + -error[E0599]: no function or associated item named `fob` found for struct `Struct` in the current scope +error[E0599]: no associated function or constant named `fob` found for struct `Struct` in the current scope --> $DIR/typo-suggestion-mistyped-in-path.rs:23:13 | LL | struct Struct; - | ------------- function or associated item `fob` not found for this struct + | ------------- associated function or constant `fob` not found for this struct ... LL | Struct::fob(); - | ^^^ function or associated item not found in `Struct` + | ^^^ associated function or constant not found in `Struct` | help: there is an associated function `foo` with a similar name | diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.rs index 46fdfd678cc6d..c54f08e9256f6 100644 --- a/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.rs +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.rs @@ -5,7 +5,7 @@ fn main() { let foo = 22; match foo { - u32::XXX => { } //~ ERROR no associated item named + u32::XXX => { } //~ ERROR no associated function or constant named _ => { } } } diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.stderr index 6000507c58974..51b08cde6eb0d 100644 --- a/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.stderr +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.stderr @@ -1,8 +1,8 @@ -error[E0599]: no associated item named `XXX` found for type `u32` in the current scope +error[E0599]: no associated function or constant named `XXX` found for type `u32` in the current scope --> $DIR/no-double-error.rs:8:14 | LL | u32::XXX => { } - | ^^^ associated item not found in `u32` + | ^^^ associated function or constant not found in `u32` error: aborting due to 1 previous error diff --git a/tests/ui/rust-2018/trait-import-suggestions.rs b/tests/ui/rust-2018/trait-import-suggestions.rs index 5a5eeacedfcc5..dce01de8c894e 100644 --- a/tests/ui/rust-2018/trait-import-suggestions.rs +++ b/tests/ui/rust-2018/trait-import-suggestions.rs @@ -27,5 +27,5 @@ fn main() { let x: u32 = 22; x.bar(); //~ ERROR no method named `bar` x.baz(); //~ ERROR no method named `baz` - let y = u32::from_str("33"); //~ ERROR no function or associated item named `from_str` + let y = u32::from_str("33"); //~ ERROR no associated function or constant named `from_str` } diff --git a/tests/ui/rust-2018/trait-import-suggestions.stderr b/tests/ui/rust-2018/trait-import-suggestions.stderr index 488044ee85245..721ba0c50d783 100644 --- a/tests/ui/rust-2018/trait-import-suggestions.stderr +++ b/tests/ui/rust-2018/trait-import-suggestions.stderr @@ -49,11 +49,11 @@ LL - x.baz(); LL + x.bar(); | -error[E0599]: no function or associated item named `from_str` found for type `u32` in the current scope +error[E0599]: no associated function or constant named `from_str` found for type `u32` in the current scope --> $DIR/trait-import-suggestions.rs:30:18 | LL | let y = u32::from_str("33"); - | ^^^^^^^^ function or associated item not found in `u32` + | ^^^^^^^^ associated function or constant not found in `u32` | = help: items from traits can only be used if the trait is in scope help: trait `FromStr` which provides `from_str` is implemented but not in scope; perhaps you want to import it diff --git a/tests/ui/rust-2018/uniform-paths/issue-87932.rs b/tests/ui/rust-2018/uniform-paths/issue-87932.rs index d24d4b8b4820b..cde7fe7a8ea6f 100644 --- a/tests/ui/rust-2018/uniform-paths/issue-87932.rs +++ b/tests/ui/rust-2018/uniform-paths/issue-87932.rs @@ -11,5 +11,5 @@ impl issue_87932_a::Deserialize for A { fn main() { A::deserialize(); - //~^ ERROR no function or associated item named `deserialize` found for struct `A` + //~^ ERROR no associated function or constant named `deserialize` found for struct `A` } diff --git a/tests/ui/rust-2018/uniform-paths/issue-87932.stderr b/tests/ui/rust-2018/uniform-paths/issue-87932.stderr index 3e6fc3ff2a562..c408b747b506f 100644 --- a/tests/ui/rust-2018/uniform-paths/issue-87932.stderr +++ b/tests/ui/rust-2018/uniform-paths/issue-87932.stderr @@ -1,11 +1,11 @@ -error[E0599]: no function or associated item named `deserialize` found for struct `A` in the current scope +error[E0599]: no associated function or constant named `deserialize` found for struct `A` in the current scope --> $DIR/issue-87932.rs:13:8 | LL | pub struct A {} - | ------------ function or associated item `deserialize` not found for this struct + | ------------ associated function or constant `deserialize` not found for this struct ... LL | A::deserialize(); - | ^^^^^^^^^^^ function or associated item not found in `A` + | ^^^^^^^^^^^ associated function or constant not found in `A` | = help: items from traits can only be used if the trait is in scope help: trait `Deserialize` which provides `deserialize` is implemented but not in scope; perhaps you want to import it diff --git a/tests/ui/shadowed/shadowing-generic-item.rs b/tests/ui/shadowed/shadowing-generic-item.rs index c3a0ced04e7f0..8a81530aab423 100644 --- a/tests/ui/shadowed/shadowing-generic-item.rs +++ b/tests/ui/shadowed/shadowing-generic-item.rs @@ -9,7 +9,7 @@ mod Foo { pub fn f() {} } fn g() { - Foo::f(); //~ ERROR no function or associated item named `f` + Foo::f(); //~ ERROR no associated function or constant named `f` } fn main() {} diff --git a/tests/ui/shadowed/shadowing-generic-item.stderr b/tests/ui/shadowed/shadowing-generic-item.stderr index 55a0bb36ea80b..eb517b1a9cdb2 100644 --- a/tests/ui/shadowed/shadowing-generic-item.stderr +++ b/tests/ui/shadowed/shadowing-generic-item.stderr @@ -8,13 +8,13 @@ LL | fn f() { LL | let t = T { i: 0 }; | ^ not a struct, variant or union type -error[E0599]: no function or associated item named `f` found for type parameter `Foo` in the current scope +error[E0599]: no associated function or constant named `f` found for type parameter `Foo` in the current scope --> $DIR/shadowing-generic-item.rs:12:10 | LL | fn g() { - | --- function or associated item `f` not found for this type parameter + | --- associated function or constant `f` not found for this type parameter LL | Foo::f(); - | ^ function or associated item not found in `Foo` + | ^ associated function or constant not found in `Foo` error: aborting due to 2 previous errors diff --git a/tests/ui/stdlib-unit-tests/atomic-from-mut-not-available.rs b/tests/ui/stdlib-unit-tests/atomic-from-mut-not-available.rs index 519b6977dcb56..b7c7f0ed98241 100644 --- a/tests/ui/stdlib-unit-tests/atomic-from-mut-not-available.rs +++ b/tests/ui/stdlib-unit-tests/atomic-from-mut-not-available.rs @@ -22,6 +22,6 @@ fn main() { core::sync::atomic::AtomicU64::from_mut(&mut 0u64); - //[alignment_mismatch]~^ ERROR no function or associated item named `from_mut` found for struct `Atomic` + //[alignment_mismatch]~^ ERROR no associated function or constant named `from_mut` found for struct `Atomic` //[alignment_matches]~^^ ERROR use of unstable library feature `atomic_from_mut` } diff --git a/tests/ui/suggestions/deref-path-method.rs b/tests/ui/suggestions/deref-path-method.rs index 0281cdb6b37cf..d44b3bd703057 100644 --- a/tests/ui/suggestions/deref-path-method.rs +++ b/tests/ui/suggestions/deref-path-method.rs @@ -1,6 +1,6 @@ fn main() { let vec = Vec::new(); Vec::contains(&vec, &0); - //~^ ERROR no function or associated item named `contains` found for struct `Vec<_, _>` in the current scope + //~^ ERROR no associated function or constant named `contains` found for struct `Vec<_, _>` in the current scope //~| HELP the function `contains` is implemented on `[_]` } diff --git a/tests/ui/suggestions/deref-path-method.stderr b/tests/ui/suggestions/deref-path-method.stderr index 0dec424555ed5..8cf8ec9146d74 100644 --- a/tests/ui/suggestions/deref-path-method.stderr +++ b/tests/ui/suggestions/deref-path-method.stderr @@ -1,8 +1,8 @@ -error[E0599]: no function or associated item named `contains` found for struct `Vec<_, _>` in the current scope +error[E0599]: no associated function or constant named `contains` found for struct `Vec<_, _>` in the current scope --> $DIR/deref-path-method.rs:3:10 | LL | Vec::contains(&vec, &0); - | ^^^^^^^^ function or associated item not found in `Vec<_, _>` + | ^^^^^^^^ associated function or constant not found in `Vec<_, _>` | note: if you're trying to build a new `Vec<_, _>` consider using one of the following associated functions: Vec::::new diff --git a/tests/ui/suggestions/dont-suggest-private-trait-method.rs b/tests/ui/suggestions/dont-suggest-private-trait-method.rs index 6e2b1abd1370f..6a220b01f1957 100644 --- a/tests/ui/suggestions/dont-suggest-private-trait-method.rs +++ b/tests/ui/suggestions/dont-suggest-private-trait-method.rs @@ -2,5 +2,5 @@ struct T; fn main() { T::new(); - //~^ ERROR no function or associated item named `new` found + //~^ ERROR no associated function or constant named `new` found } diff --git a/tests/ui/suggestions/dont-suggest-private-trait-method.stderr b/tests/ui/suggestions/dont-suggest-private-trait-method.stderr index f251ad59a587b..b53a8279dfeac 100644 --- a/tests/ui/suggestions/dont-suggest-private-trait-method.stderr +++ b/tests/ui/suggestions/dont-suggest-private-trait-method.stderr @@ -1,11 +1,11 @@ -error[E0599]: no function or associated item named `new` found for struct `T` in the current scope +error[E0599]: no associated function or constant named `new` found for struct `T` in the current scope --> $DIR/dont-suggest-private-trait-method.rs:4:8 | LL | struct T; - | -------- function or associated item `new` not found for this struct + | -------- associated function or constant `new` not found for this struct ... LL | T::new(); - | ^^^ function or associated item not found in `T` + | ^^^ associated function or constant not found in `T` error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/incorrect-variant-literal.svg b/tests/ui/suggestions/incorrect-variant-literal.svg index d2c1f6c95ca58..54eaee2a2e906 100644 --- a/tests/ui/suggestions/incorrect-variant-literal.svg +++ b/tests/ui/suggestions/incorrect-variant-literal.svg @@ -1,4 +1,4 @@ - + (I); - | ------------- function or associated item `f` not found for this struct + | ------------- associated function or constant `f` not found for this struct ... LL | Foo::<()>::f() - | ^ function or associated item cannot be called on `Foo<()>` due to unsatisfied trait bounds + | ^ associated function or constant cannot be called on `Foo<()>` due to unsatisfied trait bounds | note: trait bound `(): Iterator` was not satisfied --> $DIR/issue-108132-unmet-trait-alias-bound-on-generic-impl.rs:5:23 diff --git a/tests/ui/traits/associated-item-unsatisfied-trait-bounds.stderr b/tests/ui/traits/associated-item-unsatisfied-trait-bounds.stderr index 42969de715eb7..f26c321a2973c 100644 --- a/tests/ui/traits/associated-item-unsatisfied-trait-bounds.stderr +++ b/tests/ui/traits/associated-item-unsatisfied-trait-bounds.stderr @@ -1,11 +1,11 @@ -error[E0599]: the function or associated item `bat` exists for struct `Foo`, but its trait bounds were not satisfied +error[E0599]: the associated function or constant `bat` exists for struct `Foo`, but its trait bounds were not satisfied --> $DIR/associated-item-unsatisfied-trait-bounds.rs:8:10 | LL | struct Foo; - | ---------- function or associated item `bat` not found for this struct because `Foo` doesn't implement `Bar` or `Baz` + | ---------- associated function or constant `bat` not found for this struct because `Foo` doesn't implement `Bar` or `Baz` ... LL | Foo::bat(()); - | ^^^ function or associated item cannot be called on `Foo` due to unsatisfied trait bounds + | ^^^ associated function or constant cannot be called on `Foo` due to unsatisfied trait bounds | note: for `bat` to be available, `Foo` must implement `Bar` and `Baz` --> $DIR/associated-item-unsatisfied-trait-bounds.rs:5:38 diff --git a/tests/ui/traits/issue-3973.rs b/tests/ui/traits/issue-3973.rs index a5ed5b87051e7..96e581c169f35 100644 --- a/tests/ui/traits/issue-3973.rs +++ b/tests/ui/traits/issue-3973.rs @@ -20,6 +20,6 @@ impl ToString_ for Point { fn main() { let p = Point::new(0.0, 0.0); - //~^ ERROR no function or associated item named `new` found for struct `Point` + //~^ ERROR no associated function or constant named `new` found for struct `Point` println!("{}", p.to_string()); } diff --git a/tests/ui/traits/issue-3973.stderr b/tests/ui/traits/issue-3973.stderr index 87ee08049300f..9da3617c05b6a 100644 --- a/tests/ui/traits/issue-3973.stderr +++ b/tests/ui/traits/issue-3973.stderr @@ -7,14 +7,14 @@ LL | | Point { x: x, y: y } LL | | } | |_____^ not a member of trait `ToString_` -error[E0599]: no function or associated item named `new` found for struct `Point` in the current scope +error[E0599]: no associated function or constant named `new` found for struct `Point` in the current scope --> $DIR/issue-3973.rs:22:20 | LL | struct Point { - | ------------ function or associated item `new` not found for this struct + | ------------ associated function or constant `new` not found for this struct ... LL | let p = Point::new(0.0, 0.0); - | ^^^ function or associated item not found in `Point` + | ^^^ associated function or constant not found in `Point` error: aborting due to 2 previous errors diff --git a/tests/ui/traits/item-privacy.rs b/tests/ui/traits/item-privacy.rs index 44ba87642371a..519a95c5c7856 100644 --- a/tests/ui/traits/item-privacy.rs +++ b/tests/ui/traits/item-privacy.rs @@ -77,9 +77,9 @@ fn check_method() { // Methods, UFCS // a, b, c are resolved as trait items, their traits need to be in scope S::a(&S); - //~^ ERROR no function or associated item named `a` found + //~^ ERROR no associated function or constant named `a` found S::b(&S); - //~^ ERROR no function or associated item named `b` found + //~^ ERROR no associated function or constant named `b` found S::c(&S); // OK // a, b, c are resolved as inherent items, their traits don't need to be in scope ::a(&S); //~ ERROR method `a` is private @@ -95,8 +95,8 @@ fn check_assoc_const() { // Associated constants // A, B, C are resolved as trait items, their traits need to be in scope - S::A; //~ ERROR no associated item named `A` found - S::B; //~ ERROR no associated item named `B` found + S::A; //~ ERROR no associated function or constant named `A` found + S::B; //~ ERROR no associated function or constant named `B` found S::C; // OK // A, B, C are resolved as inherent items, their traits don't need to be in scope ::A; diff --git a/tests/ui/traits/item-privacy.stderr b/tests/ui/traits/item-privacy.stderr index 8c33bb6de200f..7b199542c961e 100644 --- a/tests/ui/traits/item-privacy.stderr +++ b/tests/ui/traits/item-privacy.stderr @@ -47,14 +47,14 @@ LL | fn a(&self) { } LL | c.a(); | ^ private method -error[E0599]: no function or associated item named `a` found for struct `S` in the current scope +error[E0599]: no associated function or constant named `a` found for struct `S` in the current scope --> $DIR/item-privacy.rs:79:8 | LL | struct S; - | -------- function or associated item `a` not found for this struct + | -------- associated function or constant `a` not found for this struct ... LL | S::a(&S); - | ^ function or associated item not found in `S` + | ^ associated function or constant not found in `S` | = help: items from traits can only be used if the trait is implemented and in scope = help: trait `method::A` which provides `a` is implemented but not reachable @@ -64,14 +64,14 @@ help: there is an associated constant `B` with a similar name LL | const B: u8 = 0; | ^^^^^^^^^^^ -error[E0599]: no function or associated item named `b` found for struct `S` in the current scope +error[E0599]: no associated function or constant named `b` found for struct `S` in the current scope --> $DIR/item-privacy.rs:81:8 | LL | struct S; - | -------- function or associated item `b` not found for this struct + | -------- associated function or constant `b` not found for this struct ... LL | S::b(&S); - | ^ function or associated item not found in `S` + | ^ associated function or constant not found in `S` | = help: items from traits can only be used if the trait is in scope help: there is an associated constant `B` with a similar name @@ -93,14 +93,14 @@ LL | fn a(&self) { } LL | ::a(&S); | ^ private method -error[E0599]: no associated item named `A` found for struct `S` in the current scope +error[E0599]: no associated function or constant named `A` found for struct `S` in the current scope --> $DIR/item-privacy.rs:98:8 | LL | struct S; - | -------- associated item `A` not found for this struct + | -------- associated function or constant `A` not found for this struct ... LL | S::A; - | ^ associated item not found in `S` + | ^ associated function or constant not found in `S` | = help: items from traits can only be used if the trait is implemented and in scope = help: trait `assoc_const::A` which provides `A` is implemented but not reachable @@ -110,14 +110,14 @@ LL - S::A; LL + S::B; | -error[E0599]: no associated item named `B` found for struct `S` in the current scope +error[E0599]: no associated function or constant named `B` found for struct `S` in the current scope --> $DIR/item-privacy.rs:99:8 | LL | struct S; - | -------- associated item `B` not found for this struct + | -------- associated function or constant `B` not found for this struct ... LL | S::B; - | ^ associated item not found in `S` + | ^ associated function or constant not found in `S` | = help: items from traits can only be used if the trait is in scope help: there is a method `b` with a similar name diff --git a/tests/ui/traits/unspecified-self-in-trait-ref.rs b/tests/ui/traits/unspecified-self-in-trait-ref.rs index f175a8e6dbdfc..fbc95e0443c5e 100644 --- a/tests/ui/traits/unspecified-self-in-trait-ref.rs +++ b/tests/ui/traits/unspecified-self-in-trait-ref.rs @@ -9,19 +9,19 @@ pub trait Bar { fn main() { let a = Foo::lol(); - //~^ ERROR no function or associated item named + //~^ ERROR no associated function or constant 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 + //~^ ERROR no associated function or constant 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 + //~^ ERROR no associated function or constant 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 + //~^ ERROR no associated function or constant named //~| WARN trait objects without an explicit `dyn` are deprecated //~| WARN this is accepted in the current edition let e = Bar::::lol(); diff --git a/tests/ui/traits/unspecified-self-in-trait-ref.stderr b/tests/ui/traits/unspecified-self-in-trait-ref.stderr index b7d78a3284e3c..e76187de81f4b 100644 --- a/tests/ui/traits/unspecified-self-in-trait-ref.stderr +++ b/tests/ui/traits/unspecified-self-in-trait-ref.stderr @@ -12,11 +12,11 @@ help: if this is a dyn-compatible trait, use `dyn` LL | let a = ::lol(); | ++++ + -error[E0599]: no function or associated item named `lol` found for trait object `dyn Foo<_>` in the current scope +error[E0599]: no associated function or constant named `lol` found for trait object `dyn Foo<_>` in the current scope --> $DIR/unspecified-self-in-trait-ref.rs:11:18 | LL | let a = Foo::lol(); - | ^^^ function or associated item not found in `dyn Foo<_>` + | ^^^ associated function or constant not found in `dyn Foo<_>` warning: trait objects without an explicit `dyn` are deprecated --> $DIR/unspecified-self-in-trait-ref.rs:15:13 @@ -31,11 +31,11 @@ help: if this is a dyn-compatible trait, use `dyn` LL | let b = >::lol(); | ++++ + -error[E0599]: no function or associated item named `lol` found for trait object `dyn Foo<_>` in the current scope +error[E0599]: no associated function or constant named `lol` found for trait object `dyn Foo<_>` in the current scope --> $DIR/unspecified-self-in-trait-ref.rs:15:23 | LL | let b = Foo::<_>::lol(); - | ^^^ function or associated item not found in `dyn Foo<_>` + | ^^^ associated function or constant not found in `dyn Foo<_>` warning: trait objects without an explicit `dyn` are deprecated --> $DIR/unspecified-self-in-trait-ref.rs:19:13 @@ -50,11 +50,11 @@ help: if this is a dyn-compatible trait, use `dyn` LL | let c = ::lol(); | ++++ + -error[E0599]: no function or associated item named `lol` found for trait object `dyn Bar<_, _>` in the current scope +error[E0599]: no associated function or constant named `lol` found for trait object `dyn Bar<_, _>` in the current scope --> $DIR/unspecified-self-in-trait-ref.rs:19:18 | LL | let c = Bar::lol(); - | ^^^ function or associated item not found in `dyn Bar<_, _>` + | ^^^ associated function or constant not found in `dyn Bar<_, _>` warning: trait objects without an explicit `dyn` are deprecated --> $DIR/unspecified-self-in-trait-ref.rs:23:13 @@ -69,11 +69,11 @@ help: if this is a dyn-compatible trait, use `dyn` LL | let d = >::lol(); | ++++ + -error[E0599]: no function or associated item named `lol` found for trait object `dyn Bar` in the current scope +error[E0599]: no associated function or constant named `lol` found for trait object `dyn Bar` in the current scope --> $DIR/unspecified-self-in-trait-ref.rs:23:30 | LL | let d = Bar::::lol(); - | ^^^ function or associated item not found in `dyn Bar` + | ^^^ associated function or constant not found in `dyn Bar` warning: trait objects without an explicit `dyn` are deprecated --> $DIR/unspecified-self-in-trait-ref.rs:27:13 diff --git a/tests/ui/type/issue-103271.rs b/tests/ui/type/issue-103271.rs index 98cfaaf5cff7b..e949bb10ece22 100644 --- a/tests/ui/type/issue-103271.rs +++ b/tests/ui/type/issue-103271.rs @@ -1,15 +1,15 @@ fn main() { let iter_fun = <&[u32]>::iter; - //~^ ERROR no function or associated item named `iter` found for reference `&[u32]` in the current scope [E0599] - //~| NOTE function or associated item not found in `&[u32]` + //~^ ERROR no associated function or constant named `iter` found for reference `&[u32]` in the current scope [E0599] + //~| NOTE associated function or constant not found in `&[u32]` //~| HELP the function `iter` is implemented on `[u32]` for item in iter_fun(&[1,1]) { let x: &u32 = item; assert_eq!(x, &1); } let iter_fun2 = <(&[u32])>::iter; - //~^ ERROR no function or associated item named `iter` found for reference `&[u32]` in the current scope [E0599] - //~| NOTE function or associated item not found in `&[u32]` + //~^ ERROR no associated function or constant named `iter` found for reference `&[u32]` in the current scope [E0599] + //~| NOTE associated function or constant not found in `&[u32]` //~| HELP the function `iter` is implemented on `[u32]` for item2 in iter_fun2(&[1,1]) { let x: &u32 = item2; diff --git a/tests/ui/type/issue-103271.stderr b/tests/ui/type/issue-103271.stderr index 1b84033291a5d..a83b782bec527 100644 --- a/tests/ui/type/issue-103271.stderr +++ b/tests/ui/type/issue-103271.stderr @@ -1,8 +1,8 @@ -error[E0599]: no function or associated item named `iter` found for reference `&[u32]` in the current scope +error[E0599]: no associated function or constant named `iter` found for reference `&[u32]` in the current scope --> $DIR/issue-103271.rs:2:30 | LL | let iter_fun = <&[u32]>::iter; - | ^^^^ function or associated item not found in `&[u32]` + | ^^^^ associated function or constant not found in `&[u32]` | help: the function `iter` is implemented on `[u32]` | @@ -10,11 +10,11 @@ LL - let iter_fun = <&[u32]>::iter; LL + let iter_fun = <[u32]>::iter; | -error[E0599]: no function or associated item named `iter` found for reference `&[u32]` in the current scope +error[E0599]: no associated function or constant named `iter` found for reference `&[u32]` in the current scope --> $DIR/issue-103271.rs:10:33 | LL | let iter_fun2 = <(&[u32])>::iter; - | ^^^^ function or associated item not found in `&[u32]` + | ^^^^ associated function or constant not found in `&[u32]` | help: the function `iter` is implemented on `[u32]` | diff --git a/tests/ui/typeck/derive-sugg-arg-arity.rs b/tests/ui/typeck/derive-sugg-arg-arity.rs index 094c93a8535d8..1a233e68639dc 100644 --- a/tests/ui/typeck/derive-sugg-arg-arity.rs +++ b/tests/ui/typeck/derive-sugg-arg-arity.rs @@ -3,6 +3,6 @@ pub struct A; fn main() { match () { _ => match A::partial_cmp() {}, - //~^ ERROR the function or associated item `partial_cmp` exists for struct `A`, but its trait bounds were not satisfied + //~^ ERROR the associated function or constant `partial_cmp` exists for struct `A`, but its trait bounds were not satisfied } } diff --git a/tests/ui/typeck/derive-sugg-arg-arity.stderr b/tests/ui/typeck/derive-sugg-arg-arity.stderr index 382b324c4cc50..029d8dfdfc79a 100644 --- a/tests/ui/typeck/derive-sugg-arg-arity.stderr +++ b/tests/ui/typeck/derive-sugg-arg-arity.stderr @@ -1,11 +1,11 @@ -error[E0599]: the function or associated item `partial_cmp` exists for struct `A`, but its trait bounds were not satisfied +error[E0599]: the associated function or constant `partial_cmp` exists for struct `A`, but its trait bounds were not satisfied --> $DIR/derive-sugg-arg-arity.rs:5:23 | LL | pub struct A; - | ------------ function or associated item `partial_cmp` not found for this struct because it doesn't satisfy `A: Iterator` or `A: PartialOrd<_>` + | ------------ associated function or constant `partial_cmp` not found for this struct because it doesn't satisfy `A: Iterator` or `A: PartialOrd<_>` ... LL | _ => match A::partial_cmp() {}, - | ^^^^^^^^^^^ function or associated item cannot be called on `A` due to unsatisfied trait bounds + | ^^^^^^^^^^^ associated function or constant cannot be called on `A` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `A: PartialOrd<_>` diff --git a/tests/ui/typeck/dont-suggest-private-dependencies.rs b/tests/ui/typeck/dont-suggest-private-dependencies.rs index ee5224e2d821e..23debbf4e3424 100644 --- a/tests/ui/typeck/dont-suggest-private-dependencies.rs +++ b/tests/ui/typeck/dont-suggest-private-dependencies.rs @@ -31,7 +31,7 @@ use public_dep::B; fn main() { let _ = u8::cast_from_lossy(9); - //~^ ERROR no function or associated item named `cast_from_lossy` found for type `u8` + //~^ ERROR no associated function or constant named `cast_from_lossy` found for type `u8` let _ = B::foo(); - //~^ ERROR no function or associated item named `foo` found for struct `B` + //~^ ERROR no associated function or constant named `foo` found for struct `B` } diff --git a/tests/ui/typeck/dont-suggest-private-dependencies.stderr b/tests/ui/typeck/dont-suggest-private-dependencies.stderr index b7b14ee6b9bbb..d17964cc933a3 100644 --- a/tests/ui/typeck/dont-suggest-private-dependencies.stderr +++ b/tests/ui/typeck/dont-suggest-private-dependencies.stderr @@ -10,17 +10,17 @@ help: there is a method `read1` with a similar name, but with different argument LL | fn read1(&self) {} | ^^^^^^^^^^^^^^^ -error[E0599]: no function or associated item named `cast_from_lossy` found for type `u8` in the current scope +error[E0599]: no associated function or constant named `cast_from_lossy` found for type `u8` in the current scope --> $DIR/dont-suggest-private-dependencies.rs:33:17 | LL | let _ = u8::cast_from_lossy(9); - | ^^^^^^^^^^^^^^^ function or associated item not found in `u8` + | ^^^^^^^^^^^^^^^ associated function or constant not found in `u8` -error[E0599]: no function or associated item named `foo` found for struct `B` in the current scope +error[E0599]: no associated function or constant named `foo` found for struct `B` in the current scope --> $DIR/dont-suggest-private-dependencies.rs:35:16 | LL | let _ = B::foo(); - | ^^^ function or associated item not found in `B` + | ^^^ associated function or constant not found in `B` error: aborting due to 3 previous errors diff --git a/tests/ui/typeck/suggest-trait-reexported-as-not-doc-visible.rs b/tests/ui/typeck/suggest-trait-reexported-as-not-doc-visible.rs index 3cb775e85ac6b..56d46fda98427 100644 --- a/tests/ui/typeck/suggest-trait-reexported-as-not-doc-visible.rs +++ b/tests/ui/typeck/suggest-trait-reexported-as-not-doc-visible.rs @@ -7,5 +7,5 @@ use suggest_trait_reexported_as_not_doc_visible_b::Bar; fn main() { Bar::foo(); - //~^ ERROR: no function or associated item named `foo` found for struct `Bar` in the current scope [E0599] + //~^ ERROR: no associated function or constant named `foo` found for struct `Bar` in the current scope [E0599] } diff --git a/tests/ui/typeck/suggest-trait-reexported-as-not-doc-visible.stderr b/tests/ui/typeck/suggest-trait-reexported-as-not-doc-visible.stderr index 9128ee6844469..7f78d2aef6179 100644 --- a/tests/ui/typeck/suggest-trait-reexported-as-not-doc-visible.stderr +++ b/tests/ui/typeck/suggest-trait-reexported-as-not-doc-visible.stderr @@ -1,8 +1,8 @@ -error[E0599]: no function or associated item named `foo` found for struct `Bar` in the current scope +error[E0599]: no associated function or constant named `foo` found for struct `Bar` in the current scope --> $DIR/suggest-trait-reexported-as-not-doc-visible.rs:9:10 | LL | Bar::foo(); - | ^^^ function or associated item not found in `Bar` + | ^^^ associated function or constant not found in `Bar` | = help: items from traits can only be used if the trait is in scope help: trait `Foo` which provides `foo` is implemented but not in scope; perhaps you want to import it diff --git a/tests/ui/ufcs/bad-builder.rs b/tests/ui/ufcs/bad-builder.rs index 350c96acca08b..53d174b7eaf2a 100644 --- a/tests/ui/ufcs/bad-builder.rs +++ b/tests/ui/ufcs/bad-builder.rs @@ -1,6 +1,6 @@ fn hello() -> Vec { Vec::::mew() - //~^ ERROR no function or associated item named `mew` found for struct `Vec` in the current scope + //~^ ERROR no associated function or constant named `mew` found for struct `Vec` in the current scope } fn main() {} diff --git a/tests/ui/ufcs/bad-builder.stderr b/tests/ui/ufcs/bad-builder.stderr index 2504a3d09253c..5fae6268af47b 100644 --- a/tests/ui/ufcs/bad-builder.stderr +++ b/tests/ui/ufcs/bad-builder.stderr @@ -1,8 +1,8 @@ -error[E0599]: no function or associated item named `mew` found for struct `Vec` in the current scope +error[E0599]: no associated function or constant named `mew` found for struct `Vec` in the current scope --> $DIR/bad-builder.rs:2:15 | LL | Vec::::mew() - | ^^^ function or associated item not found in `Vec` + | ^^^ associated function or constant not found in `Vec` | note: if you're trying to build a new `Vec` consider using one of the following associated functions: Vec::::new diff --git a/tests/ui/ufcs/ufcs-partially-resolved.rs b/tests/ui/ufcs/ufcs-partially-resolved.rs index 712668728c9e7..ac98aef4e1de6 100644 --- a/tests/ui/ufcs/ufcs-partially-resolved.rs +++ b/tests/ui/ufcs/ufcs-partially-resolved.rs @@ -35,7 +35,7 @@ fn main() { ::N::NN; //~ ERROR expected trait, found type alias `A` let _: ::Y::NN; //~ ERROR ambiguous associated type let _: ::Y::NN; //~ ERROR expected trait, found enum `E` - ::Y::NN; //~ ERROR no associated item named `NN` found for type `u16` + ::Y::NN; //~ ERROR no associated function or constant named `NN` found for type `u16` ::Y::NN; //~ ERROR expected trait, found enum `E` let _: ::NN; //~ ERROR cannot find trait `N` in trait `Tr` @@ -52,5 +52,5 @@ fn main() { let _: ::Z; //~ ERROR expected associated type, found associated function `Dr::Z` ::X; //~ ERROR expected method or associated constant, found associated type `Dr::X` let _: ::Z::N; //~ ERROR expected associated type, found associated function `Dr::Z` - ::X::N; //~ ERROR no associated item named `N` found for type `u16` + ::X::N; //~ ERROR no associated function or constant named `N` found for type `u16` } diff --git a/tests/ui/ufcs/ufcs-partially-resolved.stderr b/tests/ui/ufcs/ufcs-partially-resolved.stderr index e1df200feccff..9efadec872b36 100644 --- a/tests/ui/ufcs/ufcs-partially-resolved.stderr +++ b/tests/ui/ufcs/ufcs-partially-resolved.stderr @@ -335,17 +335,17 @@ LL - let _: ::Y::NN; LL + let _: <::Y as Example>::NN; | -error[E0599]: no associated item named `NN` found for type `u16` in the current scope +error[E0599]: no associated function or constant named `NN` found for type `u16` in the current scope --> $DIR/ufcs-partially-resolved.rs:38:20 | LL | ::Y::NN; - | ^^ associated item not found in `u16` + | ^^ associated function or constant not found in `u16` -error[E0599]: no associated item named `N` found for type `u16` in the current scope +error[E0599]: no associated function or constant named `N` found for type `u16` in the current scope --> $DIR/ufcs-partially-resolved.rs:55:20 | LL | ::X::N; - | ^ associated item not found in `u16` + | ^ associated function or constant not found in `u16` error: aborting due to 32 previous errors