Skip to content

Commit 2f47e57

Browse files
Rollup merge of #156538 - Jamesbarford:chore/merge-AliasTy-AliasTerm, r=lcnr
Refactor `AliasTy`. `AliasTerm` & `UnevaluatedConst` to use `Alias` Refactors `AliasTy`, `AliasTerm` & `UnevaluatedConst` to use `Alias`. Part of #156181 r? @lcnr
2 parents 89a9993 + 30e608d commit 2f47e57

14 files changed

Lines changed: 95 additions & 126 deletions

File tree

compiler/rustc_type_ir/src/const_kind.rs

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_type_ir_macros::{
99
GenericTypeVisitable, Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic,
1010
};
1111

12-
use crate::{self as ty, BoundVarIndexKind, Interner};
12+
use crate::{self as ty, BoundVarIndexKind, Interner, UnevaluatedConst};
1313

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

70-
/// An unevaluated (potentially generic) constant used in the type-system.
71-
#[derive_where(Clone, Copy, Debug, Hash, PartialEq; I: Interner)]
72-
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
73-
#[cfg_attr(
74-
feature = "nightly",
75-
derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext)
76-
)]
77-
pub struct UnevaluatedConst<I: Interner> {
78-
#[type_foldable(identity)]
79-
#[type_visitable(ignore)]
80-
pub kind: UnevaluatedConstKind<I>,
81-
pub args: I::GenericArgs,
82-
83-
/// This field exists to prevent the creation of `UnevaluatedConst` without using [`UnevaluatedConst::new`].
84-
#[derive_where(skip(Debug))]
85-
pub(crate) _use_unevaluated_const_new_instead: (),
86-
}
87-
88-
impl<I: Interner> Eq for UnevaluatedConst<I> {}
89-
9070
impl<I: Interner> UnevaluatedConst<I> {
9171
#[inline]
9272
pub fn new(
@@ -103,7 +83,7 @@ impl<I: Interner> UnevaluatedConst<I> {
10383
};
10484
interner.debug_assert_args_compatible(def_id, args);
10585
}
106-
UnevaluatedConst { kind, args, _use_unevaluated_const_new_instead: () }
86+
UnevaluatedConst { kind, args, _use_alias_new_instead: () }
10787
}
10888

