diff --git a/charon/hax-frontend/src/constant_utils/uneval.rs b/charon/hax-frontend/src/constant_utils/uneval.rs index e48f97f2f..dcc51464e 100644 --- a/charon/hax-frontend/src/constant_utils/uneval.rs +++ b/charon/hax-frontend/src/constant_utils/uneval.rs @@ -114,9 +114,8 @@ pub fn eval_ty_constant<'tcx, S: UnderOwnerState<'tcx>>( impl<'tcx, S: UnderOwnerState<'tcx>> SInto for ty::Const<'tcx> { #[tracing::instrument(level = "trace", skip(s))] fn sinto(&self, s: &S) -> ConstantExpr { - use rustc_middle::query::Key; let tcx = s.base().tcx; - let span = self.default_span(tcx); + let span = rustc_span::DUMMY_SP; match self.kind() { ty::ConstKind::Param(p) => { let ty = p.find_const_ty_from_env(s.param_env()); @@ -135,10 +134,9 @@ impl<'tcx, S: UnderOwnerState<'tcx>> SInto for ty::Const<'tcx> val.sinto(s) } else { use crate::rustc_middle::query::Key; - let span = span.substitute_dummy( - tcx.def_ident_span(ucv.def) - .unwrap_or_else(|| ucv.def.default_span(tcx)), - ); + let span = tcx + .def_ident_span(ucv.def) + .unwrap_or_else(|| ucv.def.default_span(tcx)); let item = translate_item_ref(s, ucv.def, ucv.args); let kind = ConstantExprKind::NamedGlobal(item); let ty = tcx.type_of(ucv.def).instantiate(tcx, ucv.args); @@ -182,9 +180,9 @@ pub(crate) fn valtree_to_constant_expr<'tcx, S: UnderOwnerState<'tcx>>( (ty::ValTreeKind::Branch(valtrees), ty::Str) => { let bytes = valtrees .iter() - .map(|x| match &***x { - ty::ValTreeKind::Leaf(leaf) => leaf.to_u8(), - _ => fatal!( + .map(|x| match x.try_to_leaf() { + Some(leaf) => leaf.to_u8(), + None => fatal!( s[span], "Expected a flat list of leaves while translating \ a str literal, got a arbitrary valtree." @@ -193,43 +191,34 @@ pub(crate) fn valtree_to_constant_expr<'tcx, S: UnderOwnerState<'tcx>>( .collect(); ConstantExprKind::Literal(ConstantLiteral::byte_str(bytes)) } - ( - ty::ValTreeKind::Branch(_), - ty::Array(..) | ty::Slice(..) | ty::Tuple(..) | ty::Adt(..), - ) => { - let contents: rustc_middle::ty::DestructuredConst = s - .base() - .tcx - .destructure_const(ty::Const::new_value(s.base().tcx, valtree, ty)); - let fields = contents.fields.iter().copied(); + (ty::ValTreeKind::Branch(fields), ty::Array(..) | ty::Slice(..) | ty::Tuple(..)) => { + let fields = fields.iter().copied().map(|field| field.sinto(s)).collect(); match ty.kind() { - ty::Array(..) | ty::Slice(..) => ConstantExprKind::Array { - fields: fields.map(|field| field.sinto(s)).collect(), - }, - ty::Tuple(_) => ConstantExprKind::Tuple { - fields: fields.map(|field| field.sinto(s)).collect(), - }, - ty::Adt(def, _) => { - let variant_idx = contents - .variant - .s_expect(s, "destructed const of adt without variant idx"); - let variant_def = &def.variant(variant_idx); - - ConstantExprKind::Adt { - kind: get_variant_kind(def, variant_idx, s), - fields: fields - .into_iter() - .zip(&variant_def.fields) - .map(|(value, field)| ConstantFieldExpr { - field: field.did.sinto(s), - value: value.sinto(s), - }) - .collect(), - } - } + ty::Array(..) | ty::Slice(..) => ConstantExprKind::Array { fields }, + ty::Tuple(_) => ConstantExprKind::Tuple { fields }, _ => unreachable!(), } } + (ty::ValTreeKind::Branch(_), ty::Adt(def, _)) => { + let contents: rustc_middle::ty::DestructuredAdtConst = + ty::Value { valtree, ty }.destructure_adt_const(); + + let fields = contents.fields.iter().copied(); + let variant_idx = contents.variant; + let variant_def = &def.variant(variant_idx); + + ConstantExprKind::Adt { + kind: get_variant_kind(def, variant_idx, s), + fields: fields + .into_iter() + .zip(&variant_def.fields) + .map(|(value, field)| ConstantFieldExpr { + field: field.did.sinto(s), + value: value.sinto(s), + }) + .collect(), + } + } (ty::ValTreeKind::Leaf(x), ty::RawPtr(_, _)) => { use crate::rustc_type_ir::inherent::Ty; let raw_address = x.to_bits_unchecked(); diff --git a/charon/hax-frontend/src/types/mir.rs b/charon/hax-frontend/src/types/mir.rs index 6c22264a1..1f1ea9af7 100644 --- a/charon/hax-frontend/src/types/mir.rs +++ b/charon/hax-frontend/src/types/mir.rs @@ -75,8 +75,7 @@ pub mod mir_kinds { id: DefId, f: impl FnOnce(&Body<'tcx>) -> T, ) -> Option { - tcx.is_ctfe_mir_available(id) - .then(|| f(tcx.mir_for_ctfe(id))) + (!tcx.is_trivial_const(id)).then(|| f(tcx.mir_for_ctfe(id))) } } diff --git a/charon/hax-frontend/src/types/ty.rs b/charon/hax-frontend/src/types/ty.rs index 558d78d01..cd4d5b789 100644 --- a/charon/hax-frontend/src/types/ty.rs +++ b/charon/hax-frontend/src/types/ty.rs @@ -72,7 +72,7 @@ pub struct ExistentialProjection { /// Reflects [`ty::BoundTyKind`] #[derive(AdtInto, Clone, Debug, Hash, PartialEq, Eq)] -#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: ty::BoundTyKind, state: S as s)] +#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: ty::BoundTyKind<'tcx>, state: S as s)] pub enum BoundTyKind { Anon, #[custom_arm(&FROM_TYPE::Param(def_id) => TO_TYPE::Param(def_id.sinto(s), s.base().tcx.item_name(def_id).sinto(s)),)] @@ -82,7 +82,7 @@ pub enum BoundTyKind { /// Reflects [`ty::BoundTy`] #[derive(AdtInto, Clone, Debug, Hash, PartialEq, Eq)] -#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: ty::BoundTy, state: S as s)] +#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: ty::BoundTy<'tcx>, state: S as s)] pub struct BoundTy { pub var: BoundVar, pub kind: BoundTyKind, @@ -93,10 +93,10 @@ sinto_as_usize!(rustc_middle::ty, BoundVar); /// Reflects [`ty::BoundRegionKind`] #[derive(AdtInto, Clone, Debug, Hash, PartialEq, Eq)] -#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: ty::BoundRegionKind, state: S as s)] +#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: ty::BoundRegionKind<'tcx>, state: S as s)] pub enum BoundRegionKind { Anon, - NamedAnon(Symbol), + NamedForPrinting(Symbol), #[custom_arm(&FROM_TYPE::Named(def_id) => TO_TYPE::Named(def_id.sinto(s), s.base().tcx.item_name(def_id).sinto(s)),)] Named(DefId, Symbol), ClosureEnv, @@ -105,7 +105,7 @@ pub enum BoundRegionKind { /// Reflects [`ty::BoundRegion`] #[derive(AdtInto, Clone, Debug, Hash, PartialEq, Eq)] -#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: ty::BoundRegion, state: S as s)] +#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: ty::BoundRegion<'tcx>, state: S as s)] pub struct BoundRegion { pub var: BoundVar, pub kind: BoundRegionKind, @@ -126,7 +126,7 @@ pub struct Placeholder { } impl<'tcx, S: UnderOwnerState<'tcx>, T: SInto, U> SInto> - for ty::Placeholder + for ty::Placeholder, T> { fn sinto(&self, s: &S) -> Placeholder { Placeholder { @@ -1291,7 +1291,7 @@ impl<'tcx, S: UnderOwnerState<'tcx>> SInto for ty::Predicate<'tcx> /// Reflects [`ty::BoundVariableKind`] #[derive(AdtInto)] -#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: ty::BoundVariableKind, state: S as tcx)] +#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: ty::BoundVariableKind<'tcx>, state: S as tcx)] #[derive(Clone, Debug, Hash, PartialEq, Eq)] pub enum BoundVariableKind { Ty(BoundTyKind), @@ -1445,7 +1445,7 @@ impl ClosureArgs { struct RegionUnEraserVisitor<'tcx> { tcx: ty::TyCtxt<'tcx>, depth: u32, - bound_vars: Vec, + bound_vars: Vec>, } impl<'tcx> ty::TypeFolder> for RegionUnEraserVisitor<'tcx> { diff --git a/charon/rust-toolchain b/charon/rust-toolchain index 7abf500f6..ebd45d66e 100644 --- a/charon/rust-toolchain +++ b/charon/rust-toolchain @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2025-11-23" +channel = "nightly-2026-02-07" components = [ "rustc-dev", "llvm-tools-preview", "rust-src", "miri" ] targets = [ "x86_64-apple-darwin", "i686-unknown-linux-gnu", "powerpc64-unknown-linux-gnu", "riscv64gc-unknown-none-elf" ] diff --git a/charon/src/ast/types_utils.rs b/charon/src/ast/types_utils.rs index 53c8f5bd5..5a6d39862 100644 --- a/charon/src/ast/types_utils.rs +++ b/charon/src/ast/types_utils.rs @@ -689,6 +689,10 @@ impl Ty { Self::mk_tuple(vec![]) } + pub fn mk_bool() -> Ty { + TyKind::Literal(LiteralTy::Bool).into() + } + pub fn mk_usize() -> Ty { TyKind::Literal(LiteralTy::UInt(UIntTy::Usize)).into() } diff --git a/charon/src/bin/charon-driver/driver.rs b/charon/src/bin/charon-driver/driver.rs index 3faaf6d2c..7727f5715 100644 --- a/charon/src/bin/charon-driver/driver.rs +++ b/charon/src/bin/charon-driver/driver.rs @@ -54,7 +54,7 @@ fn set_skip_borrowck() { } fn skip_borrowck_if_set(providers: &mut Providers) { if SKIP_BORROWCK.load(Ordering::SeqCst) { - providers.mir_borrowck = |tcx, _def_id| { + providers.queries.mir_borrowck = |tcx, _def_id| { // Empty result, which is what is used for custom_mir bodies. Ok(tcx.arena.alloc(Default::default())) } diff --git a/charon/src/bin/charon-driver/translate/get_mir.rs b/charon/src/bin/charon-driver/translate/get_mir.rs index f31c4c68b..14815a2ac 100644 --- a/charon/src/bin/charon-driver/translate/get_mir.rs +++ b/charon/src/bin/charon-driver/translate/get_mir.rs @@ -99,17 +99,17 @@ fn get_mir_for_def_id_and_level<'tcx>( | hax::DefKind::InlineConst ); let mir_available = tcx.is_mir_available(rust_def_id); - let ctfe_mir_available = tcx.is_ctfe_mir_available(rust_def_id); - // For globals, prefer ctfe_mir when both are available. - let body = if mir_available && !(is_global && ctfe_mir_available) { - tcx.optimized_mir(rust_def_id).clone() - } else if ctfe_mir_available { - tcx.mir_for_ctfe(rust_def_id).clone() + + if mir_available && !is_global { + Some(tcx.optimized_mir(rust_def_id).clone()) + } else if (is_global && !tcx.is_trivial_const(rust_def_id)) + || tcx.is_const_fn(rust_def_id) + { + Some(tcx.mir_for_ctfe(rust_def_id).clone()) } else { - trace!("no mir available"); - return None; - }; - Some(body) + trace!("mir not available for {:?}", rust_def_id); + None + } } hax::DefIdBase::Promoted(rust_def_id, promoted_id) => { Some(hax::get_promoted_mir(tcx, rust_def_id, promoted_id)) diff --git a/charon/src/bin/charon-driver/translate/translate_bodies.rs b/charon/src/bin/charon-driver/translate/translate_bodies.rs index e5522a986..756ab1cb9 100644 --- a/charon/src/bin/charon-driver/translate/translate_bodies.rs +++ b/charon/src/bin/charon-driver/translate/translate_bodies.rs @@ -82,6 +82,35 @@ impl<'tcx, 'tctx, 'ictx> DerefMut for BodyTransCtx<'tcx, 'tctx, 'ictx> { } } +/// A translation context for function blocks. +pub(crate) struct BlockTransCtx<'tcx, 'tctx, 'ictx, 'bctx> { + /// The translation context for the item. + pub b_ctx: &'bctx mut BodyTransCtx<'tcx, 'tctx, 'ictx>, + /// List of currently translated statements + pub statements: Vec, +} + +impl<'tcx, 'tctx, 'ictx, 'bctx> BlockTransCtx<'tcx, 'tctx, 'ictx, 'bctx> { + pub(crate) fn new(b_ctx: &'bctx mut BodyTransCtx<'tcx, 'tctx, 'ictx>) -> Self { + BlockTransCtx { + b_ctx, + statements: Vec::new(), + } + } +} + +impl<'tcx, 'tctx, 'ictx, 'bctx> Deref for BlockTransCtx<'tcx, 'tctx, 'ictx, 'bctx> { + type Target = BodyTransCtx<'tcx, 'tctx, 'ictx>; + fn deref(&self) -> &Self::Target { + self.b_ctx + } +} +impl<'tcx, 'tctx, 'ictx, 'bctx> DerefMut for BlockTransCtx<'tcx, 'tctx, 'ictx, 'bctx> { + fn deref_mut(&mut self) -> &mut Self::Target { + self.b_ctx + } +} + pub fn translate_variant_id(id: hax::VariantIdx) -> VariantId { VariantId::new(id.as_usize()) } @@ -188,37 +217,6 @@ impl<'tcx> BodyTransCtx<'tcx, '_, '_> { self.locals_map.insert(rid.as_usize(), local_id); } - fn translate_binaryop_kind(&mut self, _span: Span, binop: mir::BinOp) -> Result { - Ok(match binop { - mir::BinOp::BitXor => BinOp::BitXor, - mir::BinOp::BitAnd => BinOp::BitAnd, - mir::BinOp::BitOr => BinOp::BitOr, - mir::BinOp::Eq => BinOp::Eq, - mir::BinOp::Lt => BinOp::Lt, - mir::BinOp::Le => BinOp::Le, - mir::BinOp::Ne => BinOp::Ne, - mir::BinOp::Ge => BinOp::Ge, - mir::BinOp::Gt => BinOp::Gt, - mir::BinOp::Add => BinOp::Add(OverflowMode::Wrap), - mir::BinOp::AddUnchecked => BinOp::Add(OverflowMode::UB), - mir::BinOp::Sub => BinOp::Sub(OverflowMode::Wrap), - mir::BinOp::SubUnchecked => BinOp::Sub(OverflowMode::UB), - mir::BinOp::Mul => BinOp::Mul(OverflowMode::Wrap), - mir::BinOp::MulUnchecked => BinOp::Mul(OverflowMode::UB), - mir::BinOp::Div => BinOp::Div(OverflowMode::UB), - mir::BinOp::Rem => BinOp::Rem(OverflowMode::UB), - mir::BinOp::AddWithOverflow => BinOp::AddChecked, - mir::BinOp::SubWithOverflow => BinOp::SubChecked, - mir::BinOp::MulWithOverflow => BinOp::MulChecked, - mir::BinOp::Shl => BinOp::Shl(OverflowMode::Wrap), - mir::BinOp::ShlUnchecked => BinOp::Shl(OverflowMode::UB), - mir::BinOp::Shr => BinOp::Shr(OverflowMode::Wrap), - mir::BinOp::ShrUnchecked => BinOp::Shr(OverflowMode::UB), - mir::BinOp::Cmp => BinOp::Cmp, - mir::BinOp::Offset => BinOp::Offset, - }) - } - /// Translate a function's local variables by adding them in the environment. fn translate_body_locals(&mut self, body: &mir::Body<'tcx>) -> Result<(), Error> { // Translate the parameters @@ -259,27 +257,136 @@ impl<'tcx> BodyTransCtx<'tcx, '_, '_> { block: &mir::BasicBlockData<'tcx>, ) -> Result { // Translate the statements - let mut statements = Vec::new(); + let mut block_ctx = BlockTransCtx::new(self); for statement in &block.statements { trace!("statement: {:?}", statement); - - // Some statements might be ignored, hence the optional returned value - let opt_statement = self.translate_statement(source_scopes, statement)?; - if let Some(statement) = opt_statement { - statements.push(statement) - } + block_ctx.translate_statement(source_scopes, statement)?; } // Translate the terminator let terminator = block.terminator.as_ref().unwrap(); - let terminator = self.translate_terminator(source_scopes, terminator)?; + let terminator = block_ctx.translate_terminator(source_scopes, terminator)?; Ok(BlockData { - statements, + statements: block_ctx.statements, terminator, }) } + /// Gather all the lines that start with `//` inside the given span. + fn translate_body_comments( + &mut self, + source_text: &Option, + charon_span: Span, + ) -> Vec<(usize, Vec)> { + if let Some(body_text) = source_text { + let mut comments = body_text + .lines() + // Iter through the lines of this body in reverse order. + .rev() + .enumerate() + // Compute the absolute line number + .map(|(i, line)| (charon_span.data.end.line - i, line)) + // Extract the comment if this line starts with `//` + .map(|(line_nbr, line)| (line_nbr, line.trim_start().strip_prefix("//"))) + .peekable() + .batching(|iter| { + // Get the next line. This is not a comment: it's either the last line of the + // body or a line that wasn't consumed by `peeking_take_while`. + let (line_nbr, _first) = iter.next()?; + // Collect all the comments before this line. + let mut comments = iter + // `peeking_take_while` ensures we don't consume a line that returns + // `false`. It will be consumed by the next round of `batching`. + .peeking_take_while(|(_, opt_comment)| opt_comment.is_some()) + .map(|(_, opt_comment)| opt_comment.unwrap()) + .map(|s| s.strip_prefix(" ").unwrap_or(s)) + .map(str::to_owned) + .collect_vec(); + comments.reverse(); + Some((line_nbr, comments)) + }) + .filter(|(_, comments)| !comments.is_empty()) + .collect_vec(); + comments.reverse(); + comments + } else { + Vec::new() + } + } + + fn translate_body( + mut self, + mir_body: &mir::Body<'tcx>, + source_text: &Option, + ) -> Result { + // Compute the span information + let span = self.translate_span(&mir_body.span); + + // Initialize the local variables + trace!("Translating the body locals"); + self.locals.arg_count = mir_body.arg_count; + self.translate_body_locals(&mir_body)?; + + // Translate the expression body + trace!("Translating the expression body"); + + // Register the start block + let id = self.translate_basic_block_id(rustc_index::Idx::new(mir::START_BLOCK.as_usize())); + assert!(id == START_BLOCK_ID); + + // For as long as there are blocks in the stack, translate them + while let Some(mir_block_id) = self.blocks_stack.pop_front() { + let mir_block = mir_body.basic_blocks.get(mir_block_id).unwrap(); + let block_id = self.translate_basic_block_id(mir_block_id); + let block = self.translate_basic_block(&mir_body.source_scopes, mir_block)?; + self.blocks.set_slot(block_id, block); + } + + // Create the body + let comments = self.translate_body_comments(source_text, span); + Ok(Body::Unstructured(ExprBody { + span, + locals: self.locals, + bound_body_regions: self.i_ctx.lifetime_freshener.take().unwrap().slot_count(), + body: self.blocks.make_contiguous(), + comments, + })) + } +} + +impl<'tcx> BlockTransCtx<'tcx, '_, '_, '_> { + fn translate_binaryop_kind(&mut self, _span: Span, binop: mir::BinOp) -> Result { + Ok(match binop { + mir::BinOp::BitXor => BinOp::BitXor, + mir::BinOp::BitAnd => BinOp::BitAnd, + mir::BinOp::BitOr => BinOp::BitOr, + mir::BinOp::Eq => BinOp::Eq, + mir::BinOp::Lt => BinOp::Lt, + mir::BinOp::Le => BinOp::Le, + mir::BinOp::Ne => BinOp::Ne, + mir::BinOp::Ge => BinOp::Ge, + mir::BinOp::Gt => BinOp::Gt, + mir::BinOp::Add => BinOp::Add(OverflowMode::Wrap), + mir::BinOp::AddUnchecked => BinOp::Add(OverflowMode::UB), + mir::BinOp::Sub => BinOp::Sub(OverflowMode::Wrap), + mir::BinOp::SubUnchecked => BinOp::Sub(OverflowMode::UB), + mir::BinOp::Mul => BinOp::Mul(OverflowMode::Wrap), + mir::BinOp::MulUnchecked => BinOp::Mul(OverflowMode::UB), + mir::BinOp::Div => BinOp::Div(OverflowMode::UB), + mir::BinOp::Rem => BinOp::Rem(OverflowMode::UB), + mir::BinOp::AddWithOverflow => BinOp::AddChecked, + mir::BinOp::SubWithOverflow => BinOp::SubChecked, + mir::BinOp::MulWithOverflow => BinOp::MulChecked, + mir::BinOp::Shl => BinOp::Shl(OverflowMode::Wrap), + mir::BinOp::ShlUnchecked => BinOp::Shl(OverflowMode::UB), + mir::BinOp::Shr => BinOp::Shr(OverflowMode::Wrap), + mir::BinOp::ShrUnchecked => BinOp::Shr(OverflowMode::UB), + mir::BinOp::Cmp => BinOp::Cmp, + mir::BinOp::Offset => BinOp::Offset, + }) + } + fn translate_place( &mut self, span: Span, @@ -453,6 +560,28 @@ impl<'tcx> BodyTransCtx<'tcx, '_, '_> { } } } + mir::Operand::RuntimeChecks(check) => { + let op = match check { + mir::RuntimeChecks::UbChecks => NullOp::UbChecks, + mir::RuntimeChecks::OverflowChecks => NullOp::OverflowChecks, + mir::RuntimeChecks::ContractChecks => NullOp::ContractChecks, + }; + let local = self.locals.new_var(None, Ty::mk_bool()); + self.statements.push(Statement { + span, + kind: StatementKind::StorageLive(local.as_local().unwrap()), + comments_before: vec![], + }); + self.statements.push(Statement { + span, + kind: StatementKind::Assign( + local.clone(), + Rvalue::NullaryOp(op, Ty::mk_bool()), + ), + comments_before: vec![], + }); + Operand::Move(local) + } }) } @@ -562,7 +691,7 @@ impl<'tcx> BodyTransCtx<'tcx, '_, '_> { } mir::CastKind::PointerCoercion( ty::adjustment::PointerCoercion::UnsafeFnPointer - | ty::adjustment::PointerCoercion::ReifyFnPointer, + | ty::adjustment::PointerCoercion::ReifyFnPointer(_), .., ) => CastKind::FnPtr(src_ty, tgt_ty), mir::CastKind::Transmute => CastKind::Transmute(src_ty, tgt_ty), @@ -658,14 +787,6 @@ impl<'tcx> BodyTransCtx<'tcx, '_, '_> { self.translate_operand(span, left)?, self.translate_operand(span, right)?, )), - mir::Rvalue::NullaryOp(mir::NullOp::RuntimeChecks(check)) => { - let op = match check { - mir::RuntimeChecks::UbChecks => NullOp::UbChecks, - mir::RuntimeChecks::OverflowChecks => NullOp::OverflowChecks, - mir::RuntimeChecks::ContractChecks => NullOp::ContractChecks, - }; - Ok(Rvalue::NullaryOp(op, LiteralTy::Bool.into())) - } mir::Rvalue::UnaryOp(unop, operand) => { let operand = self.translate_operand(span, operand)?; let unop = match unop { @@ -677,7 +798,9 @@ impl<'tcx> BodyTransCtx<'tcx, '_, '_> { p.project(ProjectionElem::PtrMetadata, tgt_ty.clone()), ))); } - Operand::Const(_) => panic!("const metadata"), + Operand::Const(_) => { + panic!("unexpected metadata operand") + } }, }; Ok(Rvalue::UnaryOp(unop, operand)) @@ -817,7 +940,7 @@ impl<'tcx> BodyTransCtx<'tcx, '_, '_> { &mut self, source_scopes: &rustc_index::IndexVec, statement: &mir::Statement<'tcx>, - ) -> Result, Error> { + ) -> Result<(), Error> { trace!("About to translate statement (MIR) {:?}", statement); let span = self.translate_span_from_source_info(source_scopes, &statement.source_info); @@ -895,7 +1018,12 @@ impl<'tcx> BodyTransCtx<'tcx, '_, '_> { }; // Add the span information - Ok(t_statement.map(|kind| Statement::new(span, kind))) + let Some(t_statement) = t_statement else { + return Ok(()); + }; + let statement = Statement::new(span, t_statement); + self.statements.push(statement); + Ok(()) } /// Translate a terminator @@ -1269,87 +1397,6 @@ impl<'tcx> BodyTransCtx<'tcx, '_, '_> { } Ok(t_args) } - - /// Gather all the lines that start with `//` inside the given span. - fn translate_body_comments( - &mut self, - source_text: &Option, - charon_span: Span, - ) -> Vec<(usize, Vec)> { - if let Some(body_text) = source_text { - let mut comments = body_text - .lines() - // Iter through the lines of this body in reverse order. - .rev() - .enumerate() - // Compute the absolute line number - .map(|(i, line)| (charon_span.data.end.line - i, line)) - // Extract the comment if this line starts with `//` - .map(|(line_nbr, line)| (line_nbr, line.trim_start().strip_prefix("//"))) - .peekable() - .batching(|iter| { - // Get the next line. This is not a comment: it's either the last line of the - // body or a line that wasn't consumed by `peeking_take_while`. - let (line_nbr, _first) = iter.next()?; - // Collect all the comments before this line. - let mut comments = iter - // `peeking_take_while` ensures we don't consume a line that returns - // `false`. It will be consumed by the next round of `batching`. - .peeking_take_while(|(_, opt_comment)| opt_comment.is_some()) - .map(|(_, opt_comment)| opt_comment.unwrap()) - .map(|s| s.strip_prefix(" ").unwrap_or(s)) - .map(str::to_owned) - .collect_vec(); - comments.reverse(); - Some((line_nbr, comments)) - }) - .filter(|(_, comments)| !comments.is_empty()) - .collect_vec(); - comments.reverse(); - comments - } else { - Vec::new() - } - } - - fn translate_body( - mut self, - mir_body: &mir::Body<'tcx>, - source_text: &Option, - ) -> Result { - // Compute the span information - let span = self.translate_span(&mir_body.span); - - // Initialize the local variables - trace!("Translating the body locals"); - self.locals.arg_count = mir_body.arg_count; - self.translate_body_locals(&mir_body)?; - - // Translate the expression body - trace!("Translating the expression body"); - - // Register the start block - let id = self.translate_basic_block_id(rustc_index::Idx::new(mir::START_BLOCK.as_usize())); - assert!(id == START_BLOCK_ID); - - // For as long as there are blocks in the stack, translate them - while let Some(mir_block_id) = self.blocks_stack.pop_front() { - let mir_block = mir_body.basic_blocks.get(mir_block_id).unwrap(); - let block_id = self.translate_basic_block_id(mir_block_id); - let block = self.translate_basic_block(&mir_body.source_scopes, mir_block)?; - self.blocks.set_slot(block_id, block); - } - - // Create the body - let comments = self.translate_body_comments(source_text, span); - Ok(Body::Unstructured(ExprBody { - span, - locals: self.locals, - bound_body_regions: self.i_ctx.lifetime_freshener.take().unwrap().slot_count(), - body: self.blocks.make_contiguous(), - comments, - })) - } } impl<'a> IntoFormatter for &'a BodyTransCtx<'_, '_, '_> { diff --git a/charon/src/bin/charon-driver/translate/translate_generics.rs b/charon/src/bin/charon-driver/translate/translate_generics.rs index 0a83139cd..4c1beb802 100644 --- a/charon/src/bin/charon-driver/translate/translate_generics.rs +++ b/charon/src/bin/charon-driver/translate/translate_generics.rs @@ -87,7 +87,7 @@ impl BindingLevel { use hax::BoundRegionKind::*; let name = match region { Anon => None, - NamedAnon(symbol) | Named(_, symbol) => translate_region_name(symbol), + NamedForPrinting(symbol) | Named(_, symbol) => translate_region_name(symbol), ClosureEnv => Some("@env".to_owned()), }; let rid = self diff --git a/charon/src/bin/charon-driver/translate/translate_meta.rs b/charon/src/bin/charon-driver/translate/translate_meta.rs index 7c42248a2..cff6519f8 100644 --- a/charon/src/bin/charon-driver/translate/translate_meta.rs +++ b/charon/src/bin/charon-driver/translate/translate_meta.rs @@ -1,6 +1,7 @@ //! Translate information about items: name, attributes, etc. use itertools::Itertools; use rustc_middle::mir; +use rustc_span::RemapPathScopeComponents; use std::cmp::Ord; use std::path::{Component, PathBuf}; @@ -36,9 +37,8 @@ impl<'tcx, 'ctx> TranslateCtx<'tcx> { pub fn translate_filename(&mut self, name: rustc_span::FileName) -> meta::FileName { match name { rustc_span::FileName::Real(name) => { - use rustc_span::RealFileName; - match name { - RealFileName::LocalPath(path) => { + match name.local_path() { + Some(path) => { let path = if let Ok(path) = path.strip_prefix(&self.sysroot) { // The path to files in the standard library may be full paths to somewhere // in the sysroot. This may depend on how the toolchain is installed @@ -70,15 +70,16 @@ impl<'tcx, 'ctx> TranslateCtx<'tcx> { rewritten_path.extend(path); rewritten_path } else { - path.clone() + path.into() } }; FileName::Local(path) } - RealFileName::Remapped { virtual_name, .. } => { + None => { // We use the virtual name because it is always available. // That name normally starts with `/rustc//`. For our purposes we hide // the hash. + let virtual_name = name.path(RemapPathScopeComponents::empty()); let mut components_iter = virtual_name.components(); if let Some( [ @@ -96,7 +97,7 @@ impl<'tcx, 'ctx> TranslateCtx<'tcx> { .collect(); FileName::Virtual(path_without_hash) } else { - FileName::Virtual(virtual_name.clone()) + FileName::Virtual(virtual_name.into()) } } } diff --git a/charon/src/bin/charon-driver/translate/translate_trait_objects.rs b/charon/src/bin/charon-driver/translate/translate_trait_objects.rs index b7b25971f..9df9e0f99 100644 --- a/charon/src/bin/charon-driver/translate/translate_trait_objects.rs +++ b/charon/src/bin/charon-driver/translate/translate_trait_objects.rs @@ -284,6 +284,21 @@ impl ItemTransCtx<'_, '_> { }) } + /// The Charon+Hax machinery will add Destruct super-traits to trait bounds, + /// however for `dyn Trait` the Destruct super-trait is unexepcted, as it is not + /// dyn-compatible. + /// We use this function to ensure that any non dyn-compatible super-trait is + /// Destruct and can be safely ignored. + fn assert_is_destruct(&self, tref: &hax::TraitRef) { + assert!( + tref.def_id + .as_rust_def_id() + .is_some_and(|id| self.tcx.is_lang_item(id, rustc_hir::LangItem::Destruct)), + "unexpected non-dyn compatible supertrait: {:?}", + tref.def_id + ); + } + fn gen_vtable_struct_fields( &mut self, span: Span, @@ -320,12 +335,16 @@ impl ItemTransCtx<'_, '_> { let hax::ClauseKind::Trait(pred) = kind else { unreachable!() }; - let tyref = ctx - .translate_vtable_struct_ref(span, &pred.trait_ref)? - .expect("parent trait should be dyn compatible"); + let tyref = ctx.translate_vtable_struct_ref(span, &pred.trait_ref)?; + if tyref.is_none() { + ctx.assert_is_destruct(&pred.trait_ref); + } Ok(tyref) })?; - let vtbl_struct = self.erase_region_binder(vtbl_struct); + // We already checked above that it's ok for this to be none. + let Some(vtbl_struct) = self.erase_region_binder(vtbl_struct) else { + continue; + }; let ty = Ty::new(TyKind::Ref( Region::Static, Ty::new(TyKind::Adt(vtbl_struct)), @@ -678,23 +697,29 @@ impl ItemTransCtx<'_, '_> { let bound_tyref = self.translate_region_binder(span, &impl_expr.r#trait, |ctx, tref| { - let tyref = ctx - .translate_vtable_struct_ref(span, tref)? - .expect("parent trait should be dyn compatible"); + let tyref = ctx.translate_vtable_struct_ref(span, tref)?; + if tyref.is_none() { + ctx.assert_is_destruct(tref); + } Ok(tyref) })?; - let vtable_def_ref = self.erase_region_binder(bound_tyref); + let Some(vtable_def_ref) = self.erase_region_binder(bound_tyref) else { + continue; + }; let fn_ptr_ty = TyKind::Adt(vtable_def_ref).into_ty(); let kind = match &impl_expr.r#impl { hax::ImplExprAtom::Concrete(impl_item) => { - let bound_gref: RegionBinder = - self.translate_region_binder(span, &impl_expr.r#trait, |ctx, tref| { - let gref = ctx - .translate_vtable_instance_ref(span, tref, impl_item)? - .expect("parent trait should be dyn compatible"); + let bound_gref: RegionBinder> = self + .translate_region_binder(span, &impl_expr.r#trait, |ctx, tref| { + let gref = ctx.translate_vtable_instance_ref(span, tref, impl_item)?; + if gref.is_none() { + ctx.assert_is_destruct(tref); + }; Ok(gref) })?; - let vtable_instance_ref = self.erase_region_binder(bound_gref); + let Some(vtable_instance_ref) = self.erase_region_binder(bound_gref) else { + continue; + }; let global = Box::new(ConstantExpr { kind: ConstantExprKind::Global(vtable_instance_ref), ty: fn_ptr_ty, diff --git a/charon/tests/cargo/dependencies.out b/charon/tests/cargo/dependencies.out index 84dd1a171..68b0b9e1e 100644 --- a/charon/tests/cargo/dependencies.out +++ b/charon/tests/cargo/dependencies.out @@ -21,7 +21,7 @@ pub trait Sized pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/cargo/error-dependencies.out b/charon/tests/cargo/error-dependencies.out index 68ddc7311..66746c077 100644 --- a/charon/tests/cargo/error-dependencies.out +++ b/charon/tests/cargo/error-dependencies.out @@ -5,7 +5,7 @@ error: Error parsing attribute: Unrecognized attribute: `charon::error` | ^^^^^^^^^^^^^^^^ error: Error parsing attribute: Unrecognized attribute: `charon::error` - --> ./tests/cargo/error-dependencies/error-crate/src/lib.rs:4:1 + --> error-crate/src/lib.rs:4:1 note: the error occurred when translating `error_crate::CausesError`, which is (transitively) used at the following location(s): --> src/module.rs:7:9 @@ -15,7 +15,7 @@ note: the error occurred when translating `error_crate::CausesError`, which is ( 8 | let _y = error_crate::CausesError; | ------------------------ error: Error parsing attribute: Unrecognized attribute: `charon::error` - --> ./tests/cargo/error-dependencies/error-crate/src/lib.rs:4:1 + --> error-crate/src/lib.rs:4:1 ERROR Charon failed to translate this code (3 errors) error: could not compile `test-cargo` (bin "test-cargo") diff --git a/charon/tests/ui/arrays.out b/charon/tests/ui/arrays.out index cc29dd0b9..6f27a08b9 100644 --- a/charon/tests/ui/arrays.out +++ b/charon/tests/ui/arrays.out @@ -55,7 +55,7 @@ where pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/associated-types.out b/charon/tests/ui/associated-types.out index 36a295546..7af6bbb43 100644 --- a/charon/tests/ui/associated-types.out +++ b/charon/tests/ui/associated-types.out @@ -76,7 +76,7 @@ impl<'_0, T> Copy for &'_0 T { pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/call-to-known-trait-method.out b/charon/tests/ui/call-to-known-trait-method.out index 0f25d1d5f..aaba9db64 100644 --- a/charon/tests/ui/call-to-known-trait-method.out +++ b/charon/tests/ui/call-to-known-trait-method.out @@ -93,7 +93,7 @@ impl Default for bool { pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/closure-as-fn.out b/charon/tests/ui/closure-as-fn.out index b11f9f49d..4593500f8 100644 --- a/charon/tests/ui/closure-as-fn.out +++ b/charon/tests/ui/closure-as-fn.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/closures.out b/charon/tests/ui/closures.out index 0d233c94a..ed356b3f5 100644 --- a/charon/tests/ui/closures.out +++ b/charon/tests/ui/closures.out @@ -9,7 +9,7 @@ pub trait MetaSized pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::marker::Sized @@ -44,6 +44,14 @@ pub trait FnMut vtable: core::ops::function::FnMut::{vtable} } +// Full name: core::marker::Destruct +#[lang_item("destruct")] +pub trait Destruct +{ + fn drop_in_place = core::marker::Destruct::drop_in_place + non-dyn-compatible +} + // Full name: core::array::{[T; N]}::map pub fn map(@1: [T; N], @2: F) -> [U; N] where @@ -51,6 +59,9 @@ where [@TraitClause1]: Sized, [@TraitClause2]: Sized, [@TraitClause3]: FnMut, + [@TraitClause4]: Destruct, + [@TraitClause5]: Destruct, + [@TraitClause6]: Destruct, = // Full name: core::clone::Clone @@ -79,14 +90,6 @@ impl Clone for u32 { non-dyn-compatible } -// Full name: core::marker::Destruct -#[lang_item("destruct")] -pub trait Destruct -{ - fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} -} - unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) = @@ -1943,6 +1946,16 @@ where struct test_crate::test_array_map::closure {} +// Full name: test_crate::test_array_map::closure::{impl Destruct for test_crate::test_array_map::closure}::drop_in_place +unsafe fn {impl Destruct for test_crate::test_array_map::closure}::drop_in_place(@1: *mut test_crate::test_array_map::closure) += + +// Full name: test_crate::test_array_map::closure::{impl Destruct for test_crate::test_array_map::closure} +impl Destruct for test_crate::test_array_map::closure { + fn drop_in_place = {impl Destruct for test_crate::test_array_map::closure}::drop_in_place + non-dyn-compatible +} + // Full name: test_crate::test_array_map::{impl FnMut<(i32,), i32> for test_crate::test_array_map::closure}::call_mut fn {impl FnMut<(i32,), i32> for test_crate::test_array_map::closure}::call_mut<'_0>(@1: &'_0 mut test_crate::test_array_map::closure, @2: (i32,)) -> i32 { @@ -1957,16 +1970,6 @@ fn {impl FnMut<(i32,), i32> for test_crate::test_array_map::closure}::call_mut<' return } -// Full name: test_crate::test_array_map::closure::{impl Destruct for test_crate::test_array_map::closure}::drop_in_place -unsafe fn {impl Destruct for test_crate::test_array_map::closure}::drop_in_place(@1: *mut test_crate::test_array_map::closure) -= - -// Full name: test_crate::test_array_map::closure::{impl Destruct for test_crate::test_array_map::closure} -impl Destruct for test_crate::test_array_map::closure { - fn drop_in_place = {impl Destruct for test_crate::test_array_map::closure}::drop_in_place - non-dyn-compatible -} - // Full name: test_crate::test_array_map::{impl FnOnce<(i32,), i32> for test_crate::test_array_map::closure}::call_once fn {impl FnOnce<(i32,), i32> for test_crate::test_array_map::closure}::call_once(@1: test_crate::test_array_map::closure, @2: (i32,)) -> i32 { @@ -2014,7 +2017,7 @@ pub fn test_array_map(@1: [i32; 256 : usize]) -> [i32; 256 : usize] _2 = copy x_1 storage_live(_3) _3 = test_crate::test_array_map::closure { } - _0 = map[{built_in impl Sized for i32}, {built_in impl Sized for test_crate::test_array_map::closure}, {built_in impl Sized for i32}, {impl FnMut<(i32,), i32> for test_crate::test_array_map::closure}](move _2, move _3) + _0 = map[{built_in impl Sized for i32}, {built_in impl Sized for test_crate::test_array_map::closure}, {built_in impl Sized for i32}, {impl FnMut<(i32,), i32> for test_crate::test_array_map::closure}, {impl Destruct for test_crate::test_array_map::closure}, {built_in impl Destruct for i32}, {built_in impl Destruct for i32}](move _2, move _3) storage_dead(_3) storage_dead(_2) return diff --git a/charon/tests/ui/closures_with_where.out b/charon/tests/ui/closures_with_where.out index 7e1479992..c318f1e2b 100644 --- a/charon/tests/ui/closures_with_where.out +++ b/charon/tests/ui/closures_with_where.out @@ -9,7 +9,7 @@ pub trait MetaSized pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::marker::Sized @@ -45,23 +45,25 @@ pub trait FnMut vtable: core::ops::function::FnMut::{vtable} } -// Full name: core::array::from_fn -pub fn from_fn(@1: F) -> [T; N] -where - [@TraitClause0]: Sized, - [@TraitClause1]: Sized, - [@TraitClause2]: FnMut, - @TraitClause2::parent_clause1::Output = T, -= - // Full name: core::marker::Destruct #[lang_item("destruct")] pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } +// Full name: core::array::from_fn +pub fn from_fn(@1: F) -> [T; N] +where + [@TraitClause0]: Sized, + [@TraitClause1]: Sized, + [@TraitClause2]: Destruct, + [@TraitClause3]: FnMut, + [@TraitClause4]: Destruct, + @TraitClause3::parent_clause1::Output = T, += + unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) = @@ -106,6 +108,23 @@ where [@TraitClause1]: Ops, {} +// Full name: test_crate::test::closure::{impl Destruct for closure[@TraitClause0, @TraitClause1]}::drop_in_place +unsafe fn {impl Destruct for closure[@TraitClause0, @TraitClause1]}::drop_in_place(@1: *mut closure[@TraitClause0, @TraitClause1]) +where + [@TraitClause0]: Sized, + [@TraitClause1]: Ops, += + +// Full name: test_crate::test::closure::{impl Destruct for closure[@TraitClause0, @TraitClause1]} +impl Destruct for closure[@TraitClause0, @TraitClause1] +where + [@TraitClause0]: Sized, + [@TraitClause1]: Ops, +{ + fn drop_in_place = {impl Destruct for closure[@TraitClause0, @TraitClause1]}::drop_in_place[@TraitClause0, @TraitClause1] + non-dyn-compatible +} + // Full name: test_crate::test::{impl FnMut<(usize,)> for closure[@TraitClause0, @TraitClause1]}::call_mut fn {impl FnMut<(usize,)> for closure[@TraitClause0, @TraitClause1]}::call_mut<'_0, T, const K : usize>(@1: &'_0 mut closure[@TraitClause0, @TraitClause1], @2: (usize,)) -> T where @@ -127,23 +146,6 @@ where return } -// Full name: test_crate::test::closure::{impl Destruct for closure[@TraitClause0, @TraitClause1]}::drop_in_place -unsafe fn {impl Destruct for closure[@TraitClause0, @TraitClause1]}::drop_in_place(@1: *mut closure[@TraitClause0, @TraitClause1]) -where - [@TraitClause0]: Sized, - [@TraitClause1]: Ops, -= - -// Full name: test_crate::test::closure::{impl Destruct for closure[@TraitClause0, @TraitClause1]} -impl Destruct for closure[@TraitClause0, @TraitClause1] -where - [@TraitClause0]: Sized, - [@TraitClause1]: Ops, -{ - fn drop_in_place = {impl Destruct for closure[@TraitClause0, @TraitClause1]}::drop_in_place[@TraitClause0, @TraitClause1] - non-dyn-compatible -} - // Full name: test_crate::test::{impl FnOnce<(usize,)> for closure[@TraitClause0, @TraitClause1]}::call_once fn {impl FnOnce<(usize,)> for closure[@TraitClause0, @TraitClause1]}::call_once(@1: closure[@TraitClause0, @TraitClause1], @2: (usize,)) -> T where @@ -202,7 +204,7 @@ where storage_live(_1) _1 = closure { } - _0 = from_fn[@TraitClause0, @TraitClause1], 1 : usize>[@TraitClause0, {built_in impl Sized for closure[@TraitClause0, @TraitClause1]}, {impl FnMut<(usize,)> for closure[@TraitClause0, @TraitClause1]}[@TraitClause0, @TraitClause1]](move _1) + _0 = from_fn[@TraitClause0, @TraitClause1], 1 : usize>[@TraitClause0, {built_in impl Sized for closure[@TraitClause0, @TraitClause1]}, {built_in impl Destruct for T}, {impl FnMut<(usize,)> for closure[@TraitClause0, @TraitClause1]}[@TraitClause0, @TraitClause1], {impl Destruct for closure[@TraitClause0, @TraitClause1]}[@TraitClause0, @TraitClause1]](move _1) storage_dead(_1) return } diff --git a/charon/tests/ui/comments.out b/charon/tests/ui/comments.out index 0e2bb65fb..618f911d7 100644 --- a/charon/tests/ui/comments.out +++ b/charon/tests/ui/comments.out @@ -40,7 +40,7 @@ pub opaque type Arguments<'a> pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/copy_nonoverlapping.out b/charon/tests/ui/copy_nonoverlapping.out index 3cc4a5990..22078fd31 100644 --- a/charon/tests/ui/copy_nonoverlapping.out +++ b/charon/tests/ui/copy_nonoverlapping.out @@ -8,6 +8,14 @@ pub opaque type Layout pub unsafe fn from_size_align_unchecked(@1: usize, @2: usize) -> Layout = +// Full name: core::marker::Destruct +#[lang_item("destruct")] +pub trait Destruct +{ + fn drop_in_place = drop_in_place + non-dyn-compatible +} + // Full name: core::marker::MetaSized #[lang_item("meta_sized")] pub trait MetaSized @@ -20,109 +28,415 @@ pub trait Sized non-dyn-compatible } -// Full name: core::intrinsics::size_of -pub fn size_of() -> usize +// Full name: core::clone::Clone +#[lang_item("clone")] +pub trait Clone +{ + parent_clause0 : [@TraitClause0]: Sized + fn clone<'_0_1> = core::clone::Clone::clone<'_0_1, Self>[Self] + fn clone_from<'_0_1, '_1_1, [@TraitClause0_1]: Destruct> = core::clone::Clone::clone_from<'_0_1, '_1_1, Self>[Self, @TraitClause0_1] + non-dyn-compatible +} + +#[lang_item("clone_fn")] +pub fn core::clone::Clone::clone<'_0, Self>(@1: &'_0 Self) -> Self where - [@TraitClause0]: Sized, + [@TraitClause0]: Clone, += + +pub fn core::clone::Clone::clone_from<'_0, '_1, Self>(@1: &'_0 mut Self, @2: &'_1 Self) +where + [@TraitClause0]: Clone, + [@TraitClause1]: Destruct, +{ + let _0: (); // return + let self_1: &'1 mut Self; // arg #1 + let source_2: &'3 Self; // arg #2 + let _3: Self; // anonymous local + + _0 = () + storage_live(_3) + _3 = @TraitClause0::clone<'5>(move source_2) + drop[@TraitClause1] (*self_1) + (*self_1) = move _3 + storage_dead(_3) + return +} + +// Full name: core::clone::impls::{impl Clone for usize}::clone +pub fn {impl Clone for usize}::clone<'_0>(@1: &'_0 usize) -> usize { let _0: usize; // return + let self_1: &'1 usize; // arg #1 - undefined_behavior + _0 = copy (*self_1) + return } -// Full name: core::intrinsics::align_of -pub fn align_of() -> usize +// Full name: core::clone::impls::{impl Clone for usize}::clone_from +pub fn {impl Clone for usize}::clone_from<'_0, '_1>(@1: &'_0 mut usize, @2: &'_1 usize) +where + [@TraitClause0]: Destruct, +{ + let _0: (); // return + let self_1: &'1 mut usize; // arg #1 + let source_2: &'3 usize; // arg #2 + let _3: usize; // anonymous local + + _0 = () + storage_live(_3) + _3 = {impl Clone for usize}::clone<'5>(move source_2) + drop[@TraitClause0] (*self_1) + (*self_1) = move _3 + storage_dead(_3) + return +} + +// Full name: core::clone::impls::{impl Clone for usize} +impl Clone for usize { + parent_clause0 = {built_in impl Sized for usize} + fn clone<'_0_1> = {impl Clone for usize}::clone<'_0_1> + fn clone_from<'_0_1, '_1_1, [@TraitClause0_1]: Destruct> = {impl Clone for usize}::clone_from<'_0_1, '_1_1>[@TraitClause0_1] + non-dyn-compatible +} + +// Full name: core::fmt::Error +pub struct Error {} + +// Full name: core::ptr::non_null::NonNull +#[lang_item("NonNull")] +pub struct NonNull { + pointer: *const T, +} + +// Full name: core::result::Result +#[lang_item("Result")] +pub enum Result where [@TraitClause0]: Sized, + [@TraitClause1]: Sized, { - let _0: usize; // return + Ok(T), + Err(E), +} - undefined_behavior +// Full name: core::marker::PhantomData +#[lang_item("phantom_data")] +pub struct PhantomData {} + +// Full name: core::fmt::rt::ArgumentType +enum ArgumentType<'a> { + Placeholder(value: NonNull<()>, formatter: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], _lifetime: PhantomData<&'a ()>), + Count(u16), } -// Full name: core::mem::SizedTypeProperties -pub trait SizedTypeProperties +// Full name: core::fmt::rt::Argument +#[lang_item("format_argument")] +pub struct Argument<'a> { + ty: ArgumentType<'a>, +} + +// Full name: core::fmt::Arguments +#[lang_item("format_arguments")] +pub struct Arguments<'a> { + template: NonNull, + args: NonNull>, +} + +// Full name: core::marker::Copy +#[lang_item("copy")] +pub trait Copy { - parent_clause0 : [@TraitClause0]: Sized - const SIZE : usize - const ALIGN : usize - const IS_ZST : bool - const LAYOUT : Layout - const MAX_SLICE_LEN : usize + parent_clause0 : [@TraitClause0]: MetaSized + parent_clause1 : [@TraitClause1]: Clone non-dyn-compatible } -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub fn SIZE() -> usize +// Full name: core::intrinsics::ctpop +pub fn ctpop(@1: T) -> u32 where - [@TraitClause0]: SizedTypeProperties, + [@TraitClause0]: Sized, + [@TraitClause1]: Copy, { - let _0: usize; // return + let _0: u32; // return + let x_1: T; // arg #1 - _0 = size_of[@TraitClause0::parent_clause0]() - return + undefined_behavior } -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub const SIZE: usize -where - [@TraitClause0]: SizedTypeProperties, - = SIZE() +// Full name: core::panicking::panic_nounwind_fmt::compiletime +fn compiletime<'_0>(@1: Arguments<'_0>, @2: bool) -> ! +{ + let _0: !; // return + let fmt_1: Arguments<'1>; // arg #1 + let force_no_backtrace_2: bool; // arg #2 -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub fn ALIGN() -> usize + panic(core::panicking::panic_fmt) +} + +// Full name: core::intrinsics::size_of +pub fn size_of() -> usize where - [@TraitClause0]: SizedTypeProperties, + [@TraitClause0]: Sized, { let _0: usize; // return - _0 = align_of[@TraitClause0::parent_clause0]() - return + undefined_behavior } -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub const ALIGN: usize +pub fn core::intrinsics::align_of() -> usize where - [@TraitClause0]: SizedTypeProperties, - = ALIGN() + [@TraitClause0]: Sized, +{ + let _0: usize; // return -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub fn IS_ZST() -> bool -where - [@TraitClause0]: SizedTypeProperties, + undefined_behavior +} + +// Full name: core::marker::{impl Copy for usize} +impl Copy for usize { + parent_clause0 = {built_in impl MetaSized for usize} + parent_clause1 = {impl Clone for usize} + non-dyn-compatible +} + +// Full name: core::marker::Destruct::drop_in_place +unsafe fn drop_in_place(@1: *mut Self) += + +// Full name: core::panicking::panic_nounwind_fmt +pub fn panic_nounwind_fmt<'_0>(@1: Arguments<'_0>, @2: bool) -> ! { - let _0: bool; // return + let _0: !; // return + let fmt_1: Arguments<'1>; // arg #1 + let force_no_backtrace_2: bool; // arg #2 + let _3: (Arguments<'3>, bool); // anonymous local + let _4: Arguments<'4>; // anonymous local + let _5: bool; // anonymous local - _0 = const @TraitClause0::SIZE == const 0 : usize + storage_live(_3) + storage_live(_4) + _4 = copy fmt_1 + storage_live(_5) + _5 = copy force_no_backtrace_2 + _3 = (move _4, move _5) + storage_dead(_5) + storage_dead(_4) + _0 = compiletime<'6>(move _3.0, move _3.1) +} + +fn core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(@1: usize) +{ + let _0: (); // return + let align_1: usize; // arg #1 + let msg_2: &'1 Str; // local + let _3: !; // anonymous local + let _4: Arguments<'3>; // anonymous local + let _5: u32; // anonymous local + let _6: NonNull; // anonymous local + let _7: *const u8; // anonymous local + let _8: NonNull>; // anonymous local + let _9: usize; // anonymous local + let _10: usize; // anonymous local + let _11: usize; // anonymous local + let _12: *const Str; // anonymous local + let _13: &'8 [u8]; // anonymous local + + storage_live(msg_2) + storage_live(_3) + _0 = () + storage_live(_5) + _5 = ctpop[{built_in impl Sized for usize}, {impl Copy for usize}](move align_1) + switch copy _5 { + 1 : u32 => { + }, + _ => { + storage_dead(_5) + msg_2 = const "unsafe precondition(s) violated: Alignment::new_unchecked requires a power of two\n\nThis indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety." + storage_live(_4) + storage_live(_6) + storage_live(_7) + storage_live(_12) + _12 = &raw const (*msg_2) with_metadata(copy msg_2.metadata) + _7 = cast<*const Str, *const u8>(copy _12) + storage_dead(_12) + _6 = transmute<*const u8, NonNull>(copy _7) + storage_dead(_7) + storage_live(_8) + storage_live(_9) + storage_live(_10) + storage_live(_11) + storage_live(_13) + _13 = transmute<&'11 Str, &'10 [u8]>(const "unsafe precondition(s) violated: Alignment::new_unchecked requires a power of two\n\nThis indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.") + _11 = copy _13.metadata + storage_dead(_13) + _10 = move _11 wrap.<< const 1 : i32 + storage_dead(_11) + _9 = move _10 | const 1 : usize + storage_dead(_10) + _8 = transmute>>(move _9) + storage_dead(_9) + _4 = Arguments { template: move _6, args: move _8 } + storage_dead(_8) + storage_dead(_6) + _3 = panic_nounwind_fmt<'15>(move _4, const false) + }, + } + storage_dead(_5) return } -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub const IS_ZST: bool -where - [@TraitClause0]: SizedTypeProperties, - = IS_ZST() +// Full name: core::ptr::alignment::AlignmentEnum +enum AlignmentEnum { + _Align1Shl0, + _Align1Shl1, + _Align1Shl2, + _Align1Shl3, + _Align1Shl4, + _Align1Shl5, + _Align1Shl6, + _Align1Shl7, + _Align1Shl8, + _Align1Shl9, + _Align1Shl10, + _Align1Shl11, + _Align1Shl12, + _Align1Shl13, + _Align1Shl14, + _Align1Shl15, + _Align1Shl16, + _Align1Shl17, + _Align1Shl18, + _Align1Shl19, + _Align1Shl20, + _Align1Shl21, + _Align1Shl22, + _Align1Shl23, + _Align1Shl24, + _Align1Shl25, + _Align1Shl26, + _Align1Shl27, + _Align1Shl28, + _Align1Shl29, + _Align1Shl30, + _Align1Shl31, + _Align1Shl32, + _Align1Shl33, + _Align1Shl34, + _Align1Shl35, + _Align1Shl36, + _Align1Shl37, + _Align1Shl38, + _Align1Shl39, + _Align1Shl40, + _Align1Shl41, + _Align1Shl42, + _Align1Shl43, + _Align1Shl44, + _Align1Shl45, + _Align1Shl46, + _Align1Shl47, + _Align1Shl48, + _Align1Shl49, + _Align1Shl50, + _Align1Shl51, + _Align1Shl52, + _Align1Shl53, + _Align1Shl54, + _Align1Shl55, + _Align1Shl56, + _Align1Shl57, + _Align1Shl58, + _Align1Shl59, + _Align1Shl60, + _Align1Shl61, + _Align1Shl62, + _Align1Shl63, +} -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub fn LAYOUT() -> Layout +// Full name: core::ptr::alignment::Alignment +pub struct Alignment { + _inner_repr_trick: AlignmentEnum, +} + +// Full name: core::option::Option +#[lang_item("Option")] +pub enum Option where - [@TraitClause0]: SizedTypeProperties, + [@TraitClause0]: Sized, { - let _0: Layout; // return + None, + Some(T), +} - _0 = from_size_align_unchecked(const @TraitClause0::SIZE, const @TraitClause0::ALIGN) +// Full name: core::ptr::alignment::{Alignment}::new +pub fn new(@1: usize) -> Option[{built_in impl Sized for Alignment}] +{ + let _0: Option[{built_in impl Sized for Alignment}]; // return + let align_1: usize; // arg #1 + let _2: Alignment; // anonymous local + let _3: u32; // anonymous local + let _4: (); // anonymous local + let _5: bool; // anonymous local + let _6: Option[{built_in impl Sized for Alignment}]; // anonymous local + + storage_live(_4) + storage_live(_3) + _3 = ctpop[{built_in impl Sized for usize}, {impl Copy for usize}](copy align_1) + switch copy _3 { + 1 : u32 => { + }, + _ => { + storage_dead(_3) + storage_live(_6) + _6 = Option::None { } + _0 = move _6 + return + }, + } + storage_dead(_3) + storage_live(_2) + storage_live(_5) + _5 = ub_checks + if move _5 { + _4 = core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(copy align_1) + } else { + } + _2 = transmute(copy align_1) + _0 = Option::Some { 0: move _2 } + storage_dead(_2) return } -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub const LAYOUT: Layout +// Full name: core::option::unwrap_failed +fn unwrap_failed() -> ! +{ + let _0: !; // return + + panic(core::panicking::panic) +} + +// Full name: core::option::{Option[@TraitClause0]}::unwrap +#[lang_item("option_unwrap")] +pub fn unwrap(@1: Option[@TraitClause0]) -> T where - [@TraitClause0]: SizedTypeProperties, - = LAYOUT() + [@TraitClause0]: Sized, +{ + let val_0: T; // return + let self_1: Option[@TraitClause0]; // arg #1 + let _2: !; // anonymous local + + storage_live(_2) + match self_1 { + Option::None => { + }, + Option::Some => { + val_0 = move (self_1 as variant Option::Some).0 + return + }, + } + _2 = unwrap_failed() +} pub fn core::num::{usize}::MAX() -> usize { @@ -148,6 +462,19 @@ pub fn core::num::{isize}::MAX() -> isize pub const core::num::{isize}::MAX: isize = core::num::{isize}::MAX() +// Full name: core::mem::SizedTypeProperties +pub trait SizedTypeProperties +{ + parent_clause0 : [@TraitClause0]: Sized + const SIZE : usize + const ALIGN : usize + const ALIGNMENT : Alignment + const IS_ZST : bool + const LAYOUT : Layout + const MAX_SLICE_LEN : usize + non-dyn-compatible +} + // Full name: core::mem::SizedTypeProperties::MAX_SLICE_LEN pub fn MAX_SLICE_LEN() -> usize where @@ -188,6 +515,106 @@ where [@TraitClause0]: SizedTypeProperties, = MAX_SLICE_LEN() +// Full name: core::mem::SizedTypeProperties::LAYOUT +pub fn LAYOUT() -> Layout +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: Layout; // return + + _0 = from_size_align_unchecked(const @TraitClause0::SIZE, const @TraitClause0::ALIGN) + return +} + +// Full name: core::mem::SizedTypeProperties::LAYOUT +pub const LAYOUT: Layout +where + [@TraitClause0]: SizedTypeProperties, + = LAYOUT() + +// Full name: core::mem::SizedTypeProperties::IS_ZST +pub fn IS_ZST() -> bool +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: bool; // return + + _0 = const @TraitClause0::SIZE == const 0 : usize + return +} + +// Full name: core::mem::SizedTypeProperties::IS_ZST +pub const IS_ZST: bool +where + [@TraitClause0]: SizedTypeProperties, + = IS_ZST() + +// Full name: core::mem::SizedTypeProperties::ALIGN +#[lang_item("mem_align_const")] +pub fn ALIGN() -> usize +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: usize; // return + + _0 = core::intrinsics::align_of[@TraitClause0::parent_clause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::ALIGN +#[lang_item("mem_align_const")] +pub const ALIGN: usize +where + [@TraitClause0]: SizedTypeProperties, + = ALIGN() + +// Full name: core::mem::SizedTypeProperties::SIZE +#[lang_item("mem_size_const")] +pub fn SIZE() -> usize +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: usize; // return + + _0 = size_of[@TraitClause0::parent_clause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::SIZE +#[lang_item("mem_size_const")] +pub const SIZE: usize +where + [@TraitClause0]: SizedTypeProperties, + = SIZE() + +#[lang_item("mem_align_of")] +pub fn core::mem::align_of() -> usize +where + [@TraitClause0]: Sized, +{ + let _0: usize; // return + + _0 = const {impl SizedTypeProperties for T}[@TraitClause0]::ALIGN + return +} + +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub fn ALIGNMENT() -> Alignment +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: Alignment; // return + + _0 = of[@TraitClause0::parent_clause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub const ALIGNMENT: Alignment +where + [@TraitClause0]: SizedTypeProperties, + = ALIGNMENT() + // Full name: core::mem::{impl SizedTypeProperties for T} impl SizedTypeProperties for T where @@ -196,14 +623,36 @@ where parent_clause0 = @TraitClause0 const SIZE = SIZE[{impl SizedTypeProperties for T}[@TraitClause0]] const ALIGN = ALIGN[{impl SizedTypeProperties for T}[@TraitClause0]] + const ALIGNMENT = ALIGNMENT[{impl SizedTypeProperties for T}[@TraitClause0]] const IS_ZST = IS_ZST[{impl SizedTypeProperties for T}[@TraitClause0]] const LAYOUT = LAYOUT[{impl SizedTypeProperties for T}[@TraitClause0]] const MAX_SLICE_LEN = MAX_SLICE_LEN[{impl SizedTypeProperties for T}[@TraitClause0]] non-dyn-compatible } -// Full name: core::ptr::copy_nonoverlapping::precondition_check -fn precondition_check(@1: *const (), @2: *mut (), @3: usize, @4: usize, @5: usize) +// Full name: core::ptr::alignment::{Alignment}::of +pub fn of() -> Alignment +where + [@TraitClause0]: Sized, +{ + let _0: Alignment; // return + let _1: Alignment; // anonymous local + let _2: Option[{built_in impl Sized for Alignment}]; // anonymous local + let _3: usize; // anonymous local + + storage_live(_1) + storage_live(_2) + storage_live(_3) + _3 = core::mem::align_of[@TraitClause0]() + _2 = new(move _3) + storage_dead(_3) + _1 = unwrap[{built_in impl Sized for Alignment}](move _2) + storage_dead(_2) + _0 = move _1 + return +} + +fn core::ptr::copy_nonoverlapping::precondition_check(@1: *const (), @2: *mut (), @3: usize, @4: usize, @5: usize) = // Full name: core::ptr::copy_nonoverlapping @@ -222,15 +671,15 @@ where let _7: bool; // anonymous local storage_live(_4) - storage_live(_7) _0 = () + storage_live(_7) _7 = ub_checks - if copy _7 { + if move _7 { storage_live(_5) _5 = cast<*const T, *const ()>(copy src_1) storage_live(_6) _6 = cast<*mut T, *mut ()>(copy dst_2) - _4 = precondition_check(move _5, move _6, const {impl SizedTypeProperties for T}[@TraitClause0]::SIZE, const {impl SizedTypeProperties for T}[@TraitClause0]::ALIGN, copy count_3) + _4 = core::ptr::copy_nonoverlapping::precondition_check(move _5, move _6, const {impl SizedTypeProperties for T}[@TraitClause0]::SIZE, const {impl SizedTypeProperties for T}[@TraitClause0]::ALIGN, copy count_3) storage_dead(_6) storage_dead(_5) } else { diff --git a/charon/tests/ui/desugar_drops_to_calls.out b/charon/tests/ui/desugar_drops_to_calls.out index 5d04f26d4..0a47284e3 100644 --- a/charon/tests/ui/desugar_drops_to_calls.out +++ b/charon/tests/ui/desugar_drops_to_calls.out @@ -25,7 +25,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/dictionary_passing_style_woes.out b/charon/tests/ui/dictionary_passing_style_woes.out index d31473fe6..fefd512e7 100644 --- a/charon/tests/ui/dictionary_passing_style_woes.out +++ b/charon/tests/ui/dictionary_passing_style_woes.out @@ -42,7 +42,7 @@ pub trait Copy pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/drop_after_overflow.out b/charon/tests/ui/drop_after_overflow.out index 8541e0056..3e8f8c6fc 100644 --- a/charon/tests/ui/drop_after_overflow.out +++ b/charon/tests/ui/drop_after_overflow.out @@ -17,7 +17,7 @@ pub trait MetaSized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/dyn-trait.out b/charon/tests/ui/dyn-trait.out index d0b9a2e51..a120224f5 100644 --- a/charon/tests/ui/dyn-trait.out +++ b/charon/tests/ui/dyn-trait.out @@ -64,7 +64,7 @@ where pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } opaque type core::ops::function::Fn::{vtable} diff --git a/charon/tests/ui/explicit-drop-bounds.out b/charon/tests/ui/explicit-drop-bounds.out index 5b53e71c8..c64258392 100644 --- a/charon/tests/ui/explicit-drop-bounds.out +++ b/charon/tests/ui/explicit-drop-bounds.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/external.out b/charon/tests/ui/external.out index 0e76da16d..d50c1b8d4 100644 --- a/charon/tests/ui/external.out +++ b/charon/tests/ui/external.out @@ -78,7 +78,7 @@ impl Copy for u32 { pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -181,6 +181,16 @@ where #[lang_item("global_alloc_ty")] pub struct Global {} +// Full name: alloc::alloc::Global::{impl Destruct for Global}::drop_in_place +unsafe fn {impl Destruct for Global}::drop_in_place(@1: *mut Global) += + +// Full name: alloc::alloc::Global::{impl Destruct for Global} +impl Destruct for Global { + fn drop_in_place = {impl Destruct for Global}::drop_in_place + non-dyn-compatible +} + // Full name: alloc::vec::Vec #[lang_item("Vec")] pub opaque type Vec @@ -216,6 +226,7 @@ pub fn push<'_0, T, A>(@1: &'_0 mut Vec[@TraitClause0, @TraitClause1], @2: T) where [@TraitClause0]: Sized, [@TraitClause1]: Sized, + [@TraitClause3]: Destruct, = fn UNIT_METADATA() @@ -281,7 +292,7 @@ pub fn test_vec_push() storage_live(_2) storage_live(_3) _3 = &two-phase-mut v_1 - _2 = push<'3, u32, Global>[{built_in impl Sized for u32}, {built_in impl Sized for Global}](move _3, const 0 : u32) + _2 = push<'3, u32, Global>[{built_in impl Sized for u32}, {built_in impl Sized for Global}, {impl Destruct for Global}](move _3, const 0 : u32) storage_dead(_3) storage_dead(_2) _0 = () diff --git a/charon/tests/ui/impl-trait.out b/charon/tests/ui/impl-trait.out index 484ebdf9c..6a141bcf8 100644 --- a/charon/tests/ui/impl-trait.out +++ b/charon/tests/ui/impl-trait.out @@ -55,7 +55,7 @@ impl<'_0, T> Clone for &'_0 T { pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -66,7 +66,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/issue-114-opaque-bodies.out b/charon/tests/ui/issue-114-opaque-bodies.out index a5df51813..fd16b0488 100644 --- a/charon/tests/ui/issue-114-opaque-bodies.out +++ b/charon/tests/ui/issue-114-opaque-bodies.out @@ -27,13 +27,14 @@ where pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::bool::{bool}::then_some pub fn then_some(@1: bool, @2: T) -> Option[@TraitClause0] where [@TraitClause0]: Sized, + [@TraitClause1]: Destruct, { let _0: Option[@TraitClause0]; // return let self_1: bool; // arg #1 @@ -43,7 +44,7 @@ where if copy self_1 { } else { _0 = Option::None { } - drop[{built_in impl Destruct for T}] t_2 + drop[@TraitClause1] t_2 return } storage_live(_3) @@ -277,7 +278,7 @@ fn bool_to_opt(@1: bool) -> Option<()>[{built_in impl Sized for ()}] _2 = copy b_1 storage_live(_3) _3 = () - _0 = then_some<()>[{built_in impl Sized for ()}](move _2, move _3) + _0 = then_some<()>[{built_in impl Sized for ()}, {built_in impl Destruct for ()}](move _2, move _3) storage_dead(_3) storage_dead(_2) return diff --git a/charon/tests/ui/issue-120-bare-discriminant-read.out b/charon/tests/ui/issue-120-bare-discriminant-read.out index fe3d94def..e78b6a2f7 100644 --- a/charon/tests/ui/issue-120-bare-discriminant-read.out +++ b/charon/tests/ui/issue-120-bare-discriminant-read.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/issue-165-vec-macro.out b/charon/tests/ui/issue-165-vec-macro.out index 53d74a4e1..817393a13 100644 --- a/charon/tests/ui/issue-165-vec-macro.out +++ b/charon/tests/ui/issue-165-vec-macro.out @@ -43,7 +43,7 @@ impl Clone for i32 { pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/issue-323-closure-borrow.out b/charon/tests/ui/issue-323-closure-borrow.out index b6b36a635..4f07773eb 100644 --- a/charon/tests/ui/issue-323-closure-borrow.out +++ b/charon/tests/ui/issue-323-closure-borrow.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/issue-372-type-param-out-of-range.out b/charon/tests/ui/issue-372-type-param-out-of-range.out index b05d7ae97..1796d8179 100644 --- a/charon/tests/ui/issue-372-type-param-out-of-range.out +++ b/charon/tests/ui/issue-372-type-param-out-of-range.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/issue-378-ctor-as-fn.out b/charon/tests/ui/issue-378-ctor-as-fn.out index 13feb6074..2b51be653 100644 --- a/charon/tests/ui/issue-378-ctor-as-fn.out +++ b/charon/tests/ui/issue-378-ctor-as-fn.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/issue-394-rpit-with-lifetime.out b/charon/tests/ui/issue-394-rpit-with-lifetime.out index 5a9acd30b..128745ace 100644 --- a/charon/tests/ui/issue-394-rpit-with-lifetime.out +++ b/charon/tests/ui/issue-394-rpit-with-lifetime.out @@ -27,7 +27,7 @@ where pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce @@ -74,7 +74,7 @@ where pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/issue-45-misc.out b/charon/tests/ui/issue-45-misc.out index f8c42f46e..e65241951 100644 --- a/charon/tests/ui/issue-45-misc.out +++ b/charon/tests/ui/issue-45-misc.out @@ -9,7 +9,7 @@ pub trait MetaSized pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::marker::Sized @@ -45,12 +45,23 @@ pub trait FnMut vtable: core::ops::function::FnMut::{vtable} } +// Full name: core::marker::Destruct +#[lang_item("destruct")] +pub trait Destruct +{ + fn drop_in_place = core::marker::Destruct::drop_in_place + non-dyn-compatible +} + pub fn core::array::{[T; N]}::map(@1: [T; N], @2: F) -> [U; N] where [@TraitClause0]: Sized, [@TraitClause1]: Sized, [@TraitClause2]: Sized, [@TraitClause3]: FnMut, + [@TraitClause4]: Destruct, + [@TraitClause5]: Destruct, + [@TraitClause6]: Destruct, @TraitClause3::parent_clause1::Output = U, = @@ -257,14 +268,6 @@ where [@TraitClause0]: Iterator, = -// Full name: core::marker::Destruct -#[lang_item("destruct")] -pub trait Destruct -{ - fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} -} - unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) = @@ -304,6 +307,16 @@ const UNIT_METADATA: () = @Fun0() // Full name: test_crate::map::closure struct closure {} +// Full name: test_crate::map::closure::{impl Destruct for closure}::drop_in_place +unsafe fn {impl Destruct for closure}::drop_in_place(@1: *mut closure) += + +// Full name: test_crate::map::closure::{impl Destruct for closure} +impl Destruct for closure { + fn drop_in_place = {impl Destruct for closure}::drop_in_place + non-dyn-compatible +} + // Full name: test_crate::map::{impl FnMut<(i32,)> for closure}::call_mut fn {impl FnMut<(i32,)> for closure}::call_mut<'_0>(@1: &'_0 mut closure, @2: (i32,)) -> i32 { @@ -318,16 +331,6 @@ fn {impl FnMut<(i32,)> for closure}::call_mut<'_0>(@1: &'_0 mut closure, @2: (i3 return } -// Full name: test_crate::map::closure::{impl Destruct for closure}::drop_in_place -unsafe fn {impl Destruct for closure}::drop_in_place(@1: *mut closure) -= - -// Full name: test_crate::map::closure::{impl Destruct for closure} -impl Destruct for closure { - fn drop_in_place = {impl Destruct for closure}::drop_in_place - non-dyn-compatible -} - // Full name: test_crate::map::{impl FnOnce<(i32,)> for closure}::call_once fn {impl FnOnce<(i32,)> for closure}::call_once(@1: closure, @2: (i32,)) -> i32 { @@ -375,7 +378,7 @@ pub fn test_crate::map(@1: [i32; 256 : usize]) -> [i32; 256 : usize] _2 = copy x_1 storage_live(_3) _3 = closure { } - _0 = core::array::{[T; N]}::map[{built_in impl Sized for i32}, {built_in impl Sized for closure}, {built_in impl Sized for i32}, {impl FnMut<(i32,)> for closure}](move _2, move _3) + _0 = core::array::{[T; N]}::map[{built_in impl Sized for i32}, {built_in impl Sized for closure}, {built_in impl Sized for i32}, {impl FnMut<(i32,)> for closure}, {impl Destruct for closure}, {built_in impl Destruct for i32}, {built_in impl Destruct for i32}](move _2, move _3) storage_dead(_3) storage_dead(_2) return diff --git a/charon/tests/ui/issue-70-override-provided-method.3.out b/charon/tests/ui/issue-70-override-provided-method.3.out index ec79074b3..51cfef5da 100644 --- a/charon/tests/ui/issue-70-override-provided-method.3.out +++ b/charon/tests/ui/issue-70-override-provided-method.3.out @@ -56,7 +56,7 @@ pub trait Copy pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/iterator.out b/charon/tests/ui/iterator.out index e96e76c71..55d17158e 100644 --- a/charon/tests/ui/iterator.out +++ b/charon/tests/ui/iterator.out @@ -23,7 +23,7 @@ where pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::array::iter::IntoIter::{impl Destruct for IntoIter[@TraitClause0]}::drop_in_place @@ -112,7 +112,7 @@ where pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce @@ -2648,6 +2648,12 @@ where [@TraitClause0]: Sized, = +// Full name: core::slice::iter::{impl Iterator for Iter<'a, T>[@TraitClause0]}::next_chunk +pub fn {impl Iterator for Iter<'a, T>[@TraitClause0]}::next_chunk<'a, '_1, T, const N : usize>(@1: &'_1 mut Iter<'a, T>[@TraitClause0]) -> Result<[&'a T; N], IntoIter<&'a T, N>[{built_in impl Sized for &'_ T}]>[{built_in impl Sized for [&'_ T; N]}, {built_in impl Sized for IntoIter<&'_ T, N>[{built_in impl Sized for &'_ T}]}] +where + [@TraitClause0]: Sized, += + // Full name: core::slice::iter::{impl Iterator for Iter<'a, T>[@TraitClause0]}::next pub fn {impl Iterator for Iter<'a, T>[@TraitClause0]}::next<'a, '_1, T>(@1: &'_1 mut Iter<'a, T>[@TraitClause0]) -> Option<&'a T>[{built_in impl Sized for &'_ T}] where @@ -3272,13 +3278,6 @@ where [@TraitClause1]: Sized[@TraitClause0]>, = -// Full name: core::slice::iter::{impl Iterator for Iter<'a, T>[@TraitClause0]}::next_chunk -pub fn {impl Iterator for Iter<'a, T>[@TraitClause0]}::next_chunk<'a, '_1, T, const N : usize>(@1: &'_1 mut Iter<'a, T>[@TraitClause0]) -> Result<[&'a T; N], IntoIter<&'a T, N>[{impl Iterator for Iter<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::parent_clause1]>[{built_in impl Sized for [&'a T; N]}, {built_in impl Sized for IntoIter<&'a T, N>[{impl Iterator for Iter<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::parent_clause1]}] -where - [@TraitClause0]: Sized, - [@TraitClause1]: Sized[@TraitClause0]>, -= - // Full name: core::slice::iter::{impl Iterator for Iter<'a, T>[@TraitClause0]} impl<'a, T> Iterator for Iter<'a, T>[@TraitClause0] where @@ -3288,7 +3287,7 @@ where parent_clause1 = {built_in impl Sized for &'_ T} type Item = &'a T fn next<'_0_1> = {impl Iterator for Iter<'a, T>[@TraitClause0]}::next<'a, '_0_1, T>[@TraitClause0] - fn next_chunk<'_0_1, const N : usize, [@TraitClause0_1]: Sized[@TraitClause0]>> = {impl Iterator for Iter<'a, T>[@TraitClause0]}::next_chunk<'a, '_0_1, T, N>[@TraitClause0, @TraitClause0_1] + fn next_chunk<'_0_1, const N : usize> = {impl Iterator for Iter<'a, T>[@TraitClause0]}::next_chunk<'a, '_0_1, T, N>[@TraitClause0] fn size_hint<'_0_1> = {impl Iterator for Iter<'a, T>[@TraitClause0]}::size_hint<'a, '_0_1, T>[@TraitClause0] fn count = {impl Iterator for Iter<'a, T>[@TraitClause0]}::count<'a, T>[@TraitClause0] fn last = {impl Iterator for Iter<'a, T>[@TraitClause0]}::last<'a, T>[@TraitClause0] diff --git a/charon/tests/ui/matches.out b/charon/tests/ui/matches.out index 100baaa17..b249f749c 100644 --- a/charon/tests/ui/matches.out +++ b/charon/tests/ui/matches.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/method-impl-generalization.out b/charon/tests/ui/method-impl-generalization.out index 7a94de9d9..f20ad1b3f 100644 --- a/charon/tests/ui/method-impl-generalization.out +++ b/charon/tests/ui/method-impl-generalization.out @@ -42,7 +42,7 @@ pub trait Copy pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/ml-name-matcher-tests.out b/charon/tests/ui/ml-name-matcher-tests.out index 49b82d536..16e346b5b 100644 --- a/charon/tests/ui/ml-name-matcher-tests.out +++ b/charon/tests/ui/ml-name-matcher-tests.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/monomorphization/closure-fn.out b/charon/tests/ui/monomorphization/closure-fn.out index 3e1ade1d1..2cf70ea3e 100644 --- a/charon/tests/ui/monomorphization/closure-fn.out +++ b/charon/tests/ui/monomorphization/closure-fn.out @@ -27,7 +27,7 @@ struct closure<'_0, '_1> { pub trait Destruct::> { fn drop_in_place = core::marker::Destruct::drop_in_place::> - vtable: core::marker::Destruct::{vtable}::> + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place::>(@1: *mut closure<'_, '_>) @@ -38,7 +38,7 @@ unsafe fn core::marker::Destruct::drop_in_place::>(@1: *mut clos pub trait Tuple::<(u8, u8)> { parent_clause0 : [@TraitClause0]: MetaSized::<(u8, u8)> - vtable: core::marker::Tuple::{vtable}::<(u8, u8)> + non-dyn-compatible } // Full name: core::ops::function::FnOnce::, (u8, u8)> diff --git a/charon/tests/ui/monomorphization/closure-fnonce.out b/charon/tests/ui/monomorphization/closure-fnonce.out index d4cb60532..1025b7dae 100644 --- a/charon/tests/ui/monomorphization/closure-fnonce.out +++ b/charon/tests/ui/monomorphization/closure-fnonce.out @@ -29,7 +29,7 @@ struct closure { pub trait Destruct:: { fn drop_in_place = core::marker::Destruct::drop_in_place:: - vtable: core::marker::Destruct::{vtable}:: + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place::(@1: *mut closure) @@ -40,7 +40,7 @@ unsafe fn core::marker::Destruct::drop_in_place::(@1: *mut closure) pub trait Tuple::<(u8,)> { parent_clause0 : [@TraitClause0]: MetaSized::<(u8,)> - vtable: core::marker::Tuple::{vtable}::<(u8,)> + non-dyn-compatible } // Full name: core::mem::drop:: diff --git a/charon/tests/ui/monomorphization/closures.out b/charon/tests/ui/monomorphization/closures.out index 1a1c411e6..5b534267c 100644 --- a/charon/tests/ui/monomorphization/closures.out +++ b/charon/tests/ui/monomorphization/closures.out @@ -33,7 +33,7 @@ struct test_crate::main::closure<'_0> { pub trait Destruct::> { fn drop_in_place = core::marker::Destruct::drop_in_place::> - vtable: core::marker::Destruct::{vtable}::> + non-dyn-compatible } struct test_crate::main::closure#1<'_0> { @@ -45,7 +45,7 @@ struct test_crate::main::closure#1<'_0> { pub trait Destruct::> { fn drop_in_place = core::marker::Destruct::drop_in_place::> - vtable: core::marker::Destruct::{vtable}::> + non-dyn-compatible } // Full name: test_crate::Thing @@ -60,7 +60,7 @@ struct test_crate::main::closure#2 { pub trait Destruct:: { fn drop_in_place = core::marker::Destruct::drop_in_place:: - vtable: core::marker::Destruct::{vtable}:: + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place::>(@1: *mut test_crate::main::closure<'_>) @@ -77,7 +77,7 @@ unsafe fn core::marker::Destruct::drop_in_place::(@ pub trait Tuple::<(u8,)> { parent_clause0 : [@TraitClause0]: MetaSized::<(u8,)> - vtable: core::marker::Tuple::{vtable}::<(u8,)> + non-dyn-compatible } // Full name: core::mem::drop:: diff --git a/charon/tests/ui/monomorphization/dyn-trait.out b/charon/tests/ui/monomorphization/dyn-trait.out index 2fc2f166b..75b5cae11 100644 --- a/charon/tests/ui/monomorphization/dyn-trait.out +++ b/charon/tests/ui/monomorphization/dyn-trait.out @@ -5,15 +5,15 @@ error: `dyn Trait` is not yet supported with `--monomorphize` | ^^^^ error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2669:1 + --> /rustc/library/alloc/src/string.rs:2711:1 note: the error occurred when translating `alloc::string::{impl core::fmt::Display::}::{vtable}`, which is (transitively) used at the following location(s): --> tests/ui/monomorphization/dyn-trait.rs:12:27 | 12 | let _ = dyn_to_string(&str); | ---- -error: Item `alloc::string::{impl#25}` caused errors; ignoring. - --> /rustc/library/alloc/src/string.rs:2669:1 +error: Item `alloc::string::{impl#28}` caused errors; ignoring. + --> /rustc/library/alloc/src/string.rs:2711:1 error: `dyn Trait` is not yet supported with `--monomorphize` --> tests/ui/monomorphization/dyn-trait.rs:6:1 @@ -30,45 +30,45 @@ error: `dyn Trait` is not yet supported with `--monomorphize` | ^ error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2851:1 + --> /rustc/library/alloc/src/string.rs:2893:1 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/core/src/marker.rs:179:1 + --> /rustc/library/core/src/marker.rs:178:1 error: `dyn Trait` is not yet supported with `--monomorphize` --> /rustc/library/core/src/fmt/mod.rs:1186:1 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2853:5 + --> /rustc/library/alloc/src/string.rs:2895:5 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/core/src/marker.rs:179:1 + --> /rustc/library/core/src/marker.rs:178:1 error: `dyn Trait` is not yet supported with `--monomorphize` --> /rustc/library/core/src/fmt/mod.rs:1186:1 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2853:5 + --> /rustc/library/alloc/src/string.rs:2895:5 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2851:1 + --> /rustc/library/alloc/src/string.rs:2893:1 note: the error occurred when translating `alloc::string::{impl#4}::`, which is (transitively) used at the following location(s): error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2826:1 + --> /rustc/library/alloc/src/string.rs:2868:1 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2851:1 + --> /rustc/library/alloc/src/string.rs:2893:1 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2853:5 + --> /rustc/library/alloc/src/string.rs:2895:5 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/core/src/marker.rs:179:1 + --> /rustc/library/core/src/marker.rs:178:1 note: the error occurred when translating `core::marker::MetaSized::`, which is (transitively) used at the following location(s): error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/core/src/marker.rs:179:1 + --> /rustc/library/core/src/marker.rs:178:1 error: `dyn Trait` is not yet supported with `--monomorphize` --> /rustc/library/core/src/fmt/mod.rs:1186:1 @@ -81,7 +81,7 @@ error: `dyn Trait` is not yet supported with `--monomorphize` --> /rustc/library/core/src/fmt/mod.rs:1211:5 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/core/src/marker.rs:179:1 + --> /rustc/library/core/src/marker.rs:178:1 note: the error occurred when translating `core::marker::MetaSized::`, which is (transitively) used at the following location(s): --> tests/ui/monomorphization/dyn-trait.rs:7:5 @@ -97,7 +97,7 @@ note: the error occurred when translating `core::fmt::Display:: /rustc/library/alloc/src/string.rs:2853:5 + --> /rustc/library/alloc/src/string.rs:2895:5 note: the error occurred when translating `alloc::string::{impl alloc::string::ToString::}::to_string::`, which is (transitively) used at the following location(s): --> tests/ui/monomorphization/dyn-trait.rs:7:5 @@ -105,10 +105,10 @@ note: the error occurred when translating `alloc::string::{impl alloc::string::T 7 | x.to_string() | ------------- error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2853:5 + --> /rustc/library/alloc/src/string.rs:2895:5 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2826:1 + --> /rustc/library/alloc/src/string.rs:2868:1 note: the error occurred when translating `alloc::string::ToString::`, which is (transitively) used at the following location(s): --> tests/ui/monomorphization/dyn-trait.rs:7:5 @@ -116,10 +116,10 @@ note: the error occurred when translating `alloc::string::ToString:: /rustc/library/alloc/src/string.rs:2826:1 + --> /rustc/library/alloc/src/string.rs:2868:1 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2840:5 + --> /rustc/library/alloc/src/string.rs:2882:5 error: `dyn Trait` is not yet supported with `--monomorphize` --> /rustc/library/core/src/fmt/mod.rs:1211:5 @@ -133,7 +133,7 @@ error: `dyn Trait` is not yet supported with `--monomorphize` --> /rustc/library/core/src/fmt/mod.rs:1211:5 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2853:5 + --> /rustc/library/alloc/src/string.rs:2895:5 note: the error occurred when translating `alloc::string::{impl alloc::string::ToString::}::to_string::`, which is (transitively) used at the following location(s): --> tests/ui/monomorphization/dyn-trait.rs:7:5 @@ -141,10 +141,10 @@ note: the error occurred when translating `alloc::string::{impl alloc::string::T 7 | x.to_string() | ------------- error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2853:5 + --> /rustc/library/alloc/src/string.rs:2895:5 error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2840:5 + --> /rustc/library/alloc/src/string.rs:2882:5 note: the error occurred when translating `alloc::string::ToString::to_string::`, which is (transitively) used at the following location(s): --> tests/ui/monomorphization/dyn-trait.rs:7:5 @@ -152,6 +152,6 @@ note: the error occurred when translating `alloc::string::ToString::to_string::< 7 | x.to_string() | ------------- error: `dyn Trait` is not yet supported with `--monomorphize` - --> /rustc/library/alloc/src/string.rs:2840:5 + --> /rustc/library/alloc/src/string.rs:2882:5 ERROR Charon failed to translate this code (34 errors) diff --git a/charon/tests/ui/monomorphization/fndefs-casts.out b/charon/tests/ui/monomorphization/fndefs-casts.out index 7a64b707c..aef29f517 100644 --- a/charon/tests/ui/monomorphization/fndefs-casts.out +++ b/charon/tests/ui/monomorphization/fndefs-casts.out @@ -21,7 +21,7 @@ pub trait MetaSized:: foo::<'a>> pub trait Tuple::<(&'_ u32,)> { parent_clause0 : [@TraitClause0]: MetaSized::<(&'_ u32,)> - vtable: core::marker::Tuple::{vtable}::<(&'_ u32,)> + non-dyn-compatible } // Full name: test_crate::foo:: diff --git a/charon/tests/ui/monomorphization/issue-917-inline-const-with-poly-type.out b/charon/tests/ui/monomorphization/issue-917-inline-const-with-poly-type.out index 68678b843..923ed54c8 100644 --- a/charon/tests/ui/monomorphization/issue-917-inline-const-with-poly-type.out +++ b/charon/tests/ui/monomorphization/issue-917-inline-const-with-poly-type.out @@ -24,7 +24,7 @@ struct closure::<()> {} pub trait Destruct::> { fn drop_in_place = core::marker::Destruct::drop_in_place::> - vtable: core::marker::Destruct::{vtable}::> + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place::>(@1: *mut closure::<()>) @@ -35,7 +35,7 @@ unsafe fn core::marker::Destruct::drop_in_place::>(@1: *mut closur pub trait Tuple::<((),)> { parent_clause0 : [@TraitClause0]: MetaSized::<((),)> - vtable: core::marker::Tuple::{vtable}::<((),)> + non-dyn-compatible } // Full name: core::ops::function::FnOnce::, ((),)> diff --git a/charon/tests/ui/monomorphize-mut-no-types.out b/charon/tests/ui/monomorphize-mut-no-types.out index 884811dc8..aa5f677b0 100644 --- a/charon/tests/ui/monomorphize-mut-no-types.out +++ b/charon/tests/ui/monomorphize-mut-no-types.out @@ -47,14 +47,14 @@ pub trait core::marker::Sized::>><'_0, T0> pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } #[lang_item("destruct")] pub trait core::marker::Destruct::<&_ mut _><'_0, T0> { fn drop_in_place = core::marker::Destruct::drop_in_place::<&_ mut _><'_0, T0> - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::option::Option @@ -68,14 +68,14 @@ pub enum Option { pub trait core::marker::Destruct::><'_0, T0> { fn drop_in_place = core::marker::Destruct::drop_in_place::><'_0, T0> - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } #[lang_item("destruct")] pub trait core::marker::Destruct::>><'_0, T0> { fn drop_in_place = core::marker::Destruct::drop_in_place::>><'_0, T0> - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/monomorphize-mut.out b/charon/tests/ui/monomorphize-mut.out index 1802ab5da..c67a111ad 100644 --- a/charon/tests/ui/monomorphize-mut.out +++ b/charon/tests/ui/monomorphize-mut.out @@ -104,14 +104,14 @@ where pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } #[lang_item("destruct")] pub trait core::marker::Destruct::<&_ mut _><'_0, T0> { fn drop_in_place = core::marker::Destruct::drop_in_place::<&_ mut _><'_0, T0> - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } #[lang_item("Option")] @@ -129,7 +129,7 @@ where [@TraitClause0]: core::marker::Sized::<&_ mut _><'_0, T0>, { fn drop_in_place = core::marker::Destruct::drop_in_place::<_, _>[@TraitClause0]><'_0, T0>[@TraitClause0] - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } #[lang_item("Option")] @@ -149,7 +149,7 @@ where [@TraitClause1]: core::marker::Sized::<&_ mut _><'_0, T0>, { fn drop_in_place = core::marker::Destruct::drop_in_place::<_, _>[@TraitClause1]><_, _>[@TraitClause0, @TraitClause1]><'_0, T0>[@TraitClause0, @TraitClause1] - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/no_nested_borrows.out b/charon/tests/ui/no_nested_borrows.out index d932f49b2..ab3248d7f 100644 --- a/charon/tests/ui/no_nested_borrows.out +++ b/charon/tests/ui/no_nested_borrows.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/polonius_map.out b/charon/tests/ui/polonius_map.out index dcdd59856..94caa3e1b 100644 --- a/charon/tests/ui/polonius_map.out +++ b/charon/tests/ui/polonius_map.out @@ -159,52 +159,56 @@ where // Full name: std::collections::hash::map::HashMap #[lang_item("HashMap")] -pub opaque type HashMap +pub opaque type HashMap where [@TraitClause0]: Sized, [@TraitClause1]: Sized, [@TraitClause2]: Sized, + [@TraitClause3]: Sized, -// Full name: std::collections::hash::map::{HashMap[@TraitClause0, @TraitClause1, @TraitClause2]}::get -pub fn get<'_0, '_1, K, V, S, Q>(@1: &'_0 HashMap[@TraitClause0, @TraitClause1, @TraitClause2], @2: &'_1 Q) -> Option<&'_0 V>[{built_in impl Sized for &'_0 V}] +// Full name: std::collections::hash::map::{HashMap[@TraitClause0, @TraitClause1, @TraitClause2, @TraitClause3]}::get +pub fn get<'_0, '_1, K, V, S, A, Q>(@1: &'_0 HashMap[@TraitClause0, @TraitClause1, @TraitClause2, @TraitClause3], @2: &'_1 Q) -> Option<&'_0 V>[{built_in impl Sized for &'_0 V}] where [@TraitClause0]: Sized, [@TraitClause1]: Sized, [@TraitClause2]: Sized, - [@TraitClause3]: Eq, - [@TraitClause4]: Hash, - [@TraitClause5]: BuildHasher, - [@TraitClause6]: MetaSized, - [@TraitClause7]: Borrow, - [@TraitClause8]: Hash, - [@TraitClause9]: Eq, + [@TraitClause3]: Sized, + [@TraitClause4]: Eq, + [@TraitClause5]: Hash, + [@TraitClause6]: BuildHasher, + [@TraitClause8]: MetaSized, + [@TraitClause9]: Borrow, + [@TraitClause10]: Hash, + [@TraitClause11]: Eq, = -// Full name: std::collections::hash::map::{HashMap[@TraitClause0, @TraitClause1, @TraitClause2]}::insert +// Full name: std::collections::hash::map::{HashMap[@TraitClause0, @TraitClause1, @TraitClause2, @TraitClause3]}::insert #[lang_item("hashmap_insert")] -pub fn insert<'_0, K, V, S>(@1: &'_0 mut HashMap[@TraitClause0, @TraitClause1, @TraitClause2], @2: K, @3: V) -> Option[@TraitClause1] +pub fn insert<'_0, K, V, S, A>(@1: &'_0 mut HashMap[@TraitClause0, @TraitClause1, @TraitClause2, @TraitClause3], @2: K, @3: V) -> Option[@TraitClause1] where [@TraitClause0]: Sized, [@TraitClause1]: Sized, [@TraitClause2]: Sized, - [@TraitClause3]: Eq, - [@TraitClause4]: Hash, - [@TraitClause5]: BuildHasher, + [@TraitClause3]: Sized, + [@TraitClause4]: Eq, + [@TraitClause5]: Hash, + [@TraitClause6]: BuildHasher, = -// Full name: std::collections::hash::map::{impl Index<&'_0 Q> for HashMap[@TraitClause0, @TraitClause2, @TraitClause3]}::index -pub fn {impl Index<&'_0 Q> for HashMap[@TraitClause0, @TraitClause2, @TraitClause3]}::index<'_0, '_1, K, Q, V, S>(@1: &'_1 HashMap[@TraitClause0, @TraitClause2, @TraitClause3], @2: &'_0 Q) -> &'_1 V +// Full name: std::collections::hash::map::{impl Index<&'_0 Q> for HashMap[@TraitClause0, @TraitClause2, @TraitClause3, @TraitClause4]}::index +pub fn {impl Index<&'_0 Q> for HashMap[@TraitClause0, @TraitClause2, @TraitClause3, @TraitClause4]}::index<'_0, '_1, K, Q, V, S, A>(@1: &'_1 HashMap[@TraitClause0, @TraitClause2, @TraitClause3, @TraitClause4], @2: &'_0 Q) -> &'_1 V where [@TraitClause0]: Sized, [@TraitClause1]: MetaSized, [@TraitClause2]: Sized, [@TraitClause3]: Sized, - [@TraitClause4]: Eq, - [@TraitClause5]: Hash, - [@TraitClause6]: Borrow, - [@TraitClause7]: Eq, - [@TraitClause8]: Hash, - [@TraitClause9]: BuildHasher, + [@TraitClause4]: Sized, + [@TraitClause5]: Eq, + [@TraitClause6]: Hash, + [@TraitClause7]: Borrow, + [@TraitClause8]: Eq, + [@TraitClause9]: Hash, + [@TraitClause10]: BuildHasher, = // Full name: std::hash::random::RandomState @@ -243,6 +247,10 @@ impl BuildHasher for RandomState { vtable: {impl BuildHasher for RandomState}::{vtable} } +// Full name: alloc::alloc::Global +#[lang_item("global_alloc_ty")] +pub struct Global {} + fn UNIT_METADATA() { let _0: (); // return @@ -254,20 +262,20 @@ fn UNIT_METADATA() const UNIT_METADATA: () = @Fun0() // Full name: test_crate::get_or_insert -pub fn get_or_insert<'_0>(@1: &'_0 mut HashMap[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}]) -> &'_0 u32 +pub fn get_or_insert<'_0>(@1: &'_0 mut HashMap[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}, {built_in impl Sized for Global}]) -> &'_0 u32 { let _0: &'1 u32; // return - let map_1: &'3 mut HashMap[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}]; // arg #1 + let map_1: &'3 mut HashMap[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}, {built_in impl Sized for Global}]; // arg #1 let _2: Option<&'9 u32>[{built_in impl Sized for &'9 u32}]; // anonymous local - let _3: &'13 HashMap[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}]; // anonymous local + let _3: &'13 HashMap[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}, {built_in impl Sized for Global}]; // anonymous local let _4: &'14 u32; // anonymous local let _5: &'15 u32; // anonymous local let v_6: &'16 u32; // local let _7: Option[{built_in impl Sized for u32}]; // anonymous local - let _8: &'17 mut HashMap[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}]; // anonymous local + let _8: &'17 mut HashMap[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}, {built_in impl Sized for Global}]; // anonymous local let _9: &'18 u32; // anonymous local let _10: &'19 u32; // anonymous local - let _11: &'20 HashMap[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}]; // anonymous local + let _11: &'20 HashMap[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}, {built_in impl Sized for Global}]; // anonymous local let _12: &'21 u32; // anonymous local let _13: &'22 u32; // anonymous local let _14: &'23 u32; // anonymous local @@ -291,7 +299,7 @@ pub fn get_or_insert<'_0>(@1: &'_0 mut HashMap[{built_in _15 = move _16 _5 = &(*_15) _4 = &(*_5) - _2 = get<'28, '29, u32, u32, RandomState, u32>[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}, {impl Eq for u32}, {impl Hash for u32}, {impl BuildHasher for RandomState}, {built_in impl MetaSized for u32}, {impl Borrow for T}[{built_in impl MetaSized for u32}], {impl Hash for u32}, {impl Eq for u32}](move _3, move _4) + _2 = get<'28, '29, u32, u32, RandomState, Global, u32>[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}, {built_in impl Sized for Global}, {impl Eq for u32}, {impl Hash for u32}, {impl BuildHasher for RandomState}, {built_in impl MetaSized for u32}, {impl Borrow for T}[{built_in impl MetaSized for u32}], {impl Hash for u32}, {impl Eq for u32}](move _3, move _4) storage_dead(_4) storage_dead(_3) match _2 { @@ -299,7 +307,7 @@ pub fn get_or_insert<'_0>(@1: &'_0 mut HashMap[{built_in storage_live(_7) storage_live(_8) _8 = &two-phase-mut (*map_1) - _7 = insert<'31, u32, u32, RandomState>[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}, {impl Eq for u32}, {impl Hash for u32}, {impl BuildHasher for RandomState}](move _8, const 22 : u32, const 33 : u32) + _7 = insert<'31, u32, u32, RandomState, Global>[{built_in impl Sized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}, {built_in impl Sized for Global}, {impl Eq for u32}, {impl Hash for u32}, {impl BuildHasher for RandomState}](move _8, const 22 : u32, const 33 : u32) storage_live(_18) storage_live(_19) _19 = const 22 : u32 @@ -315,7 +323,7 @@ pub fn get_or_insert<'_0>(@1: &'_0 mut HashMap[{built_in _14 = move _18 _13 = &(*_14) _12 = &(*_13) - _10 = {impl Index<&'_0 Q> for HashMap[@TraitClause0, @TraitClause2, @TraitClause3]}::index<'33, '35, u32, u32, u32, RandomState>[{built_in impl Sized for u32}, {built_in impl MetaSized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}, {impl Eq for u32}, {impl Hash for u32}, {impl Borrow for T}[{built_in impl MetaSized for u32}], {impl Eq for u32}, {impl Hash for u32}, {impl BuildHasher for RandomState}](move _11, move _12) + _10 = {impl Index<&'_0 Q> for HashMap[@TraitClause0, @TraitClause2, @TraitClause3, @TraitClause4]}::index<'33, '35, u32, u32, u32, RandomState, Global>[{built_in impl Sized for u32}, {built_in impl MetaSized for u32}, {built_in impl Sized for u32}, {built_in impl Sized for RandomState}, {built_in impl Sized for Global}, {impl Eq for u32}, {impl Hash for u32}, {impl Borrow for T}[{built_in impl MetaSized for u32}], {impl Eq for u32}, {impl Hash for u32}, {impl BuildHasher for RandomState}](move _11, move _12) storage_dead(_12) storage_dead(_11) _9 = &(*_10) diff --git a/charon/tests/ui/predicates-on-late-bound-vars.out b/charon/tests/ui/predicates-on-late-bound-vars.out index 42ff59adb..ceea0b138 100644 --- a/charon/tests/ui/predicates-on-late-bound-vars.out +++ b/charon/tests/ui/predicates-on-late-bound-vars.out @@ -72,7 +72,7 @@ where pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/ptr-offset.out b/charon/tests/ui/ptr-offset.out index a6849dba4..83e1f5a03 100644 --- a/charon/tests/ui/ptr-offset.out +++ b/charon/tests/ui/ptr-offset.out @@ -28,12 +28,16 @@ pub trait Sized non-dyn-compatible } +// Full name: core::ptr::alignment::Alignment +pub opaque type Alignment + // Full name: core::mem::SizedTypeProperties pub trait SizedTypeProperties { parent_clause0 : [@TraitClause0]: Sized const SIZE : usize const ALIGN : usize + const ALIGNMENT : Alignment const IS_ZST : bool const LAYOUT : Layout const MAX_SLICE_LEN : usize @@ -68,6 +72,18 @@ where [@TraitClause0]: SizedTypeProperties, = ALIGN() +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub fn ALIGNMENT() -> Alignment +where + [@TraitClause0]: SizedTypeProperties, += + +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub const ALIGNMENT: Alignment +where + [@TraitClause0]: SizedTypeProperties, + = ALIGNMENT() + // Full name: core::mem::SizedTypeProperties::IS_ZST pub fn IS_ZST() -> bool where @@ -112,6 +128,7 @@ where parent_clause0 = @TraitClause0 const SIZE = SIZE[{impl SizedTypeProperties for T}[@TraitClause0]] const ALIGN = ALIGN[{impl SizedTypeProperties for T}[@TraitClause0]] + const ALIGNMENT = ALIGNMENT[{impl SizedTypeProperties for T}[@TraitClause0]] const IS_ZST = IS_ZST[{impl SizedTypeProperties for T}[@TraitClause0]] const LAYOUT = LAYOUT[{impl SizedTypeProperties for T}[@TraitClause0]] const MAX_SLICE_LEN = MAX_SLICE_LEN[{impl SizedTypeProperties for T}[@TraitClause0]] @@ -269,7 +286,7 @@ where storage_live(_3) storage_live(_5) _5 = ub_checks - if copy _5 { + if move _5 { storage_live(_4) _4 = cast<*const T, *const ()>(copy self_1) _3 = precondition_check(move _4, copy count_2, const {impl SizedTypeProperties for T}[@TraitClause0]::SIZE) diff --git a/charon/tests/ui/ptr_no_provenance.out b/charon/tests/ui/ptr_no_provenance.out index 032b8bd25..943400616 100644 --- a/charon/tests/ui/ptr_no_provenance.out +++ b/charon/tests/ui/ptr_no_provenance.out @@ -263,7 +263,7 @@ pub trait Pointee parent_clause7 : [@TraitClause7]: Unpin parent_clause8 : [@TraitClause8]: Freeze type Metadata - vtable: core::ptr::metadata::Pointee::{vtable} + non-dyn-compatible } // Full name: core::ptr::metadata::Thin @@ -272,7 +272,7 @@ where Self::parent_clause0::Metadata = (), { parent_clause0 : [@TraitClause0]: Pointee - vtable: core::ptr::metadata::Thin::{vtable}<()> + non-dyn-compatible } // Full name: core::ptr::metadata::Thin::{impl Thin for Self} diff --git a/charon/tests/ui/quantified-clause.out b/charon/tests/ui/quantified-clause.out index 1d6fa2dbc..a5e725c61 100644 --- a/charon/tests/ui/quantified-clause.out +++ b/charon/tests/ui/quantified-clause.out @@ -93,7 +93,7 @@ pub trait Copy pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place @@ -105,7 +105,7 @@ unsafe fn drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/raw-boxes.out b/charon/tests/ui/raw-boxes.out index 1274f6ef6..3f3a6d6e9 100644 --- a/charon/tests/ui/raw-boxes.out +++ b/charon/tests/ui/raw-boxes.out @@ -70,7 +70,7 @@ enum AlignmentEnum { // Full name: core::ptr::alignment::Alignment pub struct Alignment { - AlignmentEnum, + _inner_repr_trick: AlignmentEnum, } // Full name: core::alloc::layout::Layout @@ -171,7 +171,7 @@ pub fn panic_nounwind_fmt<'_0>(@1: Arguments<'_0>, @2: bool) -> ! pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::clone::Clone @@ -271,7 +271,7 @@ fn core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(@1: usiz _0 = () storage_live(_5) _5 = ctpop[{built_in impl Sized for usize}, {impl Copy for usize}](move align_1) - switch move _5 { + switch copy _5 { 1 : u32 => { }, _ => { @@ -310,129 +310,6 @@ fn core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(@1: usiz return } -// Full name: core::option::Option -#[lang_item("Option")] -pub enum Option -where - [@TraitClause0]: Sized, -{ - None, - Some(T), -} - -pub fn core::ptr::alignment::{Alignment}::new(@1: usize) -> Option[{built_in impl Sized for Alignment}] -{ - let _0: Option[{built_in impl Sized for Alignment}]; // return - let align_1: usize; // arg #1 - let _2: Alignment; // anonymous local - let _3: u32; // anonymous local - let _4: (); // anonymous local - let _5: bool; // anonymous local - let _6: Option[{built_in impl Sized for Alignment}]; // anonymous local - - storage_live(_4) - storage_live(_3) - _3 = ctpop[{built_in impl Sized for usize}, {impl Copy for usize}](copy align_1) - switch move _3 { - 1 : u32 => { - }, - _ => { - storage_dead(_3) - storage_live(_6) - _6 = Option::None { } - _0 = move _6 - return - }, - } - storage_dead(_3) - storage_live(_2) - storage_live(_5) - _5 = ub_checks - if copy _5 { - _4 = core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(copy align_1) - } else { - } - _2 = transmute(copy align_1) - storage_dead(_5) - _0 = Option::Some { 0: move _2 } - storage_dead(_2) - return -} - -// Full name: core::alloc::layout::{Layout}::max_size_for_align -fn max_size_for_align(@1: Alignment) -> usize -{ - let _0: usize; // return - let align_1: Alignment; // arg #1 - let _2: usize; // anonymous local - let _3: AlignmentEnum; // anonymous local - - storage_live(_3) - storage_live(_2) - _3 = copy (align_1).0 - _2 = @discriminant(_3) - _0 = const 9223372036854775808 : usize ub.- move _2 - storage_dead(_2) - return -} - -// Full name: core::alloc::layout::{Layout}::is_size_align_valid -fn is_size_align_valid(@1: usize, @2: usize) -> bool -{ - let _0: bool; // return - let size_1: usize; // arg #1 - let align_2: usize; // arg #2 - let align_3: Alignment; // local - let _4: Option[{built_in impl Sized for Alignment}]; // anonymous local - let _5: usize; // anonymous local - let _6: bool; // anonymous local - let _7: usize; // anonymous local - let _8: usize; // anonymous local - let _9: Alignment; // anonymous local - - storage_live(_4) - storage_live(_5) - _5 = copy align_2 - _4 = core::ptr::alignment::{Alignment}::new(move _5) - storage_dead(_5) - match _4 { - Option::Some => { - }, - _ => { - storage_dead(_4) - _0 = const false - return - }, - } - storage_live(align_3) - align_3 = copy (_4 as variant Option::Some).0 - storage_dead(_4) - storage_live(_6) - storage_live(_7) - _7 = copy size_1 - storage_live(_8) - storage_live(_9) - _9 = copy align_3 - _8 = max_size_for_align(move _9) - storage_dead(_9) - _6 = move _7 > move _8 - if move _6 { - } else { - storage_dead(_8) - storage_dead(_7) - storage_dead(_6) - _0 = const true - storage_dead(align_3) - return - } - storage_dead(_8) - storage_dead(_7) - _0 = const false - storage_dead(_6) - storage_dead(align_3) - return -} - fn core::alloc::layout::{Layout}::from_size_align_unchecked::precondition_check(@1: usize, @2: usize) { let _0: (); // return @@ -442,53 +319,84 @@ fn core::alloc::layout::{Layout}::from_size_align_unchecked::precondition_check( let msg_4: &'1 Str; // local let _5: !; // anonymous local let _6: Arguments<'3>; // anonymous local - let _7: NonNull; // anonymous local - let _8: *const u8; // anonymous local - let _9: NonNull>; // anonymous local + let alignment_7: Alignment; // local + let _8: u32; // anonymous local + let _9: (); // anonymous local let _10: usize; // anonymous local let _11: usize; // anonymous local - let _12: usize; // anonymous local - let _13: *const Str; // anonymous local - let _14: &'8 [u8]; // anonymous local + let _12: NonNull; // anonymous local + let _13: *const u8; // anonymous local + let _14: NonNull>; // anonymous local + let _15: usize; // anonymous local + let _16: usize; // anonymous local + let _17: usize; // anonymous local + let _18: *const Str; // anonymous local + let _19: &'8 [u8]; // anonymous local + let _20: bool; // anonymous local storage_live(msg_4) storage_live(_5) + storage_live(alignment_7) + storage_live(_9) _0 = () storage_live(_3) - _3 = is_size_align_valid(move size_1, move align_2) - if move _3 { - } else { - msg_4 = const "unsafe precondition(s) violated: Layout::from_size_align_unchecked requires that align is a power of 2 and the rounded-up allocation size does not exceed isize::MAX\n\nThis indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety." - storage_live(_6) - storage_live(_7) - storage_live(_8) - storage_live(_13) - _13 = &raw const (*msg_4) with_metadata(copy msg_4.metadata) - _8 = cast<*const Str, *const u8>(copy _13) - storage_dead(_13) - _7 = transmute<*const u8, NonNull>(copy _8) - storage_dead(_8) - storage_live(_9) - storage_live(_10) - storage_live(_11) - storage_live(_12) - storage_live(_14) - _14 = transmute<&'11 Str, &'10 [u8]>(const "unsafe precondition(s) violated: Layout::from_size_align_unchecked requires that align is a power of 2 and the rounded-up allocation size does not exceed isize::MAX\n\nThis indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.") - _12 = copy _14.metadata - storage_dead(_14) - _11 = move _12 wrap.<< const 1 : i32 - storage_dead(_12) - _10 = move _11 | const 1 : usize - storage_dead(_11) - _9 = transmute>>(move _10) - storage_dead(_10) - _6 = Arguments { template: move _7, args: move _9 } - storage_dead(_9) - storage_dead(_7) - _5 = panic_nounwind_fmt<'15>(move _6, const false) + storage_live(_8) + _8 = ctpop[{built_in impl Sized for usize}, {impl Copy for usize}](copy align_2) + switch copy _8 { + 1 : u32 => { + storage_dead(_8) + storage_live(_20) + _20 = ub_checks + if move _20 { + _9 = core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(copy align_2) + } else { + } + alignment_7 = transmute(copy align_2) + storage_live(_10) + storage_live(_11) + _11 = transmute(copy alignment_7) + _10 = const 9223372036854775808 : usize ub.- move _11 + storage_dead(_11) + _3 = copy size_1 <= move _10 + storage_dead(_10) + if move _3 { + storage_dead(_3) + return + } else { + } + }, + _ => { + storage_dead(_8) + }, } - storage_dead(_3) - return + msg_4 = const "unsafe precondition(s) violated: Layout::from_size_align_unchecked requires that align is a power of 2 and the rounded-up allocation size does not exceed isize::MAX\n\nThis indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety." + storage_live(_6) + storage_live(_12) + storage_live(_13) + storage_live(_18) + _18 = &raw const (*msg_4) with_metadata(copy msg_4.metadata) + _13 = cast<*const Str, *const u8>(copy _18) + storage_dead(_18) + _12 = transmute<*const u8, NonNull>(copy _13) + storage_dead(_13) + storage_live(_14) + storage_live(_15) + storage_live(_16) + storage_live(_17) + storage_live(_19) + _19 = transmute<&'11 Str, &'10 [u8]>(const "unsafe precondition(s) violated: Layout::from_size_align_unchecked requires that align is a power of 2 and the rounded-up allocation size does not exceed isize::MAX\n\nThis indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.") + _17 = copy _19.metadata + storage_dead(_19) + _16 = move _17 wrap.<< const 1 : i32 + storage_dead(_17) + _15 = move _16 | const 1 : usize + storage_dead(_16) + _14 = transmute>>(move _15) + storage_dead(_15) + _6 = Arguments { template: move _12, args: move _14 } + storage_dead(_14) + storage_dead(_12) + _5 = panic_nounwind_fmt<'15>(move _6, const false) } // Full name: core::alloc::layout::{Layout}::from_size_align_unchecked @@ -497,22 +405,21 @@ pub unsafe fn from_size_align_unchecked(@1: usize, @2: usize) -> Layout let _0: Layout; // return let size_1: usize; // arg #1 let align_2: usize; // arg #2 - let _3: bool; // anonymous local - let _4: (); // anonymous local - let _5: Alignment; // anonymous local + let _3: (); // anonymous local + let _4: Alignment; // anonymous local + let _5: bool; // anonymous local - storage_live(_4) storage_live(_3) - _3 = ub_checks - if move _3 { - _4 = core::alloc::layout::{Layout}::from_size_align_unchecked::precondition_check(copy size_1, copy align_2) + storage_live(_5) + _5 = ub_checks + if move _5 { + _3 = core::alloc::layout::{Layout}::from_size_align_unchecked::precondition_check(copy size_1, copy align_2) } else { } - storage_dead(_3) - storage_live(_5) - _5 = transmute(copy align_2) - _0 = Layout { size: copy size_1, align: move _5 } - storage_dead(_5) + storage_live(_4) + _4 = transmute(copy align_2) + _0 = Layout { size: copy size_1, align: move _4 } + storage_dead(_4) return } @@ -562,7 +469,7 @@ pub fn is_aligned_to(@1: *const T, @2: usize) -> bool storage_live(_7) _7 = ctpop[{built_in impl Sized for usize}, {impl Copy for usize}](copy align_2) - switch move _7 { + switch copy _7 { 1 : u32 => { }, _ => { @@ -708,6 +615,84 @@ where Break(B), } +// Full name: core::option::Option +#[lang_item("Option")] +pub enum Option +where + [@TraitClause0]: Sized, +{ + None, + Some(T), +} + +pub fn core::ptr::alignment::{Alignment}::new(@1: usize) -> Option[{built_in impl Sized for Alignment}] +{ + let _0: Option[{built_in impl Sized for Alignment}]; // return + let align_1: usize; // arg #1 + let _2: Alignment; // anonymous local + let _3: u32; // anonymous local + let _4: (); // anonymous local + let _5: bool; // anonymous local + let _6: Option[{built_in impl Sized for Alignment}]; // anonymous local + + storage_live(_4) + storage_live(_3) + _3 = ctpop[{built_in impl Sized for usize}, {impl Copy for usize}](copy align_1) + switch copy _3 { + 1 : u32 => { + }, + _ => { + storage_dead(_3) + storage_live(_6) + _6 = Option::None { } + _0 = move _6 + return + }, + } + storage_dead(_3) + storage_live(_2) + storage_live(_5) + _5 = ub_checks + if move _5 { + _4 = core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(copy align_1) + } else { + } + _2 = transmute(copy align_1) + _0 = Option::Some { 0: move _2 } + storage_dead(_2) + return +} + +// Full name: core::option::unwrap_failed +fn unwrap_failed() -> ! +{ + let _0: !; // return + + panic(core::panicking::panic) +} + +// Full name: core::option::{Option[@TraitClause0]}::unwrap +#[lang_item("option_unwrap")] +pub fn unwrap(@1: Option[@TraitClause0]) -> T +where + [@TraitClause0]: Sized, +{ + let val_0: T; // return + let self_1: Option[@TraitClause0]; // arg #1 + let _2: !; // anonymous local + + storage_live(_2) + match self_1 { + Option::None => { + }, + Option::Some => { + val_0 = move (self_1 as variant Option::Some).0 + return + }, + } + _2 = unwrap_failed() +} + pub fn core::num::{usize}::MAX() -> usize { let _0: usize; // return @@ -745,6 +730,7 @@ pub trait SizedTypeProperties parent_clause0 : [@TraitClause0]: Sized const SIZE : usize const ALIGN : usize + const ALIGNMENT : Alignment const IS_ZST : bool const LAYOUT : Layout const MAX_SLICE_LEN : usize @@ -829,8 +815,7 @@ where [@TraitClause0]: SizedTypeProperties, = IS_ZST() -// Full name: core::intrinsics::align_of -pub fn align_of() -> usize +pub fn core::intrinsics::align_of() -> usize where [@TraitClause0]: Sized, { @@ -847,7 +832,7 @@ where { let _0: usize; // return - _0 = align_of[@TraitClause0::parent_clause0]() + _0 = core::intrinsics::align_of[@TraitClause0::parent_clause0]() return } @@ -887,6 +872,34 @@ where [@TraitClause0]: SizedTypeProperties, = SIZE() +#[lang_item("mem_align_of")] +pub fn core::mem::align_of() -> usize +where + [@TraitClause0]: Sized, +{ + let _0: usize; // return + + _0 = const {impl SizedTypeProperties for T}[@TraitClause0]::ALIGN + return +} + +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub fn ALIGNMENT() -> Alignment +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: Alignment; // return + + _0 = of[@TraitClause0::parent_clause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub const ALIGNMENT: Alignment +where + [@TraitClause0]: SizedTypeProperties, + = ALIGNMENT() + // Full name: core::mem::{impl SizedTypeProperties for T} impl SizedTypeProperties for T where @@ -895,12 +908,35 @@ where parent_clause0 = @TraitClause0 const SIZE = SIZE[{impl SizedTypeProperties for T}[@TraitClause0]] const ALIGN = ALIGN[{impl SizedTypeProperties for T}[@TraitClause0]] + const ALIGNMENT = ALIGNMENT[{impl SizedTypeProperties for T}[@TraitClause0]] const IS_ZST = IS_ZST[{impl SizedTypeProperties for T}[@TraitClause0]] const LAYOUT = LAYOUT[{impl SizedTypeProperties for T}[@TraitClause0]] const MAX_SLICE_LEN = MAX_SLICE_LEN[{impl SizedTypeProperties for T}[@TraitClause0]] non-dyn-compatible } +// Full name: core::ptr::alignment::{Alignment}::of +pub fn of() -> Alignment +where + [@TraitClause0]: Sized, +{ + let _0: Alignment; // return + let _1: Alignment; // anonymous local + let _2: Option[{built_in impl Sized for Alignment}]; // anonymous local + let _3: usize; // anonymous local + + storage_live(_1) + storage_live(_2) + storage_live(_3) + _3 = core::mem::align_of[@TraitClause0]() + _2 = core::ptr::alignment::{Alignment}::new(move _3) + storage_dead(_3) + _1 = unwrap[{built_in impl Sized for Alignment}](move _2) + storage_dead(_2) + _0 = move _1 + return +} + // Full name: core::intrinsics::write_bytes pub unsafe fn write_bytes(@1: *mut T, @2: u8, @3: usize) where @@ -985,7 +1021,7 @@ where count_9 = copy _12.metadata storage_live(_16) _16 = ub_checks - if copy _16 { + if move _16 { storage_live(_14) _14 = cast<*mut [u8], *const ()>(copy _12) storage_live(_15) @@ -996,7 +1032,6 @@ where } else { } _6 = write_bytes[{built_in impl Sized for u8}](move self_7, const 0 : u8, move count_9) - storage_dead(_16) storage_dead(count_9) storage_dead(self_7) _0 = Result::Ok { 0: copy ptr_5 } @@ -1162,57 +1197,77 @@ fn core::ptr::copy_nonoverlapping::precondition_check(@1: *const (), @2: *mut () let _6: bool; // anonymous local let zero_size_7: bool; // local let _8: bool; // anonymous local - let align_9: usize; // local - let is_zst_10: bool; // local - let _11: bool; // anonymous local - let ptr_12: *const (); // local - let msg_13: &'1 Str; // local - let _14: !; // anonymous local - let _15: Arguments<'3>; // anonymous local + let is_zst_9: bool; // local + let _10: bool; // anonymous local + let ptr_11: *const (); // local + let msg_12: &'1 Str; // local + let _13: !; // anonymous local + let _14: Arguments<'3>; // anonymous local + let _15: bool; // anonymous local let _16: bool; // anonymous local - let _17: bool; // anonymous local - let _18: usize; // anonymous local + let _17: usize; // anonymous local + let _18: bool; // anonymous local let _19: bool; // anonymous local - let _20: bool; // anonymous local - let _21: usize; // anonymous local - let _22: NonNull; // anonymous local - let _23: *const u8; // anonymous local - let _24: NonNull>; // anonymous local + let _20: usize; // anonymous local + let _21: NonNull; // anonymous local + let _22: *const u8; // anonymous local + let _23: NonNull>; // anonymous local + let _24: usize; // anonymous local let _25: usize; // anonymous local let _26: usize; // anonymous local - let _27: usize; // anonymous local - let _28: *const Str; // anonymous local - let _29: &'8 [u8]; // anonymous local + let _27: *const Str; // anonymous local + let _28: &'8 [u8]; // anonymous local storage_live(zero_size_7) - storage_live(ptr_12) - storage_live(msg_13) - storage_live(_14) + storage_live(ptr_11) + storage_live(msg_12) + storage_live(_13) _0 = () storage_live(_6) switch copy count_5 { 0 : usize => { zero_size_7 = const true - storage_live(_8) - storage_live(align_9) - align_9 = copy align_4 - storage_live(is_zst_10) - is_zst_10 = copy zero_size_7 - storage_live(_16) - _16 = is_aligned_to<()>(copy src_1, copy align_4) - if move _16 { - storage_dead(_16) - storage_dead(is_zst_10) - storage_dead(align_9) - storage_live(_11) - ptr_12 = cast<*mut (), *const ()>(copy dst_2) - storage_live(_19) - _19 = is_aligned_to<()>(copy ptr_12, move align_4) - if move _19 { - if copy zero_size_7 { - storage_dead(_19) - _6 = runtime(move src_1, move ptr_12, move size_3, move count_5) - storage_dead(_11) + }, + _ => { + zero_size_7 = copy size_3 == const 0 : usize + }, + } + storage_live(_8) + storage_live(is_zst_9) + is_zst_9 = copy zero_size_7 + storage_live(_15) + _15 = is_aligned_to<()>(copy src_1, copy align_4) + if move _15 { + if copy is_zst_9 { + storage_dead(_15) + storage_dead(is_zst_9) + storage_live(_10) + ptr_11 = cast<*mut (), *const ()>(copy dst_2) + storage_live(_18) + _18 = is_aligned_to<()>(copy ptr_11, move align_4) + if move _18 { + if copy zero_size_7 { + storage_dead(_18) + _6 = runtime(move src_1, move ptr_11, move size_3, move count_5) + storage_dead(_10) + storage_dead(_8) + if move _6 { + storage_dead(_6) + return + } else { + } + } else { + storage_live(_19) + storage_live(_20) + _20 = transmute<*mut (), usize>(copy dst_2) + _19 = move _20 == const 0 : usize + storage_dead(_20) + _10 = ~(move _19) + storage_dead(_19) + storage_dead(_18) + if move _10 { + _6 = runtime(move src_1, move ptr_11, move size_3, move count_5) + storage_dead(_10) storage_dead(_8) if move _6 { storage_dead(_6) @@ -1220,64 +1275,53 @@ fn core::ptr::copy_nonoverlapping::precondition_check(@1: *const (), @2: *mut () } else { } } else { - storage_live(_20) - storage_live(_21) - _21 = transmute<*mut (), usize>(copy dst_2) - _20 = move _21 == const 0 : usize - storage_dead(_21) - _11 = ~(move _20) - storage_dead(_20) - storage_dead(_19) - if move _11 { - _6 = runtime(move src_1, move ptr_12, move size_3, move count_5) - storage_dead(_11) - storage_dead(_8) - if move _6 { - storage_dead(_6) - return - } else { - } - } else { - storage_dead(_11) - storage_dead(_8) - } + storage_dead(_10) + storage_dead(_8) } - } else { - storage_dead(_19) - storage_dead(_11) - storage_dead(_8) } } else { - storage_dead(_16) - storage_dead(is_zst_10) - storage_dead(align_9) - storage_dead(_11) + storage_dead(_18) + storage_dead(_10) storage_dead(_8) } - }, - _ => { - zero_size_7 = copy size_3 == const 0 : usize - storage_live(_8) - storage_live(align_9) - align_9 = copy align_4 - storage_live(is_zst_10) - is_zst_10 = copy zero_size_7 + } else { storage_live(_16) - _16 = is_aligned_to<()>(copy src_1, copy align_4) - if move _16 { - if copy is_zst_10 { - storage_dead(_16) - storage_dead(is_zst_10) - storage_dead(align_9) - storage_live(_11) - ptr_12 = cast<*mut (), *const ()>(copy dst_2) - storage_live(_19) - _19 = is_aligned_to<()>(copy ptr_12, move align_4) - if move _19 { - if copy zero_size_7 { - storage_dead(_19) - _6 = runtime(move src_1, move ptr_12, move size_3, move count_5) - storage_dead(_11) + storage_live(_17) + _17 = transmute<*const (), usize>(copy src_1) + _16 = move _17 == const 0 : usize + storage_dead(_17) + _8 = ~(move _16) + storage_dead(_16) + storage_dead(_15) + if move _8 { + storage_dead(is_zst_9) + storage_live(_10) + ptr_11 = cast<*mut (), *const ()>(copy dst_2) + storage_live(_18) + _18 = is_aligned_to<()>(copy ptr_11, move align_4) + if move _18 { + if copy zero_size_7 { + storage_dead(_18) + _6 = runtime(move src_1, move ptr_11, move size_3, move count_5) + storage_dead(_10) + storage_dead(_8) + if move _6 { + storage_dead(_6) + return + } else { + } + } else { + storage_live(_19) + storage_live(_20) + _20 = transmute<*mut (), usize>(copy dst_2) + _19 = move _20 == const 0 : usize + storage_dead(_20) + _10 = ~(move _19) + storage_dead(_19) + storage_dead(_18) + if move _10 { + _6 = runtime(move src_1, move ptr_11, move size_3, move count_5) + storage_dead(_10) storage_dead(_8) if move _6 { storage_dead(_6) @@ -1285,132 +1329,55 @@ fn core::ptr::copy_nonoverlapping::precondition_check(@1: *const (), @2: *mut () } else { } } else { - storage_live(_20) - storage_live(_21) - _21 = transmute<*mut (), usize>(copy dst_2) - _20 = move _21 == const 0 : usize - storage_dead(_21) - _11 = ~(move _20) - storage_dead(_20) - storage_dead(_19) - if move _11 { - _6 = runtime(move src_1, move ptr_12, move size_3, move count_5) - storage_dead(_11) - storage_dead(_8) - if move _6 { - storage_dead(_6) - return - } else { - } - } else { - storage_dead(_11) - storage_dead(_8) - } + storage_dead(_10) + storage_dead(_8) } - } else { - storage_dead(_19) - storage_dead(_11) - storage_dead(_8) } } else { - storage_live(_17) - storage_live(_18) - _18 = transmute<*const (), usize>(copy src_1) - _17 = move _18 == const 0 : usize storage_dead(_18) - _8 = ~(move _17) - storage_dead(_17) - storage_dead(_16) - if move _8 { - storage_dead(is_zst_10) - storage_dead(align_9) - storage_live(_11) - ptr_12 = cast<*mut (), *const ()>(copy dst_2) - storage_live(_19) - _19 = is_aligned_to<()>(copy ptr_12, move align_4) - if move _19 { - if copy zero_size_7 { - storage_dead(_19) - _6 = runtime(move src_1, move ptr_12, move size_3, move count_5) - storage_dead(_11) - storage_dead(_8) - if move _6 { - storage_dead(_6) - return - } else { - } - } else { - storage_live(_20) - storage_live(_21) - _21 = transmute<*mut (), usize>(copy dst_2) - _20 = move _21 == const 0 : usize - storage_dead(_21) - _11 = ~(move _20) - storage_dead(_20) - storage_dead(_19) - if move _11 { - _6 = runtime(move src_1, move ptr_12, move size_3, move count_5) - storage_dead(_11) - storage_dead(_8) - if move _6 { - storage_dead(_6) - return - } else { - } - } else { - storage_dead(_11) - storage_dead(_8) - } - } - } else { - storage_dead(_19) - storage_dead(_11) - storage_dead(_8) - } - } else { - storage_dead(is_zst_10) - storage_dead(align_9) - storage_dead(_11) - storage_dead(_8) - } + storage_dead(_10) + storage_dead(_8) } } else { - storage_dead(_16) - storage_dead(is_zst_10) - storage_dead(align_9) - storage_dead(_11) + storage_dead(is_zst_9) + storage_dead(_10) storage_dead(_8) } - }, + } + } else { + storage_dead(_15) + storage_dead(is_zst_9) + storage_dead(_10) + storage_dead(_8) } - msg_13 = const "unsafe precondition(s) violated: ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap\n\nThis indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety." - storage_live(_15) + msg_12 = const "unsafe precondition(s) violated: ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap\n\nThis indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety." + storage_live(_14) + storage_live(_21) storage_live(_22) + storage_live(_27) + _27 = &raw const (*msg_12) with_metadata(copy msg_12.metadata) + _22 = cast<*const Str, *const u8>(copy _27) + storage_dead(_27) + _21 = transmute<*const u8, NonNull>(copy _22) + storage_dead(_22) storage_live(_23) - storage_live(_28) - _28 = &raw const (*msg_13) with_metadata(copy msg_13.metadata) - _23 = cast<*const Str, *const u8>(copy _28) - storage_dead(_28) - _22 = transmute<*const u8, NonNull>(copy _23) - storage_dead(_23) storage_live(_24) storage_live(_25) storage_live(_26) - storage_live(_27) - storage_live(_29) - _29 = transmute<&'11 Str, &'10 [u8]>(const "unsafe precondition(s) violated: ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap\n\nThis indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.") - _27 = copy _29.metadata - storage_dead(_29) - _26 = move _27 wrap.<< const 1 : i32 - storage_dead(_27) - _25 = move _26 | const 1 : usize + storage_live(_28) + _28 = transmute<&'11 Str, &'10 [u8]>(const "unsafe precondition(s) violated: ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap\n\nThis indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.") + _26 = copy _28.metadata + storage_dead(_28) + _25 = move _26 wrap.<< const 1 : i32 storage_dead(_26) - _24 = transmute>>(move _25) + _24 = move _25 | const 1 : usize storage_dead(_25) - _15 = Arguments { template: move _22, args: move _24 } + _23 = transmute>>(move _24) storage_dead(_24) - storage_dead(_22) - _14 = panic_nounwind_fmt<'15>(move _15, const false) + _14 = Arguments { template: move _21, args: move _23 } + storage_dead(_23) + storage_dead(_21) + _13 = panic_nounwind_fmt<'15>(move _14, const false) } pub unsafe fn core::alloc::Allocator::grow<'_0, Self>(@1: &'_0 Self, @2: NonNull, @3: Layout, @4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] @@ -1476,7 +1443,7 @@ where count_10 = copy (old_layout_3).size storage_live(_17) _17 = ub_checks - if copy _17 { + if move _17 { storage_live(_15) _15 = transmute, *const ()>(copy ptr_2) storage_live(_16) @@ -1487,7 +1454,6 @@ where } else { } copy_nonoverlapping(copy src_8, copy dst_9, copy count_10) - storage_dead(_17) storage_dead(count_10) storage_dead(dst_9) storage_dead(src_8) @@ -1559,7 +1525,7 @@ where count_10 = copy (old_layout_3).size storage_live(_17) _17 = ub_checks - if copy _17 { + if move _17 { storage_live(_15) _15 = transmute, *const ()>(copy ptr_2) storage_live(_16) @@ -1570,7 +1536,6 @@ where } else { } copy_nonoverlapping(copy src_8, copy dst_9, copy count_10) - storage_dead(_17) storage_dead(count_10) storage_dead(dst_9) storage_dead(src_8) @@ -1642,7 +1607,7 @@ where count_10 = copy (new_layout_4).size storage_live(_17) _17 = ub_checks - if copy _17 { + if move _17 { storage_live(_15) _15 = transmute, *const ()>(copy ptr_2) storage_live(_16) @@ -1653,7 +1618,6 @@ where } else { } copy_nonoverlapping(copy src_8, copy dst_9, copy count_10) - storage_dead(_17) storage_dead(count_10) storage_dead(dst_9) storage_dead(src_8) @@ -1702,101 +1666,6 @@ where unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) = -// Full name: core::num::niche_types::NonZeroUsizeInner -pub struct NonZeroUsizeInner { - usize, -} - -// Full name: core::num::niche_types::{impl Clone for NonZeroUsizeInner}::clone -pub fn {impl Clone for NonZeroUsizeInner}::clone<'_0>(@1: &'_0 NonZeroUsizeInner) -> NonZeroUsizeInner -{ - let _0: NonZeroUsizeInner; // return - let self_1: &'1 NonZeroUsizeInner; // arg #1 - - _0 = copy (*self_1) - return -} - -// Full name: core::num::niche_types::{impl Clone for NonZeroUsizeInner}::clone_from -pub fn {impl Clone for NonZeroUsizeInner}::clone_from<'_0, '_1>(@1: &'_0 mut NonZeroUsizeInner, @2: &'_1 NonZeroUsizeInner) -where - [@TraitClause0]: Destruct, -{ - let _0: (); // return - let self_1: &'1 mut NonZeroUsizeInner; // arg #1 - let source_2: &'3 NonZeroUsizeInner; // arg #2 - let _3: NonZeroUsizeInner; // anonymous local - - _0 = () - storage_live(_3) - _3 = {impl Clone for NonZeroUsizeInner}::clone<'5>(move source_2) - drop[@TraitClause0] (*self_1) - (*self_1) = move _3 - storage_dead(_3) - return -} - -// Full name: core::num::niche_types::{impl Clone for NonZeroUsizeInner} -impl Clone for NonZeroUsizeInner { - parent_clause0 = {built_in impl Sized for NonZeroUsizeInner} - fn clone<'_0_1> = {impl Clone for NonZeroUsizeInner}::clone<'_0_1> - fn clone_from<'_0_1, '_1_1, [@TraitClause0_1]: Destruct> = {impl Clone for NonZeroUsizeInner}::clone_from<'_0_1, '_1_1>[@TraitClause0_1] - non-dyn-compatible -} - -// Full name: core::num::niche_types::{impl Copy for NonZeroUsizeInner} -impl Copy for NonZeroUsizeInner { - parent_clause0 = {built_in impl MetaSized for NonZeroUsizeInner} - parent_clause1 = {impl Clone for NonZeroUsizeInner} - non-dyn-compatible -} - -// Full name: core::num::nonzero::private::Sealed -pub trait Sealed -{ - parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::num::nonzero::private::Sealed::{vtable} -} - -// Full name: core::num::nonzero::ZeroablePrimitive -pub trait ZeroablePrimitive -{ - parent_clause0 : [@TraitClause0]: Sized - parent_clause1 : [@TraitClause1]: Copy - parent_clause2 : [@TraitClause2]: Sealed - parent_clause3 : [@TraitClause3]: Sized - parent_clause4 : [@TraitClause4]: Copy - type NonZeroInner - non-dyn-compatible -} - -// Full name: core::num::nonzero::{impl Sealed for usize} -impl Sealed for usize { - parent_clause0 = {built_in impl MetaSized for usize} - vtable: {impl Sealed for usize}::{vtable} -} - -// Full name: core::num::nonzero::{impl ZeroablePrimitive for usize} -impl ZeroablePrimitive for usize { - parent_clause0 = {built_in impl Sized for usize} - parent_clause1 = {impl Copy for usize} - parent_clause2 = {impl Sealed for usize} - parent_clause3 = {built_in impl Sized for NonZeroUsizeInner} - parent_clause4 = {impl Copy for NonZeroUsizeInner} - type NonZeroInner = NonZeroUsizeInner - non-dyn-compatible -} - -// Full name: core::num::nonzero::NonZero -#[lang_item("NonZero")] -pub struct NonZero -where - [@TraitClause0]: Sized, - [@TraitClause1]: ZeroablePrimitive, -{ - @TraitClause1::NonZeroInner, -} - // Full name: core::ptr::unique::Unique pub struct Unique { pointer: NonNull, @@ -1825,7 +1694,7 @@ fn core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(@1: *mut _0 = () storage_live(_5) _5 = transmute<*mut (), usize>(copy ptr_1) - switch move _5 { + switch copy _5 { 0 : usize => { }, _ => { @@ -1941,216 +1810,208 @@ unsafe fn __rust_no_alloc_shim_is_unstable_v2() #[lang_item("global_alloc_ty")] pub struct Global {} -// Full name: alloc::alloc::{Global}::alloc_impl -fn alloc_impl<'_0>(@1: &'_0 Global, @2: Layout, @3: bool) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +// Full name: alloc::alloc::{Global}::alloc_impl_runtime +fn alloc_impl_runtime(@1: Layout, @2: bool) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] { let _0: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // return - let self_1: &'1 Global; // arg #1 - let layout_2: Layout; // arg #2 - let zeroed_3: bool; // arg #3 - let size_4: usize; // local - let _5: NonNull<[u8]>; // anonymous local - let data_6: NonNull; // local - let raw_ptr_7: *mut u8; // local - let _8: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull}]; // anonymous local - let self_9: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // local - let self_10: Option>[{built_in impl Sized for NonNull}]; // local - let ptr_11: NonNull; // local - let _12: NonNull<[u8]>; // anonymous local - let _13: NonZero[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}]; // anonymous local - let _14: Alignment; // anonymous local - let _15: *const u8; // anonymous local - let ptr_16: *mut [u8]; // local - let data_17: *mut u8; // local - let _18: (); // anonymous local - let _19: *mut (); // anonymous local - let _20: *const [u8]; // anonymous local - let _21: bool; // anonymous local + let layout_1: Layout; // arg #1 + let zeroed_2: bool; // arg #2 + let size_3: usize; // local + let _4: NonNull<[u8]>; // anonymous local + let data_5: NonNull; // local + let raw_ptr_6: *mut u8; // local + let _7: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull}]; // anonymous local + let self_8: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // local + let self_9: Option>[{built_in impl Sized for NonNull}]; // local + let ptr_10: NonNull; // local + let _11: NonNull<[u8]>; // anonymous local + let _12: Alignment; // anonymous local + let _13: *const u8; // anonymous local + let ptr_14: *mut [u8]; // local + let data_15: *mut u8; // local + let _16: (); // anonymous local + let _17: *mut (); // anonymous local + let _18: *const [u8]; // anonymous local + let _19: (); // anonymous local + let _20: usize; // anonymous local + let _21: Alignment; // anonymous local let _22: (); // anonymous local let _23: usize; // anonymous local - let _24: AlignmentEnum; // anonymous local - let _25: (); // anonymous local - let _26: usize; // anonymous local - let _27: AlignmentEnum; // anonymous local - let _28: NonNull; // anonymous local - let _29: *const u8; // anonymous local - let _30: usize; // anonymous local - let _31: (); // anonymous local - let _32: *mut (); // anonymous local - let _33: bool; // anonymous local - let v_34: NonNull; // local - let v_35: NonNull; // local - let ptr_36: *mut [u8]; // local - let data_37: *mut u8; // local - let _38: (); // anonymous local - let _39: *mut (); // anonymous local - let _40: *const [u8]; // anonymous local - let _41: bool; // anonymous local - let _42: Option>[{built_in impl Sized for NonNull}]; // anonymous local + let _24: Alignment; // anonymous local + let _25: NonNull; // anonymous local + let _26: *const u8; // anonymous local + let _27: usize; // anonymous local + let _28: (); // anonymous local + let _29: *mut (); // anonymous local + let v_30: NonNull; // local + let v_31: NonNull; // local + let ptr_32: *mut [u8]; // local + let data_33: *mut u8; // local + let _34: (); // anonymous local + let _35: *mut (); // anonymous local + let _36: *const [u8]; // anonymous local + let _37: bool; // anonymous local + let _38: bool; // anonymous local + let _39: bool; // anonymous local + let _40: Option>[{built_in impl Sized for NonNull}]; // anonymous local + let _41: AllocError; // anonymous local + let _42: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local let _43: AllocError; // anonymous local - let _44: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local - let _45: AllocError; // anonymous local - let _46: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let _44: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - storage_live(size_4) - storage_live(raw_ptr_7) - storage_live(ptr_11) - storage_live(_13) - storage_live(_18) + storage_live(size_3) + storage_live(raw_ptr_6) + storage_live(ptr_10) + storage_live(_12) + storage_live(_16) + storage_live(_19) storage_live(_22) - storage_live(_25) - storage_live(_29) - storage_live(_31) - storage_live(_38) - size_4 = copy (layout_2).size - switch copy size_4 { + storage_live(_26) + storage_live(_28) + storage_live(_34) + size_3 = copy (layout_1).size + switch copy size_3 { 0 : usize => { }, _ => { - if copy zeroed_3 { + if copy zeroed_2 { + _19 = __rust_no_alloc_shim_is_unstable_v2() + storage_live(_20) + storage_live(_21) + _21 = copy (layout_1).align + _20 = transmute(copy _21) + storage_dead(_21) + raw_ptr_6 = __rust_alloc_zeroed(copy size_3, move _20) + storage_dead(_20) + } else { _22 = __rust_no_alloc_shim_is_unstable_v2() storage_live(_23) storage_live(_24) - _24 = copy ((layout_2).align).0 - _23 = @discriminant(_24) + _24 = copy (layout_1).align + _23 = transmute(copy _24) storage_dead(_24) - raw_ptr_7 = __rust_alloc_zeroed(copy size_4, move _23) + raw_ptr_6 = __rust_alloc(copy size_3, move _23) storage_dead(_23) - } else { - _25 = __rust_no_alloc_shim_is_unstable_v2() - storage_live(_26) - storage_live(_27) - _27 = copy ((layout_2).align).0 - _26 = @discriminant(_27) - storage_dead(_27) - raw_ptr_7 = __rust_alloc(copy size_4, move _26) - storage_dead(_26) } - storage_live(_8) + storage_live(_7) + storage_live(self_8) storage_live(self_9) - storage_live(self_10) - _29 = cast<*mut u8, *const u8>(copy raw_ptr_7) - storage_live(_30) - _30 = transmute<*mut u8, usize>(copy raw_ptr_7) - switch move _30 { + _26 = cast<*mut u8, *const u8>(copy raw_ptr_6) + storage_live(_27) + _27 = transmute<*mut u8, usize>(copy raw_ptr_6) + switch copy _27 { 0 : usize => { }, _ => { - storage_dead(_30) - storage_live(_28) - storage_live(_33) - _33 = ub_checks - if copy _33 { - storage_live(_32) - _32 = cast<*mut u8, *mut ()>(copy raw_ptr_7) - _31 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _32) - storage_dead(_32) + storage_dead(_27) + storage_live(_25) + storage_live(_38) + _38 = ub_checks + if move _38 { + storage_live(_29) + _29 = cast<*mut u8, *mut ()>(copy raw_ptr_6) + _28 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _29) + storage_dead(_29) } else { } - _28 = NonNull { pointer: copy _29 } - storage_dead(_33) - self_10 = Option::Some { 0: move _28 } - storage_dead(_28) - storage_live(v_34) - v_34 = move (self_10 as variant Option::Some).0 - self_9 = Result::Ok { 0: copy v_34 } - storage_dead(v_34) - storage_dead(self_10) - storage_live(v_35) - v_35 = move (self_9 as variant Result::Ok).0 - _8 = ControlFlow::Continue { 0: copy v_35 } - storage_dead(v_35) + _25 = NonNull { pointer: copy _26 } + self_9 = Option::Some { 0: move _25 } + storage_dead(_25) + storage_live(v_30) + v_30 = move (self_9 as variant Option::Some).0 + self_8 = Result::Ok { 0: copy v_30 } + storage_dead(v_30) storage_dead(self_9) - ptr_11 = copy (_8 as variant ControlFlow::Continue).0 - storage_dead(_8) - storage_live(_12) - storage_live(ptr_36) - storage_live(data_37) - data_37 = transmute, *mut u8>(copy ptr_11) - ptr_36 = *mut (copy data_37, copy size_4) - storage_dead(data_37) - storage_live(_40) - storage_live(_41) - _41 = ub_checks - if copy _41 { - storage_live(_39) - _39 = transmute, *mut ()>(copy ptr_11) - _38 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _39) - storage_dead(_39) + storage_live(v_31) + v_31 = move (self_8 as variant Result::Ok).0 + _7 = ControlFlow::Continue { 0: copy v_31 } + storage_dead(v_31) + storage_dead(self_8) + ptr_10 = copy (_7 as variant ControlFlow::Continue).0 + storage_dead(_7) + storage_live(_11) + storage_live(ptr_32) + storage_live(data_33) + data_33 = transmute, *mut u8>(copy ptr_10) + ptr_32 = *mut (copy data_33, copy size_3) + storage_dead(data_33) + storage_live(_36) + storage_live(_39) + _39 = ub_checks + if move _39 { + storage_live(_35) + _35 = transmute, *mut ()>(copy ptr_10) + _34 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _35) + storage_dead(_35) } else { } - _40 = cast<*mut [u8], *const [u8]>(copy ptr_36) - _12 = NonNull { pointer: copy _40 } - storage_dead(_41) - storage_dead(_40) - storage_dead(ptr_36) - _0 = Result::Ok { 0: move _12 } - storage_dead(_12) + _36 = cast<*mut [u8], *const [u8]>(copy ptr_32) + _11 = NonNull { pointer: copy _36 } + storage_dead(_36) + storage_dead(ptr_32) + _0 = Result::Ok { 0: move _11 } + storage_dead(_11) return }, } - storage_dead(_30) + storage_dead(_27) + storage_live(_40) + _40 = Option::None { } + self_9 = move _40 + storage_live(v_30) + storage_live(_41) + _41 = AllocError { } storage_live(_42) - _42 = Option::None { } - self_10 = move _42 - storage_live(v_34) + _42 = Result::Err { 0: move _41 } + self_8 = move _42 + storage_dead(v_30) + storage_dead(self_9) + storage_live(v_31) + storage_dead(v_31) + storage_dead(self_8) storage_live(_43) _43 = AllocError { } storage_live(_44) _44 = Result::Err { 0: move _43 } - self_9 = move _44 - storage_dead(v_34) - storage_dead(self_10) - storage_live(v_35) - storage_dead(v_35) - storage_dead(self_9) - storage_live(_45) - _45 = AllocError { } - storage_live(_46) - _46 = Result::Err { 0: move _45 } - _0 = move _46 - storage_dead(_8) + _0 = move _44 + storage_dead(_7) return }, } - storage_live(_5) - storage_live(data_6) - storage_live(_14) - _14 = copy (layout_2).align - _13 = transmute[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}]>(copy _14) - storage_dead(_14) - storage_live(_15) - _15 = transmute[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}], *const u8>(copy _13) - data_6 = NonNull { pointer: copy _15 } - storage_dead(_15) - storage_live(ptr_16) - storage_live(data_17) - data_17 = transmute[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}], *mut u8>(copy _13) - ptr_16 = *mut (copy data_17, const 0 : usize) - storage_dead(data_17) - storage_live(_20) - storage_live(_21) - _21 = ub_checks - if copy _21 { - storage_live(_19) - _19 = transmute[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}], *mut ()>(copy _13) - _18 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _19) - storage_dead(_19) + storage_live(_4) + storage_live(data_5) + _12 = copy (layout_1).align + storage_live(_13) + _13 = transmute(copy _12) + data_5 = NonNull { pointer: copy _13 } + storage_dead(_13) + storage_live(ptr_14) + storage_live(data_15) + data_15 = transmute(copy _12) + ptr_14 = *mut (copy data_15, const 0 : usize) + storage_dead(data_15) + storage_live(_18) + storage_live(_37) + _37 = ub_checks + if move _37 { + storage_live(_17) + _17 = transmute(copy _12) + _16 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _17) + storage_dead(_17) } else { } - _20 = cast<*mut [u8], *const [u8]>(copy ptr_16) - _5 = NonNull { pointer: copy _20 } - storage_dead(_21) - storage_dead(_20) - storage_dead(ptr_16) - storage_dead(data_6) - _0 = Result::Ok { 0: move _5 } - storage_dead(_5) + _18 = cast<*mut [u8], *const [u8]>(copy ptr_14) + _4 = NonNull { pointer: copy _18 } + storage_dead(_18) + storage_dead(ptr_14) + storage_dead(data_5) + _0 = Result::Ok { 0: move _4 } + storage_dead(_4) return } -// Full name: alloc::alloc::{Global}::grow_impl -unsafe fn grow_impl<'_0>(@1: &'_0 Global, @2: NonNull, @3: Layout, @4: Layout, @5: bool) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +// Full name: alloc::alloc::{Global}::grow_impl_runtime +fn grow_impl_runtime<'_0>(@1: &'_0 Global, @2: NonNull, @3: Layout, @4: Layout, @5: bool) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] { let _0: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // return let self_1: &'1 Global; // arg #1 @@ -2166,149 +2027,140 @@ unsafe fn grow_impl<'_0>(@1: &'_0 Global, @2: NonNull, @3: Layout, @4: Layou let cond_11: bool; // local let raw_ptr_12: *mut u8; // local let ptr_13: *mut u8; // local - let self_14: NonNull; // local - let new_size_15: usize; // local - let _16: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull}]; // anonymous local - let self_17: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // local - let self_18: Option>[{built_in impl Sized for NonNull}]; // local - let ptr_19: *mut u8; // local - let ptr_20: NonNull; // local - let _21: (); // anonymous local - let self_22: *mut u8; // local - let self_23: *mut u8; // local - let count_24: usize; // local - let _25: NonNull<[u8]>; // anonymous local - let _26: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull<[u8]>>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull<[u8]>}]; // anonymous local - let self_27: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local - let new_ptr_28: NonNull<[u8]>; // local - let src_29: *const u8; // local - let ptr_30: *mut u8; // local - let dst_31: *mut u8; // local - let _32: (); // anonymous local - let _33: AlignmentEnum; // anonymous local - let _34: AlignmentEnum; // anonymous local + let _14: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull}]; // anonymous local + let self_15: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // local + let self_16: Option>[{built_in impl Sized for NonNull}]; // local + let ptr_17: NonNull; // local + let _18: (); // anonymous local + let self_19: *mut u8; // local + let count_20: usize; // local + let _21: NonNull<[u8]>; // anonymous local + let _22: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull<[u8]>>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull<[u8]>}]; // anonymous local + let self_23: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local + let new_ptr_24: NonNull<[u8]>; // local + let src_25: *const u8; // local + let ptr_26: *mut u8; // local + let dst_27: *mut u8; // local + let _28: (); // anonymous local + let _29: Alignment; // anonymous local + let _30: Alignment; // anonymous local + let _31: (); // anonymous local + let _32: NonNull; // anonymous local + let _33: *const u8; // anonymous local + let _34: usize; // anonymous local let _35: (); // anonymous local - let _36: bool; // anonymous local - let _37: NonNull; // anonymous local - let _38: *const u8; // anonymous local - let _39: usize; // anonymous local - let _40: (); // anonymous local - let _41: *mut (); // anonymous local - let v_42: NonNull; // local - let v_43: NonNull; // local + let _36: *mut (); // anonymous local + let v_37: NonNull; // local + let v_38: NonNull; // local + let _39: (); // anonymous local + let _40: *const (); // anonymous local + let _41: bool; // anonymous local + let ptr_42: *mut [u8]; // local + let data_43: *mut u8; // local let _44: (); // anonymous local - let _45: *const (); // anonymous local - let _46: bool; // anonymous local - let ptr_47: *mut [u8]; // local - let data_48: *mut u8; // local + let _45: *mut (); // anonymous local + let _46: *const [u8]; // anonymous local + let v_47: NonNull<[u8]>; // local + let _48: *mut [u8]; // anonymous local let _49: (); // anonymous local - let _50: *mut (); // anonymous local - let _51: *const [u8]; // anonymous local - let v_52: NonNull<[u8]>; // local - let _53: *mut [u8]; // anonymous local - let _54: (); // anonymous local - let _55: *const (); // anonymous local - let _56: *mut (); // anonymous local - let _57: bool; // anonymous local - let _58: AllocError; // anonymous local - let _59: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - let _60: Option>[{built_in impl Sized for NonNull}]; // anonymous local - let _61: AllocError; // anonymous local - let _62: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local - let _63: AllocError; // anonymous local - let _64: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let _50: *const (); // anonymous local + let _51: *mut (); // anonymous local + let _52: bool; // anonymous local + let _53: bool; // anonymous local + let _54: bool; // anonymous local + let _55: bool; // anonymous local + let _56: bool; // anonymous local + let _57: AllocError; // anonymous local + let _58: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let _59: Option>[{built_in impl Sized for NonNull}]; // anonymous local + let _60: AllocError; // anonymous local + let _61: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local + let _62: AllocError; // anonymous local + let _63: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local storage_live(old_size_6) storage_live(_8) storage_live(new_size_10) storage_live(raw_ptr_12) - storage_live(ptr_20) - storage_live(_21) - storage_live(new_ptr_28) - storage_live(ptr_30) - storage_live(_32) + storage_live(ptr_17) + storage_live(_18) + storage_live(new_ptr_24) + storage_live(ptr_26) + storage_live(_28) + storage_live(_29) + storage_live(_31) storage_live(_33) storage_live(_35) - storage_live(_36) - storage_live(_38) - storage_live(_40) + storage_live(_39) storage_live(_44) + storage_live(_48) storage_live(_49) - storage_live(_53) - storage_live(_54) old_size_6 = copy (old_layout_3).size switch copy old_size_6 { 0 : usize => { }, _ => { storage_live(_7) - _33 = copy ((old_layout_3).align).0 - _8 = @discriminant(_33) + _29 = copy (old_layout_3).align + _8 = transmute(copy _29) storage_live(_9) - storage_live(_34) - _34 = copy ((new_layout_4).align).0 - _9 = @discriminant(_34) - storage_dead(_34) + storage_live(_30) + _30 = copy (new_layout_4).align + _9 = transmute(copy _30) + storage_dead(_30) _7 = copy _8 == move _9 if move _7 { } else { storage_dead(_9) storage_dead(_7) - storage_live(_26) - storage_live(self_27) - self_27 = alloc_impl<'22>(move self_1, move new_layout_4, move zeroed_5) - storage_live(v_52) - match self_27 { + storage_live(_22) + storage_live(self_23) + self_23 = alloc_impl_runtime(move new_layout_4, move zeroed_5) + storage_live(v_47) + match self_23 { Result::Ok => { }, Result::Err => { - storage_dead(v_52) - storage_dead(self_27) + storage_dead(v_47) + storage_dead(self_23) + storage_live(_57) + _57 = AllocError { } storage_live(_58) - _58 = AllocError { } - storage_live(_59) - _59 = Result::Err { 0: move _58 } - _0 = move _59 - storage_dead(_26) + _58 = Result::Err { 0: move _57 } + _0 = move _58 + storage_dead(_22) return }, } - v_52 = move (self_27 as variant Result::Ok).0 - _26 = ControlFlow::Continue { 0: copy v_52 } - storage_dead(v_52) - storage_dead(self_27) - new_ptr_28 = copy (_26 as variant ControlFlow::Continue).0 - storage_dead(_26) - storage_live(src_29) - ptr_30 = transmute, *mut u8>(copy ptr_2) - src_29 = transmute, *const u8>(copy ptr_2) - storage_live(dst_31) - _53 = transmute, *mut [u8]>(copy new_ptr_28) - dst_31 = cast<*mut [u8], *mut u8>(copy _53) - storage_live(_57) - _57 = ub_checks - if copy _57 { - storage_live(_55) - _55 = transmute, *const ()>(copy ptr_2) - storage_live(_56) - _56 = cast<*mut [u8], *mut ()>(copy _53) - _54 = core::ptr::copy_nonoverlapping::precondition_check(move _55, move _56, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::SIZE, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, copy old_size_6) - storage_dead(_56) - storage_dead(_55) + v_47 = move (self_23 as variant Result::Ok).0 + _22 = ControlFlow::Continue { 0: copy v_47 } + storage_dead(v_47) + storage_dead(self_23) + new_ptr_24 = copy (_22 as variant ControlFlow::Continue).0 + storage_dead(_22) + storage_live(src_25) + ptr_26 = transmute, *mut u8>(copy ptr_2) + src_25 = transmute, *const u8>(copy ptr_2) + storage_live(dst_27) + _48 = transmute, *mut [u8]>(copy new_ptr_24) + dst_27 = cast<*mut [u8], *mut u8>(copy _48) + storage_live(_53) + _53 = ub_checks + if move _53 { + storage_live(_50) + _50 = transmute, *const ()>(copy ptr_2) + storage_live(_51) + _51 = cast<*mut [u8], *mut ()>(copy _48) + _49 = core::ptr::copy_nonoverlapping::precondition_check(move _50, move _51, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::SIZE, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, copy old_size_6) + storage_dead(_51) + storage_dead(_50) } else { } - copy_nonoverlapping(copy src_29, copy dst_31, copy old_size_6) - storage_dead(_57) - storage_dead(dst_31) - storage_dead(src_29) - switch copy old_size_6 { - 0 : usize => { - }, - _ => { - _32 = __rust_dealloc(move ptr_30, move old_size_6, move _8) - }, - } - _0 = Result::Ok { 0: copy new_ptr_28 } + copy_nonoverlapping(copy src_25, copy dst_27, copy old_size_6) + storage_dead(dst_27) + storage_dead(src_25) + _28 = __rust_dealloc(move ptr_26, move old_size_6, move _8) + _0 = Result::Ok { 0: copy new_ptr_24 } return } storage_dead(_9) @@ -2316,741 +2168,464 @@ unsafe fn grow_impl<'_0>(@1: &'_0 Global, @2: NonNull, @3: Layout, @4: Layou new_size_10 = copy (new_layout_4).size storage_live(cond_11) cond_11 = copy new_size_10 >= copy old_size_6 - _36 = ub_checks - if copy _36 { + storage_live(_52) + _52 = ub_checks + if move _52 { + _31 = core::hint::assert_unchecked::precondition_check(copy cond_11) } else { - assert(copy cond_11 == true) else undefined_behavior - storage_dead(cond_11) - storage_live(ptr_13) - storage_live(self_14) - self_14 = copy ptr_2 - ptr_13 = transmute, *mut u8>(copy ptr_2) - storage_dead(self_14) - storage_live(new_size_15) - new_size_15 = copy new_size_10 - raw_ptr_12 = __rust_realloc(move ptr_13, copy old_size_6, move _8, copy new_size_10) - storage_dead(new_size_15) - storage_dead(ptr_13) - storage_live(_16) - storage_live(self_17) - storage_live(self_18) - storage_live(ptr_19) - ptr_19 = copy raw_ptr_12 - _38 = cast<*mut u8, *const u8>(copy raw_ptr_12) - storage_live(_39) - _39 = transmute<*mut u8, usize>(copy raw_ptr_12) - switch move _39 { - 0 : usize => { - }, - _ => { - storage_dead(_39) - storage_live(_37) - if copy _36 { - storage_live(_41) - _41 = cast<*mut u8, *mut ()>(copy raw_ptr_12) - _40 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _41) - storage_dead(_41) - } else { - } - _37 = NonNull { pointer: copy _38 } - self_18 = Option::Some { 0: move _37 } - storage_dead(_37) - storage_dead(ptr_19) - storage_live(v_42) - v_42 = move (self_18 as variant Option::Some).0 - self_17 = Result::Ok { 0: copy v_42 } - storage_dead(v_42) - storage_dead(self_18) - storage_live(v_43) - v_43 = move (self_17 as variant Result::Ok).0 - _16 = ControlFlow::Continue { 0: copy v_43 } - storage_dead(v_43) - storage_dead(self_17) - ptr_20 = copy (_16 as variant ControlFlow::Continue).0 - storage_dead(_16) - if copy zeroed_5 { - storage_live(self_22) - storage_live(self_23) - self_23 = copy raw_ptr_12 - self_22 = copy raw_ptr_12 offset copy old_size_6 - storage_dead(self_23) - storage_live(count_24) - count_24 = copy new_size_10 wrap.- copy old_size_6 - if copy _36 { - storage_live(_45) - _45 = cast<*mut u8, *const ()>(copy self_22) - storage_live(_46) - _46 = copy count_24 == const 0 : usize - _44 = core::ptr::write_bytes::precondition_check(move _45, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, move _46) - storage_dead(_46) - storage_dead(_45) - } else { - } - _21 = write_bytes[{built_in impl Sized for u8}](move self_22, const 0 : u8, move count_24) - storage_dead(count_24) - storage_dead(self_22) - } else { - } - storage_live(_25) - storage_live(ptr_47) - storage_live(data_48) - data_48 = transmute, *mut u8>(copy ptr_20) - ptr_47 = *mut (copy data_48, copy new_size_10) - storage_dead(data_48) - storage_live(_51) - if copy _36 { - storage_live(_50) - _50 = transmute, *mut ()>(copy ptr_20) - _49 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _50) - storage_dead(_50) - } else { - } - _51 = cast<*mut [u8], *const [u8]>(copy ptr_47) - _25 = NonNull { pointer: copy _51 } - storage_dead(_51) - storage_dead(ptr_47) - _0 = Result::Ok { 0: move _25 } - storage_dead(_25) - return - }, - } - storage_dead(_39) - storage_live(_60) - _60 = Option::None { } - self_18 = move _60 - storage_dead(ptr_19) - storage_live(v_42) - storage_live(_61) - _61 = AllocError { } - storage_live(_62) - _62 = Result::Err { 0: move _61 } - self_17 = move _62 - storage_dead(v_42) - storage_dead(self_18) - storage_live(v_43) - storage_dead(v_43) - storage_dead(self_17) - storage_live(_63) - _63 = AllocError { } - storage_live(_64) - _64 = Result::Err { 0: move _63 } - _0 = move _64 - storage_dead(_16) - return } - _35 = core::hint::assert_unchecked::precondition_check(copy cond_11) assert(copy cond_11 == true) else undefined_behavior storage_dead(cond_11) storage_live(ptr_13) - storage_live(self_14) - self_14 = copy ptr_2 ptr_13 = transmute, *mut u8>(copy ptr_2) - storage_dead(self_14) - storage_live(new_size_15) - new_size_15 = copy new_size_10 raw_ptr_12 = __rust_realloc(move ptr_13, copy old_size_6, move _8, copy new_size_10) - storage_dead(new_size_15) storage_dead(ptr_13) - storage_live(_16) - storage_live(self_17) - storage_live(self_18) - storage_live(ptr_19) - ptr_19 = copy raw_ptr_12 - _38 = cast<*mut u8, *const u8>(copy raw_ptr_12) - storage_live(_39) - _39 = transmute<*mut u8, usize>(copy raw_ptr_12) - switch move _39 { + storage_live(_14) + storage_live(self_15) + storage_live(self_16) + _33 = cast<*mut u8, *const u8>(copy raw_ptr_12) + storage_live(_34) + _34 = transmute<*mut u8, usize>(copy raw_ptr_12) + switch copy _34 { 0 : usize => { - storage_dead(_39) - storage_live(_60) - _60 = Option::None { } - self_18 = move _60 - storage_dead(ptr_19) - storage_live(v_42) - storage_live(_61) - _61 = AllocError { } - storage_live(_62) - _62 = Result::Err { 0: move _61 } - self_17 = move _62 - storage_dead(v_42) - storage_dead(self_18) - storage_live(v_43) - storage_dead(v_43) - storage_dead(self_17) - storage_live(_63) - _63 = AllocError { } - storage_live(_64) - _64 = Result::Err { 0: move _63 } - _0 = move _64 - storage_dead(_16) - return }, _ => { - }, - } - storage_dead(_39) - storage_live(_37) - storage_live(_41) - _41 = cast<*mut u8, *mut ()>(copy raw_ptr_12) - _40 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _41) - storage_dead(_41) - _37 = NonNull { pointer: copy _38 } - self_18 = Option::Some { 0: move _37 } - storage_dead(_37) - storage_dead(ptr_19) - storage_live(v_42) - v_42 = move (self_18 as variant Option::Some).0 - self_17 = Result::Ok { 0: copy v_42 } - storage_dead(v_42) - storage_dead(self_18) - storage_live(v_43) - v_43 = move (self_17 as variant Result::Ok).0 - _16 = ControlFlow::Continue { 0: copy v_43 } - storage_dead(v_43) - storage_dead(self_17) - ptr_20 = copy (_16 as variant ControlFlow::Continue).0 - storage_dead(_16) - if copy zeroed_5 { - storage_live(self_22) - storage_live(self_23) - self_23 = copy raw_ptr_12 - self_22 = copy raw_ptr_12 offset copy old_size_6 - storage_dead(self_23) - storage_live(count_24) - count_24 = copy new_size_10 wrap.- copy old_size_6 - if copy _36 { - storage_live(_45) - _45 = cast<*mut u8, *const ()>(copy self_22) + storage_dead(_34) + storage_live(_32) + storage_live(_54) + _54 = ub_checks + if move _54 { + storage_live(_36) + _36 = cast<*mut u8, *mut ()>(copy raw_ptr_12) + _35 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _36) + storage_dead(_36) + } else { + } + _32 = NonNull { pointer: copy _33 } + self_16 = Option::Some { 0: move _32 } + storage_dead(_32) + storage_live(v_37) + v_37 = move (self_16 as variant Option::Some).0 + self_15 = Result::Ok { 0: copy v_37 } + storage_dead(v_37) + storage_dead(self_16) + storage_live(v_38) + v_38 = move (self_15 as variant Result::Ok).0 + _14 = ControlFlow::Continue { 0: copy v_38 } + storage_dead(v_38) + storage_dead(self_15) + ptr_17 = copy (_14 as variant ControlFlow::Continue).0 + storage_dead(_14) + if copy zeroed_5 { + storage_live(self_19) + self_19 = copy raw_ptr_12 offset copy old_size_6 + storage_live(count_20) + count_20 = copy new_size_10 wrap.- copy old_size_6 + storage_live(_55) + _55 = ub_checks + if move _55 { + storage_live(_40) + _40 = cast<*mut u8, *const ()>(copy self_19) + storage_live(_41) + _41 = copy count_20 == const 0 : usize + _39 = core::ptr::write_bytes::precondition_check(move _40, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, move _41) + storage_dead(_41) + storage_dead(_40) + } else { + } + _18 = write_bytes[{built_in impl Sized for u8}](move self_19, const 0 : u8, move count_20) + storage_dead(count_20) + storage_dead(self_19) + } else { + } + storage_live(_21) + storage_live(ptr_42) + storage_live(data_43) + data_43 = transmute, *mut u8>(copy ptr_17) + ptr_42 = *mut (copy data_43, copy new_size_10) + storage_dead(data_43) storage_live(_46) - _46 = copy count_24 == const 0 : usize - _44 = core::ptr::write_bytes::precondition_check(move _45, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, move _46) + storage_live(_56) + _56 = ub_checks + if move _56 { + storage_live(_45) + _45 = transmute, *mut ()>(copy ptr_17) + _44 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _45) + storage_dead(_45) + } else { + } + _46 = cast<*mut [u8], *const [u8]>(copy ptr_42) + _21 = NonNull { pointer: copy _46 } storage_dead(_46) - storage_dead(_45) - } else { - } - _21 = write_bytes[{built_in impl Sized for u8}](move self_22, const 0 : u8, move count_24) - storage_dead(count_24) - storage_dead(self_22) - } else { - } - storage_live(_25) - storage_live(ptr_47) - storage_live(data_48) - data_48 = transmute, *mut u8>(copy ptr_20) - ptr_47 = *mut (copy data_48, copy new_size_10) - storage_dead(data_48) - storage_live(_51) - if copy _36 { - storage_live(_50) - _50 = transmute, *mut ()>(copy ptr_20) - _49 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _50) - storage_dead(_50) - } else { + storage_dead(ptr_42) + _0 = Result::Ok { 0: move _21 } + storage_dead(_21) + return + }, } - _51 = cast<*mut [u8], *const [u8]>(copy ptr_47) - _25 = NonNull { pointer: copy _51 } - storage_dead(_51) - storage_dead(ptr_47) - _0 = Result::Ok { 0: move _25 } - storage_dead(_25) + storage_dead(_34) + storage_live(_59) + _59 = Option::None { } + self_16 = move _59 + storage_live(v_37) + storage_live(_60) + _60 = AllocError { } + storage_live(_61) + _61 = Result::Err { 0: move _60 } + self_15 = move _61 + storage_dead(v_37) + storage_dead(self_16) + storage_live(v_38) + storage_dead(v_38) + storage_dead(self_15) + storage_live(_62) + _62 = AllocError { } + storage_live(_63) + _63 = Result::Err { 0: move _62 } + _0 = move _63 + storage_dead(_14) return }, } - _0 = alloc_impl<'20>(move self_1, move new_layout_4, move zeroed_5) + _0 = alloc_impl_runtime(move new_layout_4, move zeroed_5) return } -// Full name: alloc::alloc::{impl Allocator for Global}::shrink -pub unsafe fn {impl Allocator for Global}::shrink<'_0>(@1: &'_0 Global, @2: NonNull, @3: Layout, @4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +// Full name: alloc::alloc::{Global}::shrink_impl_runtime +fn shrink_impl_runtime<'_0>(@1: &'_0 Global, @2: NonNull, @3: Layout, @4: Layout, @5: bool) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] { let _0: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // return let self_1: &'1 Global; // arg #1 let ptr_2: NonNull; // arg #2 let old_layout_3: Layout; // arg #3 let new_layout_4: Layout; // arg #4 - let new_size_5: usize; // local - let _6: (); // anonymous local - let _7: NonNull<[u8]>; // anonymous local - let data_8: NonNull; // local - let _9: bool; // anonymous local - let _10: usize; // anonymous local + let _zeroed_5: bool; // arg #5 + let new_size_6: usize; // local + let _7: (); // anonymous local + let _8: NonNull<[u8]>; // anonymous local + let data_9: NonNull; // local + let _10: bool; // anonymous local let _11: usize; // anonymous local - let cond_12: bool; // local - let _13: usize; // anonymous local - let raw_ptr_14: *mut u8; // local - let ptr_15: *mut u8; // local - let self_16: NonNull; // local - let new_size_17: usize; // local - let _18: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull}]; // anonymous local - let self_19: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // local - let self_20: Option>[{built_in impl Sized for NonNull}]; // local - let ptr_21: *mut u8; // local - let ptr_22: NonNull; // local - let _23: NonNull<[u8]>; // anonymous local - let _24: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull<[u8]>>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull<[u8]>}]; // anonymous local - let self_25: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local - let new_ptr_26: NonNull<[u8]>; // local - let src_27: *const u8; // local - let ptr_28: *mut u8; // local - let dst_29: *mut u8; // local - let _30: (); // anonymous local - let _31: AlignmentEnum; // anonymous local + let _12: usize; // anonymous local + let cond_13: bool; // local + let _14: usize; // anonymous local + let raw_ptr_15: *mut u8; // local + let ptr_16: *mut u8; // local + let _17: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull}]; // anonymous local + let self_18: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // local + let self_19: Option>[{built_in impl Sized for NonNull}]; // local + let ptr_20: NonNull; // local + let _21: NonNull<[u8]>; // anonymous local + let _22: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull<[u8]>>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull<[u8]>}]; // anonymous local + let self_23: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local + let new_ptr_24: NonNull<[u8]>; // local + let src_25: *const u8; // local + let ptr_26: *mut u8; // local + let dst_27: *mut u8; // local + let _28: (); // anonymous local + let _29: Alignment; // anonymous local + let _30: usize; // anonymous local + let ptr_31: *mut u8; // local let _32: usize; // anonymous local - let ptr_33: *mut u8; // local - let _34: usize; // anonymous local - let _35: AlignmentEnum; // anonymous local - let _36: NonZero[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}]; // anonymous local - let _37: Alignment; // anonymous local - let _38: *const u8; // anonymous local - let ptr_39: *mut [u8]; // local - let data_40: *mut u8; // local - let _41: (); // anonymous local - let _42: *mut (); // anonymous local - let _43: *const [u8]; // anonymous local - let _44: bool; // anonymous local - let _45: AlignmentEnum; // anonymous local + let _33: Alignment; // anonymous local + let _34: Alignment; // anonymous local + let _35: *const u8; // anonymous local + let ptr_36: *mut [u8]; // local + let data_37: *mut u8; // local + let _38: (); // anonymous local + let _39: *mut (); // anonymous local + let _40: *const [u8]; // anonymous local + let _41: Alignment; // anonymous local + let _42: (); // anonymous local + let _43: NonNull; // anonymous local + let _44: *const u8; // anonymous local + let _45: usize; // anonymous local let _46: (); // anonymous local - let _47: bool; // anonymous local - let _48: NonNull; // anonymous local - let _49: *const u8; // anonymous local - let _50: usize; // anonymous local - let _51: (); // anonymous local - let _52: *mut (); // anonymous local - let v_53: NonNull; // local - let v_54: NonNull; // local - let ptr_55: *mut [u8]; // local - let data_56: *mut u8; // local + let _47: *mut (); // anonymous local + let v_48: NonNull; // local + let v_49: NonNull; // local + let ptr_50: *mut [u8]; // local + let data_51: *mut u8; // local + let _52: (); // anonymous local + let _53: *mut (); // anonymous local + let _54: *const [u8]; // anonymous local + let v_55: NonNull<[u8]>; // local + let _56: *mut [u8]; // anonymous local let _57: (); // anonymous local - let _58: *mut (); // anonymous local - let _59: *const [u8]; // anonymous local - let v_60: NonNull<[u8]>; // local - let _61: *mut [u8]; // anonymous local - let _62: (); // anonymous local - let _63: *const (); // anonymous local - let _64: *mut (); // anonymous local + let _58: *const (); // anonymous local + let _59: *mut (); // anonymous local + let _60: usize; // anonymous local + let _61: bool; // anonymous local + let _62: bool; // anonymous local + let _63: bool; // anonymous local + let _64: bool; // anonymous local let _65: bool; // anonymous local - let _66: usize; // anonymous local - let _67: AllocError; // anonymous local - let _68: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local - let _69: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull<[u8]>>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull<[u8]>}]; // anonymous local - let _70: Option>[{built_in impl Sized for NonNull}]; // anonymous local + let _66: AllocError; // anonymous local + let _67: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let _68: Option>[{built_in impl Sized for NonNull}]; // anonymous local + let _69: AllocError; // anonymous local + let _70: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local let _71: AllocError; // anonymous local let _72: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - let _73: AllocError; // anonymous local - let _74: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local - let _75: AllocError; // anonymous local - let _76: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - storage_live(new_size_5) - storage_live(_6) - storage_live(_10) - storage_live(_13) - storage_live(raw_ptr_14) - storage_live(ptr_22) - storage_live(new_ptr_26) - storage_live(ptr_28) - storage_live(_30) - storage_live(_31) - storage_live(_36) - storage_live(_41) + storage_live(new_size_6) + storage_live(_7) + storage_live(_11) + storage_live(_14) + storage_live(raw_ptr_15) + storage_live(ptr_20) + storage_live(new_ptr_24) + storage_live(ptr_26) + storage_live(_28) + storage_live(_29) + storage_live(_34) + storage_live(_38) + storage_live(_42) + storage_live(_44) storage_live(_46) - storage_live(_47) - storage_live(_49) - storage_live(_51) + storage_live(_52) + storage_live(_56) storage_live(_57) - storage_live(_61) - storage_live(_62) - new_size_5 = copy (new_layout_4).size - switch copy new_size_5 { + new_size_6 = copy (new_layout_4).size + switch copy new_size_6 { 0 : usize => { }, _ => { - storage_live(_9) - _31 = copy ((old_layout_3).align).0 - _10 = @discriminant(_31) - storage_live(_11) - storage_live(_45) - _45 = copy ((new_layout_4).align).0 - _11 = @discriminant(_45) - storage_dead(_45) - _9 = copy _10 == move _11 - if move _9 { - storage_dead(_11) - storage_dead(_9) - storage_live(cond_12) - _13 = copy (old_layout_3).size - cond_12 = copy new_size_5 <= copy _13 - _47 = ub_checks - if copy _47 { - _46 = core::hint::assert_unchecked::precondition_check(copy cond_12) - assert(copy cond_12 == true) else undefined_behavior - storage_dead(cond_12) - storage_live(ptr_15) - storage_live(self_16) - self_16 = copy ptr_2 - ptr_15 = transmute, *mut u8>(copy ptr_2) - storage_dead(self_16) - storage_live(new_size_17) - new_size_17 = copy new_size_5 - raw_ptr_14 = __rust_realloc(move ptr_15, move _13, move _10, copy new_size_5) - storage_dead(new_size_17) - storage_dead(ptr_15) - storage_live(_18) - storage_live(self_19) - storage_live(self_20) - storage_live(ptr_21) - ptr_21 = copy raw_ptr_14 - _49 = cast<*mut u8, *const u8>(copy raw_ptr_14) - storage_live(_50) - _50 = transmute<*mut u8, usize>(copy raw_ptr_14) - switch move _50 { - 0 : usize => { - storage_dead(_50) - storage_live(_70) - _70 = Option::None { } - self_20 = move _70 - }, - _ => { - storage_dead(_50) - storage_live(_48) - storage_live(_52) - _52 = cast<*mut u8, *mut ()>(copy raw_ptr_14) - _51 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _52) - storage_dead(_52) - _48 = NonNull { pointer: copy _49 } - self_20 = Option::Some { 0: move _48 } - storage_dead(_48) - }, - } - } else { - assert(copy cond_12 == true) else undefined_behavior - storage_dead(cond_12) - storage_live(ptr_15) - storage_live(self_16) - self_16 = copy ptr_2 - ptr_15 = transmute, *mut u8>(copy ptr_2) - storage_dead(self_16) - storage_live(new_size_17) - new_size_17 = copy new_size_5 - raw_ptr_14 = __rust_realloc(move ptr_15, move _13, move _10, copy new_size_5) - storage_dead(new_size_17) - storage_dead(ptr_15) - storage_live(_18) - storage_live(self_19) - storage_live(self_20) - storage_live(ptr_21) - ptr_21 = copy raw_ptr_14 - _49 = cast<*mut u8, *const u8>(copy raw_ptr_14) - storage_live(_50) - _50 = transmute<*mut u8, usize>(copy raw_ptr_14) - switch move _50 { - 0 : usize => { - storage_dead(_50) - storage_live(_70) - _70 = Option::None { } - self_20 = move _70 - }, - _ => { - storage_dead(_50) - storage_live(_48) - if copy _47 { - storage_live(_52) - _52 = cast<*mut u8, *mut ()>(copy raw_ptr_14) - _51 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _52) - storage_dead(_52) - } else { - } - _48 = NonNull { pointer: copy _49 } - self_20 = Option::Some { 0: move _48 } - storage_dead(_48) - }, - } - } - storage_dead(ptr_21) - storage_live(v_53) - match self_20 { - Option::None => { - storage_live(_73) - _73 = AllocError { } - storage_live(_74) - _74 = Result::Err { 0: move _73 } - self_19 = move _74 - storage_dead(v_53) - storage_dead(self_20) - storage_live(v_54) - match self_19 { - Result::Ok => { - v_54 = move (self_19 as variant Result::Ok).0 - _18 = ControlFlow::Continue { 0: copy v_54 } - storage_dead(v_54) - storage_dead(self_19) - ptr_22 = copy (_18 as variant ControlFlow::Continue).0 - storage_dead(_18) - storage_live(_23) - storage_live(ptr_55) - storage_live(data_56) - data_56 = transmute, *mut u8>(copy ptr_22) - ptr_55 = *mut (copy data_56, copy new_size_5) - storage_dead(data_56) - storage_live(_59) - if copy _47 { - storage_live(_58) - _58 = transmute, *mut ()>(copy ptr_22) - _57 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _58) - storage_dead(_58) - } else { - } - _59 = cast<*mut [u8], *const [u8]>(copy ptr_55) - _23 = NonNull { pointer: copy _59 } - storage_dead(_59) - storage_dead(ptr_55) - _0 = Result::Ok { 0: move _23 } - storage_dead(_23) - return - }, - Result::Err => { - storage_dead(v_54) - storage_dead(self_19) - storage_live(_75) - _75 = AllocError { } - storage_live(_76) - _76 = Result::Err { 0: move _75 } - _0 = move _76 - storage_dead(_18) - return - }, - } - }, - Option::Some => { - v_53 = move (self_20 as variant Option::Some).0 - self_19 = Result::Ok { 0: copy v_53 } - storage_dead(v_53) - storage_dead(self_20) - storage_live(v_54) - match self_19 { - Result::Ok => { - v_54 = move (self_19 as variant Result::Ok).0 - _18 = ControlFlow::Continue { 0: copy v_54 } - storage_dead(v_54) - storage_dead(self_19) - ptr_22 = copy (_18 as variant ControlFlow::Continue).0 - storage_dead(_18) - storage_live(_23) - storage_live(ptr_55) - storage_live(data_56) - data_56 = transmute, *mut u8>(copy ptr_22) - ptr_55 = *mut (copy data_56, copy new_size_5) - storage_dead(data_56) - storage_live(_59) - if copy _47 { - storage_live(_58) - _58 = transmute, *mut ()>(copy ptr_22) - _57 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _58) - storage_dead(_58) - } else { - } - _59 = cast<*mut [u8], *const [u8]>(copy ptr_55) - _23 = NonNull { pointer: copy _59 } - storage_dead(_59) - storage_dead(ptr_55) - _0 = Result::Ok { 0: move _23 } - storage_dead(_23) - return - }, - Result::Err => { - storage_dead(v_54) - storage_dead(self_19) - storage_live(_75) - _75 = AllocError { } - storage_live(_76) - _76 = Result::Err { 0: move _75 } - _0 = move _76 - storage_dead(_18) - return - }, - } - }, - } + storage_live(_10) + _29 = copy (old_layout_3).align + _11 = transmute(copy _29) + storage_live(_12) + storage_live(_41) + _41 = copy (new_layout_4).align + _12 = transmute(copy _41) + storage_dead(_41) + _10 = copy _11 == move _12 + if move _10 { } else { - storage_dead(_11) - storage_dead(_9) - storage_live(_24) - storage_live(self_25) - self_25 = alloc_impl<'23>(move self_1, move new_layout_4, const false) - storage_live(v_60) - match self_25 { + storage_dead(_12) + storage_dead(_10) + storage_live(_22) + storage_live(self_23) + self_23 = alloc_impl_runtime(move new_layout_4, const false) + storage_live(v_55) + match self_23 { Result::Ok => { - v_60 = move (self_25 as variant Result::Ok).0 - _24 = ControlFlow::Continue { 0: copy v_60 } - storage_dead(v_60) - storage_dead(self_25) - match _24 { - ControlFlow::Continue => { - new_ptr_26 = copy (_24 as variant ControlFlow::Continue).0 - storage_dead(_24) - storage_live(src_27) - ptr_28 = transmute, *mut u8>(copy ptr_2) - src_27 = transmute, *const u8>(copy ptr_2) - storage_live(dst_29) - _61 = transmute, *mut [u8]>(copy new_ptr_26) - dst_29 = cast<*mut [u8], *mut u8>(copy _61) - storage_live(_65) - _65 = ub_checks - if copy _65 { - storage_live(_63) - _63 = transmute, *const ()>(copy ptr_2) - storage_live(_64) - _64 = cast<*mut [u8], *mut ()>(copy _61) - _62 = core::ptr::copy_nonoverlapping::precondition_check(move _63, move _64, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::SIZE, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, copy new_size_5) - storage_dead(_64) - storage_dead(_63) - } else { - } - copy_nonoverlapping(copy src_27, copy dst_29, copy new_size_5) - storage_dead(_65) - storage_dead(dst_29) - storage_dead(src_27) - storage_live(_66) - _66 = copy (old_layout_3).size - switch move _66 { - 0 : usize => { - }, - _ => { - _30 = __rust_dealloc(move ptr_28, move _66, move _10) - }, - } - storage_dead(_66) - _0 = Result::Ok { 0: copy new_ptr_26 } - return - }, - ControlFlow::Break => { - storage_live(_71) - _71 = AllocError { } - storage_live(_72) - _72 = Result::Err { 0: move _71 } - _0 = move _72 - storage_dead(_24) - return - }, - } }, Result::Err => { + storage_dead(v_55) + storage_dead(self_23) + storage_live(_66) + _66 = AllocError { } storage_live(_67) - _67 = AllocError { } - storage_live(_68) - _68 = Result::Err { 0: move _67 } - storage_live(_69) - _69 = ControlFlow::Break { 0: move _68 } - _24 = move _69 - storage_dead(v_60) - storage_dead(self_25) - match _24 { - ControlFlow::Continue => { - new_ptr_26 = copy (_24 as variant ControlFlow::Continue).0 - storage_dead(_24) - storage_live(src_27) - ptr_28 = transmute, *mut u8>(copy ptr_2) - src_27 = transmute, *const u8>(copy ptr_2) - storage_live(dst_29) - _61 = transmute, *mut [u8]>(copy new_ptr_26) - dst_29 = cast<*mut [u8], *mut u8>(copy _61) - storage_live(_65) - _65 = ub_checks - if copy _65 { - storage_live(_63) - _63 = transmute, *const ()>(copy ptr_2) - storage_live(_64) - _64 = cast<*mut [u8], *mut ()>(copy _61) - _62 = core::ptr::copy_nonoverlapping::precondition_check(move _63, move _64, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::SIZE, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, copy new_size_5) - storage_dead(_64) - storage_dead(_63) - } else { - } - copy_nonoverlapping(copy src_27, copy dst_29, copy new_size_5) - storage_dead(_65) - storage_dead(dst_29) - storage_dead(src_27) - storage_live(_66) - _66 = copy (old_layout_3).size - switch move _66 { - 0 : usize => { - }, - _ => { - _30 = __rust_dealloc(move ptr_28, move _66, move _10) - }, - } - storage_dead(_66) - _0 = Result::Ok { 0: copy new_ptr_26 } - return - }, - ControlFlow::Break => { - storage_live(_71) - _71 = AllocError { } - storage_live(_72) - _72 = Result::Err { 0: move _71 } - _0 = move _72 - storage_dead(_24) - return - }, - } + _67 = Result::Err { 0: move _66 } + _0 = move _67 + storage_dead(_22) + return }, } + v_55 = move (self_23 as variant Result::Ok).0 + _22 = ControlFlow::Continue { 0: copy v_55 } + storage_dead(v_55) + storage_dead(self_23) + new_ptr_24 = copy (_22 as variant ControlFlow::Continue).0 + storage_dead(_22) + storage_live(src_25) + ptr_26 = transmute, *mut u8>(copy ptr_2) + src_25 = transmute, *const u8>(copy ptr_2) + storage_live(dst_27) + _56 = transmute, *mut [u8]>(copy new_ptr_24) + dst_27 = cast<*mut [u8], *mut u8>(copy _56) + storage_live(_63) + _63 = ub_checks + if move _63 { + storage_live(_58) + _58 = transmute, *const ()>(copy ptr_2) + storage_live(_59) + _59 = cast<*mut [u8], *mut ()>(copy _56) + _57 = core::ptr::copy_nonoverlapping::precondition_check(move _58, move _59, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::SIZE, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, copy new_size_6) + storage_dead(_59) + storage_dead(_58) + } else { + } + copy_nonoverlapping(copy src_25, copy dst_27, copy new_size_6) + storage_dead(dst_27) + storage_dead(src_25) + storage_live(_60) + _60 = copy (old_layout_3).size + switch copy _60 { + 0 : usize => { + }, + _ => { + _28 = __rust_dealloc(move ptr_26, move _60, move _11) + }, + } + storage_dead(_60) + _0 = Result::Ok { 0: copy new_ptr_24 } + return + } + storage_dead(_12) + storage_dead(_10) + storage_live(cond_13) + _14 = copy (old_layout_3).size + cond_13 = copy new_size_6 <= copy _14 + storage_live(_62) + _62 = ub_checks + if move _62 { + _42 = core::hint::assert_unchecked::precondition_check(copy cond_13) + } else { + } + assert(copy cond_13 == true) else undefined_behavior + storage_dead(cond_13) + storage_live(ptr_16) + ptr_16 = transmute, *mut u8>(copy ptr_2) + raw_ptr_15 = __rust_realloc(move ptr_16, move _14, move _11, copy new_size_6) + storage_dead(ptr_16) + storage_live(_17) + storage_live(self_18) + storage_live(self_19) + _44 = cast<*mut u8, *const u8>(copy raw_ptr_15) + storage_live(_45) + _45 = transmute<*mut u8, usize>(copy raw_ptr_15) + switch copy _45 { + 0 : usize => { + }, + _ => { + storage_dead(_45) + storage_live(_43) + storage_live(_64) + _64 = ub_checks + if move _64 { + storage_live(_47) + _47 = cast<*mut u8, *mut ()>(copy raw_ptr_15) + _46 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _47) + storage_dead(_47) + } else { + } + _43 = NonNull { pointer: copy _44 } + self_19 = Option::Some { 0: move _43 } + storage_dead(_43) + storage_live(v_48) + v_48 = move (self_19 as variant Option::Some).0 + self_18 = Result::Ok { 0: copy v_48 } + storage_dead(v_48) + storage_dead(self_19) + storage_live(v_49) + v_49 = move (self_18 as variant Result::Ok).0 + _17 = ControlFlow::Continue { 0: copy v_49 } + storage_dead(v_49) + storage_dead(self_18) + ptr_20 = copy (_17 as variant ControlFlow::Continue).0 + storage_dead(_17) + storage_live(_21) + storage_live(ptr_50) + storage_live(data_51) + data_51 = transmute, *mut u8>(copy ptr_20) + ptr_50 = *mut (copy data_51, copy new_size_6) + storage_dead(data_51) + storage_live(_54) + storage_live(_65) + _65 = ub_checks + if move _65 { + storage_live(_53) + _53 = transmute, *mut ()>(copy ptr_20) + _52 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _53) + storage_dead(_53) + } else { + } + _54 = cast<*mut [u8], *const [u8]>(copy ptr_50) + _21 = NonNull { pointer: copy _54 } + storage_dead(_54) + storage_dead(ptr_50) + _0 = Result::Ok { 0: move _21 } + storage_dead(_21) + return + }, } - undefined_behavior + storage_dead(_45) + storage_live(_68) + _68 = Option::None { } + self_19 = move _68 + storage_live(v_48) + storage_live(_69) + _69 = AllocError { } + storage_live(_70) + _70 = Result::Err { 0: move _69 } + self_18 = move _70 + storage_dead(v_48) + storage_dead(self_19) + storage_live(v_49) + storage_dead(v_49) + storage_dead(self_18) + storage_live(_71) + _71 = AllocError { } + storage_live(_72) + _72 = Result::Err { 0: move _71 } + _0 = move _72 + storage_dead(_17) + return }, } - storage_live(_32) - _32 = copy (old_layout_3).size - switch move _32 { + storage_live(_30) + _30 = copy (old_layout_3).size + switch copy _30 { 0 : usize => { }, _ => { - storage_live(ptr_33) - ptr_33 = transmute, *mut u8>(copy ptr_2) - storage_live(_34) - storage_live(_35) - _35 = copy ((old_layout_3).align).0 - _34 = @discriminant(_35) - storage_dead(_35) - _6 = __rust_dealloc(move ptr_33, move _32, move _34) - storage_dead(_34) - storage_dead(ptr_33) + storage_live(ptr_31) + ptr_31 = transmute, *mut u8>(copy ptr_2) + storage_live(_32) + storage_live(_33) + _33 = copy (old_layout_3).align + _32 = transmute(copy _33) + storage_dead(_33) + _7 = __rust_dealloc(move ptr_31, move _30, move _32) + storage_dead(_32) + storage_dead(ptr_31) }, } - storage_dead(_32) - storage_live(_7) - storage_live(data_8) - storage_live(_37) - _37 = copy (new_layout_4).align - _36 = transmute[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}]>(copy _37) - storage_dead(_37) - storage_live(_38) - _38 = transmute[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}], *const u8>(copy _36) - data_8 = NonNull { pointer: copy _38 } - storage_dead(_38) - storage_live(ptr_39) - storage_live(data_40) - data_40 = transmute[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}], *mut u8>(copy _36) - ptr_39 = *mut (copy data_40, const 0 : usize) - storage_dead(data_40) - storage_live(_43) - storage_live(_44) - _44 = ub_checks - if copy _44 { - storage_live(_42) - _42 = transmute[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}], *mut ()>(copy _36) - _41 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _42) - storage_dead(_42) + storage_dead(_30) + storage_live(_8) + storage_live(data_9) + _34 = copy (new_layout_4).align + storage_live(_35) + _35 = transmute(copy _34) + data_9 = NonNull { pointer: copy _35 } + storage_dead(_35) + storage_live(ptr_36) + storage_live(data_37) + data_37 = transmute(copy _34) + ptr_36 = *mut (copy data_37, const 0 : usize) + storage_dead(data_37) + storage_live(_40) + storage_live(_61) + _61 = ub_checks + if move _61 { + storage_live(_39) + _39 = transmute(copy _34) + _38 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _39) + storage_dead(_39) } else { } - _43 = cast<*mut [u8], *const [u8]>(copy ptr_39) - _7 = NonNull { pointer: copy _43 } - storage_dead(_44) - storage_dead(_43) - storage_dead(ptr_39) - storage_dead(data_8) - _0 = Result::Ok { 0: move _7 } - storage_dead(_7) + _40 = cast<*mut [u8], *const [u8]>(copy ptr_36) + _8 = NonNull { pointer: copy _40 } + storage_dead(_40) + storage_dead(ptr_36) + storage_dead(data_9) + _0 = Result::Ok { 0: move _8 } + storage_dead(_8) + return +} + +// Full name: alloc::alloc::{impl Allocator for Global}::shrink +pub unsafe fn {impl Allocator for Global}::shrink<'_0>(@1: &'_0 Global, @2: NonNull, @3: Layout, @4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +{ + let _0: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // return + let self_1: &'1 Global; // arg #1 + let ptr_2: NonNull; // arg #2 + let old_layout_3: Layout; // arg #3 + let new_layout_4: Layout; // arg #4 + + _0 = shrink_impl_runtime<'3>(move self_1, move ptr_2, move old_layout_3, move new_layout_4, const false) return } @@ -3063,7 +2638,7 @@ pub unsafe fn {impl Allocator for Global}::grow_zeroed<'_0>(@1: &'_0 Global, @2: let old_layout_3: Layout; // arg #3 let new_layout_4: Layout; // arg #4 - _0 = grow_impl<'3>(move self_1, move ptr_2, move old_layout_3, move new_layout_4, const true) + _0 = grow_impl_runtime<'3>(move self_1, move ptr_2, move old_layout_3, move new_layout_4, const true) return } @@ -3076,7 +2651,7 @@ pub unsafe fn {impl Allocator for Global}::grow<'_0>(@1: &'_0 Global, @2: NonNul let old_layout_3: Layout; // arg #3 let new_layout_4: Layout; // arg #4 - _0 = grow_impl<'3>(move self_1, move ptr_2, move old_layout_3, move new_layout_4, const false) + _0 = grow_impl_runtime<'3>(move self_1, move ptr_2, move old_layout_3, move new_layout_4, const false) return } @@ -3090,12 +2665,12 @@ pub unsafe fn {impl Allocator for Global}::deallocate<'_0>(@1: &'_0 Global, @2: let _4: usize; // anonymous local let ptr_5: *mut u8; // local let _6: usize; // anonymous local - let _7: AlignmentEnum; // anonymous local + let _7: Alignment; // anonymous local - storage_live(_4) _0 = () + storage_live(_4) _4 = copy (layout_3).size - switch move _4 { + switch copy _4 { 0 : usize => { }, _ => { @@ -3103,15 +2678,15 @@ pub unsafe fn {impl Allocator for Global}::deallocate<'_0>(@1: &'_0 Global, @2: ptr_5 = transmute, *mut u8>(copy ptr_2) storage_live(_6) storage_live(_7) - _7 = copy ((layout_3).align).0 - _6 = @discriminant(_7) + _7 = copy (layout_3).align + _6 = transmute(copy _7) storage_dead(_7) _0 = __rust_dealloc(move ptr_5, move _4, move _6) storage_dead(_6) storage_dead(ptr_5) - return }, } + storage_dead(_4) return } @@ -3122,7 +2697,7 @@ pub fn {impl Allocator for Global}::allocate_zeroed<'_0>(@1: &'_0 Global, @2: La let self_1: &'1 Global; // arg #1 let layout_2: Layout; // arg #2 - _0 = alloc_impl<'3>(move self_1, move layout_2, const true) + _0 = alloc_impl_runtime(move layout_2, const true) return } @@ -3133,7 +2708,7 @@ pub fn {impl Allocator for Global}::allocate<'_0>(@1: &'_0 Global, @2: Layout) - let self_1: &'1 Global; // arg #1 let layout_2: Layout; // arg #2 - _0 = alloc_impl<'3>(move self_1, move layout_2, const false) + _0 = alloc_impl_runtime(move layout_2, const false) return } @@ -3162,16 +2737,6 @@ impl Allocator for Global { vtable: {impl Allocator for Global}::{vtable} } -fn UNIT_METADATA() -{ - let _0: (); // return - - _0 = () - return -} - -const UNIT_METADATA: () = @Fun0() - // Full name: alloc::alloc::handle_alloc_error::ct_error fn ct_error(@1: Layout) -> ! { @@ -3211,34 +2776,27 @@ unsafe fn exchange_malloc(@1: usize, @2: usize) -> *mut u8 let _4: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local let ptr_5: NonNull<[u8]>; // local let _6: !; // anonymous local - let _7: bool; // anonymous local - let _8: (); // anonymous local - let _9: Alignment; // anonymous local - let _10: *mut [u8]; // anonymous local - let _11: &'4 Global; // anonymous local - let _12: Global; // anonymous local + let _7: (); // anonymous local + let _8: Alignment; // anonymous local + let _9: *mut [u8]; // anonymous local + let _10: bool; // anonymous local storage_live(layout_3) storage_live(ptr_5) storage_live(_6) - storage_live(_8) storage_live(_7) - _7 = ub_checks - if move _7 { - _8 = core::alloc::layout::{Layout}::from_size_align_unchecked::precondition_check(copy size_1, copy align_2) + storage_live(_10) + _10 = ub_checks + if move _10 { + _7 = core::alloc::layout::{Layout}::from_size_align_unchecked::precondition_check(copy size_1, copy align_2) } else { } - storage_live(_11) - storage_live(_12) - _12 = Global { } - _11 = &_12 - storage_dead(_7) - storage_live(_9) - _9 = transmute(copy align_2) - layout_3 = Layout { size: copy size_1, align: move _9 } - storage_dead(_9) + storage_live(_8) + _8 = transmute(copy align_2) + layout_3 = Layout { size: copy size_1, align: move _8 } + storage_dead(_8) storage_live(_4) - _4 = alloc_impl<'1>(move _11, copy layout_3, const false) + _4 = alloc_impl_runtime(copy layout_3, const false) match _4 { Result::Ok => { }, @@ -3247,10 +2805,10 @@ unsafe fn exchange_malloc(@1: usize, @2: usize) -> *mut u8 }, } ptr_5 = copy (_4 as variant Result::Ok).0 - storage_live(_10) - _10 = transmute, *mut [u8]>(copy ptr_5) - _0 = cast<*mut [u8], *mut u8>(copy _10) - storage_dead(_10) + storage_live(_9) + _9 = transmute, *mut [u8]>(copy ptr_5) + _0 = cast<*mut [u8], *mut u8>(copy _9) + storage_dead(_9) storage_dead(_4) return } @@ -3339,7 +2897,7 @@ where storage_live(_6) storage_live(_7) _7 = ub_checks - if copy _7 { + if move _7 { storage_live(_5) _5 = cast<*mut T, *mut ()>(copy raw_1) _4 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _5) @@ -3348,7 +2906,6 @@ where } _6 = cast<*mut T, *const T>(copy raw_1) _3 = NonNull { pointer: copy _6 } - storage_dead(_7) storage_dead(_6) storage_live(_8) _8 = PhantomData { } diff --git a/charon/tests/ui/regressions/closure-inside-impl-with-bound-with-assoc-ty.out b/charon/tests/ui/regressions/closure-inside-impl-with-bound-with-assoc-ty.out index dce771bee..98b48eda5 100644 --- a/charon/tests/ui/regressions/closure-inside-impl-with-bound-with-assoc-ty.out +++ b/charon/tests/ui/regressions/closure-inside-impl-with-bound-with-assoc-ty.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/regressions/invalid-reconstruct-assert.out b/charon/tests/ui/regressions/invalid-reconstruct-assert.out index 5e10477c4..0073434be 100644 --- a/charon/tests/ui/regressions/invalid-reconstruct-assert.out +++ b/charon/tests/ui/regressions/invalid-reconstruct-assert.out @@ -17,7 +17,7 @@ pub fn {impl Ord for u32}::cmp<'_0, '_1>(@1: &'_0 u32, @2: &'_1 u32) -> Ordering pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::MetaSized @@ -47,7 +47,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce @@ -157,17 +157,19 @@ where let _31: usize; // anonymous local let _32: bool; // anonymous local let _33: usize; // anonymous local - let _34: bool; // anonymous local - let _35: i8; // anonymous local - let _36: *const T; // anonymous local - let _37: (); // anonymous local + let _34: i8; // anonymous local + let _35: *const T; // anonymous local + let _36: (); // anonymous local + let _37: usize; // anonymous local let _38: usize; // anonymous local - let _39: usize; // anonymous local - let _40: bool; // anonymous local - let _41: i8; // anonymous local - let _42: (); // anonymous local - let _43: (); // anonymous local - let _44: Result[{built_in impl Sized for usize}, {built_in impl Sized for usize}]; // anonymous local + let _39: i8; // anonymous local + let _40: (); // anonymous local + let _41: (); // anonymous local + let _42: bool; // anonymous local + let _43: bool; // anonymous local + let _44: bool; // anonymous local + let _45: bool; // anonymous local + let _46: Result[{built_in impl Sized for usize}, {built_in impl Sized for usize}]; // anonymous local bb0: { storage_live(base_5); @@ -177,26 +179,25 @@ where storage_live(_21); storage_live(result_25); storage_live(_30); - storage_live(_37); + storage_live(_36); + storage_live(_38); storage_live(_39); storage_live(_40); storage_live(_41); - storage_live(_42); - storage_live(_43); storage_live(size_3); size_3 = copy self_1.metadata; storage_live(_4); _4 = copy size_3; - switch move _4 -> 0 : usize: bb1, otherwise: bb2; + switch copy _4 -> 0 : usize: bb1, otherwise: bb2; } bb1: { storage_dead(_4); - storage_live(_44); - _44 = Result::Err { 0: const 0 : usize }; - _0 = move _44; + storage_live(_46); + _46 = Result::Err { 0: const 0 : usize }; + _0 = move _46; storage_dead(size_3); - drop[{built_in impl Destruct for F}] f_2 -> bb34 (unwind: bb3); + drop[{built_in impl Destruct for F}] f_2 -> bb31 (unwind: bb3); } bb2: { @@ -232,9 +233,9 @@ where _13 = &mut f_2; storage_live(_14); storage_live(_29); - storage_live(_34); - _34 = ub_checks; - if copy _34 -> bb7 else -> bb8; + storage_live(_42); + _42 = ub_checks; + if move _42 -> bb7 else -> bb8; } bb6: { @@ -246,9 +247,10 @@ where storage_live(_20); storage_live(index_22); index_22 = copy base_5; - storage_live(_36); - _40 = ub_checks; - if copy _40 -> bb9 else -> bb10; + storage_live(_35); + storage_live(_43); + _43 = ub_checks; + if move _43 -> bb9 else -> bb10; } bb7: { @@ -266,7 +268,6 @@ where assert(move _32 == true) else undefined_behavior; storage_dead(_32); _29 = &raw const (*self_1)[copy mid_10]; - storage_dead(_34); _15 = &(*_29); storage_dead(_29); _14 = (copy _15,); @@ -274,16 +275,16 @@ where } bb9: { - storage_live(_38); - _38 = copy self_1.metadata; - _37 = {impl SliceIndex<[T]> for usize}::get_unchecked::precondition_check(copy index_22, move _38) -> bb16 (unwind: bb15); + storage_live(_37); + _37 = copy self_1.metadata; + _36 = {impl SliceIndex<[T]> for usize}::get_unchecked::precondition_check(copy index_22, move _37) -> bb16 (unwind: bb15); } bb10: { - _39 = copy self_1.metadata; - _36 = &raw const (*self_1)[copy index_22]; - _21 = &(*_36); - storage_dead(_36); + _38 = copy self_1.metadata; + _35 = &raw const (*self_1)[copy index_22]; + _21 = &(*_35); + storage_dead(_35); storage_dead(index_22); _20 = (copy _21,); cmp_18 = @TraitClause2::call_mut<'24>(move _19, move _20) -> bb17 (unwind: bb13); @@ -307,10 +308,10 @@ where storage_dead(_13); storage_live(_16); storage_live(_17); - storage_live(_35); - _35 = @discriminant(cmp_12); - _17 = copy _35 == const 1 : i8; - storage_dead(_35); + storage_live(_34); + _34 = @discriminant(cmp_12); + _17 = copy _34 == const 1 : i8; + storage_dead(_34); _16 = select_unpredictable[{built_in impl Sized for usize}, {built_in impl Destruct for usize}](move _17, move base_5, move mid_10) -> bb20 (unwind: bb13); } @@ -319,21 +320,15 @@ where } bb16: { - storage_dead(_38); - _39 = copy self_1.metadata; - _36 = &raw const (*self_1)[copy index_22]; - _21 = &(*_36); - storage_dead(_36); - storage_dead(index_22); - _20 = (copy _21,); - cmp_18 = @TraitClause2::call_mut<'29>(move _19, move _20) -> bb21 (unwind: bb13); + storage_dead(_37); + goto bb10; } bb17: { storage_dead(_20); storage_dead(_19); - _41 = @discriminant(cmp_18); - switch move _41 -> 0 : i8: bb22, otherwise: bb23; + _39 = @discriminant(cmp_18); + switch copy _39 -> 0 : i8: bb21, otherwise: bb22; } bb18: { @@ -355,101 +350,76 @@ where } bb21: { - storage_dead(_20); - storage_dead(_19); - _41 = @discriminant(cmp_18); - switch move _41 -> 0 : i8: bb24, otherwise: bb25; - } - - bb22: { - storage_live(cond_23); - storage_live(_24); - _24 = copy base_5; - cond_23 = move _24 < copy _39; - storage_dead(_24); - if copy _40 -> bb26 else -> bb27; - } - - bb23: { - storage_live(_26); - storage_live(_27); - _27 = copy _41 == const -1 : i8; - _26 = cast(move _27); - storage_dead(_27); - result_25 = move base_5 wrap.+ move _26; - storage_dead(_26); - storage_live(cond_28); - cond_28 = copy result_25 <= copy _39; - if copy _40 -> bb28 else -> bb29; - } - - bb24: { storage_live(cond_23); storage_live(_24); _24 = copy base_5; - cond_23 = move _24 < copy _39; + cond_23 = move _24 < copy _38; storage_dead(_24); - goto bb26; + storage_live(_44); + _44 = ub_checks; + if move _44 -> bb23 else -> bb24; } - bb25: { + bb22: { storage_live(_26); storage_live(_27); - _27 = copy _41 == const -1 : i8; + _27 = copy _39 == const -1 : i8; _26 = cast(move _27); storage_dead(_27); result_25 = move base_5 wrap.+ move _26; storage_dead(_26); storage_live(cond_28); - cond_28 = copy result_25 <= copy _39; - goto bb28; + cond_28 = copy result_25 <= copy _38; + storage_live(_45); + _45 = ub_checks; + if move _45 -> bb25 else -> bb26; } - bb26: { - _42 = core::hint::assert_unchecked::precondition_check(copy cond_23) -> bb27 (unwind: bb30); + bb23: { + _40 = core::hint::assert_unchecked::precondition_check(copy cond_23) -> bb24 (unwind: bb27); } - bb27: { + bb24: { assert(copy cond_23 == true) else undefined_behavior; storage_dead(cond_23); _0 = Result::Ok { 0: move base_5 }; - goto bb31; + goto bb28; } - bb28: { - _43 = core::hint::assert_unchecked::precondition_check(copy cond_28) -> bb29 (unwind: bb32); + bb25: { + _41 = core::hint::assert_unchecked::precondition_check(copy cond_28) -> bb26 (unwind: bb29); } - bb29: { + bb26: { assert(copy cond_28 == true) else undefined_behavior; storage_dead(cond_28); _0 = Result::Err { 0: copy result_25 }; - goto bb31; + goto bb28; } - bb30: { + bb27: { undefined_behavior; } - bb31: { + bb28: { storage_dead(cmp_18); storage_dead(size_3); - drop[{built_in impl Destruct for F}] f_2 -> bb35 (unwind: bb33); + drop[{built_in impl Destruct for F}] f_2 -> bb32 (unwind: bb30); } - bb32: { + bb29: { undefined_behavior; } - bb33: { + bb30: { unwind_continue; } - bb34: { + bb31: { return; } - bb35: { + bb32: { return; } } diff --git a/charon/tests/ui/regressions/issue-1010-missing-lifetime.out b/charon/tests/ui/regressions/issue-1010-missing-lifetime.out index 1e4031c7a..f00107a9e 100644 --- a/charon/tests/ui/regressions/issue-1010-missing-lifetime.out +++ b/charon/tests/ui/regressions/issue-1010-missing-lifetime.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/result-unwrap.out b/charon/tests/ui/result-unwrap.out index b1cf1d0f5..77eab4ede 100644 --- a/charon/tests/ui/result-unwrap.out +++ b/charon/tests/ui/result-unwrap.out @@ -105,7 +105,7 @@ pub fn {impl Debug for u32}::fmt<'_0, '_1, '_2>(@1: &'_0 u32, @2: &'_1 mut Forma _4 = copy (((*f_2)).0).flags _3 = move _4 & copy DEBUG_LOWER_HEX_FLAG storage_dead(_4) - switch move _3 { + switch copy _3 { 0 : u32 => { }, _ => { @@ -120,7 +120,7 @@ pub fn {impl Debug for u32}::fmt<'_0, '_1, '_2>(@1: &'_0 u32, @2: &'_1 mut Forma _6 = copy (((*f_2)).0).flags _5 = move _6 & copy DEBUG_UPPER_HEX_FLAG storage_dead(_6) - switch move _5 { + switch copy _5 { 0 : u32 => { }, _ => { diff --git a/charon/tests/ui/rust-name-matcher-tests.out b/charon/tests/ui/rust-name-matcher-tests.out index e99f45abb..04e5fab0b 100644 --- a/charon/tests/ui/rust-name-matcher-tests.out +++ b/charon/tests/ui/rust-name-matcher-tests.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/rvalues.out b/charon/tests/ui/rvalues.out index e0ef169de..2722dfa7c 100644 --- a/charon/tests/ui/rvalues.out +++ b/charon/tests/ui/rvalues.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::mem::size_of @@ -554,7 +554,8 @@ where let _12: usize; // anonymous local let _13: usize; // anonymous local let _14: usize; // anonymous local - let _15: usize; // anonymous local + let _15: bool; // anonymous local + let _16: usize; // anonymous local storage_live(_9) storage_live(_12) @@ -563,13 +564,15 @@ where size_1 = size_of[@TraitClause0]() storage_live(align_2) align_2 = align_of[@TraitClause0]() - storage_live(_15) + storage_live(_16) // This is `const (false)` in the MIR we get, but `true` in const evaluation. - _15 = offset_of(Struct[@TraitClause0].b) + _16 = offset_of(Struct[@TraitClause0].b) storage_live(ub_3) - ub_3 = ub_checks + storage_live(_15) + _15 = ub_checks + ub_3 = move _15 storage_live(offset_4) - offset_4 = move _15 + offset_4 = move _16 storage_live(_5) storage_live(_6) storage_live(_7) diff --git a/charon/tests/ui/send_bound.out b/charon/tests/ui/send_bound.out index 6c1e611c3..e50f84a39 100644 --- a/charon/tests/ui/send_bound.out +++ b/charon/tests/ui/send_bound.out @@ -21,7 +21,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/simple/additions.out b/charon/tests/ui/simple/additions.out index 6f390dd42..0151200c4 100644 --- a/charon/tests/ui/simple/additions.out +++ b/charon/tests/ui/simple/additions.out @@ -5,7 +5,7 @@ pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::MetaSized diff --git a/charon/tests/ui/simple/assoc-constraint-on-assoc-ty.out b/charon/tests/ui/simple/assoc-constraint-on-assoc-ty.out index a8d8eedd6..674fea26b 100644 --- a/charon/tests/ui/simple/assoc-constraint-on-assoc-ty.out +++ b/charon/tests/ui/simple/assoc-constraint-on-assoc-ty.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/simple/assoc-type-with-fn-bound.out b/charon/tests/ui/simple/assoc-type-with-fn-bound.out index d36b19b24..b883a3628 100644 --- a/charon/tests/ui/simple/assoc-type-with-fn-bound.out +++ b/charon/tests/ui/simple/assoc-type-with-fn-bound.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/box-into-inner.out b/charon/tests/ui/simple/box-into-inner.out index 70ceff274..c405ecefd 100644 --- a/charon/tests/ui/simple/box-into-inner.out +++ b/charon/tests/ui/simple/box-into-inner.out @@ -21,18 +21,22 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) = +// Full name: core::ptr::alignment::Alignment +pub opaque type Alignment + // Full name: core::mem::SizedTypeProperties pub trait SizedTypeProperties { parent_clause0 : [@TraitClause0]: Sized const SIZE : usize const ALIGN : usize + const ALIGNMENT : Alignment const IS_ZST : bool const LAYOUT : Layout const MAX_SLICE_LEN : usize @@ -67,6 +71,18 @@ where [@TraitClause0]: SizedTypeProperties, = ALIGN() +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub fn ALIGNMENT() -> Alignment +where + [@TraitClause0]: SizedTypeProperties, += + +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub const ALIGNMENT: Alignment +where + [@TraitClause0]: SizedTypeProperties, + = ALIGNMENT() + // Full name: core::mem::SizedTypeProperties::IS_ZST pub fn IS_ZST() -> bool where @@ -111,6 +127,7 @@ where parent_clause0 = @TraitClause0 const SIZE = SIZE[{impl SizedTypeProperties for T}[@TraitClause0]] const ALIGN = ALIGN[{impl SizedTypeProperties for T}[@TraitClause0]] + const ALIGNMENT = ALIGNMENT[{impl SizedTypeProperties for T}[@TraitClause0]] const IS_ZST = IS_ZST[{impl SizedTypeProperties for T}[@TraitClause0]] const LAYOUT = LAYOUT[{impl SizedTypeProperties for T}[@TraitClause0]] const MAX_SLICE_LEN = MAX_SLICE_LEN[{impl SizedTypeProperties for T}[@TraitClause0]] diff --git a/charon/tests/ui/simple/box-new.out b/charon/tests/ui/simple/box-new.out index 562ba56c8..1f528bf44 100644 --- a/charon/tests/ui/simple/box-new.out +++ b/charon/tests/ui/simple/box-new.out @@ -58,7 +58,7 @@ where pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/builtin-drop-mono.out b/charon/tests/ui/simple/builtin-drop-mono.out index f75a2725f..7d795d0ba 100644 --- a/charon/tests/ui/simple/builtin-drop-mono.out +++ b/charon/tests/ui/simple/builtin-drop-mono.out @@ -25,7 +25,7 @@ pub opaque type String pub trait Destruct::<[String; 4 : usize]> { fn drop_in_place = core::marker::Destruct::drop_in_place::<[String; 4 : usize]> - vtable: core::marker::Destruct::{vtable}::<[String; 4 : usize]> + non-dyn-compatible } // Full name: core::marker::Destruct:: @@ -33,7 +33,7 @@ pub trait Destruct::<[String; 4 : usize]> pub trait Destruct:: { fn drop_in_place = core::marker::Destruct::drop_in_place:: - vtable: core::marker::Destruct::{vtable}:: + non-dyn-compatible } // Full name: core::marker::Destruct::<[String]> @@ -41,7 +41,7 @@ pub trait Destruct:: pub trait Destruct::<[String]> { fn drop_in_place = core::marker::Destruct::drop_in_place::<[String]> - vtable: core::marker::Destruct::{vtable}::<[String]> + non-dyn-compatible } // Full name: alloc::alloc::Global @@ -53,7 +53,7 @@ pub struct Global {} pub trait Destruct:: { fn drop_in_place = core::marker::Destruct::drop_in_place:: - vtable: core::marker::Destruct::{vtable}:: + non-dyn-compatible } fn UNIT_METADATA() @@ -137,7 +137,7 @@ impl Destruct:: { pub trait Destruct::[{built_in impl MetaSized::<[String]>}, {built_in impl Sized::}, {impl Destruct::<[String]>}::, {impl Destruct::}]> { fn drop_in_place = core::marker::Destruct::drop_in_place::[{built_in impl MetaSized::<[String]>}, {built_in impl Sized::}, {impl Destruct::<[String]>}::, {impl Destruct::}]> - vtable: core::marker::Destruct::{vtable}::[{built_in impl MetaSized::<[String]>}, {built_in impl Sized::}, {impl Destruct::<[String]>}::, {impl Destruct::}]> + non-dyn-compatible } // Full name: core::marker::Destruct::<(String, String)> @@ -145,7 +145,7 @@ pub trait Destruct::[{built_in impl MetaSized::<[Str pub trait Destruct::<(String, String)> { fn drop_in_place = core::marker::Destruct::drop_in_place::<(String, String)> - vtable: core::marker::Destruct::{vtable}::<(String, String)> + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place::<[String; 4 : usize]>(@1: *mut [String; 4 : usize]) diff --git a/charon/tests/ui/simple/builtin-drop.out b/charon/tests/ui/simple/builtin-drop.out index d3ef2d7f8..411d4c1b4 100644 --- a/charon/tests/ui/simple/builtin-drop.out +++ b/charon/tests/ui/simple/builtin-drop.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/call-inherent-method-with-trait-bound.out b/charon/tests/ui/simple/call-inherent-method-with-trait-bound.out index e54c04e6b..a786de9fe 100644 --- a/charon/tests/ui/simple/call-inherent-method-with-trait-bound.out +++ b/charon/tests/ui/simple/call-inherent-method-with-trait-bound.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/call-method-via-supertrait-bound.out b/charon/tests/ui/simple/call-method-via-supertrait-bound.out index cb44bca44..6363865f0 100644 --- a/charon/tests/ui/simple/call-method-via-supertrait-bound.out +++ b/charon/tests/ui/simple/call-method-via-supertrait-bound.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/simple/catch-unwind.out b/charon/tests/ui/simple/catch-unwind.out index 69096d95a..523ab2bc2 100644 --- a/charon/tests/ui/simple/catch-unwind.out +++ b/charon/tests/ui/simple/catch-unwind.out @@ -44,7 +44,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -55,7 +55,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/closure-capture-ref-by-move.out b/charon/tests/ui/simple/closure-capture-ref-by-move.out index 4663a66ae..b1699bcfc 100644 --- a/charon/tests/ui/simple/closure-capture-ref-by-move.out +++ b/charon/tests/ui/simple/closure-capture-ref-by-move.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/closure-fn.out b/charon/tests/ui/simple/closure-fn.out index 576229454..541648da7 100644 --- a/charon/tests/ui/simple/closure-fn.out +++ b/charon/tests/ui/simple/closure-fn.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/closure-fnmut.out b/charon/tests/ui/simple/closure-fnmut.out index eb7d99efd..3047aeeb1 100644 --- a/charon/tests/ui/simple/closure-fnmut.out +++ b/charon/tests/ui/simple/closure-fnmut.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/closure-fnonce.out b/charon/tests/ui/simple/closure-fnonce.out index c9706f5eb..2494473b6 100644 --- a/charon/tests/ui/simple/closure-fnonce.out +++ b/charon/tests/ui/simple/closure-fnonce.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::mem::drop diff --git a/charon/tests/ui/simple/closure-inside-impl.out b/charon/tests/ui/simple/closure-inside-impl.out index efcd98ec5..cc72be36a 100644 --- a/charon/tests/ui/simple/closure-inside-impl.out +++ b/charon/tests/ui/simple/closure-inside-impl.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/closure-inside-inline-const.out b/charon/tests/ui/simple/closure-inside-inline-const.out index 71e9ca9f8..0d9471978 100644 --- a/charon/tests/ui/simple/closure-inside-inline-const.out +++ b/charon/tests/ui/simple/closure-inside-inline-const.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::mem::size_of diff --git a/charon/tests/ui/simple/closure-uses-ambient-self-clause.out b/charon/tests/ui/simple/closure-uses-ambient-self-clause.out index a7fd8153e..5cb075d06 100644 --- a/charon/tests/ui/simple/closure-uses-ambient-self-clause.out +++ b/charon/tests/ui/simple/closure-uses-ambient-self-clause.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/closure-with-drops.out b/charon/tests/ui/simple/closure-with-drops.out index 5e5623b3d..018418168 100644 --- a/charon/tests/ui/simple/closure-with-drops.out +++ b/charon/tests/ui/simple/closure-with-drops.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::mem::drop diff --git a/charon/tests/ui/simple/closure-with-non-upvar-lifetime.out b/charon/tests/ui/simple/closure-with-non-upvar-lifetime.out index 98dfa2b5e..f54ff5b7b 100644 --- a/charon/tests/ui/simple/closure-with-non-upvar-lifetime.out +++ b/charon/tests/ui/simple/closure-with-non-upvar-lifetime.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/conditional-drop.out b/charon/tests/ui/simple/conditional-drop.out index 446e06e37..f616eeab5 100644 --- a/charon/tests/ui/simple/conditional-drop.out +++ b/charon/tests/ui/simple/conditional-drop.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/drop-cow.out b/charon/tests/ui/simple/drop-cow.out index 07f53c03f..d49dd6de7 100644 --- a/charon/tests/ui/simple/drop-cow.out +++ b/charon/tests/ui/simple/drop-cow.out @@ -5,7 +5,7 @@ pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::MetaSized diff --git a/charon/tests/ui/simple/drop-glue-with-const-generic-silenced.out b/charon/tests/ui/simple/drop-glue-with-const-generic-silenced.out index db5c78ac1..36954a498 100644 --- a/charon/tests/ui/simple/drop-glue-with-const-generic-silenced.out +++ b/charon/tests/ui/simple/drop-glue-with-const-generic-silenced.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/drop-glue-with-const-generic.out b/charon/tests/ui/simple/drop-glue-with-const-generic.out index f79028fc1..8f578c6d6 100644 --- a/charon/tests/ui/simple/drop-glue-with-const-generic.out +++ b/charon/tests/ui/simple/drop-glue-with-const-generic.out @@ -1,4 +1,4 @@ -error: internal compiler error: compiler/rustc_middle/src/ty/sty.rs:373:13: cannot find `K/#0` in param-env: ParamEnv { +error: internal compiler error: /rustc-dev/efc9e1b50cbf2cede7ebe25f0a1fc64fd8b3e942/compiler/rustc_middle/src/ty/sty.rs:352:13: cannot find `K/#0` in param-env: ParamEnv { caller_bounds: [ Binder { value: HostEffectPredicate { trait_ref: , constness: Maybe }, bound_vars: [] }, Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] }, @@ -6,7 +6,7 @@ error: internal compiler error: compiler/rustc_middle/src/ty/sty.rs:373:13: cann } -thread 'rustc' panicked at compiler/rustc_middle/src/ty/sty.rs:373:13: +thread 'rustc' panicked at /rustc-dev/efc9e1b50cbf2cede7ebe25f0a1fc64fd8b3e942/compiler/rustc_middle/src/ty/sty.rs:352:13: Box note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: rustc panicked while retrieving drop glue. This is known to happen with `--precise-drops`; to silence this warning, pass `--opaque '{impl core::marker::Destruct for test_crate::PortableHash}'` to charon diff --git a/charon/tests/ui/simple/drop-string-desugar.out b/charon/tests/ui/simple/drop-string-desugar.out index f6ea501a9..3bedf0347 100644 --- a/charon/tests/ui/simple/drop-string-desugar.out +++ b/charon/tests/ui/simple/drop-string-desugar.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/drop-string.out b/charon/tests/ui/simple/drop-string.out index 5c0b9ad6d..0545a17b9 100644 --- a/charon/tests/ui/simple/drop-string.out +++ b/charon/tests/ui/simple/drop-string.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/dyn-broken-assoc-type-constraint.out b/charon/tests/ui/simple/dyn-broken-assoc-type-constraint.out index 71ef85e9c..95d711050 100644 --- a/charon/tests/ui/simple/dyn-broken-assoc-type-constraint.out +++ b/charon/tests/ui/simple/dyn-broken-assoc-type-constraint.out @@ -19,7 +19,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/simple/dyn-cast-to-supertrait.out b/charon/tests/ui/simple/dyn-cast-to-supertrait.out index 4789ab4fe..c118c9ab6 100644 --- a/charon/tests/ui/simple/dyn-cast-to-supertrait.out +++ b/charon/tests/ui/simple/dyn-cast-to-supertrait.out @@ -11,7 +11,7 @@ pub trait MetaSized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/dyn-fn.out b/charon/tests/ui/simple/dyn-fn.out index f3087ade3..8383f6c46 100644 --- a/charon/tests/ui/simple/dyn-fn.out +++ b/charon/tests/ui/simple/dyn-fn.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } opaque type core::ops::function::Fn::{vtable} diff --git a/charon/tests/ui/simple/gat-complex-lifetimes.out b/charon/tests/ui/simple/gat-complex-lifetimes.out index 9d7d6b9d9..fb99f95b9 100644 --- a/charon/tests/ui/simple/gat-complex-lifetimes.out +++ b/charon/tests/ui/simple/gat-complex-lifetimes.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/simple/gat-default.out b/charon/tests/ui/simple/gat-default.out index ab07f2761..f33ec1ebe 100644 --- a/charon/tests/ui/simple/gat-default.out +++ b/charon/tests/ui/simple/gat-default.out @@ -1,5 +1,5 @@ -thread 'rustc' panicked at /rustc-dev/94b49fd998d6723e0a9240a7cff5f9df37b84dd8/compiler/rustc_type_ir/src/binder.rs:781:9: +thread 'rustc' panicked at /rustc-dev/efc9e1b50cbf2cede7ebe25f0a1fc64fd8b3e942/compiler/rustc_type_ir/src/binder.rs:793:9: type parameter `U/#1` (U/#1/1) out of range when instantiating, args=[()] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: Hax panicked when translating `test_crate::{impl#0}`. @@ -9,7 +9,7 @@ error: Hax panicked when translating `test_crate::{impl#0}`. | ^^^^^^^^^^^^^^^^^^^^^^ -thread 'rustc' panicked at /rustc-dev/94b49fd998d6723e0a9240a7cff5f9df37b84dd8/compiler/rustc_type_ir/src/binder.rs:781:9: +thread 'rustc' panicked at /rustc-dev/efc9e1b50cbf2cede7ebe25f0a1fc64fd8b3e942/compiler/rustc_type_ir/src/binder.rs:793:9: type parameter `U/#1` (U/#1/1) out of range when instantiating, args=[()] error: Hax panicked when translating `test_crate::{impl#0}`. --> tests/ui/simple/gat-default.rs:9:1 diff --git a/charon/tests/ui/simple/gat-implied-clause.out b/charon/tests/ui/simple/gat-implied-clause.out index 48ec361a8..329324f43 100644 --- a/charon/tests/ui/simple/gat-implied-clause.out +++ b/charon/tests/ui/simple/gat-implied-clause.out @@ -33,7 +33,7 @@ where pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/simple/hello-world.out b/charon/tests/ui/simple/hello-world.out index dee6ddee8..4c966387c 100644 --- a/charon/tests/ui/simple/hello-world.out +++ b/charon/tests/ui/simple/hello-world.out @@ -9,7 +9,7 @@ pub opaque type String pub trait Destruct:: { fn drop_in_place = core::marker::Destruct::drop_in_place:: - vtable: core::marker::Destruct::{vtable}:: + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place::(@1: *mut String) diff --git a/charon/tests/ui/simple/hide-drops.out b/charon/tests/ui/simple/hide-drops.out index b6740e6c9..a1436351d 100644 --- a/charon/tests/ui/simple/hide-drops.out +++ b/charon/tests/ui/simple/hide-drops.out @@ -5,7 +5,7 @@ pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: {vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/impl-trait-in-arg.out b/charon/tests/ui/simple/impl-trait-in-arg.out index 7f345b2c6..9396682a1 100644 --- a/charon/tests/ui/simple/impl-trait-in-arg.out +++ b/charon/tests/ui/simple/impl-trait-in-arg.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/simple/lending-iterator-gat.out b/charon/tests/ui/simple/lending-iterator-gat.out index 3aedf5a96..18458aad3 100644 --- a/charon/tests/ui/simple/lending-iterator-gat.out +++ b/charon/tests/ui/simple/lending-iterator-gat.out @@ -21,7 +21,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -32,7 +32,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/lifetime-unification-from-trait-impl.out b/charon/tests/ui/simple/lifetime-unification-from-trait-impl.out index d3e46e1a0..a7fb76d4b 100644 --- a/charon/tests/ui/simple/lifetime-unification-from-trait-impl.out +++ b/charon/tests/ui/simple/lifetime-unification-from-trait-impl.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/simple/manual-drop-impl.out b/charon/tests/ui/simple/manual-drop-impl.out index 68b8b8708..9adf7096c 100644 --- a/charon/tests/ui/simple/manual-drop-impl.out +++ b/charon/tests/ui/simple/manual-drop-impl.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/method-with-assoc-type-constraint.out b/charon/tests/ui/simple/method-with-assoc-type-constraint.out index 41bf454a7..43aeab319 100644 --- a/charon/tests/ui/simple/method-with-assoc-type-constraint.out +++ b/charon/tests/ui/simple/method-with-assoc-type-constraint.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/simple/min.out b/charon/tests/ui/simple/min.out index 2526d7814..03cf49920 100644 --- a/charon/tests/ui/simple/min.out +++ b/charon/tests/ui/simple/min.out @@ -5,7 +5,7 @@ pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::MetaSized diff --git a/charon/tests/ui/simple/nested-closure-lifetime.out b/charon/tests/ui/simple/nested-closure-lifetime.out index d0ea05804..f24a09de5 100644 --- a/charon/tests/ui/simple/nested-closure-lifetime.out +++ b/charon/tests/ui/simple/nested-closure-lifetime.out @@ -33,7 +33,7 @@ where pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -44,7 +44,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/nested-closure-trait-ref.out b/charon/tests/ui/simple/nested-closure-trait-ref.out index 323dae2e0..fcf214c91 100644 --- a/charon/tests/ui/simple/nested-closure-trait-ref.out +++ b/charon/tests/ui/simple/nested-closure-trait-ref.out @@ -33,7 +33,7 @@ where pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -44,7 +44,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/nested-closure.out b/charon/tests/ui/simple/nested-closure.out index 5a639e71d..7380a04dc 100644 --- a/charon/tests/ui/simple/nested-closure.out +++ b/charon/tests/ui/simple/nested-closure.out @@ -33,7 +33,7 @@ where pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -44,7 +44,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/non-lifetime-gats.out b/charon/tests/ui/simple/non-lifetime-gats.out index a51712552..7b9dcc9ef 100644 --- a/charon/tests/ui/simple/non-lifetime-gats.out +++ b/charon/tests/ui/simple/non-lifetime-gats.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/pass-higher-kinded-fn-item-as-closure.out b/charon/tests/ui/simple/pass-higher-kinded-fn-item-as-closure.out index 88c5c966b..858da99fd 100644 --- a/charon/tests/ui/simple/pass-higher-kinded-fn-item-as-closure.out +++ b/charon/tests/ui/simple/pass-higher-kinded-fn-item-as-closure.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place @@ -29,7 +29,7 @@ unsafe fn drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/pointee_metadata.out b/charon/tests/ui/simple/pointee_metadata.out index 9f11ef1f7..8781e2a8a 100644 --- a/charon/tests/ui/simple/pointee_metadata.out +++ b/charon/tests/ui/simple/pointee_metadata.out @@ -206,7 +206,7 @@ pub trait Pointee parent_clause7 : [@TraitClause7]: Unpin parent_clause8 : [@TraitClause8]: Freeze type Metadata - vtable: core::ptr::metadata::Pointee::{vtable} + non-dyn-compatible } // Full name: core::ptr::const_ptr::{*const T}::to_raw_parts diff --git a/charon/tests/ui/simple/promoted-closure-no-warns.out b/charon/tests/ui/simple/promoted-closure-no-warns.out index ff7b1d480..388f4b139 100644 --- a/charon/tests/ui/simple/promoted-closure-no-warns.out +++ b/charon/tests/ui/simple/promoted-closure-no-warns.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/promoted-closure.out b/charon/tests/ui/simple/promoted-closure.out index ff7b1d480..388f4b139 100644 --- a/charon/tests/ui/simple/promoted-closure.out +++ b/charon/tests/ui/simple/promoted-closure.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/promoted_in_closure.out b/charon/tests/ui/simple/promoted_in_closure.out index dfb5a2138..14edd7f32 100644 --- a/charon/tests/ui/simple/promoted_in_closure.out +++ b/charon/tests/ui/simple/promoted_in_closure.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/simple/ptr_metadata.out b/charon/tests/ui/simple/ptr_metadata.out index 1e7c28a31..5aebff7c9 100644 --- a/charon/tests/ui/simple/ptr_metadata.out +++ b/charon/tests/ui/simple/ptr_metadata.out @@ -263,7 +263,7 @@ pub trait Pointee parent_clause7 : [@TraitClause7]: Unpin parent_clause8 : [@TraitClause8]: Freeze type Metadata - vtable: core::ptr::metadata::Pointee::{vtable} + non-dyn-compatible } // Full name: core::ptr::metadata::Thin @@ -272,7 +272,7 @@ where Self::parent_clause0::Metadata = (), { parent_clause0 : [@TraitClause0]: Pointee - vtable: core::ptr::metadata::Thin::{vtable}<()> + non-dyn-compatible } // Full name: core::ptr::metadata::Thin::{impl Thin for Self} diff --git a/charon/tests/ui/simple/single-variant-enum-drop-glue.out b/charon/tests/ui/simple/single-variant-enum-drop-glue.out index 52b9e8c82..a43ab6fad 100644 --- a/charon/tests/ui/simple/single-variant-enum-drop-glue.out +++ b/charon/tests/ui/simple/single-variant-enum-drop-glue.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/slice_index_range.out b/charon/tests/ui/simple/slice_index_range.out index fa09ee542..6f53ddb3f 100644 --- a/charon/tests/ui/simple/slice_index_range.out +++ b/charon/tests/ui/simple/slice_index_range.out @@ -55,17 +55,419 @@ pub struct Arguments<'a> { args: NonNull>, } -fn core::slice::index::slice_index_fail::do_panic::runtime(@1: usize, @2: usize) -> ! +// Full name: core::fmt::num::imp::{impl Display for usize}::fmt +pub fn {impl Display for usize}::fmt<'_0, '_1, '_2>(@1: &'_0 usize, @2: &'_1 mut Formatter<'_2>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}] = +fn UNIT_METADATA() +{ + let _0: (); // return + + _0 = () + return +} + +const UNIT_METADATA: () = @Fun0() + +fn core::slice::index::slice_index_fail::do_panic::runtime(@1: usize, @2: usize) -> ! +{ + let _0: !; // return + let start_1: usize; // arg #1 + let len_2: usize; // arg #2 + let _3: Arguments<'1>; // anonymous local + let args_4: &'3 usize; // local + let args_5: &'4 usize; // local + let args_6: [Argument<'7>; 2 : usize]; // local + let _7: Argument<'8>; // anonymous local + let _8: Argument<'9>; // anonymous local + let args_9: &'12 [Argument<'13>; 2 : usize]; // local + let _10: ArgumentType<'15>; // anonymous local + let _11: NonNull<()>; // anonymous local + let _12: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _13: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _14: *const usize; // anonymous local + let _15: *const (); // anonymous local + let _16: ArgumentType<'16>; // anonymous local + let _17: NonNull<()>; // anonymous local + let _18: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _19: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _20: *const usize; // anonymous local + let _21: *const (); // anonymous local + let _22: NonNull; // anonymous local + let _23: NonNull>; // anonymous local + let _24: PhantomData<&'30 ()>; // anonymous local + let _25: PhantomData<&'39 ()>; // anonymous local + let _26: [u8; 57 : usize]; // anonymous local + let _27: &'44 [u8; 57 : usize]; // anonymous local + + storage_live(args_4) + storage_live(args_5) + storage_live(args_9) + storage_live(_3) + args_4 = &start_1 + args_5 = &len_2 + storage_live(args_6) + storage_live(_7) + storage_live(_13) + storage_live(_14) + storage_live(_10) + storage_live(_11) + _14 = &raw const (*args_4) + storage_live(_15) + _15 = cast<*const usize, *const ()>(copy _14) + _11 = NonNull { pointer: copy _15 } + storage_dead(_15) + storage_live(_12) + _13 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'25, '26, '27>) + _12 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _13) + storage_live(_24) + _24 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _24 } + storage_dead(_12) + storage_dead(_11) + _7 = Argument { ty: move _10 } + storage_dead(_10) + storage_dead(_14) + storage_dead(_13) + storage_live(_8) + storage_live(_19) + storage_live(_20) + storage_live(_16) + storage_live(_17) + _20 = &raw const (*args_5) + storage_live(_21) + _21 = cast<*const usize, *const ()>(copy _20) + _17 = NonNull { pointer: copy _21 } + storage_dead(_21) + storage_live(_18) + _19 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'36, '37, '38>) + _18 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _19) + storage_live(_25) + _25 = PhantomData { } + _16 = ArgumentType::Placeholder { value: move _17, formatter: copy _18, _lifetime: move _25 } + storage_dead(_18) + storage_dead(_17) + _8 = Argument { ty: move _16 } + storage_dead(_16) + storage_dead(_20) + storage_dead(_19) + args_6 = [move _7, move _8] + storage_dead(_8) + storage_dead(_7) + args_9 = &args_6 + storage_live(_22) + storage_live(_26) + _26 = [const 18 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 115 : u8, const 116 : u8, const 97 : u8, const 114 : u8, const 116 : u8, const 32 : u8, const 105 : u8, const 110 : u8, const 100 : u8, const 101 : u8, const 120 : u8, const 32 : u8, const 192 : u8, const 34 : u8, const 32 : u8, const 111 : u8, const 117 : u8, const 116 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 102 : u8, const 111 : u8, const 114 : u8, const 32 : u8, const 115 : u8, const 108 : u8, const 105 : u8, const 99 : u8, const 101 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 108 : u8, const 101 : u8, const 110 : u8, const 103 : u8, const 116 : u8, const 104 : u8, const 32 : u8, const 192 : u8, const 0 : u8] + storage_live(_27) + _27 = &_26 + _22 = transmute<&'44 [u8; 57 : usize], NonNull>(move _27) + storage_live(_23) + _23 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { template: move _22, args: move _23 } + storage_dead(_23) + storage_dead(_22) + panic(core::panicking::panic_fmt) +} + fn core::slice::index::slice_index_fail::do_panic#1::runtime(@1: usize, @2: usize) -> ! -= +{ + let _0: !; // return + let end_1: usize; // arg #1 + let len_2: usize; // arg #2 + let _3: Arguments<'1>; // anonymous local + let args_4: &'3 usize; // local + let args_5: &'4 usize; // local + let args_6: [Argument<'7>; 2 : usize]; // local + let _7: Argument<'8>; // anonymous local + let _8: Argument<'9>; // anonymous local + let args_9: &'12 [Argument<'13>; 2 : usize]; // local + let _10: ArgumentType<'15>; // anonymous local + let _11: NonNull<()>; // anonymous local + let _12: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _13: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _14: *const usize; // anonymous local + let _15: *const (); // anonymous local + let _16: ArgumentType<'16>; // anonymous local + let _17: NonNull<()>; // anonymous local + let _18: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _19: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _20: *const usize; // anonymous local + let _21: *const (); // anonymous local + let _22: NonNull; // anonymous local + let _23: NonNull>; // anonymous local + let _24: PhantomData<&'30 ()>; // anonymous local + let _25: PhantomData<&'39 ()>; // anonymous local + let _26: [u8; 55 : usize]; // anonymous local + let _27: &'44 [u8; 55 : usize]; // anonymous local + + storage_live(args_4) + storage_live(args_5) + storage_live(args_9) + storage_live(_3) + args_4 = &end_1 + args_5 = &len_2 + storage_live(args_6) + storage_live(_7) + storage_live(_13) + storage_live(_14) + storage_live(_10) + storage_live(_11) + _14 = &raw const (*args_4) + storage_live(_15) + _15 = cast<*const usize, *const ()>(copy _14) + _11 = NonNull { pointer: copy _15 } + storage_dead(_15) + storage_live(_12) + _13 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'25, '26, '27>) + _12 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _13) + storage_live(_24) + _24 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _24 } + storage_dead(_12) + storage_dead(_11) + _7 = Argument { ty: move _10 } + storage_dead(_10) + storage_dead(_14) + storage_dead(_13) + storage_live(_8) + storage_live(_19) + storage_live(_20) + storage_live(_16) + storage_live(_17) + _20 = &raw const (*args_5) + storage_live(_21) + _21 = cast<*const usize, *const ()>(copy _20) + _17 = NonNull { pointer: copy _21 } + storage_dead(_21) + storage_live(_18) + _19 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'36, '37, '38>) + _18 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _19) + storage_live(_25) + _25 = PhantomData { } + _16 = ArgumentType::Placeholder { value: move _17, formatter: copy _18, _lifetime: move _25 } + storage_dead(_18) + storage_dead(_17) + _8 = Argument { ty: move _16 } + storage_dead(_16) + storage_dead(_20) + storage_dead(_19) + args_6 = [move _7, move _8] + storage_dead(_8) + storage_dead(_7) + args_9 = &args_6 + storage_live(_22) + storage_live(_26) + _26 = [const 16 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 101 : u8, const 110 : u8, const 100 : u8, const 32 : u8, const 105 : u8, const 110 : u8, const 100 : u8, const 101 : u8, const 120 : u8, const 32 : u8, const 192 : u8, const 34 : u8, const 32 : u8, const 111 : u8, const 117 : u8, const 116 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 102 : u8, const 111 : u8, const 114 : u8, const 32 : u8, const 115 : u8, const 108 : u8, const 105 : u8, const 99 : u8, const 101 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 108 : u8, const 101 : u8, const 110 : u8, const 103 : u8, const 116 : u8, const 104 : u8, const 32 : u8, const 192 : u8, const 0 : u8] + storage_live(_27) + _27 = &_26 + _22 = transmute<&'44 [u8; 55 : usize], NonNull>(move _27) + storage_live(_23) + _23 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { template: move _22, args: move _23 } + storage_dead(_23) + storage_dead(_22) + panic(core::panicking::panic_fmt) +} fn core::slice::index::slice_index_fail::do_panic#2::runtime(@1: usize, @2: usize) -> ! -= +{ + let _0: !; // return + let start_1: usize; // arg #1 + let end_2: usize; // arg #2 + let _3: Arguments<'1>; // anonymous local + let args_4: &'3 usize; // local + let args_5: &'4 usize; // local + let args_6: [Argument<'7>; 2 : usize]; // local + let _7: Argument<'8>; // anonymous local + let _8: Argument<'9>; // anonymous local + let args_9: &'12 [Argument<'13>; 2 : usize]; // local + let _10: ArgumentType<'15>; // anonymous local + let _11: NonNull<()>; // anonymous local + let _12: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _13: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _14: *const usize; // anonymous local + let _15: *const (); // anonymous local + let _16: ArgumentType<'16>; // anonymous local + let _17: NonNull<()>; // anonymous local + let _18: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _19: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _20: *const usize; // anonymous local + let _21: *const (); // anonymous local + let _22: NonNull; // anonymous local + let _23: NonNull>; // anonymous local + let _24: PhantomData<&'30 ()>; // anonymous local + let _25: PhantomData<&'39 ()>; // anonymous local + let _26: [u8; 40 : usize]; // anonymous local + let _27: &'44 [u8; 40 : usize]; // anonymous local + + storage_live(args_4) + storage_live(args_5) + storage_live(args_9) + storage_live(_3) + args_4 = &start_1 + args_5 = &end_2 + storage_live(args_6) + storage_live(_7) + storage_live(_13) + storage_live(_14) + storage_live(_10) + storage_live(_11) + _14 = &raw const (*args_4) + storage_live(_15) + _15 = cast<*const usize, *const ()>(copy _14) + _11 = NonNull { pointer: copy _15 } + storage_dead(_15) + storage_live(_12) + _13 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'25, '26, '27>) + _12 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _13) + storage_live(_24) + _24 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _24 } + storage_dead(_12) + storage_dead(_11) + _7 = Argument { ty: move _10 } + storage_dead(_10) + storage_dead(_14) + storage_dead(_13) + storage_live(_8) + storage_live(_19) + storage_live(_20) + storage_live(_16) + storage_live(_17) + _20 = &raw const (*args_5) + storage_live(_21) + _21 = cast<*const usize, *const ()>(copy _20) + _17 = NonNull { pointer: copy _21 } + storage_dead(_21) + storage_live(_18) + _19 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'36, '37, '38>) + _18 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _19) + storage_live(_25) + _25 = PhantomData { } + _16 = ArgumentType::Placeholder { value: move _17, formatter: copy _18, _lifetime: move _25 } + storage_dead(_18) + storage_dead(_17) + _8 = Argument { ty: move _16 } + storage_dead(_16) + storage_dead(_20) + storage_dead(_19) + args_6 = [move _7, move _8] + storage_dead(_8) + storage_dead(_7) + args_9 = &args_6 + storage_live(_22) + storage_live(_26) + _26 = [const 22 : u8, const 115 : u8, const 108 : u8, const 105 : u8, const 99 : u8, const 101 : u8, const 32 : u8, const 105 : u8, const 110 : u8, const 100 : u8, const 101 : u8, const 120 : u8, const 32 : u8, const 115 : u8, const 116 : u8, const 97 : u8, const 114 : u8, const 116 : u8, const 115 : u8, const 32 : u8, const 97 : u8, const 116 : u8, const 32 : u8, const 192 : u8, const 13 : u8, const 32 : u8, const 98 : u8, const 117 : u8, const 116 : u8, const 32 : u8, const 101 : u8, const 110 : u8, const 100 : u8, const 115 : u8, const 32 : u8, const 97 : u8, const 116 : u8, const 32 : u8, const 192 : u8, const 0 : u8] + storage_live(_27) + _27 = &_26 + _22 = transmute<&'44 [u8; 40 : usize], NonNull>(move _27) + storage_live(_23) + _23 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { template: move _22, args: move _23 } + storage_dead(_23) + storage_dead(_22) + panic(core::panicking::panic_fmt) +} fn core::slice::index::slice_index_fail::do_panic#3::runtime(@1: usize, @2: usize) -> ! -= +{ + let _0: !; // return + let end_1: usize; // arg #1 + let len_2: usize; // arg #2 + let _3: Arguments<'1>; // anonymous local + let args_4: &'3 usize; // local + let args_5: &'4 usize; // local + let args_6: [Argument<'7>; 2 : usize]; // local + let _7: Argument<'8>; // anonymous local + let _8: Argument<'9>; // anonymous local + let args_9: &'12 [Argument<'13>; 2 : usize]; // local + let _10: ArgumentType<'15>; // anonymous local + let _11: NonNull<()>; // anonymous local + let _12: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _13: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _14: *const usize; // anonymous local + let _15: *const (); // anonymous local + let _16: ArgumentType<'16>; // anonymous local + let _17: NonNull<()>; // anonymous local + let _18: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _19: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _20: *const usize; // anonymous local + let _21: *const (); // anonymous local + let _22: NonNull; // anonymous local + let _23: NonNull>; // anonymous local + let _24: PhantomData<&'30 ()>; // anonymous local + let _25: PhantomData<&'39 ()>; // anonymous local + let _26: [u8; 55 : usize]; // anonymous local + let _27: &'44 [u8; 55 : usize]; // anonymous local + + storage_live(args_4) + storage_live(args_5) + storage_live(args_9) + storage_live(_3) + args_4 = &end_1 + args_5 = &len_2 + storage_live(args_6) + storage_live(_7) + storage_live(_13) + storage_live(_14) + storage_live(_10) + storage_live(_11) + _14 = &raw const (*args_4) + storage_live(_15) + _15 = cast<*const usize, *const ()>(copy _14) + _11 = NonNull { pointer: copy _15 } + storage_dead(_15) + storage_live(_12) + _13 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'25, '26, '27>) + _12 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _13) + storage_live(_24) + _24 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _24 } + storage_dead(_12) + storage_dead(_11) + _7 = Argument { ty: move _10 } + storage_dead(_10) + storage_dead(_14) + storage_dead(_13) + storage_live(_8) + storage_live(_19) + storage_live(_20) + storage_live(_16) + storage_live(_17) + _20 = &raw const (*args_5) + storage_live(_21) + _21 = cast<*const usize, *const ()>(copy _20) + _17 = NonNull { pointer: copy _21 } + storage_dead(_21) + storage_live(_18) + _19 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'36, '37, '38>) + _18 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _19) + storage_live(_25) + _25 = PhantomData { } + _16 = ArgumentType::Placeholder { value: move _17, formatter: copy _18, _lifetime: move _25 } + storage_dead(_18) + storage_dead(_17) + _8 = Argument { ty: move _16 } + storage_dead(_16) + storage_dead(_20) + storage_dead(_19) + args_6 = [move _7, move _8] + storage_dead(_8) + storage_dead(_7) + args_9 = &args_6 + storage_live(_22) + storage_live(_26) + _26 = [const 16 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 101 : u8, const 110 : u8, const 100 : u8, const 32 : u8, const 105 : u8, const 110 : u8, const 100 : u8, const 101 : u8, const 120 : u8, const 32 : u8, const 192 : u8, const 34 : u8, const 32 : u8, const 111 : u8, const 117 : u8, const 116 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 102 : u8, const 111 : u8, const 114 : u8, const 32 : u8, const 115 : u8, const 108 : u8, const 105 : u8, const 99 : u8, const 101 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 108 : u8, const 101 : u8, const 110 : u8, const 103 : u8, const 116 : u8, const 104 : u8, const 32 : u8, const 192 : u8, const 0 : u8] + storage_live(_27) + _27 = &_26 + _22 = transmute<&'44 [u8; 55 : usize], NonNull>(move _27) + storage_live(_23) + _23 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { template: move _22, args: move _23 } + storage_dead(_23) + storage_dead(_22) + panic(core::panicking::panic_fmt) +} // Full name: core::panicking::panic_nounwind_fmt::compiletime fn compiletime<'_0>(@1: Arguments<'_0>, @2: bool) -> ! @@ -620,49 +1022,48 @@ where let self_1: RangeInclusive[{built_in impl Sized for usize}]; // arg #1 let slice_2: *mut [T]; // arg #2 let exclusive_end_3: usize; // local - let _4: bool; // anonymous local - let _5: (); // anonymous local - let _6: usize; // anonymous local - let new_len_7: usize; // local + let _4: (); // anonymous local + let _5: usize; // anonymous local + let new_len_6: usize; // local + let _7: *mut T; // anonymous local let _8: *mut T; // anonymous local - let _9: *mut T; // anonymous local + let self_9: usize; // local let self_10: usize; // local - let self_11: usize; // local - let self_12: bool; // local + let self_11: bool; // local + let _12: bool; // anonymous local storage_live(exclusive_end_3) - storage_live(_5) + storage_live(_4) + storage_live(self_9) storage_live(self_10) storage_live(self_11) - storage_live(self_12) - self_10 = move (self_1).start - self_11 = move (self_1).end - self_12 = move (self_1).exhausted - exclusive_end_3 = copy self_11 wrap.+ const 1 : usize - if copy self_12 { - self_10 = copy exclusive_end_3 + self_9 = move (self_1).start + self_10 = move (self_1).end + self_11 = move (self_1).exhausted + exclusive_end_3 = copy self_10 wrap.+ const 1 : usize + if copy self_11 { + self_9 = copy exclusive_end_3 } else { } - storage_live(new_len_7) - storage_live(_4) - _4 = ub_checks - if move _4 { - storage_live(_6) - _6 = copy slice_2.metadata - _5 = {impl SliceIndex<[T]> for Range[{built_in impl Sized for usize}]}::get_unchecked_mut::precondition_check(copy self_10, copy exclusive_end_3, move _6) - storage_dead(_6) + storage_live(new_len_6) + storage_live(_12) + _12 = ub_checks + if move _12 { + storage_live(_5) + _5 = copy slice_2.metadata + _4 = {impl SliceIndex<[T]> for Range[{built_in impl Sized for usize}]}::get_unchecked_mut::precondition_check(copy self_9, copy exclusive_end_3, move _5) + storage_dead(_5) } else { } - storage_dead(_4) - new_len_7 = copy exclusive_end_3 ub.- copy self_10 + new_len_6 = copy exclusive_end_3 ub.- copy self_9 + storage_live(_7) storage_live(_8) - storage_live(_9) - _8 = cast<*mut [T], *mut T>(copy slice_2) - _9 = copy _8 offset copy self_10 - _0 = @PtrFromPartsMut<'_, [T]>(copy _9, copy new_len_7) - storage_dead(_9) + _7 = cast<*mut [T], *mut T>(copy slice_2) + _8 = copy _7 offset copy self_9 + _0 = @PtrFromPartsMut<'_, [T]>(copy _8, copy new_len_6) storage_dead(_8) - storage_dead(new_len_7) + storage_dead(_7) + storage_dead(new_len_6) return } @@ -742,49 +1143,48 @@ where let self_1: RangeInclusive[{built_in impl Sized for usize}]; // arg #1 let slice_2: *const [T]; // arg #2 let exclusive_end_3: usize; // local - let _4: bool; // anonymous local - let _5: (); // anonymous local - let _6: usize; // anonymous local - let new_len_7: usize; // local + let _4: (); // anonymous local + let _5: usize; // anonymous local + let new_len_6: usize; // local + let _7: *const T; // anonymous local let _8: *const T; // anonymous local - let _9: *const T; // anonymous local + let self_9: usize; // local let self_10: usize; // local - let self_11: usize; // local - let self_12: bool; // local + let self_11: bool; // local + let _12: bool; // anonymous local storage_live(exclusive_end_3) - storage_live(_5) + storage_live(_4) + storage_live(self_9) storage_live(self_10) storage_live(self_11) - storage_live(self_12) - self_10 = move (self_1).start - self_11 = move (self_1).end - self_12 = move (self_1).exhausted - exclusive_end_3 = copy self_11 wrap.+ const 1 : usize - if copy self_12 { - self_10 = copy exclusive_end_3 + self_9 = move (self_1).start + self_10 = move (self_1).end + self_11 = move (self_1).exhausted + exclusive_end_3 = copy self_10 wrap.+ const 1 : usize + if copy self_11 { + self_9 = copy exclusive_end_3 } else { } - storage_live(new_len_7) - storage_live(_4) - _4 = ub_checks - if move _4 { - storage_live(_6) - _6 = copy slice_2.metadata - _5 = {impl SliceIndex<[T]> for Range[{built_in impl Sized for usize}]}::get_unchecked::precondition_check(copy self_10, copy exclusive_end_3, move _6) - storage_dead(_6) + storage_live(new_len_6) + storage_live(_12) + _12 = ub_checks + if move _12 { + storage_live(_5) + _5 = copy slice_2.metadata + _4 = {impl SliceIndex<[T]> for Range[{built_in impl Sized for usize}]}::get_unchecked::precondition_check(copy self_9, copy exclusive_end_3, move _5) + storage_dead(_5) } else { } - storage_dead(_4) - new_len_7 = copy exclusive_end_3 ub.- copy self_10 + new_len_6 = copy exclusive_end_3 ub.- copy self_9 + storage_live(_7) storage_live(_8) - storage_live(_9) - _8 = cast<*const [T], *const T>(copy slice_2) - _9 = copy _8 offset copy self_10 - _0 = @PtrFromPartsShared<'_, [T]>(copy _9, copy new_len_7) - storage_dead(_9) + _7 = cast<*const [T], *const T>(copy slice_2) + _8 = copy _7 offset copy self_9 + _0 = @PtrFromPartsShared<'_, [T]>(copy _8, copy new_len_6) storage_dead(_8) - storage_dead(new_len_7) + storage_dead(_7) + storage_dead(new_len_6) return } diff --git a/charon/tests/ui/simple/struct-with-drops.out b/charon/tests/ui/simple/struct-with-drops.out index c7f5cfb83..e1c9fd358 100644 --- a/charon/tests/ui/simple/struct-with-drops.out +++ b/charon/tests/ui/simple/struct-with-drops.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/simple/trait-alias.out b/charon/tests/ui/simple/trait-alias.out index 99f1592b8..07a3da6b0 100644 --- a/charon/tests/ui/simple/trait-alias.out +++ b/charon/tests/ui/simple/trait-alias.out @@ -32,7 +32,7 @@ where pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/simple/trivial_generic_function.out b/charon/tests/ui/simple/trivial_generic_function.out index 5834b9e2e..afed16005 100644 --- a/charon/tests/ui/simple/trivial_generic_function.out +++ b/charon/tests/ui/simple/trivial_generic_function.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/simple/vec-push.out b/charon/tests/ui/simple/vec-push.out index ecab98c04..4797e12e3 100644 --- a/charon/tests/ui/simple/vec-push.out +++ b/charon/tests/ui/simple/vec-push.out @@ -16,12 +16,27 @@ pub trait Sized non-dyn-compatible } +// Full name: core::marker::Destruct +#[lang_item("destruct")] +pub trait Destruct +{ + fn drop_in_place = core::marker::Destruct::drop_in_place + non-dyn-compatible +} + +unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) += + +// Full name: core::ptr::alignment::Alignment +pub opaque type Alignment + // Full name: core::mem::SizedTypeProperties pub trait SizedTypeProperties { parent_clause0 : [@TraitClause0]: Sized const SIZE : usize const ALIGN : usize + const ALIGNMENT : Alignment const IS_ZST : bool const LAYOUT : Layout const MAX_SLICE_LEN : usize @@ -56,6 +71,18 @@ where [@TraitClause0]: SizedTypeProperties, = ALIGN() +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub fn ALIGNMENT() -> Alignment +where + [@TraitClause0]: SizedTypeProperties, += + +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub const ALIGNMENT: Alignment +where + [@TraitClause0]: SizedTypeProperties, + = ALIGNMENT() + // Full name: core::mem::SizedTypeProperties::IS_ZST pub fn IS_ZST() -> bool where @@ -100,6 +127,7 @@ where parent_clause0 = @TraitClause0 const SIZE = SIZE[{impl SizedTypeProperties for T}[@TraitClause0]] const ALIGN = ALIGN[{impl SizedTypeProperties for T}[@TraitClause0]] + const ALIGNMENT = ALIGNMENT[{impl SizedTypeProperties for T}[@TraitClause0]] const IS_ZST = IS_ZST[{impl SizedTypeProperties for T}[@TraitClause0]] const LAYOUT = LAYOUT[{impl SizedTypeProperties for T}[@TraitClause0]] const MAX_SLICE_LEN = MAX_SLICE_LEN[{impl SizedTypeProperties for T}[@TraitClause0]] @@ -120,6 +148,16 @@ pub opaque type Unique #[lang_item("global_alloc_ty")] pub struct Global {} +// Full name: alloc::alloc::Global::{impl Destruct for Global}::drop_in_place +unsafe fn {impl Destruct for Global}::drop_in_place(@1: *mut Global) += + +// Full name: alloc::alloc::Global::{impl Destruct for Global} +impl Destruct for Global { + fn drop_in_place = {impl Destruct for Global}::drop_in_place + non-dyn-compatible +} + // Full name: alloc::raw_vec::RawVec opaque type RawVec where @@ -136,6 +174,7 @@ fn grow_one<'_0, T, A>(@1: &'_0 mut RawVec[@TraitClause0, @TraitClause1]) where [@TraitClause0]: Sized, [@TraitClause1]: Sized, + [@TraitClause3]: Destruct, = // Full name: alloc::vec::Vec @@ -164,6 +203,7 @@ pub fn push_mut<'_0, T, A>(@1: &'_0 mut Vec[@TraitClause0, @TraitClause1], @2 where [@TraitClause0]: Sized, [@TraitClause1]: Sized, + [@TraitClause3]: Destruct, { let _0: &'1 mut T; // return let self_1: &'3 mut Vec[@TraitClause0, @TraitClause1]; // arg #1 @@ -201,7 +241,7 @@ where storage_dead(_5) storage_live(_7) _7 = &two-phase-mut ((*self_1)).buf - _6 = grow_one<'11, T, A>[@TraitClause0, @TraitClause1](move _7) + _6 = grow_one<'11, T, A>[@TraitClause0, @TraitClause1, @TraitClause3](move _7) storage_dead(_7) } else { storage_dead(_5) @@ -228,6 +268,7 @@ pub fn push<'_0, T, A>(@1: &'_0 mut Vec[@TraitClause0, @TraitClause1], @2: T) where [@TraitClause0]: Sized, [@TraitClause1]: Sized, + [@TraitClause3]: Destruct, { let _0: (); // return let self_1: &'1 mut Vec[@TraitClause0, @TraitClause1]; // arg #1 @@ -236,7 +277,7 @@ where _0 = () storage_live(_3) - _3 = push_mut<'5, T, A>[@TraitClause0, @TraitClause1](move self_1, move value_2) + _3 = push_mut<'5, T, A>[@TraitClause0, @TraitClause1, @TraitClause3](move self_1, move value_2) storage_dead(_3) return } @@ -251,7 +292,7 @@ fn vec<'_0>(@1: &'_0 mut Vec[{built_in impl Sized for u32}, {built_in impl _0 = () storage_live(_2) _2 = &two-phase-mut (*x_1) - _0 = push<'4, u32, Global>[{built_in impl Sized for u32}, {built_in impl Sized for Global}](move _2, const 42 : u32) + _0 = push<'4, u32, Global>[{built_in impl Sized for u32}, {built_in impl Sized for Global}, {impl Destruct for Global}](move _2, const 42 : u32) storage_dead(_2) return } diff --git a/charon/tests/ui/simple/vec-with-capacity.out b/charon/tests/ui/simple/vec-with-capacity.out index 71fecbbbb..f213216a2 100644 --- a/charon/tests/ui/simple/vec-with-capacity.out +++ b/charon/tests/ui/simple/vec-with-capacity.out @@ -25,18 +25,22 @@ pub struct PhantomData {} pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) = +// Full name: core::ptr::alignment::Alignment +pub opaque type Alignment + // Full name: core::mem::SizedTypeProperties pub trait SizedTypeProperties { parent_clause0 : [@TraitClause0]: Sized const SIZE : usize const ALIGN : usize + const ALIGNMENT : Alignment const IS_ZST : bool const LAYOUT : Layout const MAX_SLICE_LEN : usize @@ -71,6 +75,18 @@ where [@TraitClause0]: SizedTypeProperties, = ALIGN() +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub fn ALIGNMENT() -> Alignment +where + [@TraitClause0]: SizedTypeProperties, += + +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub const ALIGNMENT: Alignment +where + [@TraitClause0]: SizedTypeProperties, + = ALIGNMENT() + // Full name: core::mem::SizedTypeProperties::IS_ZST pub fn IS_ZST() -> bool where @@ -115,6 +131,7 @@ where parent_clause0 = @TraitClause0 const SIZE = SIZE[{impl SizedTypeProperties for T}[@TraitClause0]] const ALIGN = ALIGN[{impl SizedTypeProperties for T}[@TraitClause0]] + const ALIGNMENT = ALIGNMENT[{impl SizedTypeProperties for T}[@TraitClause0]] const IS_ZST = IS_ZST[{impl SizedTypeProperties for T}[@TraitClause0]] const LAYOUT = LAYOUT[{impl SizedTypeProperties for T}[@TraitClause0]] const MAX_SLICE_LEN = MAX_SLICE_LEN[{impl SizedTypeProperties for T}[@TraitClause0]] @@ -125,6 +142,16 @@ where #[lang_item("global_alloc_ty")] pub struct Global {} +// Full name: alloc::alloc::Global::{impl Destruct for Global}::drop_in_place +unsafe fn {impl Destruct for Global}::drop_in_place(@1: *mut Global) += + +// Full name: alloc::alloc::Global::{impl Destruct for Global} +impl Destruct for Global { + fn drop_in_place = {impl Destruct for Global}::drop_in_place + non-dyn-compatible +} + // Full name: alloc::raw_vec::RawVec opaque type RawVec where @@ -140,6 +167,7 @@ where fn with_capacity_in(@1: usize, @2: A, @3: Layout) -> RawVecInner[@TraitClause0] where [@TraitClause0]: Sized, + [@TraitClause2]: Destruct, = // Full name: alloc::vec::Vec @@ -187,7 +215,7 @@ where storage_live(_3) storage_live(_5) _5 = Global { } - _3 = with_capacity_in[{built_in impl Sized for Global}](move capacity_1, move _5, const {impl SizedTypeProperties for T}[@TraitClause0]::LAYOUT) + _3 = with_capacity_in[{built_in impl Sized for Global}, {impl Destruct for Global}](move capacity_1, move _5, const {impl SizedTypeProperties for T}[@TraitClause0]::LAYOUT) storage_live(_4) _4 = PhantomData { } _2 = RawVec { 0: move _3, 1: move _4 } diff --git a/charon/tests/ui/slice-index-range.out b/charon/tests/ui/slice-index-range.out index a5e65e51f..a8d68b505 100644 --- a/charon/tests/ui/slice-index-range.out +++ b/charon/tests/ui/slice-index-range.out @@ -32,25 +32,455 @@ where [@TraitClause2]: Index<[T], I>, = +// Full name: core::fmt::Error +pub struct Error {} + // Full name: core::fmt::Arguments #[lang_item("format_arguments")] pub opaque type Arguments<'a> +// Full name: core::result::Result +#[lang_item("Result")] +pub enum Result +where + [@TraitClause0]: Sized, + [@TraitClause1]: Sized, +{ + Ok(T), + Err(E), +} + +// Full name: core::fmt::num::imp::{impl Display for usize}::fmt +pub fn {impl Display for usize}::fmt<'_0, '_1, '_2>(@1: &'_0 usize, @2: &'_1 mut Formatter<'_2>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}] += + +// Full name: core::ptr::non_null::NonNull +#[lang_item("NonNull")] +pub opaque type NonNull + +// Full name: core::marker::PhantomData +#[lang_item("phantom_data")] +pub struct PhantomData {} + +// Full name: core::fmt::rt::ArgumentType +enum ArgumentType<'a> { + Placeholder(value: NonNull<()>, formatter: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], _lifetime: PhantomData<&'a ()>), + Count(u16), +} + // Full name: core::fmt::rt::Argument #[lang_item("format_argument")] pub opaque type Argument<'a> +fn UNIT_METADATA() +{ + let _0: (); // return + + _0 = () + return +} + +const UNIT_METADATA: () = @Fun0() + fn core::slice::index::slice_index_fail::do_panic::runtime(@1: usize, @2: usize) -> ! -= +{ + let _0: !; // return + let start_1: usize; // arg #1 + let len_2: usize; // arg #2 + let _3: Arguments<'1>; // anonymous local + let args_4: &'3 usize; // local + let args_5: &'4 usize; // local + let args_6: [Argument<'7>; 2 : usize]; // local + let _7: Argument<'8>; // anonymous local + let _8: Argument<'9>; // anonymous local + let args_9: &'12 [Argument<'13>; 2 : usize]; // local + let _10: ArgumentType<'15>; // anonymous local + let _11: NonNull<()>; // anonymous local + let _12: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _13: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _14: *const usize; // anonymous local + let _15: *const (); // anonymous local + let _16: ArgumentType<'16>; // anonymous local + let _17: NonNull<()>; // anonymous local + let _18: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _19: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _20: *const usize; // anonymous local + let _21: *const (); // anonymous local + let _22: NonNull; // anonymous local + let _23: NonNull>; // anonymous local + let _24: PhantomData<&'30 ()>; // anonymous local + let _25: PhantomData<&'39 ()>; // anonymous local + let _26: [u8; 57 : usize]; // anonymous local + let _27: &'44 [u8; 57 : usize]; // anonymous local + + storage_live(args_4) + storage_live(args_5) + storage_live(args_9) + storage_live(_3) + args_4 = &start_1 + args_5 = &len_2 + storage_live(args_6) + storage_live(_7) + storage_live(_13) + storage_live(_14) + storage_live(_10) + storage_live(_11) + _14 = &raw const (*args_4) + storage_live(_15) + _15 = cast<*const usize, *const ()>(copy _14) + _11 = NonNull { 0: copy _15 } + storage_dead(_15) + storage_live(_12) + _13 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'25, '26, '27>) + _12 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _13) + storage_live(_24) + _24 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _24 } + storage_dead(_12) + storage_dead(_11) + _7 = Argument { 0: move _10 } + storage_dead(_10) + storage_dead(_14) + storage_dead(_13) + storage_live(_8) + storage_live(_19) + storage_live(_20) + storage_live(_16) + storage_live(_17) + _20 = &raw const (*args_5) + storage_live(_21) + _21 = cast<*const usize, *const ()>(copy _20) + _17 = NonNull { 0: copy _21 } + storage_dead(_21) + storage_live(_18) + _19 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'36, '37, '38>) + _18 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _19) + storage_live(_25) + _25 = PhantomData { } + _16 = ArgumentType::Placeholder { value: move _17, formatter: copy _18, _lifetime: move _25 } + storage_dead(_18) + storage_dead(_17) + _8 = Argument { 0: move _16 } + storage_dead(_16) + storage_dead(_20) + storage_dead(_19) + args_6 = [move _7, move _8] + storage_dead(_8) + storage_dead(_7) + args_9 = &args_6 + storage_live(_22) + storage_live(_26) + _26 = [const 18 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 115 : u8, const 116 : u8, const 97 : u8, const 114 : u8, const 116 : u8, const 32 : u8, const 105 : u8, const 110 : u8, const 100 : u8, const 101 : u8, const 120 : u8, const 32 : u8, const 192 : u8, const 34 : u8, const 32 : u8, const 111 : u8, const 117 : u8, const 116 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 102 : u8, const 111 : u8, const 114 : u8, const 32 : u8, const 115 : u8, const 108 : u8, const 105 : u8, const 99 : u8, const 101 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 108 : u8, const 101 : u8, const 110 : u8, const 103 : u8, const 116 : u8, const 104 : u8, const 32 : u8, const 192 : u8, const 0 : u8] + storage_live(_27) + _27 = &_26 + _22 = transmute<&'44 [u8; 57 : usize], NonNull>(move _27) + storage_live(_23) + _23 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { 0: move _22, 1: move _23 } + storage_dead(_23) + storage_dead(_22) + panic(core::panicking::panic_fmt) +} fn core::slice::index::slice_index_fail::do_panic#1::runtime(@1: usize, @2: usize) -> ! -= +{ + let _0: !; // return + let end_1: usize; // arg #1 + let len_2: usize; // arg #2 + let _3: Arguments<'1>; // anonymous local + let args_4: &'3 usize; // local + let args_5: &'4 usize; // local + let args_6: [Argument<'7>; 2 : usize]; // local + let _7: Argument<'8>; // anonymous local + let _8: Argument<'9>; // anonymous local + let args_9: &'12 [Argument<'13>; 2 : usize]; // local + let _10: ArgumentType<'15>; // anonymous local + let _11: NonNull<()>; // anonymous local + let _12: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _13: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _14: *const usize; // anonymous local + let _15: *const (); // anonymous local + let _16: ArgumentType<'16>; // anonymous local + let _17: NonNull<()>; // anonymous local + let _18: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _19: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _20: *const usize; // anonymous local + let _21: *const (); // anonymous local + let _22: NonNull; // anonymous local + let _23: NonNull>; // anonymous local + let _24: PhantomData<&'30 ()>; // anonymous local + let _25: PhantomData<&'39 ()>; // anonymous local + let _26: [u8; 55 : usize]; // anonymous local + let _27: &'44 [u8; 55 : usize]; // anonymous local + + storage_live(args_4) + storage_live(args_5) + storage_live(args_9) + storage_live(_3) + args_4 = &end_1 + args_5 = &len_2 + storage_live(args_6) + storage_live(_7) + storage_live(_13) + storage_live(_14) + storage_live(_10) + storage_live(_11) + _14 = &raw const (*args_4) + storage_live(_15) + _15 = cast<*const usize, *const ()>(copy _14) + _11 = NonNull { 0: copy _15 } + storage_dead(_15) + storage_live(_12) + _13 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'25, '26, '27>) + _12 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _13) + storage_live(_24) + _24 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _24 } + storage_dead(_12) + storage_dead(_11) + _7 = Argument { 0: move _10 } + storage_dead(_10) + storage_dead(_14) + storage_dead(_13) + storage_live(_8) + storage_live(_19) + storage_live(_20) + storage_live(_16) + storage_live(_17) + _20 = &raw const (*args_5) + storage_live(_21) + _21 = cast<*const usize, *const ()>(copy _20) + _17 = NonNull { 0: copy _21 } + storage_dead(_21) + storage_live(_18) + _19 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'36, '37, '38>) + _18 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _19) + storage_live(_25) + _25 = PhantomData { } + _16 = ArgumentType::Placeholder { value: move _17, formatter: copy _18, _lifetime: move _25 } + storage_dead(_18) + storage_dead(_17) + _8 = Argument { 0: move _16 } + storage_dead(_16) + storage_dead(_20) + storage_dead(_19) + args_6 = [move _7, move _8] + storage_dead(_8) + storage_dead(_7) + args_9 = &args_6 + storage_live(_22) + storage_live(_26) + _26 = [const 16 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 101 : u8, const 110 : u8, const 100 : u8, const 32 : u8, const 105 : u8, const 110 : u8, const 100 : u8, const 101 : u8, const 120 : u8, const 32 : u8, const 192 : u8, const 34 : u8, const 32 : u8, const 111 : u8, const 117 : u8, const 116 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 102 : u8, const 111 : u8, const 114 : u8, const 32 : u8, const 115 : u8, const 108 : u8, const 105 : u8, const 99 : u8, const 101 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 108 : u8, const 101 : u8, const 110 : u8, const 103 : u8, const 116 : u8, const 104 : u8, const 32 : u8, const 192 : u8, const 0 : u8] + storage_live(_27) + _27 = &_26 + _22 = transmute<&'44 [u8; 55 : usize], NonNull>(move _27) + storage_live(_23) + _23 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { 0: move _22, 1: move _23 } + storage_dead(_23) + storage_dead(_22) + panic(core::panicking::panic_fmt) +} fn core::slice::index::slice_index_fail::do_panic#2::runtime(@1: usize, @2: usize) -> ! -= +{ + let _0: !; // return + let start_1: usize; // arg #1 + let end_2: usize; // arg #2 + let _3: Arguments<'1>; // anonymous local + let args_4: &'3 usize; // local + let args_5: &'4 usize; // local + let args_6: [Argument<'7>; 2 : usize]; // local + let _7: Argument<'8>; // anonymous local + let _8: Argument<'9>; // anonymous local + let args_9: &'12 [Argument<'13>; 2 : usize]; // local + let _10: ArgumentType<'15>; // anonymous local + let _11: NonNull<()>; // anonymous local + let _12: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _13: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _14: *const usize; // anonymous local + let _15: *const (); // anonymous local + let _16: ArgumentType<'16>; // anonymous local + let _17: NonNull<()>; // anonymous local + let _18: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _19: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _20: *const usize; // anonymous local + let _21: *const (); // anonymous local + let _22: NonNull; // anonymous local + let _23: NonNull>; // anonymous local + let _24: PhantomData<&'30 ()>; // anonymous local + let _25: PhantomData<&'39 ()>; // anonymous local + let _26: [u8; 40 : usize]; // anonymous local + let _27: &'44 [u8; 40 : usize]; // anonymous local + + storage_live(args_4) + storage_live(args_5) + storage_live(args_9) + storage_live(_3) + args_4 = &start_1 + args_5 = &end_2 + storage_live(args_6) + storage_live(_7) + storage_live(_13) + storage_live(_14) + storage_live(_10) + storage_live(_11) + _14 = &raw const (*args_4) + storage_live(_15) + _15 = cast<*const usize, *const ()>(copy _14) + _11 = NonNull { 0: copy _15 } + storage_dead(_15) + storage_live(_12) + _13 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'25, '26, '27>) + _12 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _13) + storage_live(_24) + _24 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _24 } + storage_dead(_12) + storage_dead(_11) + _7 = Argument { 0: move _10 } + storage_dead(_10) + storage_dead(_14) + storage_dead(_13) + storage_live(_8) + storage_live(_19) + storage_live(_20) + storage_live(_16) + storage_live(_17) + _20 = &raw const (*args_5) + storage_live(_21) + _21 = cast<*const usize, *const ()>(copy _20) + _17 = NonNull { 0: copy _21 } + storage_dead(_21) + storage_live(_18) + _19 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'36, '37, '38>) + _18 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _19) + storage_live(_25) + _25 = PhantomData { } + _16 = ArgumentType::Placeholder { value: move _17, formatter: copy _18, _lifetime: move _25 } + storage_dead(_18) + storage_dead(_17) + _8 = Argument { 0: move _16 } + storage_dead(_16) + storage_dead(_20) + storage_dead(_19) + args_6 = [move _7, move _8] + storage_dead(_8) + storage_dead(_7) + args_9 = &args_6 + storage_live(_22) + storage_live(_26) + _26 = [const 22 : u8, const 115 : u8, const 108 : u8, const 105 : u8, const 99 : u8, const 101 : u8, const 32 : u8, const 105 : u8, const 110 : u8, const 100 : u8, const 101 : u8, const 120 : u8, const 32 : u8, const 115 : u8, const 116 : u8, const 97 : u8, const 114 : u8, const 116 : u8, const 115 : u8, const 32 : u8, const 97 : u8, const 116 : u8, const 32 : u8, const 192 : u8, const 13 : u8, const 32 : u8, const 98 : u8, const 117 : u8, const 116 : u8, const 32 : u8, const 101 : u8, const 110 : u8, const 100 : u8, const 115 : u8, const 32 : u8, const 97 : u8, const 116 : u8, const 32 : u8, const 192 : u8, const 0 : u8] + storage_live(_27) + _27 = &_26 + _22 = transmute<&'44 [u8; 40 : usize], NonNull>(move _27) + storage_live(_23) + _23 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { 0: move _22, 1: move _23 } + storage_dead(_23) + storage_dead(_22) + panic(core::panicking::panic_fmt) +} fn core::slice::index::slice_index_fail::do_panic#3::runtime(@1: usize, @2: usize) -> ! -= +{ + let _0: !; // return + let end_1: usize; // arg #1 + let len_2: usize; // arg #2 + let _3: Arguments<'1>; // anonymous local + let args_4: &'3 usize; // local + let args_5: &'4 usize; // local + let args_6: [Argument<'7>; 2 : usize]; // local + let _7: Argument<'8>; // anonymous local + let _8: Argument<'9>; // anonymous local + let args_9: &'12 [Argument<'13>; 2 : usize]; // local + let _10: ArgumentType<'15>; // anonymous local + let _11: NonNull<()>; // anonymous local + let _12: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _13: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _14: *const usize; // anonymous local + let _15: *const (); // anonymous local + let _16: ArgumentType<'16>; // anonymous local + let _17: NonNull<()>; // anonymous local + let _18: unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _19: fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]; // anonymous local + let _20: *const usize; // anonymous local + let _21: *const (); // anonymous local + let _22: NonNull; // anonymous local + let _23: NonNull>; // anonymous local + let _24: PhantomData<&'30 ()>; // anonymous local + let _25: PhantomData<&'39 ()>; // anonymous local + let _26: [u8; 55 : usize]; // anonymous local + let _27: &'44 [u8; 55 : usize]; // anonymous local + + storage_live(args_4) + storage_live(args_5) + storage_live(args_9) + storage_live(_3) + args_4 = &end_1 + args_5 = &len_2 + storage_live(args_6) + storage_live(_7) + storage_live(_13) + storage_live(_14) + storage_live(_10) + storage_live(_11) + _14 = &raw const (*args_4) + storage_live(_15) + _15 = cast<*const usize, *const ()>(copy _14) + _11 = NonNull { 0: copy _15 } + storage_dead(_15) + storage_live(_12) + _13 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'25, '26, '27>) + _12 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _13) + storage_live(_24) + _24 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _24 } + storage_dead(_12) + storage_dead(_11) + _7 = Argument { 0: move _10 } + storage_dead(_10) + storage_dead(_14) + storage_dead(_13) + storage_live(_8) + storage_live(_19) + storage_live(_20) + storage_live(_16) + storage_live(_17) + _20 = &raw const (*args_5) + storage_live(_21) + _21 = cast<*const usize, *const ()>(copy _20) + _17 = NonNull { 0: copy _21 } + storage_dead(_21) + storage_live(_18) + _19 = cast {impl Display for usize}::fmt<'_0_1, '_1_1, '_2_1>, fn<'_0_1, '_1_1, '_2_1>(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(const {impl Display for usize}::fmt<'36, '37, '38>) + _18 = transmute(&'_0_1 usize, &'_1_1 mut Formatter<'_2_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}], unsafe fn<'_0_1, '_1_1>(NonNull<()>, &'_0_1 mut Formatter<'_1_1>) -> Result<(), Error>[{built_in impl Sized for ()}, {built_in impl Sized for Error}]>(copy _19) + storage_live(_25) + _25 = PhantomData { } + _16 = ArgumentType::Placeholder { value: move _17, formatter: copy _18, _lifetime: move _25 } + storage_dead(_18) + storage_dead(_17) + _8 = Argument { 0: move _16 } + storage_dead(_16) + storage_dead(_20) + storage_dead(_19) + args_6 = [move _7, move _8] + storage_dead(_8) + storage_dead(_7) + args_9 = &args_6 + storage_live(_22) + storage_live(_26) + _26 = [const 16 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 101 : u8, const 110 : u8, const 100 : u8, const 32 : u8, const 105 : u8, const 110 : u8, const 100 : u8, const 101 : u8, const 120 : u8, const 32 : u8, const 192 : u8, const 34 : u8, const 32 : u8, const 111 : u8, const 117 : u8, const 116 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 114 : u8, const 97 : u8, const 110 : u8, const 103 : u8, const 101 : u8, const 32 : u8, const 102 : u8, const 111 : u8, const 114 : u8, const 32 : u8, const 115 : u8, const 108 : u8, const 105 : u8, const 99 : u8, const 101 : u8, const 32 : u8, const 111 : u8, const 102 : u8, const 32 : u8, const 108 : u8, const 101 : u8, const 110 : u8, const 103 : u8, const 116 : u8, const 104 : u8, const 32 : u8, const 192 : u8, const 0 : u8] + storage_live(_27) + _27 = &_26 + _22 = transmute<&'44 [u8; 55 : usize], NonNull>(move _27) + storage_live(_23) + _23 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { 0: move _22, 1: move _23 } + storage_dead(_23) + storage_dead(_22) + panic(core::panicking::panic_fmt) +} pub fn core::ops::index::Index::index<'_0, Self, Idx>(@1: &'_0 Self, @2: Idx) -> &'_0 @TraitClause0::Output where @@ -117,10 +547,6 @@ fn core::slice::index::slice_index_fail::do_panic#3(@1: usize, @2: usize) -> ! pub fn panic_nounwind_fmt<'_0>(@1: Arguments<'_0>, @2: bool) -> ! = -// Full name: core::ptr::non_null::NonNull -#[lang_item("NonNull")] -pub opaque type NonNull - // Full name: core::slice::index::private_slice_index::Sealed pub trait Sealed { @@ -528,48 +954,47 @@ where let _0: *mut [T]; // return let self_1: Range[{built_in impl Sized for usize}]; // arg #1 let slice_2: *mut [T]; // arg #2 - let _3: bool; // anonymous local - let _4: (); // anonymous local + let _3: (); // anonymous local + let _4: usize; // anonymous local let _5: usize; // anonymous local let _6: usize; // anonymous local - let _7: usize; // anonymous local - let new_len_8: usize; // local - let _9: usize; // anonymous local - let offset_10: usize; // local + let new_len_7: usize; // local + let _8: usize; // anonymous local + let offset_9: usize; // local + let _10: *mut T; // anonymous local let _11: *mut T; // anonymous local - let _12: *mut T; // anonymous local + let _12: bool; // anonymous local - storage_live(_4) - storage_live(new_len_8) - storage_live(offset_10) storage_live(_3) - _3 = ub_checks - if move _3 { + storage_live(new_len_7) + storage_live(offset_9) + storage_live(_12) + _12 = ub_checks + if move _12 { + storage_live(_4) + _4 = copy (self_1).start storage_live(_5) - _5 = copy (self_1).start + _5 = copy (self_1).end storage_live(_6) - _6 = copy (self_1).end - storage_live(_7) - _7 = copy slice_2.metadata - _4 = {impl SliceIndex<[T]> for Range[{built_in impl Sized for usize}]}::get_unchecked_mut::precondition_check(move _5, move _6, move _7) - storage_dead(_7) + _6 = copy slice_2.metadata + _3 = {impl SliceIndex<[T]> for Range[{built_in impl Sized for usize}]}::get_unchecked_mut::precondition_check(move _4, move _5, move _6) storage_dead(_6) storage_dead(_5) + storage_dead(_4) } else { } - storage_dead(_3) - storage_live(_9) - _9 = copy (self_1).end - offset_10 = copy (self_1).start - new_len_8 = move _9 ub.- copy offset_10 - storage_dead(_9) + storage_live(_8) + _8 = copy (self_1).end + offset_9 = copy (self_1).start + new_len_7 = move _8 ub.- copy offset_9 + storage_dead(_8) + storage_live(_10) storage_live(_11) - storage_live(_12) - _11 = cast<*mut [T], *mut T>(copy slice_2) - _12 = copy _11 offset copy offset_10 - _0 = @PtrFromPartsMut<'_, [T]>(copy _12, copy new_len_8) - storage_dead(_12) + _10 = cast<*mut [T], *mut T>(copy slice_2) + _11 = copy _10 offset copy offset_9 + _0 = @PtrFromPartsMut<'_, [T]>(copy _11, copy new_len_7) storage_dead(_11) + storage_dead(_10) return } @@ -648,48 +1073,47 @@ where let _0: *const [T]; // return let self_1: Range[{built_in impl Sized for usize}]; // arg #1 let slice_2: *const [T]; // arg #2 - let _3: bool; // anonymous local - let _4: (); // anonymous local + let _3: (); // anonymous local + let _4: usize; // anonymous local let _5: usize; // anonymous local let _6: usize; // anonymous local - let _7: usize; // anonymous local - let new_len_8: usize; // local - let _9: usize; // anonymous local - let offset_10: usize; // local + let new_len_7: usize; // local + let _8: usize; // anonymous local + let offset_9: usize; // local + let _10: *const T; // anonymous local let _11: *const T; // anonymous local - let _12: *const T; // anonymous local + let _12: bool; // anonymous local - storage_live(_4) - storage_live(new_len_8) - storage_live(offset_10) storage_live(_3) - _3 = ub_checks - if move _3 { + storage_live(new_len_7) + storage_live(offset_9) + storage_live(_12) + _12 = ub_checks + if move _12 { + storage_live(_4) + _4 = copy (self_1).start storage_live(_5) - _5 = copy (self_1).start + _5 = copy (self_1).end storage_live(_6) - _6 = copy (self_1).end - storage_live(_7) - _7 = copy slice_2.metadata - _4 = {impl SliceIndex<[T]> for Range[{built_in impl Sized for usize}]}::get_unchecked::precondition_check(move _5, move _6, move _7) - storage_dead(_7) + _6 = copy slice_2.metadata + _3 = {impl SliceIndex<[T]> for Range[{built_in impl Sized for usize}]}::get_unchecked::precondition_check(move _4, move _5, move _6) storage_dead(_6) storage_dead(_5) + storage_dead(_4) } else { } - storage_dead(_3) - storage_live(_9) - _9 = copy (self_1).end - offset_10 = copy (self_1).start - new_len_8 = move _9 ub.- copy offset_10 - storage_dead(_9) + storage_live(_8) + _8 = copy (self_1).end + offset_9 = copy (self_1).start + new_len_7 = move _8 ub.- copy offset_9 + storage_dead(_8) + storage_live(_10) storage_live(_11) - storage_live(_12) - _11 = cast<*const [T], *const T>(copy slice_2) - _12 = copy _11 offset copy offset_10 - _0 = @PtrFromPartsShared<'_, [T]>(copy _12, copy new_len_8) - storage_dead(_12) + _10 = cast<*const [T], *const T>(copy slice_2) + _11 = copy _10 offset copy offset_9 + _0 = @PtrFromPartsShared<'_, [T]>(copy _11, copy new_len_7) storage_dead(_11) + storage_dead(_10) return } @@ -868,16 +1292,6 @@ where vtable: {impl SliceIndex<[T]> for Range[{built_in impl Sized for usize}]}::{vtable}[@TraitClause0] } -fn UNIT_METADATA() -{ - let _0: (); // return - - _0 = () - return -} - -const UNIT_METADATA: () = @Fun0() - // Full name: test_crate::main fn main() { diff --git a/charon/tests/ui/string-literal.out b/charon/tests/ui/string-literal.out index 0488bb75a..c740743f9 100644 --- a/charon/tests/ui/string-literal.out +++ b/charon/tests/ui/string-literal.out @@ -54,7 +54,7 @@ impl Display for Str { pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/traits.out b/charon/tests/ui/traits.out index 3c8d1141a..cd3133c07 100644 --- a/charon/tests/ui/traits.out +++ b/charon/tests/ui/traits.out @@ -17,7 +17,7 @@ pub trait Sized pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) @@ -28,7 +28,7 @@ unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) pub trait Tuple { parent_clause0 : [@TraitClause0]: MetaSized - vtable: core::marker::Tuple::{vtable} + non-dyn-compatible } // Full name: core::ops::function::FnOnce diff --git a/charon/tests/ui/type_inference_is_order_dependent.out b/charon/tests/ui/type_inference_is_order_dependent.out index 2121a8fec..b3ceab783 100644 --- a/charon/tests/ui/type_inference_is_order_dependent.out +++ b/charon/tests/ui/type_inference_is_order_dependent.out @@ -99,7 +99,7 @@ where pub trait Destruct { fn drop_in_place = drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } // Full name: core::marker::Destruct::drop_in_place diff --git a/charon/tests/ui/unsafe.out b/charon/tests/ui/unsafe.out index 70c63f0cb..88d2d19f2 100644 --- a/charon/tests/ui/unsafe.out +++ b/charon/tests/ui/unsafe.out @@ -272,7 +272,7 @@ pub trait Pointee parent_clause7 : [@TraitClause7]: Unpin parent_clause8 : [@TraitClause8]: Freeze type Metadata - vtable: core::ptr::metadata::Pointee::{vtable} + non-dyn-compatible } // Full name: core::ptr::null diff --git a/charon/tests/ui/unsize.out b/charon/tests/ui/unsize.out index 46ba4e042..376512075 100644 --- a/charon/tests/ui/unsize.out +++ b/charon/tests/ui/unsize.out @@ -46,7 +46,7 @@ where pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/unsized-string-consts.out b/charon/tests/ui/unsized-string-consts.out index 1f1332aac..329a17e58 100644 --- a/charon/tests/ui/unsized-string-consts.out +++ b/charon/tests/ui/unsized-string-consts.out @@ -54,7 +54,7 @@ impl Display for Str { pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/charon/tests/ui/vtable_drop.out b/charon/tests/ui/vtable_drop.out index 5ef34fb5c..e99bf3934 100644 --- a/charon/tests/ui/vtable_drop.out +++ b/charon/tests/ui/vtable_drop.out @@ -1,13 +1,11 @@ # Final LLBC before serialization: -opaque type core::marker::Destruct::{vtable} - // Full name: core::marker::Destruct #[lang_item("destruct")] pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } opaque type core::marker::MetaSized::{vtable} @@ -117,7 +115,6 @@ struct test_crate::Modifiable::{vtable} { drop: unsafe fn(*mut (dyn Modifiable)), method_modify: fn<'_0_1, '_1_1>(&'_0_1 mut (dyn Modifiable), &'_1_1 T) -> T, super_trait_0: &'static core::marker::MetaSized::{vtable}, - super_trait_1: &'static core::marker::Destruct::{vtable}, } // Full name: test_crate::Modifiable @@ -229,7 +226,7 @@ where size_1 = size_of[{built_in impl MetaSized for i32}, {built_in impl Sized for Global}, {built_in impl Destruct for i32}, {impl Destruct for Global}]> storage_live(align_2) align_2 = align_of[{built_in impl MetaSized for i32}, {built_in impl Sized for Global}, {built_in impl Destruct for i32}, {impl Destruct for Global}]> - ret_0 = test_crate::Modifiable::{vtable} { size: move size_1, align: move align_2, drop: const {vtable_drop_shim}[@TraitClause0, @TraitClause1, @TraitClause2], method_modify: const {vtable_method}<'1, '2, T>[@TraitClause0, @TraitClause1, @TraitClause2], super_trait_0: const Opaque(missing supertrait vtable), super_trait_1: const Opaque(missing supertrait vtable) } + ret_0 = test_crate::Modifiable::{vtable} { size: move size_1, align: move align_2, drop: const {vtable_drop_shim}[@TraitClause0, @TraitClause1, @TraitClause2], method_modify: const {vtable_method}<'1, '2, T>[@TraitClause0, @TraitClause1, @TraitClause2], super_trait_0: const Opaque(missing supertrait vtable) } return } diff --git a/charon/tests/ui/vtables.out b/charon/tests/ui/vtables.out index 53fc85236..7e94915ba 100644 --- a/charon/tests/ui/vtables.out +++ b/charon/tests/ui/vtables.out @@ -86,7 +86,7 @@ impl Display for Str { pub trait Destruct { fn drop_in_place = core::marker::Destruct::drop_in_place - vtable: core::marker::Destruct::{vtable} + non-dyn-compatible } unsafe fn core::marker::Destruct::drop_in_place(@1: *mut Self) diff --git a/flake.nix b/flake.nix index a12b7ca42..624c11f5f 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ rust-overlay = { # We pin a specific commit because we require a relatively recent version # and flake dependents don't look at our flake.lock. - url = "github:oxalica/rust-overlay/ab726555a9a72e6dc80649809147823a813fa95b"; + url = "github:oxalica/rust-overlay/5177426d9f8f7f1827001c9749b9a9c5570d456b"; inputs.nixpkgs.follows = "nixpkgs"; }; crane.url = "github:ipetkov/crane";