Skip to content
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
26 changes: 3 additions & 23 deletions compiler/rustc_type_ir/src/const_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_type_ir_macros::{
GenericTypeVisitable, Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic,
};

use crate::{self as ty, BoundVarIndexKind, Interner};
use crate::{self as ty, BoundVarIndexKind, Interner, UnevaluatedConst};

/// Represents a constant in Rust.
#[derive_where(Clone, Copy, Hash, PartialEq; I: Interner)]
Expand Down Expand Up @@ -67,26 +67,6 @@ impl<I: Interner> fmt::Debug for ConstKind<I> {
}
}

/// An unevaluated (potentially generic) constant used in the type-system.
#[derive_where(Clone, Copy, Debug, Hash, PartialEq; I: Interner)]
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
#[cfg_attr(
feature = "nightly",
derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext)
)]
pub struct UnevaluatedConst<I: Interner> {
#[type_foldable(identity)]
#[type_visitable(ignore)]
pub kind: UnevaluatedConstKind<I>,
pub args: I::GenericArgs,

/// This field exists to prevent the creation of `UnevaluatedConst` without using [`UnevaluatedConst::new`].
#[derive_where(skip(Debug))]
pub(crate) _use_unevaluated_const_new_instead: (),
}

impl<I: Interner> Eq for UnevaluatedConst<I> {}

impl<I: Interner> UnevaluatedConst<I> {
#[inline]
pub fn new(
Expand All @@ -103,7 +83,7 @@ impl<I: Interner> UnevaluatedConst<I> {
};
interner.debug_assert_args_compatible(def_id, args);
}
UnevaluatedConst { kind, args, _use_unevaluated_const_new_instead: () }
UnevaluatedConst { kind, args, _use_alias_new_instead: () }
}

pub fn type_of(self, interner: I) -> ty::Unnormalized<I, I::Ty> {
Expand All @@ -121,7 +101,7 @@ impl<I: Interner> UnevaluatedConst<I> {
/// and handled in very similar ways. The documentation for AliasTyKind/etc. may be helpful when
/// learning about UnevaluatedConstKind.
#[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner)]
#[derive(GenericTypeVisitable, Lift_Generic)]
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
#[cfg_attr(
feature = "nightly",
derive(Encodable_NoContext, Decodable_NoContext, StableHash_NoContext)
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_type_ir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ mod pattern;
mod predicate;
mod predicate_kind;
mod region_kind;
mod ty;
mod ty_info;
mod ty_kind;
mod unnormalized;
Expand Down Expand Up @@ -80,6 +81,7 @@ pub use predicate_kind::*;
pub use region_kind::*;
pub use rustc_ast_ir::{FloatTy, IntTy, Movability, Mutability, Pinnedness, UintTy};
use rustc_type_ir_macros::GenericTypeVisitable;
pub use ty::{Alias, AliasTerm, AliasTy, UnevaluatedConst};
pub use ty_info::*;
pub use ty_kind::*;
pub use unnormalized::Unnormalized;
Expand Down
74 changes: 18 additions & 56 deletions compiler/rustc_type_ir/src/predicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ use rustc_type_ir_macros::{
};

use crate::inherent::*;
use crate::ty::AliasTerm;
use crate::upcast::{Upcast, UpcastFrom};
use crate::visit::TypeVisitableExt as _;
use crate::{self as ty, AliasTyKind, Interner, UnevaluatedConstKind};
use crate::{self as ty, Alias, AliasTyKind, Interner, UnevaluatedConstKind};

/// `A: 'region`
#[derive_where(Clone, Hash, PartialEq, Debug; I: Interner, A)]
Expand Down Expand Up @@ -537,7 +538,7 @@ impl<I: Interner> ty::Binder<I, ExistentialProjection<I>> {
}

#[derive_where(Clone, Copy, PartialEq, Eq, Hash, Debug; I: Interner)]
#[derive(Lift_Generic, TypeVisitable_Generic, GenericTypeVisitable)]
#[derive(TypeVisitable_Generic, TypeFoldable_Generic, Lift_Generic, GenericTypeVisitable)]
#[cfg_attr(
feature = "nightly",
derive(Encodable_NoContext, Decodable_NoContext, StableHash_NoContext)
Expand Down Expand Up @@ -640,41 +641,6 @@ impl<I: Interner> From<ty::UnevaluatedConstKind<I>> for AliasTermKind<I> {
}
}

/// Represents the unprojected term of a projection goal.
///
/// * For a projection, this would be `<Ty as Trait<...>>::N<...>`.
/// * For an inherent projection, this would be `Ty::N<...>`.
/// * For an opaque type, there is no explicit syntax.
#[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner)]
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
#[cfg_attr(
feature = "nightly",
derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext)
)]
pub struct AliasTerm<I: Interner> {
/// The parameters of the associated or opaque item.
///
/// For a projection, these are the generic parameters for the trait and the
/// GAT parameters, if there are any.
///
/// For an inherent projection, they consist of the self type and the GAT parameters,
/// if there are any.
///
/// For RPIT the generic parameters are for the generics of the function,
/// while for TAIT it is used for the generic parameters of the alias.
pub args: I::GenericArgs,

#[type_foldable(identity)]
#[type_visitable(ignore)]
pub kind: AliasTermKind<I>,

/// This field exists to prevent the creation of `AliasTerm` without using [`AliasTerm::new_from_args`].
#[derive_where(skip(Debug))]
_use_alias_term_new_instead: (),
}

