This repository was archived by the owner on May 28, 2025. It is now read-only.
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;
21
21
use std::mem;
22
22
use std::num::NonZeroUsize;
23
23
use std::ops::{ControlFlow, Deref};
24
- use std::slice;
25
24
26
25
/// An entity in the Rust type system, which can be one of
27
26
/// several kinds (types, lifetimes, and consts).
@@ -55,18 +54,6 @@ pub enum GenericArgKind<'tcx> {
55
54
Const(ty::Const<'tcx>),
56
55
}
57
56
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
-
70
57
impl<'tcx> GenericArgKind<'tcx> {
71
58
#[inline]
72
59
fn pack(self) -> GenericArg<'tcx> {
You can’t perform that action at this time.
0 commit comments