10989
pub fn type_of(self, interner: I) -> ty::Unnormalized<I, I::Ty> {
@@ -121,7 +101,7 @@ impl<I: Interner> UnevaluatedConst<I> {
121101
/// and handled in very similar ways. The documentation for AliasTyKind/etc. may be helpful when
122102
/// learning about UnevaluatedConstKind.
123103
#[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner)]
124-
#[derive(GenericTypeVisitable, Lift_Generic)]
104+
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
125105
#[cfg_attr(
126106
feature = "nightly",
127107
derive(Encodable_NoContext, Decodable_NoContext, StableHash_NoContext)

compiler/rustc_type_ir/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ mod pattern;
5252
mod predicate;
5353
mod predicate_kind;
5454
mod region_kind;
55+
mod ty;
5556
mod ty_info;
5657
mod ty_kind;
5758
mod unnormalized;
@@ -80,6 +81,7 @@ pub use predicate_kind::*;
8081
pub use region_kind::*;
8182
pub use rustc_ast_ir::{FloatTy, IntTy, Movability, Mutability, Pinnedness, UintTy};
8283
use rustc_type_ir_macros::GenericTypeVisitable;
84+
pub use ty::{Alias, AliasTerm, AliasTy, UnevaluatedConst};
8385
pub use ty_info::*;
8486
pub use ty_kind::*;
8587
pub use unnormalized::Unnormalized;

compiler/rustc_type_ir/src/predicate.rs

Lines changed: 18 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ use rustc_type_ir_macros::{
99
};
1010

1111
use crate::inherent::*;
12+
use crate::ty::AliasTerm;
1213
use crate::upcast::{Upcast, UpcastFrom};
1314
use crate::visit::TypeVisitableExt as _;
14-
use crate::{self as ty, AliasTyKind, Interner, UnevaluatedConstKind};
15+
use crate::{self as ty, Alias, AliasTyKind, Interner, UnevaluatedConstKind};
1516

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

539540
#[derive_where(Clone, Copy, PartialEq, Eq, Hash, Debug; I: Interner)]
540-
#[derive(Lift_Generic, TypeVisitable_Generic, GenericTypeVisitable)]
541+
#[derive(TypeVisitable_Generic, TypeFoldable_Generic, Lift_Generic, GenericTypeVisitable)]
541542
#[cfg_attr(
542543
feature = "nightly",
543544
derive(Encodable_NoContext, Decodable_NoContext, StableHash_NoContext)
@@ -640,41 +641,6 @@ impl<I: Interner> From<ty::UnevaluatedConstKind<I>> for AliasTermKind<I> {
640641
}
641642
}
642643

643-
/// Represents the unprojected term of a projection goal.
644-
///
645-
/// * For a projection, this would be `<Ty as Trait<...>>::N<...>`.
646-
/// * For an inherent projection, this would be `Ty::N<...>`.
647-
/// * For an opaque type, there is no explicit syntax.
648-
#[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner)]
649-
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
650-
#[cfg_attr(
651-
feature = "nightly",
652-
derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext)
653-
)]
654-
pub struct AliasTerm<I: Interner> {
655-
/// The parameters of the associated or opaque item.
656-
///
657-
/// For a projection, these are the generic parameters for the trait and the
658-
/// GAT parameters, if there are any.
659-
///
660-
/// For an inherent projection, they consist of the self type and the GAT parameters,
661-
/// if there are any.
662-
///
663-
/// For RPIT the generic parameters are for the generics of the function,
664-
/// while for TAIT it is used for the generic parameters of the alias.
665-
pub args: I::GenericArgs,
666-
667-
#[type_foldable(identity)]
668-
#[type_visitable(ignore)]
669-
pub kind: AliasTermKind<I>,
670-
671-
/// This field exists to prevent the creation of `AliasTerm` without using [`AliasTerm::new_from_args`].
672-
#[derive_where(skip(Debug))]
673-
_use_alias_term_new_instead: (),
674-
}
675-
676-
impl<I: Interner> Eq for AliasTerm<I> {}
677-
678644
impl<I: Interner> AliasTerm<I> {
679645
pub fn new_from_args(
680646
interner: I,
@@ -694,7 +660,7 @@ impl<I: Interner> AliasTerm<I> {
694660
};
695661
interner.debug_assert_args_compatible(def_id, args);
696662
}
697-
AliasTerm { kind, args, _use_alias_term_new_instead: () }
663+
AliasTerm { kind, args, _use_alias_new_instead: () }
698664
}
699665

700666
pub fn new(
@@ -724,7 +690,7 @@ impl<I: Interner> AliasTerm<I> {
724690
panic!("Cannot turn `{}` into `AliasTy`", kind.descr())
725691
}
726692
};
727-
ty::AliasTy { kind, args: self.args, _use_alias_ty_new_instead: () }
693+
ty::AliasTy { kind, args: self.args, _use_alias_new_instead: () }
728694
}
729695

730696
pub fn expect_ct(self) -> ty::UnevaluatedConst<I> {
@@ -742,7 +708,7 @@ impl<I: Interner> AliasTerm<I> {
742708
panic!("Cannot turn `{}` into `UnevaluatedConst`", kind.descr())
743709
}
744710
};
745-
ty::UnevaluatedConst { kind, args: self.args, _use_unevaluated_const_new_instead: () }
711+
ty::UnevaluatedConst { kind, args: self.args, _use_alias_new_instead: () }
746712
}
747713

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

898864
impl<I: Interner> From<ty::AliasTy<I>> for AliasTerm<I> {
899865
fn from(ty: ty::AliasTy<I>) -> Self {
900-
AliasTerm {
901-
args: ty.args,
902-
kind: AliasTermKind::from(ty.kind),
903-
_use_alias_term_new_instead: (),
904-
}
866+
AliasTerm { args: ty.args, kind: AliasTermKind::from(ty.kind), _use_alias_new_instead: () }
905867
}
906868
}
907869

908870
impl<I: Interner> From<ty::UnevaluatedConst<I>> for AliasTerm<I> {
909871
fn from(ty: ty::UnevaluatedConst<I>) -> Self {
910-
AliasTerm {
911-
args: ty.args,
912-
kind: AliasTermKind::from(ty.kind),
913-
_use_alias_term_new_instead: (),
914-
}
872+
AliasTerm { args: ty.args, kind: AliasTermKind::from(ty.kind), _use_alias_new_instead: () }
915873
}
916874
}
917875

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

