1
Fork 0

Tweak wording

This commit is contained in:
Esteban Küber 2020-02-18 18:36:56 -08:00
parent 0387f0d19b
commit 1e7bcc733a
14 changed files with 28 additions and 26 deletions

View file

@ -988,6 +988,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let action = if let Some(param) = param_type { let action = if let Some(param) = param_type {
format!("restrict type parameter `{}` with", param) format!("restrict type parameter `{}` with", param)
} else { } else {
// FIXME: it might only need to be imported into scope, not implemented.
"implement".to_string() "implement".to_string()
}; };
let mut use_note = true; let mut use_note = true;
@ -996,9 +997,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
err.span_label( err.span_label(
self.tcx.sess.source_map().def_span(span), self.tcx.sess.source_map().def_span(span),
&format!( &format!(
"`{}` defines an item `{}`", "`{}` defines an item `{}`, perhaps you need to {} it",
self.tcx.def_path_str(trait_info.def_id), self.tcx.def_path_str(trait_info.def_id),
item_name item_name,
action
), ),
); );
use_note = false use_note = false

View file

@ -2,7 +2,7 @@ error[E0599]: no associated item named `ID` found for type `i32` in the current
--> $DIR/associated-const-no-item.rs:5:23 --> $DIR/associated-const-no-item.rs:5:23
| |
LL | trait Foo { LL | trait Foo {
| --------- `Foo` defines an item `ID` | --------- `Foo` defines an item `ID`, perhaps you need to implement it
... ...
LL | const X: i32 = <i32>::ID; LL | const X: i32 = <i32>::ID;
| ^^ associated item not found in `i32` | ^^ associated item not found in `i32`

View file

@ -5,7 +5,7 @@ LL | a.test_mut();
| ^^^^^^^^ help: there is a method with a similar name: `get_mut` | ^^^^^^^^ help: there is a method with a similar name: `get_mut`
... ...
LL | trait MyIter { LL | trait MyIter {
| ------------ `MyIter` defines an item `test_mut` | ------------ `MyIter` defines an item `test_mut`, perhaps you need to implement it
| |
= help: items from traits can only be used if the trait is implemented and in scope = help: items from traits can only be used if the trait is implemented and in scope
@ -16,7 +16,7 @@ LL | a.test();
| ^^^^ method not found in `std::vec::Vec<{integer}>` | ^^^^ method not found in `std::vec::Vec<{integer}>`
... ...
LL | trait MyIter { LL | trait MyIter {
| ------------ `MyIter` defines an item `test` | ------------ `MyIter` defines an item `test`, perhaps you need to implement it
| |
= help: items from traits can only be used if the trait is implemented and in scope = help: items from traits can only be used if the trait is implemented and in scope
@ -27,7 +27,7 @@ LL | ([1]).test();
| ^^^^ method not found in `[{integer}; 1]` | ^^^^ method not found in `[{integer}; 1]`
... ...
LL | trait MyIter { LL | trait MyIter {
| ------------ `MyIter` defines an item `test` | ------------ `MyIter` defines an item `test`, perhaps you need to implement it
| |
= help: items from traits can only be used if the trait is implemented and in scope = help: items from traits can only be used if the trait is implemented and in scope
@ -38,7 +38,7 @@ LL | (&[1]).test();
| ^^^^ method not found in `&[{integer}; 1]` | ^^^^ method not found in `&[{integer}; 1]`
... ...
LL | trait MyIter { LL | trait MyIter {
| ------------ `MyIter` defines an item `test` | ------------ `MyIter` defines an item `test`, perhaps you need to implement it
| |
= help: items from traits can only be used if the trait is implemented and in scope = 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 `foo` found for struct `Bar` in the current scope
--> $DIR/issue-21659-show-relevant-trait-impls-3.rs:20:8 --> $DIR/issue-21659-show-relevant-trait-impls-3.rs:20:8
| |
LL | trait Foo<A> { LL | trait Foo<A> {
| ------------ `Foo` defines an item `foo` | ------------ `Foo` defines an item `foo`, perhaps you need to implement it
... ...
LL | struct Bar; LL | struct Bar;
| ----------- method `foo` not found for this | ----------- method `foo` not found for this

View file

@ -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 --> $DIR/no-method-suggested-traits.rs:45:10
| |
LL | pub trait Bar { LL | pub trait Bar {
| ------------- `foo::Bar` defines an item `method2` | ------------- `foo::Bar` defines an item `method2`, perhaps you need to implement it
... ...
LL | 1u64.method2(); LL | 1u64.method2();
| ^^^^^^^ method not found in `u64` | ^^^^^^^ method not found in `u64`
@ -134,7 +134,7 @@ error[E0599]: no method named `method2` found for struct `std::rc::Rc<&mut std::
--> $DIR/no-method-suggested-traits.rs:47:44 --> $DIR/no-method-suggested-traits.rs:47:44
| |
LL | pub trait Bar { LL | pub trait Bar {
| ------------- `foo::Bar` defines an item `method2` | ------------- `foo::Bar` defines an item `method2`, perhaps you need to implement it
... ...
LL | std::rc::Rc::new(&mut Box::new(&1u64)).method2(); LL | std::rc::Rc::new(&mut Box::new(&1u64)).method2();
| ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&u64>>` | ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&u64>>`
@ -145,7 +145,7 @@ error[E0599]: no method named `method2` found for struct `no_method_suggested_tr
--> $DIR/no-method-suggested-traits.rs:50:37 --> $DIR/no-method-suggested-traits.rs:50:37
| |
LL | pub trait Bar { LL | pub trait Bar {
| ------------- `foo::Bar` defines an item `method2` | ------------- `foo::Bar` defines an item `method2`, perhaps you need to implement it
... ...
LL | no_method_suggested_traits::Foo.method2(); LL | no_method_suggested_traits::Foo.method2();
| ^^^^^^^ method not found in `no_method_suggested_traits::Foo` | ^^^^^^^ method not found in `no_method_suggested_traits::Foo`
@ -156,7 +156,7 @@ error[E0599]: no method named `method2` found for struct `std::rc::Rc<&mut std::
--> $DIR/no-method-suggested-traits.rs:52:71 --> $DIR/no-method-suggested-traits.rs:52:71
| |
LL | pub trait Bar { LL | pub trait Bar {
| ------------- `foo::Bar` defines an item `method2` | ------------- `foo::Bar` defines an item `method2`, perhaps you need to implement it
... ...
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2(); 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>>` | ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>`
@ -167,7 +167,7 @@ error[E0599]: no method named `method2` found for enum `no_method_suggested_trai
--> $DIR/no-method-suggested-traits.rs:54:40 --> $DIR/no-method-suggested-traits.rs:54:40
| |
LL | pub trait Bar { LL | pub trait Bar {
| ------------- `foo::Bar` defines an item `method2` | ------------- `foo::Bar` defines an item `method2`, perhaps you need to implement it
... ...
LL | no_method_suggested_traits::Bar::X.method2(); LL | no_method_suggested_traits::Bar::X.method2();
| ^^^^^^^ method not found in `no_method_suggested_traits::Bar` | ^^^^^^^ method not found in `no_method_suggested_traits::Bar`
@ -178,7 +178,7 @@ error[E0599]: no method named `method2` found for struct `std::rc::Rc<&mut std::
--> $DIR/no-method-suggested-traits.rs:56:74 --> $DIR/no-method-suggested-traits.rs:56:74
| |
LL | pub trait Bar { LL | pub trait Bar {
| ------------- `foo::Bar` defines an item `method2` | ------------- `foo::Bar` defines an item `method2`, perhaps you need to implement it
... ...
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2(); 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>>` | ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>`

View file

@ -2,7 +2,7 @@ error[E0599]: no method named `foo` found for reference `&dyn Foo` in the curren
--> $DIR/issue-5153.rs:10:27 --> $DIR/issue-5153.rs:10:27
| |
LL | trait Foo { LL | trait Foo {
| --------- `Foo` defines an item `foo` | --------- `Foo` defines an item `foo`, perhaps you need to implement it
... ...
LL | (&5isize as &dyn Foo).foo(); LL | (&5isize as &dyn Foo).foo();
| ^^^ method not found in `&dyn Foo` | ^^^ method not found in `&dyn Foo`

View file

@ -2,7 +2,7 @@ error[E0599]: no method named `f` found for fn pointer `fn(&u8)` in the current
--> $DIR/issue-57362-1.rs:20:7 --> $DIR/issue-57362-1.rs:20:7
| |
LL | trait Trait { LL | trait Trait {
| ----------- `Trait` defines an item `f` | ----------- `Trait` defines an item `f`, perhaps you need to implement it
... ...
LL | a.f(); LL | a.f();
| ^ method not found in `fn(&u8)` | ^ method not found in `fn(&u8)`

View file

@ -2,7 +2,7 @@ error[E0599]: no function or associated item named `make_g` found for fn pointer
--> $DIR/issue-57362-2.rs:22:25 --> $DIR/issue-57362-2.rs:22:25
| |
LL | trait X { LL | trait X {
| ------- `X` defines an item `make_g` | ------- `X` defines an item `make_g`, perhaps you need to implement it
... ...
LL | let x = <fn (&())>::make_g(); LL | let x = <fn (&())>::make_g();
| ^^^^^^ function or associated item not found in `for<'r> fn(&'r ())` | ^^^^^^ function or associated item not found in `for<'r> fn(&'r ())`

View file

@ -10,7 +10,7 @@ error[E0599]: no method named `bind` found for array `[&str; 1]` in the current
--> $DIR/issue-2149.rs:13:12 --> $DIR/issue-2149.rs:13:12
| |
LL | trait VecMonad<A> { LL | trait VecMonad<A> {
| ----------------- `VecMonad` defines an item `bind` | ----------------- `VecMonad` defines an item `bind`, perhaps you need to implement it
... ...
LL | ["hi"].bind(|x| [x] ); LL | ["hi"].bind(|x| [x] );
| ^^^^ method not found in `[&str; 1]` | ^^^^ method not found in `[&str; 1]`

View file

@ -2,7 +2,7 @@ error[E0599]: no method named `owned` found for reference `&dyn Foo` in the curr
--> $DIR/object-pointer-types.rs:11:7 --> $DIR/object-pointer-types.rs:11:7
| |
LL | trait Foo { LL | trait Foo {
| --------- `Foo` defines an item `owned` | --------- `Foo` defines an item `owned`, perhaps you need to implement it
... ...
LL | x.owned(); LL | x.owned();
| ^^^^^ method not found in `&dyn Foo` | ^^^^^ method not found in `&dyn Foo`
@ -13,7 +13,7 @@ error[E0599]: no method named `owned` found for mutable reference `&mut dyn Foo`
--> $DIR/object-pointer-types.rs:17:7 --> $DIR/object-pointer-types.rs:17:7
| |
LL | trait Foo { LL | trait Foo {
| --------- `Foo` defines an item `owned` | --------- `Foo` defines an item `owned`, perhaps you need to implement it
... ...
LL | x.owned(); LL | x.owned();
| ^^^^^ method not found in `&mut dyn Foo` | ^^^^^ method not found in `&mut dyn Foo`

View file

@ -4,7 +4,7 @@ error[E0599]: no method named `foo` found for struct `A` in the current scope
LL | trait B { fn foo(self: Box<Self>); } LL | trait B { fn foo(self: Box<Self>); }
| ------- --- the method is available for `std::boxed::Box<A>` here | ------- --- the method is available for `std::boxed::Box<A>` here
| | | |
| `B` defines an item `foo` | `B` defines an item `foo`, perhaps you need to implement it
LL | struct A; LL | struct A;
| --------- method `foo` not found for this | --------- method `foo` not found for this
... ...

View file

@ -2,7 +2,7 @@ error[E0599]: no method named `foo_one` found for struct `MyStruct` in the curre
--> $DIR/specialization-trait-not-implemented.rs:22:29 --> $DIR/specialization-trait-not-implemented.rs:22:29
| |
LL | trait Foo { LL | trait Foo {
| --------- `Foo` defines an item `foo_one` | --------- `Foo` defines an item `foo_one`, perhaps you need to implement it
... ...
LL | struct MyStruct; LL | struct MyStruct;
| ---------------- | ----------------

View file

@ -5,7 +5,7 @@ LL | struct S;
| --------- method `a` not found for this | --------- method `a` not found for this
... ...
LL | trait A { LL | trait A {
| ------- `method::A` defines an item `a` | ------- `method::A` defines an item `a`, perhaps you need to implement it
... ...
LL | S.a(); LL | S.a();
| ^ method not found in `S` | ^ method not found in `S`
@ -47,7 +47,7 @@ LL | struct S;
| --------- function or associated item `a` not found for this | --------- function or associated item `a` not found for this
... ...
LL | trait A { LL | trait A {
| ------- `method::A` defines an item `a` | ------- `method::A` defines an item `a`, perhaps you need to implement it
... ...
LL | S::a(&S); LL | S::a(&S);
| ^ function or associated item not found in `S` | ^ function or associated item not found in `S`
@ -82,7 +82,7 @@ LL | struct S;
| --------- associated item `A` not found for this | --------- associated item `A` not found for this
... ...
LL | trait A { LL | trait A {
| ------- `assoc_const::A` defines an item `A` | ------- `assoc_const::A` defines an item `A`, perhaps you need to implement it
... ...
LL | S::A; LL | S::A;
| ^ associated item not found in `S` | ^ associated item not found in `S`

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 --> $DIR/trivial-bounds-leak.rs:24:10
| |
LL | pub trait Foo { LL | pub trait Foo {
| ------------- `Foo` defines an item `test` | ------------- `Foo` defines an item `test`, perhaps you need to implement it
... ...
LL | 3i32.test(); LL | 3i32.test();
| ^^^^ method not found in `i32` | ^^^^ method not found in `i32`