impl<I: Interner> Eq for AliasTerm<I> {}

impl<I: Interner> AliasTerm<I> {
pub fn new_from_args(
interner: I,
Expand All @@ -694,7 +660,7 @@ impl<I: Interner> AliasTerm<I> {
};
interner.debug_assert_args_compatible(def_id, args);
}
AliasTerm { kind, args, _use_alias_term_new_instead: () }
AliasTerm { kind, args, _use_alias_new_instead: () }
}

pub fn new(
Expand Down Expand Up @@ -724,7 +690,7 @@ impl<I: Interner> AliasTerm<I> {
panic!("Cannot turn `{}` into `AliasTy`", kind.descr())
}
};
ty::AliasTy { kind, args: self.args, _use_alias_ty_new_instead: () }
ty::AliasTy { kind, args: self.args, _use_alias_new_instead: () }
}

pub fn expect_ct(self) -> ty::UnevaluatedConst<I> {
Expand All @@ -742,7 +708,7 @@ impl<I: Interner> AliasTerm<I> {
panic!("Cannot turn `{}` into `UnevaluatedConst`", kind.descr())
}
};
ty::UnevaluatedConst { kind, args: self.args, _use_unevaluated_const_new_instead: () }
ty::UnevaluatedConst { kind, args: self.args, _use_alias_new_instead: () }
}

