Skip to content

Commit 04e9918

Browse files
author
jasper3108
committed
make TraitImpl unstable
1 parent 7857058 commit 04e9918

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

compiler/rustc_const_eval/src/const_eval/machine.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ use tracing::debug;
2121

2222
use super::error::*;
2323
use crate::errors::{LongRunning, LongRunningWarn};
24-
use crate::interpret::util::type_implements_dyn_trait;
2524
use crate::interpret::{
2625
self, AllocId, AllocInit, AllocRange, ConstAllocation, CtfeProvenance, FnArg, Frame,
2726
GlobalAlloc, ImmTy, InterpCx, InterpResult, OpTy, PlaceTy, Pointer, RangeSet, Scalar,
2827
compile_time_machine, err_inval, interp_ok, throw_exhaust, throw_inval, throw_ub,
29-
throw_ub_custom, throw_unsup, throw_unsup_format,
28+
throw_ub_custom, throw_unsup, throw_unsup_format, type_implements_dyn_trait,
3029
};
3130

3231
/// When hitting this many interpreted terminators we emit a deny by default lint

compiler/rustc_const_eval/src/interpret/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mod projection;
1515
mod stack;
1616
mod step;
1717
mod traits;
18-
pub(crate) mod util;
18+
mod util;
1919
mod validity;
2020
mod visitor;
2121

@@ -38,6 +38,6 @@ use self::place::{MemPlace, Place};
3838
pub use self::projection::{OffsetMode, Projectable};
3939
pub use self::stack::{Frame, FrameInfo, LocalState, ReturnContinuation};
4040
pub use self::util::EnteredTraceSpan;
41-
pub(crate) use self::util::create_static_alloc;
41+
pub(crate) use self::util::{create_static_alloc, type_implements_dyn_trait};
4242
pub use self::validity::{CtfeValidationMode, RangeSet, RefTracking};
4343
pub use self::visitor::ValueVisitor;

library/core/src/mem/type_info.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ pub struct Type {
2020

2121
/// Info of a trait implementation, you can retrieve the vtable with [Self::get_vtable]
2222
#[derive(Debug, PartialEq, Eq)]
23+
#[unstable(feature = "type_info", issue = "146922")]
24+
#[non_exhaustive]
2325
pub struct TraitImpl<T: PointeeSized> {
2426
pub(crate) vtable: DynMetadata<T>,
2527
}

0 commit comments

Comments
 (0)