991949
/// Used by the new solver to normalize an alias. This always expects the `term` to
992950
/// be an unconstrained inference variable which is used as the output.
993-
#[derive_where(Clone, Copy, Hash, PartialEq; I: Interner)]
951+
#[derive_where(Clone, Copy, Hash, Eq, PartialEq; I: Interner, K)]
994952
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
995953
#[cfg_attr(
996954
feature = "nightly",
997955
derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext)
998956
)]
999-
pub struct NormalizesTo<I: Interner> {
1000-
pub alias: AliasTerm<I>,
957+
pub struct NormalizesTo<I: Interner, K = AliasTermKind<I>> {
958+
pub alias: Alias<I, K>,
1001959
pub term: I::Term,
1002960
}
1003961

1004-
impl<I: Interner> Eq for NormalizesTo<I> {}
1005-
1006962
impl<I: Interner> NormalizesTo<I> {
1007963
pub fn self_ty(self) -> I::Ty {
1008964
self.alias.self_ty()
@@ -1017,7 +973,13 @@ impl<I: Interner> NormalizesTo<I> {
1017973
}
1018974
}
1019975

1020-
impl<I: Interner> fmt::Debug for NormalizesTo<I> {
976+
impl<I: Interner, K> fmt::Debug for NormalizesTo<I, K>
977+
where
978+
// `TypeVisitable_Generic` derived on `NormalizesTo` creates a field-level
979+
// `Alias<I, K>: TypeVisitable<I>` bound. Since `TypeVisitable<I>: fmt::Debug`,
980+
// that proves `Alias<I, K>: fmt::Debug`, but not `K: fmt::Debug`.
981+
Alias<I, K>: fmt::Debug,
982+
{
1021983
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1022984
write!(f, "NormalizesTo({:?}, {:?})", self.alias, self.term)
1023985
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
use derive_where::derive_where;
2+
#[cfg(feature = "nightly")]
3+
use rustc_macros::{Decodable_NoContext, Encodable_NoContext, StableHash_NoContext};
4+
use rustc_type_ir_macros::{
5+
GenericTypeVisitable, Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic,
6+
};
7+
8+
use crate::predicate::AliasTermKind;
9+
use crate::ty_kind::AliasTyKind;
10+
use crate::{Interner, UnevaluatedConstKind};
11+
12+
/// Represents an alias of a type, constant, or other term-like item.
13+
///
14+
/// * For a projection, this would be `<Ty as Trait<...>>::N<...>`.
15+
/// * For an inherent projection, this would be `Ty::N<...>`.
16+
/// * For an opaque type, there is no explicit syntax.
17+
#[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner, K)]
18+
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
19+
#[cfg_attr(
20+
feature = "nightly",
21+
derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext)
22+
)]
23+
pub struct Alias<I: Interner, K> {
24+
pub kind: K,
25+
26+
/// The parameters of the associated, opaque, or constant alias.
27+
///
28+
/// For a projection, these are the generic parameters for the trait and the
29+
/// GAT parameters, if there are any.
30+
///
31+
/// For an inherent projection, they consist of the self type and the GAT parameters,
32+
/// if there are any.
33+
///
34+
/// For RPIT the generic parameters are for the generics of the function,
35+
/// while for TAIT it is used for the generic parameters of the alias.
36+
pub args: I::GenericArgs,
37+
38+
/// This field exists to prevent the creation of `Alias` without using the relevant constructor.
39+
#[derive_where(skip(Debug))]
40+
#[type_visitable(ignore)]
41+
#[type_foldable(identity)]
42+
#[lift(identity)]
43+
pub(crate) _use_alias_new_instead: (),
44+
}
45+
46+
impl<I: Interner, K: PartialEq> Eq for Alias<I, K> {}
47+
48+
impl<I: Interner, K: Copy> Alias<I, K> {
49+
pub fn kind(self, _interner: I) -> K {
50+
self.kind
51+
}
52+
}
53+
54+
pub type AliasTerm<I> = Alias<I, AliasTermKind<I>>;
55+
pub type AliasTy<I> = Alias<I, AliasTyKind<I>>;
56+
pub type UnevaluatedConst<I> = Alias<I, UnevaluatedConstKind<I>>;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mod alias;
2+
3+
pub use alias::{Alias, AliasTerm, AliasTy, UnevaluatedConst};

compiler/rustc_type_ir/src/ty_kind.rs

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ use rustc_type_ir_macros::{
1717
use self::TyKind::*;
1818
pub use self::closure::*;
1919
use crate::inherent::*;
20+
use crate::ty::AliasTy;
2021
#[cfg(feature = "nightly")]
2122
use crate::visit::TypeVisitable;
2223
use crate::{self as ty, BoundVarIndexKind, FloatTy, IntTy, Interner, UintTy};
2324

2425
mod closure;
2526

2627
#[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner)]
27-
#[derive(GenericTypeVisitable, Lift_Generic)]
28+
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
2829
#[cfg_attr(
2930
feature = "nightly",
3031
derive(Encodable_NoContext, Decodable_NoContext, StableHash_NoContext)
@@ -427,45 +428,10 @@ impl<I: Interner> fmt::Debug for TyKind<I> {
427428
}
428429
}
429430

430-
/// Represents the projection of an associated, opaque, or lazy-type-alias type.
431-
///
432-
/// * For a projection, this would be `<Ty as Trait<...>>::N<...>`.
433-
/// * For an inherent projection, this would be `Ty::N<...>`.
434-
/// * For an opaque type, there is no explicit syntax.
435-
#[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner)]
436-
#[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)]
437-
#[cfg_attr(
438-
feature = "nightly",
439-
derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext)
440-
)]
441-
pub struct AliasTy<I: Interner> {
442-
/// The parameters of the associated or opaque type.
443-
///
444-
/// For a projection, these are the generic parameters for the trait and the
445-
/// GAT parameters, if there are any.
446-
///
447-
/// For an inherent projection, they consist of the self type and the GAT parameters,
448-
/// if there are any.
449-
///
450-
/// For RPIT the generic parameters are for the generics of the function,
451-
/// while for TAIT it is used for the generic parameters of the alias.
452-
pub args: I::GenericArgs,
453-
454-
#[type_foldable(identity)]
455-
#[type_visitable(ignore)]
456-
pub kind: AliasTyKind<I>,
457-
458-
/// This field exists to prevent the creation of `AliasTy` without using [`AliasTy::new_from_args`].
459-
#[derive_where(skip(Debug))]
460-
pub(crate) _use_alias_ty_new_instead: (),
461-
}
462-
463-
impl<I: Interner> Eq for AliasTy<I> {}
464-
465431
impl<I: Interner> AliasTy<I> {
466432
pub fn new_from_args(interner: I, kind: AliasTyKind<I>, args: I::GenericArgs) -> AliasTy<I> {
467433
interner.debug_assert_args_compatible(kind.def_id(), args);
468-
AliasTy { kind, args, _use_alias_ty_new_instead: () }
434+
AliasTy { kind, args, _use_alias_new_instead: () }
469435
}
470436

471437
pub fn new(

tests/mir-opt/issue_99325.main.built.after.32bit.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| User Type Annotations
44
| 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">}
5-
| 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">}
5+
| 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">}
66
|
77
fn main() -> () {
88
let mut _0: ();

tests/mir-opt/issue_99325.main.built.after.64bit.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| User Type Annotations
44
| 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">}
5-
| 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">}
5+
| 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">}
66
|
77
fn main() -> () {
88
let mut _0: ();

tests/ui/attributes/dump-preds.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ error: rustc_dump_item_bounds
3333
LL | type Assoc<P: Eq>: std::ops::Deref<Target = ()>
3434
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3535
|
36-
= 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: [] }
36+
= 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: [] }
3737
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::ops::Deref>, polarity:Positive), bound_vars: [] }
3838
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::marker::Sized>, polarity:Positive), bound_vars: [] }
3939

tests/ui/coherence/occurs-check/associated-type.next.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
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) }, .. }
2-
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) }, .. }
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))], .. }
2+
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))], .. }
33
error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), ())>` for type `for<'a> fn(&'a (), ())`
44
--> $DIR/associated-type.rs:32:1
55
|

0 commit comments

Comments
 (0)