mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #152880 - JohnTitor:tweak-assoc-item-note, r=fmease
Tweak incorrect assoc item note Fix rust-lang/rust#142797 r? @fmease
This commit is contained in:
@@ -1177,15 +1177,10 @@ fn report_no_match_method_error(
|
||||
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(
|
||||
|
||||
@@ -46,11 +46,11 @@ LL | pub trait Trait {
|
||||
| --------------- this is the trait that was imported
|
||||
= help: you can use `cargo tree` to explore your dependency tree
|
||||
|
||||
error[E0599]: no function or associated item named `bar` found for struct `dep_2_reexport::Type` in the current scope
|
||||
error[E0599]: no associated function or constant named `bar` found for struct `dep_2_reexport::Type` in the current scope
|
||||
--> replaced
|
||||
|
|
||||
LL | Type::bar();
|
||||
| ^^^ function or associated item not found in `dep_2_reexport::Type`
|
||||
| ^^^ associated function or constant not found in `dep_2_reexport::Type`
|
||||
|
|
||||
note: there are multiple different versions of crate `dependency` in the dependency graph
|
||||
--> replaced
|
||||
|
||||
@@ -3,7 +3,7 @@ trait Foo {
|
||||
}
|
||||
|
||||
const X: i32 = <i32>::ID;
|
||||
//~^ ERROR no associated item named `ID` found
|
||||
//~^ ERROR no associated function or constant named `ID` found
|
||||
|
||||
fn main() {
|
||||
assert_eq!(1, X);
|
||||
|
||||
@@ -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 = <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
|
||||
|
||||
@@ -7,5 +7,5 @@ impl Fail<i32> {
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@@ -7,16 +7,16 @@ LL | struct Fail<T>;
|
||||
= 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<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 `Fail<i32>`
|
||||
= note: the associated function or constant was found for `Fail<i32>`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
||||
@@ -14,5 +14,5 @@ impl Fail<i32, i32> {
|
||||
fn main() {
|
||||
Fail::<i32, u32>::C
|
||||
//~^ ERROR: type mismatch
|
||||
//~| ERROR no associated item named `C` found for struct `Fail<i32, u32>` in the current scope
|
||||
//~| ERROR no associated function or constant named `C` found for struct `Fail<i32, u32>` in the current scope
|
||||
}
|
||||
|
||||
@@ -15,16 +15,16 @@ note: required by a bound in `Fail`
|
||||
LL | struct Fail<T: Proj<Assoc = U>, U>(T);
|
||||
| ^^^^^^^^^ required by this bound in `Fail`
|
||||
|
||||
error[E0599]: no associated item named `C` found for struct `Fail<i32, u32>` in the current scope
|
||||
error[E0599]: no associated function or constant named `C` found for struct `Fail<i32, u32>` in the current scope
|
||||
--> $DIR/wrong-projection-self-ty-invalid-bivariant-arg2.rs:15:23
|
||||
|
|
||||
LL | struct Fail<T: Proj<Assoc = U>, U>(T);
|
||||
| ---------------------------------- associated item `C` not found for this struct
|
||||
| ---------------------------------- associated function or constant `C` not found for this struct
|
||||
...
|
||||
LL | Fail::<i32, u32>::C
|
||||
| ^ associated item not found in `Fail<i32, u32>`
|
||||
| ^ associated function or constant not found in `Fail<i32, u32>`
|
||||
|
|
||||
= note: the associated item was found for `Fail<i32, i32>`
|
||||
= note: the associated function or constant was found for `Fail<i32, i32>`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ fn misspellable_trait() {}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
// issue: <https://github.com/rust-lang/rust/issues/142797>
|
||||
|
||||
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() {}
|
||||
@@ -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`.
|
||||
@@ -1,7 +1,7 @@
|
||||
//! regression test for <https://github.com/rust-lang/rust/issues/38919>
|
||||
|
||||
fn foo<T: Iterator>() {
|
||||
T::Item; //~ ERROR no associated item named `Item` found
|
||||
T::Item; //~ ERROR no associated function or constant named `Item` found
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
|
||||
@@ -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<T: Iterator>() {
|
||||
| - 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
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ impl Trait for () {
|
||||
|
||||
fn f() {
|
||||
<Self>::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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 | <Self>::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
|
||||
|
|
||||
|
||||
@@ -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 `()`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 `()`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
|
||||
|
||||
@@ -13,5 +13,5 @@ impl Foo<u64> for () {}
|
||||
|
||||
fn main() {
|
||||
assert_eq!(<() as Foo<u32>>::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
|
||||
}
|
||||
|
||||
@@ -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<u32>>::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
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ fn qux(&self, x: i32) {}
|
||||
|
||||
fn main() {
|
||||
S::bar();
|
||||
//~^ ERROR no function or associated item named `bar`
|
||||
//~^ ERROR no associated function or constant named `bar`
|
||||
//~| HELP you might have meant to use `foo`
|
||||
|
||||
let s = S;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
error[E0599]: no function or associated item named `bar` found for struct `S` in the current scope
|
||||
error[E0599]: no associated function or constant named `bar` found for struct `S` in the current scope
|
||||
--> $DIR/rustc_confusables_assoc_fn.rs:14:8
|
||||
|
|
||||
LL | struct S;
|
||||
| -------- function or associated item `bar` not found for this struct
|
||||
| -------- associated function or constant `bar` not found for this struct
|
||||
...
|
||||
LL | S::bar();
|
||||
| ^^^ function or associated item not found in `S`
|
||||
| ^^^ associated function or constant not found in `S`
|
||||
|
|
||||
help: you might have meant to use `foo`
|
||||
|
|
||||
|
||||
@@ -15,5 +15,5 @@ fn call() {}
|
||||
|
||||
fn main() {
|
||||
Wrapper::<function>::call;
|
||||
//~^ ERROR: the function or associated item `call` exists for struct `Wrapper<function>`,
|
||||
//~^ ERROR: the associated function or constant `call` exists for struct `Wrapper<function>`,
|
||||
}
|
||||
|
||||
@@ -15,14 +15,14 @@ error[E0741]: using function pointers as const generic parameters is forbidden
|
||||
LL | struct Wrapper<const F: fn()>;
|
||||
| ^^^^
|
||||
|
||||
error[E0599]: the function or associated item `call` exists for struct `Wrapper<function>`, but its trait bounds were not satisfied
|
||||
error[E0599]: the associated function or constant `call` exists for struct `Wrapper<function>`, but its trait bounds were not satisfied
|
||||
--> $DIR/non_valtreeable_const_arg-2.rs:17:26
|
||||
|
|
||||
LL | struct Wrapper<const F: fn()>;
|
||||
| ----------------------------- function or associated item `call` not found for this struct because it doesn't satisfy `Wrapper<function>: Fn<_>`
|
||||
| ----------------------------- associated function or constant `call` not found for this struct because it doesn't satisfy `Wrapper<function>: Fn<_>`
|
||||
...
|
||||
LL | Wrapper::<function>::call;
|
||||
| ^^^^ function or associated item cannot be called on `Wrapper<function>` due to unsatisfied trait bounds
|
||||
| ^^^^ associated function or constant cannot be called on `Wrapper<function>` due to unsatisfied trait bounds
|
||||
|
|
||||
= note: the following trait bounds were not satisfied:
|
||||
`Wrapper<function>: Fn<_>`
|
||||
|
||||
@@ -15,5 +15,5 @@ fn foo() {}
|
||||
|
||||
fn main() {
|
||||
Foo::foo();
|
||||
//~^ ERROR the function or associated item
|
||||
//~^ ERROR the associated function or constant
|
||||
}
|
||||
|
||||
@@ -11,14 +11,14 @@ help: you might have meant to write a const parameter here
|
||||
LL | impl<const T: /* Type */> Bar<T> 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<const N: usize> {}
|
||||
| -------------------------- 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
|
||||
|
||||
@@ -27,5 +27,5 @@ pub fn new(val: T) -> Inline<T> {
|
||||
fn main() {
|
||||
let dst = Inline::<dyn Debug>::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<dyn Debug>`
|
||||
//~| ERROR the associated function or constant `new` exists for struct `Inline<dyn Debug>`
|
||||
}
|
||||
|
||||
@@ -15,14 +15,14 @@ help: consider relaxing the implicit `Sized` restriction
|
||||
LL | struct Inline<T: ?Sized>
|
||||
| ++++++++
|
||||
|
||||
error[E0599]: the function or associated item `new` exists for struct `Inline<dyn Debug>`, but its trait bounds were not satisfied
|
||||
error[E0599]: the associated function or constant `new` exists for struct `Inline<dyn Debug>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-80742.rs:28:36
|
||||
|
|
||||
LL | struct Inline<T>
|
||||
| ---------------- function or associated item `new` not found for this struct
|
||||
| ---------------- associated function or constant `new` not found for this struct
|
||||
...
|
||||
LL | let dst = Inline::<dyn Debug>::new(0);
|
||||
| ^^^ function or associated item cannot be called on `Inline<dyn Debug>` due to unsatisfied trait bounds
|
||||
| ^^^ associated function or constant cannot be called on `Inline<dyn Debug>` due to unsatisfied trait bounds
|
||||
|
|
||||
note: trait bound `dyn Debug: Sized` was not satisfied
|
||||
--> $DIR/issue-80742.rs:18:6
|
||||
|
||||
@@ -17,5 +17,5 @@ struct Inline<T>
|
||||
fn main() {
|
||||
let dst = Inline::<dyn Debug>::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<T>`
|
||||
//~| ERROR no associated function or constant named `new` found for struct `Inline<T>`
|
||||
}
|
||||
|
||||
@@ -15,14 +15,14 @@ help: consider relaxing the implicit `Sized` restriction
|
||||
LL | struct Inline<T: ?Sized>
|
||||
| ++++++++
|
||||
|
||||
error[E0599]: no function or associated item named `new` found for struct `Inline<T>` in the current scope
|
||||
error[E0599]: no associated function or constant named `new` found for struct `Inline<T>` in the current scope
|
||||
--> $DIR/size_of-dyn-trait-3.rs:18:36
|
||||
|
|
||||
LL | struct Inline<T>
|
||||
| ---------------- function or associated item `new` not found for this struct
|
||||
| ---------------- associated function or constant `new` not found for this struct
|
||||
...
|
||||
LL | let dst = Inline::<dyn Debug>::new(0);
|
||||
| ^^^ function or associated item not found in `Inline<dyn Debug>`
|
||||
| ^^^ associated function or constant not found in `Inline<dyn Debug>`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
||||
@@ -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`
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ fn assert() {}
|
||||
}
|
||||
fn f<T>() {
|
||||
Bool::<{ std::mem::needs_drop::<T>() }>::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() {
|
||||
|
||||
@@ -9,14 +9,14 @@ help: try adding a `where` bound
|
||||
LL | fn f<T>() where [(); { std::mem::needs_drop::<T>() } as usize]: {
|
||||
| +++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0599]: no function or associated item named `assert` found for struct `Bool<{ std::mem::needs_drop::<T>() }>` in the current scope
|
||||
error[E0599]: no associated function or constant named `assert` found for struct `Bool<{ std::mem::needs_drop::<T>() }>` in the current scope
|
||||
--> $DIR/const-needs_drop-monomorphic.rs:11:46
|
||||
|
|
||||
LL | struct Bool<const B: 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::<T>() }>::assert();
|
||||
| ^^^^^^ function or associated item cannot be called on `Bool<{ std::mem::needs_drop::<T>() }>` due to unsatisfied trait bounds
|
||||
| ^^^^^^ associated function or constant cannot be called on `Bool<{ std::mem::needs_drop::<T>() }>` due to unsatisfied trait bounds
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! regression test for issue <https://github.com/rust-lang/rust/issues/23217>
|
||||
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() {}
|
||||
|
||||
@@ -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
|
||||
|
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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() {}
|
||||
|
||||
@@ -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
|
||||
|
|
||||
|
||||
+1
-1
@@ -29,5 +29,5 @@ fn new() -> P::Pointer<Self> {
|
||||
|
||||
fn main() {
|
||||
let mut list = RcNode::<i32>::new();
|
||||
//~^ ERROR the variant or associated item `new` exists for enum `Node<i32, RcFamily>`, but its trait bounds were not satisfied
|
||||
//~^ ERROR the variant, associated function, or constant `new` exists for enum `Node<i32, RcFamily>`, but its trait bounds were not satisfied
|
||||
}
|
||||
|
||||
+3
-3
@@ -15,14 +15,14 @@ help: consider relaxing the implicit `Sized` restriction
|
||||
LL | type Pointer<T>: Deref<Target = T> + ?Sized;
|
||||
| ++++++++
|
||||
|
||||
error[E0599]: the variant or associated item `new` exists for enum `Node<i32, RcFamily>`, but its trait bounds were not satisfied
|
||||
error[E0599]: the variant, associated function, or constant `new` exists for enum `Node<i32, RcFamily>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs:31:35
|
||||
|
|
||||
LL | enum Node<T, P: PointerFamily> {
|
||||
| ------------------------------ 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::<i32>::new();
|
||||
| ^^^ variant or associated item cannot be called on `Node<i32, RcFamily>` due to unsatisfied trait bounds
|
||||
| ^^^ variant, associated function, or constant cannot be called on `Node<i32, RcFamily>` due to unsatisfied trait bounds
|
||||
|
|
||||
note: trait bound `(dyn Deref<Target = Node<i32, RcFamily>> + 'static): Sized` was not satisfied
|
||||
--> $DIR/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs:23:29
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@@ -16,17 +16,17 @@ note: required by a bound in `SafeImpl`
|
||||
LL | pub struct SafeImpl<T: ?Sized, A: Raw<T>>(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<T>(PhantomData<T>);
|
||||
| --------------------- doesn't satisfy `RawImpl<_>: Raw<_>`
|
||||
...
|
||||
LL | pub struct SafeImpl<T: ?Sized, A: Raw<T>>(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<T: ?Sized, A: Raw<T>>(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<T>(PhantomData<T>);
|
||||
| --------------------- doesn't satisfy `RawImpl<()>: Raw<()>`
|
||||
...
|
||||
LL | pub struct SafeImpl<T: ?Sized, A: Raw<T>>(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
|
||||
|
||||
@@ -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() { }
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
_ => (),
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
|
||||
fn main() {
|
||||
let ug = Graph::<i32, i32>::new_undirected();
|
||||
//~^ ERROR no function or associated item named `new_undirected` found
|
||||
//~^ ERROR no associated function or constant named `new_undirected` found
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
error[E0599]: no function or associated item named `new_undirected` found for struct `issue_30123_aux::Graph<i32, i32>` in the current scope
|
||||
error[E0599]: no associated function or constant named `new_undirected` found for struct `issue_30123_aux::Graph<i32, i32>` in the current scope
|
||||
--> $DIR/issue-30123.rs:7:33
|
||||
|
|
||||
LL | let ug = Graph::<i32, i32>::new_undirected();
|
||||
| ^^^^^^^^^^^^^^ function or associated item not found in `issue_30123_aux::Graph<i32, i32>`
|
||||
| ^^^^^^^^^^^^^^ associated function or constant not found in `issue_30123_aux::Graph<i32, i32>`
|
||||
|
|
||||
note: if you're trying to build a new `issue_30123_aux::Graph<i32, i32>`, consider using `issue_30123_aux::Graph::<N, E>::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 `issue_30123_aux::Graph<N, E, Undirected>`
|
||||
= note: the associated function or constant was found for `issue_30123_aux::Graph<N, E, Undirected>`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
||||
@@ -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<Value> = Vec::new();
|
||||
vec.last().map(f);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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]
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
|
||||
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`
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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<T: Copy>() {
|
||||
| - 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
|
||||
|
||||
@@ -10,7 +10,7 @@ fn method(self) {
|
||||
|
||||
fn foo(y: B<fn(&'static ())>) {
|
||||
B::<for<'a> fn(&'a ())>::method(y);
|
||||
//~^ ERROR no function or associated item named `method` found
|
||||
//~^ ERROR no associated function or constant named `method` found
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
error[E0599]: no function or associated item named `method` found for struct `B<for<'a> fn(&'a ())>` in the current scope
|
||||
error[E0599]: no associated function or constant named `method` found for struct `B<for<'a> fn(&'a ())>` in the current scope
|
||||
--> $DIR/receiver-equality.rs:12:30
|
||||
|
|
||||
LL | struct B<T>(T);
|
||||
| ----------- function or associated item `method` not found for this struct
|
||||
| ----------- associated function or constant `method` not found for this struct
|
||||
...
|
||||
LL | B::<for<'a> fn(&'a ())>::method(y);
|
||||
| ^^^^^^ function or associated item not found in `B<for<'a> fn(&'a ())>`
|
||||
| ^^^^^^ associated function or constant not found in `B<for<'a> fn(&'a ())>`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ fn make_g() -> Self::G {
|
||||
// FIXME(@compiler-errors): This error message is less than helpful.
|
||||
fn g() {
|
||||
let x = <fn (&())>::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() {}
|
||||
|
||||
@@ -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 = <fn (&())>::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
|
||||
|
||||
@@ -29,11 +29,12 @@ fn make_f() -> Self::F {
|
||||
|
||||
fn higher_ranked_region_has_lost_its_binder() {
|
||||
let x = <fn (&())>::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 = <fn (&())>::make_f(); //~ ERROR no function
|
||||
let x = <fn (&())>::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() {}
|
||||
|
||||
@@ -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 = <fn (&())>::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 = <fn (&())>::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
|
||||
|
||||
@@ -43,7 +43,7 @@ fn x<'b>(_: &'a impl Copy + 'a) -> Box<dyn 'b> { 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
|
||||
|
||||
@@ -243,18 +243,18 @@ error[E0425]: cannot find type `new` in this scope
|
||||
LL | fn elided4(_: &impl Copy + 'a) -> new { x(x) }
|
||||
| ^^^ not found in this scope
|
||||
|
||||
error[E0224]: at least one trait is required for an object type
|
||||
--> $DIR/ty-variance-issue-124423.rs:55:40
|
||||
|
|
||||
LL | impl<'a> LifetimeTrait<'a> for &'a Box<dyn 'a> {}
|
||||
| ^^^^^^
|
||||
|
||||
error[E0224]: at least one trait is required for an object type
|
||||
--> $DIR/ty-variance-issue-124423.rs:41:40
|
||||
|
|
||||
LL | fn x<'b>(_: &'a impl Copy + 'a) -> Box<dyn 'b> { Box::u32(x) }
|
||||
| ^^^^^^
|
||||
|
||||
error[E0224]: at least one trait is required for an object type
|
||||
--> $DIR/ty-variance-issue-124423.rs:55:40
|
||||
|
|
||||
LL | impl<'a> LifetimeTrait<'a> for &'a Box<dyn 'a> {}
|
||||
| ^^^^^^
|
||||
|
||||
error[E0224]: at least one trait is required for an object type
|
||||
--> $DIR/ty-variance-issue-124423.rs:35:39
|
||||
|
|
||||
@@ -267,11 +267,11 @@ 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
|
||||
error[E0599]: no associated function or constant 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<dyn 'b> { Box::u32(x) }
|
||||
| ^^^ function or associated item not found in `Box<_, _>`
|
||||
| ^^^ associated function or constant not found in `Box<_, _>`
|
||||
|
|
||||
note: if you're trying to build a new `Box<_, _>` consider using one of the following associated functions:
|
||||
Box::<T>::new
|
||||
|
||||
@@ -20,6 +20,6 @@ fn x<'b>(_: &'a impl Copy + 'a) -> Box<dyn 'b> { 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() {}
|
||||
|
||||
@@ -93,11 +93,11 @@ 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
|
||||
error[E0599]: no associated function or constant 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<dyn 'b> { Box::u32(x) }
|
||||
| ^^^ function or associated item not found in `Box<_, _>`
|
||||
| ^^^ associated function or constant not found in `Box<_, _>`
|
||||
|
|
||||
note: if you're trying to build a new `Box<_, _>` consider using one of the following associated functions:
|
||||
Box::<T>::new
|
||||
|
||||
@@ -6,7 +6,7 @@ fn full_of_✨() -> 👀 { //~ ERROR identifiers cannot contain emoji
|
||||
}
|
||||
}
|
||||
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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
error[E0599]: no function or associated item named `foo` found for struct `Foo<B>` in the current scope
|
||||
error[E0599]: no associated function or constant named `foo` found for struct `Foo<B>` in the current scope
|
||||
--> $DIR/ufc-method-call.rs:27:27
|
||||
|
|
||||
LL | pub struct Foo<T>(T);
|
||||
| ----------------- function or associated item `foo` not found for this struct
|
||||
| ----------------- associated function or constant `foo` not found for this struct
|
||||
...
|
||||
LL | test::Foo::<test::B>::foo();
|
||||
| ^^^ function or associated item not found in `Foo<B>`
|
||||
| ^^^ associated function or constant not found in `Foo<B>`
|
||||
|
|
||||
= note: the function or associated item was found for `Foo<A>`
|
||||
= note: the associated function or constant was found for `Foo<A>`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
||||
@@ -26,5 +26,5 @@ fn bar() {}
|
||||
fn main() {
|
||||
test::Foo::<test::B>::foo();
|
||||
//[same_name]~^ ERROR associated function `foo` is private
|
||||
//[different_name]~^^ ERROR no function or associated item named `foo` found for struct `Foo<B>`
|
||||
//[different_name]~^^ ERROR no associated function or constant named `foo` found for struct `Foo<B>`
|
||||
}
|
||||
|
||||
@@ -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`
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -50,15 +50,15 @@ fn build_private() -> Self {
|
||||
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 `<impl Foo<T>>` it should not be
|
||||
// suggested because `u8` does not meet the `T: SomeTrait` constraint
|
||||
let _foo = Foo::<u8>::new();
|
||||
//~^ ERROR the function or associated item `new` exists for struct `Foo<u8>`, but its trait bounds were not satisfied
|
||||
//~^ ERROR the associated function or constant `new` exists for struct `Foo<u8>`, but its trait bounds were not satisfied
|
||||
|
||||
// Should suggest only `<impl Bar>::build()` and `SomeMod::<impl Bar>::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
|
||||
}
|
||||
|
||||
@@ -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<u8>`, but its trait bounds were not satisfied
|
||||
error[E0599]: the associated function or constant `new` exists for struct `Foo<u8>`, but its trait bounds were not satisfied
|
||||
--> $DIR/suggest-builder-fn.rs:57:27
|
||||
|
|
||||
LL | struct Foo<T> {
|
||||
| ------------- function or associated item `new` not found for this struct
|
||||
| ------------- associated function or constant `new` not found for this struct
|
||||
...
|
||||
LL | let _foo = Foo::<u8>::new();
|
||||
| ^^^ function or associated item cannot be called on `Foo<u8>` due to unsatisfied trait bounds
|
||||
| ^^^ associated function or constant cannot be called on `Foo<u8>` 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<T: SomeTrait + Default> Foo<T> {
|
||||
| |
|
||||
| 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
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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
|
||||
|
|
||||
|
||||
@@ -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
|
||||
_ => { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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`
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -11,5 +11,5 @@ fn deserialize() {
|
||||
|
||||
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`
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,7 +9,7 @@ mod Foo {
|
||||
pub fn f() {}
|
||||
}
|
||||
fn g<Foo>() {
|
||||
Foo::f(); //~ ERROR no function or associated item named `f`
|
||||
Foo::f(); //~ ERROR no associated function or constant named `f`
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -8,13 +8,13 @@ LL | fn f<T>() {
|
||||
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<Foo>() {
|
||||
| --- 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
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
error[E0599]: no function or associated item named `from_mut` found for struct `Atomic<u64>` in the current scope
|
||||
error[E0599]: no associated function or constant named `from_mut` found for struct `Atomic<u64>` in the current scope
|
||||
--> $DIR/atomic-from-mut-not-available.rs:24:36
|
||||
|
|
||||
LL | core::sync::atomic::AtomicU64::from_mut(&mut 0u64);
|
||||
| ^^^^^^^^ function or associated item not found in `Atomic<u64>`
|
||||
| ^^^^^^^^ associated function or constant not found in `Atomic<u64>`
|
||||
|
|
||||
note: if you're trying to build a new `Atomic<u64>`, consider using `Atomic::<u64>::new` which returns `Atomic<u64>`
|
||||
--> $SRC_DIR/core/src/sync/atomic.rs:LL:COL
|
||||
::: $SRC_DIR/core/src/sync/atomic.rs:LL:COL
|
||||
|
|
||||
= note: in this macro invocation
|
||||
= note: the function or associated item was found for
|
||||
= note: the associated function or constant was found for
|
||||
- `Atomic<*mut T>`
|
||||
- `Atomic<bool>`
|
||||
- `Atomic<i16>`
|
||||
|
||||
@@ -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<u64>`
|
||||
//[alignment_mismatch]~^ ERROR no associated function or constant named `from_mut` found for struct `Atomic<u64>`
|
||||
//[alignment_matches]~^^ ERROR use of unstable library feature `atomic_from_mut`
|
||||
}
|
||||
|
||||
@@ -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 `[_]`
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user