pub fn to_term(self, interner: I) -> I::Term {
Expand Down Expand Up @@ -897,21 +863,13 @@ impl<I: Interner> AliasTerm<I> {

impl<I: Interner> From<ty::AliasTy<I>> for AliasTerm<I> {
fn from(ty: ty::AliasTy<I>) -> Self {
AliasTerm {
args: ty.args,
kind: AliasTermKind::from(ty.kind),
_use_alias_term_new_instead: (),
}
AliasTerm { args: ty.args, kind: AliasTermKind::from(ty.kind), _use_alias_new_instead: () }
}
}

impl<I: Interner> From<ty::UnevaluatedConst<I>> for AliasTerm<I> {
fn from(ty: ty::UnevaluatedConst<I>) -> Self {
AliasTerm {
args: ty.args,
kind: AliasTermKind::from(ty.kind),
_use_alias_term_new_instead: (),
}
AliasTerm { args: ty.args, kind: AliasTermKind::from(ty.kind), _use_alias_new_instead: () }
}
}

Expand Down Expand Up @@ -990,19 +948,17 @@ impl<I: Interner> fmt::Debug for ProjectionPredicate<I> {

/// Used by the new solver to normalize an alias. This always expects the `term` to
/// be an unconstrained inference variable which is used as the output.
#[derive_where(Clone, Copy, Hash, PartialEq; I: Interner)]
#[derive_where(Clone, Copy, Hash, Eq, PartialEq; I: Interner, K)]
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
#[cfg_attr(
feature = "nightly",
derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext)
)]
pub struct NormalizesTo<I: Interner> {
pub alias: AliasTerm<I>,
pub struct NormalizesTo<I: Interner, K = AliasTermKind<I>> {
pub alias: Alias<I, K>,
pub term: I::Term,
}

impl<I: Interner> Eq for NormalizesTo<I> {}

impl<I: Interner> NormalizesTo<I> {
pub fn self_ty(self) -> I::Ty {
self.alias.self_ty()
Expand All @@ -1017,7 +973,13 @@ impl<I: Interner> NormalizesTo<I> {
}
}

impl<I: Interner> fmt::Debug for NormalizesTo<I> {
impl<I: Interner, K> fmt::Debug for NormalizesTo<I, K>
where
// `TypeVisitable_Generic` derived on `NormalizesTo` creates a field-level
// `Alias<I, K>: TypeVisitable<I>` bound. Since `TypeVisitable<I>: fmt::Debug`,
// that proves `Alias<I, K>: fmt::Debug`, but not `K: fmt::Debug`.
Alias<I, K>: fmt::Debug,

@lcnr lcnr Jun 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Alias<I, K>: fmt::Debug,
K: fmt::Debug,

this does not work? 🤔

does Alias implement Debug in a weird way?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope 😞. TypeVisitable_Generic creates Alias<I, K>: TypeVisitable<I> and;

pub trait TypeVisitable<I: Interner>: fmt::Debug {
    // ...
}

So can prove Alias<I, K>: fmt::Debug but not K: Debug

Error;

error[E0277]: `K` doesn't implement `Debug`
   --> compiler/rustc_type_ir/src/predicate.rs:957:12
    |
957 | pub struct NormalizesTo<I: Interner, K = AliasTermKind<I>> {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Debug` is not implemented for `K`
    |
note: required for `predicate::NormalizesTo<I, K>` to implement `Debug`
   --> compiler/rustc_type_ir/src/predicate.rs:976:22
    |
976 | impl<I: Interner, K> fmt::Debug for NormalizesTo<I, K>
    |                      ^^^^^^^^^^     ^^^^^^^^^^^^^^^^^^
977 | where
978 |     K: fmt::Debug,
    |        ---------- unsatisfied trait bound introduced here
note: required by a bound in `visit::TypeVisitable`
   --> compiler/rustc_type_ir/src/visit.rs:62:39
    |
 62 | pub trait TypeVisitable<I: Interner>: fmt::Debug {
    |                                       ^^^^^^^^^^ required by this bound in `TypeVisitable`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

annoying 😭 alright, r=me if CI passes

{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "NormalizesTo({:?}, {:?})", self.alias, self.term)
}
Expand Down
56 changes: 56 additions & 0 deletions compiler/rustc_type_ir/src/ty/alias.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
use derive_where::derive_where;
#[cfg(feature = "nightly")]
use rustc_macros::{Decodable_NoContext, Encodable_NoContext, StableHash_NoContext};
use rustc_type_ir_macros::{
GenericTypeVisitable, Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic,
};

use crate::predicate::AliasTermKind;
use crate::ty_kind::AliasTyKind;
use crate::{Interner, UnevaluatedConstKind};

/// Represents an alias of a type, constant, or other term-like item.
///
/// * For a projection, this would be `<Ty as Trait<...>>::N<...>`.
/// * For an inherent projection, this would be `Ty::N<...>`.
/// * For an opaque type, there is no explicit syntax.
#[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner, K)]
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
#[cfg_attr(
feature = "nightly",
derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext)
)]
pub struct Alias<I: Interner, K> {
pub kind: K,

/// The parameters of the associated, opaque, or constant alias.
///
/// For a projection, these are the generic parameters for the trait and the
/// GAT parameters, if there are any.
///
/// For an inherent projection, they consist of the self type and the GAT parameters,
/// if there are any.
///
/// For RPIT the generic parameters are for the generics of the function,
/// while for TAIT it is used for the generic parameters of the alias.
pub args: I::GenericArgs,

/// This field exists to prevent the creation of `Alias` without using the relevant constructor.
#[derive_where(skip(Debug))]
#[type_visitable(ignore)]
#[type_foldable(identity)]
#[lift(identity)]
pub(crate) _use_alias_new_instead: (),
}

impl<I: Interner, K: PartialEq> Eq for Alias<I, K> {}

impl<I: Interner, K: Copy> Alias<I, K> {
pub fn kind(self, _interner: I) -> K {
self.kind
}
}

pub type AliasTerm<I> = Alias<I, AliasTermKind<I>>;
pub type AliasTy<I> = Alias<I, AliasTyKind<I>>;
pub type UnevaluatedConst<I> = Alias<I, UnevaluatedConstKind<I>>;
3 changes: 3 additions & 0 deletions compiler/rustc_type_ir/src/ty/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mod alias;

pub use alias::{Alias, AliasTerm, AliasTy, UnevaluatedConst};
40 changes: 3 additions & 37 deletions compiler/rustc_type_ir/src/ty_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ use rustc_type_ir_macros::{
use self::TyKind::*;
pub use self::closure::*;
use crate::inherent::*;
use crate::ty::AliasTy;
#[cfg(feature = "nightly")]
use crate::visit::TypeVisitable;
use crate::{self as ty, BoundVarIndexKind, FloatTy, IntTy, Interner, UintTy};

mod closure;

#[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner)]
#[derive(GenericTypeVisitable, Lift_Generic)]
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
#[cfg_attr(
feature = "nightly",
derive(Encodable_NoContext, Decodable_NoContext, StableHash_NoContext)
Expand Down Expand Up @@ -427,45 +428,10 @@ impl<I: Interner> fmt::Debug for TyKind<I> {
}
}

/// Represents the projection of an associated, opaque, or lazy-type-alias type.
///
/// * For a projection, this would be `<Ty as Trait<...>>::N<...>`.
/// * For an inherent projection, this would be `Ty::N<...>`.
/// * For an opaque type, there is no explicit syntax.
#[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner)]
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
#[cfg_attr(
feature = "nightly",
derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext)
)]
pub struct AliasTy<I: Interner> {
/// The parameters of the associated or opaque type.
///
/// For a projection, these are the generic parameters for the trait and the
/// GAT parameters, if there are any.
///
/// For an inherent projection, they consist of the self type and the GAT parameters,
/// if there are any.
///
/// For RPIT the generic parameters are for the generics of the function,
/// while for TAIT it is used for the generic parameters of the alias.
pub args: I::GenericArgs,

#[type_foldable(identity)]
#[type_visitable(ignore)]
pub kind: AliasTyKind<I>,

/// This field exists to prevent the creation of `AliasTy` without using [`AliasTy::new_from_args`].
#[derive_where(skip(Debug))]
pub(crate) _use_alias_ty_new_instead: (),
}

impl<I: Interner> Eq for AliasTy<I> {}

impl<I: Interner> AliasTy<I> {
pub fn new_from_args(interner: I, kind: AliasTyKind<I>, args: I::GenericArgs) -> AliasTy<I> {
interner.debug_assert_args_compatible(kind.def_id(), args);
AliasTy { kind, args, _use_alias_ty_new_instead: () }
AliasTy { kind, args, _use_alias_new_instead: () }
}

pub fn new(
Expand Down
2 changes: 1 addition & 1 deletion tests/mir-opt/issue_99325.main.built.after.32bit.mir
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| User Type Annotations
| 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [&*b"AAAA"], user_self_ty: None }), max_universe: U0, var_kinds: [] }, span: $DIR/issue_99325.rs:13:16: 13:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [UnevaluatedConst { kind: Anon { def_id: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}) }, args: [], .. }], user_self_ty: None }), max_universe: U0, var_kinds: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [Alias { kind: Anon { def_id: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}) }, args: [], .. }], user_self_ty: None }), max_universe: U0, var_kinds: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
|
fn main() -> () {
let mut _0: ();
Expand Down
2 changes: 1 addition & 1 deletion tests/mir-opt/issue_99325.main.built.after.64bit.mir
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| User Type Annotations
| 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [&*b"AAAA"], user_self_ty: None }), max_universe: U0, var_kinds: [] }, span: $DIR/issue_99325.rs:13:16: 13:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [UnevaluatedConst { kind: Anon { def_id: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}) }, args: [], .. }], user_self_ty: None }), max_universe: U0, var_kinds: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [Alias { kind: Anon { def_id: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}) }, args: [], .. }], user_self_ty: None }), max_universe: U0, var_kinds: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
|
fn main() -> () {
let mut _0: ();
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/attributes/dump-preds.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ error: rustc_dump_item_bounds
LL | type Assoc<P: Eq>: std::ops::Deref<Target = ()>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: Binder { value: ProjectionPredicate(AliasTerm { args: [Alias(AliasTy { args: [Self/#0, T/#1, P/#2], kind: Projection { def_id: DefId(..) }, .. })], kind: ProjectionTy { def_id: DefId(..) }, .. }, Term::Ty(())), bound_vars: [] }
= note: Binder { value: ProjectionPredicate(Alias { kind: ProjectionTy { def_id: DefId(..) }, args: [Alias(Alias { kind: Projection { def_id: DefId(..) }, args: [Self/#0, T/#1, P/#2], .. })], .. }, Term::Ty(())), bound_vars: [] }
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::ops::Deref>, polarity:Positive), bound_vars: [] }
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::marker::Sized>, polarity:Positive), bound_vars: [] }

Expand Down
4 changes: 2 additions & 2 deletions tests/ui/coherence/occurs-check/associated-type.next.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTerm { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1))], kind: ProjectionTy { def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }, .. }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTerm { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1))], kind: ProjectionTy { def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }, .. }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias { kind: ProjectionTy { def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }, args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1))], .. }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias { kind: ProjectionTy { def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }, args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1))], .. }
error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), ())>` for type `for<'a> fn(&'a (), ())`
--> $DIR/associated-type.rs:32:1
|
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/coherence/occurs-check/associated-type.old.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTerm { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1))], kind: ProjectionTy { def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }, .. }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTerm { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1))], kind: ProjectionTy { def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }, .. }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias { kind: ProjectionTy { def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }, args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1))], .. }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias { kind: ProjectionTy { def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }, args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1))], .. }
error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), ())>` for type `for<'a> fn(&'a (), ())`
--> $DIR/associated-type.rs:32:1
|
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/higher-ranked/structually-relate-aliases.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTerm { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a))], kind: ProjectionTy { def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit) }, .. }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias { kind: ProjectionTy { def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit) }, args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a))], .. }
error[E0277]: the trait bound `for<'a> T: ToUnit<'a>` is not satisfied
--> $DIR/structually-relate-aliases.rs:13:36
|
Expand Down
Loading
Loading