Skip to content

Commit

Permalink
Use consisntent style of size_of in query type erasure
Browse files Browse the repository at this point in the history
All other impls replace type generics with `()` (or a type implementing the necessery traits)
and lifetimes with `'static`, do the same for those impls.
  • Loading branch information
WaffleLapkin committed Oct 3, 2023
1 parent 61361bb commit c490968
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/query/erase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ pub fn restore<T: EraseType>(value: Erase<T>) -> T {
}

impl<T> EraseType for &'_ T {
type Result = [u8; size_of::<*const ()>()];
type Result = [u8; size_of::<&'static ()>()];
}

impl<T> EraseType for &'_ [T] {
type Result = [u8; size_of::<*const [()]>()];
type Result = [u8; size_of::<&'static [()]>()];
}

impl<T> EraseType for &'_ ty::List<T> {
type Result = [u8; size_of::<*const ()>()];
type Result = [u8; size_of::<&'static ty::List<()>>()];
}

impl<I: rustc_index::Idx, T> EraseType for &'_ rustc_index::IndexSlice<I, T> {
Expand Down

0 comments on commit c490968

Please sign in to comment.