Conversation
3ef4cf0 to
c64839d
Compare
|
The job Click to see the possible cause of the failure (guessed by this bot) |
| write!(p, ")")?; | ||
| if let Some(ty) = return_ty.skip_binder().as_type() { | ||
| if !ty.is_unit() { | ||
| if !matches!(ty.kind(), ty::Tuple(tys) if tys.is_empty()) { |
| where | ||
| F: FnOnce(&mut Self) -> R; | ||
| pub trait TyEncoder<'tcx>: ir_codec::TyEncoder<'tcx, Interner = TyCtxt<'tcx>> {} | ||
| impl<'tcx, T> TyEncoder<'tcx> for T where T: ir_codec::TyEncoder<'tcx, Interner = TyCtxt<'tcx>> {} |
There was a problem hiding this comment.
why does this trait have to be moved? This is surprising to me
Might be good to write in the PR description what you're moving and why.
As in, sth like
- moving
Ty - also uses other types
Xwhich now need to be moved - has function which relies on
tcx, add methodfn XXXtotrait Interner
| /// `Decodable` can still be implemented in cases where `Decodable` is required | ||
| /// by a trait bound. | ||
| pub trait RefDecodable<'tcx, D: TyDecoder<'tcx>>: PointeeSized { | ||
| pub trait RefDecodable<'tcx, D: TyDecoder<'tcx>>: std::marker::PointeeSized { |
| feature = "nightly", | ||
| derive(Encodable_NoContext, Decodable_NoContext, HashStable_NoContext) | ||
| )] | ||
| #[cfg_attr(feature = "nightly", derive(HashStable_NoContext))] |
| #[rustc_diagnostic_item = "Ty"] | ||
| #[rustc_pass_by_value] | ||
| #[rustc_has_incoherent_inherent_impls] | ||
| pub struct Ty<I: Interner>(pub I::Interned<WithCachedTypeInfo<TyKind<I>>>); |
There was a problem hiding this comment.
should be in a mod ty or mod sty to mirror rustc_middle
| #[cfg_attr(feature = "nightly", derive(HashStable_NoContext))] | ||
| #[rustc_diagnostic_item = "Ty"] | ||
| #[rustc_pass_by_value] | ||
| #[rustc_has_incoherent_inherent_impls] |
There was a problem hiding this comment.
dubious :3 i guess that's a way to simply the migration. Removing this before merge/add a TODO rn
| #[inline] | ||
| pub fn interned(self) -> I::Interned<WithCachedTypeInfo<TyKind<I>>> { | ||
| self.0 | ||
| } |
| } | ||
|
|
||
| #[inline] | ||
| #[allow(rustc::pass_by_value)] |
|
|
||
| impl<I: Interner> TypeSuperVisitable<I> for Ty<I> | ||
| where | ||
| I::Interned<WithCachedTypeInfo<TyKind<I>>>: Deref<Target = WithCachedTypeInfo<TyKind<I>>>, |
There was a problem hiding this comment.
should be item bound of I::Interned, same with all other where-bounds here
| I::Region: TypeFoldable<I> + TypeVisitable<I>, | ||
| I::Term: From<Ty<I>>, | ||
| I::Tys: TypeFoldable<I> + TypeVisitable<I>, | ||
| I::Interned<WithCachedTypeInfo<TyKind<I>>>: |
| /// This offset is also chosen so that the first byte is never < 0x80. | ||
| pub const SHORTHAND_OFFSET: usize = 0x80; | ||
|
|
||
| pub trait TyEncoder<'tcx>: SpanEncoder { |
There was a problem hiding this comment.
this feels rustc specific and is not used by r-a afaik, so I'd prefer keeping this in rustc_middle for now
| } | ||
|
|
||
| pub trait Interned<T>: Clone + Copy + Hash + PartialEq + Eq + Debug { | ||
| fn new_unchecked(t: &T) -> Self; |
There was a problem hiding this comment.
🤔 where is that used, surprising that we'd ever want to use this in rustc_next_trait_solver
| + Hash | ||
| + Eq | ||
| + PartialEq | ||
| + Deref<Target = T>; |
There was a problem hiding this comment.
should be a super trait bounds of a single Interned trait
| #![cfg_attr(feature = "nightly", rustc_diagnostic_item = "type_ir")] | ||
| // tidy-alphabetical-start | ||
| #![allow(rustc::direct_use_of_rustc_type_ir)] | ||
| #![allow(rustc::pass_by_value)] |
r? ghost