Skip to content

Commit c490968

Browse files
committed
Use consisntent style of size_of in query type erasure
All other impls replace type generics with `()` (or a type implementing the necessery traits) and lifetimes with `'static`, do the same for those impls.
1 parent 61361bb commit c490968

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_middle/src/query/erase.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ pub fn restore<T: EraseType>(value: Erase<T>) -> T {
4646
}
4747

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

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

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

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

0 commit comments

Comments
 (0)