Rollup merge of #68014 - estebank:unify-e0599, r=cramertj

Unify output of "variant not found" errors

Fix #49566.
This commit is contained in:
Yuki Okushi 2020-01-11 04:50:48 +09:00 committed by GitHub
commit a491100aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
156 changed files with 260 additions and 254 deletions

View File

@ -2125,9 +2125,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
let msg = format!("expected type, found variant `{}`", assoc_ident);
tcx.sess.span_err(span, &msg);
} else if qself_ty.is_enum() {
let mut err = tcx.sess.struct_span_err(
let mut err = struct_span_err!(
tcx.sess,
assoc_ident.span,
&format!("no variant `{}` in enum `{}`", assoc_ident, qself_ty),
E0599,
"no variant named `{}` found for enum `{}`",
assoc_ident,
qself_ty,
);
let adt_def = qself_ty.ty_adt_def().expect("enum is not an ADT");

View File

@ -360,10 +360,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
tcx.sess,
span,
E0599,
"no {} named `{}` found for type `{}` in the current scope",
"no {} named `{}` found for {} `{}` in the current scope",
item_kind,
item_name,
ty_str
actual.prefix_string(),
ty_str,
);
if let Some(span) =
tcx.sess.confused_type_with_std_module.borrow().get(&span)

View File

@ -3,7 +3,7 @@ trait Foo {
}
const X: i32 = <i32>::ID;
//~^ ERROR no associated item named `ID` found for type `i32`
//~^ ERROR no associated item named `ID` found
fn main() {
assert_eq!(1, X);

View File

@ -1,4 +1,4 @@
error[E0599]: no variant or associated item named `mispellable` found for type `Enum` in the current scope
error[E0599]: no variant or associated item named `mispellable` found for enum `Enum` in the current scope
--> $DIR/associated-item-enum.rs:17:11
|
LL | enum Enum { Variant }
@ -10,7 +10,7 @@ LL | Enum::mispellable();
| variant or associated item not found in `Enum`
| help: there is a method with a similar name: `misspellable`
error[E0599]: no variant or associated item named `mispellable_trait` found for type `Enum` in the current scope
error[E0599]: no variant or associated item named `mispellable_trait` found for enum `Enum` in the current scope
--> $DIR/associated-item-enum.rs:18:11
|
LL | enum Enum { Variant }
@ -19,7 +19,7 @@ LL | enum Enum { Variant }
LL | Enum::mispellable_trait();
| ^^^^^^^^^^^^^^^^^ variant or associated item not found in `Enum`
error[E0599]: no variant or associated item named `MISPELLABLE` found for type `Enum` in the current scope
error[E0599]: no variant or associated item named `MISPELLABLE` found for enum `Enum` in the current scope
--> $DIR/associated-item-enum.rs:19:11
|
LL | enum Enum { Variant }

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `test_mut` found for type `std::vec::Vec<{integer}>` in the current scope
error[E0599]: no method named `test_mut` found for struct `std::vec::Vec<{integer}>` in the current scope
--> $DIR/auto-ref-slice-plus-ref.rs:7:7
|
LL | a.test_mut();
@ -8,7 +8,7 @@ LL | a.test_mut();
= note: the following trait defines an item `test_mut`, perhaps you need to implement it:
candidate #1: `MyIter`
error[E0599]: no method named `test` found for type `std::vec::Vec<{integer}>` in the current scope
error[E0599]: no method named `test` found for struct `std::vec::Vec<{integer}>` in the current scope
--> $DIR/auto-ref-slice-plus-ref.rs:8:7
|
LL | a.test();
@ -18,7 +18,7 @@ LL | a.test();
= note: the following trait defines an item `test`, perhaps you need to implement it:
candidate #1: `MyIter`
error[E0599]: no method named `test` found for type `[{integer}; 1]` in the current scope
error[E0599]: no method named `test` found for array `[{integer}; 1]` in the current scope
--> $DIR/auto-ref-slice-plus-ref.rs:10:11
|
LL | ([1]).test();
@ -28,7 +28,7 @@ LL | ([1]).test();
= note: the following trait defines an item `test`, perhaps you need to implement it:
candidate #1: `MyIter`
error[E0599]: no method named `test` found for type `&[{integer}; 1]` in the current scope
error[E0599]: no method named `test` found for reference `&[{integer}; 1]` in the current scope
--> $DIR/auto-ref-slice-plus-ref.rs:11:12
|
LL | (&[1]).test();

View File

@ -1,7 +1,7 @@
trait A {
fn a(&self) {
|| self.b()
//~^ ERROR no method named `b` found for type `&Self` in the current scope
//~^ ERROR no method named `b` found
}
}
fn main() {}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `b` found for type `&Self` in the current scope
error[E0599]: no method named `b` found for reference `&Self` in the current scope
--> $DIR/issue-3563.rs:3:17
|
LL | || self.b()

View File

@ -1,4 +1,4 @@
error[E0599]: no variant or associated item named `Hsl` found for type `Color` in the current scope
error[E0599]: no variant or associated item named `Hsl` found for enum `Color` in the current scope
--> $DIR/bogus-tag.rs:7:16
|
LL | enum Color { Rgb(isize, isize, isize), Rgba(isize, isize, isize, isize), }

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `eat` found for type `std::boxed::Box<dyn Noisy>` in the current scope
error[E0599]: no method named `eat` found for struct `std::boxed::Box<dyn Noisy>` in the current scope
--> $DIR/class-cast-to-trait.rs:53:8
|
LL | nyan.eat();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `the_fn` found for type `&Lib::TheStruct` in the current scope
error[E0599]: no method named `the_fn` found for reference `&Lib::TheStruct` in the current scope
--> $DIR/coherence_inherent.rs:31:11
|
LL | s.the_fn();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `the_fn` found for type `&coherence_inherent_cc_lib::TheStruct` in the current scope
error[E0599]: no method named `the_fn` found for reference `&coherence_inherent_cc_lib::TheStruct` in the current scope
--> $DIR/coherence_inherent_cc.rs:23:11
|
LL | s.the_fn();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `closure` found for type `Obj<[closure@$DIR/issue-18343.rs:6:28: 6:33]>` in the current scope
error[E0599]: no method named `closure` found for struct `Obj<[closure@$DIR/issue-18343.rs:6:28: 6:33]>` in the current scope
--> $DIR/issue-18343.rs:7:7
|
LL | struct Obj<F> where F: FnMut() -> u32 {

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `closure` found for type `Obj<[closure@$DIR/issue-2392.rs:35:36: 35:41]>` in the current scope
error[E0599]: no method named `closure` found for struct `Obj<[closure@$DIR/issue-2392.rs:35:36: 35:41]>` in the current scope
--> $DIR/issue-2392.rs:36:15
|
LL | struct Obj<F> where F: FnOnce() -> u32 {
@ -12,7 +12,7 @@ help: to call the function stored in `closure`, surround the field access with p
LL | (o_closure.closure)();
| ^ ^
error[E0599]: no method named `not_closure` found for type `Obj<[closure@$DIR/issue-2392.rs:35:36: 35:41]>` in the current scope
error[E0599]: no method named `not_closure` found for struct `Obj<[closure@$DIR/issue-2392.rs:35:36: 35:41]>` in the current scope
--> $DIR/issue-2392.rs:38:15
|
LL | struct Obj<F> where F: FnOnce() -> u32 {
@ -23,7 +23,7 @@ LL | o_closure.not_closure();
| |
| field, not a method
error[E0599]: no method named `closure` found for type `Obj<fn() -> u32 {func}>` in the current scope
error[E0599]: no method named `closure` found for struct `Obj<fn() -> u32 {func}>` in the current scope
--> $DIR/issue-2392.rs:42:12
|
LL | struct Obj<F> where F: FnOnce() -> u32 {
@ -37,7 +37,7 @@ help: to call the function stored in `closure`, surround the field access with p
LL | (o_func.closure)();
| ^ ^
error[E0599]: no method named `boxed_closure` found for type `BoxedObj` in the current scope
error[E0599]: no method named `boxed_closure` found for struct `BoxedObj` in the current scope
--> $DIR/issue-2392.rs:45:14
|
LL | struct BoxedObj {
@ -51,7 +51,7 @@ help: to call the function stored in `boxed_closure`, surround the field access
LL | (boxed_fn.boxed_closure)();
| ^ ^
error[E0599]: no method named `boxed_closure` found for type `BoxedObj` in the current scope
error[E0599]: no method named `boxed_closure` found for struct `BoxedObj` in the current scope
--> $DIR/issue-2392.rs:48:19
|
LL | struct BoxedObj {
@ -65,7 +65,7 @@ help: to call the function stored in `boxed_closure`, surround the field access
LL | (boxed_closure.boxed_closure)();
| ^ ^
error[E0599]: no method named `closure` found for type `Obj<fn() -> u32 {func}>` in the current scope
error[E0599]: no method named `closure` found for struct `Obj<fn() -> u32 {func}>` in the current scope
--> $DIR/issue-2392.rs:53:12
|
LL | struct Obj<F> where F: FnOnce() -> u32 {
@ -79,7 +79,7 @@ help: to call the function stored in `closure`, surround the field access with p
LL | (w.wrap.closure)();
| ^ ^
error[E0599]: no method named `not_closure` found for type `Obj<fn() -> u32 {func}>` in the current scope
error[E0599]: no method named `not_closure` found for struct `Obj<fn() -> u32 {func}>` in the current scope
--> $DIR/issue-2392.rs:55:12
|
LL | struct Obj<F> where F: FnOnce() -> u32 {
@ -90,7 +90,7 @@ LL | w.wrap.not_closure();
| |
| field, not a method
error[E0599]: no method named `closure` found for type `Obj<std::boxed::Box<(dyn std::ops::FnOnce() -> u32 + 'static)>>` in the current scope
error[E0599]: no method named `closure` found for struct `Obj<std::boxed::Box<(dyn std::ops::FnOnce() -> u32 + 'static)>>` in the current scope
--> $DIR/issue-2392.rs:58:24
|
LL | struct Obj<F> where F: FnOnce() -> u32 {
@ -104,7 +104,7 @@ help: to call the function stored in `closure`, surround the field access with p
LL | (check_expression().closure)();
| ^ ^
error[E0599]: no method named `f1` found for type `FuncContainer` in the current scope
error[E0599]: no method named `f1` found for struct `FuncContainer` in the current scope
--> $DIR/issue-2392.rs:64:31
|
LL | struct FuncContainer {
@ -118,7 +118,7 @@ help: to call the function stored in `f1`, surround the field access with parent
LL | ((*self.container).f1)(1);
| ^ ^
error[E0599]: no method named `f2` found for type `FuncContainer` in the current scope
error[E0599]: no method named `f2` found for struct `FuncContainer` in the current scope
--> $DIR/issue-2392.rs:65:31
|
LL | struct FuncContainer {
@ -132,7 +132,7 @@ help: to call the function stored in `f2`, surround the field access with parent
LL | ((*self.container).f2)(1);
| ^ ^
error[E0599]: no method named `f3` found for type `FuncContainer` in the current scope
error[E0599]: no method named `f3` found for struct `FuncContainer` in the current scope
--> $DIR/issue-2392.rs:66:31
|
LL | struct FuncContainer {

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `example` found for type `Example` in the current scope
error[E0599]: no method named `example` found for struct `Example` in the current scope
--> $DIR/issue-32128.rs:12:10
|
LL | struct Example {

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `closure` found for type `&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:48]>` in the current scope
error[E0599]: no method named `closure` found for reference `&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:48]>` in the current scope
--> $DIR/issue-33784.rs:27:7
|
LL | p.closure();
@ -9,7 +9,7 @@ help: to call the function stored in `closure`, surround the field access with p
LL | (p.closure)();
| ^ ^
error[E0599]: no method named `fn_ptr` found for type `&&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:48]>` in the current scope
error[E0599]: no method named `fn_ptr` found for reference `&&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:48]>` in the current scope
--> $DIR/issue-33784.rs:29:7
|
LL | q.fn_ptr();
@ -20,7 +20,7 @@ help: to call the function stored in `fn_ptr`, surround the field access with pa
LL | (q.fn_ptr)();
| ^ ^
error[E0599]: no method named `c_fn_ptr` found for type `&D` in the current scope
error[E0599]: no method named `c_fn_ptr` found for reference `&D` in the current scope
--> $DIR/issue-33784.rs:32:7
|
LL | s.c_fn_ptr();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `dog_age` found for type `animal::Dog` in the current scope
error[E0599]: no method named `dog_age` found for struct `animal::Dog` in the current scope
--> $DIR/private-field.rs:16:23
|
LL | pub struct Dog {

View File

@ -4,7 +4,7 @@ error[E0107]: wrong number of const arguments: expected 0, found 1
LL | let _: u32 = 5i32.try_into::<32>().unwrap();
| ^^ unexpected const argument
error[E0599]: no method named `f` found for type `S` in the current scope
error[E0599]: no method named `f` found for struct `S` in the current scope
--> $DIR/invalid-const-arg-for-type-param.rs:7:7
|
LL | struct S;

View File

@ -1,4 +1,4 @@
error[E0599]: no associated item named `HOST_SIZE` found for type `Foo<A, B>` in the current scope
error[E0599]: no associated item named `HOST_SIZE` found for struct `Foo<A, B>` in the current scope
--> $DIR/too_generic_eval_ice.rs:7:19
|
LL | pub struct Foo<A, B>(A, B);

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `clone` found for type `Foo` in the current scope
error[E0599]: no method named `clone` found for struct `Foo` in the current scope
--> $DIR/copy-a-resource.rs:18:16
|
LL | struct Foo {

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `clone` found for type `Bar<NotClone>` in the current scope
error[E0599]: no method named `clone` found for struct `Bar<NotClone>` in the current scope
--> $DIR/derive-assoc-type-not-impl.rs:18:30
|
LL | struct Bar<T: Foo> {

View File

@ -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 for type `[u8]` in the current scope
//~| ERROR no associated item named `AssocItem` found
(u8, u8)::AssocItem => {}
//~^ ERROR missing angle brackets in associated item path
//~| ERROR no associated item named `AssocItem` found for type `(u8, u8)` in the current sco
//~| ERROR no associated item named `AssocItem` found
_::AssocItem => {}
//~^ ERROR missing angle brackets in associated item path
//~| ERROR no associated item named `AssocItem` found for type `_` in the current scope
//~| ERROR no associated item named `AssocItem` found
}
match &0u8 {
&(u8,)::AssocItem => {}
//~^ ERROR missing angle brackets in associated item path
//~| ERROR no associated item named `AssocItem` found for type `(u8,)` in the current scope
//~| ERROR no associated item 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 for type `u8` in the current scope
//~| ERROR no associated item 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 for type `u8` in the current scope
//~| ERROR no associated item named `AssocItem` found
}
}

View File

@ -37,13 +37,13 @@ LL | ($ty: ty) => ($ty::AssocItem)
LL | pat!(u8) => {}
| -------- in this macro invocation
error[E0599]: no associated item named `AssocItem` found for type `[u8]` in the current scope
error[E0599]: no associated item 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]`
error[E0599]: no associated item named `AssocItem` found for type `(u8, u8)` in the current scope
error[E0599]: no associated item named `AssocItem` found for tuple `(u8, u8)` in the current scope
--> $DIR/bad-assoc-pat.rs:6:19
|
LL | (u8, u8)::AssocItem => {}
@ -55,7 +55,7 @@ error[E0599]: no associated item named `AssocItem` found for type `_` in the cur
LL | _::AssocItem => {}
| ^^^^^^^^^ associated item not found in `_`
error[E0599]: no associated item named `AssocItem` found for type `(u8,)` in the current scope
error[E0599]: no associated item named `AssocItem` found for tuple `(u8,)` in the current scope
--> $DIR/bad-assoc-pat.rs:14:17
|
LL | &(u8,)::AssocItem => {}

View File

@ -35,5 +35,5 @@ impl S {
}
fn main() {
S.hello_method(); //~ no method named `hello_method` found for type `S` in the current scope
S.hello_method(); //~ no method named `hello_method` found
}

View File

@ -56,7 +56,7 @@ error: missing `fn`, `type`, or `const` for associated-item declaration
LL | pub hello_method(&self) {
| ^ missing `fn`, `type`, or `const`
error[E0599]: no method named `hello_method` found for type `S` in the current scope
error[E0599]: no method named `hello_method` found for struct `S` in the current scope
--> $DIR/issue-40006.rs:38:7
|
LL | struct S;

View File

@ -2,5 +2,5 @@ struct T;
fn main() {
T::new();
//~^ ERROR no function or associated item named `new` found for type `T` in the current scope
//~^ ERROR no function or associated item named `new` found
}

View File

@ -1,4 +1,4 @@
error[E0599]: no function or associated item named `new` found for type `T` in the current scope
error[E0599]: no function or associated item named `new` found for struct `T` in the current scope
--> $DIR/dont-suggest-private-trait-method.rs:4:8
|
LL | struct T;

View File

@ -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 type
let xe3 = XE::Empty3(); //~ ERROR no variant or associated item named `Empty3` found for type
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
XE::Empty1 {}; //~ ERROR no variant `Empty1` in enum `empty_struct::XE`
XE::Empty1 {}; //~ ERROR no variant named `Empty1` found for enum `empty_struct::XE`
}

View File

@ -58,7 +58,7 @@ LL | let xe1 = XEmpty1();
| did you mean `XEmpty1 { /* fields */ }`?
| help: a unit struct with a similar name exists: `XEmpty2`
error[E0599]: no variant or associated item named `Empty3` found for type `empty_struct::XE` in the current scope
error[E0599]: no variant or associated item 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;
@ -67,7 +67,7 @@ LL | let xe3 = XE::Empty3;
| variant or associated item not found in `empty_struct::XE`
| help: there is a variant with a similar name: `XEmpty3`
error[E0599]: no variant or associated item named `Empty3` found for type `empty_struct::XE` in the current scope
error[E0599]: no variant or associated item 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();
@ -76,7 +76,7 @@ LL | let xe3 = XE::Empty3();
| variant or associated item not found in `empty_struct::XE`
| help: there is a variant with a similar name: `XEmpty3`
error: no variant `Empty1` in enum `empty_struct::XE`
error[E0599]: no variant named `Empty1` found for enum `empty_struct::XE`
--> $DIR/empty-struct-braces-expr.rs:28:9
|
LL | XE::Empty1 {};

View File

@ -1,4 +1,4 @@
error[E0599]: no associated item named `NotEvenReal` found for type `Foo` in the current scope
error[E0599]: no associated item named `NotEvenReal` found for struct `Foo` in the current scope
--> $DIR/E0599.rs:4:20
|
LL | struct Foo;

View File

@ -20,7 +20,7 @@ LL | x += 2;
|
= note: an implementation of `std::ops::AddAssign` might be missing for `&str`
error[E0599]: no method named `z` found for type `&str` in the current scope
error[E0599]: no method named `z` found for reference `&str` in the current scope
--> $DIR/error-festival.rs:16:7
|
LL | x.z();

View File

@ -15,7 +15,7 @@ LL | fn f() { ::bar::m!(); }
LL | Vec::new();
| ^^^ use of undeclared type or module `Vec`
error[E0599]: no method named `clone` found for type `()` in the current scope
error[E0599]: no method named `clone` found for unit type `()` in the current scope
--> $DIR/no_implicit_prelude.rs:12:12
|
LL | fn f() { ::bar::m!(); }

View File

@ -14,7 +14,7 @@ mod bar {
}
mod baz {
pub macro m() { ().f() } //~ ERROR no method named `f` found for type `()` in the current scope
pub macro m() { ().f() } //~ ERROR no method named `f` found
fn f() { ::bar::m!(); }
}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `f` found for type `()` in the current scope
error[E0599]: no method named `f` found for unit type `()` in the current scope
--> $DIR/trait_items.rs:17:24
|
LL | fn f() { ::baz::m!(); }

View File

@ -6,19 +6,19 @@ LL | #![feature(impl_trait_in_bindings)]
|
= note: `#[warn(incomplete_features)]` on by default
error[E0599]: no method named `count_ones` found for type `impl std::marker::Copy` in the current scope
error[E0599]: no method named `count_ones` found for opaque type `impl std::marker::Copy` in the current scope
--> $DIR/bindings-opaque.rs:11:17
|
LL | let _ = FOO.count_ones();
| ^^^^^^^^^^ method not found in `impl std::marker::Copy`
error[E0599]: no method named `count_ones` found for type `impl std::marker::Copy` in the current scope
error[E0599]: no method named `count_ones` found for opaque type `impl std::marker::Copy` in the current scope
--> $DIR/bindings-opaque.rs:13:17
|
LL | let _ = BAR.count_ones();
| ^^^^^^^^^^ method not found in `impl std::marker::Copy`
error[E0599]: no method named `count_ones` found for type `impl std::marker::Copy` in the current scope
error[E0599]: no method named `count_ones` found for opaque type `impl std::marker::Copy` in the current scope
--> $DIR/bindings-opaque.rs:15:17
|
LL | let _ = foo.count_ones();

View File

@ -18,5 +18,5 @@ fn main() {
let f1 = Bar;
f1.foo(1usize);
//~^ error: method named `foo` found for type `Bar` in the current scope
//~^ error: method named `foo` found for struct `Bar` in the current scope
}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `foo` found for type `Bar` in the current scope
error[E0599]: no method named `foo` found for struct `Bar` in the current scope
--> $DIR/issue-21659-show-relevant-trait-impls-3.rs:20:8
|
LL | struct Bar;

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `is_empty` found for type `Foo` in the current scope
error[E0599]: no method named `is_empty` found for struct `Foo` in the current scope
--> $DIR/method-suggestion-no-duplication.rs:7:15
|
LL | struct Foo;

View File

@ -25,7 +25,7 @@ fn main() {
//~|items from traits can only be used if the trait is in scope
std::rc::Rc::new(&mut Box::new(&1u32)).method();
//~^items from traits can only be used if the trait is in scope
//~| ERROR no method named `method` found for type
//~| ERROR no method named `method` found for struct
'a'.method();
//~^ ERROR no method named

View File

@ -16,7 +16,7 @@ LL | use no_method_suggested_traits::qux::PrivPub;
LL | use no_method_suggested_traits::Reexported;
|
error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&u32>>` in the current scope
error[E0599]: no method named `method` found for struct `std::rc::Rc<&mut std::boxed::Box<&u32>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:26:44
|
LL | std::rc::Rc::new(&mut Box::new(&1u32)).method();
@ -46,7 +46,7 @@ help: the following trait is implemented but not in scope; perhaps add a `use` f
LL | use foo::Bar;
|
error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&char>>` in the current scope
error[E0599]: no method named `method` found for struct `std::rc::Rc<&mut std::boxed::Box<&char>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:32:43
|
LL | fn method(&self) {}
@ -78,7 +78,7 @@ help: the following trait is implemented but not in scope; perhaps add a `use` f
LL | use no_method_suggested_traits::foo::PubPub;
|
error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&i32>>` in the current scope
error[E0599]: no method named `method` found for struct `std::rc::Rc<&mut std::boxed::Box<&i32>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:37:44
|
LL | std::rc::Rc::new(&mut Box::new(&1i32)).method();
@ -90,7 +90,7 @@ help: the following trait is implemented but not in scope; perhaps add a `use` f
LL | use no_method_suggested_traits::foo::PubPub;
|
error[E0599]: no method named `method` found for type `Foo` in the current scope
error[E0599]: no method named `method` found for struct `Foo` in the current scope
--> $DIR/no-method-suggested-traits.rs:40:9
|
LL | struct Foo;
@ -106,7 +106,7 @@ LL | Foo.method();
candidate #3: `no_method_suggested_traits::qux::PrivPub`
candidate #4: `no_method_suggested_traits::Reexported`
error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&Foo>>` in the current scope
error[E0599]: no method named `method` found for struct `std::rc::Rc<&mut std::boxed::Box<&Foo>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:42:43
|
LL | std::rc::Rc::new(&mut Box::new(&Foo)).method();
@ -129,7 +129,7 @@ LL | 1u64.method2();
= note: the following trait defines an item `method2`, perhaps you need to implement it:
candidate #1: `foo::Bar`
error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::boxed::Box<&u64>>` in the current scope
error[E0599]: no method named `method2` found for struct `std::rc::Rc<&mut std::boxed::Box<&u64>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:47:44
|
LL | std::rc::Rc::new(&mut Box::new(&1u64)).method2();
@ -139,7 +139,7 @@ LL | std::rc::Rc::new(&mut Box::new(&1u64)).method2();
= note: the following trait defines an item `method2`, perhaps you need to implement it:
candidate #1: `foo::Bar`
error[E0599]: no method named `method2` found for type `no_method_suggested_traits::Foo` in the current scope
error[E0599]: no method named `method2` found for struct `no_method_suggested_traits::Foo` in the current scope
--> $DIR/no-method-suggested-traits.rs:50:37
|
LL | no_method_suggested_traits::Foo.method2();
@ -149,7 +149,7 @@ LL | no_method_suggested_traits::Foo.method2();
= note: the following trait defines an item `method2`, perhaps you need to implement it:
candidate #1: `foo::Bar`
error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` in the current scope
error[E0599]: no method named `method2` found for struct `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:52:71
|
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
@ -159,7 +159,7 @@ LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).metho
= note: the following trait defines an item `method2`, perhaps you need to implement it:
candidate #1: `foo::Bar`
error[E0599]: no method named `method2` found for type `no_method_suggested_traits::Bar` in the current scope
error[E0599]: no method named `method2` found for enum `no_method_suggested_traits::Bar` in the current scope
--> $DIR/no-method-suggested-traits.rs:54:40
|
LL | no_method_suggested_traits::Bar::X.method2();
@ -169,7 +169,7 @@ LL | no_method_suggested_traits::Bar::X.method2();
= note: the following trait defines an item `method2`, perhaps you need to implement it:
candidate #1: `foo::Bar`
error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` in the current scope
error[E0599]: no method named `method2` found for struct `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:56:74
|
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
@ -179,7 +179,7 @@ LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).me
= note: the following trait defines an item `method2`, perhaps you need to implement it:
candidate #1: `foo::Bar`
error[E0599]: no method named `method3` found for type `Foo` in the current scope
error[E0599]: no method named `method3` found for struct `Foo` in the current scope
--> $DIR/no-method-suggested-traits.rs:59:9
|
LL | struct Foo;
@ -192,7 +192,7 @@ LL | Foo.method3();
= note: the following trait defines an item `method3`, perhaps you need to implement it:
candidate #1: `no_method_suggested_traits::foo::PubPub`
error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&Foo>>` in the current scope
error[E0599]: no method named `method3` found for struct `std::rc::Rc<&mut std::boxed::Box<&Foo>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:61:43
|
LL | std::rc::Rc::new(&mut Box::new(&Foo)).method3();
@ -202,7 +202,7 @@ LL | std::rc::Rc::new(&mut Box::new(&Foo)).method3();
= note: the following trait defines an item `method3`, perhaps you need to implement it:
candidate #1: `no_method_suggested_traits::foo::PubPub`
error[E0599]: no method named `method3` found for type `Bar` in the current scope
error[E0599]: no method named `method3` found for enum `Bar` in the current scope
--> $DIR/no-method-suggested-traits.rs:63:12
|
LL | enum Bar { X }
@ -215,7 +215,7 @@ LL | Bar::X.method3();
= note: the following trait defines an item `method3`, perhaps you need to implement it:
candidate #1: `no_method_suggested_traits::foo::PubPub`
error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&Bar>>` in the current scope
error[E0599]: no method named `method3` found for struct `std::rc::Rc<&mut std::boxed::Box<&Bar>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:65:46
|
LL | std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
@ -231,31 +231,31 @@ error[E0599]: no method named `method3` found for type `usize` in the current sc
LL | 1_usize.method3();
| ^^^^^^^ method not found in `usize`
error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&usize>>` in the current scope
error[E0599]: no method named `method3` found for struct `std::rc::Rc<&mut std::boxed::Box<&usize>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:70:47
|
LL | std::rc::Rc::new(&mut Box::new(&1_usize)).method3();
| ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&usize>>`
error[E0599]: no method named `method3` found for type `no_method_suggested_traits::Foo` in the current scope
error[E0599]: no method named `method3` found for struct `no_method_suggested_traits::Foo` in the current scope
--> $DIR/no-method-suggested-traits.rs:71:37
|
LL | no_method_suggested_traits::Foo.method3();
| ^^^^^^^ method not found in `no_method_suggested_traits::Foo`
error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` in the current scope
error[E0599]: no method named `method3` found for struct `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:72:71
|
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3();
| ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>`
error[E0599]: no method named `method3` found for type `no_method_suggested_traits::Bar` in the current scope
error[E0599]: no method named `method3` found for enum `no_method_suggested_traits::Bar` in the current scope
--> $DIR/no-method-suggested-traits.rs:74:40
|
LL | no_method_suggested_traits::Bar::X.method3();
| ^^^^^^^ method not found in `no_method_suggested_traits::Bar`
error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` in the current scope
error[E0599]: no method named `method3` found for struct `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:75:74
|
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3();

View File

@ -37,7 +37,7 @@ LL | Foo.bar();
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate
error[E0599]: no method named `bar` found for type `Foo` in the current scope
error[E0599]: no method named `bar` found for struct `Foo` in the current scope
--> $DIR/infinite-autoderef.rs:26:9
|
LL | struct Foo;

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `foo` found for type `&b::B` in the current scope
error[E0599]: no method named `foo` found for reference `&b::B` in the current scope
--> $DIR/issue-10465.rs:17:15
|
LL | b.foo();

View File

@ -12,7 +12,7 @@ LL | self.iter()
= help: type parameters must be constrained to match other types
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
error[E0599]: no method named `iter` found for type `&G` in the current scope
error[E0599]: no method named `iter` found for reference `&G` in the current scope
--> $DIR/issue-13853.rs:27:23
|
LL | for node in graph.iter() {

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `homura` found for type `&'static str` in the current scope
error[E0599]: no method named `homura` found for reference `&'static str` in the current scope
--> $DIR/issue-19521.rs:2:8
|
LL | "".homura()();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `kaname` found for type `Homura` in the current scope
error[E0599]: no method named `kaname` found for struct `Homura` in the current scope
--> $DIR/issue-19692.rs:4:40
|
LL | struct Homura;

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `to_string` found for type `*const u8` in the current scope
error[E0599]: no method named `to_string` found for raw pointer `*const u8` in the current scope
--> $DIR/issue-21596.rs:4:22
|
LL | println!("{}", z.to_string());

View File

@ -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 for type `Delicious`
//~^ ERROR no variant or associated item named `PIE` found
}
fn main() {}

View File

@ -1,4 +1,4 @@
error[E0599]: no variant or associated item named `PIE` found for type `Delicious` in the current scope
error[E0599]: no variant or associated item named `PIE` found for enum `Delicious` in the current scope
--> $DIR/issue-22933-2.rs:4:55
|
LL | enum Delicious {

View File

@ -1,4 +1,4 @@
const FOO: [u32; u8::MIN as usize] = [];
//~^ ERROR no associated item named `MIN` found for type `u8`
//~^ ERROR no associated item named `MIN` found
fn main() {}

View File

@ -7,7 +7,7 @@ fn use_token(token: &Token) { unimplemented!() }
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 for type
Struct::method; //~ ERROR no function or associated item named `method` found for type
Struct::Assoc; //~ ERROR no associated item named `Assoc` found for type `Struct` in
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
}

View File

@ -1,4 +1,4 @@
error[E0599]: no variant or associated item named `Homura` found for type `Token` in the current scope
error[E0599]: no variant or associated item named `Homura` found for enum `Token` in the current scope
--> $DIR/issue-23173.rs:9:23
|
LL | enum Token { LeftParen, RightParen, Plus, Minus, /* etc */ }
@ -7,7 +7,7 @@ LL | enum Token { LeftParen, RightParen, Plus, Minus, /* etc */ }
LL | use_token(&Token::Homura);
| ^^^^^^ variant or associated item not found in `Token`
error[E0599]: no function or associated item named `method` found for type `Struct` in the current scope
error[E0599]: no function or associated item named `method` found for struct `Struct` in the current scope
--> $DIR/issue-23173.rs:10:13
|
LL | struct Struct {
@ -16,7 +16,7 @@ LL | struct Struct {
LL | Struct::method();
| ^^^^^^ function or associated item not found in `Struct`
error[E0599]: no function or associated item named `method` found for type `Struct` in the current scope
error[E0599]: no function or associated item named `method` found for struct `Struct` in the current scope
--> $DIR/issue-23173.rs:11:13
|
LL | struct Struct {
@ -25,7 +25,7 @@ LL | struct Struct {
LL | Struct::method;
| ^^^^^^ function or associated item not found in `Struct`
error[E0599]: no associated item named `Assoc` found for type `Struct` in the current scope
error[E0599]: no associated item named `Assoc` found for struct `Struct` in the current scope
--> $DIR/issue-23173.rs:12:13
|
LL | struct Struct {

View File

@ -1,5 +1,5 @@
pub enum SomeEnum {
B = SomeEnum::A, //~ ERROR no variant or associated item named `A` found for type `SomeEnum`
B = SomeEnum::A, //~ ERROR no variant or associated item named `A` found
}
fn main() {}

View File

@ -1,4 +1,4 @@
error[E0599]: no variant or associated item named `A` found for type `SomeEnum` in the current scope
error[E0599]: no variant or associated item named `A` found for enum `SomeEnum` in the current scope
--> $DIR/issue-23217.rs:2:19
|
LL | pub enum SomeEnum {

View File

@ -1,6 +1,6 @@
macro_rules! foo {
($e:expr) => { $e.foo() }
//~^ ERROR no method named `foo` found for type `i32` in the current scope
//~^ ERROR no method named `foo` found
}
fn main() {
@ -8,5 +8,5 @@ fn main() {
foo!(a);
foo!(1i32.foo());
//~^ ERROR no method named `foo` found for type `i32` in the current scope
//~^ ERROR no method named `foo` found
}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `clone` found for type `C` in the current scope
error[E0599]: no method named `clone` found for struct `C` in the current scope
--> $DIR/issue-2823.rs:13:16
|
LL | struct C {

View File

@ -4,7 +4,7 @@ error[E0191]: the value of the associated type `Output` (from trait `std::ops::B
LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
| ^^^^^^ help: specify the associated type: `BitXor<Output = Type>`
error[E0599]: no function or associated item named `bitor` found for type `dyn std::ops::BitXor<_>` in the current scope
error[E0599]: no function or associated item named `bitor` found for trait object `dyn std::ops::BitXor<_>` in the current scope
--> $DIR/issue-28344.rs:4:25
|
LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
@ -19,7 +19,7 @@ error[E0191]: the value of the associated type `Output` (from trait `std::ops::B
LL | let g = BitXor::bitor;
| ^^^^^^ help: specify the associated type: `BitXor<Output = Type>`
error[E0599]: no function or associated item named `bitor` found for type `dyn std::ops::BitXor<_>` in the current scope
error[E0599]: no function or associated item named `bitor` found for trait object `dyn std::ops::BitXor<_>` in the current scope
--> $DIR/issue-28344.rs:8:21
|
LL | let g = BitXor::bitor;

View File

@ -2,6 +2,6 @@
pub trait Foo {}
impl Foo for [u8; usize::BYTES] {}
//~^ ERROR no associated item named `BYTES` found for type `usize`
//~^ ERROR no associated item named `BYTES` found
fn main() { }

View File

@ -5,7 +5,7 @@ fn main(){
foo(|| {
match Foo::Bar(1) {
Foo::Baz(..) => (),
//~^ ERROR no variant or associated item named `Baz` found for type `Foo`
//~^ ERROR no variant or associated item named `Baz` found
_ => (),
}
});

View File

@ -1,4 +1,4 @@
error[E0599]: no variant or associated item named `Baz` found for type `Foo` in the current scope
error[E0599]: no variant or associated item named `Baz` found for enum `Foo` in the current scope
--> $DIR/issue-28971.rs:7:18
|
LL | enum Foo {

View File

@ -13,7 +13,7 @@ fn func() -> Ret {
fn main() {
Obj::func.x();
//~^ ERROR no method named `x` found for type `fn() -> Ret {Obj::func}` in the current scope
//~^ ERROR no method named `x` found
func.x();
//~^ ERROR no method named `x` found for type `fn() -> Ret {func}` in the current scope
//~^ ERROR no method named `x` found
}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `x` found for type `fn() -> Ret {Obj::func}` in the current scope
error[E0599]: no method named `x` found for fn item `fn() -> Ret {Obj::func}` in the current scope
--> $DIR/issue-29124.rs:15:15
|
LL | Obj::func.x();
@ -6,7 +6,7 @@ LL | Obj::func.x();
|
= note: Obj::func is a function, perhaps you wish to call it
error[E0599]: no method named `x` found for type `fn() -> Ret {func}` in the current scope
error[E0599]: no method named `x` found for fn item `fn() -> Ret {func}` in the current scope
--> $DIR/issue-29124.rs:17:10
|
LL | func.x();

View File

@ -5,5 +5,5 @@ use issue_30123_aux::*;
fn main() {
let ug = Graph::<i32, i32>::new_undirected();
//~^ ERROR no function or associated item named `new_undirected` found for type
//~^ ERROR no function or associated item named `new_undirected` found
}

View File

@ -1,4 +1,4 @@
error[E0599]: no function or associated item named `new_undirected` found for type `issue_30123_aux::Graph<i32, i32>` in the current scope
error[E0599]: no function or associated item 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();

View File

@ -7,7 +7,7 @@ LL | .cloned()
= note: expected type `u8`
found reference `&_`
error[E0599]: no method named `collect` found for type `std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>` in the current scope
error[E0599]: no method named `collect` found for struct `std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>` in the current scope
--> $DIR/issue-31173.rs:14:10
|
LL | .collect();

View File

@ -1,4 +1,4 @@
fn main() {
let baz = ().foo(); //~ ERROR no method named `foo` found for type `()` in the current scope
let baz = ().foo(); //~ ERROR no method named `foo` found
<i32 as std::str::FromStr>::from_str(&baz); // No complaints about `str` being unsized
}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `foo` found for type `()` in the current scope
error[E0599]: no method named `foo` found for unit type `()` in the current scope
--> $DIR/issue-33575.rs:2:18
|
LL | let baz = ().foo();

View File

@ -4,7 +4,7 @@ enum S {
fn bug(l: S) {
match l {
S::B {} => {}, //~ ERROR no variant `B` in enum `S`
S::B {} => {}, //~ ERROR no variant named `B` found for enum `S`
}
}

View File

@ -1,4 +1,4 @@
error: no variant `B` in enum `S`
error[E0599]: no variant named `B` found for enum `S`
--> $DIR/issue-34209.rs:7:12
|
LL | enum S {
@ -9,3 +9,4 @@ LL | S::B {} => {},
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.

View File

@ -7,5 +7,5 @@ fn main () {
//~| ERROR expected expression, found reserved identifier `_`
//~| ERROR expected expression, found reserved identifier `_`
let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_receiver)| {}).collect();
//~^ ERROR no method named `iter` found for type `()` in the current scope
//~^ ERROR no method named `iter` found
}

View File

@ -43,7 +43,7 @@ LL | let sr: Vec<(u32, _, _) = vec![];
| |
| cannot assign to this expression
error[E0599]: no method named `iter` found for type `()` in the current scope
error[E0599]: no method named `iter` found for unit type `()` in the current scope
--> $DIR/issue-34334.rs:9:36
|
LL | let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_receiver)| {}).collect();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `is_subset` found for type `&std::collections::HashSet<T>` in the current scope
error[E0599]: no method named `is_subset` found for reference `&std::collections::HashSet<T>` in the current scope
--> $DIR/issue-35677.rs:4:10
|
LL | this.is_subset(other)

View File

@ -7,7 +7,7 @@ impl Obj {
return 1+1 == 2
}
pub fn chirp(&self) {
self.boom(); //~ ERROR no method named `boom` found for type `&Obj` in the current scope
self.boom(); //~ ERROR no method named `boom` found
}
}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `boom` found for type `&Obj` in the current scope
error[E0599]: no method named `boom` found for reference `&Obj` in the current scope
--> $DIR/issue-3707.rs:10:14
|
LL | self.boom();

View File

@ -1,5 +1,5 @@
fn foo<T: Iterator>() {
T::Item; //~ ERROR no associated item named `Item` found for type `T` in the current scope
T::Item; //~ ERROR no associated item named `Item` found
}
fn main() { }

View File

@ -1,4 +1,4 @@
error[E0599]: no associated item named `Item` found for type `T` in the current scope
error[E0599]: no associated item named `Item` found for type parameter `T` in the current scope
--> $DIR/issue-38919.rs:2:8
|
LL | T::Item;

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `exec` found for type `&mut std::process::Command` in the current scope
error[E0599]: no method named `exec` found for mutable reference `&mut std::process::Command` in the current scope
--> $DIR/issue-39175.rs:15:39
|
LL | Command::new("echo").arg("hello").exec();

View File

@ -12,7 +12,7 @@ impl Dim for Dim3 {
pub struct Vector<T, D: Dim> {
entries: [T; D::dim()],
//~^ ERROR no function or associated item named `dim` found for type `D` in the current scope
//~^ ERROR no function or associated item named `dim` found
_dummy: D,
}

View File

@ -1,4 +1,4 @@
error[E0599]: no function or associated item named `dim` found for type `D` in the current scope
error[E0599]: no function or associated item named `dim` found for type parameter `D` in the current scope
--> $DIR/issue-39559.rs:14:21
|
LL | entries: [T; D::dim()],

View File

@ -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 type `Point`
//~^ ERROR no function or associated item named `new` found for struct `Point`
println!("{}", p.to_string());
}

View File

@ -7,7 +7,7 @@ LL | | Point { x: x, y: y }
LL | | }
| |_____^ not a member of trait `ToString_`
error[E0599]: no function or associated item named `new` found for type `Point` in the current scope
error[E0599]: no function or associated item named `new` found for struct `Point` in the current scope
--> $DIR/issue-3973.rs:22:20
|
LL | struct Point {

View File

@ -25,5 +25,5 @@ impl<T: Clone, F> Iterator for Iterate<T, F> where F: Fn(&T) -> T {
fn main() {
let a = iterate(0, |x| x+1);
println!("{:?}", a.iter().take(10).collect::<Vec<usize>>());
//~^ ERROR no method named `iter` found for type `Iterate<{integer}
//~^ ERROR no method named `iter` found
}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `iter` found for type `Iterate<{integer}, [closure@$DIR/issue-41880.rs:26:24: 26:31]>` in the current scope
error[E0599]: no method named `iter` found for struct `Iterate<{integer}, [closure@$DIR/issue-41880.rs:26:24: 26:31]>` in the current scope
--> $DIR/issue-41880.rs:27:24
|
LL | pub struct Iterate<T, F> {

View File

@ -1,4 +1,4 @@
error[E0599]: no associated item named `String` found for type `std::string::String` in the current scope
error[E0599]: no associated item named `String` found for struct `std::string::String` in the current scope
--> $DIR/issue-42880.rs:4:22
|
LL | let f = |&Value::String(_)| ();

View File

@ -8,5 +8,5 @@
extern crate xcrate_issue_43189_b;
fn main() {
().a();
//~^ ERROR no method named `a` found for type `()` in the current scope [E0599]
//~^ ERROR no method named `a` found
}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `a` found for type `()` in the current scope
error[E0599]: no method named `a` found for unit type `()` in the current scope
--> $DIR/issue-43189.rs:10:8
|
LL | ().a();

View File

@ -1,4 +1,4 @@
fn main() {
let _result = &Some(42).as_deref();
//~^ ERROR no method named `as_deref` found for type `std::option::Option<{integer}>`
//~^ ERROR no method named `as_deref` found for enum `std::option::Option<{integer}>`
}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `as_deref` found for type `std::option::Option<{integer}>` in the current scope
error[E0599]: no method named `as_deref` found for enum `std::option::Option<{integer}>` in the current scope
--> $DIR/option-as_deref.rs:2:29
|
LL | let _result = &Some(42).as_deref();

View File

@ -1,4 +1,4 @@
fn main() {
let _result = &mut Some(42).as_deref_mut();
//~^ ERROR no method named `as_deref_mut` found for type `std::option::Option<{integer}>`
//~^ ERROR no method named `as_deref_mut` found for enum `std::option::Option<{integer}>`
}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `as_deref_mut` found for type `std::option::Option<{integer}>` in the current scope
error[E0599]: no method named `as_deref_mut` found for enum `std::option::Option<{integer}>` in the current scope
--> $DIR/option-as_deref_mut.rs:2:33
|
LL | let _result = &mut Some(42).as_deref_mut();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `as_deref` found for type `std::result::Result<{integer}, _>` in the current scope
error[E0599]: no method named `as_deref` found for enum `std::result::Result<{integer}, _>` in the current scope
--> $DIR/result-as_deref.rs:4:27
|
LL | let _result = &Ok(42).as_deref();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `as_deref_err` found for type `std::result::Result<_, {integer}>` in the current scope
error[E0599]: no method named `as_deref_err` found for enum `std::result::Result<_, {integer}>` in the current scope
--> $DIR/result-as_deref_err.rs:4:28
|
LL | let _result = &Err(41).as_deref_err();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `as_deref_mut` found for type `std::result::Result<{integer}, _>` in the current scope
error[E0599]: no method named `as_deref_mut` found for enum `std::result::Result<{integer}, _>` in the current scope
--> $DIR/result-as_deref_mut.rs:4:31
|
LL | let _result = &mut Ok(42).as_deref_mut();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `as_deref_mut_err` found for type `std::result::Result<_, {integer}>` in the current scope
error[E0599]: no method named `as_deref_mut_err` found for enum `std::result::Result<_, {integer}>` in the current scope
--> $DIR/result-as_deref_mut_err.rs:4:32
|
LL | let _result = &mut Err(41).as_deref_mut_err();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `as_deref_mut_ok` found for type `std::result::Result<{integer}, _>` in the current scope
error[E0599]: no method named `as_deref_mut_ok` found for enum `std::result::Result<{integer}, _>` in the current scope
--> $DIR/result-as_deref_mut_ok.rs:4:31
|
LL | let _result = &mut Ok(42).as_deref_mut_ok();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `as_deref_ok` found for type `std::result::Result<{integer}, _>` in the current scope
error[E0599]: no method named `as_deref_ok` found for enum `std::result::Result<{integer}, _>` in the current scope
--> $DIR/result-as_deref_ok.rs:4:27
|
LL | let _result = &Ok(42).as_deref_ok();

View File

@ -8,5 +8,5 @@ impl Foo for isize {
fn main() {
(&5isize as &dyn Foo).foo();
//~^ ERROR: no method named `foo` found for type `&dyn Foo` in the current scope
//~^ ERROR: no method named `foo` found for reference `&dyn Foo` in the current scope
}

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `foo` found for type `&dyn Foo` in the current scope
error[E0599]: no method named `foo` found for reference `&dyn Foo` in the current scope
--> $DIR/issue-5153.rs:10:27
|
LL | (&5isize as &dyn Foo).foo();

View File

@ -4,7 +4,7 @@ error[E0616]: field `inner` of struct `std::sync::Mutex` is private
LL | let _ = test.comps.inner.lock().unwrap();
| ^^^^^^^^^^^^^^^^
error[E0599]: no method named `unwrap` found for type `std::sys_common::mutex::MutexGuard<'_>` in the current scope
error[E0599]: no method named `unwrap` found for struct `std::sys_common::mutex::MutexGuard<'_>` in the current scope
--> $DIR/issue-54062.rs:10:37
|
LL | let _ = test.comps.inner.lock().unwrap();

View File

@ -1,4 +1,4 @@
error[E0599]: no method named `f` found for type `fn(&u8)` in the current scope
error[E0599]: no method named `f` found for fn pointer `fn(&u8)` in the current scope
--> $DIR/issue-57362-1.rs:20:7
|
LL | a.f();

View File

@ -1,4 +1,4 @@
error[E0599]: no function or associated item named `make_g` found for type `for<'r> fn(&'r ())` in the current scope
error[E0599]: no function or associated item named `make_g` found for fn pointer `for<'r> fn(&'r ())` in the current scope
--> $DIR/issue-57362-2.rs:22:25
|
LL | let x = <fn (&())>::make_g();

View File

@ -18,5 +18,5 @@ fn main() {
Trait::exists(());
// no object safety error
Trait::nonexistent(());
//~^ ERROR no function or associated item named `nonexistent` found for type `dyn Trait`
//~^ ERROR no function or associated item named `nonexistent` found
}

Some files were not shown because too many files have changed in this diff Show More