Make sure the alias is actually rigid
This commit is contained in:
parent
50b8029ce1
commit
fd2038d344
@ -15,7 +15,7 @@
|
||||
use crate::solve::inspect::ProbeKind;
|
||||
use crate::solve::{
|
||||
BuiltinImplSource, CandidateSource, Certainty, EvalCtxt, Goal, GoalSource, MaybeCause,
|
||||
NoSolution, QueryResult,
|
||||
NoSolution, QueryResult, Reveal,
|
||||
};
|
||||
|
||||
impl<D, I> EvalCtxt<'_, D>
|
||||
@ -39,11 +39,58 @@ pub(super) fn compute_normalizes_to_goal(
|
||||
Err(NoSolution) => {
|
||||
let Goal { param_env, predicate: NormalizesTo { alias, term } } = goal;
|
||||
self.relate_rigid_alias_non_alias(param_env, alias, ty::Invariant, term)?;
|
||||
self.add_rigid_constraints(param_env, alias)?;
|
||||
self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Register any obligations that are used to validate that an alias should be
|
||||
/// treated as rigid.
|
||||
///
|
||||
/// An alias may be considered rigid if it fails normalization, but we also don't
|
||||
/// want to consider aliases that are not well-formed to be rigid simply because
|
||||
/// they fail normalization.
|
||||
///
|
||||
/// For example, some `<T as Trait>::Assoc` where `T: Trait` does not hold, or an
|
||||
/// opaque type whose hidden type doesn't actually satisfy the opaque item bounds.
|
||||
fn add_rigid_constraints(
|
||||
&mut self,
|
||||
param_env: I::ParamEnv,
|
||||
rigid_alias: ty::AliasTerm<I>,
|
||||
) -> Result<(), NoSolution> {
|
||||
match rigid_alias.kind(self.cx()) {
|
||||
// Projections are rigid only if their trait ref holds.
|
||||
ty::AliasTermKind::ProjectionTy | ty::AliasTermKind::ProjectionConst => {
|
||||
let trait_ref = rigid_alias.trait_ref(self.cx());
|
||||
self.add_goal(GoalSource::Misc, Goal::new(self.cx(), param_env, trait_ref));
|
||||
Ok(())
|
||||
}
|
||||
ty::AliasTermKind::OpaqueTy => {
|
||||
match param_env.reveal() {
|
||||
// In user-facing mode, paques are only rigid if we may not define it.
|
||||
Reveal::UserFacing => {
|
||||
if rigid_alias
|
||||
.def_id
|
||||
.as_local()
|
||||
.is_some_and(|def_id| self.can_define_opaque_ty(def_id))
|
||||
{
|
||||
Err(NoSolution)
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
// Opaques are never rigid in reveal-all mode.
|
||||
Reveal::All => Err(NoSolution),
|
||||
}
|
||||
}
|
||||
// FIXME(generic_const_exprs): we would need to support generic consts here
|
||||
ty::AliasTermKind::UnevaluatedConst => Err(NoSolution),
|
||||
// Inherent and weak types are never rigid. This type must not be well-formed.
|
||||
ty::AliasTermKind::WeakTy | ty::AliasTermKind::InherentTy => Err(NoSolution),
|
||||
}
|
||||
}
|
||||
|
||||
/// Normalize the given alias by at least one step. If the alias is rigid, this
|
||||
/// returns `NoSolution`.
|
||||
#[instrument(level = "trace", skip(self), ret)]
|
||||
@ -124,6 +171,7 @@ fn probe_and_match_goal_against_assumption(
|
||||
ecx.instantiate_normalizes_to_term(goal, assumption_projection_pred.term);
|
||||
|
||||
// Add GAT where clauses from the trait's definition
|
||||
// FIXME: We don't need these, since these are the type's own WF obligations.
|
||||
ecx.add_goals(
|
||||
GoalSource::Misc,
|
||||
cx.own_predicates_of(goal.predicate.def_id())
|
||||
@ -179,7 +227,8 @@ fn consider_impl_candidate(
|
||||
.map(|pred| goal.with(cx, pred));
|
||||
ecx.add_goals(GoalSource::ImplWhereBound, where_clause_bounds);
|
||||
|
||||
// Add GAT where clauses from the trait's definition
|
||||
// Add GAT where clauses from the trait's definition.
|
||||
// FIXME: We don't need these, since these are the type's own WF obligations.
|
||||
ecx.add_goals(
|
||||
GoalSource::Misc,
|
||||
cx.own_predicates_of(goal.predicate.def_id())
|
||||
|
@ -31,6 +31,18 @@ help: consider further restricting `Self`
|
||||
LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
|
||||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0271]: type mismatch resolving `<Self as Deref>::Target normalizes-to <Self as Deref>::Target`
|
||||
--> $DIR/defaults-unsound-62211-1.rs:24:96
|
||||
|
|
||||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
|
||||
| ^^^^ types differ
|
||||
|
|
||||
note: required by a bound in `UncheckedCopy::Output`
|
||||
--> $DIR/defaults-unsound-62211-1.rs:24:31
|
||||
|
|
||||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
|
||||
| ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
|
||||
|
||||
error[E0277]: the trait bound `Self: Deref` is not satisfied
|
||||
--> $DIR/defaults-unsound-62211-1.rs:24:96
|
||||
|
|
||||
@ -38,10 +50,10 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
|
||||
| ^^^^ the trait `Deref` is not implemented for `Self`
|
||||
|
|
||||
note: required by a bound in `UncheckedCopy::Output`
|
||||
--> $DIR/defaults-unsound-62211-1.rs:24:31
|
||||
--> $DIR/defaults-unsound-62211-1.rs:24:25
|
||||
|
|
||||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
|
||||
| ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
|
||||
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
|
||||
help: consider further restricting `Self`
|
||||
|
|
||||
LL | trait UncheckedCopy: Sized + Deref {
|
||||
@ -63,6 +75,7 @@ help: consider further restricting `Self`
|
||||
LL | trait UncheckedCopy: Sized + Copy {
|
||||
| ++++++
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
Some errors have detailed explanations: E0271, E0277.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -31,6 +31,18 @@ help: consider further restricting `Self`
|
||||
LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
|
||||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0271]: type mismatch resolving `<Self as Deref>::Target normalizes-to <Self as Deref>::Target`
|
||||
--> $DIR/defaults-unsound-62211-2.rs:24:96
|
||||
|
|
||||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
|
||||
| ^^^^ types differ
|
||||
|
|
||||
note: required by a bound in `UncheckedCopy::Output`
|
||||
--> $DIR/defaults-unsound-62211-2.rs:24:31
|
||||
|
|
||||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
|
||||
| ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
|
||||
|
||||
error[E0277]: the trait bound `Self: Deref` is not satisfied
|
||||
--> $DIR/defaults-unsound-62211-2.rs:24:96
|
||||
|
|
||||
@ -38,10 +50,10 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
|
||||
| ^^^^ the trait `Deref` is not implemented for `Self`
|
||||
|
|
||||
note: required by a bound in `UncheckedCopy::Output`
|
||||
--> $DIR/defaults-unsound-62211-2.rs:24:31
|
||||
--> $DIR/defaults-unsound-62211-2.rs:24:25
|
||||
|
|
||||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
|
||||
| ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
|
||||
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
|
||||
help: consider further restricting `Self`
|
||||
|
|
||||
LL | trait UncheckedCopy: Sized + Deref {
|
||||
@ -63,6 +75,7 @@ help: consider further restricting `Self`
|
||||
LL | trait UncheckedCopy: Sized + Copy {
|
||||
| ++++++
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
Some errors have detailed explanations: E0271, E0277.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -1,3 +1,15 @@
|
||||
error[E0271]: type mismatch resolving `<<T as SubEncoder>::ActualSize as Add>::Output normalizes-to <<T as SubEncoder>::ActualSize as Add>::Output`
|
||||
--> $DIR/issue-54108.rs:23:17
|
||||
|
|
||||
LL | type Size = <Self as SubEncoder>::ActualSize;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
|
||||
note: required by a bound in `Encoder::Size`
|
||||
--> $DIR/issue-54108.rs:8:20
|
||||
|
|
||||
LL | type Size: Add<Output = Self::Size>;
|
||||
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size`
|
||||
|
||||
error[E0277]: cannot add `<T as SubEncoder>::ActualSize` to `<T as SubEncoder>::ActualSize`
|
||||
--> $DIR/issue-54108.rs:23:17
|
||||
|
|
||||
@ -6,15 +18,16 @@ LL | type Size = <Self as SubEncoder>::ActualSize;
|
||||
|
|
||||
= help: the trait `Add` is not implemented for `<T as SubEncoder>::ActualSize`
|
||||
note: required by a bound in `Encoder::Size`
|
||||
--> $DIR/issue-54108.rs:8:20
|
||||
--> $DIR/issue-54108.rs:8:16
|
||||
|
|
||||
LL | type Size: Add<Output = Self::Size>;
|
||||
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size`
|
||||
help: consider further restricting the associated type
|
||||
|
|
||||
LL | T: SubEncoder, <T as SubEncoder>::ActualSize: Add
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
Some errors have detailed explanations: E0271, E0277.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -11,13 +11,6 @@ help: consider mutably borrowing here
|
||||
LL | for item in &mut *things { *item = 0 }
|
||||
| ++++
|
||||
|
||||
error[E0614]: type `<dyn Iterator<Item = &'a mut u8> as IntoIterator>::Item` cannot be dereferenced
|
||||
--> $DIR/issue-20605.rs:6:27
|
||||
|
|
||||
LL | for item in *things { *item = 0 }
|
||||
| ^^^^^
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0277, E0614.
|
||||
For more information about an error, try `rustc --explain E0277`.
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
@ -15,6 +15,14 @@ help: consider specifying the generic arguments
|
||||
LL | cmp_eq::<A, B, O>
|
||||
| +++++++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
error[E0271]: type mismatch resolving `build_expression<A, B, O>::{opaque#0} normalizes-to _`
|
||||
--> $DIR/ambig-hr-projection-issue-93340.rs:14:1
|
||||
|
|
||||
LL | / fn build_expression<A: Scalar, B: Scalar, O: Scalar>(
|
||||
LL | | ) -> impl Fn(A::RefType<'_>, B::RefType<'_>) -> O {
|
||||
| |_________________________________________________^ types differ
|
||||
|
||||
For more information about this error, try `rustc --explain E0283`.
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0283.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -7,14 +7,32 @@ LL | #![feature(lazy_type_alias)]
|
||||
= note: see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error[E0277]: the size for values of type `A<usize>` cannot be known at compilation time
|
||||
error[E0271]: type mismatch resolving `A<usize> normalizes-to _`
|
||||
--> $DIR/alias-bounds-when-not-wf.rs:16:13
|
||||
|
|
||||
LL | fn hello(_: W<A<usize>>) {}
|
||||
| ^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
| ^^^^^^^^^^^ types differ
|
||||
|
||||
error[E0271]: type mismatch resolving `A<usize> normalizes-to _`
|
||||
--> $DIR/alias-bounds-when-not-wf.rs:16:10
|
||||
|
|
||||
= help: the trait `Sized` is not implemented for `A<usize>`
|
||||
LL | fn hello(_: W<A<usize>>) {}
|
||||
| ^ types differ
|
||||
|
||||
error: aborting due to 1 previous error; 1 warning emitted
|
||||
error[E0271]: type mismatch resolving `A<usize> normalizes-to _`
|
||||
--> $DIR/alias-bounds-when-not-wf.rs:16:10
|
||||
|
|
||||
LL | fn hello(_: W<A<usize>>) {}
|
||||
| ^ types differ
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
error[E0271]: type mismatch resolving `A<usize> normalizes-to _`
|
||||
--> $DIR/alias-bounds-when-not-wf.rs:16:1
|
||||
|
|
||||
LL | fn hello(_: W<A<usize>>) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error: aborting due to 4 previous errors; 1 warning emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0271`.
|
||||
|
@ -4,19 +4,51 @@ error[E0282]: type annotations needed
|
||||
LL | foo(false).next().unwrap();
|
||||
| ^^^^^^^^^^ cannot infer type
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/method-resolution4.rs:16:5
|
||||
error[E0271]: type mismatch resolving `foo::{opaque#0} normalizes-to _`
|
||||
--> $DIR/method-resolution4.rs:13:9
|
||||
|
|
||||
LL | foo(false).next().unwrap();
|
||||
| ^^^^^^^^^^ types differ
|
||||
|
||||
error[E0277]: the size for values of type `impl Iterator<Item = ()>` cannot be known at compilation time
|
||||
--> $DIR/method-resolution4.rs:11:20
|
||||
|
|
||||
LL | fn foo(b: bool) -> impl Iterator<Item = ()> {
|
||||
| ------------------------ the expected opaque type
|
||||
...
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `Sized` is not implemented for `impl Iterator<Item = ()>`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error[E0271]: type mismatch resolving `foo::{opaque#0} normalizes-to _`
|
||||
--> $DIR/method-resolution4.rs:16:5
|
||||
|
|
||||
LL | std::iter::empty()
|
||||
| ^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error[E0277]: the size for values of type `impl Iterator<Item = ()>` cannot be known at compilation time
|
||||
--> $DIR/method-resolution4.rs:13:9
|
||||
|
|
||||
= note: expected opaque type `impl Iterator<Item = ()>`
|
||||
found struct `std::iter::Empty<_>`
|
||||
LL | foo(false).next().unwrap();
|
||||
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `Sized` is not implemented for `impl Iterator<Item = ()>`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error[E0271]: type mismatch resolving `foo::{opaque#0} normalizes-to _`
|
||||
--> $DIR/method-resolution4.rs:13:9
|
||||
|
|
||||
LL | foo(false).next().unwrap();
|
||||
| ^^^^^^^^^^ types differ
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
Some errors have detailed explanations: E0282, E0308.
|
||||
For more information about an error, try `rustc --explain E0282`.
|
||||
error[E0271]: type mismatch resolving `foo::{opaque#0} normalizes-to _`
|
||||
--> $DIR/method-resolution4.rs:11:1
|
||||
|
|
||||
LL | fn foo(b: bool) -> impl Iterator<Item = ()> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0277, E0282.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -12,15 +12,37 @@ help: consider specifying the generic argument
|
||||
LL | let mut gen = Box::<T>::pin(foo());
|
||||
| +++++
|
||||
|
||||
error[E0308]: mismatched types
|
||||
error[E0271]: type mismatch resolving `foo::{opaque#0} normalizes-to _`
|
||||
--> $DIR/recursive-coroutine-boxed.rs:14:18
|
||||
|
|
||||
LL | #[coroutine] || {
|
||||
| __________________^
|
||||
LL | | let mut gen = Box::pin(foo());
|
||||
LL | |
|
||||
LL | | let mut r = gen.as_mut().resume(());
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }
|
||||
| |_____^ types differ
|
||||
|
||||
error[E0271]: type mismatch resolving `foo::{opaque#0} normalizes-to _`
|
||||
--> $DIR/recursive-coroutine-boxed.rs:15:32
|
||||
|
|
||||
LL | let mut gen = Box::pin(foo());
|
||||
| ^^^^^ types differ
|
||||
|
||||
error[E0277]: the size for values of type `impl Coroutine<Yield = (), Return = ()>` cannot be known at compilation time
|
||||
--> $DIR/recursive-coroutine-boxed.rs:9:13
|
||||
|
|
||||
LL | fn foo() -> impl Coroutine<Yield = (), Return = ()> {
|
||||
| ---------------------------------------
|
||||
| |
|
||||
| the expected opaque type
|
||||
| expected `impl Coroutine<Yield = (), Return = ()>` because of return type
|
||||
...
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `Sized` is not implemented for `impl Coroutine<Yield = (), Return = ()>`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error[E0271]: type mismatch resolving `foo::{opaque#0} normalizes-to _`
|
||||
--> $DIR/recursive-coroutine-boxed.rs:14:18
|
||||
|
|
||||
LL | #[coroutine] || {
|
||||
| __________________^
|
||||
LL | | let mut gen = Box::pin(foo());
|
||||
@ -31,10 +53,32 @@ LL | | }
|
||||
LL | | }
|
||||
| |_____^ types differ
|
||||
|
|
||||
= note: expected opaque type `impl Coroutine<Yield = (), Return = ()>`
|
||||
found coroutine `{coroutine@$DIR/recursive-coroutine-boxed.rs:14:18: 14:20}`
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error[E0277]: the size for values of type `impl Coroutine<Yield = (), Return = ()>` cannot be known at compilation time
|
||||
--> $DIR/recursive-coroutine-boxed.rs:15:32
|
||||
|
|
||||
LL | let mut gen = Box::pin(foo());
|
||||
| ^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `Sized` is not implemented for `impl Coroutine<Yield = (), Return = ()>`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
Some errors have detailed explanations: E0282, E0308.
|
||||
For more information about an error, try `rustc --explain E0282`.
|
||||
error[E0271]: type mismatch resolving `foo::{opaque#0} normalizes-to _`
|
||||
--> $DIR/recursive-coroutine-boxed.rs:15:32
|
||||
|
|
||||
LL | let mut gen = Box::pin(foo());
|
||||
| ^^^^^ types differ
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0271]: type mismatch resolving `foo::{opaque#0} normalizes-to _`
|
||||
--> $DIR/recursive-coroutine-boxed.rs:9:1
|
||||
|
|
||||
LL | fn foo() -> impl Coroutine<Yield = (), Return = ()> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0277, E0282.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -1,26 +1,39 @@
|
||||
error[E0271]: type mismatch resolving `impl Trait <: dyn Trait`
|
||||
error[E0271]: type mismatch resolving `hello::{opaque#0} normalizes-to _`
|
||||
--> $DIR/unsized_coercion.rs:14:17
|
||||
|
|
||||
LL | let x = hello();
|
||||
| ^^^^^^^ types differ
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/unsized_coercion.rs:18:14
|
||||
--> $DIR/unsized_coercion.rs:18:5
|
||||
|
|
||||
LL | fn hello() -> Box<impl Trait> {
|
||||
| ---------- the expected opaque type
|
||||
| ---------------
|
||||
| | |
|
||||
| | the expected opaque type
|
||||
| expected `Box<impl Trait>` because of return type
|
||||
...
|
||||
LL | Box::new(1u32)
|
||||
| -------- ^^^^ types differ
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
| ^^^^^^^^^^^^^^ types differ
|
||||
|
|
||||
= note: expected opaque type `impl Trait`
|
||||
found type `u32`
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
= note: expected struct `Box<impl Trait>`
|
||||
found struct `Box<u32>`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error[E0271]: type mismatch resolving `hello::{opaque#0} normalizes-to _`
|
||||
--> $DIR/unsized_coercion.rs:14:17
|
||||
|
|
||||
LL | let x = hello();
|
||||
| ^^^^^^^ types differ
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0271]: type mismatch resolving `hello::{opaque#0} normalizes-to _`
|
||||
--> $DIR/unsized_coercion.rs:12:1
|
||||
|
|
||||
LL | fn hello() -> Box<impl Trait> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0308.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -1,38 +1,39 @@
|
||||
error[E0271]: type mismatch resolving `impl Trait + ?Sized <: dyn Send`
|
||||
error[E0271]: type mismatch resolving `hello::{opaque#0} normalizes-to _`
|
||||
--> $DIR/unsized_coercion3.rs:13:17
|
||||
|
|
||||
LL | let x = hello();
|
||||
| ^^^^^^^ types differ
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/unsized_coercion3.rs:18:14
|
||||
--> $DIR/unsized_coercion3.rs:18:5
|
||||
|
|
||||
LL | fn hello() -> Box<impl Trait + ?Sized> {
|
||||
| ------------------- the expected opaque type
|
||||
| ------------------------
|
||||
| | |
|
||||
| | the expected opaque type
|
||||
| expected `Box<impl Trait + ?Sized>` because of return type
|
||||
...
|
||||
LL | Box::new(1u32)
|
||||
| -------- ^^^^ types differ
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
| ^^^^^^^^^^^^^^ types differ
|
||||
|
|
||||
= note: expected opaque type `impl Trait + ?Sized`
|
||||
found type `u32`
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
= note: expected struct `Box<impl Trait + ?Sized>`
|
||||
found struct `Box<u32>`
|
||||
|
||||
error[E0277]: the size for values of type `impl Trait + ?Sized` cannot be known at compilation time
|
||||
--> $DIR/unsized_coercion3.rs:18:14
|
||||
error[E0271]: type mismatch resolving `hello::{opaque#0} normalizes-to _`
|
||||
--> $DIR/unsized_coercion3.rs:13:17
|
||||
|
|
||||
LL | Box::new(1u32)
|
||||
| -------- ^^^^ doesn't have a size known at compile-time
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
LL | let x = hello();
|
||||
| ^^^^^^^ types differ
|
||||
|
|
||||
= help: the trait `Sized` is not implemented for `impl Trait + ?Sized`
|
||||
note: required by a bound in `Box::<T>::new`
|
||||
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error[E0271]: type mismatch resolving `hello::{opaque#0} normalizes-to _`
|
||||
--> $DIR/unsized_coercion3.rs:11:1
|
||||
|
|
||||
LL | fn hello() -> Box<impl Trait + ?Sized> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
Some errors have detailed explanations: E0271, E0277, E0308.
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0308.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -1,21 +1,69 @@
|
||||
error[E0271]: type mismatch resolving `impl !Sized + Sized == ()`
|
||||
error[E0271]: type mismatch resolving `weird0::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:15:16
|
||||
|
|
||||
LL | fn weird0() -> impl Sized + !Sized {}
|
||||
| ^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error[E0271]: type mismatch resolving `impl !Sized + Sized == ()`
|
||||
error[E0271]: type mismatch resolving `weird0::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:15:36
|
||||
|
|
||||
LL | fn weird0() -> impl Sized + !Sized {}
|
||||
| ^^ types differ
|
||||
|
||||
error[E0277]: the size for values of type `impl !Sized + Sized` cannot be known at compilation time
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:15:16
|
||||
|
|
||||
LL | fn weird0() -> impl Sized + !Sized {}
|
||||
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `Sized` is not implemented for `impl !Sized + Sized`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error[E0271]: type mismatch resolving `weird0::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:15:1
|
||||
|
|
||||
LL | fn weird0() -> impl Sized + !Sized {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error[E0271]: type mismatch resolving `weird1::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:17:16
|
||||
|
|
||||
LL | fn weird1() -> impl !Sized + Sized {}
|
||||
| ^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error[E0271]: type mismatch resolving `impl !Sized == ()`
|
||||
error[E0271]: type mismatch resolving `weird1::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:17:36
|
||||
|
|
||||
LL | fn weird1() -> impl !Sized + Sized {}
|
||||
| ^^ types differ
|
||||
|
||||
error[E0277]: the size for values of type `impl !Sized + Sized` cannot be known at compilation time
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:17:16
|
||||
|
|
||||
LL | fn weird1() -> impl !Sized + Sized {}
|
||||
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `Sized` is not implemented for `impl !Sized + Sized`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error[E0271]: type mismatch resolving `weird1::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:17:1
|
||||
|
|
||||
LL | fn weird1() -> impl !Sized + Sized {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error[E0271]: type mismatch resolving `weird2::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:19:16
|
||||
|
|
||||
LL | fn weird2() -> impl !Sized {}
|
||||
| ^^^^^^^^^^^ types differ
|
||||
|
||||
error[E0271]: type mismatch resolving `weird2::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:19:28
|
||||
|
|
||||
LL | fn weird2() -> impl !Sized {}
|
||||
| ^^ types differ
|
||||
|
||||
error[E0277]: the size for values of type `impl !Sized` cannot be known at compilation time
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:19:16
|
||||
|
|
||||
@ -25,6 +73,12 @@ LL | fn weird2() -> impl !Sized {}
|
||||
= help: the trait `Sized` is not implemented for `impl !Sized`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error[E0271]: type mismatch resolving `weird2::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:19:1
|
||||
|
|
||||
LL | fn weird2() -> impl !Sized {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error[E0277]: the trait bound `impl !Trait: Trait` is not satisfied
|
||||
--> $DIR/opaque-type-unsatisfied-bound.rs:12:13
|
||||
|
|
||||
@ -39,7 +93,7 @@ note: required by a bound in `consume`
|
||||
LL | fn consume(_: impl Trait) {}
|
||||
| ^^^^^ required by this bound in `consume`
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: aborting due to 13 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0277.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -1,9 +1,31 @@
|
||||
error[E0271]: type mismatch resolving `impl !Fn<(u32,)> == ()`
|
||||
error[E0271]: type mismatch resolving `produce::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:17
|
||||
|
|
||||
LL | fn produce() -> impl !Fn<(u32,)> {}
|
||||
| ^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
error[E0271]: type mismatch resolving `produce::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:34
|
||||
|
|
||||
LL | fn produce() -> impl !Fn<(u32,)> {}
|
||||
| ^^ types differ
|
||||
|
||||
For more information about this error, try `rustc --explain E0271`.
|
||||
error[E0277]: the size for values of type `impl !Fn<(u32,)>` cannot be known at compilation time
|
||||
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:17
|
||||
|
|
||||
LL | fn produce() -> impl !Fn<(u32,)> {}
|
||||
| ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `Sized` is not implemented for `impl !Fn<(u32,)>`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error[E0271]: type mismatch resolving `produce::{opaque#0} normalizes-to _`
|
||||
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:1
|
||||
|
|
||||
LL | fn produce() -> impl !Fn<(u32,)> {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0277.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -16,6 +16,43 @@ note: required by a bound in `needs_coroutine`
|
||||
LL | fn needs_coroutine(_: impl Coroutine<A, Yield = B, Return = C>) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `needs_coroutine`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
error[E0271]: type mismatch resolving `<{coroutine@$DIR/coroutine.rs:20:9: 20:11} as Coroutine<A>>::Yield normalizes-to <{coroutine@$DIR/coroutine.rs:20:9: 20:11} as Coroutine<A>>::Yield`
|
||||
--> $DIR/coroutine.rs:20:9
|
||||
|
|
||||
LL | needs_coroutine(
|
||||
| --------------- required by a bound introduced by this call
|
||||
LL | #[coroutine]
|
||||
LL | / || {
|
||||
LL | |
|
||||
LL | | yield ();
|
||||
LL | | },
|
||||
| |_________^ types differ
|
||||
|
|
||||
note: required by a bound in `needs_coroutine`
|
||||
--> $DIR/coroutine.rs:14:41
|
||||
|
|
||||
LL | fn needs_coroutine(_: impl Coroutine<A, Yield = B, Return = C>) {}
|
||||
| ^^^^^^^^^ required by this bound in `needs_coroutine`
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
error[E0271]: type mismatch resolving `<{coroutine@$DIR/coroutine.rs:20:9: 20:11} as Coroutine<A>>::Return normalizes-to <{coroutine@$DIR/coroutine.rs:20:9: 20:11} as Coroutine<A>>::Return`
|
||||
--> $DIR/coroutine.rs:20:9
|
||||
|
|
||||
LL | needs_coroutine(
|
||||
| --------------- required by a bound introduced by this call
|
||||
LL | #[coroutine]
|
||||
LL | / || {
|
||||
LL | |
|
||||
LL | | yield ();
|
||||
LL | | },
|
||||
| |_________^ types differ
|
||||
|
|
||||
note: required by a bound in `needs_coroutine`
|
||||
--> $DIR/coroutine.rs:14:52
|
||||
|
|
||||
LL | fn needs_coroutine(_: impl Coroutine<A, Yield = B, Return = C>) {}
|
||||
| ^^^^^^^^^^ required by this bound in `needs_coroutine`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0277.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -9,6 +9,20 @@ help: consider restricting type parameter `T`
|
||||
LL | fn test_poly<T: Trait>() {
|
||||
| +++++++
|
||||
|
||||
error[E0271]: type mismatch resolving `<T as Trait>::Assoc normalizes-to <T as Trait>::Assoc`
|
||||
--> $DIR/projection-trait-ref.rs:8:12
|
||||
|
|
||||
LL | let x: <T as Trait>::Assoc = ();
|
||||
| ^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error[E0271]: type mismatch resolving `<T as Trait>::Assoc normalizes-to <T as Trait>::Assoc`
|
||||
--> $DIR/projection-trait-ref.rs:8:12
|
||||
|
|
||||
LL | let x: <T as Trait>::Assoc = ();
|
||||
| ^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error[E0277]: the trait bound `i32: Trait` is not satisfied
|
||||
--> $DIR/projection-trait-ref.rs:13:12
|
||||
|
|
||||
@ -21,6 +35,21 @@ help: this trait has no implementations, consider adding one
|
||||
LL | trait Trait {
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error[E0271]: type mismatch resolving `<i32 as Trait>::Assoc normalizes-to <i32 as Trait>::Assoc`
|
||||
--> $DIR/projection-trait-ref.rs:13:12
|
||||
|
|
||||
LL | let x: <i32 as Trait>::Assoc = ();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
error[E0271]: type mismatch resolving `<i32 as Trait>::Assoc normalizes-to <i32 as Trait>::Assoc`
|
||||
--> $DIR/projection-trait-ref.rs:13:12
|
||||
|
|
||||
LL | let x: <i32 as Trait>::Assoc = ();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0277.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -43,7 +43,20 @@ help: consider restricting type parameter `T`
|
||||
LL | pub fn copy_any<T: std::marker::Copy>(t: &T) -> T {
|
||||
| +++++++++++++++++++
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error[E0277]: the size for values of type `<dyn Setup<From = T> as Setup>::From` cannot be known at compilation time
|
||||
--> $DIR/dyn-incompatibility.rs:12:5
|
||||
|
|
||||
LL | copy::<dyn Setup<From=T>>(t)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `Sized` is not implemented for `<dyn Setup<From = T> as Setup>::From`
|
||||
= note: the return type of a function must have a statically known size
|
||||
help: consider further restricting the associated type
|
||||
|
|
||||
LL | pub fn copy_any<T>(t: &T) -> T where <dyn Setup<From = T> as Setup>::From: Sized {
|
||||
| +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0277, E0308.
|
||||
For more information about an error, try `rustc --explain E0277`.
|
||||
|
@ -15,6 +15,20 @@ note: required by a bound in `require_fn`
|
||||
LL | fn require_fn(_: impl Fn() -> i32) {}
|
||||
| ^^^^^^^^^^^ required by this bound in `require_fn`
|
||||
|
||||
error[E0271]: type mismatch resolving `<unsafe fn() -> i32 as FnOnce<()>>::Output normalizes-to <unsafe fn() -> i32 as FnOnce<()>>::Output`
|
||||
--> $DIR/fn-trait.rs:20:16
|
||||
|
|
||||
LL | require_fn(f as unsafe fn() -> i32);
|
||||
| ---------- ^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
note: required by a bound in `require_fn`
|
||||
--> $DIR/fn-trait.rs:3:31
|
||||
|
|
||||
LL | fn require_fn(_: impl Fn() -> i32) {}
|
||||
| ^^^ required by this bound in `require_fn`
|
||||
|
||||
error[E0277]: expected a `Fn()` closure, found `extern "C" fn() -> i32 {g}`
|
||||
--> $DIR/fn-trait.rs:22:16
|
||||
|
|
||||
@ -31,6 +45,20 @@ note: required by a bound in `require_fn`
|
||||
LL | fn require_fn(_: impl Fn() -> i32) {}
|
||||
| ^^^^^^^^^^^ required by this bound in `require_fn`
|
||||
|
||||
error[E0271]: type mismatch resolving `<extern "C" fn() -> i32 {g} as FnOnce<()>>::Output normalizes-to <extern "C" fn() -> i32 {g} as FnOnce<()>>::Output`
|
||||
--> $DIR/fn-trait.rs:22:16
|
||||
|
|
||||
LL | require_fn(g);
|
||||
| ---------- ^ types differ
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
note: required by a bound in `require_fn`
|
||||
--> $DIR/fn-trait.rs:3:31
|
||||
|
|
||||
LL | fn require_fn(_: impl Fn() -> i32) {}
|
||||
| ^^^ required by this bound in `require_fn`
|
||||
|
||||
error[E0277]: expected a `Fn()` closure, found `extern "C" fn() -> i32`
|
||||
--> $DIR/fn-trait.rs:24:16
|
||||
|
|
||||
@ -47,6 +75,20 @@ note: required by a bound in `require_fn`
|
||||
LL | fn require_fn(_: impl Fn() -> i32) {}
|
||||
| ^^^^^^^^^^^ required by this bound in `require_fn`
|
||||
|
||||
error[E0271]: type mismatch resolving `<extern "C" fn() -> i32 as FnOnce<()>>::Output normalizes-to <extern "C" fn() -> i32 as FnOnce<()>>::Output`
|
||||
--> $DIR/fn-trait.rs:24:16
|
||||
|
|
||||
LL | require_fn(g as extern "C" fn() -> i32);
|
||||
| ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
note: required by a bound in `require_fn`
|
||||
--> $DIR/fn-trait.rs:3:31
|
||||
|
|
||||
LL | fn require_fn(_: impl Fn() -> i32) {}
|
||||
| ^^^ required by this bound in `require_fn`
|
||||
|
||||
error[E0277]: expected a `Fn()` closure, found `unsafe fn() -> i32 {h}`
|
||||
--> $DIR/fn-trait.rs:26:16
|
||||
|
|
||||
@ -64,6 +106,21 @@ note: required by a bound in `require_fn`
|
||||
LL | fn require_fn(_: impl Fn() -> i32) {}
|
||||
| ^^^^^^^^^^^ required by this bound in `require_fn`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error[E0271]: type mismatch resolving `<unsafe fn() -> i32 {h} as FnOnce<()>>::Output normalizes-to <unsafe fn() -> i32 {h} as FnOnce<()>>::Output`
|
||||
--> $DIR/fn-trait.rs:26:16
|
||||
|
|
||||
LL | require_fn(h);
|
||||
| ---------- ^ types differ
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
note: required by a bound in `require_fn`
|
||||
--> $DIR/fn-trait.rs:3:31
|
||||
|
|
||||
LL | fn require_fn(_: impl Fn() -> i32) {}
|
||||
| ^^^ required by this bound in `require_fn`
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0277.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -26,21 +26,13 @@ LL | trait ToUnit<'a> {
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc), .. }
|
||||
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc), .. }
|
||||
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc), .. }
|
||||
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc), .. }
|
||||
error[E0119]: conflicting implementations of trait `Overlap<fn(_)>` for type `fn(_)`
|
||||
--> $DIR/issue-118950-root-region.rs:19:1
|
||||
error[E0271]: type mismatch resolving `Assoc<'a, T> normalizes-to _`
|
||||
--> $DIR/issue-118950-root-region.rs:19:17
|
||||
|
|
||||
LL | impl<T> Overlap<T> for T {}
|
||||
| ------------------------ first implementation here
|
||||
LL |
|
||||
LL | impl<T> Overlap<for<'a> fn(Assoc<'a, T>)> for T where Missing: Overlap<T> {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(_)`
|
||||
|
|
||||
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
||||
|
||||
error: aborting due to 3 previous errors; 1 warning emitted
|
||||
|
||||
Some errors have detailed explanations: E0119, E0277, E0412.
|
||||
For more information about an error, try `rustc --explain E0119`.
|
||||
Some errors have detailed explanations: E0271, E0277, E0412.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -4,6 +4,21 @@ error[E0282]: type annotations needed
|
||||
LL | self.bar.next().unwrap();
|
||||
| ^^^^^^^^ cannot infer type
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
error[E0271]: type mismatch resolving `Tait normalizes-to _`
|
||||
--> $DIR/method_resolution_trait_method_from_opaque.rs:26:9
|
||||
|
|
||||
LL | self.bar.next().unwrap();
|
||||
| ^^^^^^^^ types differ
|
||||
|
||||
For more information about this error, try `rustc --explain E0282`.
|
||||
error[E0271]: type mismatch resolving `Tait normalizes-to _`
|
||||
--> $DIR/method_resolution_trait_method_from_opaque.rs:26:9
|
||||
|
|
||||
LL | self.bar.next().unwrap();
|
||||
| ^^^^^^^^ types differ
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0271, E0282.
|
||||
For more information about an error, try `rustc --explain E0271`.
|
||||
|
@ -25,6 +25,8 @@ fn foo(&mut self) {
|
||||
//[current]~^ ERROR: item does not constrain
|
||||
self.bar.next().unwrap();
|
||||
//[next]~^ ERROR: type annotations needed
|
||||
//[next]~| ERROR type mismatch resolving `Tait normalizes-to _`
|
||||
//[next]~| ERROR type mismatch resolving `Tait normalizes-to _`
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user