"cannot resolve" → "cannot satisfy"

This commit is contained in:
Esteban Küber 2020-04-04 19:47:50 -07:00
parent 49dc2f9f09
commit 0cd4c89366
17 changed files with 23 additions and 23 deletions

View File

@ -1377,7 +1377,7 @@ fn maybe_report_ambiguity(
return; return;
} }
let mut err = self.need_type_info_err(body_id, span, self_ty, ErrorCode::E0283); let mut err = self.need_type_info_err(body_id, span, self_ty, ErrorCode::E0283);
err.note(&format!("cannot resolve `{}`", predicate)); err.note(&format!("cannot satisfy `{}`", predicate));
if let ObligationCauseCode::ItemObligation(def_id) = obligation.cause.code { if let ObligationCauseCode::ItemObligation(def_id) = obligation.cause.code {
self.suggest_fully_qualified_path(&mut err, def_id, span, trait_ref.def_id()); self.suggest_fully_qualified_path(&mut err, def_id, span, trait_ref.def_id());
} else if let ( } else if let (
@ -1407,7 +1407,7 @@ fn maybe_report_ambiguity(
// LL | const fn const_val<T: Sized>() -> usize { // LL | const fn const_val<T: Sized>() -> usize {
// | --------- - required by this bound in `Tt::const_val` // | --------- - required by this bound in `Tt::const_val`
// | // |
// = note: cannot resolve `_: Tt` // = note: cannot satisfy `_: Tt`
err.span_suggestion_verbose( err.span_suggestion_verbose(
span.shrink_to_hi(), span.shrink_to_hi(),
@ -1457,7 +1457,7 @@ fn maybe_report_ambiguity(
return; return;
} }
let mut err = self.need_type_info_err(body_id, span, self_ty, ErrorCode::E0284); let mut err = self.need_type_info_err(body_id, span, self_ty, ErrorCode::E0284);
err.note(&format!("cannot resolve `{}`", predicate)); err.note(&format!("cannot satisfy `{}`", predicate));
err err
} }
@ -1469,10 +1469,10 @@ fn maybe_report_ambiguity(
self.tcx.sess, self.tcx.sess,
span, span,
E0284, E0284,
"type annotations needed: cannot resolve `{}`", "type annotations needed: cannot satisfy `{}`",
predicate, predicate,
); );
err.span_label(span, &format!("cannot resolve `{}`", predicate)); err.span_label(span, &format!("cannot satisfy `{}`", predicate));
err err
} }
}; };

View File

