Skip to content

"cannot resolve" → "cannot satisfy" #70798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/librustc_trait_selection/traits/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
return;
}
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 {
self.suggest_fully_qualified_path(&mut err, def_id, span, trait_ref.def_id());
} else if let (
Expand Down Expand Up @@ -1407,7 +1407,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
// LL | const fn const_val<T: Sized>() -> usize {
// | --------- - required by this bound in `Tt::const_val`
// |
// = note: cannot resolve `_: Tt`
// = note: cannot satisfy `_: Tt`

err.span_suggestion_verbose(
span.shrink_to_hi(),
Expand Down Expand Up @@ -1457,7 +1457,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
return;
}
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
}

Expand All @@ -1469,10 +1469,10 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
self.tcx.sess,
span,
E0284,
"type annotations needed: cannot resolve `{}`",
"type annotations needed: cannot satisfy `{}`",
predicate,
);
err.span_label(span, &format!("cannot resolve `{}`", predicate));
err.span_label(span, &format!("cannot satisfy `{}`", predicate));
err
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/associated-const/issue-63496.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LL | fn f() -> ([u8; A::C], [u8; A::C]);
| cannot infer type
| 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`

error[E0283]: type annotations needed
Expand All @@ -25,7 +25,7 @@ LL | fn f() -> ([u8; A::C], [u8; A::C]);
| cannot infer type
| 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`

error: aborting due to 2 previous errors
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/associated-item/issue-48027.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ LL | fn return_n(&self) -> [u8; Bar::X];
| cannot infer type
| 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`

error: aborting due to 2 previous errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | trait Foo: Iterator<Item = i32> {}
LL | trait Bar: Foo<Item = u32> {}
| ^^^^^^^^^^^^^^^ 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
--> $DIR/associated-types-overridden-binding.rs:7:21
Expand All @@ -16,7 +16,7 @@ LL | trait I32Iterator = Iterator<Item = i32>;
LL | trait U32Iterator = I32Iterator<Item = u32>;
| ^^^^^^^^^^^^^^^^^^^^^^^ 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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0284]: type annotations needed
LL | let x: isize = Foo::bar();
| ^^^^^^^^ cannot infer type
|
= note: cannot resolve `<_ as Foo>::A == _`
= note: cannot satisfy `<_ as Foo>::A == _`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0283.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | fn create() -> u32;
LL | let cont: u32 = Generator::create();
| ^^^^^^^^^^^^^^^^^ cannot infer type
|
= note: cannot resolve `_: Generator`
= note: cannot satisfy `_: Generator`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-12028.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0284]: type annotations needed
LL | self.input_stream(&mut stream);
| ^^^^^^^^^^^^ 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

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-21974.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | trait Foo {
LL | where &'a T : Foo,
| ^^^ 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

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-24424.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL |
LL | impl <'l0, 'l1, T0> Trait1<'l0, T0> for bool where T0 : Trait0<'l0>, T0 : Trait0<'l1> {}
| ^^^^^^^^^^^ 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

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-29147.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | trait Foo { fn xxx(&self); }
LL | let _ = <S5<_>>::xxx;
| ^^^^^^^^^^^^ cannot infer type for struct `S5<_>`
|
= note: cannot resolve `S5<_>: Foo`
= note: cannot satisfy `S5<_>: Foo`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-54954.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LL | const ARR_LEN: usize = Tt::const_val::<[i8; 123]>();
LL | const fn const_val<T: Sized>() -> usize {
| --------- - required by this bound in `Tt::const_val`
|
= note: cannot resolve `_: Tt`
= note: cannot satisfy `_: Tt`

error[E0080]: evaluation of constant value failed
--> $DIR/issue-54954.rs:13:15
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-58022.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ LL | fn new(slice: &[u8; Foo::SIZE]) -> Self;
| cannot infer type
| 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`

error: aborting due to 2 previous errors
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/question-mark-type-infer.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0284]: type annotations needed
LL | l.iter().map(f).collect()?
| ^^^^^^^ 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
|
LL | l.iter().map(f).collect::<B>()?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | fn new() -> T;
LL | let _f: base::Foo = base::HasNew::new();
| ^^^^^^^^^^^^^^^^^ cannot infer type
|
= note: cannot resolve `_: base::HasNew<base::Foo>`
= note: cannot satisfy `_: base::HasNew<base::Foo>`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/type/type-annotation-needed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ fn main() {
foo(42);
//~^ ERROR type annotations needed
//~| NOTE cannot infer type
//~| NOTE cannot resolve
//~| NOTE cannot satisfy
}
2 changes: 1 addition & 1 deletion src/test/ui/type/type-annotation-needed.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | fn foo<T: Into<String>>(x: i32) {}
LL | foo(42);
| ^^^ 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
|
LL | foo::<T>(42);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/type/type-check/issue-40294.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | trait Foo: Sized {
LL | where &'a T : Foo,
| ^^^ 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

Expand Down