File tree Expand file tree Collapse file tree 1 file changed +0
-13
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ use std::marker::PhantomData;
2121use std:: mem;
2222use std:: num:: NonZeroUsize ;
2323use std:: ops:: { ControlFlow , Deref } ;
24- use std:: slice;
2524
2625/// An entity in the Rust type system, which can be one of
2726/// several kinds (types, lifetimes, and consts).
@@ -55,18 +54,6 @@ pub enum GenericArgKind<'tcx> {
5554 Const ( ty:: Const < ' tcx > ) ,
5655}
5756
58- /// This function goes from `&'a [Ty<'tcx>]` to `&'a [GenericArg<'tcx>]`
59- ///
60- /// This is sound as, for types, `GenericArg` is just
61- /// `NonZeroUsize::new_unchecked(ty as *const _ as usize)` as
62- /// long as we use `0` for the `TYPE_TAG`.
63- pub fn ty_slice_as_generic_args < ' a , ' tcx > ( ts : & ' a [ Ty < ' tcx > ] ) -> & ' a [ GenericArg < ' tcx > ] {
64- assert_eq ! ( TYPE_TAG , 0 ) ;
65- // SAFETY: the whole slice is valid and immutable.
66- // `Ty` and `GenericArg` is explained above.
67- unsafe { slice:: from_raw_parts ( ts. as_ptr ( ) . cast ( ) , ts. len ( ) ) }
68- }
69-
7057impl < ' tcx > GenericArgKind < ' tcx > {
7158 #[ inline]
7259 fn pack ( self ) -> GenericArg < ' tcx > {
You can’t perform that action at this time.
0 commit comments