@ -10,7 +10,7 @@ LL | fn f() -> ([u8; A::C], [u8; A::C]);
| cannot infer type | cannot infer type
| help: use the fully qualified path to an implementation: `<Type as A>::C` | help: use the fully qualified path to an implementation: `<Type as A>::C`
| |
= note: cannot resolve `_: A` = note: cannot satisfy `_: A`
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl` = note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
error[E0283]: type annotations needed error[E0283]: type annotations needed
@ -25,7 +25,7 @@ LL | fn f() -> ([u8; A::C], [u8; A::C]);
| cannot infer type | cannot infer type
| help: use the fully qualified path to an implementation: `<Type as A>::C` | help: use the fully qualified path to an implementation: `<Type as A>::C`
| |
= note: cannot resolve `_: A` = note: cannot satisfy `_: A`
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl` = note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -22,7 +22,7 @@ LL | fn return_n(&self) -> [u8; Bar::X];
| cannot infer type | cannot infer type
| help: use the fully qualified path to an implementation: `<Type as Bar>::X` | help: use the fully qualified path to an implementation: `<Type as Bar>::X`
| |
= note: cannot resolve `_: Bar` = note: cannot satisfy `_: Bar`
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl` = note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -6,7 +6,7 @@ LL | trait Foo: Iterator<Item = i32> {}
LL | trait Bar: Foo<Item = u32> {} LL | trait Bar: Foo<Item = u32> {}
| ^^^^^^^^^^^^^^^ cannot infer type for type parameter `Self` | ^^^^^^^^^^^^^^^ cannot infer type for type parameter `Self`
| |
= note: cannot resolve `<Self as std::iter::Iterator>::Item == i32` = note: cannot satisfy `<Self as std::iter::Iterator>::Item == i32`
error[E0284]: type annotations needed error[E0284]: type annotations needed
--> $DIR/associated-types-overridden-binding.rs:7:21 --> $DIR/associated-types-overridden-binding.rs:7:21
@ -16,7 +16,7 @@ LL | trait I32Iterator = Iterator<Item = i32>;
LL | trait U32Iterator = I32Iterator<Item = u32>; LL | trait U32Iterator = I32Iterator<Item = u32>;
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `Self` | ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `Self`
| |
= note: cannot resolve `<Self as std::iter::Iterator>::Item == i32` = note: cannot satisfy `<Self as std::iter::Iterator>::Item == i32`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -4,7 +4,7 @@ error[E0284]: type annotations needed
LL | let x: isize = Foo::bar(); LL | let x: isize = Foo::bar();
| ^^^^^^^^ cannot infer type | ^^^^^^^^ cannot infer type
| |
= note: cannot resolve `<_ as Foo>::A == _` = note: cannot satisfy `<_ as Foo>::A == _`
error: aborting due to previous error error: aborting due to previous error

View File

@ -7,7 +7,7 @@ LL | fn create() -> u32;
LL | let cont: u32 = Generator::create(); LL | let cont: u32 = Generator::create();
| ^^^^^^^^^^^^^^^^^ cannot infer type | ^^^^^^^^^^^^^^^^^ cannot infer type
| |
= note: cannot resolve `_: Generator` = note: cannot satisfy `_: Generator`
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error[E0284]: type annotations needed
LL | self.input_stream(&mut stream); LL | self.input_stream(&mut stream);
| ^^^^^^^^^^^^ cannot infer type for type parameter `H` declared on the trait `StreamHash` | ^^^^^^^^^^^^ cannot infer type for type parameter `H` declared on the trait `StreamHash`
| |
= note: cannot resolve `<_ as StreamHasher>::S == <H as StreamHasher>::S` = note: cannot satisfy `<_ as StreamHasher>::S == <H as StreamHasher>::S`
error: aborting due to previous error error: aborting due to previous error

View File

@ -7,7 +7,7 @@ LL | trait Foo {
LL | where &'a T : Foo, LL | where &'a T : Foo,
| ^^^ cannot infer type for reference `&'a T` | ^^^ cannot infer type for reference `&'a T`
| |
= note: cannot resolve `&'a T: Foo` = note: cannot satisfy `&'a T: Foo`
error: aborting due to previous error error: aborting due to previous error

View File

@ -7,7 +7,7 @@ LL |
LL | impl <'l0, 'l1, T0> Trait1<'l0, T0> for bool where T0 : Trait0<'l0>, T0 : Trait0<'l1> {} LL | impl <'l0, 'l1, T0> Trait1<'l0, T0> for bool where T0 : Trait0<'l0>, T0 : Trait0<'l1> {}
| ^^^^^^^^^^^ cannot infer type for type parameter `T0` | ^^^^^^^^^^^ cannot infer type for type parameter `T0`
| |
= note: cannot resolve `T0: Trait0<'l0>` = note: cannot satisfy `T0: Trait0<'l0>`
error: aborting due to previous error error: aborting due to previous error

View File

@ -7,7 +7,7 @@ LL | trait Foo { fn xxx(&self); }
LL | let _ = <S5<_>>::xxx; LL | let _ = <S5<_>>::xxx;
| ^^^^^^^^^^^^ cannot infer type for struct `S5<_>` | ^^^^^^^^^^^^ cannot infer type for struct `S5<_>`
| |
= note: cannot resolve `S5<_>: Foo` = note: cannot satisfy `S5<_>: Foo`
error: aborting due to previous error error: aborting due to previous error

View File

@ -13,7 +13,7 @@ LL | const ARR_LEN: usize = Tt::const_val::<[i8; 123]>();
LL | const fn const_val<T: Sized>() -> usize { LL | const fn const_val<T: Sized>() -> usize {
| --------- - required by this bound in `Tt::const_val` | --------- - required by this bound in `Tt::const_val`
| |
= note: cannot resolve `_: Tt` = note: cannot satisfy `_: Tt`
error[E0080]: evaluation of constant value failed error[E0080]: evaluation of constant value failed
--> $DIR/issue-54954.rs:13:15 --> $DIR/issue-54954.rs:13:15

View File

@ -16,7 +16,7 @@ LL | fn new(slice: &[u8; Foo::SIZE]) -> Self;
| cannot infer type | cannot infer type
| help: use the fully qualified path to an implementation: `<Type as Foo>::SIZE` | help: use the fully qualified path to an implementation: `<Type as Foo>::SIZE`
| |
= note: cannot resolve `_: Foo` = note: cannot satisfy `_: Foo`
= note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl` = note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -4,7 +4,7 @@ error[E0284]: type annotations needed
LL | l.iter().map(f).collect()? LL | l.iter().map(f).collect()?
| ^^^^^^^ cannot infer type | ^^^^^^^ cannot infer type
| |
= note: cannot resolve `<_ as std::ops::Try>::Ok == _` = note: cannot satisfy `<_ as std::ops::Try>::Ok == _`
help: consider specifying the type argument in the method call help: consider specifying the type argument in the method call
| |
LL | l.iter().map(f).collect::<B>()? LL | l.iter().map(f).collect::<B>()?

View File

@ -7,7 +7,7 @@ LL | fn new() -> T;
LL | let _f: base::Foo = base::HasNew::new(); LL | let _f: base::Foo = base::HasNew::new();
| ^^^^^^^^^^^^^^^^^ cannot infer type | ^^^^^^^^^^^^^^^^^ cannot infer type
| |
= note: cannot resolve `_: base::HasNew<base::Foo>` = note: cannot satisfy `_: base::HasNew<base::Foo>`
error: aborting due to previous error error: aborting due to previous error

View File

@ -6,5 +6,5 @@ fn main() {
foo(42); foo(42);
//~^ ERROR type annotations needed //~^ ERROR type annotations needed
//~| NOTE cannot infer type //~| NOTE cannot infer type
//~| NOTE cannot resolve //~| NOTE cannot satisfy
} }

View File

@ -7,7 +7,7 @@ LL | fn foo<T: Into<String>>(x: i32) {}
LL | foo(42); LL | foo(42);
| ^^^ cannot infer type for type parameter `T` declared on the function `foo` | ^^^ cannot infer type for type parameter `T` declared on the function `foo`
| |
= note: cannot resolve `_: std::convert::Into<std::string::String>` = note: cannot satisfy `_: std::convert::Into<std::string::String>`
help: consider specifying the type argument in the function call help: consider specifying the type argument in the function call
| |
LL | foo::<T>(42); LL | foo::<T>(42);

View File

@ -7,7 +7,7 @@ LL | trait Foo: Sized {
LL | where &'a T : Foo, LL | where &'a T : Foo,
| ^^^ cannot infer type for reference `&'a T` | ^^^ cannot infer type for reference `&'a T`
| |
= note: cannot resolve `&'a T: Foo` = note: cannot satisfy `&'a T: Foo`
error: aborting due to previous error error: aborting due to previous error