Give method not found a primary span label

This commit is contained in:
Esteban Küber 2019-09-06 12:00:07 -07:00
parent 2c0931e168
commit 5799fb419c
63 changed files with 101 additions and 98 deletions

View File

@ -425,6 +425,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
"private field"
};
err.span_label(item_name.span, format!("{}, not a method", field_kind));
} else if lev_candidate.is_none() && static_sources.is_empty() {
err.span_label(span, format!("{} not found in `{}`", item_kind, ty_str));
self.tcx.sess.trait_methods_not_found.borrow_mut().insert(orig_span);
}
} else {
err.span_label(span, format!("{} not found in `{}`", item_kind, ty_str));

View File

@ -12,7 +12,7 @@ error[E0599]: no method named `test` found for type `std::vec::Vec<{integer}>` i
--> $DIR/auto-ref-slice-plus-ref.rs:8:7
|
LL | a.test();
| ^^^^
| ^^^^ method not found in `std::vec::Vec<{integer}>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `test`, perhaps you need to implement it:
@ -22,7 +22,7 @@ error[E0599]: no method named `test` found for type `[{integer}; 1]` in the curr
--> $DIR/auto-ref-slice-plus-ref.rs:10:11
|
LL | ([1]).test();
| ^^^^
| ^^^^ method not found in `[{integer}; 1]`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `test`, perhaps you need to implement it:
@ -32,7 +32,7 @@ error[E0599]: no method named `test` found for type `&[{integer}; 1]` in the cur
--> $DIR/auto-ref-slice-plus-ref.rs:11:12
|
LL | (&[1]).test();
| ^^^^
| ^^^^ method not found in `&[{integer}; 1]`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `test`, perhaps you need to implement it:

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `eat` found for type `std::boxed::Box<dyn Noisy>`
--> $DIR/class-cast-to-trait.rs:53:8
|
LL | nyan.eat();
| ^^^
| ^^^ method not found in `std::boxed::Box<dyn Noisy>`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `the_fn` found for type `&Lib::TheStruct` in the c
--> $DIR/coherence_inherent.rs:35:11
|
LL | s.the_fn();
| ^^^^^^
| ^^^^^^ method not found in `&Lib::TheStruct`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `the_fn` found for type `&Lib::TheStruct` in the c
--> $DIR/coherence_inherent.rs:35:11
|
LL | s.the_fn();
| ^^^^^^
| ^^^^^^ method not found in `&Lib::TheStruct`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `the_fn` found for type `&coherence_inherent_cc_li
--> $DIR/coherence_inherent_cc.rs:26:11
|
LL | s.the_fn();
| ^^^^^^
| ^^^^^^ method not found in `&coherence_inherent_cc_lib::TheStruct`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `the_fn` found for type `&coherence_inherent_cc_li
--> $DIR/coherence_inherent_cc.rs:26:11
|
LL | s.the_fn();
| ^^^^^^
| ^^^^^^ method not found in `&coherence_inherent_cc_lib::TheStruct`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -11,7 +11,7 @@ LL | struct S;
| --------- method `f` not found for this
...
LL | S.f::<0>();
| ^
| ^ method not found in `S`
error[E0107]: wrong number of const arguments: expected 0, found 1
--> $DIR/invalid-const-arg-for-type-param.rs:8:9

View File

@ -5,7 +5,7 @@ LL | struct Foo {
| ---------- method `clone` not found for this
...
LL | let _y = x.clone();
| ^^^^^
| ^^^^^ method not found in `Foo`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `clone`, perhaps you need to implement it:

View File

@ -5,7 +5,7 @@ LL | struct Bar<T: Foo> {
| ------------------ method `clone` not found for this
...
LL | Bar::<NotClone> { x: 1 }.clone();
| ^^^^^
| ^^^^^ method not found in `Bar<NotClone>`
|
= note: the method `clone` exists but the following trait bounds were not satisfied:
`Bar<NotClone> : std::clone::Clone`

View File

@ -24,7 +24,7 @@ error[E0599]: no method named `z` found for type `&str` in the current scope
--> $DIR/error-festival.rs:16:7
|
LL | x.z();
| ^
| ^ method not found in `&str`
error[E0600]: cannot apply unary operator `!` to type `Question`
--> $DIR/error-festival.rs:19:5

View File

@ -22,7 +22,7 @@ LL | fn f() { ::bar::m!(); }
| ------------ in this macro invocation
...
LL | ().clone()
| ^^^^^
| ^^^^^ method not found in `()`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -5,7 +5,7 @@ LL | fn f() { ::baz::m!(); }
| ------------ in this macro invocation
...
LL | pub macro m() { ().f() }
| ^
| ^ method not found in `()`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -10,19 +10,19 @@ error[E0599]: no method named `count_ones` found for type `impl std::marker::Cop
--> $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
--> $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
--> $DIR/bindings-opaque.rs:15:17
|
LL | let _ = foo.count_ones();
| ^^^^^^^^^^
| ^^^^^^^^^^ method not found in `impl std::marker::Copy`
error: aborting due to 3 previous errors

View File

@ -5,7 +5,7 @@ LL | struct Bar;
| ----------- method `foo` not found for this
...
LL | f1.foo(1usize);
| ^^^
| ^^^ method not found in `Bar`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `foo`, perhaps you need to implement it:

View File

@ -5,7 +5,7 @@ LL | struct Foo;
| ----------- method `is_empty` not found for this
...
LL | foo(|s| s.is_empty());
| ^^^^^^^^
| ^^^^^^^^ method not found in `Foo`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `is_empty`, perhaps you need to implement it:

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `method` found for type `u32` in the current scope
--> $DIR/no-method-suggested-traits.rs:23:10
|
LL | 1u32.method();
| ^^^^^^
| ^^^^^^ method not found in `u32`
|
= help: items from traits can only be used if the trait is in scope
help: the following traits are implemented but not in scope, perhaps add a `use` for one of them:
@ -20,7 +20,7 @@ error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::box
--> $DIR/no-method-suggested-traits.rs:26:44
|
LL | std::rc::Rc::new(&mut Box::new(&1u32)).method();
| ^^^^^^
| ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&u32>>`
|
= help: items from traits can only be used if the trait is in scope
help: the following traits are implemented but not in scope, perhaps add a `use` for one of them:
@ -38,7 +38,7 @@ error[E0599]: no method named `method` found for type `char` in the current scop
--> $DIR/no-method-suggested-traits.rs:30:9
|
LL | 'a'.method();
| ^^^^^^
| ^^^^^^ method not found in `char`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
@ -58,7 +58,7 @@ LL | fn method(&self) {}
| the method is available for `std::rc::Rc<std::rc::Rc<&mut std::boxed::Box<&char>>>` here
...
LL | std::rc::Rc::new(&mut Box::new(&'a')).method();
| ^^^^^^
| ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&char>>`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
@ -70,7 +70,7 @@ error[E0599]: no method named `method` found for type `i32` in the current scope
--> $DIR/no-method-suggested-traits.rs:35:10
|
LL | 1i32.method();
| ^^^^^^
| ^^^^^^ method not found in `i32`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
@ -82,7 +82,7 @@ error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::box
--> $DIR/no-method-suggested-traits.rs:37:44
|
LL | std::rc::Rc::new(&mut Box::new(&1i32)).method();
| ^^^^^^
| ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&i32>>`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
@ -97,7 +97,7 @@ LL | struct Foo;
| ----------- method `method` not found for this
...
LL | Foo.method();
| ^^^^^^
| ^^^^^^ method not found in `Foo`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `method`, perhaps you need to implement one of them:
@ -110,7 +110,7 @@ error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::box
--> $DIR/no-method-suggested-traits.rs:42:43
|
LL | std::rc::Rc::new(&mut Box::new(&Foo)).method();
| ^^^^^^
| ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&Foo>>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `method`, perhaps you need to implement one of them:
@ -123,7 +123,7 @@ error[E0599]: no method named `method2` found for type `u64` in the current scop
--> $DIR/no-method-suggested-traits.rs:45:10
|
LL | 1u64.method2();
| ^^^^^^^
| ^^^^^^^ method not found in `u64`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `method2`, perhaps you need to implement it:
@ -133,7 +133,7 @@ error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::bo
--> $DIR/no-method-suggested-traits.rs:47:44
|
LL | std::rc::Rc::new(&mut Box::new(&1u64)).method2();
| ^^^^^^^
| ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&u64>>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `method2`, perhaps you need to implement it:
@ -143,7 +143,7 @@ error[E0599]: no method named `method2` found for type `no_method_suggested_trai
--> $DIR/no-method-suggested-traits.rs:50:37
|
LL | no_method_suggested_traits::Foo.method2();
| ^^^^^^^
| ^^^^^^^ method not found in `no_method_suggested_traits::Foo`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `method2`, perhaps you need to implement it:
@ -153,7 +153,7 @@ error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::bo
--> $DIR/no-method-suggested-traits.rs:52:71
|
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
| ^^^^^^^
| ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `method2`, perhaps you need to implement it:
@ -163,7 +163,7 @@ error[E0599]: no method named `method2` found for type `no_method_suggested_trai
--> $DIR/no-method-suggested-traits.rs:54:40
|
LL | no_method_suggested_traits::Bar::X.method2();
| ^^^^^^^
| ^^^^^^^ method not found in `no_method_suggested_traits::Bar`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `method2`, perhaps you need to implement it:
@ -173,7 +173,7 @@ error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::bo
--> $DIR/no-method-suggested-traits.rs:56:74
|
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
| ^^^^^^^
| ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `method2`, perhaps you need to implement it:
@ -186,7 +186,7 @@ LL | struct Foo;
| ----------- method `method3` not found for this
...
LL | Foo.method3();
| ^^^^^^^
| ^^^^^^^ method not found in `Foo`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `method3`, perhaps you need to implement it:
@ -196,7 +196,7 @@ error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::bo
--> $DIR/no-method-suggested-traits.rs:61:43
|
LL | std::rc::Rc::new(&mut Box::new(&Foo)).method3();
| ^^^^^^^
| ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&Foo>>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `method3`, perhaps you need to implement it:
@ -209,7 +209,7 @@ LL | enum Bar { X }
| -------- method `method3` not found for this
...
LL | Bar::X.method3();
| ^^^^^^^
| ^^^^^^^ method not found in `Bar`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `method3`, perhaps you need to implement it:
@ -219,7 +219,7 @@ error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::bo
--> $DIR/no-method-suggested-traits.rs:65:46
|
LL | std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
| ^^^^^^^
| ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&Bar>>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `method3`, perhaps you need to implement it:
@ -229,37 +229,37 @@ error[E0599]: no method named `method3` found for type `usize` in the current sc
--> $DIR/no-method-suggested-traits.rs:69:13
|
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
--> $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
--> $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
--> $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
--> $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
--> $DIR/no-method-suggested-traits.rs:75:74
|
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3();
| ^^^^^^^
| ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>`
error: aborting due to 24 previous errors

View File

@ -44,7 +44,7 @@ LL | struct Foo;
| ----------- method `bar` not found for this
...
LL | Foo.bar();
| ^^^
| ^^^ method not found in `Foo`
error: aborting due to 6 previous errors

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `foo` found for type `&b::B` in the current scope
--> $DIR/issue-10465.rs:17:15
|
LL | b.foo();
| ^^^
| ^^^ method not found in `&b::B`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -14,7 +14,7 @@ error[E0599]: no method named `iter` found for type `&G` in the current scope
--> $DIR/issue-13853.rs:27:23
|
LL | for node in graph.iter() {
| ^^^^
| ^^^^ method not found in `&G`
error[E0308]: mismatched types
--> $DIR/issue-13853.rs:37:13

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `push` found for type `!` in the current scope
--> $DIR/issue-15207.rs:3:15
|
LL | break.push(1)
| ^^^^
| ^^^^ method not found in `!`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `honk` found for type `{integer}` in the current s
--> $DIR/issue-1871.rs:7:9
|
LL | f.honk()
| ^^^^
| ^^^^ method not found in `{integer}`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `homura` found for type `&'static str` in the curr
--> $DIR/issue-19521.rs:2:8
|
LL | "".homura()();
| ^^^^^^
| ^^^^^^ method not found in `&'static str`
error: aborting due to previous error

View File

@ -5,7 +5,7 @@ LL | struct Homura;
| -------------- method `kaname` not found for this
...
LL | let Some(ref madoka) = Some(homura.kaname());
| ^^^^^^
| ^^^^^^ method not found in `Homura`
error: aborting due to previous error

View File

@ -10,7 +10,7 @@ error[E0599]: no method named `bind` found for type `[&str; 1]` in the current s
--> $DIR/issue-2149.rs:13:12
|
LL | ["hi"].bind(|x| [x] );
| ^^^^
| ^^^^ method not found in `[&str; 1]`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `bind`, perhaps you need to implement it:

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `to_string` found for type `*const u8` in the curr
--> $DIR/issue-21596.rs:4:22
|
LL | println!("{}", z.to_string());
| ^^^^^^^^^
| ^^^^^^^^^ method not found in `*const u8`
|
= note: try using `<*const T>::as_ref()` to get a reference to the type behind the pointer: https://doc.rust-lang.org/std/primitive.pointer.html#method.as_ref
= note: using `<*const T>::as_ref()` on a pointer which is unaligned or points to invalid or uninitialized memory is undefined behavior

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `foo` found for type `i32` in the current scope
--> $DIR/issue-25385.rs:2:23
|
LL | ($e:expr) => { $e.foo() }
| ^^^
| ^^^ method not found in `i32`
...
LL | foo!(a);
| -------- in this macro invocation
@ -11,7 +11,7 @@ error[E0599]: no method named `foo` found for type `i32` in the current scope
--> $DIR/issue-25385.rs:10:15
|
LL | foo!(1i32.foo());
| ^^^
| ^^^ method not found in `i32`
error: aborting due to 2 previous errors

View File

@ -5,7 +5,7 @@ LL | struct C {
| -------- method `clone` not found for this
...
LL | let _d = c.clone();
| ^^^^^
| ^^^^^ method not found in `C`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `clone`, perhaps you need to implement it:

View File

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

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `homura` found for type `{integer}` in the current
--> $DIR/issue-29181.rs:6:7
|
LL | 0.homura();
| ^^^^^^
| ^^^^^^ method not found in `{integer}`
error: aborting due to previous error

View File

@ -11,7 +11,7 @@ error[E0599]: no method named `collect` found for type `std::iter::Cloned<std::i
--> $DIR/issue-31173.rs:14:10
|
LL | .collect();
| ^^^^^^^
| ^^^^^^^ method not found in `std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>`
|
= note: the method `collect` exists but the following trait bounds were not satisfied:
`&mut std::iter::Cloned<std::iter::TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>> : std::iter::Iterator`

View File

@ -45,7 +45,7 @@ error[E0599]: no method named `iter` found for 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();
| ^^^^
| ^^^^ method not found in `()`
error: aborting due to 7 previous errors

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `is_subset` found for type `&std::collections::Has
--> $DIR/issue-35677.rs:4:10
|
LL | this.is_subset(other)
| ^^^^^^^^^
| ^^^^^^^^^ method not found in `&std::collections::HashSet<T>`
|
= note: the method `is_subset` exists but the following trait bounds were not satisfied:
`T : std::cmp::Eq`

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `exec` found for type `&mut std::process::Command`
--> $DIR/issue-39175.rs:15:39
|
LL | Command::new("echo").arg("hello").exec();
| ^^^^
| ^^^^ method not found in `&mut std::process::Command`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -5,7 +5,7 @@ LL | pub struct Iterate<T, F> {
| ------------------------ method `iter` not found for this
...
LL | println!("{:?}", a.iter().take(10).collect::<Vec<usize>>());
| ^^^^
| ^^^^ method not found in `Iterate<{integer}, [closure@$DIR/issue-41880.rs:26:24: 26:31]>`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `a` found for type `()` in the current scope
--> $DIR/issue-43189.rs:10:8
|
LL | ().a();
| ^
| ^ method not found in `()`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_mut` found for type `std::option::Option
--> $DIR/option-as_deref_mut.rs:4:33
|
LL | let _result = &mut Some(42).as_deref_mut();
| ^^^^^^^^^^^^
| ^^^^^^^^^^^^ method not found in `std::option::Option<{integer}>`
|
= note: the method `as_deref_mut` exists but the following trait bounds were not satisfied:
`{integer} : std::ops::DerefMut`

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `foo` found for type `&dyn Foo` in the current sco
--> $DIR/issue-5153.rs:10:27
|
LL | (&5isize as &dyn Foo).foo();
| ^^^
| ^^^ method not found in `&dyn Foo`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `foo`, perhaps you need to implement it:

View File

@ -8,7 +8,7 @@ error[E0599]: no method named `unwrap` found for type `std::sys_common::mutex::M
--> $DIR/issue-54062.rs:10:37
|
LL | let _ = test.comps.inner.lock().unwrap();
| ^^^^^^
| ^^^^^^ method not found in `std::sys_common::mutex::MutexGuard<'_>`
error: aborting due to 2 previous errors

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `f` found for type `fn(&u8)` in the current scope
--> $DIR/issue-57362-1.rs:20:7
|
LL | a.f();
| ^
| ^ method not found in `fn(&u8)`
|
= note: a is a function, perhaps you wish to call it
= help: items from traits can only be used if the trait is implemented and in scope

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `fake` found for type `{integer}` in the current s
--> $DIR/macro-backtrace-invalid-internals.rs:5:13
|
LL | 1.fake()
| ^^^^
| ^^^^ method not found in `{integer}`
...
LL | fake_method_stmt!();
| -------------------- in this macro invocation
@ -42,7 +42,7 @@ error[E0599]: no method named `fake` found for type `{integer}` in the current s
--> $DIR/macro-backtrace-invalid-internals.rs:23:13
|
LL | 1.fake()
| ^^^^
| ^^^^ method not found in `{integer}`
...
LL | let _ = fake_method_expr!();
| ------------------- in this macro invocation

View File

@ -32,7 +32,7 @@ LL | pub struct Foo;
| --------------- method `take` not found for this
...
LL | .take()
| ^^^^
| ^^^^ method not found in `Foo`
|
= note: the method `take` exists but the following trait bounds were not satisfied:
`&mut Foo : std::iter::Iterator`

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `count` found for type `std::iter::Filter<std::ite
--> $DIR/issue-36053-2.rs:7:55
|
LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
| ^^^^^
| ^^^^^ method not found in `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>`
|
= note: the method `count` exists but the following trait bounds were not satisfied:
`&mut std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]> : std::iter::Iterator`

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `unwrap` found for type `std::result::Result<(), F
--> $DIR/method-help-unsatisfied-bound.rs:5:7
|
LL | a.unwrap();
| ^^^^^^
| ^^^^^^ method not found in `std::result::Result<(), Foo>`
|
= note: the method `unwrap` exists but the following trait bounds were not satisfied:
`Foo : std::fmt::Debug`

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `clone` found for type `libc::c_void` in the curre
--> $DIR/non-copyable-void.rs:11:23
|
LL | let _z = (*y).clone();
| ^^^^^
| ^^^^^ method not found in `libc::c_void`
error: aborting due to previous error

View File

@ -5,7 +5,7 @@ LL | struct Foo {
| ---------- method `clone` not found for this
...
LL | let _y = x.clone();
| ^^^^^
| ^^^^^ method not found in `Foo`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `clone`, perhaps you need to implement it:

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `owned` found for type `&dyn Foo` in the current s
--> $DIR/object-pointer-types.rs:11:7
|
LL | x.owned();
| ^^^^^
| ^^^^^ method not found in `&dyn Foo`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `owned`, perhaps you need to implement it:
@ -12,7 +12,7 @@ error[E0599]: no method named `owned` found for type `&mut dyn Foo` in the curre
--> $DIR/object-pointer-types.rs:17:7
|
LL | x.owned();
| ^^^^^
| ^^^^^ method not found in `&mut dyn Foo`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `owned`, perhaps you need to implement it:
@ -22,7 +22,7 @@ error[E0599]: no method named `managed` found for type `std::boxed::Box<(dyn Foo
--> $DIR/object-pointer-types.rs:23:7
|
LL | x.managed();
| ^^^^^^^
| ^^^^^^^ method not found in `std::boxed::Box<(dyn Foo + 'static)>`
error: aborting due to 3 previous errors

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `foobar` found for type `u32` in the current scope
--> $DIR/trait-import-suggestions.rs:22:11
|
LL | x.foobar();
| ^^^^^^
| ^^^^^^ method not found in `u32`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:
@ -12,7 +12,7 @@ error[E0599]: no method named `bar` found for type `u32` in the current scope
--> $DIR/trait-import-suggestions.rs:28:7
|
LL | x.bar();
| ^^^
| ^^^ method not found in `u32`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
@ -24,7 +24,7 @@ error[E0599]: no method named `baz` found for type `u32` in the current scope
--> $DIR/trait-import-suggestions.rs:29:7
|
LL | x.baz();
| ^^^
| ^^^ method not found in `u32`
error[E0599]: no function or associated item named `from_str` found for type `u32` in the current scope
--> $DIR/trait-import-suggestions.rs:30:18

View File

@ -8,7 +8,7 @@ LL | fn foo(self: Box<Self>) {}
| --- the method is available for `std::boxed::Box<A>` here
...
LL | A.foo();
| ^^^
| ^^^ method not found in `A`
error: aborting due to previous error

View File

@ -7,7 +7,7 @@ LL | struct A;
| --------- method `foo` not found for this
...
LL | A.foo()
| ^^^
| ^^^ method not found in `A`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `foo`, perhaps you need to implement it:

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `f` found for type `()` in the current scope
--> $DIR/shadowed-trait-methods.rs:13:8
|
LL | ().f()
| ^
| ^ method not found in `()`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -5,7 +5,7 @@ LL | struct MyStruct;
| ---------------- method `foo_one` not found for this
...
LL | println!("{}", MyStruct.foo_one());
| ^^^^^^^
| ^^^^^^^ method not found in `MyStruct`
|
= note: the method `foo_one` exists but the following trait bounds were not satisfied:
`MyStruct : Foo`

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `hello` found for type `impl Foo` in the current s
--> $DIR/impl-trait-with-missing-trait-bounds-in-arg.rs:15:9
|
LL | foo.hello();
| ^^^^^
| ^^^^^ method not found in `impl Foo`
|
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `hello`, perhaps you need to restrict type parameter `impl Foo` with it:

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `method` found for type `&T` in the current scope
--> $DIR/issue-21673.rs:6:7
|
LL | x.method()
| ^^^^^^
| ^^^^^^ method not found in `&T`
|
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it:
@ -14,7 +14,7 @@ error[E0599]: no method named `method` found for type `T` in the current scope
--> $DIR/issue-21673.rs:10:7
|
LL | x.method()
| ^^^^^^
| ^^^^^^ method not found in `T`
|
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it:

View File

@ -23,7 +23,7 @@ error[E0599]: no method named `count_o` found for type `u32` in the current scop
--> $DIR/suggest-methods.rs:28:19
|
LL | let _ = 63u32.count_o();
| ^^^^^^^
| ^^^^^^^ method not found in `u32`
error: aborting due to 4 previous errors

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `foo` found for type `&i32` in the current scope
--> $DIR/trait-impl-1.rs:15:7
|
LL | x.foo();
| ^^^
| ^^^ method not found in `&i32`
error: aborting due to previous error

View File

@ -5,7 +5,7 @@ LL | struct S;
| --------- method `a` not found for this
...
LL | S.a();
| ^
| ^ method not found in `S`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `a`, perhaps you need to implement it:
@ -25,7 +25,7 @@ LL | fn b(&self) { }
| the method is available for `std::rc::Rc<S>` here
...
LL | S.b();
| ^
| ^ method not found in `S`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -12,7 +12,7 @@ error[E0599]: no method named `test` found for type `i32` in the current scope
--> $DIR/trivial-bounds-leak.rs:24:10
|
LL | 3i32.test();
| ^^^^
| ^^^^ method not found in `i32`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `test`, perhaps you need to implement it:

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `call` found for type `[closure@$DIR/unboxed-closu
--> $DIR/unboxed-closures-static-call-wrong-trait.rs:7:10
|
LL | mut_.call((0, ));
| ^^^^
| ^^^^ method not found in `[closure@$DIR/unboxed-closures-static-call-wrong-trait.rs:6:26: 6:31]`
|
= note: mut_ is a function, perhaps you wish to call it

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `deref` found for type `&()` in the current scope
--> $DIR/shadow.rs:19:11
|
LL | x.deref();
| ^^^^^
| ^^^^^ method not found in `&()`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:

View File

@ -13,7 +13,7 @@ LL | union U4<T> {
| ----------- method `clone` not found for this
...
LL | let w = u.clone();
| ^^^^^
| ^^^^^ method not found in `U4<CloneNoCopy>`
|
= note: the method `clone` exists but the following trait bounds were not satisfied:
`U4<CloneNoCopy> : std::clone::Clone`

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `clone` found for type `std::boxed::Box<dyn Foo>`
--> $DIR/unique-object-noncopyable.rs:24:16
|
LL | let _z = y.clone();
| ^^^^^
| ^^^^^ method not found in `std::boxed::Box<dyn Foo>`
|
= note: the method `clone` exists but the following trait bounds were not satisfied:
`std::boxed::Box<dyn Foo> : std::clone::Clone`

View File

@ -2,7 +2,7 @@ error[E0599]: no method named `clone` found for type `std::boxed::Box<R>` in the
--> $DIR/unique-pinned-nocopy.rs:12:16
|
LL | let _j = i.clone();
| ^^^^^
| ^^^^^ method not found in `std::boxed::Box<R>`
|
= note: the method `clone` exists but the following trait bounds were not satisfied:
`std::boxed::Box<R> : std::clone::Clone`