From 3a01e03640569b0681db78cea3301cbf902d5883 Mon Sep 17 00:00:00 2001 From: N1ark Date: Sun, 31 May 2026 18:29:22 +0100 Subject: [PATCH 1/4] Bump rustc to `nightly-2026-04-18` --- charon/rust-toolchain | 2 +- .../src/elaboration.rs | 26 +- .../rustc_trait_elaboration/src/predicates.rs | 13 +- .../hax/constant_utils/uneval.rs | 4 +- .../src/bin/charon-driver/hax/rustc_utils.rs | 12 +- .../src/bin/charon-driver/hax/types/def_id.rs | 14 +- charon/src/bin/charon-driver/hax/types/mod.rs | 2 +- .../charon-driver/hax/types/new/full_def.rs | 2 +- .../charon-driver/hax/types/new/item_ref.rs | 2 +- charon/src/bin/charon-driver/hax/types/ty.rs | 32 +- charon/src/bin/charon-driver/main.rs | 2 - .../bin/charon-driver/translate/get_mir.rs | 4 +- .../charon-driver/translate/resolve_path.rs | 2 +- .../translate/translate_bodies.rs | 2 +- .../translate/translate_crate.rs | 2 +- .../translate/translate_predicates.rs | 1 + charon/src/transform/typecheck_and_unify.rs | 6 +- charon/tests/crate_data.rs | 2 - charon/tests/layout.rs | 1 - charon/tests/ui/advanced-const-generics.out | 10 +- charon/tests/ui/copy_nonoverlapping.out | 114 +- .../tests/ui/dyn-with-diamond-supertraits.out | 26 +- charon/tests/ui/issue-114-opaque-bodies.out | 2 +- charon/tests/ui/iterator.out | 139 +- charon/tests/ui/ptr-offset.out | 2 +- charon/tests/ui/raw-boxes.out | 2656 ++++++++--------- .../issue-1073-out-of-bounds-body-region.out | 580 ++-- charon/tests/ui/result-unwrap.out | 28 +- charon/tests/ui/simple/box-dyn-fnonce-raw.out | 105 +- charon/tests/ui/simple/box-dyn-fnonce.out | 4 +- charon/tests/ui/simple/box-into-inner.out | 2 +- .../simple/drop-glue-with-const-generic.out | 4 +- charon/tests/ui/simple/slice_index_range.out | 338 +-- charon/tests/ui/simple/vec-push.out | 2 +- charon/tests/ui/simple/vec-with-capacity.out | 2 +- charon/tests/ui/slice-index-range.out | 336 +-- flake.nix | 2 +- 37 files changed, 2152 insertions(+), 2331 deletions(-) diff --git a/charon/rust-toolchain b/charon/rust-toolchain index 6b2c73aa1..560f57966 100644 --- a/charon/rust-toolchain +++ b/charon/rust-toolchain @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2026-02-22" +channel = "nightly-2026-04-18" components = [ "rustc-dev", "llvm-tools-preview", "rust-src", "miri" ] targets = [ "x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "aarch64-apple-darwin", "i686-unknown-linux-gnu", "powerpc64-unknown-linux-gnu", "riscv64gc-unknown-none-elf" ] diff --git a/charon/rustc_trait_elaboration/src/elaboration.rs b/charon/rustc_trait_elaboration/src/elaboration.rs index b7c7b378a..be865ae54 100644 --- a/charon/rustc_trait_elaboration/src/elaboration.rs +++ b/charon/rustc_trait_elaboration/src/elaboration.rs @@ -120,10 +120,7 @@ impl<'tcx> PredicateSearcher<'tcx> { let initial_self_pred = initial_self_pred(tcx, owner_id); let mut out = Self { elab_ctx, - typing_env: TypingEnv { - param_env: tcx.param_env(owner_id), - typing_mode: TypingMode::PostAnalysis, - }, + typing_env: TypingEnv::new(tcx.param_env(owner_id), TypingMode::PostAnalysis), candidates: Default::default(), implicit_self_clause: initial_self_pred.is_some(), item_refs_cache: Default::default(), @@ -219,10 +216,17 @@ impl<'tcx> PredicateSearcher<'tcx> { let elab_ctx = self.elab_ctx; let tcx = self.elab_ctx.tcx; // Note: We skip a binder but rebind it just after. - let TyKind::Alias(AliasTyKind::Projection, alias_ty) = ty.skip_binder().kind() else { + let TyKind::Alias( + alias @ ty::AliasTy { + kind: AliasTyKind::Projection { def_id, .. }, + args, + .. + }, + ) = ty.skip_binder().kind() + else { return; }; - let trait_ref = ty.rebind(alias_ty.trait_ref(tcx)).upcast(tcx); + let trait_ref = ty.rebind(alias.trait_ref(tcx)).upcast(tcx); // The predicate we're looking for is is `::Type: OtherTrait`. We try to solve // `T as Trait` and add all the bounds on `Trait::Type` to our context. @@ -230,14 +234,14 @@ impl<'tcx> PredicateSearcher<'tcx> { if matches!(proof.kind, TraitProofKind::Error(_)) { return; } - let item_ref = self.resolve_item_reference(alias_ty.def_id, alias_ty.args, true); + let item_ref = self.resolve_item_reference(*def_id, args, true); // The bounds that hold on the associated type. - let item_bounds = ItemPredicates::implied(self.elab_ctx, alias_ty.def_id); + let item_bounds = ItemPredicates::implied(self.elab_ctx, *def_id); let item_bounds = item_bounds .iter_trait_clauses() // Substitute the item generics - .map(|(_, tref)| EarlyBinder::bind(tref).instantiate(tcx, alias_ty.args)) + .map(|(_, tref)| EarlyBinder::bind(tref).instantiate(tcx, args)) .enumerate(); // Add all the bounds on the corresponding associated item. @@ -345,8 +349,8 @@ impl<'tcx> PredicateSearcher<'tcx> { let ty = Ty::new_projection(tcx, assoc.def_id, erased_tref.skip_binder().args); let ty = crate::erase_and_norm(tcx, self.typing_env, ty); - if let TyKind::Alias(_, alias_ty) = ty.kind() - && alias_ty.def_id == assoc.def_id + if let TyKind::Alias(alias_ty) = ty.kind() + && alias_ty.kind.def_id() == assoc.def_id { // Couldn't normalize the type to anything different than itself; // this must be a built-in associated type such as diff --git a/charon/rustc_trait_elaboration/src/predicates.rs b/charon/rustc_trait_elaboration/src/predicates.rs index 3cfa486a3..42bdddb84 100644 --- a/charon/rustc_trait_elaboration/src/predicates.rs +++ b/charon/rustc_trait_elaboration/src/predicates.rs @@ -212,10 +212,10 @@ impl<'tcx> ItemPredicates<'tcx> { let options = elab_ctx.bounds_options(); let def_kind = tcx.def_kind(def_id); let mut predicates = match def_kind { - AssocConst + AssocConst { .. } | AssocFn | AssocTy - | Const + | Const { .. } | Enum | Fn | ForeignTy @@ -398,6 +398,13 @@ fn inherits_parent_clauses<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool { use DefKind::*; matches!( tcx.def_kind(def_id), - AnonConst | AssocConst | AssocFn | AssocTy | Closure | Ctor(..) | InlineConst | Variant + AnonConst + | AssocConst { .. } + | AssocFn + | AssocTy + | Closure + | Ctor(..) + | InlineConst + | Variant ) } diff --git a/charon/src/bin/charon-driver/hax/constant_utils/uneval.rs b/charon/src/bin/charon-driver/hax/constant_utils/uneval.rs index 0b3beca37..2e2490b9a 100644 --- a/charon/src/bin/charon-driver/hax/constant_utils/uneval.rs +++ b/charon/src/bin/charon-driver/hax/constant_utils/uneval.rs @@ -133,7 +133,7 @@ impl<'tcx, S: UnderOwnerState<'tcx>> SInto for ty::Const<'tcx> { val.sinto(s) } else { - use rustc_middle::query::Key; + use rustc_middle::query::QueryKey; let span = tcx .def_ident_span(ucv.def) .unwrap_or_else(|| ucv.def.default_span(tcx)); @@ -192,7 +192,7 @@ pub(crate) fn valtree_to_constant_expr<'tcx, S: UnderOwnerState<'tcx>>( ConstantExprKind::Literal(ConstantLiteral::byte_str(bytes)) } (ty::ValTreeKind::Branch(fields), ty::Array(..) | ty::Slice(..) | ty::Tuple(..)) => { - let fields = fields.iter().copied().map(|field| field.sinto(s)).collect(); + let fields = fields.iter().map(|field| field.sinto(s)).collect(); match ty.kind() { ty::Array(..) | ty::Slice(..) => ConstantExprKind::Array { fields }, ty::Tuple(_) => ConstantExprKind::Tuple { fields }, diff --git a/charon/src/bin/charon-driver/hax/rustc_utils.rs b/charon/src/bin/charon-driver/hax/rustc_utils.rs index 8dc1502a9..0434f2ee1 100644 --- a/charon/src/bin/charon-driver/hax/rustc_utils.rs +++ b/charon/src/bin/charon-driver/hax/rustc_utils.rs @@ -1,6 +1,7 @@ use crate::hax::prelude::*; use rustc_hir::def::DefKind as RDefKind; use rustc_middle::{mir, ty}; +use rustc_type_ir::Interner; pub fn inst_binder<'tcx, T>( tcx: ty::TyCtxt<'tcx>, @@ -88,10 +89,7 @@ impl<'tcx, S: UnderOwnerState<'tcx>> HasParamEnv<'tcx> for S { } } fn typing_env(&self) -> ty::TypingEnv<'tcx> { - ty::TypingEnv { - param_env: self.param_env(), - typing_mode: ty::TypingMode::PostAnalysis, - } + ty::TypingEnv::new(self.param_env(), ty::TypingMode::PostAnalysis) } } @@ -221,7 +219,9 @@ pub fn assoc_tys_for_trait<'tcx>( tcx.generics_of(assoc.def_id).own_params.is_empty() && tcx.predicates_of(assoc.def_id).predicates.is_empty() }) - .map(|assoc| ty::AliasTy::new(tcx, assoc.def_id, tref.args)), + .map(|assoc| { + ty::AliasTy::new(tcx, tcx.alias_ty_kind_from_def_id(assoc.def_id), tref.args) + }), ); for clause in tcx .explicit_super_predicates_of(tref.def_id) @@ -260,7 +260,7 @@ pub fn dyn_self_ty<'tcx>( .map(|alias_ty| { let proj = ty::ProjectionPredicate { projection_term: alias_ty.into(), - term: ty::Ty::new_alias(tcx, ty::Projection, alias_ty).into(), + term: ty::Ty::new_alias(tcx, alias_ty).into(), }; let proj = ty::ExistentialProjection::erase_self_ty(tcx, proj); ty::Binder::dummy(ty::ExistentialPredicate::Projection(proj)) diff --git a/charon/src/bin/charon-driver/hax/types/def_id.rs b/charon/src/bin/charon-driver/hax/types/def_id.rs index d27f4ef98..4abbc8095 100644 --- a/charon/src/bin/charon-driver/hax/types/def_id.rs +++ b/charon/src/bin/charon-driver/hax/types/def_id.rs @@ -38,7 +38,9 @@ pub enum DefKind { AssocTy, TyParam, Fn, - Const, + Const { + is_type_const: bool, + }, ConstParam, Static { safety: Safety, @@ -47,7 +49,9 @@ pub enum DefKind { }, Ctor(CtorOf, CtorKind), AssocFn, - AssocConst, + AssocConst { + is_type_const: bool, + }, Macro(MacroKinds), ExternCrate, Use, @@ -267,9 +271,9 @@ impl DefId { pub fn visibility<'tcx>(&self, tcx: ty::TyCtxt<'tcx>) -> Option { use DefKind::*; match self.kind { - AssocConst + AssocConst { .. } | AssocFn - | Const + | Const { .. } | Enum | Field | Fn @@ -393,11 +397,9 @@ pub enum DefPathItem { LifetimeNs(Symbol), Closure, Ctor, - LateAnonConst, AnonConst, #[disable_mapping] PromotedConst, - DesugaredAnonymousLifetime, OpaqueTy, OpaqueLifetime(Symbol), AnonAssocTy(Symbol), diff --git a/charon/src/bin/charon-driver/hax/types/mod.rs b/charon/src/bin/charon-driver/hax/types/mod.rs index b61ea4cfc..7de4017ce 100644 --- a/charon/src/bin/charon-driver/hax/types/mod.rs +++ b/charon/src/bin/charon-driver/hax/types/mod.rs @@ -13,7 +13,7 @@ use crate::hax::sinto_todo; sinto_reexport!(rustc_span::Span); -pub use rustc_span::source_map::Spanned; +pub use rustc_span::Spanned; impl<'s, S: UnderOwnerState<'s>, T: SInto, U> SInto> for Spanned { fn sinto<'a>(&self, s: &S) -> Spanned { Spanned { diff --git a/charon/src/bin/charon-driver/hax/types/new/full_def.rs b/charon/src/bin/charon-driver/hax/types/new/full_def.rs index 0c3d356f6..fa3a42a66 100644 --- a/charon/src/bin/charon-driver/hax/types/new/full_def.rs +++ b/charon/src/bin/charon-driver/hax/types/new/full_def.rs @@ -1204,7 +1204,7 @@ impl<'tcx> FullDef<'tcx> { let tcx = s.base().tcx; for impl_def_id in tcx.inherent_impls(rust_def_id) { children.extend( - tcx.associated_items(impl_def_id) + tcx.associated_items(*impl_def_id) .in_definition_order() .filter_map(|assoc| Some((assoc.opt_name()?, assoc.def_id).sinto(s))), ); diff --git a/charon/src/bin/charon-driver/hax/types/new/item_ref.rs b/charon/src/bin/charon-driver/hax/types/new/item_ref.rs index 6810b086f..39c23eeb5 100644 --- a/charon/src/bin/charon-driver/hax/types/new/item_ref.rs +++ b/charon/src/bin/charon-driver/hax/types/new/item_ref.rs @@ -192,7 +192,7 @@ impl ItemRef { let tref = ty::TraitRef::new(tcx, def_id, generics); rustc_utils::assoc_tys_for_trait(tcx, typing_env, tref) .into_iter() - .map(|alias_ty| ty::Ty::new_alias(tcx, ty::Projection, alias_ty)) + .map(|alias_ty| ty::Ty::new_alias(tcx, alias_ty)) .map(|ty| normalize(tcx, typing_env, ty)) .map(|ty| ty.sinto(s)) .collect() diff --git a/charon/src/bin/charon-driver/hax/types/ty.rs b/charon/src/bin/charon-driver/hax/types/ty.rs index ba96a774c..e2a9f2148 100644 --- a/charon/src/bin/charon-driver/hax/types/ty.rs +++ b/charon/src/bin/charon-driver/hax/types/ty.rs @@ -629,25 +629,21 @@ pub enum AliasKind { impl Alias { #[tracing::instrument(level = "trace", skip(s))] - fn from<'tcx, S: UnderOwnerState<'tcx>>( - s: &S, - alias_kind: &rustc_type_ir::AliasTyKind, - alias_ty: &ty::AliasTy<'tcx>, - ) -> TyKind { + fn from<'tcx, S: UnderOwnerState<'tcx>>(s: &S, alias_ty: &ty::AliasTy<'tcx>) -> TyKind { let tcx = s.base().tcx; let typing_env = s.typing_env(); use rustc_type_ir::AliasTyKind as RustAliasKind; // Try to normalize the alias first. - let ty = ty::Ty::new_alias(tcx, *alias_kind, *alias_ty); + let ty = ty::Ty::new_alias(tcx, *alias_ty); let ty = crate::hax::traits::normalize(tcx, typing_env, ty); - let ty::Alias(alias_kind, alias_ty) = ty.kind() else { + let ty::Alias(alias_ty) = ty.kind() else { let ty: Ty = ty.sinto(s); return ty.kind().clone(); }; - let kind = match alias_kind { - RustAliasKind::Projection => { + let kind = match alias_ty.kind { + RustAliasKind::Projection { def_id } => { // FIXME: In a case like: // ``` // impl Trait for Result @@ -662,22 +658,22 @@ impl Alias { // just erase them. See also https://github.com/hacspec/hax/issues/747. // FIXME: at least only erase the trait regions let args = crate::hax::traits::erase_free_regions(tcx, alias_ty.args); - AliasKind::Projection(ItemRef::translate(s, alias_ty.def_id, args)) + AliasKind::Projection(ItemRef::translate(s, def_id, args)) } - RustAliasKind::Inherent => AliasKind::Inherent, - RustAliasKind::Opaque => { + RustAliasKind::Inherent { .. } => AliasKind::Inherent, + RustAliasKind::Opaque { def_id } => { // Reveal the underlying `impl Trait` type. - let ty = tcx.type_of(alias_ty.def_id).instantiate(tcx, alias_ty.args); + let ty = tcx.type_of(def_id).instantiate(tcx, alias_ty.args); AliasKind::Opaque { hidden_ty: ty.sinto(s), } } - RustAliasKind::Free => AliasKind::Free, + RustAliasKind::Free { .. } => AliasKind::Free, }; TyKind::Alias(Alias { kind, args: alias_ty.args.sinto(s), - def_id: alias_ty.def_id.sinto(s), + def_id: alias_ty.kind.def_id().sinto(s), }) } } @@ -798,7 +794,7 @@ pub enum TyKind { #[custom_arm(FROM_TYPE::Coroutine(def_id, generics) => TO_TYPE::Coroutine(translate_item_ref(s, *def_id, generics)),)] Coroutine(ItemRef), Never, - #[custom_arm(FROM_TYPE::Alias(alias_kind, alias_ty) => Alias::from(s, alias_kind, alias_ty),)] + #[custom_arm(FROM_TYPE::Alias(alias_ty) => Alias::from(s, alias_ty),)] Alias(Alias), Param(ParamTy), Bound(BoundVarIndexKind, BoundTy), @@ -902,7 +898,7 @@ fn resolve_for_dyn<'tcx, S: UnderOwnerState<'tcx>, R>( let Term::Ty(ty) = proj.skip_binder().term.sinto(s) else { unreachable!() }; - let item = tcx.associated_item(alias_ty.def_id); + let item = tcx.associated_item(alias_ty.kind.def_id()); ProjectionPredicate { trait_proof, assoc_item: AssocItem::sfrom(s, &item), @@ -1202,7 +1198,7 @@ impl<'tcx, S: UnderBinderState<'tcx>> SInto let Term::Ty(ty) = self.term.sinto(s) else { unreachable!() }; - let item = tcx.associated_item(alias_ty.def_id); + let item = tcx.associated_item(alias_ty.kind.def_id()); ProjectionPredicate { trait_proof: solve_trait(s, poly_trait_ref), assoc_item: AssocItem::sfrom(s, &item), diff --git a/charon/src/bin/charon-driver/main.rs b/charon/src/bin/charon-driver/main.rs index 44c582bd1..ab74f3f3d 100644 --- a/charon/src/bin/charon-driver/main.rs +++ b/charon/src/bin/charon-driver/main.rs @@ -10,8 +10,6 @@ #![allow(clippy::manual_map)] #![allow(clippy::mem_replace_with_default)] #![allow(clippy::useless_format)] -#![expect(incomplete_features)] -#![feature(box_patterns)] #![feature(deref_patterns)] #![feature(iter_array_chunks)] #![feature(iterator_try_collect)] diff --git a/charon/src/bin/charon-driver/translate/get_mir.rs b/charon/src/bin/charon-driver/translate/get_mir.rs index bcc3464f1..9e5dba7db 100644 --- a/charon/src/bin/charon-driver/translate/get_mir.rs +++ b/charon/src/bin/charon-driver/translate/get_mir.rs @@ -94,9 +94,9 @@ fn get_mir_for_def_id_and_level<'tcx>( // generic or inlineable functions. let is_global = matches!( def_id.kind, - hax::DefKind::Const + hax::DefKind::Const { .. } | hax::DefKind::AnonConst - | hax::DefKind::AssocConst + | hax::DefKind::AssocConst { .. } | hax::DefKind::InlineConst ); let mir_available = tcx.is_mir_available(rust_def_id); diff --git a/charon/src/bin/charon-driver/translate/resolve_path.rs b/charon/src/bin/charon-driver/translate/resolve_path.rs index 7484f1173..20bc29145 100644 --- a/charon/src/bin/charon-driver/translate/resolve_path.rs +++ b/charon/src/bin/charon-driver/translate/resolve_path.rs @@ -120,7 +120,7 @@ pub fn def_path_def_ids<'a, 'tcx>( items = impls .filter(|impl_def_id| { let impl_self_ty = tcx - .impl_trait_ref(impl_def_id) + .impl_trait_ref(*impl_def_id) .skip_binder() .self_ty(); if let ty::Adt(adt_def, _) = impl_self_ty.kind() { diff --git a/charon/src/bin/charon-driver/translate/translate_bodies.rs b/charon/src/bin/charon-driver/translate/translate_bodies.rs index ca9477292..6ae7ba082 100644 --- a/charon/src/bin/charon-driver/translate/translate_bodies.rs +++ b/charon/src/bin/charon-driver/translate/translate_bodies.rs @@ -1100,7 +1100,7 @@ impl<'tcx> BlockTransCtx<'tcx, '_, '_, '_> { use ty::AdtKind; trace!("{:?}", rvalue); - let adt_kind = self.tcx.adt_def(def_id).adt_kind(); + let adt_kind = self.tcx.adt_def(*def_id).adt_kind(); let item = hax::translate_item_ref(&self.hax_state, *def_id, generics); let tref = self.translate_type_decl_ref(span, &item)?; let variant_id = match adt_kind { diff --git a/charon/src/bin/charon-driver/translate/translate_crate.rs b/charon/src/bin/charon-driver/translate/translate_crate.rs index a1fcc424a..5aacc11a0 100644 --- a/charon/src/bin/charon-driver/translate/translate_crate.rs +++ b/charon/src/bin/charon-driver/translate/translate_crate.rs @@ -226,7 +226,7 @@ impl<'tcx> TranslateCtx<'tcx> { Some(match &def_id.kind { Enum | Struct | Union | TyAlias | ForeignTy => TransItemSourceKind::Type, Fn | AssocFn => TransItemSourceKind::Fun, - Const | Static { .. } | AssocConst => TransItemSourceKind::Global, + Const { .. } | Static { .. } | AssocConst { .. } => TransItemSourceKind::Global, Trait | TraitAlias => TransItemSourceKind::TraitDecl, Impl { of_trait: true } => TransItemSourceKind::TraitImpl(TraitImplSource::Normal), Impl { of_trait: false } => TransItemSourceKind::InherentImpl, diff --git a/charon/src/bin/charon-driver/translate/translate_predicates.rs b/charon/src/bin/charon-driver/translate/translate_predicates.rs index beab1bac6..a12d03f69 100644 --- a/charon/src/bin/charon-driver/translate/translate_predicates.rs +++ b/charon/src/bin/charon-driver/translate/translate_predicates.rs @@ -40,6 +40,7 @@ impl<'tcx> TranslateCtx<'tcx> { SolverTraitLangItem::Destruct => BuiltinImplData::UntrackedDestruct, SolverTraitLangItem::DiscriminantKind => BuiltinImplData::DiscriminantKind, SolverTraitLangItem::Drop => return None, + SolverTraitLangItem::Field => return None, SolverTraitLangItem::Fn => BuiltinImplData::Fn, SolverTraitLangItem::FnMut => BuiltinImplData::FnMut, SolverTraitLangItem::FnOnce => BuiltinImplData::FnOnce, diff --git a/charon/src/transform/typecheck_and_unify.rs b/charon/src/transform/typecheck_and_unify.rs index 815c7913a..6f39dccff 100644 --- a/charon/src/transform/typecheck_and_unify.rs +++ b/charon/src/transform/typecheck_and_unify.rs @@ -442,10 +442,8 @@ impl VisitAstMut for TypeCheckVisitor<'_> { } fn enter_trait_ref(&mut self, x: &mut TraitRef) { match &x.kind { - TraitRefKind::Clause(var) => { - if self.binder_stack.get_var(*var).is_none() { - self.error(format!("Found incorrect clause var: {var}")); - } + TraitRefKind::Clause(var) if self.binder_stack.get_var(*var).is_none() => { + self.error(format!("Found incorrect clause var: {var}")); } TraitRefKind::BuiltinOrAuto { parent_trait_refs, diff --git a/charon/tests/crate_data.rs b/charon/tests/crate_data.rs index e4d47e226..a40232f94 100644 --- a/charon/tests/crate_data.rs +++ b/charon/tests/crate_data.rs @@ -1,5 +1,3 @@ -#![feature(box_patterns)] - use charon_lib::llbc_ast::*; use itertools::Itertools; use std::collections::HashMap; diff --git a/charon/tests/layout.rs b/charon/tests/layout.rs index a00af8aba..521847f0d 100644 --- a/charon/tests/layout.rs +++ b/charon/tests/layout.rs @@ -1,4 +1,3 @@ -#![feature(box_patterns)] use itertools::Itertools; use std::path::PathBuf; diff --git a/charon/tests/ui/advanced-const-generics.out b/charon/tests/ui/advanced-const-generics.out index 35cd70e58..a3b8d1c27 100644 --- a/charon/tests/ui/advanced-const-generics.out +++ b/charon/tests/ui/advanced-const-generics.out @@ -19,11 +19,11 @@ where pub trait Eq { proof ImpliedClause0: (Self: PartialEq) - fn assert_receiver_is_total_eq<'_0_1> = core::cmp::Eq::assert_receiver_is_total_eq<'_0_1, Self>[Self] + fn assert_fields_are_eq<'_0_1> = core::cmp::Eq::assert_fields_are_eq<'_0_1, Self>[Self] non-dyn-compatible } -pub fn core::cmp::Eq::assert_receiver_is_total_eq<'_0, Self>(_1: &'_0 Self) +pub fn core::cmp::Eq::assert_fields_are_eq<'_0, Self>(_1: &'_0 Self) where TraitClause0: (Self: Eq), = @@ -94,8 +94,8 @@ enum Foo { B, } -// Full name: test_crate::{impl Eq for Foo}::assert_receiver_is_total_eq -pub fn {impl Eq for Foo}::assert_receiver_is_total_eq<'_0>(self_1: &'_0 Foo) +// Full name: test_crate::{impl Eq for Foo}::assert_fields_are_eq +pub fn {impl Eq for Foo}::assert_fields_are_eq<'_0>(self_1: &'_0 Foo) { let _0: (); // return let self_1: &'1 Foo; // arg #1 @@ -149,7 +149,7 @@ impl PartialEq for Foo { // Full name: test_crate::{impl Eq for Foo} impl Eq for Foo { proof ImpliedClause0: (Foo: PartialEq) = {impl PartialEq for Foo} - fn assert_receiver_is_total_eq<'_0_1> = {impl Eq for Foo}::assert_receiver_is_total_eq<'_0_1> + fn assert_fields_are_eq<'_0_1> = {impl Eq for Foo}::assert_fields_are_eq<'_0_1> non-dyn-compatible } diff --git a/charon/tests/ui/copy_nonoverlapping.out b/charon/tests/ui/copy_nonoverlapping.out index 0bce2cabd..aa6b5bedb 100644 --- a/charon/tests/ui/copy_nonoverlapping.out +++ b/charon/tests/ui/copy_nonoverlapping.out @@ -110,7 +110,7 @@ pub struct Error {} // Full name: core::ptr::non_null::NonNull #[lang_item("NonNull")] pub struct NonNull { - pointer: *const T, + pointer: *const T is !null, } // Full name: core::result::Result @@ -192,7 +192,7 @@ impl Copy for usize { non-dyn-compatible } -// Full name: core::ptr::alignment::AlignmentEnum +// Full name: core::mem::alignment::AlignmentEnum enum AlignmentEnum { _Align1Shl0, _Align1Shl1, @@ -260,62 +260,11 @@ enum AlignmentEnum { _Align1Shl63, } -// Full name: core::ptr::alignment::Alignment +// Full name: core::mem::alignment::Alignment pub struct Alignment { _inner_repr_trick: AlignmentEnum, } -// Full name: core::mem::SizedTypeProperties -pub trait SizedTypeProperties -{ - proof ImpliedClause0: (Self: 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::SIZE -#[lang_item("mem_size_const")] -pub fn SIZE() -> usize -where - TraitClause0: (Self: SizedTypeProperties), -{ - let _0: usize; // return - - _0 = size_of[TraitClause0::ImpliedClause0]() - return -} - -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub const SIZE: usize -where - TraitClause0: (Self: SizedTypeProperties), - = SIZE() - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub fn ALIGN() -> usize -where - TraitClause0: (Self: SizedTypeProperties), -{ - let _0: usize; // return - - _0 = align_of[TraitClause0::ImpliedClause0]() - return -} - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub const ALIGN: usize -where - TraitClause0: (Self: SizedTypeProperties), - = ALIGN() - // Full name: core::panicking::panic_nounwind_fmt pub fn panic_nounwind_fmt<'_0>(fmt_1: Arguments<'_0>, force_no_backtrace_2: bool) -> ! { @@ -337,7 +286,7 @@ pub fn panic_nounwind_fmt<'_0>(fmt_1: Arguments<'_0>, force_no_backtrace_2: bool _0 = compiletime<'6>(move _3.0, move _3.1) } -fn core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(align_1: usize) +fn core::mem::alignment::{Alignment}::new_unchecked::precondition_check(align_1: usize) { let _0: (); // return let align_1: usize; // arg #1 @@ -408,7 +357,7 @@ where Some(T), } -// Full name: core::ptr::alignment::{Alignment}::new +// Full name: core::mem::alignment::{Alignment}::new pub fn new(align_1: usize) -> Option[{built_in impl Sized for Alignment}] { let _0: Option[{built_in impl Sized for Alignment}]; // return @@ -438,7 +387,7 @@ pub fn new(align_1: usize) -> Option[{built_in impl Sized for Alignme storage_live(_5) _5 = ub_checks if move _5 { - _4 = core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(copy align_1) + _4 = core::mem::alignment::{Alignment}::new_unchecked::precondition_check(copy align_1) } else { } _2 = transmute(copy align_1) @@ -447,6 +396,57 @@ pub fn new(align_1: usize) -> Option[{built_in impl Sized for Alignme return } +// Full name: core::mem::SizedTypeProperties +pub trait SizedTypeProperties +{ + proof ImpliedClause0: (Self: 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::SIZE +#[lang_item("mem_size_const")] +pub fn SIZE() -> usize +where + TraitClause0: (Self: SizedTypeProperties), +{ + let _0: usize; // return + + _0 = size_of[TraitClause0::ImpliedClause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::SIZE +#[lang_item("mem_size_const")] +pub const SIZE: usize +where + TraitClause0: (Self: SizedTypeProperties), + = SIZE() + +// Full name: core::mem::SizedTypeProperties::ALIGN +#[lang_item("mem_align_const")] +pub fn ALIGN() -> usize +where + TraitClause0: (Self: SizedTypeProperties), +{ + let _0: usize; // return + + _0 = align_of[TraitClause0::ImpliedClause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::ALIGN +#[lang_item("mem_align_const")] +pub const ALIGN: usize +where + TraitClause0: (Self: SizedTypeProperties), + = ALIGN() + // Full name: core::option::unwrap_failed fn unwrap_failed() -> ! { diff --git a/charon/tests/ui/dyn-with-diamond-supertraits.out b/charon/tests/ui/dyn-with-diamond-supertraits.out index 97f7786a4..bff213d72 100644 --- a/charon/tests/ui/dyn-with-diamond-supertraits.out +++ b/charon/tests/ui/dyn-with-diamond-supertraits.out @@ -119,11 +119,11 @@ where struct test_crate::Join::{vtable} { size: usize, align: usize, - drop: unsafe fn(*mut (dyn Join)), - method_join_method: fn<'_0_1>(&'_0_1 (dyn Join)) -> (Ty2, Ty3), + drop: unsafe fn(*mut (dyn Join)), + method_join_method: fn<'_0_1>(&'_0_1 (dyn Join)) -> (Ty3, Ty2), super_trait_0: &'static core::marker::MetaSized::{vtable}, - super_trait_1: &'static test_crate::Left::{vtable}, - super_trait_2: &'static test_crate::Right::{vtable}, + super_trait_1: &'static test_crate::Left::{vtable}, + super_trait_2: &'static test_crate::Right::{vtable}, } // Full name: test_crate::Join @@ -494,28 +494,28 @@ fn {impl Join for i32}::join_method<'_0>(self_1: &'_0 i32) -> (i32, i32) } // Full name: test_crate::{impl Join for i32}::join_method::{vtable_method} -fn {impl Join for i32}::join_method::{vtable_method}<'_0>(_1: &'_0 (dyn Join)) -> (i32, i32) +fn {impl Join for i32}::join_method::{vtable_method}<'_0>(_1: &'_0 (dyn Join)) -> (i32, i32) { let _0: (i32, i32); // return - let _1: &'_0 (dyn Join + '0); // arg #1 + let _1: &'_0 (dyn Join + '0); // arg #1 let _2: &'_0 i32; // anonymous local storage_live(_2) - _2 = concretize<&'_0 (dyn Join + '1), &'_0 i32>(move _1) + _2 = concretize<&'_0 (dyn Join + '1), &'_0 i32>(move _1) _0 = {impl Join for i32}::join_method<'_0>(move _2) return } // Full name: test_crate::{impl Join for i32}::{vtable_drop_shim} -unsafe fn {impl Join for i32}::{vtable_drop_shim}(dyn_self_1: *mut (dyn Join)) +unsafe fn {impl Join for i32}::{vtable_drop_shim}(dyn_self_1: *mut (dyn Join)) { let ret_0: (); // return - let dyn_self_1: *mut (dyn Join + '0); // arg #1 + let dyn_self_1: *mut (dyn Join + '0); // arg #1 let target_self_2: *mut i32; // local ret_0 = () storage_live(target_self_2) - target_self_2 = concretize<*mut (dyn Join + '1), *mut i32>(move dyn_self_1) + target_self_2 = concretize<*mut (dyn Join + '1), *mut i32>(move dyn_self_1) return } @@ -557,11 +557,11 @@ impl Join for i32 { fn main() { let _0: (); // return - let v_1: &'3 (dyn Join + '4); // local + let v_1: &'3 (dyn Join + '4); // local let _2: &'6 i32; // anonymous local let _3: &'7 i32; // anonymous local let _4: (i32, i32); // anonymous local - let _5: &'8 (dyn Join + '9); // anonymous local + let _5: &'8 (dyn Join + '9); // anonymous local let _6: &'10 i32; // anonymous local let _7: &'11 i32; // anonymous local let _8: &'19 i32; // anonymous local @@ -581,7 +581,7 @@ fn main() _6 = move _7 _3 = &(*_6) _2 = &(*_3) - v_1 = unsize_cast<&'6 i32, &'12 (dyn Join + '13), &{impl Join for i32}::{vtable}>(move _2) + v_1 = unsize_cast<&'6 i32, &'12 (dyn Join + '13), &{impl Join for i32}::{vtable}>(move _2) storage_dead(_2) storage_dead(_3) storage_live(_4) diff --git a/charon/tests/ui/issue-114-opaque-bodies.out b/charon/tests/ui/issue-114-opaque-bodies.out index 6efe068c2..c1c0cbba0 100644 --- a/charon/tests/ui/issue-114-opaque-bodies.out +++ b/charon/tests/ui/issue-114-opaque-bodies.out @@ -125,7 +125,7 @@ pub const MAX: usize = MAX() // Full name: core::ptr::non_null::NonNull #[lang_item("NonNull")] pub struct NonNull { - pointer: *const T, + pointer: *const T is !null, } // Full name: core::ptr::unique::Unique diff --git a/charon/tests/ui/iterator.out b/charon/tests/ui/iterator.out index 4a2e1237d..e54495f18 100644 --- a/charon/tests/ui/iterator.out +++ b/charon/tests/ui/iterator.out @@ -69,6 +69,7 @@ pub trait Try proof ImpliedClause1: (Self: FromResidual) proof ImpliedClause2: (Self::Output: Sized) proof ImpliedClause3: (Self::Residual: Sized) + proof ImpliedClause4: (Self::Residual: Residual) type Output type Residual fn from_output = from_output[Self] @@ -413,6 +414,7 @@ pub trait Eq { proof ImpliedClause0: (Self: PartialEq) fn assert_receiver_is_total_eq<'_0_1> = assert_receiver_is_total_eq<'_0_1, Self>[Self] + fn assert_fields_are_eq<'_0_1> = assert_fields_are_eq<'_0_1, Self>[Self] non-dyn-compatible } @@ -552,8 +554,8 @@ pub trait DoubleEndedIterator fn next_back<'_0_1> = next_back<'_0_1, Self>[Self] fn advance_back_by<'_0_1> = advance_back_by<'_0_1, Self>[Self] fn nth_back<'_0_1> = nth_back<'_0_1, Self>[Self] - fn try_rfold<'_0_1, B, F, R, TraitClause0_1: (B: Sized), TraitClause1_1: (F: Sized), TraitClause2_1: (R: Sized), TraitClause3_1: (Self: Sized), TraitClause4_1: (F: FnMut<(B, Self::ImpliedClause1::Item)>), TraitClause5_1: (R: Try), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause5_1::Output = B> = try_rfold<'_0_1, Self, B, F, R>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] - fn rfold), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = B> = rfold[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1] + fn try_rfold<'_0_1, B, F, R, TraitClause0_1: (B: Sized), TraitClause1_1: (F: Sized), TraitClause2_1: (R: Sized), TraitClause3_1: (Self: Sized), TraitClause4_1: (F: FnMut<(B, Self::ImpliedClause1::Item)>), TraitClause5_1: (F: Destruct), TraitClause6_1: (R: Try), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause6_1::Output = B> = try_rfold<'_0_1, Self, B, F, R>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1, TraitClause6_1] + fn rfold), TraitClause5_1: (F: Destruct), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = B> = rfold[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] fn rfind<'_0_1, P, TraitClause0_1: (P: Sized), TraitClause1_1: (Self: Sized), TraitClause2_1: for<'_0_2> (P: FnMut<(&'_0_2 Self::ImpliedClause1::Item,)>), TypeConstraint0: for<'_0_2> TraitClause2_1::ImpliedClause1::Output = bool> = rfind<'_0_1, Self, P>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1] vtable: core::iter::traits::double_ended::DoubleEndedIterator::{vtable} } @@ -578,8 +580,8 @@ pub trait Iterator fn next<'_0_1> = core::iter::traits::iterator::Iterator::next<'_0_1, Self>[Self] fn next_chunk<'_0_1, const N : usize, TraitClause0_1: (Self: Sized)> = core::iter::traits::iterator::Iterator::next_chunk<'_0_1, Self, N>[Self, TraitClause0_1] fn size_hint<'_0_1> = core::iter::traits::iterator::Iterator::size_hint<'_0_1, Self>[Self] - fn count = core::iter::traits::iterator::Iterator::count[Self, TraitClause0_1] - fn last = core::iter::traits::iterator::Iterator::last[Self, TraitClause0_1] + fn count = core::iter::traits::iterator::Iterator::count[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1] + fn last = core::iter::traits::iterator::Iterator::last[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1] fn advance_by<'_0_1> = core::iter::traits::iterator::Iterator::advance_by<'_0_1, Self>[Self] fn nth<'_0_1> = core::iter::traits::iterator::Iterator::nth<'_0_1, Self>[Self] fn step_by = core::iter::traits::iterator::Iterator::step_by[Self, TraitClause0_1] @@ -611,11 +613,11 @@ pub trait Iterator fn partition), TraitClause5_1: for<'_0_2> (F: FnMut<(&'_0_2 Self::Item,)>), TypeConstraint0: for<'_0_2> TraitClause5_1::ImpliedClause1::Output = bool> = core::iter::traits::iterator::Iterator::partition[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] fn partition_in_place<'a, T, P, TraitClause0_1: (T: Sized), TraitClause1_1: (P: Sized), TraitClause2_1: (Self: Sized), TraitClause3_1: (Self: DoubleEndedIterator), TraitClause4_1: for<'_0_2> (P: FnMut<(&'_0_2 T,)>), TypeOutlives0: T: 'a, TypeConstraint0: Self::Item = &'a mut T, TypeConstraint1: for<'_0_2> TraitClause4_1::ImpliedClause1::Output = bool> = core::iter::traits::iterator::Iterator::partition_in_place<'a, Self, T, P>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] fn is_partitioned), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = core::iter::traits::iterator::Iterator::is_partitioned[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1] - fn try_fold<'_0_1, B, F, R, TraitClause0_1: (B: Sized), TraitClause1_1: (F: Sized), TraitClause2_1: (R: Sized), TraitClause3_1: (Self: Sized), TraitClause4_1: (F: FnMut<(B, Self::Item)>), TraitClause5_1: (R: Try), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause5_1::Output = B> = core::iter::traits::iterator::Iterator::try_fold<'_0_1, Self, B, F, R>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn try_fold<'_0_1, B, F, R, TraitClause0_1: (B: Sized), TraitClause1_1: (F: Sized), TraitClause2_1: (R: Sized), TraitClause3_1: (Self: Sized), TraitClause4_1: (F: FnMut<(B, Self::Item)>), TraitClause5_1: (F: Destruct), TraitClause6_1: (R: Try), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause6_1::Output = B> = core::iter::traits::iterator::Iterator::try_fold<'_0_1, Self, B, F, R>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1, TraitClause6_1] fn try_for_each<'_0_1, F, R, TraitClause0_1: (F: Sized), TraitClause1_1: (R: Sized), TraitClause2_1: (Self: Sized), TraitClause3_1: (F: FnMut<(Self::Item,)>), TraitClause4_1: (R: Try), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause4_1::Output = ()> = core::iter::traits::iterator::Iterator::try_for_each<'_0_1, Self, F, R>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] - fn fold), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = B> = core::iter::traits::iterator::Iterator::fold[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1] - fn reduce), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = Self::Item> = core::iter::traits::iterator::Iterator::reduce[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1] - fn try_reduce<'_0_1, R, T2, TraitClause0_1: (R: Sized), TraitClause1_1: (T2: Sized), TraitClause2_1: (Self: Sized), TraitClause3_1: (R: Try), TraitClause4_1: (TraitClause3_1::Residual: Residual[Self::ImpliedClause1]>), TraitClause5_1: (T2: FnMut<(Self::Item, Self::Item)>), TypeConstraint0: TraitClause3_1::Output = Self::Item, TypeConstraint1: TraitClause5_1::ImpliedClause1::Output = R> = core::iter::traits::iterator::Iterator::try_reduce<'_0_1, Self, R, T2>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn fold), TraitClause5_1: (F: Destruct), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = B> = core::iter::traits::iterator::Iterator::fold[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn reduce), TraitClause4_1: (F: Destruct), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = Self::Item> = core::iter::traits::iterator::Iterator::reduce[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] + fn try_reduce<'_0_1, R, T2, TraitClause0_1: (R: Sized), TraitClause1_1: (T2: Sized), TraitClause2_1: (Self: Sized), TraitClause3_1: (R: Try), TraitClause4_1: (TraitClause3_1::Residual: Residual[Self::ImpliedClause1]>), TraitClause5_1: (T2: FnMut<(Self::Item, Self::Item)>), TraitClause6_1: (T2: Destruct), TypeConstraint0: TraitClause3_1::Output = Self::Item, TypeConstraint1: TraitClause5_1::ImpliedClause1::Output = R> = core::iter::traits::iterator::Iterator::try_reduce<'_0_1, Self, R, T2>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1, TraitClause6_1] fn all<'_0_1, F, TraitClause0_1: (F: Sized), TraitClause1_1: (Self: Sized), TraitClause2_1: (F: FnMut<(Self::Item,)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = core::iter::traits::iterator::Iterator::all<'_0_1, Self, F>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1] fn any<'_0_1, F, TraitClause0_1: (F: Sized), TraitClause1_1: (Self: Sized), TraitClause2_1: (F: FnMut<(Self::Item,)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = core::iter::traits::iterator::Iterator::any<'_0_1, Self, F>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1] fn find<'_0_1, P, TraitClause0_1: (P: Sized), TraitClause1_1: (Self: Sized), TraitClause2_1: for<'_0_2> (P: FnMut<(&'_0_2 Self::Item,)>), TypeConstraint0: for<'_0_2> TraitClause2_1::ImpliedClause1::Output = bool> = core::iter::traits::iterator::Iterator::find<'_0_1, Self, P>[Self, TraitClause0_1, TraitClause1_1, TraitClause2_1] @@ -1093,6 +1095,7 @@ where TraitClause4: (R: Try), TraitClause5: (TraitClause4::Residual: Residual[{impl Iterator for IntoIter[TraitClause0]}[TraitClause0]::ImpliedClause1]>), TraitClause6: (T2: FnMut<(T, T)>), + TraitClause7: (T2: Destruct), TypeConstraint0: TraitClause4::Output = T, TypeConstraint1: TraitClause6::ImpliedClause1::Output = R, = @@ -1103,8 +1106,10 @@ where TraitClause0: (T: Sized), TraitClause1: (F: Sized), TraitClause2: (IntoIter[TraitClause0]: Sized), - TraitClause3: (F: FnMut<(T, T)>), - TypeConstraint0: TraitClause3::ImpliedClause1::Output = T, + TraitClause3: (IntoIter[TraitClause0]: Destruct), + TraitClause4: (F: FnMut<(T, T)>), + TraitClause5: (F: Destruct), + TypeConstraint0: TraitClause4::ImpliedClause1::Output = T, = // Full name: core::array::iter::{impl Iterator for IntoIter[TraitClause0]}::try_for_each @@ -1462,8 +1467,8 @@ where fn try_fold<'_0_1, B, F, R, TraitClause0_1: (B: Sized), TraitClause1_1: (F: Sized), TraitClause2_1: (R: Sized), TraitClause3_1: (IntoIter[TraitClause0]: Sized), TraitClause4_1: (F: FnMut<(B, T)>), TraitClause5_1: (R: Try), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause5_1::Output = B> = {impl Iterator for IntoIter[TraitClause0]}::try_fold<'_0_1, T, B, F, R, N>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] fn try_for_each<'_0_1, F, R, TraitClause0_1: (F: Sized), TraitClause1_1: (R: Sized), TraitClause2_1: (IntoIter[TraitClause0]: Sized), TraitClause3_1: (F: FnMut<(T,)>), TraitClause4_1: (R: Try), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause4_1::Output = ()> = {impl Iterator for IntoIter[TraitClause0]}::try_for_each<'_0_1, T, F, R, N>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] fn fold), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = Acc> = {impl Iterator for IntoIter[TraitClause0]}::fold[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] - fn reduce[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(T, T)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = T> = {impl Iterator for IntoIter[TraitClause0]}::reduce[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] - fn try_reduce<'_0_1, R, T2, TraitClause0_1: (R: Sized), TraitClause1_1: (T2: Sized), TraitClause2_1: (IntoIter[TraitClause0]: Sized), TraitClause3_1: (R: Try), TraitClause4_1: (TraitClause3_1::Residual: Residual[{impl Iterator for IntoIter[TraitClause0]}[TraitClause0]::ImpliedClause1]>), TraitClause5_1: (T2: FnMut<(T, T)>), TypeConstraint0: TraitClause3_1::Output = T, TypeConstraint1: TraitClause5_1::ImpliedClause1::Output = R> = {impl Iterator for IntoIter[TraitClause0]}::try_reduce<'_0_1, T, R, T2, N>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn reduce[TraitClause0]: Sized), TraitClause2_1: (IntoIter[TraitClause0]: Destruct), TraitClause3_1: (F: FnMut<(T, T)>), TraitClause4_1: (F: Destruct), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = T> = {impl Iterator for IntoIter[TraitClause0]}::reduce[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] + fn try_reduce<'_0_1, R, T2, TraitClause0_1: (R: Sized), TraitClause1_1: (T2: Sized), TraitClause2_1: (IntoIter[TraitClause0]: Sized), TraitClause3_1: (R: Try), TraitClause4_1: (TraitClause3_1::Residual: Residual[{impl Iterator for IntoIter[TraitClause0]}[TraitClause0]::ImpliedClause1]>), TraitClause5_1: (T2: FnMut<(T, T)>), TraitClause6_1: (T2: Destruct), TypeConstraint0: TraitClause3_1::Output = T, TypeConstraint1: TraitClause5_1::ImpliedClause1::Output = R> = {impl Iterator for IntoIter[TraitClause0]}::try_reduce<'_0_1, T, R, T2, N>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1, TraitClause6_1] fn all<'_0_1, F, TraitClause0_1: (F: Sized), TraitClause1_1: (IntoIter[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(T,)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for IntoIter[TraitClause0]}::all<'_0_1, T, F, N>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] fn any<'_0_1, F, TraitClause0_1: (F: Sized), TraitClause1_1: (IntoIter[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(T,)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for IntoIter[TraitClause0]}::any<'_0_1, T, F, N>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] fn find<'_0_1, P, TraitClause0_1: (P: Sized), TraitClause1_1: (IntoIter[TraitClause0]: Sized), TraitClause2_1: for<'_0_2> (P: FnMut<(&'_0_2 T,)>), TypeConstraint0: for<'_0_2> TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for IntoIter[TraitClause0]}::find<'_0_1, T, P, N>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] @@ -1528,11 +1533,18 @@ where = // Full name: core::cmp::Eq::assert_receiver_is_total_eq +#[lang_item("assert_receiver_is_total_eq")] pub fn assert_receiver_is_total_eq<'_0, Self>(_1: &'_0 Self) where TraitClause0: (Self: Eq), = +// Full name: core::cmp::Eq::assert_fields_are_eq +pub fn assert_fields_are_eq<'_0, Self>(_1: &'_0 Self) +where + TraitClause0: (Self: Eq), += + #[lang_item("ord_cmp_method")] pub fn core::cmp::Ord::cmp<'_0, '_1, Self>(_1: &'_0 Self, _2: &'_1 Self) -> Ordering where @@ -1733,9 +1745,10 @@ where TraitClause3: (R: Sized), TraitClause4: (Self: Sized), TraitClause5: (F: FnMut<(B, TraitClause0::ImpliedClause1::Item)>), - TraitClause6: (R: Try), + TraitClause6: (F: Destruct), + TraitClause7: (R: Try), TypeConstraint0: TraitClause5::ImpliedClause1::Output = R, - TypeConstraint1: TraitClause6::Output = B, + TypeConstraint1: TraitClause7::Output = B, = // Full name: core::iter::traits::double_ended::DoubleEndedIterator::rfold @@ -1745,8 +1758,10 @@ where TraitClause1: (B: Sized), TraitClause2: (F: Sized), TraitClause3: (Self: Sized), - TraitClause4: (F: FnMut<(B, TraitClause0::ImpliedClause1::Item)>), - TypeConstraint0: TraitClause4::ImpliedClause1::Output = B, + TraitClause4: (Self: Destruct), + TraitClause5: (F: FnMut<(B, TraitClause0::ImpliedClause1::Item)>), + TraitClause6: (F: Destruct), + TypeConstraint0: TraitClause5::ImpliedClause1::Output = B, = // Full name: core::iter::traits::double_ended::DoubleEndedIterator::rfind @@ -1792,12 +1807,16 @@ pub fn core::iter::traits::iterator::Iterator::count(_1: Self) -> usize where TraitClause0: (Self: Iterator), TraitClause1: (Self: Sized), + TraitClause2: (Self: Destruct), + TraitClause3: (TraitClause0::Item: Destruct), = pub fn core::iter::traits::iterator::Iterator::last(_1: Self) -> Option[TraitClause0::ImpliedClause1] where TraitClause0: (Self: Iterator), TraitClause1: (Self: Sized), + TraitClause2: (Self: Destruct), + TraitClause3: (TraitClause0::Item: Destruct), = pub fn core::iter::traits::iterator::Iterator::advance_by<'_0, Self>(_1: &'_0 mut Self, _2: usize) -> Result<(), NonZero[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}]>[{built_in impl Sized for ()}, {built_in impl Sized for NonZero[{built_in impl Sized for usize}, {impl ZeroablePrimitive for usize}]}] @@ -2071,9 +2090,10 @@ where TraitClause3: (R: Sized), TraitClause4: (Self: Sized), TraitClause5: (F: FnMut<(B, TraitClause0::Item)>), - TraitClause6: (R: Try), + TraitClause6: (F: Destruct), + TraitClause7: (R: Try), TypeConstraint0: TraitClause5::ImpliedClause1::Output = R, - TypeConstraint1: TraitClause6::Output = B, + TypeConstraint1: TraitClause7::Output = B, = pub fn core::iter::traits::iterator::Iterator::try_for_each<'_0, Self, F, R>(_1: &'_0 mut Self, _2: F) -> R @@ -2094,8 +2114,10 @@ where TraitClause1: (B: Sized), TraitClause2: (F: Sized), TraitClause3: (Self: Sized), - TraitClause4: (F: FnMut<(B, TraitClause0::Item)>), - TypeConstraint0: TraitClause4::ImpliedClause1::Output = B, + TraitClause4: (Self: Destruct), + TraitClause5: (F: FnMut<(B, TraitClause0::Item)>), + TraitClause6: (F: Destruct), + TypeConstraint0: TraitClause5::ImpliedClause1::Output = B, = pub fn core::iter::traits::iterator::Iterator::reduce(_1: Self, _2: F) -> Option[TraitClause0::ImpliedClause1] @@ -2103,8 +2125,10 @@ where TraitClause0: (Self: Iterator), TraitClause1: (F: Sized), TraitClause2: (Self: Sized), - TraitClause3: (F: FnMut<(TraitClause0::Item, TraitClause0::Item)>), - TypeConstraint0: TraitClause3::ImpliedClause1::Output = TraitClause0::Item, + TraitClause3: (Self: Destruct), + TraitClause4: (F: FnMut<(TraitClause0::Item, TraitClause0::Item)>), + TraitClause5: (F: Destruct), + TypeConstraint0: TraitClause4::ImpliedClause1::Output = TraitClause0::Item, = pub fn core::iter::traits::iterator::Iterator::try_reduce<'_0, Self, R, T2>(_1: &'_0 mut Self, _2: T2) -> TraitClause5::TryType @@ -2116,6 +2140,7 @@ where TraitClause4: (R: Try), TraitClause5: (TraitClause4::Residual: Residual[TraitClause0::ImpliedClause1]>), TraitClause6: (T2: FnMut<(TraitClause0::Item, TraitClause0::Item)>), + TraitClause7: (T2: Destruct), TypeConstraint0: TraitClause4::Output = TraitClause0::Item, TypeConstraint1: TraitClause6::ImpliedClause1::Output = R, = @@ -2956,6 +2981,7 @@ where TraitClause4: (R: Try), TraitClause5: (TraitClause4::Residual: Residual[{impl Iterator for Iter<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::ImpliedClause1]>), TraitClause6: (T2: FnMut<(&'a T, &'a T)>), + TraitClause7: (T2: Destruct), TypeConstraint0: TraitClause4::Output = &'a T, TypeConstraint1: TraitClause6::ImpliedClause1::Output = R, = @@ -2966,8 +2992,10 @@ where TraitClause0: (T: Sized), TraitClause1: (F: Sized), TraitClause2: (Iter<'a, T>[TraitClause0]: Sized), - TraitClause3: (F: FnMut<(&'a T, &'a T)>), - TypeConstraint0: TraitClause3::ImpliedClause1::Output = &'a T, + TraitClause3: (Iter<'a, T>[TraitClause0]: Destruct), + TraitClause4: (F: FnMut<(&'a T, &'a T)>), + TraitClause5: (F: Destruct), + TypeConstraint0: TraitClause4::ImpliedClause1::Output = &'a T, = // Full name: core::slice::iter::{impl Iterator for Iter<'a, T>[TraitClause0]}::try_for_each @@ -2992,9 +3020,10 @@ where TraitClause3: (R: Sized), TraitClause4: (Iter<'a, T>[TraitClause0]: Sized), TraitClause5: (F: FnMut<(B, &'a T)>), - TraitClause6: (R: Try), + TraitClause6: (F: Destruct), + TraitClause7: (R: Try), TypeConstraint0: TraitClause5::ImpliedClause1::Output = R, - TypeConstraint1: TraitClause6::Output = B, + TypeConstraint1: TraitClause7::Output = B, = // Full name: core::slice::iter::{impl Iterator for Iter<'a, T>[TraitClause0]}::is_partitioned @@ -3313,11 +3342,11 @@ where fn partition[TraitClause0]: Sized), TraitClause3_1: (B: Default), TraitClause4_1: (B: Extend<&'a T>), TraitClause5_1: for<'_0_2> (F: FnMut<(&'_0_2 &'a T,)>), TypeConstraint0: for<'_0_2> TraitClause5_1::ImpliedClause1::Output = bool> = {impl Iterator for Iter<'a, T>[TraitClause0]}::partition<'a, T, B, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] fn partition_in_place<'a, T, P, TraitClause0_1: (T: Sized), TraitClause1_1: (P: Sized), TraitClause2_1: (Iter<'a, T>[TraitClause0]: Sized), TraitClause3_1: (Iter<'a, T>[TraitClause0]: DoubleEndedIterator), TraitClause4_1: for<'_0_2> (P: FnMut<(&'_0_2 T,)>), TypeOutlives0: T: 'a, TypeConstraint0: {impl Iterator for Iter<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::Item = &'a mut T, TypeConstraint1: for<'_0_2> TraitClause4_1::ImpliedClause1::Output = bool> = {impl Iterator for Iter<'a, T>[TraitClause0]}::partition_in_place<'a, 'a, T, T, P>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] fn is_partitioned[TraitClause0]: Sized), TraitClause2_1: (P: FnMut<(&'a T,)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for Iter<'a, T>[TraitClause0]}::is_partitioned<'a, T, P>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] - fn try_fold<'_0_1, B, F, R, TraitClause0_1: (B: Sized), TraitClause1_1: (F: Sized), TraitClause2_1: (R: Sized), TraitClause3_1: (Iter<'a, T>[TraitClause0]: Sized), TraitClause4_1: (F: FnMut<(B, &'a T)>), TraitClause5_1: (R: Try), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause5_1::Output = B> = {impl Iterator for Iter<'a, T>[TraitClause0]}::try_fold<'a, '_0_1, T, B, F, R>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn try_fold<'_0_1, B, F, R, TraitClause0_1: (B: Sized), TraitClause1_1: (F: Sized), TraitClause2_1: (R: Sized), TraitClause3_1: (Iter<'a, T>[TraitClause0]: Sized), TraitClause4_1: (F: FnMut<(B, &'a T)>), TraitClause5_1: (F: Destruct), TraitClause6_1: (R: Try), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause6_1::Output = B> = {impl Iterator for Iter<'a, T>[TraitClause0]}::try_fold<'a, '_0_1, T, B, F, R>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1, TraitClause6_1] fn try_for_each<'_0_1, F, R, TraitClause0_1: (F: Sized), TraitClause1_1: (R: Sized), TraitClause2_1: (Iter<'a, T>[TraitClause0]: Sized), TraitClause3_1: (F: FnMut<(&'a T,)>), TraitClause4_1: (R: Try), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause4_1::Output = ()> = {impl Iterator for Iter<'a, T>[TraitClause0]}::try_for_each<'a, '_0_1, T, F, R>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] fn fold), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = B> = {impl Iterator for Iter<'a, T>[TraitClause0]}::fold<'a, T, B, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] - fn reduce[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(&'a T, &'a T)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = &'a T> = {impl Iterator for Iter<'a, T>[TraitClause0]}::reduce<'a, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] - fn try_reduce<'_0_1, R, T2, TraitClause0_1: (R: Sized), TraitClause1_1: (T2: Sized), TraitClause2_1: (Iter<'a, T>[TraitClause0]: Sized), TraitClause3_1: (R: Try), TraitClause4_1: (TraitClause3_1::Residual: Residual[{impl Iterator for Iter<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::ImpliedClause1]>), TraitClause5_1: (T2: FnMut<(&'a T, &'a T)>), TypeConstraint0: TraitClause3_1::Output = &'a T, TypeConstraint1: TraitClause5_1::ImpliedClause1::Output = R> = {impl Iterator for Iter<'a, T>[TraitClause0]}::try_reduce<'a, '_0_1, T, R, T2>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn reduce[TraitClause0]: Sized), TraitClause2_1: (Iter<'a, T>[TraitClause0]: Destruct), TraitClause3_1: (F: FnMut<(&'a T, &'a T)>), TraitClause4_1: (F: Destruct), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = &'a T> = {impl Iterator for Iter<'a, T>[TraitClause0]}::reduce<'a, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] + fn try_reduce<'_0_1, R, T2, TraitClause0_1: (R: Sized), TraitClause1_1: (T2: Sized), TraitClause2_1: (Iter<'a, T>[TraitClause0]: Sized), TraitClause3_1: (R: Try), TraitClause4_1: (TraitClause3_1::Residual: Residual[{impl Iterator for Iter<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::ImpliedClause1]>), TraitClause5_1: (T2: FnMut<(&'a T, &'a T)>), TraitClause6_1: (T2: Destruct), TypeConstraint0: TraitClause3_1::Output = &'a T, TypeConstraint1: TraitClause5_1::ImpliedClause1::Output = R> = {impl Iterator for Iter<'a, T>[TraitClause0]}::try_reduce<'a, '_0_1, T, R, T2>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1, TraitClause6_1] fn all<'_0_1, F, TraitClause0_1: (F: Sized), TraitClause1_1: (Iter<'a, T>[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(&'a T,)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for Iter<'a, T>[TraitClause0]}::all<'a, '_0_1, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] fn any<'_0_1, F, TraitClause0_1: (F: Sized), TraitClause1_1: (Iter<'a, T>[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(&'a T,)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for Iter<'a, T>[TraitClause0]}::any<'a, '_0_1, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] fn find<'_0_1, P, TraitClause0_1: (P: Sized), TraitClause1_1: (Iter<'a, T>[TraitClause0]: Sized), TraitClause2_1: for<'_0_2> (P: FnMut<(&'_0_2 &'a T,)>), TypeConstraint0: for<'_0_2> TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for Iter<'a, T>[TraitClause0]}::find<'a, '_0_1, T, P>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] @@ -3778,6 +3807,7 @@ where TraitClause4: (R: Try), TraitClause5: (TraitClause4::Residual: Residual[{impl Iterator for Chunks<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::ImpliedClause1]>), TraitClause6: (T2: FnMut<(&'a [T], &'a [T])>), + TraitClause7: (T2: Destruct), TypeConstraint0: TraitClause4::Output = &'a [T], TypeConstraint1: TraitClause6::ImpliedClause1::Output = R, = @@ -3788,8 +3818,10 @@ where TraitClause0: (T: Sized), TraitClause1: (F: Sized), TraitClause2: (Chunks<'a, T>[TraitClause0]: Sized), - TraitClause3: (F: FnMut<(&'a [T], &'a [T])>), - TypeConstraint0: TraitClause3::ImpliedClause1::Output = &'a [T], + TraitClause3: (Chunks<'a, T>[TraitClause0]: Destruct), + TraitClause4: (F: FnMut<(&'a [T], &'a [T])>), + TraitClause5: (F: Destruct), + TypeConstraint0: TraitClause4::ImpliedClause1::Output = &'a [T], = // Full name: core::slice::iter::{impl Iterator for Chunks<'a, T>[TraitClause0]}::fold @@ -3799,8 +3831,10 @@ where TraitClause1: (B: Sized), TraitClause2: (F: Sized), TraitClause3: (Chunks<'a, T>[TraitClause0]: Sized), - TraitClause4: (F: FnMut<(B, &'a [T])>), - TypeConstraint0: TraitClause4::ImpliedClause1::Output = B, + TraitClause4: (Chunks<'a, T>[TraitClause0]: Destruct), + TraitClause5: (F: FnMut<(B, &'a [T])>), + TraitClause6: (F: Destruct), + TypeConstraint0: TraitClause5::ImpliedClause1::Output = B, = // Full name: core::slice::iter::{impl Iterator for Chunks<'a, T>[TraitClause0]}::try_for_each @@ -3825,9 +3859,10 @@ where TraitClause3: (R: Sized), TraitClause4: (Chunks<'a, T>[TraitClause0]: Sized), TraitClause5: (F: FnMut<(B, &'a [T])>), - TraitClause6: (R: Try), + TraitClause6: (F: Destruct), + TraitClause7: (R: Try), TypeConstraint0: TraitClause5::ImpliedClause1::Output = R, - TypeConstraint1: TraitClause6::Output = B, + TypeConstraint1: TraitClause7::Output = B, = // Full name: core::slice::iter::{impl Iterator for Chunks<'a, T>[TraitClause0]}::is_partitioned @@ -4169,11 +4204,11 @@ where fn partition[TraitClause0]: Sized), TraitClause3_1: (B: Default), TraitClause4_1: (B: Extend<&'a [T]>), TraitClause5_1: for<'_0_2> (F: FnMut<(&'_0_2 &'a [T],)>), TypeConstraint0: for<'_0_2> TraitClause5_1::ImpliedClause1::Output = bool> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::partition<'a, T, B, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] fn partition_in_place<'a, T, P, TraitClause0_1: (T: Sized), TraitClause1_1: (P: Sized), TraitClause2_1: (Chunks<'a, T>[TraitClause0]: Sized), TraitClause3_1: (Chunks<'a, T>[TraitClause0]: DoubleEndedIterator), TraitClause4_1: for<'_0_2> (P: FnMut<(&'_0_2 T,)>), TypeOutlives0: T: 'a, TypeConstraint0: {impl Iterator for Chunks<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::Item = &'a mut T, TypeConstraint1: for<'_0_2> TraitClause4_1::ImpliedClause1::Output = bool> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::partition_in_place<'a, 'a, T, T, P>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] fn is_partitioned[TraitClause0]: Sized), TraitClause2_1: (P: FnMut<(&'a [T],)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::is_partitioned<'a, T, P>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] - fn try_fold<'_0_1, B, F, R, TraitClause0_1: (B: Sized), TraitClause1_1: (F: Sized), TraitClause2_1: (R: Sized), TraitClause3_1: (Chunks<'a, T>[TraitClause0]: Sized), TraitClause4_1: (F: FnMut<(B, &'a [T])>), TraitClause5_1: (R: Try), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause5_1::Output = B> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::try_fold<'a, '_0_1, T, B, F, R>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn try_fold<'_0_1, B, F, R, TraitClause0_1: (B: Sized), TraitClause1_1: (F: Sized), TraitClause2_1: (R: Sized), TraitClause3_1: (Chunks<'a, T>[TraitClause0]: Sized), TraitClause4_1: (F: FnMut<(B, &'a [T])>), TraitClause5_1: (F: Destruct), TraitClause6_1: (R: Try), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause6_1::Output = B> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::try_fold<'a, '_0_1, T, B, F, R>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1, TraitClause6_1] fn try_for_each<'_0_1, F, R, TraitClause0_1: (F: Sized), TraitClause1_1: (R: Sized), TraitClause2_1: (Chunks<'a, T>[TraitClause0]: Sized), TraitClause3_1: (F: FnMut<(&'a [T],)>), TraitClause4_1: (R: Try), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause4_1::Output = ()> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::try_for_each<'a, '_0_1, T, F, R>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] - fn fold[TraitClause0]: Sized), TraitClause3_1: (F: FnMut<(B, &'a [T])>), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = B> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::fold<'a, T, B, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1] - fn reduce[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(&'a [T], &'a [T])>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = &'a [T]> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::reduce<'a, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] - fn try_reduce<'_0_1, R, T2, TraitClause0_1: (R: Sized), TraitClause1_1: (T2: Sized), TraitClause2_1: (Chunks<'a, T>[TraitClause0]: Sized), TraitClause3_1: (R: Try), TraitClause4_1: (TraitClause3_1::Residual: Residual[{impl Iterator for Chunks<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::ImpliedClause1]>), TraitClause5_1: (T2: FnMut<(&'a [T], &'a [T])>), TypeConstraint0: TraitClause3_1::Output = &'a [T], TypeConstraint1: TraitClause5_1::ImpliedClause1::Output = R> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::try_reduce<'a, '_0_1, T, R, T2>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn fold[TraitClause0]: Sized), TraitClause3_1: (Chunks<'a, T>[TraitClause0]: Destruct), TraitClause4_1: (F: FnMut<(B, &'a [T])>), TraitClause5_1: (F: Destruct), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = B> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::fold<'a, T, B, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn reduce[TraitClause0]: Sized), TraitClause2_1: (Chunks<'a, T>[TraitClause0]: Destruct), TraitClause3_1: (F: FnMut<(&'a [T], &'a [T])>), TraitClause4_1: (F: Destruct), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = &'a [T]> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::reduce<'a, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] + fn try_reduce<'_0_1, R, T2, TraitClause0_1: (R: Sized), TraitClause1_1: (T2: Sized), TraitClause2_1: (Chunks<'a, T>[TraitClause0]: Sized), TraitClause3_1: (R: Try), TraitClause4_1: (TraitClause3_1::Residual: Residual[{impl Iterator for Chunks<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::ImpliedClause1]>), TraitClause5_1: (T2: FnMut<(&'a [T], &'a [T])>), TraitClause6_1: (T2: Destruct), TypeConstraint0: TraitClause3_1::Output = &'a [T], TypeConstraint1: TraitClause5_1::ImpliedClause1::Output = R> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::try_reduce<'a, '_0_1, T, R, T2>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1, TraitClause6_1] fn all<'_0_1, F, TraitClause0_1: (F: Sized), TraitClause1_1: (Chunks<'a, T>[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(&'a [T],)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::all<'a, '_0_1, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] fn any<'_0_1, F, TraitClause0_1: (F: Sized), TraitClause1_1: (Chunks<'a, T>[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(&'a [T],)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::any<'a, '_0_1, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] fn find<'_0_1, P, TraitClause0_1: (P: Sized), TraitClause1_1: (Chunks<'a, T>[TraitClause0]: Sized), TraitClause2_1: for<'_0_2> (P: FnMut<(&'_0_2 &'a [T],)>), TypeConstraint0: for<'_0_2> TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for Chunks<'a, T>[TraitClause0]}::find<'a, '_0_1, T, P>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] @@ -4634,6 +4669,7 @@ where TraitClause4: (R: Try), TraitClause5: (TraitClause4::Residual: Residual[{impl Iterator for ChunksExact<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::ImpliedClause1]>), TraitClause6: (T2: FnMut<(&'a [T], &'a [T])>), + TraitClause7: (T2: Destruct), TypeConstraint0: TraitClause4::Output = &'a [T], TypeConstraint1: TraitClause6::ImpliedClause1::Output = R, = @@ -4644,8 +4680,10 @@ where TraitClause0: (T: Sized), TraitClause1: (F: Sized), TraitClause2: (ChunksExact<'a, T>[TraitClause0]: Sized), - TraitClause3: (F: FnMut<(&'a [T], &'a [T])>), - TypeConstraint0: TraitClause3::ImpliedClause1::Output = &'a [T], + TraitClause3: (ChunksExact<'a, T>[TraitClause0]: Destruct), + TraitClause4: (F: FnMut<(&'a [T], &'a [T])>), + TraitClause5: (F: Destruct), + TypeConstraint0: TraitClause4::ImpliedClause1::Output = &'a [T], = // Full name: core::slice::iter::{impl Iterator for ChunksExact<'a, T>[TraitClause0]}::fold @@ -4655,8 +4693,10 @@ where TraitClause1: (B: Sized), TraitClause2: (F: Sized), TraitClause3: (ChunksExact<'a, T>[TraitClause0]: Sized), - TraitClause4: (F: FnMut<(B, &'a [T])>), - TypeConstraint0: TraitClause4::ImpliedClause1::Output = B, + TraitClause4: (ChunksExact<'a, T>[TraitClause0]: Destruct), + TraitClause5: (F: FnMut<(B, &'a [T])>), + TraitClause6: (F: Destruct), + TypeConstraint0: TraitClause5::ImpliedClause1::Output = B, = // Full name: core::slice::iter::{impl Iterator for ChunksExact<'a, T>[TraitClause0]}::try_for_each @@ -4681,9 +4721,10 @@ where TraitClause3: (R: Sized), TraitClause4: (ChunksExact<'a, T>[TraitClause0]: Sized), TraitClause5: (F: FnMut<(B, &'a [T])>), - TraitClause6: (R: Try), + TraitClause6: (F: Destruct), + TraitClause7: (R: Try), TypeConstraint0: TraitClause5::ImpliedClause1::Output = R, - TypeConstraint1: TraitClause6::Output = B, + TypeConstraint1: TraitClause7::Output = B, = // Full name: core::slice::iter::{impl Iterator for ChunksExact<'a, T>[TraitClause0]}::is_partitioned @@ -5025,11 +5066,11 @@ where fn partition[TraitClause0]: Sized), TraitClause3_1: (B: Default), TraitClause4_1: (B: Extend<&'a [T]>), TraitClause5_1: for<'_0_2> (F: FnMut<(&'_0_2 &'a [T],)>), TypeConstraint0: for<'_0_2> TraitClause5_1::ImpliedClause1::Output = bool> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::partition<'a, T, B, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] fn partition_in_place<'a, T, P, TraitClause0_1: (T: Sized), TraitClause1_1: (P: Sized), TraitClause2_1: (ChunksExact<'a, T>[TraitClause0]: Sized), TraitClause3_1: (ChunksExact<'a, T>[TraitClause0]: DoubleEndedIterator), TraitClause4_1: for<'_0_2> (P: FnMut<(&'_0_2 T,)>), TypeOutlives0: T: 'a, TypeConstraint0: {impl Iterator for ChunksExact<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::Item = &'a mut T, TypeConstraint1: for<'_0_2> TraitClause4_1::ImpliedClause1::Output = bool> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::partition_in_place<'a, 'a, T, T, P>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] fn is_partitioned[TraitClause0]: Sized), TraitClause2_1: (P: FnMut<(&'a [T],)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::is_partitioned<'a, T, P>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] - fn try_fold<'_0_1, B, F, R, TraitClause0_1: (B: Sized), TraitClause1_1: (F: Sized), TraitClause2_1: (R: Sized), TraitClause3_1: (ChunksExact<'a, T>[TraitClause0]: Sized), TraitClause4_1: (F: FnMut<(B, &'a [T])>), TraitClause5_1: (R: Try), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause5_1::Output = B> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::try_fold<'a, '_0_1, T, B, F, R>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn try_fold<'_0_1, B, F, R, TraitClause0_1: (B: Sized), TraitClause1_1: (F: Sized), TraitClause2_1: (R: Sized), TraitClause3_1: (ChunksExact<'a, T>[TraitClause0]: Sized), TraitClause4_1: (F: FnMut<(B, &'a [T])>), TraitClause5_1: (F: Destruct), TraitClause6_1: (R: Try), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause6_1::Output = B> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::try_fold<'a, '_0_1, T, B, F, R>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1, TraitClause6_1] fn try_for_each<'_0_1, F, R, TraitClause0_1: (F: Sized), TraitClause1_1: (R: Sized), TraitClause2_1: (ChunksExact<'a, T>[TraitClause0]: Sized), TraitClause3_1: (F: FnMut<(&'a [T],)>), TraitClause4_1: (R: Try), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = R, TypeConstraint1: TraitClause4_1::Output = ()> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::try_for_each<'a, '_0_1, T, F, R>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] - fn fold[TraitClause0]: Sized), TraitClause3_1: (F: FnMut<(B, &'a [T])>), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = B> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::fold<'a, T, B, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1] - fn reduce[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(&'a [T], &'a [T])>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = &'a [T]> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::reduce<'a, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] - fn try_reduce<'_0_1, R, T2, TraitClause0_1: (R: Sized), TraitClause1_1: (T2: Sized), TraitClause2_1: (ChunksExact<'a, T>[TraitClause0]: Sized), TraitClause3_1: (R: Try), TraitClause4_1: (TraitClause3_1::Residual: Residual[{impl Iterator for ChunksExact<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::ImpliedClause1]>), TraitClause5_1: (T2: FnMut<(&'a [T], &'a [T])>), TypeConstraint0: TraitClause3_1::Output = &'a [T], TypeConstraint1: TraitClause5_1::ImpliedClause1::Output = R> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::try_reduce<'a, '_0_1, T, R, T2>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn fold[TraitClause0]: Sized), TraitClause3_1: (ChunksExact<'a, T>[TraitClause0]: Destruct), TraitClause4_1: (F: FnMut<(B, &'a [T])>), TraitClause5_1: (F: Destruct), TypeConstraint0: TraitClause4_1::ImpliedClause1::Output = B> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::fold<'a, T, B, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1] + fn reduce[TraitClause0]: Sized), TraitClause2_1: (ChunksExact<'a, T>[TraitClause0]: Destruct), TraitClause3_1: (F: FnMut<(&'a [T], &'a [T])>), TraitClause4_1: (F: Destruct), TypeConstraint0: TraitClause3_1::ImpliedClause1::Output = &'a [T]> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::reduce<'a, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1] + fn try_reduce<'_0_1, R, T2, TraitClause0_1: (R: Sized), TraitClause1_1: (T2: Sized), TraitClause2_1: (ChunksExact<'a, T>[TraitClause0]: Sized), TraitClause3_1: (R: Try), TraitClause4_1: (TraitClause3_1::Residual: Residual[{impl Iterator for ChunksExact<'a, T>[TraitClause0]}<'a, T>[TraitClause0]::ImpliedClause1]>), TraitClause5_1: (T2: FnMut<(&'a [T], &'a [T])>), TraitClause6_1: (T2: Destruct), TypeConstraint0: TraitClause3_1::Output = &'a [T], TypeConstraint1: TraitClause5_1::ImpliedClause1::Output = R> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::try_reduce<'a, '_0_1, T, R, T2>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1, TraitClause3_1, TraitClause4_1, TraitClause5_1, TraitClause6_1] fn all<'_0_1, F, TraitClause0_1: (F: Sized), TraitClause1_1: (ChunksExact<'a, T>[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(&'a [T],)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::all<'a, '_0_1, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] fn any<'_0_1, F, TraitClause0_1: (F: Sized), TraitClause1_1: (ChunksExact<'a, T>[TraitClause0]: Sized), TraitClause2_1: (F: FnMut<(&'a [T],)>), TypeConstraint0: TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::any<'a, '_0_1, T, F>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] fn find<'_0_1, P, TraitClause0_1: (P: Sized), TraitClause1_1: (ChunksExact<'a, T>[TraitClause0]: Sized), TraitClause2_1: for<'_0_2> (P: FnMut<(&'_0_2 &'a [T],)>), TypeConstraint0: for<'_0_2> TraitClause2_1::ImpliedClause1::Output = bool> = {impl Iterator for ChunksExact<'a, T>[TraitClause0]}::find<'a, '_0_1, T, P>[TraitClause0, TraitClause0_1, TraitClause1_1, TraitClause2_1] diff --git a/charon/tests/ui/ptr-offset.out b/charon/tests/ui/ptr-offset.out index df831283b..4bac2c046 100644 --- a/charon/tests/ui/ptr-offset.out +++ b/charon/tests/ui/ptr-offset.out @@ -28,7 +28,7 @@ pub trait Sized non-dyn-compatible } -// Full name: core::ptr::alignment::Alignment +// Full name: core::mem::alignment::Alignment pub opaque type Alignment // Full name: core::mem::SizedTypeProperties diff --git a/charon/tests/ui/raw-boxes.out b/charon/tests/ui/raw-boxes.out index 1cd3358ec..b4759c2cd 100644 --- a/charon/tests/ui/raw-boxes.out +++ b/charon/tests/ui/raw-boxes.out @@ -1,6 +1,6 @@ # Final LLBC before serialization: -// Full name: core::ptr::alignment::AlignmentEnum +// Full name: core::mem::alignment::AlignmentEnum enum AlignmentEnum { _Align1Shl0, _Align1Shl1, @@ -68,7 +68,7 @@ enum AlignmentEnum { _Align1Shl63, } -// Full name: core::ptr::alignment::Alignment +// Full name: core::mem::alignment::Alignment pub struct Alignment { _inner_repr_trick: AlignmentEnum, } @@ -83,7 +83,7 @@ pub struct Layout { // Full name: core::ptr::non_null::NonNull #[lang_item("NonNull")] pub struct NonNull { - pointer: *const T, + pointer: *const T is !null, } // Full name: core::marker::MetaSized @@ -247,7 +247,7 @@ where TraitClause1: (T: Copy), = -fn core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(align_1: usize) +fn core::mem::alignment::{Alignment}::new_unchecked::precondition_check(align_1: usize) { let _0: (); // return let align_1: usize; // arg #1 @@ -346,7 +346,7 @@ fn core::alloc::layout::{Layout}::from_size_align_unchecked::precondition_check( storage_live(_20) _20 = ub_checks if move _20 { - _9 = core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(copy align_2) + _9 = core::mem::alignment::{Alignment}::new_unchecked::precondition_check(copy align_2) } else { } alignment_7 = transmute(copy align_2) @@ -613,128 +613,175 @@ where Break(B), } -pub fn core::num::{usize}::MAX() -> usize -{ - let _0: usize; // return - - _0 = ~(const 0 : usize) - return -} - -pub const core::num::{usize}::MAX: usize = core::num::{usize}::MAX() - -pub fn core::num::{isize}::MAX() -> isize -{ - let _0: isize; // return - let _1: usize; // anonymous local - let _2: u32; // anonymous local - let _3: bool; // anonymous local - - storage_live(_2) - storage_live(_3) - storage_live(_1) - _2 = cast(const 1 : i32) - _3 = move _2 < const 64 : u32 - assert(move _3 == true) (overflow) else panic - _1 = copy core::num::{usize}::MAX wrap.>> const 1 : i32 - _0 = cast(move _1) - storage_dead(_1) - return -} - -pub const core::num::{isize}::MAX: isize = core::num::{isize}::MAX() +// Full name: core::intrinsics::write_bytes +pub unsafe fn write_bytes(dst_1: *mut T, val_2: u8, count_3: usize) +where + TraitClause0: (T: Sized), += -// Full name: core::mem::SizedTypeProperties -pub trait SizedTypeProperties -{ - proof ImpliedClause0: (Self: 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::convert::Infallible +pub enum Infallible { } -// Full name: core::mem::SizedTypeProperties::MAX_SLICE_LEN -pub fn MAX_SLICE_LEN() -> usize +pub fn core::alloc::Allocator::allocate_zeroed<'_0, Self>(self_1: &'_0 Self, layout_2: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] where - TraitClause0: (Self: SizedTypeProperties), + TraitClause0: (Self: Allocator), { - let _0: usize; // return - let _1: usize; // anonymous local - let n_2: usize; // local - let _3: usize; // anonymous local - let _4: usize; // anonymous local - let _5: bool; // anonymous local + let _0: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // return + let self_1: &'1 Self; // arg #1 + let layout_2: Layout; // arg #2 + let _3: 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_4: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local + let _5: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local + let ptr_6: NonNull<[u8]>; // local + let _7: (); // anonymous local + let self_8: *mut u8; // local + let self_9: NonNull; // local + let count_10: usize; // local + let v_11: NonNull<[u8]>; // local + let _12: *mut u8; // anonymous local + let _13: *mut [u8]; // anonymous local + let _14: isize; // anonymous local + let _15: bool; // anonymous local + let _16: (); // anonymous local + let _17: *const (); // anonymous local + let _18: bool; // anonymous local + let _19: bool; // anonymous local + let _20: AllocError; // anonymous local + let _21: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local storage_live(_5) - storage_live(_1) - _1 = const TraitClause0::SIZE - switch copy _1 { - 0 : usize => { - _0 = copy core::num::{usize}::MAX + storage_live(ptr_6) + storage_live(_7) + storage_live(self_9) + storage_live(_13) + storage_live(_16) + storage_live(_3) + storage_live(self_4) + self_4 = TraitClause0::allocate<'3>(move self_1, move layout_2) + storage_live(v_11) + match self_4 { + Result::Ok => { }, - _ => { - storage_live(n_2) - n_2 = copy _1 - storage_live(_3) - _3 = cast(copy core::num::{isize}::MAX) - storage_live(_4) - _4 = copy n_2 - _5 = copy _4 == const 0 : usize - assert(move _5 == false) (division_by_zero) else panic - _0 = move _3 ub./ move _4 - storage_dead(_4) + Result::Err => { + storage_dead(v_11) + storage_dead(self_4) + storage_live(_14) + storage_live(_15) + _14 = @discriminant(_5) + _15 = copy _14 == const 1 : isize + assert(move _15 == true) else undefined_behavior + storage_live(_20) + _20 = AllocError { } + storage_live(_21) + _21 = Result::Err { 0: move _20 } + _0 = move _21 + storage_dead(_15) + storage_dead(_14) storage_dead(_3) - storage_dead(n_2) + return }, } - storage_dead(_1) + v_11 = move (self_4 as variant Result::Ok).0 + _3 = ControlFlow::Continue { 0: copy v_11 } + storage_dead(v_11) + storage_dead(self_4) + ptr_6 = copy (_3 as variant ControlFlow::Continue).0 + storage_dead(_3) + storage_live(self_8) + storage_live(_12) + _13 = transmute, *mut [u8]>(copy ptr_6) + _12 = cast<*mut [u8], *mut u8>(copy _13) + self_9 = transmute<*mut u8, NonNull>(copy _12) + storage_dead(_12) + self_8 = transmute, *mut u8>(copy self_9) + storage_live(count_10) + count_10 = copy _13.metadata + storage_live(_19) + _19 = ub_checks + if move _19 { + storage_live(_17) + _17 = transmute, *const ()>(copy self_9) + storage_live(_18) + _18 = copy count_10 == const 0 : usize + _16 = core::ptr::write_bytes::precondition_check(move _17, const 1 : usize, move _18) + storage_dead(_18) + storage_dead(_17) + } else { + } + _7 = write_bytes[{built_in impl Sized for u8}](move self_8, const 0 : u8, move count_10) + storage_dead(count_10) + storage_dead(self_8) + _0 = Result::Ok { 0: copy ptr_6 } return } -// Full name: core::mem::SizedTypeProperties::MAX_SLICE_LEN -pub const MAX_SLICE_LEN: usize +pub unsafe fn core::alloc::Allocator::deallocate<'_0, Self>(_1: &'_0 Self, _2: NonNull, _3: Layout) where - TraitClause0: (Self: SizedTypeProperties), - = MAX_SLICE_LEN() + TraitClause0: (Self: Allocator), += -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub fn LAYOUT() -> Layout -where - TraitClause0: (Self: SizedTypeProperties), +// Full name: core::fmt::{Arguments<'a>}::from_str +pub fn from_str<'a>(s_1: &'static str) -> Arguments<'a> { - let _0: Layout; // return + let _0: Arguments<'1>; // return + let s_1: &'3 str; // arg #1 + let _2: NonNull; // anonymous local + let _3: *const u8; // anonymous local + let _4: NonNull>; // anonymous local + let _5: usize; // anonymous local + let _6: usize; // anonymous local + let _7: usize; // anonymous local + let _8: *const str; // anonymous local + let _9: &'8 [u8]; // anonymous local - _0 = from_size_align_unchecked(const TraitClause0::SIZE, const TraitClause0::ALIGN) + storage_live(_2) + storage_live(_3) + storage_live(_8) + _8 = &raw const (*s_1) with_metadata(copy s_1.metadata) + _3 = cast<*const str, *const u8>(copy _8) + storage_dead(_8) + _2 = transmute<*const u8, NonNull>(copy _3) + storage_dead(_3) + storage_live(_4) + storage_live(_5) + storage_live(_6) + storage_live(_7) + storage_live(_9) + _9 = transmute<&'3 str, &'9 [u8]>(copy s_1) + _7 = copy _9.metadata + storage_dead(_9) + _6 = move _7 wrap.<< const 1 : i32 + storage_dead(_7) + _5 = move _6 | const 1 : usize + storage_dead(_6) + _4 = transmute>>(move _5) + storage_dead(_5) + _0 = Arguments { template: move _2, args: move _4 } + storage_dead(_4) + storage_dead(_2) return } -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub const LAYOUT: Layout -where - TraitClause0: (Self: SizedTypeProperties), - = LAYOUT() - -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub fn IS_ZST() -> bool -where - TraitClause0: (Self: SizedTypeProperties), +// Full name: core::panicking::panic_nounwind +#[lang_item("panic_nounwind")] +pub fn panic_nounwind(expr_1: &'static str) -> ! { - let _0: bool; // return + let _0: !; // return + let expr_1: &'1 str; // arg #1 + let _2: !; // anonymous local + let _3: Arguments<'3>; // anonymous local + let _4: &'4 str; // anonymous local - _0 = const TraitClause0::SIZE == const 0 : usize - return + storage_live(_2) + storage_live(_3) + storage_live(_4) + _4 = copy expr_1 + _3 = from_str<'5>(move _4) + storage_dead(_4) + _2 = panic_nounwind_fmt<'7>(move _3, const false) } -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub const IS_ZST: bool -where - TraitClause0: (Self: SizedTypeProperties), - = IS_ZST() - // Full name: core::option::Option #[lang_item("Option")] pub enum Option @@ -745,333 +792,9 @@ where Some(T), } -pub fn core::ptr::alignment::{Alignment}::new(align_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(self_1: Option[TraitClause0]) -> T -where - TraitClause0: (T: 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() -} - -// Full name: core::mem::SizedTypeProperties::ALIGNMENT -pub fn ALIGNMENT() -> Alignment -where - TraitClause0: (Self: SizedTypeProperties), -{ - let _0: Alignment; // return - let _1: Option[{built_in impl Sized for Alignment}]; // anonymous local - - storage_live(_1) - _1 = core::ptr::alignment::{Alignment}::new(const TraitClause0::ALIGN) - _0 = unwrap[{built_in impl Sized for Alignment}](move _1) - storage_dead(_1) - return -} - -// Full name: core::mem::SizedTypeProperties::ALIGNMENT -pub const ALIGNMENT: Alignment -where - TraitClause0: (Self: SizedTypeProperties), - = ALIGNMENT() - -// Full name: core::intrinsics::align_of -pub fn align_of() -> usize -where - TraitClause0: (T: Sized), -= - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub fn ALIGN() -> usize -where - TraitClause0: (Self: SizedTypeProperties), -{ - let _0: usize; // return - - _0 = align_of[TraitClause0::ImpliedClause0]() - return -} - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub const ALIGN: usize -where - TraitClause0: (Self: SizedTypeProperties), - = ALIGN() - -// Full name: core::intrinsics::size_of -pub fn size_of() -> usize -where - TraitClause0: (T: Sized), -= - -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub fn SIZE() -> usize -where - TraitClause0: (Self: SizedTypeProperties), -{ - let _0: usize; // return - - _0 = size_of[TraitClause0::ImpliedClause0]() - return -} - -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub const SIZE: usize -where - TraitClause0: (Self: SizedTypeProperties), - = SIZE() - -// Full name: core::mem::{impl SizedTypeProperties for T} -impl SizedTypeProperties for T -where - TraitClause0: (T: Sized), -{ - proof ImpliedClause0: (T: Sized) = 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::intrinsics::write_bytes -pub unsafe fn write_bytes(dst_1: *mut T, val_2: u8, count_3: usize) -where - TraitClause0: (T: Sized), -= - -// Full name: core::convert::Infallible -pub enum Infallible { -} - -pub fn core::alloc::Allocator::allocate_zeroed<'_0, Self>(self_1: &'_0 Self, layout_2: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] -where - TraitClause0: (Self: Allocator), -{ - let _0: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // return - let self_1: &'1 Self; // arg #1 - let layout_2: Layout; // arg #2 - let _3: 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_4: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local - let _5: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local - let ptr_6: NonNull<[u8]>; // local - let _7: (); // anonymous local - let self_8: *mut u8; // local - let self_9: NonNull; // local - let count_10: usize; // local - let v_11: NonNull<[u8]>; // local - let _12: *const u8; // anonymous local - let _13: *mut [u8]; // anonymous local - let _14: isize; // anonymous local - let _15: bool; // anonymous local - let _16: (); // anonymous local - let _17: *const (); // anonymous local - let _18: bool; // anonymous local - let _19: bool; // anonymous local - let _20: AllocError; // anonymous local - let _21: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - - storage_live(_5) - storage_live(ptr_6) - storage_live(_7) - storage_live(_13) - storage_live(_16) - storage_live(_3) - storage_live(self_4) - self_4 = TraitClause0::allocate<'3>(move self_1, move layout_2) - storage_live(v_11) - match self_4 { - Result::Ok => { - }, - Result::Err => { - storage_dead(v_11) - storage_dead(self_4) - storage_live(_14) - storage_live(_15) - _14 = @discriminant(_5) - _15 = copy _14 == const 1 : isize - assert(move _15 == true) else undefined_behavior - storage_live(_20) - _20 = AllocError { } - storage_live(_21) - _21 = Result::Err { 0: move _20 } - _0 = move _21 - storage_dead(_15) - storage_dead(_14) - storage_dead(_3) - return - }, - } - v_11 = move (self_4 as variant Result::Ok).0 - _3 = ControlFlow::Continue { 0: copy v_11 } - storage_dead(v_11) - storage_dead(self_4) - ptr_6 = copy (_3 as variant ControlFlow::Continue).0 - storage_dead(_3) - storage_live(self_8) - storage_live(self_9) - storage_live(_12) - _13 = transmute, *mut [u8]>(copy ptr_6) - _12 = cast<*mut [u8], *const u8>(copy _13) - self_9 = NonNull { pointer: copy _12 } - storage_dead(_12) - self_8 = cast<*mut [u8], *mut u8>(copy _13) - storage_dead(self_9) - storage_live(count_10) - count_10 = copy _13.metadata - storage_live(_19) - _19 = ub_checks - if move _19 { - storage_live(_17) - _17 = cast<*mut [u8], *const ()>(copy _13) - storage_live(_18) - _18 = copy count_10 == const 0 : usize - _16 = core::ptr::write_bytes::precondition_check(move _17, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, move _18) - storage_dead(_18) - storage_dead(_17) - } else { - } - _7 = write_bytes[{built_in impl Sized for u8}](move self_8, const 0 : u8, move count_10) - storage_dead(count_10) - storage_dead(self_8) - _0 = Result::Ok { 0: copy ptr_6 } - return -} - -pub unsafe fn core::alloc::Allocator::deallocate<'_0, Self>(_1: &'_0 Self, _2: NonNull, _3: Layout) -where - TraitClause0: (Self: Allocator), -= - -// Full name: core::fmt::{Arguments<'a>}::from_str -pub fn from_str<'a>(s_1: &'static str) -> Arguments<'a> -{ - let _0: Arguments<'1>; // return - let s_1: &'3 str; // arg #1 - let _2: NonNull; // anonymous local - let _3: *const u8; // anonymous local - let _4: NonNull>; // anonymous local - let _5: usize; // anonymous local - let _6: usize; // anonymous local - let _7: usize; // anonymous local - let _8: *const str; // anonymous local - let _9: &'8 [u8]; // anonymous local - - storage_live(_2) - storage_live(_3) - storage_live(_8) - _8 = &raw const (*s_1) with_metadata(copy s_1.metadata) - _3 = cast<*const str, *const u8>(copy _8) - storage_dead(_8) - _2 = transmute<*const u8, NonNull>(copy _3) - storage_dead(_3) - storage_live(_4) - storage_live(_5) - storage_live(_6) - storage_live(_7) - storage_live(_9) - _9 = transmute<&'3 str, &'9 [u8]>(copy s_1) - _7 = copy _9.metadata - storage_dead(_9) - _6 = move _7 wrap.<< const 1 : i32 - storage_dead(_7) - _5 = move _6 | const 1 : usize - storage_dead(_6) - _4 = transmute>>(move _5) - storage_dead(_5) - _0 = Arguments { template: move _2, args: move _4 } - storage_dead(_4) - storage_dead(_2) - return -} - -// Full name: core::panicking::panic_nounwind -#[lang_item("panic_nounwind")] -pub fn panic_nounwind(expr_1: &'static str) -> ! -{ - let _0: !; // return - let expr_1: &'1 str; // arg #1 - let _2: !; // anonymous local - let _3: Arguments<'3>; // anonymous local - let _4: &'4 str; // anonymous local - - storage_live(_2) - storage_live(_3) - storage_live(_4) - _4 = copy expr_1 - _3 = from_str<'5>(move _4) - storage_dead(_4) - _2 = panic_nounwind_fmt<'7>(move _3, const false) -} - -// Full name: core::intrinsics::cold_path -pub fn cold_path() -= +// Full name: core::intrinsics::cold_path +pub fn cold_path() += // Full name: core::ub_checks::maybe_is_nonoverlapping::runtime fn runtime(src_1: *const (), dst_2: *const (), size_3: usize, count_4: usize) -> bool @@ -1310,37 +1033,239 @@ fn core::ptr::copy_nonoverlapping::precondition_check(src_1: *const (), dst_2: * storage_dead(_10) storage_dead(_8) } - 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) + 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(_24) + storage_live(_25) + storage_live(_26) + 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 = move _25 | const 1 : usize + storage_dead(_25) + _23 = transmute>>(move _24) + storage_dead(_24) + _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>(self_1: &'_0 Self, ptr_2: NonNull, old_layout_3: Layout, new_layout_4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +where + TraitClause0: (Self: Allocator), +{ + let _0: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // return + let self_1: &'1 Self; // arg #1 + let ptr_2: NonNull; // arg #2 + let old_layout_3: Layout; // arg #3 + let new_layout_4: Layout; // arg #4 + let _5: 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_6: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local + let _7: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local + let new_ptr_8: NonNull<[u8]>; // local + let src_9: *const u8; // local + let dst_10: *mut u8; // local + let count_11: usize; // local + let _12: (); // anonymous local + let v_13: NonNull<[u8]>; // local + let _14: isize; // anonymous local + let _15: bool; // anonymous local + let _16: NonNull; // anonymous local + let _17: *mut u8; // anonymous local + let _18: *mut [u8]; // anonymous local + let _19: (); // anonymous local + let _20: *const (); // anonymous local + let _21: *mut (); // anonymous local + let _22: bool; // anonymous local + let _23: AllocError; // anonymous local + let _24: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + + storage_live(_7) + storage_live(new_ptr_8) + storage_live(_12) + storage_live(_16) + storage_live(_19) + storage_live(_5) + storage_live(self_6) + self_6 = TraitClause0::allocate<'9>(copy self_1, move new_layout_4) + storage_live(v_13) + match self_6 { + Result::Ok => { + }, + Result::Err => { + storage_dead(v_13) + storage_dead(self_6) + storage_live(_14) + storage_live(_15) + _14 = @discriminant(_7) + _15 = copy _14 == const 1 : isize + assert(move _15 == true) else undefined_behavior + storage_live(_23) + _23 = AllocError { } + storage_live(_24) + _24 = Result::Err { 0: move _23 } + _0 = move _24 + storage_dead(_15) + storage_dead(_14) + storage_dead(_5) + return + }, + } + v_13 = move (self_6 as variant Result::Ok).0 + _5 = ControlFlow::Continue { 0: copy v_13 } + storage_dead(v_13) + storage_dead(self_6) + new_ptr_8 = copy (_5 as variant ControlFlow::Continue).0 + storage_dead(_5) + storage_live(src_9) + src_9 = transmute, *const u8>(copy ptr_2) + storage_live(dst_10) + storage_live(_17) + storage_live(_18) + _18 = transmute, *mut [u8]>(copy new_ptr_8) + _17 = cast<*mut [u8], *mut u8>(copy _18) + storage_dead(_18) + _16 = transmute<*mut u8, NonNull>(copy _17) + storage_dead(_17) + dst_10 = transmute, *mut u8>(copy _16) + storage_live(count_11) + count_11 = copy (old_layout_3).size + storage_live(_22) + _22 = ub_checks + if move _22 { + storage_live(_20) + _20 = transmute, *const ()>(copy ptr_2) + storage_live(_21) + _21 = transmute, *mut ()>(copy _16) + _19 = core::ptr::copy_nonoverlapping::precondition_check(move _20, move _21, const 1 : usize, const 1 : usize, copy count_11) + storage_dead(_21) + storage_dead(_20) + } else { + } + copy_nonoverlapping(copy src_9, copy dst_10, copy count_11) + storage_dead(count_11) + storage_dead(dst_10) + storage_dead(src_9) + _12 = TraitClause0::deallocate<'11>(move self_1, move ptr_2, move old_layout_3) + _0 = Result::Ok { 0: copy new_ptr_8 } + return +} + +pub unsafe fn core::alloc::Allocator::grow_zeroed<'_0, Self>(self_1: &'_0 Self, ptr_2: NonNull, old_layout_3: Layout, new_layout_4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +where + TraitClause0: (Self: Allocator), +{ + let _0: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // return + let self_1: &'1 Self; // arg #1 + let ptr_2: NonNull; // arg #2 + let old_layout_3: Layout; // arg #3 + let new_layout_4: Layout; // arg #4 + let _5: 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_6: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local + let _7: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local + let new_ptr_8: NonNull<[u8]>; // local + let src_9: *const u8; // local + let dst_10: *mut u8; // local + let count_11: usize; // local + let _12: (); // anonymous local + let v_13: NonNull<[u8]>; // local + let _14: isize; // anonymous local + let _15: bool; // anonymous local + let _16: NonNull; // anonymous local + let _17: *mut u8; // anonymous local + let _18: *mut [u8]; // anonymous local + let _19: (); // anonymous local + let _20: *const (); // anonymous local + let _21: *mut (); // anonymous local + let _22: bool; // anonymous local + let _23: AllocError; // anonymous local + let _24: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + + storage_live(_7) + storage_live(new_ptr_8) + storage_live(_12) + storage_live(_16) + storage_live(_19) + storage_live(_5) + storage_live(self_6) + self_6 = TraitClause0::allocate_zeroed<'9>(copy self_1, move new_layout_4) + storage_live(v_13) + match self_6 { + Result::Ok => { + }, + Result::Err => { + storage_dead(v_13) + storage_dead(self_6) + storage_live(_14) + storage_live(_15) + _14 = @discriminant(_7) + _15 = copy _14 == const 1 : isize + assert(move _15 == true) else undefined_behavior + storage_live(_23) + _23 = AllocError { } + storage_live(_24) + _24 = Result::Err { 0: move _23 } + _0 = move _24 + storage_dead(_15) + storage_dead(_14) + storage_dead(_5) + return + }, + } + v_13 = move (self_6 as variant Result::Ok).0 + _5 = ControlFlow::Continue { 0: copy v_13 } + storage_dead(v_13) + storage_dead(self_6) + new_ptr_8 = copy (_5 as variant ControlFlow::Continue).0 + storage_dead(_5) + storage_live(src_9) + src_9 = transmute, *const u8>(copy ptr_2) + storage_live(dst_10) + storage_live(_17) + storage_live(_18) + _18 = transmute, *mut [u8]>(copy new_ptr_8) + _17 = cast<*mut [u8], *mut u8>(copy _18) + storage_dead(_18) + _16 = transmute<*mut u8, NonNull>(copy _17) + storage_dead(_17) + dst_10 = transmute, *mut u8>(copy _16) + storage_live(count_11) + count_11 = copy (old_layout_3).size 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(_24) - storage_live(_25) - storage_live(_26) - 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 = move _25 | const 1 : usize - storage_dead(_25) - _23 = transmute>>(move _24) - storage_dead(_24) - _14 = Arguments { template: move _21, args: move _23 } - storage_dead(_23) - storage_dead(_21) - _13 = panic_nounwind_fmt<'15>(move _14, const false) + _22 = ub_checks + if move _22 { + storage_live(_20) + _20 = transmute, *const ()>(copy ptr_2) + storage_live(_21) + _21 = transmute, *mut ()>(copy _16) + _19 = core::ptr::copy_nonoverlapping::precondition_check(move _20, move _21, const 1 : usize, const 1 : usize, copy count_11) + storage_dead(_21) + storage_dead(_20) + } else { + } + copy_nonoverlapping(copy src_9, copy dst_10, copy count_11) + storage_dead(count_11) + storage_dead(dst_10) + storage_dead(src_9) + _12 = TraitClause0::deallocate<'11>(move self_1, move ptr_2, move old_layout_3) + _0 = Result::Ok { 0: copy new_ptr_8 } + return } -pub unsafe fn core::alloc::Allocator::grow<'_0, Self>(self_1: &'_0 Self, ptr_2: NonNull, old_layout_3: Layout, new_layout_4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +pub unsafe fn core::alloc::Allocator::shrink<'_0, Self>(self_1: &'_0 Self, ptr_2: NonNull, old_layout_3: Layout, new_layout_4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] where TraitClause0: (Self: Allocator), { @@ -1360,22 +1285,24 @@ where let v_13: NonNull<[u8]>; // local let _14: isize; // anonymous local let _15: bool; // anonymous local - let _16: *mut [u8]; // anonymous local - let _17: (); // anonymous local - let _18: *const (); // anonymous local - let _19: *mut (); // anonymous local - let _20: bool; // anonymous local - let _21: AllocError; // anonymous local - let _22: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let _16: NonNull; // anonymous local + let _17: *mut u8; // anonymous local + let _18: *mut [u8]; // anonymous local + let _19: (); // anonymous local + let _20: *const (); // anonymous local + let _21: *mut (); // anonymous local + let _22: bool; // anonymous local + let _23: AllocError; // anonymous local + let _24: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local storage_live(_7) storage_live(new_ptr_8) storage_live(_12) storage_live(_16) - storage_live(_17) + storage_live(_19) storage_live(_5) storage_live(self_6) - self_6 = TraitClause0::allocate<'9>(copy self_1, move new_layout_4) + self_6 = TraitClause0::allocate<'9>(copy self_1, copy new_layout_4) storage_live(v_13) match self_6 { Result::Ok => { @@ -1388,11 +1315,11 @@ where _14 = @discriminant(_7) _15 = copy _14 == const 1 : isize assert(move _15 == true) else undefined_behavior - storage_live(_21) - _21 = AllocError { } - storage_live(_22) - _22 = Result::Err { 0: move _21 } - _0 = move _22 + storage_live(_23) + _23 = AllocError { } + storage_live(_24) + _24 = Result::Err { 0: move _23 } + _0 = move _24 storage_dead(_15) storage_dead(_14) storage_dead(_5) @@ -1408,20 +1335,26 @@ where storage_live(src_9) src_9 = transmute, *const u8>(copy ptr_2) storage_live(dst_10) - _16 = transmute, *mut [u8]>(copy new_ptr_8) - dst_10 = cast<*mut [u8], *mut u8>(copy _16) + storage_live(_17) + storage_live(_18) + _18 = transmute, *mut [u8]>(copy new_ptr_8) + _17 = cast<*mut [u8], *mut u8>(copy _18) + storage_dead(_18) + _16 = transmute<*mut u8, NonNull>(copy _17) + storage_dead(_17) + dst_10 = transmute, *mut u8>(copy _16) storage_live(count_11) - count_11 = copy (old_layout_3).size - storage_live(_20) - _20 = ub_checks - if move _20 { - storage_live(_18) - _18 = transmute, *const ()>(copy ptr_2) - storage_live(_19) - _19 = cast<*mut [u8], *mut ()>(copy _16) - _17 = core::ptr::copy_nonoverlapping::precondition_check(move _18, move _19, 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 count_11) - storage_dead(_19) - storage_dead(_18) + count_11 = copy (new_layout_4).size + storage_live(_22) + _22 = ub_checks + if move _22 { + storage_live(_20) + _20 = transmute, *const ()>(copy ptr_2) + storage_live(_21) + _21 = transmute, *mut ()>(copy _16) + _19 = core::ptr::copy_nonoverlapping::precondition_check(move _20, move _21, const 1 : usize, const 1 : usize, copy count_11) + storage_dead(_21) + storage_dead(_20) } else { } copy_nonoverlapping(copy src_9, copy dst_10, copy count_11) @@ -1433,227 +1366,317 @@ where return } -pub unsafe fn core::alloc::Allocator::grow_zeroed<'_0, Self>(self_1: &'_0 Self, ptr_2: NonNull, old_layout_3: Layout, new_layout_4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +pub fn core::alloc::Allocator::by_ref<'_0, Self>(self_1: &'_0 Self) -> &'_0 Self +where + TraitClause0: (Self: Allocator), + TraitClause1: (Self: Sized), +{ + let _0: &'1 Self; // return + let self_1: &'2 Self; // arg #1 + + _0 = copy self_1 + return +} + +#[lang_item("clone_fn")] +pub fn core::clone::Clone::clone<'_0, Self>(_1: &'_0 Self) -> Self +where + TraitClause0: (Self: Clone), += + +pub fn core::clone::Clone::clone_from<'_0, '_1, Self>(self_1: &'_0 mut Self, source_2: &'_1 Self) +where + TraitClause0: (Self: Clone), + TraitClause1: (Self: 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::drop_in_place] (*self_1) + (*self_1) = move _3 + storage_dead(_3) + return +} + +// Full name: core::intrinsics::size_of +pub fn size_of() -> usize +where + TraitClause0: (T: Sized), += + +// Full name: core::intrinsics::align_of +pub fn align_of() -> usize +where + TraitClause0: (T: Sized), += + +pub fn core::mem::alignment::{Alignment}::new(align_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::mem::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 +pub trait SizedTypeProperties +{ + proof ImpliedClause0: (Self: 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::SIZE +#[lang_item("mem_size_const")] +pub fn SIZE() -> usize +where + TraitClause0: (Self: SizedTypeProperties), +{ + let _0: usize; // return + + _0 = size_of[TraitClause0::ImpliedClause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::SIZE +#[lang_item("mem_size_const")] +pub const SIZE: usize +where + TraitClause0: (Self: SizedTypeProperties), + = SIZE() + +// Full name: core::mem::SizedTypeProperties::ALIGN +#[lang_item("mem_align_const")] +pub fn ALIGN() -> usize +where + TraitClause0: (Self: SizedTypeProperties), +{ + let _0: usize; // return + + _0 = align_of[TraitClause0::ImpliedClause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::ALIGN +#[lang_item("mem_align_const")] +pub const ALIGN: usize +where + TraitClause0: (Self: SizedTypeProperties), + = ALIGN() + +// 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(self_1: Option[TraitClause0]) -> T where - TraitClause0: (Self: Allocator), + TraitClause0: (T: Sized), { - let _0: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // return - let self_1: &'1 Self; // arg #1 - let ptr_2: NonNull; // arg #2 - let old_layout_3: Layout; // arg #3 - let new_layout_4: Layout; // arg #4 - let _5: 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_6: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local - let _7: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local - let new_ptr_8: NonNull<[u8]>; // local - let src_9: *const u8; // local - let dst_10: *mut u8; // local - let count_11: usize; // local - let _12: (); // anonymous local - let v_13: NonNull<[u8]>; // local - let _14: isize; // anonymous local - let _15: bool; // anonymous local - let _16: *mut [u8]; // anonymous local - let _17: (); // anonymous local - let _18: *const (); // anonymous local - let _19: *mut (); // anonymous local - let _20: bool; // anonymous local - let _21: AllocError; // anonymous local - let _22: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let val_0: T; // return + let self_1: Option[TraitClause0]; // arg #1 + let _2: !; // anonymous local - storage_live(_7) - storage_live(new_ptr_8) - storage_live(_12) - storage_live(_16) - storage_live(_17) - storage_live(_5) - storage_live(self_6) - self_6 = TraitClause0::allocate_zeroed<'9>(copy self_1, move new_layout_4) - storage_live(v_13) - match self_6 { - Result::Ok => { + storage_live(_2) + match self_1 { + Option::None => { }, - Result::Err => { - storage_dead(v_13) - storage_dead(self_6) - storage_live(_14) - storage_live(_15) - _14 = @discriminant(_7) - _15 = copy _14 == const 1 : isize - assert(move _15 == true) else undefined_behavior - storage_live(_21) - _21 = AllocError { } - storage_live(_22) - _22 = Result::Err { 0: move _21 } - _0 = move _22 - storage_dead(_15) - storage_dead(_14) - storage_dead(_5) + Option::Some => { + val_0 = move (self_1 as variant Option::Some).0 return }, } - v_13 = move (self_6 as variant Result::Ok).0 - _5 = ControlFlow::Continue { 0: copy v_13 } - storage_dead(v_13) - storage_dead(self_6) - new_ptr_8 = copy (_5 as variant ControlFlow::Continue).0 - storage_dead(_5) - storage_live(src_9) - src_9 = transmute, *const u8>(copy ptr_2) - storage_live(dst_10) - _16 = transmute, *mut [u8]>(copy new_ptr_8) - dst_10 = cast<*mut [u8], *mut u8>(copy _16) - storage_live(count_11) - count_11 = copy (old_layout_3).size - storage_live(_20) - _20 = ub_checks - if move _20 { - storage_live(_18) - _18 = transmute, *const ()>(copy ptr_2) - storage_live(_19) - _19 = cast<*mut [u8], *mut ()>(copy _16) - _17 = core::ptr::copy_nonoverlapping::precondition_check(move _18, move _19, 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 count_11) - storage_dead(_19) - storage_dead(_18) - } else { - } - copy_nonoverlapping(copy src_9, copy dst_10, copy count_11) - storage_dead(count_11) - storage_dead(dst_10) - storage_dead(src_9) - _12 = TraitClause0::deallocate<'11>(move self_1, move ptr_2, move old_layout_3) - _0 = Result::Ok { 0: copy new_ptr_8 } + _2 = unwrap_failed() +} + +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub fn ALIGNMENT() -> Alignment +where + TraitClause0: (Self: SizedTypeProperties), +{ + let _0: Alignment; // return + let _1: Option[{built_in impl Sized for Alignment}]; // anonymous local + + storage_live(_1) + _1 = core::mem::alignment::{Alignment}::new(const TraitClause0::ALIGN) + _0 = unwrap[{built_in impl Sized for Alignment}](move _1) + storage_dead(_1) return } -pub unsafe fn core::alloc::Allocator::shrink<'_0, Self>(self_1: &'_0 Self, ptr_2: NonNull, old_layout_3: Layout, new_layout_4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub const ALIGNMENT: Alignment where - TraitClause0: (Self: Allocator), + TraitClause0: (Self: SizedTypeProperties), + = ALIGNMENT() + +// Full name: core::mem::SizedTypeProperties::IS_ZST +pub fn IS_ZST() -> bool +where + TraitClause0: (Self: SizedTypeProperties), { - let _0: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // return - let self_1: &'1 Self; // arg #1 - let ptr_2: NonNull; // arg #2 - let old_layout_3: Layout; // arg #3 - let new_layout_4: Layout; // arg #4 - let _5: 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_6: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local - let _7: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local - let new_ptr_8: NonNull<[u8]>; // local - let src_9: *const u8; // local - let dst_10: *mut u8; // local - let count_11: usize; // local - let _12: (); // anonymous local - let v_13: NonNull<[u8]>; // local - let _14: isize; // anonymous local - let _15: bool; // anonymous local - let _16: *mut [u8]; // anonymous local - let _17: (); // anonymous local - let _18: *const (); // anonymous local - let _19: *mut (); // anonymous local - let _20: bool; // anonymous local - let _21: AllocError; // anonymous local - let _22: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let _0: bool; // return - storage_live(_7) - storage_live(new_ptr_8) - storage_live(_12) - storage_live(_16) - storage_live(_17) - storage_live(_5) - storage_live(self_6) - self_6 = TraitClause0::allocate<'9>(copy self_1, copy new_layout_4) - storage_live(v_13) - match self_6 { - Result::Ok => { - }, - Result::Err => { - storage_dead(v_13) - storage_dead(self_6) - storage_live(_14) - storage_live(_15) - _14 = @discriminant(_7) - _15 = copy _14 == const 1 : isize - assert(move _15 == true) else undefined_behavior - storage_live(_21) - _21 = AllocError { } - storage_live(_22) - _22 = Result::Err { 0: move _21 } - _0 = move _22 - storage_dead(_15) - storage_dead(_14) - storage_dead(_5) - return - }, - } - v_13 = move (self_6 as variant Result::Ok).0 - _5 = ControlFlow::Continue { 0: copy v_13 } - storage_dead(v_13) - storage_dead(self_6) - new_ptr_8 = copy (_5 as variant ControlFlow::Continue).0 - storage_dead(_5) - storage_live(src_9) - src_9 = transmute, *const u8>(copy ptr_2) - storage_live(dst_10) - _16 = transmute, *mut [u8]>(copy new_ptr_8) - dst_10 = cast<*mut [u8], *mut u8>(copy _16) - storage_live(count_11) - count_11 = copy (new_layout_4).size - storage_live(_20) - _20 = ub_checks - if move _20 { - storage_live(_18) - _18 = transmute, *const ()>(copy ptr_2) - storage_live(_19) - _19 = cast<*mut [u8], *mut ()>(copy _16) - _17 = core::ptr::copy_nonoverlapping::precondition_check(move _18, move _19, 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 count_11) - storage_dead(_19) - storage_dead(_18) - } else { - } - copy_nonoverlapping(copy src_9, copy dst_10, copy count_11) - storage_dead(count_11) - storage_dead(dst_10) - storage_dead(src_9) - _12 = TraitClause0::deallocate<'11>(move self_1, move ptr_2, move old_layout_3) - _0 = Result::Ok { 0: copy new_ptr_8 } + _0 = const TraitClause0::SIZE == const 0 : usize return } -pub fn core::alloc::Allocator::by_ref<'_0, Self>(self_1: &'_0 Self) -> &'_0 Self +// Full name: core::mem::SizedTypeProperties::IS_ZST +pub const IS_ZST: bool where - TraitClause0: (Self: Allocator), - TraitClause1: (Self: Sized), + TraitClause0: (Self: SizedTypeProperties), + = IS_ZST() + +// Full name: core::mem::SizedTypeProperties::LAYOUT +pub fn LAYOUT() -> Layout +where + TraitClause0: (Self: SizedTypeProperties), { - let _0: &'1 Self; // return - let self_1: &'2 Self; // arg #1 + let _0: Layout; // return - _0 = copy self_1 + _0 = from_size_align_unchecked(const TraitClause0::SIZE, const TraitClause0::ALIGN) + return +} + +// Full name: core::mem::SizedTypeProperties::LAYOUT +pub const LAYOUT: Layout +where + TraitClause0: (Self: SizedTypeProperties), + = LAYOUT() + +pub fn core::num::{usize}::MAX() -> usize +{ + let _0: usize; // return + + _0 = ~(const 0 : usize) + return +} + +pub const core::num::{usize}::MAX: usize = core::num::{usize}::MAX() + +pub fn core::num::{isize}::MAX() -> isize +{ + let _0: isize; // return + let _1: usize; // anonymous local + let _2: u32; // anonymous local + let _3: bool; // anonymous local + + storage_live(_2) + storage_live(_3) + storage_live(_1) + _2 = cast(const 1 : i32) + _3 = move _2 < const 64 : u32 + assert(move _3 == true) (overflow) else panic + _1 = copy core::num::{usize}::MAX wrap.>> const 1 : i32 + _0 = cast(move _1) + storage_dead(_1) + return +} + +pub const core::num::{isize}::MAX: isize = core::num::{isize}::MAX() + +// Full name: core::mem::SizedTypeProperties::MAX_SLICE_LEN +pub fn MAX_SLICE_LEN() -> usize +where + TraitClause0: (Self: SizedTypeProperties), +{ + let _0: usize; // return + let _1: usize; // anonymous local + let n_2: usize; // local + let _3: usize; // anonymous local + let _4: usize; // anonymous local + let _5: bool; // anonymous local + + storage_live(_5) + storage_live(_1) + _1 = const TraitClause0::SIZE + switch copy _1 { + 0 : usize => { + _0 = copy core::num::{usize}::MAX + }, + _ => { + storage_live(n_2) + n_2 = copy _1 + storage_live(_3) + _3 = cast(copy core::num::{isize}::MAX) + storage_live(_4) + _4 = copy n_2 + _5 = copy _4 == const 0 : usize + assert(move _5 == false) (division_by_zero) else panic + _0 = move _3 ub./ move _4 + storage_dead(_4) + storage_dead(_3) + storage_dead(n_2) + }, + } + storage_dead(_1) return } -#[lang_item("clone_fn")] -pub fn core::clone::Clone::clone<'_0, Self>(_1: &'_0 Self) -> Self +// Full name: core::mem::SizedTypeProperties::MAX_SLICE_LEN +pub const MAX_SLICE_LEN: usize where - TraitClause0: (Self: Clone), -= + TraitClause0: (Self: SizedTypeProperties), + = MAX_SLICE_LEN() -pub fn core::clone::Clone::clone_from<'_0, '_1, Self>(self_1: &'_0 mut Self, source_2: &'_1 Self) +// Full name: core::mem::{impl SizedTypeProperties for T} +impl SizedTypeProperties for T where - TraitClause0: (Self: Clone), - TraitClause1: (Self: Destruct), + TraitClause0: (T: Sized), { - 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::drop_in_place] (*self_1) - (*self_1) = move _3 - storage_dead(_3) - return + proof ImpliedClause0: (T: Sized) = 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::unique::Unique @@ -1781,11 +1804,11 @@ unsafe fn __rust_alloc(_1: usize, _2: Alignment) -> *mut u8 = // Full name: alloc::alloc::__rust_dealloc -unsafe fn __rust_dealloc(_1: *mut u8, _2: usize, _3: Alignment) +unsafe fn __rust_dealloc(_1: NonNull, _2: usize, _3: Alignment) = // Full name: alloc::alloc::__rust_realloc -unsafe fn __rust_realloc(_1: *mut u8, _2: usize, _3: Alignment, _4: usize) -> *mut u8 +unsafe fn __rust_realloc(_1: NonNull, _2: usize, _3: Alignment, _4: usize) -> *mut u8 = // Full name: alloc::alloc::__rust_alloc_zeroed @@ -1817,156 +1840,147 @@ fn alloc_impl_runtime(layout_1: Layout, zeroed_2: bool) -> Result, let ptr_11: NonNull; // local let _12: NonNull<[u8]>; // anonymous local let _13: Alignment; // anonymous local - let _14: *const u8; // anonymous local - let ptr_15: *mut [u8]; // local - let data_16: *mut u8; // local - let _17: (); // anonymous local - let _18: *mut (); // anonymous local - let _19: *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: (); // anonymous local + let _19: Alignment; // anonymous local let _20: (); // anonymous local let _21: Alignment; // anonymous local - let _22: (); // anonymous local - let _23: Alignment; // anonymous local - let _24: NonNull; // anonymous local - let _25: *const u8; // anonymous local - let _26: usize; // anonymous local - let _27: (); // anonymous local - let _28: *mut (); // anonymous local - let v_29: NonNull; // local - let v_30: NonNull; // local - let ptr_31: *mut [u8]; // local - let data_32: *mut u8; // local - let _33: (); // anonymous local - let _34: *mut (); // anonymous local - let _35: *const [u8]; // anonymous local - let _36: isize; // anonymous local - let _37: bool; // anonymous local - let _38: bool; // anonymous local - let _39: bool; // anonymous local - let _40: bool; // anonymous local - let _41: Option>[{built_in impl Sized for NonNull}]; // anonymous local - let _42: AllocError; // anonymous local - let _43: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local - let _44: AllocError; // anonymous local - let _45: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let _22: NonNull; // anonymous local + let _23: usize; // anonymous local + let _24: (); // anonymous local + let _25: *mut (); // anonymous local + let v_26: NonNull; // local + let v_27: NonNull; // local + let ptr_28: *mut [u8]; // local + let data_29: *mut u8; // local + let _30: (); // anonymous local + let _31: *mut (); // anonymous local + let _32: isize; // anonymous local + let _33: bool; // anonymous local + let _34: bool; // anonymous local + let _35: bool; // anonymous local + let _36: bool; // anonymous local + let _37: Option>[{built_in impl Sized for NonNull}]; // anonymous local + let _38: AllocError; // anonymous local + let _39: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local + let _40: AllocError; // anonymous local + let _41: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local storage_live(size_3) storage_live(raw_ptr_6) storage_live(_10) storage_live(ptr_11) storage_live(_13) - storage_live(_17) + storage_live(_16) + storage_live(_18) storage_live(_20) - storage_live(_22) - storage_live(_25) - storage_live(_27) - storage_live(_33) + storage_live(_24) + storage_live(_30) size_3 = copy (layout_1).size switch copy size_3 { 0 : usize => { }, _ => { if copy zeroed_2 { + _18 = __rust_no_alloc_shim_is_unstable_v2() + storage_live(_19) + _19 = copy (layout_1).align + raw_ptr_6 = __rust_alloc_zeroed(copy size_3, move _19) + storage_dead(_19) + } else { _20 = __rust_no_alloc_shim_is_unstable_v2() storage_live(_21) _21 = copy (layout_1).align - raw_ptr_6 = __rust_alloc_zeroed(copy size_3, move _21) + raw_ptr_6 = __rust_alloc(copy size_3, move _21) storage_dead(_21) - } else { - _22 = __rust_no_alloc_shim_is_unstable_v2() - storage_live(_23) - _23 = copy (layout_1).align - raw_ptr_6 = __rust_alloc(copy size_3, move _23) - storage_dead(_23) } storage_live(_7) storage_live(self_8) storage_live(self_9) - _25 = cast<*mut u8, *const u8>(copy raw_ptr_6) - storage_live(_26) - _26 = transmute<*mut u8, usize>(copy raw_ptr_6) - switch copy _26 { + storage_live(_23) + _23 = transmute<*mut u8, usize>(copy raw_ptr_6) + switch copy _23 { 0 : usize => { }, _ => { - storage_dead(_26) - storage_live(_24) - storage_live(_39) - _39 = ub_checks - if move _39 { - storage_live(_28) - _28 = cast<*mut u8, *mut ()>(copy raw_ptr_6) - _27 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _28) - storage_dead(_28) + storage_dead(_23) + storage_live(_22) + storage_live(_35) + _35 = ub_checks + if move _35 { + storage_live(_25) + _25 = cast<*mut u8, *mut ()>(copy raw_ptr_6) + _24 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _25) + storage_dead(_25) } else { } - _24 = NonNull { pointer: copy _25 } - self_9 = Option::Some { 0: move _24 } - storage_dead(_24) - storage_live(v_29) - v_29 = move (self_9 as variant Option::Some).0 - self_8 = Result::Ok { 0: copy v_29 } - storage_dead(v_29) + _22 = transmute<*mut u8, NonNull>(copy raw_ptr_6) + self_9 = Option::Some { 0: move _22 } + storage_dead(_22) + storage_live(v_26) + v_26 = move (self_9 as variant Option::Some).0 + self_8 = Result::Ok { 0: copy v_26 } + storage_dead(v_26) storage_dead(self_9) - storage_live(v_30) - v_30 = move (self_8 as variant Result::Ok).0 - _7 = ControlFlow::Continue { 0: copy v_30 } - storage_dead(v_30) + storage_live(v_27) + v_27 = move (self_8 as variant Result::Ok).0 + _7 = ControlFlow::Continue { 0: copy v_27 } + storage_dead(v_27) storage_dead(self_8) ptr_11 = copy (_7 as variant ControlFlow::Continue).0 storage_dead(_7) storage_live(_12) - storage_live(ptr_31) - storage_live(data_32) - data_32 = transmute, *mut u8>(copy ptr_11) - ptr_31 = *mut (copy data_32, copy size_3) - storage_dead(data_32) - storage_live(_35) - storage_live(_40) - _40 = ub_checks - if move _40 { - storage_live(_34) - _34 = transmute, *mut ()>(copy ptr_11) - _33 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _34) - storage_dead(_34) + storage_live(ptr_28) + storage_live(data_29) + data_29 = transmute, *mut u8>(copy ptr_11) + ptr_28 = *mut (copy data_29, copy size_3) + storage_dead(data_29) + storage_live(_36) + _36 = ub_checks + if move _36 { + storage_live(_31) + _31 = transmute, *mut ()>(copy ptr_11) + _30 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _31) + storage_dead(_31) } else { } - _35 = cast<*mut [u8], *const [u8]>(copy ptr_31) - _12 = NonNull { pointer: copy _35 } - storage_dead(_35) - storage_dead(ptr_31) + _12 = transmute<*mut [u8], NonNull<[u8]>>(copy ptr_28) + storage_dead(ptr_28) _0 = Result::Ok { 0: move _12 } storage_dead(_12) return }, } - storage_dead(_26) - storage_live(_41) - _41 = Option::None { } - self_9 = move _41 - storage_live(v_29) - storage_live(_42) - _42 = AllocError { } - storage_live(_43) - _43 = Result::Err { 0: move _42 } - self_8 = move _43 - storage_dead(v_29) + storage_dead(_23) + storage_live(_37) + _37 = Option::None { } + self_9 = move _37 + storage_live(v_26) + storage_live(_38) + _38 = AllocError { } + storage_live(_39) + _39 = Result::Err { 0: move _38 } + self_8 = move _39 + storage_dead(v_26) storage_dead(self_9) - storage_live(v_30) - storage_dead(v_30) + storage_live(v_27) + storage_dead(v_27) storage_dead(self_8) - storage_live(_36) - storage_live(_37) - _36 = @discriminant(_10) - _37 = copy _36 == const 1 : isize - assert(move _37 == true) else undefined_behavior - storage_live(_44) - _44 = AllocError { } - storage_live(_45) - _45 = Result::Err { 0: move _44 } - _0 = move _45 - storage_dead(_37) - storage_dead(_36) + storage_live(_32) + storage_live(_33) + _32 = @discriminant(_10) + _33 = copy _32 == const 1 : isize + assert(move _33 == true) else undefined_behavior + storage_live(_40) + _40 = AllocError { } + storage_live(_41) + _41 = Result::Err { 0: move _40 } + _0 = move _41 + storage_dead(_33) + storage_dead(_32) storage_dead(_7) return }, @@ -1974,29 +1988,23 @@ fn alloc_impl_runtime(layout_1: Layout, zeroed_2: bool) -> Result, storage_live(_4) storage_live(data_5) _13 = copy (layout_1).align - storage_live(_14) - _14 = transmute(copy _13) - data_5 = NonNull { pointer: copy _14 } - storage_dead(_14) - storage_live(ptr_15) - storage_live(data_16) - data_16 = transmute(copy _13) - ptr_15 = *mut (copy data_16, const 0 : usize) - storage_dead(data_16) - storage_live(_19) - storage_live(_38) - _38 = ub_checks - if move _38 { - storage_live(_18) - _18 = transmute(copy _13) - _17 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _18) - storage_dead(_18) + data_5 = transmute>(copy _13) + storage_live(ptr_14) + storage_live(data_15) + data_15 = transmute(copy _13) + ptr_14 = *mut (copy data_15, const 0 : usize) + storage_dead(data_15) + storage_live(_34) + _34 = ub_checks + if move _34 { + storage_live(_17) + _17 = transmute(copy _13) + _16 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _17) + storage_dead(_17) } else { } - _19 = cast<*mut [u8], *const [u8]>(copy ptr_15) - _4 = NonNull { pointer: copy _19 } - storage_dead(_19) - storage_dead(ptr_15) + _4 = transmute<*mut [u8], NonNull<[u8]>>(copy ptr_14) + storage_dead(ptr_14) storage_dead(data_5) _0 = Result::Ok { 0: move _4 } storage_dead(_4) @@ -2019,82 +2027,78 @@ fn grow_impl_runtime<'_0>(self_1: &'_0 Global, ptr_2: NonNull, old_layout_3: let new_size_10: usize; // local let cond_11: bool; // local let raw_ptr_12: *mut u8; // local - let ptr_13: *mut u8; // 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 _17: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local - let ptr_18: NonNull; // local - let _19: (); // anonymous local - let self_20: *mut u8; // local - let count_21: usize; // local - let _22: NonNull<[u8]>; // anonymous local - let _23: 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_24: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local - let _25: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous 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: Alignment; // anonymous local - let _32: Alignment; // anonymous local - let _33: (); // anonymous local - let _34: NonNull; // anonymous local - let _35: *const u8; // anonymous local - let _36: usize; // anonymous local - let _37: (); // anonymous local - let _38: *mut (); // anonymous local - let v_39: NonNull; // local - let v_40: NonNull; // local - let _41: isize; // anonymous local + let _13: 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_14: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // local + let self_15: Option>[{built_in impl Sized for NonNull}]; // local + let _16: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous 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 _24: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local + let new_ptr_25: NonNull<[u8]>; // local + let src_26: *const 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: usize; // anonymous local + let _34: (); // anonymous local + let _35: *mut (); // anonymous local + let v_36: NonNull; // local + let v_37: NonNull; // local + let _38: isize; // anonymous local + let _39: bool; // anonymous local + let _40: (); // anonymous local + let _41: *const (); // anonymous local let _42: bool; // anonymous local - let _43: (); // anonymous local - let _44: *const (); // anonymous local - let _45: bool; // anonymous local - let ptr_46: *mut [u8]; // local - let data_47: *mut u8; // local - let _48: (); // anonymous local - let _49: *mut (); // anonymous local - let _50: *const [u8]; // anonymous local - let v_51: NonNull<[u8]>; // local - let _52: isize; // anonymous local - let _53: bool; // anonymous local - let _54: *mut [u8]; // anonymous local - let _55: (); // anonymous local - let _56: *const (); // anonymous local - let _57: *mut (); // anonymous local + let ptr_43: *mut [u8]; // local + let data_44: *mut u8; // local + let _45: (); // anonymous local + let _46: *mut (); // anonymous local + let v_47: NonNull<[u8]>; // local + let _48: isize; // anonymous local + let _49: bool; // anonymous local + let _50: NonNull; // anonymous local + let _51: *mut u8; // anonymous local + let _52: *mut [u8]; // anonymous local + let _53: (); // anonymous local + let _54: *const (); // anonymous local + let _55: *mut (); // anonymous local + let _56: bool; // anonymous local + let _57: bool; // anonymous local let _58: bool; // anonymous local let _59: bool; // anonymous local let _60: bool; // anonymous local - let _61: bool; // anonymous local - let _62: bool; // 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 _65: Option>[{built_in impl Sized for NonNull}]; // anonymous local + let _61: AllocError; // anonymous local + let _62: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let _63: Option>[{built_in impl Sized for NonNull}]; // anonymous local + let _64: AllocError; // anonymous local + let _65: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local let _66: AllocError; // anonymous local - let _67: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local - let _68: AllocError; // anonymous local - let _69: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let _67: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local storage_live(old_size_6) storage_live(new_size_10) storage_live(raw_ptr_12) - storage_live(_17) - storage_live(ptr_18) - storage_live(_19) - storage_live(_25) - storage_live(new_ptr_26) - storage_live(ptr_28) - storage_live(_30) + storage_live(_16) + storage_live(ptr_17) + storage_live(_18) + storage_live(_24) + storage_live(new_ptr_25) + storage_live(_28) + storage_live(_29) storage_live(_31) - storage_live(_33) - storage_live(_35) - storage_live(_37) - storage_live(_43) - storage_live(_48) - storage_live(_54) - storage_live(_55) + storage_live(_34) + storage_live(_40) + storage_live(_45) + storage_live(_50) + storage_live(_53) old_size_6 = copy (old_layout_3).size switch copy old_size_6 { 0 : usize => { @@ -2102,74 +2106,79 @@ fn grow_impl_runtime<'_0>(self_1: &'_0 Global, ptr_2: NonNull, old_layout_3: _ => { storage_live(_7) storage_live(_8) - _31 = copy (old_layout_3).align - _8 = transmute(copy _31) + _29 = copy (old_layout_3).align + _8 = transmute(copy _29) storage_live(_9) - storage_live(_32) - _32 = copy (new_layout_4).align - _9 = transmute(copy _32) - storage_dead(_32) + storage_live(_30) + _30 = copy (new_layout_4).align + _9 = transmute(copy _30) + storage_dead(_30) _7 = move _8 == move _9 if move _7 { } else { storage_dead(_9) storage_dead(_8) storage_dead(_7) - storage_live(_23) - storage_live(self_24) - self_24 = alloc_impl_runtime(move new_layout_4, move zeroed_5) - storage_live(v_51) - match self_24 { + 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_51) - storage_dead(self_24) - storage_live(_52) - storage_live(_53) - _52 = @discriminant(_25) - _53 = copy _52 == const 1 : isize - assert(move _53 == true) else undefined_behavior - storage_live(_63) - _63 = AllocError { } - storage_live(_64) - _64 = Result::Err { 0: move _63 } - _0 = move _64 - storage_dead(_53) - storage_dead(_52) - storage_dead(_23) + storage_dead(v_47) + storage_dead(self_23) + storage_live(_48) + storage_live(_49) + _48 = @discriminant(_24) + _49 = copy _48 == const 1 : isize + assert(move _49 == true) else undefined_behavior + storage_live(_61) + _61 = AllocError { } + storage_live(_62) + _62 = Result::Err { 0: move _61 } + _0 = move _62 + storage_dead(_49) + storage_dead(_48) + storage_dead(_22) return }, } - v_51 = move (self_24 as variant Result::Ok).0 - _23 = ControlFlow::Continue { 0: copy v_51 } - storage_dead(v_51) - storage_dead(self_24) - new_ptr_26 = copy (_23 as variant ControlFlow::Continue).0 - storage_dead(_23) - storage_live(src_27) - ptr_28 = transmute, *mut u8>(copy ptr_2) - src_27 = transmute, *const u8>(copy ptr_2) - storage_live(dst_29) - _54 = transmute, *mut [u8]>(copy new_ptr_26) - dst_29 = cast<*mut [u8], *mut u8>(copy _54) - storage_live(_59) - _59 = ub_checks - if move _59 { - storage_live(_56) - _56 = transmute, *const ()>(copy ptr_2) - storage_live(_57) - _57 = cast<*mut [u8], *mut ()>(copy _54) - _55 = core::ptr::copy_nonoverlapping::precondition_check(move _56, move _57, 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(_57) - storage_dead(_56) + 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_25 = copy (_22 as variant ControlFlow::Continue).0 + storage_dead(_22) + storage_live(src_26) + src_26 = transmute, *const u8>(copy ptr_2) + storage_live(dst_27) + storage_live(_51) + storage_live(_52) + _52 = transmute, *mut [u8]>(copy new_ptr_25) + _51 = cast<*mut [u8], *mut u8>(copy _52) + storage_dead(_52) + _50 = transmute<*mut u8, NonNull>(copy _51) + storage_dead(_51) + dst_27 = transmute, *mut u8>(copy _50) + storage_live(_57) + _57 = ub_checks + if move _57 { + storage_live(_54) + _54 = transmute, *const ()>(copy ptr_2) + storage_live(_55) + _55 = transmute, *mut ()>(copy _50) + _53 = core::ptr::copy_nonoverlapping::precondition_check(move _54, move _55, const 1 : usize, const 1 : usize, copy old_size_6) + storage_dead(_55) + storage_dead(_54) } else { } - copy_nonoverlapping(copy src_27, copy dst_29, copy old_size_6) - storage_dead(dst_29) - storage_dead(src_27) - _30 = __rust_dealloc(move ptr_28, move old_size_6, move _31) - _0 = Result::Ok { 0: copy new_ptr_26 } + copy_nonoverlapping(copy src_26, copy dst_27, copy old_size_6) + storage_dead(dst_27) + storage_dead(src_26) + _28 = __rust_dealloc(move ptr_2, move old_size_6, move _29) + _0 = Result::Ok { 0: copy new_ptr_25 } return } storage_dead(_9) @@ -2178,129 +2187,122 @@ fn grow_impl_runtime<'_0>(self_1: &'_0 Global, ptr_2: NonNull, old_layout_3: new_size_10 = copy (new_layout_4).size storage_live(cond_11) cond_11 = copy new_size_10 >= copy old_size_6 - storage_live(_58) - _58 = ub_checks - if move _58 { - _33 = core::hint::assert_unchecked::precondition_check(copy cond_11) + storage_live(_56) + _56 = ub_checks + if move _56 { + _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) - ptr_13 = transmute, *mut u8>(copy ptr_2) - raw_ptr_12 = __rust_realloc(move ptr_13, copy old_size_6, move _31, copy new_size_10) - storage_dead(ptr_13) - storage_live(_14) + raw_ptr_12 = __rust_realloc(move ptr_2, copy old_size_6, move _29, copy new_size_10) + storage_live(_13) + storage_live(self_14) storage_live(self_15) - storage_live(self_16) - _35 = cast<*mut u8, *const u8>(copy raw_ptr_12) - storage_live(_36) - _36 = transmute<*mut u8, usize>(copy raw_ptr_12) - switch copy _36 { + storage_live(_33) + _33 = transmute<*mut u8, usize>(copy raw_ptr_12) + switch copy _33 { 0 : usize => { }, _ => { - storage_dead(_36) - storage_live(_34) - storage_live(_60) - _60 = ub_checks - if move _60 { - storage_live(_38) - _38 = cast<*mut u8, *mut ()>(copy raw_ptr_12) - _37 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _38) - storage_dead(_38) + storage_dead(_33) + storage_live(_32) + storage_live(_58) + _58 = ub_checks + if move _58 { + storage_live(_35) + _35 = cast<*mut u8, *mut ()>(copy raw_ptr_12) + _34 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _35) + storage_dead(_35) } else { } - _34 = NonNull { pointer: copy _35 } - self_16 = Option::Some { 0: move _34 } - storage_dead(_34) - storage_live(v_39) - v_39 = move (self_16 as variant Option::Some).0 - self_15 = Result::Ok { 0: copy v_39 } - storage_dead(v_39) - storage_dead(self_16) - storage_live(v_40) - v_40 = move (self_15 as variant Result::Ok).0 - _14 = ControlFlow::Continue { 0: copy v_40 } - storage_dead(v_40) + _32 = transmute<*mut u8, NonNull>(copy raw_ptr_12) + self_15 = Option::Some { 0: move _32 } + storage_dead(_32) + storage_live(v_36) + v_36 = move (self_15 as variant Option::Some).0 + self_14 = Result::Ok { 0: copy v_36 } + storage_dead(v_36) storage_dead(self_15) - ptr_18 = copy (_14 as variant ControlFlow::Continue).0 - storage_dead(_14) + storage_live(v_37) + v_37 = move (self_14 as variant Result::Ok).0 + _13 = ControlFlow::Continue { 0: copy v_37 } + storage_dead(v_37) + storage_dead(self_14) + ptr_17 = copy (_13 as variant ControlFlow::Continue).0 + storage_dead(_13) if copy zeroed_5 { - storage_live(self_20) - self_20 = copy raw_ptr_12 offset copy old_size_6 - storage_live(count_21) - count_21 = copy new_size_10 wrap.- copy old_size_6 - storage_live(_61) - _61 = ub_checks - if move _61 { - storage_live(_44) - _44 = cast<*mut u8, *const ()>(copy self_20) - storage_live(_45) - _45 = copy count_21 == const 0 : usize - _43 = core::ptr::write_bytes::precondition_check(move _44, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, move _45) - storage_dead(_45) - storage_dead(_44) + 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(_59) + _59 = ub_checks + if move _59 { + storage_live(_41) + _41 = cast<*mut u8, *const ()>(copy self_19) + storage_live(_42) + _42 = copy count_20 == const 0 : usize + _40 = core::ptr::write_bytes::precondition_check(move _41, const 1 : usize, move _42) + storage_dead(_42) + storage_dead(_41) } else { } - _19 = write_bytes[{built_in impl Sized for u8}](move self_20, const 0 : u8, move count_21) - storage_dead(count_21) - storage_dead(self_20) + _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(_22) - storage_live(ptr_46) - storage_live(data_47) - data_47 = transmute, *mut u8>(copy ptr_18) - ptr_46 = *mut (copy data_47, copy new_size_10) - storage_dead(data_47) - storage_live(_50) - storage_live(_62) - _62 = ub_checks - if move _62 { - storage_live(_49) - _49 = transmute, *mut ()>(copy ptr_18) - _48 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _49) - storage_dead(_49) + storage_live(_21) + storage_live(ptr_43) + storage_live(data_44) + data_44 = transmute, *mut u8>(copy ptr_17) + ptr_43 = *mut (copy data_44, copy new_size_10) + storage_dead(data_44) + storage_live(_60) + _60 = ub_checks + if move _60 { + storage_live(_46) + _46 = transmute, *mut ()>(copy ptr_17) + _45 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _46) + storage_dead(_46) } else { } - _50 = cast<*mut [u8], *const [u8]>(copy ptr_46) - _22 = NonNull { pointer: copy _50 } - storage_dead(_50) - storage_dead(ptr_46) - _0 = Result::Ok { 0: move _22 } - storage_dead(_22) + _21 = transmute<*mut [u8], NonNull<[u8]>>(copy ptr_43) + storage_dead(ptr_43) + _0 = Result::Ok { 0: move _21 } + storage_dead(_21) return }, } - storage_dead(_36) + storage_dead(_33) + storage_live(_63) + _63 = Option::None { } + self_15 = move _63 + storage_live(v_36) + storage_live(_64) + _64 = AllocError { } storage_live(_65) - _65 = Option::None { } - self_16 = move _65 - storage_live(v_39) + _65 = Result::Err { 0: move _64 } + self_14 = move _65 + storage_dead(v_36) + storage_dead(self_15) + storage_live(v_37) + storage_dead(v_37) + storage_dead(self_14) + storage_live(_38) + storage_live(_39) + _38 = @discriminant(_16) + _39 = copy _38 == const 1 : isize + assert(move _39 == true) else undefined_behavior storage_live(_66) _66 = AllocError { } storage_live(_67) _67 = Result::Err { 0: move _66 } - self_15 = move _67 - storage_dead(v_39) - storage_dead(self_16) - storage_live(v_40) - storage_dead(v_40) - storage_dead(self_15) - storage_live(_41) - storage_live(_42) - _41 = @discriminant(_17) - _42 = copy _41 == const 1 : isize - assert(move _42 == true) else undefined_behavior - storage_live(_68) - _68 = AllocError { } - storage_live(_69) - _69 = Result::Err { 0: move _68 } - _0 = move _69 - storage_dead(_42) - storage_dead(_41) - storage_dead(_14) + _0 = move _67 + storage_dead(_39) + storage_dead(_38) + storage_dead(_13) return }, } @@ -2327,88 +2329,81 @@ fn shrink_impl_runtime<'_0>(self_1: &'_0 Global, ptr_2: NonNull, old_layout_ 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 _20: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local - let ptr_21: NonNull; // local - let _22: NonNull<[u8]>; // anonymous local - let _23: 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_24: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local - let _25: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous 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 _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 _19: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous 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 _24: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local + let new_ptr_25: NonNull<[u8]>; // local + let src_26: *const u8; // local + let dst_27: *mut u8; // local + let _28: (); // anonymous local + let _29: Alignment; // anonymous local + let _30: usize; // anonymous local let _31: Alignment; // anonymous local - let _32: usize; // anonymous local - let ptr_33: *mut u8; // local - let _34: Alignment; // anonymous local - let _35: Alignment; // anonymous local - let _36: *const u8; // anonymous local - let ptr_37: *mut [u8]; // local - let data_38: *mut u8; // local - let _39: (); // anonymous local - let _40: *mut (); // anonymous local - let _41: *const [u8]; // anonymous local - let _42: Alignment; // anonymous local - let _43: (); // anonymous local - let _44: NonNull; // anonymous local - let _45: *const u8; // anonymous local - let _46: usize; // anonymous local + let _32: Alignment; // anonymous local + let ptr_33: *mut [u8]; // local + let data_34: *mut u8; // local + let _35: (); // anonymous local + let _36: *mut (); // anonymous local + let _37: Alignment; // anonymous local + let _38: (); // anonymous local + let _39: NonNull; // anonymous local + let _40: usize; // anonymous local + let _41: (); // anonymous local + let _42: *mut (); // anonymous local + let v_43: NonNull; // local + let v_44: NonNull; // local + let ptr_45: *mut [u8]; // local + let data_46: *mut u8; // local let _47: (); // anonymous local let _48: *mut (); // anonymous local - let v_49: NonNull; // local - let v_50: NonNull; // local - let ptr_51: *mut [u8]; // local - let data_52: *mut u8; // local - let _53: (); // anonymous local - let _54: *mut (); // anonymous local - let _55: *const [u8]; // anonymous local - let _56: isize; // anonymous local - let _57: bool; // anonymous local - let v_58: NonNull<[u8]>; // local - let _59: isize; // anonymous local - let _60: bool; // anonymous local - let _61: *mut [u8]; // anonymous local - let _62: (); // anonymous local - let _63: *const (); // anonymous local - let _64: *mut (); // anonymous local - let _65: usize; // anonymous local - let _66: bool; // anonymous local - let _67: bool; // anonymous local - let _68: bool; // anonymous local - let _69: bool; // anonymous local - let _70: bool; // anonymous local + let _49: isize; // anonymous local + let _50: bool; // anonymous local + let v_51: NonNull<[u8]>; // local + let _52: isize; // anonymous local + let _53: bool; // anonymous local + let _54: NonNull; // anonymous local + let _55: *mut u8; // anonymous local + let _56: *mut [u8]; // anonymous local + let _57: (); // 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: 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: Option>[{built_in impl Sized for NonNull}]; // anonymous local - let _74: AllocError; // anonymous local - let _75: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local - let _76: AllocError; // anonymous local - let _77: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local storage_live(new_size_6) storage_live(_7) storage_live(_14) storage_live(raw_ptr_15) - storage_live(_20) - storage_live(ptr_21) - storage_live(_25) - storage_live(new_ptr_26) - storage_live(ptr_28) - storage_live(_30) - storage_live(_31) + storage_live(_19) + storage_live(ptr_20) + storage_live(_24) + storage_live(new_ptr_25) + storage_live(_28) + storage_live(_29) + storage_live(_32) storage_live(_35) - storage_live(_39) - storage_live(_43) - storage_live(_45) + storage_live(_38) + storage_live(_41) storage_live(_47) - storage_live(_53) - storage_live(_61) - storage_live(_62) + storage_live(_54) + storage_live(_57) new_size_6 = copy (new_layout_4).size switch copy new_size_6 { 0 : usize => { @@ -2416,83 +2411,88 @@ fn shrink_impl_runtime<'_0>(self_1: &'_0 Global, ptr_2: NonNull, old_layout_ _ => { storage_live(_10) storage_live(_11) - _31 = copy (old_layout_3).align - _11 = transmute(copy _31) + _29 = copy (old_layout_3).align + _11 = transmute(copy _29) storage_live(_12) - storage_live(_42) - _42 = copy (new_layout_4).align - _12 = transmute(copy _42) - storage_dead(_42) + storage_live(_37) + _37 = copy (new_layout_4).align + _12 = transmute(copy _37) + storage_dead(_37) _10 = move _11 == move _12 if move _10 { } else { storage_dead(_12) storage_dead(_11) storage_dead(_10) - storage_live(_23) - storage_live(self_24) - self_24 = alloc_impl_runtime(move new_layout_4, const false) - storage_live(v_58) - match self_24 { + storage_live(_22) + storage_live(self_23) + self_23 = alloc_impl_runtime(move new_layout_4, const false) + storage_live(v_51) + match self_23 { Result::Ok => { }, Result::Err => { - storage_dead(v_58) - storage_dead(self_24) - storage_live(_59) - storage_live(_60) - _59 = @discriminant(_25) - _60 = copy _59 == const 1 : isize - assert(move _60 == true) else undefined_behavior - storage_live(_71) - _71 = AllocError { } - storage_live(_72) - _72 = Result::Err { 0: move _71 } - _0 = move _72 - storage_dead(_60) - storage_dead(_59) - storage_dead(_23) + storage_dead(v_51) + storage_dead(self_23) + storage_live(_52) + storage_live(_53) + _52 = @discriminant(_24) + _53 = copy _52 == const 1 : isize + assert(move _53 == true) else undefined_behavior + storage_live(_66) + _66 = AllocError { } + storage_live(_67) + _67 = Result::Err { 0: move _66 } + _0 = move _67 + storage_dead(_53) + storage_dead(_52) + storage_dead(_22) return }, } - v_58 = move (self_24 as variant Result::Ok).0 - _23 = ControlFlow::Continue { 0: copy v_58 } - storage_dead(v_58) - storage_dead(self_24) - new_ptr_26 = copy (_23 as variant ControlFlow::Continue).0 - storage_dead(_23) - 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(_68) - _68 = ub_checks - if move _68 { - 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_6) - storage_dead(_64) - storage_dead(_63) + v_51 = move (self_23 as variant Result::Ok).0 + _22 = ControlFlow::Continue { 0: copy v_51 } + storage_dead(v_51) + storage_dead(self_23) + new_ptr_25 = copy (_22 as variant ControlFlow::Continue).0 + storage_dead(_22) + storage_live(src_26) + src_26 = transmute, *const u8>(copy ptr_2) + storage_live(dst_27) + storage_live(_55) + storage_live(_56) + _56 = transmute, *mut [u8]>(copy new_ptr_25) + _55 = cast<*mut [u8], *mut u8>(copy _56) + storage_dead(_56) + _54 = transmute<*mut u8, NonNull>(copy _55) + storage_dead(_55) + dst_27 = transmute, *mut u8>(copy _54) + storage_live(_63) + _63 = ub_checks + if move _63 { + storage_live(_58) + _58 = transmute, *const ()>(copy ptr_2) + storage_live(_59) + _59 = transmute, *mut ()>(copy _54) + _57 = core::ptr::copy_nonoverlapping::precondition_check(move _58, move _59, const 1 : usize, const 1 : usize, copy new_size_6) + storage_dead(_59) + storage_dead(_58) } else { } - copy_nonoverlapping(copy src_27, copy dst_29, copy new_size_6) - storage_dead(dst_29) - storage_dead(src_27) - storage_live(_65) - _65 = copy (old_layout_3).size - switch copy _65 { + copy_nonoverlapping(copy src_26, copy dst_27, copy new_size_6) + storage_dead(dst_27) + storage_dead(src_26) + storage_live(_60) + _60 = copy (old_layout_3).size + switch copy _60 { 0 : usize => { }, _ => { - _30 = __rust_dealloc(move ptr_28, move _65, move _31) + _28 = __rust_dealloc(move ptr_2, move _60, move _29) }, } - storage_dead(_65) - _0 = Result::Ok { 0: copy new_ptr_26 } + storage_dead(_60) + _0 = Result::Ok { 0: copy new_ptr_25 } return } storage_dead(_12) @@ -2501,152 +2501,136 @@ fn shrink_impl_runtime<'_0>(self_1: &'_0 Global, ptr_2: NonNull, old_layout_ storage_live(cond_13) _14 = copy (old_layout_3).size cond_13 = copy new_size_6 <= copy _14 - storage_live(_67) - _67 = ub_checks - if move _67 { - _43 = core::hint::assert_unchecked::precondition_check(copy cond_13) + storage_live(_62) + _62 = ub_checks + if move _62 { + _38 = 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 _31, copy new_size_6) - storage_dead(ptr_16) - storage_live(_17) + raw_ptr_15 = __rust_realloc(move ptr_2, move _14, move _29, copy new_size_6) + storage_live(_16) + storage_live(self_17) storage_live(self_18) - storage_live(self_19) - _45 = cast<*mut u8, *const u8>(copy raw_ptr_15) - storage_live(_46) - _46 = transmute<*mut u8, usize>(copy raw_ptr_15) - switch copy _46 { + storage_live(_40) + _40 = transmute<*mut u8, usize>(copy raw_ptr_15) + switch copy _40 { 0 : usize => { }, _ => { - storage_dead(_46) - storage_live(_44) - storage_live(_69) - _69 = ub_checks - if move _69 { - storage_live(_48) - _48 = cast<*mut u8, *mut ()>(copy raw_ptr_15) - _47 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _48) - storage_dead(_48) + storage_dead(_40) + storage_live(_39) + storage_live(_64) + _64 = ub_checks + if move _64 { + storage_live(_42) + _42 = cast<*mut u8, *mut ()>(copy raw_ptr_15) + _41 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _42) + storage_dead(_42) } else { } - _44 = NonNull { pointer: copy _45 } - self_19 = Option::Some { 0: move _44 } - storage_dead(_44) - storage_live(v_49) - v_49 = move (self_19 as variant Option::Some).0 - self_18 = Result::Ok { 0: copy v_49 } - storage_dead(v_49) - storage_dead(self_19) - storage_live(v_50) - v_50 = move (self_18 as variant Result::Ok).0 - _17 = ControlFlow::Continue { 0: copy v_50 } - storage_dead(v_50) + _39 = transmute<*mut u8, NonNull>(copy raw_ptr_15) + self_18 = Option::Some { 0: move _39 } + storage_dead(_39) + storage_live(v_43) + v_43 = move (self_18 as variant Option::Some).0 + self_17 = Result::Ok { 0: copy v_43 } + storage_dead(v_43) storage_dead(self_18) - ptr_21 = copy (_17 as variant ControlFlow::Continue).0 - storage_dead(_17) - storage_live(_22) - storage_live(ptr_51) - storage_live(data_52) - data_52 = transmute, *mut u8>(copy ptr_21) - ptr_51 = *mut (copy data_52, copy new_size_6) - storage_dead(data_52) - storage_live(_55) - storage_live(_70) - _70 = ub_checks - if move _70 { - storage_live(_54) - _54 = transmute, *mut ()>(copy ptr_21) - _53 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _54) - storage_dead(_54) + storage_live(v_44) + v_44 = move (self_17 as variant Result::Ok).0 + _16 = ControlFlow::Continue { 0: copy v_44 } + storage_dead(v_44) + storage_dead(self_17) + ptr_20 = copy (_16 as variant ControlFlow::Continue).0 + storage_dead(_16) + storage_live(_21) + storage_live(ptr_45) + storage_live(data_46) + data_46 = transmute, *mut u8>(copy ptr_20) + ptr_45 = *mut (copy data_46, copy new_size_6) + storage_dead(data_46) + storage_live(_65) + _65 = ub_checks + if move _65 { + storage_live(_48) + _48 = transmute, *mut ()>(copy ptr_20) + _47 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _48) + storage_dead(_48) } else { } - _55 = cast<*mut [u8], *const [u8]>(copy ptr_51) - _22 = NonNull { pointer: copy _55 } - storage_dead(_55) - storage_dead(ptr_51) - _0 = Result::Ok { 0: move _22 } - storage_dead(_22) + _21 = transmute<*mut [u8], NonNull<[u8]>>(copy ptr_45) + storage_dead(ptr_45) + _0 = Result::Ok { 0: move _21 } + storage_dead(_21) return }, } - storage_dead(_46) - storage_live(_73) - _73 = Option::None { } - self_19 = move _73 - storage_live(v_49) - storage_live(_74) - _74 = AllocError { } - storage_live(_75) - _75 = Result::Err { 0: move _74 } - self_18 = move _75 - storage_dead(v_49) - storage_dead(self_19) - storage_live(v_50) - storage_dead(v_50) + storage_dead(_40) + storage_live(_68) + _68 = Option::None { } + self_18 = move _68 + storage_live(v_43) + storage_live(_69) + _69 = AllocError { } + storage_live(_70) + _70 = Result::Err { 0: move _69 } + self_17 = move _70 + storage_dead(v_43) storage_dead(self_18) - storage_live(_56) - storage_live(_57) - _56 = @discriminant(_20) - _57 = copy _56 == const 1 : isize - assert(move _57 == true) else undefined_behavior - storage_live(_76) - _76 = AllocError { } - storage_live(_77) - _77 = Result::Err { 0: move _76 } - _0 = move _77 - storage_dead(_57) - storage_dead(_56) - storage_dead(_17) + storage_live(v_44) + storage_dead(v_44) + storage_dead(self_17) + storage_live(_49) + storage_live(_50) + _49 = @discriminant(_19) + _50 = copy _49 == const 1 : isize + assert(move _50 == true) else undefined_behavior + storage_live(_71) + _71 = AllocError { } + storage_live(_72) + _72 = Result::Err { 0: move _71 } + _0 = move _72 + storage_dead(_50) + storage_dead(_49) + storage_dead(_16) return }, } - storage_live(_32) - _32 = copy (old_layout_3).size - switch copy _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) - _34 = copy (old_layout_3).align - _7 = __rust_dealloc(move ptr_33, move _32, move _34) - storage_dead(_34) - storage_dead(ptr_33) + storage_live(_31) + _31 = copy (old_layout_3).align + _7 = __rust_dealloc(move ptr_2, move _30, move _31) + storage_dead(_31) }, } - storage_dead(_32) + storage_dead(_30) storage_live(_8) storage_live(data_9) - _35 = copy (new_layout_4).align - storage_live(_36) - _36 = transmute(copy _35) - data_9 = NonNull { pointer: copy _36 } - storage_dead(_36) - storage_live(ptr_37) - storage_live(data_38) - data_38 = transmute(copy _35) - ptr_37 = *mut (copy data_38, const 0 : usize) - storage_dead(data_38) - storage_live(_41) - storage_live(_66) - _66 = ub_checks - if move _66 { - storage_live(_40) - _40 = transmute(copy _35) - _39 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _40) - storage_dead(_40) + _32 = copy (new_layout_4).align + data_9 = transmute>(copy _32) + storage_live(ptr_33) + storage_live(data_34) + data_34 = transmute(copy _32) + ptr_33 = *mut (copy data_34, const 0 : usize) + storage_dead(data_34) + storage_live(_61) + _61 = ub_checks + if move _61 { + storage_live(_36) + _36 = transmute(copy _32) + _35 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _36) + storage_dead(_36) } else { } - _41 = cast<*mut [u8], *const [u8]>(copy ptr_37) - _8 = NonNull { pointer: copy _41 } - storage_dead(_41) - storage_dead(ptr_37) + _8 = transmute<*mut [u8], NonNull<[u8]>>(copy ptr_33) + storage_dead(ptr_33) storage_dead(data_9) _0 = Result::Ok { 0: move _8 } storage_dead(_8) @@ -2700,8 +2684,7 @@ pub unsafe fn {impl Allocator for Global}::deallocate<'_0>(self_1: &'_0 Global, let ptr_2: NonNull; // arg #2 let layout_3: Layout; // arg #3 let _4: usize; // anonymous local - let ptr_5: *mut u8; // local - let _6: Alignment; // anonymous local + let _5: Alignment; // anonymous local _0 = () storage_live(_4) @@ -2710,13 +2693,10 @@ pub unsafe fn {impl Allocator for Global}::deallocate<'_0>(self_1: &'_0 Global, 0 : usize => { }, _ => { - storage_live(ptr_5) - ptr_5 = transmute, *mut u8>(copy ptr_2) - storage_live(_6) - _6 = copy (layout_3).align - _0 = __rust_dealloc(move ptr_5, move _4, move _6) - storage_dead(_6) - storage_dead(ptr_5) + storage_live(_5) + _5 = copy (layout_3).align + _0 = __rust_dealloc(move ptr_2, move _4, move _5) + storage_dead(_5) }, } storage_dead(_4) @@ -2818,6 +2798,44 @@ where TraitClause2: (A: Allocator), = +// Full name: alloc::boxed::box_new_uninit +fn box_new_uninit(layout_1: Layout) -> *mut u8 +{ + let _0: *mut u8; // return + let layout_1: Layout; // arg #1 + let _2: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let ptr_3: NonNull<[u8]>; // local + let _4: !; // anonymous local + let _5: NonNull; // anonymous local + let _6: *mut u8; // anonymous local + let _7: *mut [u8]; // anonymous local + + storage_live(ptr_3) + storage_live(_4) + storage_live(_2) + _2 = alloc_impl_runtime(copy layout_1, const false) + match _2 { + Result::Ok => { + }, + Result::Err => { + _4 = handle_alloc_error(move layout_1) + }, + } + ptr_3 = copy (_2 as variant Result::Ok).0 + storage_live(_5) + storage_live(_6) + storage_live(_7) + _7 = transmute, *mut [u8]>(copy ptr_3) + _6 = cast<*mut [u8], *mut u8>(copy _7) + storage_dead(_7) + _5 = transmute<*mut u8, NonNull>(copy _6) + storage_dead(_6) + _0 = transmute, *mut u8>(copy _5) + storage_dead(_5) + storage_dead(_2) + return +} + #[lang_item("box_new")] pub fn alloc::boxed::{Box[TraitClause0::ImpliedClause0, {built_in impl Sized for Global}, {impl Allocator for Global}]}::new(x_1: T) -> Box[TraitClause0::ImpliedClause0, {built_in impl Sized for Global}, {impl Allocator for Global}] where @@ -2826,56 +2844,14 @@ where let _0: Box[TraitClause0::ImpliedClause0, {built_in impl Sized for Global}, {impl Allocator for Global}]; // return let x_1: T; // arg #1 let ptr_2: *mut T; // local - let size_3: usize; // local - let align_4: usize; // local - let layout_5: Layout; // local - let _6: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - let ptr_7: NonNull<[u8]>; // local - let _8: !; // anonymous local - let _9: (); // anonymous local - let _10: Alignment; // anonymous local - let _11: *mut [u8]; // anonymous local - let _12: bool; // anonymous local + let _3: *mut u8; // anonymous local storage_live(ptr_2) - storage_live(_8) - storage_live(_9) - storage_live(_11) - storage_live(size_3) - size_3 = const {impl SizedTypeProperties for T}[TraitClause0]::SIZE - storage_live(align_4) - align_4 = const {impl SizedTypeProperties for T}[TraitClause0]::ALIGN - storage_live(layout_5) - storage_live(ptr_7) - storage_live(_12) - _12 = ub_checks - if move _12 { - _9 = core::alloc::layout::{Layout}::from_size_align_unchecked::precondition_check(copy size_3, copy align_4) - } else { - } - storage_live(_10) - _10 = transmute(copy align_4) - layout_5 = Layout { size: copy size_3, align: move _10 } - storage_dead(_10) - storage_live(_6) - _6 = alloc_impl_runtime(copy layout_5, const false) - match _6 { - Result::Ok => { - }, - Result::Err => { - _8 = handle_alloc_error(move layout_5) - }, - } - ptr_7 = copy (_6 as variant Result::Ok).0 - _11 = transmute, *mut [u8]>(copy ptr_7) - storage_dead(_6) - storage_dead(ptr_7) - storage_dead(layout_5) - storage_dead(align_4) - storage_dead(size_3) - ptr_2 = cast<*mut [u8], *mut T>(copy _11) + storage_live(_3) + _3 = box_new_uninit(const {impl SizedTypeProperties for T}[TraitClause0]::LAYOUT) + ptr_2 = cast<*mut u8, *mut T>(copy _3) (*ptr_2) = move x_1 - _0 = transmute<*mut T, Box[TraitClause0::ImpliedClause0, {built_in impl Sized for Global}, {impl Allocator for Global}]>(copy ptr_2) + _0 = transmute<*mut u8, Box[TraitClause0::ImpliedClause0, {built_in impl Sized for Global}, {impl Allocator for Global}]>(copy _3) return } @@ -2890,34 +2866,30 @@ where let _3: NonNull; // anonymous local let _4: (); // anonymous local let _5: *mut (); // anonymous local - let _6: *const T; // anonymous local - let _7: bool; // anonymous local - let _8: PhantomData; // anonymous local - let _9: Global; // anonymous local + let _6: bool; // anonymous local + let _7: PhantomData; // anonymous local + let _8: Global; // anonymous local storage_live(_4) storage_live(_2) storage_live(_3) storage_live(_6) - storage_live(_7) - _7 = ub_checks - if move _7 { + _6 = ub_checks + if move _6 { storage_live(_5) _5 = cast<*mut T, *mut ()>(copy raw_1) _4 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _5) storage_dead(_5) } else { } - _6 = cast<*mut T, *const T>(copy raw_1) - _3 = NonNull { pointer: copy _6 } - storage_dead(_6) - storage_live(_8) - _8 = PhantomData { } - _2 = Unique { pointer: move _3, _marker: move _8 } + _3 = transmute<*mut T, NonNull>(copy raw_1) + storage_live(_7) + _7 = PhantomData { } + _2 = Unique { pointer: move _3, _marker: move _7 } storage_dead(_3) - storage_live(_9) - _9 = Global { } - _0 = Box { 0: move _2, 1: move _9 } + storage_live(_8) + _8 = Global { } + _0 = Box { 0: move _2, 1: move _8 } storage_dead(_2) return } diff --git a/charon/tests/ui/regressions/issue-1073-out-of-bounds-body-region.out b/charon/tests/ui/regressions/issue-1073-out-of-bounds-body-region.out index 638a779fa..1510ef242 100644 --- a/charon/tests/ui/regressions/issue-1073-out-of-bounds-body-region.out +++ b/charon/tests/ui/regressions/issue-1073-out-of-bounds-body-region.out @@ -1,9 +1,5 @@ # Final LLBC before serialization: -// Full name: core::alloc::layout::Layout -#[lang_item("alloc_layout")] -pub opaque type Layout - // Full name: core::ffi::c_void #[lang_item("c_void")] pub enum c_void { @@ -35,113 +31,6 @@ pub trait Sized #[lang_item("phantom_data")] pub struct PhantomData {} -// Full name: core::ptr::alignment::Alignment -pub opaque type Alignment - -// Full name: core::mem::SizedTypeProperties -pub trait SizedTypeProperties -{ - proof ImpliedClause0: (Self: 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::SIZE -#[lang_item("mem_size_const")] -pub fn SIZE() -> usize -where - TraitClause0: (Self: SizedTypeProperties), -= - -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub const SIZE: usize -where - TraitClause0: (Self: SizedTypeProperties), - = SIZE() - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub fn ALIGN() -> usize -where - TraitClause0: (Self: SizedTypeProperties), -= - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub const ALIGN: usize -where - TraitClause0: (Self: SizedTypeProperties), - = ALIGN() - -// Full name: core::mem::SizedTypeProperties::ALIGNMENT -pub fn ALIGNMENT() -> Alignment -where - TraitClause0: (Self: SizedTypeProperties), -= - -// Full name: core::mem::SizedTypeProperties::ALIGNMENT -pub const ALIGNMENT: Alignment -where - TraitClause0: (Self: SizedTypeProperties), - = ALIGNMENT() - -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub fn IS_ZST() -> bool -where - TraitClause0: (Self: SizedTypeProperties), -= - -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub const IS_ZST: bool -where - TraitClause0: (Self: SizedTypeProperties), - = IS_ZST() - -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub fn LAYOUT() -> Layout -where - TraitClause0: (Self: SizedTypeProperties), -= - -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub const LAYOUT: Layout -where - TraitClause0: (Self: SizedTypeProperties), - = LAYOUT() - -// Full name: core::mem::SizedTypeProperties::MAX_SLICE_LEN -pub fn MAX_SLICE_LEN() -> usize -where - TraitClause0: (Self: SizedTypeProperties), -= - -// Full name: core::mem::SizedTypeProperties::MAX_SLICE_LEN -pub const MAX_SLICE_LEN: usize -where - TraitClause0: (Self: SizedTypeProperties), - = MAX_SLICE_LEN() - -// Full name: core::mem::{impl SizedTypeProperties for T} -impl SizedTypeProperties for T -where - TraitClause0: (T: Sized), -{ - proof ImpliedClause0: (T: Sized) = 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::option::Option #[lang_item("Option")] pub enum Option @@ -204,68 +93,70 @@ pub fn advance_slices<'a, '_1, '_2>(bufs_1: &'_1 mut &'_2 mut [std::io::IoSlice< let _16: &'68 mut [std::io::IoSlice<'69>]; // anonymous local let len_17: usize; // local let ptr_18: NonNull>; // local - let end_or_len_19: *const std::io::IoSlice<'73>; // local - let _20: *mut std::io::IoSlice<'75>; // anonymous local - let self_21: *mut std::io::IoSlice<'76>; // local - let self_22: *const [std::io::IoSlice<'78>]; // local - let _23: *const std::io::IoSlice<'79>; // anonymous local - let ptr_24: NonNull>; // local - let end_or_len_25: *const std::io::IoSlice<'81>; // local - let _26: bool; // anonymous local - let _27: NonNull>; // anonymous local - let _28: NonNull>; // anonymous local - let _29: &'90 std::io::IoSlice<'91>; // anonymous local - let _30: *mut std::io::IoSlice<'94>; // anonymous local - let _31: *mut std::io::IoSlice<'95>; // anonymous local - let _32: *const std::io::IoSlice<'96>; // anonymous local - let _33: *const std::io::IoSlice<'97>; // anonymous local - let data_34: *const u8; // local - let _35: *mut c_void; // anonymous local - let len_36: usize; // local - let _37: (); // anonymous local - let _38: *mut (); // anonymous local - let _39: bool; // anonymous local - let _40: usize; // anonymous local - let src_41: &'103 mut [std::io::IoSlice<'104>]; // local - let _42: bool; // anonymous local - let _43: usize; // anonymous local - let _44: !; // anonymous local - let new_len_45: usize; // local - let _46: *mut [std::io::IoSlice<'106>]; // anonymous local - let ptr_47: *mut [std::io::IoSlice<'107>]; // local - let _48: *mut std::io::IoSlice<'108>; // anonymous local - let _49: *mut std::io::IoSlice<'109>; // anonymous local - let _50: usize; // anonymous local - let s_51: &'111 str; // local - let _52: NonNull; // anonymous local - let _53: *const u8; // anonymous local - let _54: NonNull>; // anonymous local - let _55: usize; // anonymous local - let _56: usize; // anonymous local + let self_19: NonNull<[std::io::IoSlice<'73>]>; // local + let end_or_len_20: *const std::io::IoSlice<'75>; // local + let _21: *mut std::io::IoSlice<'77>; // anonymous local + let self_22: *mut std::io::IoSlice<'78>; // local + let _23: *const [std::io::IoSlice<'80>]; // anonymous local + let _24: *mut std::io::IoSlice<'81>; // anonymous local + let _25: *mut [std::io::IoSlice<'83>]; // anonymous local + let ptr_26: NonNull>; // local + let end_or_len_27: *const std::io::IoSlice<'85>; // local + let _28: bool; // anonymous local + let _29: NonNull>; // anonymous local + let _30: NonNull>; // anonymous local + let _31: &'94 std::io::IoSlice<'95>; // anonymous local + let _32: *mut std::io::IoSlice<'98>; // anonymous local + let _33: *mut std::io::IoSlice<'99>; // anonymous local + let _34: *mut std::io::IoSlice<'100>; // anonymous local + let _35: *const std::io::IoSlice<'101>; // anonymous local + let data_36: *const u8; // local + let _37: *mut c_void; // anonymous local + let len_38: usize; // local + let _39: (); // anonymous local + let _40: *mut (); // anonymous local + let _41: bool; // anonymous local + let _42: usize; // anonymous local + let src_43: &'107 mut [std::io::IoSlice<'108>]; // local + let _44: bool; // anonymous local + let _45: usize; // anonymous local + let _46: !; // anonymous local + let new_len_47: usize; // local + let _48: *mut [std::io::IoSlice<'109>]; // anonymous local + let ptr_49: *mut [std::io::IoSlice<'110>]; // local + let _50: *mut std::io::IoSlice<'111>; // anonymous local + let _51: *mut std::io::IoSlice<'112>; // anonymous local + let _52: usize; // anonymous local + let s_53: &'114 str; // local + let _54: NonNull; // anonymous local + let _55: *const u8; // anonymous local + let _56: NonNull>; // anonymous local let _57: usize; // anonymous local - let _58: *const str; // anonymous local - let _59: &'116 [u8]; // anonymous local - let _60: bool; // anonymous local - let _61: usize; // anonymous local - let _62: Arguments<'121>; // anonymous local - let _63: *mut c_void; // anonymous local - let self_64: *mut c_void; // local - let s_65: &'122 str; // local - let _66: NonNull; // anonymous local - let _67: *const u8; // anonymous local - let _68: NonNull>; // anonymous local - let _69: usize; // anonymous local - let _70: usize; // anonymous local + let _58: usize; // anonymous local + let _59: usize; // anonymous local + let _60: *const str; // anonymous local + let _61: &'119 [u8]; // anonymous local + let _62: bool; // anonymous local + let _63: usize; // anonymous local + let _64: Arguments<'124>; // anonymous local + let _65: *mut c_void; // anonymous local + let self_66: *mut c_void; // local + let s_67: &'125 str; // local + let _68: NonNull; // anonymous local + let _69: *const u8; // anonymous local + let _70: NonNull>; // anonymous local let _71: usize; // anonymous local - let _72: *const str; // anonymous local - let _73: &'124 [u8]; // anonymous local - let _74: bool; // anonymous local - let _75: &'186 mut [std::io::IoSlice<'187>; 0 : usize]; // anonymous local - let _76: &'226 mut [std::io::IoSlice<'178>; 0 : usize]; // anonymous local - let _77: [std::io::IoSlice<'178>; 0 : usize]; // anonymous local - let _78: PhantomData<&'134 std::io::IoSlice<'135>>; // anonymous local - let _79: &'_ mut [std::io::IoSlice<'209>]; // anonymous local - let _80: &'_ mut std::io::IoSlice<'209>; // anonymous local + let _72: usize; // anonymous local + let _73: usize; // anonymous local + let _74: *const str; // anonymous local + let _75: &'127 [u8]; // anonymous local + let _76: bool; // anonymous local + let _77: &'191 mut [std::io::IoSlice<'192>; 0 : usize]; // anonymous local + let _78: &'231 mut [std::io::IoSlice<'183>; 0 : usize]; // anonymous local + let _79: [std::io::IoSlice<'183>; 0 : usize]; // anonymous local + let _80: PhantomData<&'139 std::io::IoSlice<'140>>; // anonymous local + let _81: &'_ mut [std::io::IoSlice<'214>]; // anonymous local + let _82: &'_ mut std::io::IoSlice<'214>; // anonymous local storage_live(remove_3) storage_live(iter_4) @@ -277,110 +168,119 @@ pub fn advance_slices<'a, '_1, '_2>(bufs_1: &'_1 mut &'_2 mut [std::io::IoSlice< storage_live(self_14) storage_live(_15) storage_live(_16) - storage_live(self_22) - storage_live(_33) - storage_live(len_36) - storage_live(_37) - storage_live(_44) + storage_live(len_38) + storage_live(_39) + storage_live(_46) _0 = () remove_3 = const 0 : usize self_13 = copy (*bufs_1) storage_live(len_17) storage_live(ptr_18) - storage_live(end_or_len_19) + storage_live(end_or_len_20) len_17 = copy self_13.metadata - self_22 = &raw const (*self_13) with_metadata(copy self_13.metadata) + storage_live(self_19) storage_live(_23) - _23 = cast<*const [std::io::IoSlice<'78>], *const std::io::IoSlice<'128>>(copy self_22) - ptr_18 = NonNull { 0: copy _23 } + _23 = &raw const (*self_13) with_metadata(copy self_13.metadata) + self_19 = transmute<*const [std::io::IoSlice<'80>], NonNull<[std::io::IoSlice<'131>]>>(copy _23) storage_dead(_23) - storage_live(_20) - storage_live(self_21) - self_21 = cast<*const [std::io::IoSlice<'78>], *mut std::io::IoSlice<'130>>(copy self_22) - _20 = copy self_21 offset copy len_17 - storage_dead(self_21) - end_or_len_19 = cast<*mut std::io::IoSlice<'75>, *const std::io::IoSlice<'131>>(copy _20) - storage_dead(_20) - storage_live(_78) - _78 = PhantomData { } - iter_4 = Iter { 0: copy ptr_18, 1: copy end_or_len_19, 2: move _78 } - storage_dead(end_or_len_19) + storage_live(_24) + storage_live(_25) + _25 = transmute]>, *mut [std::io::IoSlice<'132>]>(copy self_19) + _24 = cast<*mut [std::io::IoSlice<'83>], *mut std::io::IoSlice<'133>>(copy _25) + storage_dead(_25) + ptr_18 = transmute<*mut std::io::IoSlice<'81>, NonNull>>(copy _24) + storage_dead(_24) + storage_dead(self_19) + storage_live(_21) + storage_live(self_22) + self_22 = transmute>, *mut std::io::IoSlice<'135>>(copy ptr_18) + _21 = copy self_22 offset copy len_17 + storage_dead(self_22) + end_or_len_20 = cast<*mut std::io::IoSlice<'77>, *const std::io::IoSlice<'136>>(copy _21) + storage_dead(_21) + storage_live(_80) + _80 = PhantomData { } + iter_4 = Iter { 0: copy ptr_18, 1: copy end_or_len_20, 2: move _80 } + storage_dead(end_or_len_20) storage_dead(ptr_18) storage_dead(len_17) loop { storage_live(_5) - storage_live(ptr_24) - storage_live(end_or_len_25) - storage_live(_27) + storage_live(ptr_26) + storage_live(end_or_len_27) storage_live(_29) - ptr_24 = copy (iter_4).0 - end_or_len_25 = copy (iter_4).1 - storage_live(_26) - _27 = transmute<*const std::io::IoSlice<'81>, NonNull>>(copy end_or_len_25) - storage_live(_30) - _30 = transmute>, *mut std::io::IoSlice<'145>>(copy ptr_24) storage_live(_31) - _31 = transmute>, *mut std::io::IoSlice<'146>>(copy _27) - _26 = copy _30 == copy _31 - storage_dead(_31) - storage_dead(_30) - if move _26 { - storage_dead(_26) + storage_live(_32) + ptr_26 = copy (iter_4).0 + end_or_len_27 = copy (iter_4).1 + storage_live(_28) + _29 = transmute<*const std::io::IoSlice<'85>, NonNull>>(copy end_or_len_27) + _32 = transmute>, *mut std::io::IoSlice<'150>>(copy ptr_26) + storage_live(_33) + _33 = transmute>, *mut std::io::IoSlice<'151>>(copy _29) + _28 = copy _32 == copy _33 + storage_dead(_33) + if move _28 { + storage_dead(_28) + storage_dead(_32) + storage_dead(_31) storage_dead(_29) - storage_dead(_27) - storage_dead(end_or_len_25) - storage_dead(ptr_24) + storage_dead(end_or_len_27) + storage_dead(ptr_26) break 0 } else { - storage_dead(_26) - storage_live(_28) - storage_live(_32) - _33 = transmute>, *const std::io::IoSlice<'147>>(copy ptr_24) - _32 = copy _33 offset const 1 : usize - _28 = NonNull { 0: copy _32 } - storage_dead(_32) - (iter_4).0 = move _28 storage_dead(_28) - _29 = &(*_33) - _5 = Option::Some { 0: copy _29 } + storage_live(_30) + storage_live(_34) + _34 = copy _32 offset const 1 : usize + _30 = transmute<*mut std::io::IoSlice<'100>, NonNull>>(copy _34) + storage_dead(_34) + (iter_4).0 = move _30 + storage_dead(_30) + storage_live(_35) + _35 = transmute>, *const std::io::IoSlice<'154>>(copy ptr_26) + _31 = &(*_35) + storage_dead(_35) + _5 = Option::Some { 0: copy _31 } + storage_dead(_32) + storage_dead(_31) storage_dead(_29) - storage_dead(_27) - storage_dead(end_or_len_25) - storage_dead(ptr_24) + storage_dead(end_or_len_27) + storage_dead(ptr_26) buf_6 = copy (_5 as variant Option::Some).0 storage_live(_7) storage_live(self_8) self_8 = copy n_2 - storage_live(_35) - storage_live(data_34) - _35 = copy ((((*buf_6)).0).0).iov_base - data_34 = cast<*mut c_void, *const u8>(copy _35) - len_36 = copy ((((*buf_6)).0).0).iov_len - storage_live(_74) - _74 = ub_checks - if move _74 { - storage_live(_38) - _38 = cast<*mut c_void, *mut ()>(copy _35) - _37 = precondition_check(move _38, 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 len_36) - storage_dead(_38) + storage_live(_37) + storage_live(data_36) + _37 = copy ((((*buf_6)).0).0).iov_base + data_36 = cast<*mut c_void, *const u8>(copy _37) + len_38 = copy ((((*buf_6)).0).0).iov_len + storage_live(_76) + _76 = ub_checks + if move _76 { + storage_live(_40) + _40 = cast<*mut c_void, *mut ()>(copy _37) + _39 = precondition_check(move _40, const 1 : usize, const 1 : usize, copy len_38) + storage_dead(_40) } else { } - storage_dead(data_34) - storage_dead(_35) - storage_live(_39) - _39 = copy self_8 < copy len_36 - if move _39 { - storage_dead(_39) + storage_dead(data_36) + storage_dead(_37) + storage_live(_41) + _41 = copy self_8 < copy len_38 + if move _41 { + storage_dead(_41) storage_dead(self_8) storage_dead(_7) break 0 } else { } - storage_live(_40) - _40 = copy self_8 ub.- copy len_36 - _7 = Option::Some { 0: move _40 } - storage_dead(_40) - storage_dead(_39) + storage_live(_42) + _42 = copy self_8 ub.- copy len_38 + _7 = Option::Some { 0: move _42 } + storage_dead(_42) + storage_dead(_41) storage_dead(self_8) n_2 = copy (_7 as variant Option::Some).0 remove_3 = copy remove_3 wrap.+ const 1 : usize @@ -389,149 +289,149 @@ pub fn advance_slices<'a, '_1, '_2>(bufs_1: &'_1 mut &'_2 mut [std::io::IoSlice< continue 0 } } - storage_live(_75) - storage_live(_76) storage_live(_77) - _77 = [] - _76 = &mut _77 - _75 = move _76 + storage_live(_78) + storage_live(_79) + _79 = [] + _78 = &mut _79 + _77 = move _78 storage_dead(_5) - storage_live(src_41) - src_41 = @ArrayToSliceMut<'_, std::io::IoSlice<'187>, 0 : usize>(move _75) + storage_live(src_43) + src_43 = @ArrayToSliceMut<'_, std::io::IoSlice<'192>, 0 : usize>(move _77) self_10 = copy (*bufs_1) - (*bufs_1) = copy src_41 - storage_dead(src_41) - storage_live(_43) - storage_live(new_len_45) - storage_live(_42) - _43 = copy self_10.metadata - _42 = copy remove_3 > copy _43 - if move _42 { + (*bufs_1) = copy src_43 + storage_dead(src_43) + storage_live(_45) + storage_live(new_len_47) + storage_live(_44) + _45 = copy self_10.metadata + _44 = copy remove_3 > copy _45 + if move _44 { } else { - storage_dead(_42) - new_len_45 = copy _43 ub.- copy remove_3 - storage_live(_46) - storage_live(ptr_47) - ptr_47 = &raw mut (*self_10) with_metadata(copy self_10.metadata) + storage_dead(_44) + new_len_47 = copy _45 ub.- copy remove_3 storage_live(_48) - storage_live(_49) - _48 = cast<*mut [std::io::IoSlice<'107>], *mut std::io::IoSlice<'193>>(copy ptr_47) - _49 = copy _48 offset copy remove_3 - _46 = @PtrFromPartsMut<'_, [std::io::IoSlice<'194>]>(copy _49, copy new_len_45) - storage_dead(_49) + storage_live(ptr_49) + ptr_49 = &raw mut (*self_10) with_metadata(copy self_10.metadata) + storage_live(_50) + storage_live(_51) + _50 = cast<*mut [std::io::IoSlice<'110>], *mut std::io::IoSlice<'198>>(copy ptr_49) + _51 = copy _50 offset copy remove_3 + _48 = @PtrFromPartsMut<'_, [std::io::IoSlice<'199>]>(copy _51, copy new_len_47) + storage_dead(_51) + storage_dead(_50) + storage_dead(ptr_49) + _9 = &mut (*_48) with_metadata(copy _48.metadata) storage_dead(_48) - storage_dead(ptr_47) - _9 = &mut (*_46) with_metadata(copy _46.metadata) - storage_dead(_46) - storage_dead(new_len_45) - storage_dead(_43) + storage_dead(new_len_47) + storage_dead(_45) (*bufs_1) = copy _9 self_14 = copy (*bufs_1) - storage_live(_50) - _50 = copy self_14.metadata - switch copy _50 { + storage_live(_52) + _52 = copy self_14.metadata + switch copy _52 { 0 : usize => { }, _ => { - storage_dead(_50) + storage_dead(_52) _15 = copy (*bufs_1) _16 = copy (*bufs_1) - storage_live(_79) - _79 = &mut (*_16) with_metadata(copy _16.metadata) - storage_live(_80) - _80 = @SliceIndexMut<'_, std::io::IoSlice<'209>>(move _79, const 0 : usize) - self_12 = &two-phase-mut (*_80) - storage_live(_60) - storage_live(_61) - _61 = copy ((((*self_12)).0).0).iov_len - _60 = move _61 < copy n_2 - if move _60 { + storage_live(_81) + _81 = &mut (*_16) with_metadata(copy _16.metadata) + storage_live(_82) + _82 = @SliceIndexMut<'_, std::io::IoSlice<'214>>(move _81, const 0 : usize) + self_12 = &two-phase-mut (*_82) + storage_live(_62) + storage_live(_63) + _63 = copy ((((*self_12)).0).0).iov_len + _62 = move _63 < copy n_2 + if move _62 { } else { - storage_dead(_61) - storage_dead(_60) - ((((*self_12)).0).0).iov_len = copy ((((*self_12)).0).0).iov_len wrap.- copy n_2 - storage_live(_63) - storage_live(self_64) - self_64 = copy ((((*self_12)).0).0).iov_base - _63 = copy self_64 offset copy n_2 - storage_dead(self_64) - ((((*self_12)).0).0).iov_base = copy _63 storage_dead(_63) + storage_dead(_62) + ((((*self_12)).0).0).iov_len = copy ((((*self_12)).0).0).iov_len wrap.- copy n_2 + storage_live(_65) + storage_live(self_66) + self_66 = copy ((((*self_12)).0).0).iov_base + _65 = copy self_66 offset copy n_2 + storage_dead(self_66) + ((((*self_12)).0).0).iov_base = copy _65 + storage_dead(_65) return } - storage_dead(_61) - storage_live(_62) - storage_live(s_65) - s_65 = const "advancing IoSlice beyond its length" - storage_live(_66) - storage_live(_67) - storage_live(_72) - _72 = &raw const (*s_65) with_metadata(copy s_65.metadata) - _67 = cast<*const str, *const u8>(copy _72) - storage_dead(_72) - _66 = transmute<*const u8, NonNull>(copy _67) - storage_dead(_67) + storage_dead(_63) + storage_live(_64) + storage_live(s_67) + s_67 = const "advancing IoSlice beyond its length" storage_live(_68) storage_live(_69) + storage_live(_74) + _74 = &raw const (*s_67) with_metadata(copy s_67.metadata) + _69 = cast<*const str, *const u8>(copy _74) + storage_dead(_74) + _68 = transmute<*const u8, NonNull>(copy _69) + storage_dead(_69) storage_live(_70) storage_live(_71) + storage_live(_72) storage_live(_73) - _73 = transmute<&'215 str, &'214 [u8]>(const "advancing IoSlice beyond its length") - _71 = copy _73.metadata + storage_live(_75) + _75 = transmute<&'220 str, &'219 [u8]>(const "advancing IoSlice beyond its length") + _73 = copy _75.metadata + storage_dead(_75) + _72 = move _73 wrap.<< const 1 : i32 storage_dead(_73) - _70 = move _71 wrap.<< const 1 : i32 + _71 = move _72 | const 1 : usize + storage_dead(_72) + _70 = transmute>>(move _71) storage_dead(_71) - _69 = move _70 | const 1 : usize + _64 = Arguments { 0: move _68, 1: move _70 } storage_dead(_70) - _68 = transmute>>(move _69) - storage_dead(_69) - _62 = Arguments { 0: move _66, 1: move _68 } storage_dead(_68) - storage_dead(_66) - storage_dead(s_65) + storage_dead(s_67) panic(core::panicking::panic_fmt) }, } - storage_dead(_50) + storage_dead(_52) switch copy n_2 { 0 : usize => { }, _ => { storage_live(_11) - storage_live(s_51) - s_51 = const "advancing io slices beyond their length" - storage_live(_52) - storage_live(_53) - storage_live(_58) - _58 = &raw const (*s_51) with_metadata(copy s_51.metadata) - _53 = cast<*const str, *const u8>(copy _58) - storage_dead(_58) - _52 = transmute<*const u8, NonNull>(copy _53) - storage_dead(_53) + storage_live(s_53) + s_53 = const "advancing io slices beyond their length" storage_live(_54) storage_live(_55) + storage_live(_60) + _60 = &raw const (*s_53) with_metadata(copy s_53.metadata) + _55 = cast<*const str, *const u8>(copy _60) + storage_dead(_60) + _54 = transmute<*const u8, NonNull>(copy _55) + storage_dead(_55) storage_live(_56) storage_live(_57) + storage_live(_58) storage_live(_59) - _59 = transmute<&'204 str, &'203 [u8]>(const "advancing io slices beyond their length") - _57 = copy _59.metadata + storage_live(_61) + _61 = transmute<&'209 str, &'208 [u8]>(const "advancing io slices beyond their length") + _59 = copy _61.metadata + storage_dead(_61) + _58 = move _59 wrap.<< const 1 : i32 storage_dead(_59) - _56 = move _57 wrap.<< const 1 : i32 + _57 = move _58 | const 1 : usize + storage_dead(_58) + _56 = transmute>>(move _57) storage_dead(_57) - _55 = move _56 | const 1 : usize + _11 = Arguments { 0: move _54, 1: move _56 } storage_dead(_56) - _54 = transmute>>(move _55) - storage_dead(_55) - _11 = Arguments { 0: move _52, 1: move _54 } storage_dead(_54) - storage_dead(_52) - storage_dead(s_51) + storage_dead(s_53) panic(core::panicking::panic_fmt) }, } return } - _44 = slice_index_fail(move remove_3, copy _43, move _43) + _46 = slice_index_fail(move remove_3, copy _45, move _45) } // Full name: test_crate::foo diff --git a/charon/tests/ui/result-unwrap.out b/charon/tests/ui/result-unwrap.out index 24fd2f44a..c9ec142fe 100644 --- a/charon/tests/ui/result-unwrap.out +++ b/charon/tests/ui/result-unwrap.out @@ -10,30 +10,6 @@ pub struct FormattingOptions { precision: u16, } -// Full name: core::fmt::flags::DEBUG_LOWER_HEX_FLAG -fn DEBUG_LOWER_HEX_FLAG() -> u32 -{ - let _0: u32; // return - - _0 = const 1 : u32 panic.<< const 25 : i32 - return -} - -// Full name: core::fmt::flags::DEBUG_LOWER_HEX_FLAG -const DEBUG_LOWER_HEX_FLAG: u32 = DEBUG_LOWER_HEX_FLAG() - -// Full name: core::fmt::flags::DEBUG_UPPER_HEX_FLAG -fn DEBUG_UPPER_HEX_FLAG() -> u32 -{ - let _0: u32; // return - - _0 = const 1 : u32 panic.<< const 26 : i32 - return -} - -// Full name: core::fmt::flags::DEBUG_UPPER_HEX_FLAG -const DEBUG_UPPER_HEX_FLAG: u32 = DEBUG_UPPER_HEX_FLAG() - // Full name: core::marker::MetaSized #[lang_item("meta_sized")] pub trait MetaSized @@ -103,7 +79,7 @@ pub fn {impl Debug for u32}::fmt<'_0, '_1, '_2>(self_1: &'_0 u32, f_2: &'_1 mut storage_live(_3) storage_live(_4) _4 = copy (((*f_2)).0).flags - _3 = move _4 & copy DEBUG_LOWER_HEX_FLAG + _3 = move _4 & const 33554432 : u32 storage_dead(_4) switch copy _3 { 0 : u32 => { @@ -118,7 +94,7 @@ pub fn {impl Debug for u32}::fmt<'_0, '_1, '_2>(self_1: &'_0 u32, f_2: &'_1 mut storage_live(_5) storage_live(_6) _6 = copy (((*f_2)).0).flags - _5 = move _6 & copy DEBUG_UPPER_HEX_FLAG + _5 = move _6 & const 67108864 : u32 storage_dead(_6) switch copy _5 { 0 : u32 => { diff --git a/charon/tests/ui/simple/box-dyn-fnonce-raw.out b/charon/tests/ui/simple/box-dyn-fnonce-raw.out index 2a70d174c..3b362dfda 100644 --- a/charon/tests/ui/simple/box-dyn-fnonce-raw.out +++ b/charon/tests/ui/simple/box-dyn-fnonce-raw.out @@ -90,7 +90,7 @@ pub trait Tuple non-dyn-compatible } -// Full name: core::ptr::alignment::Alignment +// Full name: core::mem::alignment::Alignment pub opaque type Alignment // Full name: core::mem::SizedTypeProperties @@ -226,10 +226,7 @@ where // Full name: core::ptr::unique::Unique pub opaque type Unique -fn core::alloc::layout::{Layout}::from_size_align_unchecked::precondition_check(_1: usize, _2: usize) -= - -fn core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(_1: usize) +fn core::mem::alignment::{Alignment}::new_unchecked::precondition_check(_1: usize) = fn core::alloc::layout::{Layout}::from_size_alignment_unchecked::precondition_check(_1: usize, _2: Alignment) @@ -283,6 +280,44 @@ where TraitClause2: (A: Allocator), = +// Full name: alloc::boxed::box_new_uninit +fn box_new_uninit(layout_1: Layout) -> *mut u8 +{ + let _0: *mut u8; // return + let layout_1: Layout; // arg #1 + let _2: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let ptr_3: NonNull<[u8]>; // local + let _4: !; // anonymous local + let _5: NonNull; // anonymous local + let _6: *mut u8; // anonymous local + let _7: *mut [u8]; // anonymous local + + storage_live(ptr_3) + storage_live(_4) + storage_live(_2) + _2 = alloc_impl_runtime(copy layout_1, const false) + match _2 { + Result::Ok => { + }, + Result::Err => { + _4 = handle_alloc_error(move layout_1) + }, + } + ptr_3 = copy (_2 as variant Result::Ok).0 + storage_live(_5) + storage_live(_6) + storage_live(_7) + _7 = transmute, *mut [u8]>(copy ptr_3) + _6 = cast<*mut [u8], *mut u8>(copy _7) + storage_dead(_7) + _5 = transmute<*mut u8, NonNull>(copy _6) + storage_dead(_6) + _0 = transmute, *mut u8>(copy _5) + storage_dead(_5) + storage_dead(_2) + return +} + // Full name: alloc::boxed::{Box[TraitClause0::ImpliedClause0, {built_in impl Sized for Global}, {impl Allocator for Global}]}::new #[lang_item("box_new")] pub fn new(x_1: T) -> Box[TraitClause0::ImpliedClause0, {built_in impl Sized for Global}, {impl Allocator for Global}] @@ -292,56 +327,14 @@ where let _0: Box[TraitClause0::ImpliedClause0, {built_in impl Sized for Global}, {impl Allocator for Global}]; // return let x_1: T; // arg #1 let ptr_2: *mut T; // local - let size_3: usize; // local - let align_4: usize; // local - let layout_5: Layout; // local - let _6: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - let ptr_7: NonNull<[u8]>; // local - let _8: !; // anonymous local - let _9: (); // anonymous local - let _10: Alignment; // anonymous local - let _11: *mut [u8]; // anonymous local - let _12: bool; // anonymous local + let _3: *mut u8; // anonymous local storage_live(ptr_2) - storage_live(_8) - storage_live(_9) - storage_live(_11) - storage_live(size_3) - size_3 = const {impl SizedTypeProperties for T}[TraitClause0]::SIZE - storage_live(align_4) - align_4 = const {impl SizedTypeProperties for T}[TraitClause0]::ALIGN - storage_live(layout_5) - storage_live(ptr_7) - storage_live(_12) - _12 = ub_checks - if move _12 { - _9 = core::alloc::layout::{Layout}::from_size_align_unchecked::precondition_check(copy size_3, copy align_4) - } else { - } - storage_live(_10) - _10 = transmute(copy align_4) - layout_5 = Layout { 0: copy size_3, 1: move _10 } - storage_dead(_10) - storage_live(_6) - _6 = alloc_impl_runtime(copy layout_5, const false) - match _6 { - Result::Ok => { - }, - Result::Err => { - _8 = handle_alloc_error(move layout_5) - }, - } - ptr_7 = copy (_6 as variant Result::Ok).0 - _11 = transmute, *mut [u8]>(copy ptr_7) - storage_dead(_6) - storage_dead(ptr_7) - storage_dead(layout_5) - storage_dead(align_4) - storage_dead(size_3) - ptr_2 = cast<*mut [u8], *mut T>(copy _11) + storage_live(_3) + _3 = box_new_uninit(const {impl SizedTypeProperties for T}[TraitClause0]::LAYOUT) + ptr_2 = cast<*mut u8, *mut T>(copy _3) (*ptr_2) = move x_1 - _0 = transmute<*mut T, Box[TraitClause0::ImpliedClause0, {built_in impl Sized for Global}, {impl Allocator for Global}]>(copy ptr_2) + _0 = transmute<*mut u8, Box[TraitClause0::ImpliedClause0, {built_in impl Sized for Global}, {impl Allocator for Global}]>(copy _3) return } @@ -365,7 +358,7 @@ where let _10: (); // anonymous local let _11: (); // anonymous local let unique_12: NonNull; // local - let _13: *const u8; // anonymous local + let _13: *mut u8; // anonymous local let ptr_14: NonNull; // local let ptr_15: PhantomData; // local let _16: bool; // anonymous local @@ -393,7 +386,7 @@ where storage_live(_16) _16 = ub_checks if move _16 { - _10 = core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(copy align_9) + _10 = core::mem::alignment::{Alignment}::new_unchecked::precondition_check(copy align_9) } else { } alignment_8 = transmute(copy align_9) @@ -414,8 +407,8 @@ where storage_live(_6) _6 = &((*self_1)).1 storage_live(_13) - _13 = cast<*mut T, *const u8>(copy _4) - unique_12 = NonNull { 0: copy _13 } + _13 = cast<*mut T, *mut u8>(copy _4) + unique_12 = transmute<*mut u8, NonNull>(copy _13) storage_dead(_13) _5 = TraitClause2::deallocate<'7>(move _6, move unique_12, move layout_2) storage_dead(_6) diff --git a/charon/tests/ui/simple/box-dyn-fnonce.out b/charon/tests/ui/simple/box-dyn-fnonce.out index c310e1fb4..59b4ceca3 100644 --- a/charon/tests/ui/simple/box-dyn-fnonce.out +++ b/charon/tests/ui/simple/box-dyn-fnonce.out @@ -1,5 +1,5 @@ error: trying to access the allocator field from Box, but it is being treated as a builtin (without allocator) - --> /rustc/library/alloc/src/boxed.rs:2250:51 + --> /rustc/library/alloc/src/boxed.rs:2259:51 note: the error occurred when translating `alloc::boxed::{impl core::ops::function::FnOnce for alloc::boxed::Box[TraitClause1, TraitClause2]}::call_once`, which is (transitively) used at the following location(s): --> tests/ui/simple/box-dyn-fnonce.rs:4:5 @@ -7,7 +7,7 @@ note: the error occurred when translating `alloc::boxed::{impl core::ops::functi 4 | f(); | --- error: trying to access the allocator field from Box, but it is being treated as a builtin (without allocator) - --> /rustc/library/alloc/src/boxed.rs:1931:17 + --> /rustc/library/alloc/src/boxed.rs:1940:17 note: the error occurred when translating `alloc::boxed::{impl core::ops::drop::Drop for alloc::boxed::Box[TraitClause0, TraitClause1]}::drop`, which is (transitively) used at the following location(s): --> tests/ui/simple/box-dyn-fnonce.rs:4:5 diff --git a/charon/tests/ui/simple/box-into-inner.out b/charon/tests/ui/simple/box-into-inner.out index df7ab58a0..128eca77d 100644 --- a/charon/tests/ui/simple/box-into-inner.out +++ b/charon/tests/ui/simple/box-into-inner.out @@ -16,7 +16,7 @@ pub trait Sized non-dyn-compatible } -// Full name: core::ptr::alignment::Alignment +// Full name: core::mem::alignment::Alignment pub opaque type Alignment // Full name: core::mem::SizedTypeProperties 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 7575499f4..08bec9022 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: /rustc-dev/5fb2ff8611e5a4af4dc85977cfdecfbf3ffa6ade/compiler/rustc_middle/src/ty/sty.rs:352:13: cannot find `K/#0` in param-env: ParamEnv { +error: internal compiler error: /rustc-dev/e9e32aca5a4ffd08cbc29547b039d64b92a2c03b/compiler/rustc_middle/src/ty/sty.rs:354: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: /rustc-dev/5fb2ff8611e5a4af4dc85977cfdecfbf3ffa6 } -thread 'rustc' panicked at /rustc-dev/5fb2ff8611e5a4af4dc85977cfdecfbf3ffa6ade/compiler/rustc_middle/src/ty/sty.rs:352:13: +thread 'rustc' panicked at /rustc-dev/e9e32aca5a4ffd08cbc29547b039d64b92a2c03b/compiler/rustc_middle/src/ty/sty.rs:354: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/slice_index_range.out b/charon/tests/ui/simple/slice_index_range.out index cd967a9cb..2a03c5994 100644 --- a/charon/tests/ui/simple/slice_index_range.out +++ b/charon/tests/ui/simple/slice_index_range.out @@ -6,7 +6,7 @@ pub struct Error {} // Full name: core::ptr::non_null::NonNull #[lang_item("NonNull")] pub struct NonNull { - pointer: *const T, + pointer: *const T is !null, } // Full name: core::marker::MetaSized @@ -76,19 +76,17 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(start_1: usize, len_2 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 + let _15: ArgumentType<'16>; // anonymous local + let _16: NonNull<()>; // anonymous local + let _17: 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 _18: 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 _19: *const usize; // anonymous local + let _20: NonNull; // anonymous local + let _21: NonNull>; // anonymous local + let _22: PhantomData<&'30 ()>; // anonymous local + let _23: PhantomData<&'39 ()>; // anonymous local + let _24: [u8; 57 : usize]; // anonymous local + let _25: &'44 [u8; 57 : usize]; // anonymous local storage_live(args_4) storage_live(args_5) @@ -103,16 +101,13 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(start_1: usize, len_2 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) + _11 = transmute<*const usize, NonNull<()>>(copy _14) 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_live(_22) + _22 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _22 } storage_dead(_12) storage_dead(_11) _7 = Argument { ty: move _10 } @@ -120,42 +115,39 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(start_1: usize, len_2 storage_dead(_14) storage_dead(_13) storage_live(_8) + storage_live(_18) storage_live(_19) - storage_live(_20) + storage_live(_15) storage_live(_16) + _19 = &raw const (*args_5) + _16 = transmute<*const usize, NonNull<()>>(copy _19) 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) + _18 = 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>) + _17 = 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 _18) + storage_live(_23) + _23 = PhantomData { } + _15 = ArgumentType::Placeholder { value: move _16, formatter: copy _17, _lifetime: move _23 } storage_dead(_17) - _8 = Argument { ty: move _16 } storage_dead(_16) - storage_dead(_20) + _8 = Argument { ty: move _15 } + storage_dead(_15) storage_dead(_19) + storage_dead(_18) 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) + storage_live(_20) + storage_live(_24) + _24 = [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(_25) + _25 = &_24 + _20 = transmute<&'44 [u8; 57 : usize], NonNull>(move _25) + storage_live(_21) + _21 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { template: move _20, args: move _21 } + storage_dead(_21) + storage_dead(_20) panic(core::panicking::panic_fmt) } @@ -176,19 +168,17 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(end_1: usize, len_2 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 + let _15: ArgumentType<'16>; // anonymous local + let _16: NonNull<()>; // anonymous local + let _17: 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 _18: 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 _19: *const usize; // anonymous local + let _20: NonNull; // anonymous local + let _21: NonNull>; // anonymous local + let _22: PhantomData<&'30 ()>; // anonymous local + let _23: PhantomData<&'39 ()>; // anonymous local + let _24: [u8; 55 : usize]; // anonymous local + let _25: &'44 [u8; 55 : usize]; // anonymous local storage_live(args_4) storage_live(args_5) @@ -203,16 +193,13 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(end_1: usize, len_2 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) + _11 = transmute<*const usize, NonNull<()>>(copy _14) 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_live(_22) + _22 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _22 } storage_dead(_12) storage_dead(_11) _7 = Argument { ty: move _10 } @@ -220,42 +207,39 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(end_1: usize, len_2 storage_dead(_14) storage_dead(_13) storage_live(_8) + storage_live(_18) storage_live(_19) - storage_live(_20) + storage_live(_15) storage_live(_16) + _19 = &raw const (*args_5) + _16 = transmute<*const usize, NonNull<()>>(copy _19) 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) + _18 = 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>) + _17 = 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 _18) + storage_live(_23) + _23 = PhantomData { } + _15 = ArgumentType::Placeholder { value: move _16, formatter: copy _17, _lifetime: move _23 } storage_dead(_17) - _8 = Argument { ty: move _16 } storage_dead(_16) - storage_dead(_20) + _8 = Argument { ty: move _15 } + storage_dead(_15) storage_dead(_19) + storage_dead(_18) 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) + storage_live(_20) + storage_live(_24) + _24 = [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(_25) + _25 = &_24 + _20 = transmute<&'44 [u8; 55 : usize], NonNull>(move _25) + storage_live(_21) + _21 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { template: move _20, args: move _21 } + storage_dead(_21) + storage_dead(_20) panic(core::panicking::panic_fmt) } @@ -276,19 +260,17 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(start_1: usize, end 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 + let _15: ArgumentType<'16>; // anonymous local + let _16: NonNull<()>; // anonymous local + let _17: 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 _18: 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 _19: *const usize; // anonymous local + let _20: NonNull; // anonymous local + let _21: NonNull>; // anonymous local + let _22: PhantomData<&'30 ()>; // anonymous local + let _23: PhantomData<&'39 ()>; // anonymous local + let _24: [u8; 40 : usize]; // anonymous local + let _25: &'44 [u8; 40 : usize]; // anonymous local storage_live(args_4) storage_live(args_5) @@ -303,16 +285,13 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(start_1: usize, end 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) + _11 = transmute<*const usize, NonNull<()>>(copy _14) 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_live(_22) + _22 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _22 } storage_dead(_12) storage_dead(_11) _7 = Argument { ty: move _10 } @@ -320,42 +299,39 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(start_1: usize, end storage_dead(_14) storage_dead(_13) storage_live(_8) + storage_live(_18) storage_live(_19) - storage_live(_20) + storage_live(_15) storage_live(_16) + _19 = &raw const (*args_5) + _16 = transmute<*const usize, NonNull<()>>(copy _19) 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) + _18 = 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>) + _17 = 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 _18) + storage_live(_23) + _23 = PhantomData { } + _15 = ArgumentType::Placeholder { value: move _16, formatter: copy _17, _lifetime: move _23 } storage_dead(_17) - _8 = Argument { ty: move _16 } storage_dead(_16) - storage_dead(_20) + _8 = Argument { ty: move _15 } + storage_dead(_15) storage_dead(_19) + storage_dead(_18) 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) + storage_live(_20) + storage_live(_24) + _24 = [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(_25) + _25 = &_24 + _20 = transmute<&'44 [u8; 40 : usize], NonNull>(move _25) + storage_live(_21) + _21 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { template: move _20, args: move _21 } + storage_dead(_21) + storage_dead(_20) panic(core::panicking::panic_fmt) } @@ -376,19 +352,17 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(end_1: usize, len_2 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 + let _15: ArgumentType<'16>; // anonymous local + let _16: NonNull<()>; // anonymous local + let _17: 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 _18: 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 _19: *const usize; // anonymous local + let _20: NonNull; // anonymous local + let _21: NonNull>; // anonymous local + let _22: PhantomData<&'30 ()>; // anonymous local + let _23: PhantomData<&'39 ()>; // anonymous local + let _24: [u8; 55 : usize]; // anonymous local + let _25: &'44 [u8; 55 : usize]; // anonymous local storage_live(args_4) storage_live(args_5) @@ -403,16 +377,13 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(end_1: usize, len_2 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) + _11 = transmute<*const usize, NonNull<()>>(copy _14) 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_live(_22) + _22 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _22 } storage_dead(_12) storage_dead(_11) _7 = Argument { ty: move _10 } @@ -420,42 +391,39 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(end_1: usize, len_2 storage_dead(_14) storage_dead(_13) storage_live(_8) + storage_live(_18) storage_live(_19) - storage_live(_20) + storage_live(_15) storage_live(_16) + _19 = &raw const (*args_5) + _16 = transmute<*const usize, NonNull<()>>(copy _19) 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) + _18 = 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>) + _17 = 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 _18) + storage_live(_23) + _23 = PhantomData { } + _15 = ArgumentType::Placeholder { value: move _16, formatter: copy _17, _lifetime: move _23 } storage_dead(_17) - _8 = Argument { ty: move _16 } storage_dead(_16) - storage_dead(_20) + _8 = Argument { ty: move _15 } + storage_dead(_15) storage_dead(_19) + storage_dead(_18) 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) + storage_live(_20) + storage_live(_24) + _24 = [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(_25) + _25 = &_24 + _20 = transmute<&'44 [u8; 55 : usize], NonNull>(move _25) + storage_live(_21) + _21 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { template: move _20, args: move _21 } + storage_dead(_21) + storage_dead(_20) panic(core::panicking::panic_fmt) } diff --git a/charon/tests/ui/simple/vec-push.out b/charon/tests/ui/simple/vec-push.out index 19038cb07..44c390aec 100644 --- a/charon/tests/ui/simple/vec-push.out +++ b/charon/tests/ui/simple/vec-push.out @@ -27,7 +27,7 @@ pub trait Destruct unsafe fn core::marker::Destruct::drop_in_place(_1: *mut Self) = -// Full name: core::ptr::alignment::Alignment +// Full name: core::mem::alignment::Alignment pub opaque type Alignment // Full name: core::mem::SizedTypeProperties diff --git a/charon/tests/ui/simple/vec-with-capacity.out b/charon/tests/ui/simple/vec-with-capacity.out index 3d9ce8690..3208e0087 100644 --- a/charon/tests/ui/simple/vec-with-capacity.out +++ b/charon/tests/ui/simple/vec-with-capacity.out @@ -31,7 +31,7 @@ pub trait Destruct unsafe fn core::marker::Destruct::drop_in_place(_1: *mut Self) = -// Full name: core::ptr::alignment::Alignment +// Full name: core::mem::alignment::Alignment pub opaque type Alignment // Full name: core::mem::SizedTypeProperties diff --git a/charon/tests/ui/slice-index-range.out b/charon/tests/ui/slice-index-range.out index 87206b187..30d9ccaa4 100644 --- a/charon/tests/ui/slice-index-range.out +++ b/charon/tests/ui/slice-index-range.out @@ -89,19 +89,17 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(start_1: usize, len_2 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 + let _15: ArgumentType<'16>; // anonymous local + let _16: NonNull<()>; // anonymous local + let _17: 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 _18: 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 _19: *const usize; // anonymous local + let _20: NonNull; // anonymous local + let _21: NonNull>; // anonymous local + let _22: PhantomData<&'30 ()>; // anonymous local + let _23: PhantomData<&'39 ()>; // anonymous local + let _24: [u8; 57 : usize]; // anonymous local + let _25: &'44 [u8; 57 : usize]; // anonymous local storage_live(args_4) storage_live(args_5) @@ -116,16 +114,13 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(start_1: usize, len_2 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) + _11 = transmute<*const usize, NonNull<()>>(copy _14) 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_live(_22) + _22 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _22 } storage_dead(_12) storage_dead(_11) _7 = Argument { 0: move _10 } @@ -133,42 +128,39 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(start_1: usize, len_2 storage_dead(_14) storage_dead(_13) storage_live(_8) + storage_live(_18) storage_live(_19) - storage_live(_20) + storage_live(_15) storage_live(_16) + _19 = &raw const (*args_5) + _16 = transmute<*const usize, NonNull<()>>(copy _19) 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) + _18 = 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>) + _17 = 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 _18) + storage_live(_23) + _23 = PhantomData { } + _15 = ArgumentType::Placeholder { value: move _16, formatter: copy _17, _lifetime: move _23 } storage_dead(_17) - _8 = Argument { 0: move _16 } storage_dead(_16) - storage_dead(_20) + _8 = Argument { 0: move _15 } + storage_dead(_15) storage_dead(_19) + storage_dead(_18) 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) + storage_live(_20) + storage_live(_24) + _24 = [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(_25) + _25 = &_24 + _20 = transmute<&'44 [u8; 57 : usize], NonNull>(move _25) + storage_live(_21) + _21 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { 0: move _20, 1: move _21 } + storage_dead(_21) + storage_dead(_20) panic(core::panicking::panic_fmt) } @@ -189,19 +181,17 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(end_1: usize, len_2 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 + let _15: ArgumentType<'16>; // anonymous local + let _16: NonNull<()>; // anonymous local + let _17: 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 _18: 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 _19: *const usize; // anonymous local + let _20: NonNull; // anonymous local + let _21: NonNull>; // anonymous local + let _22: PhantomData<&'30 ()>; // anonymous local + let _23: PhantomData<&'39 ()>; // anonymous local + let _24: [u8; 55 : usize]; // anonymous local + let _25: &'44 [u8; 55 : usize]; // anonymous local storage_live(args_4) storage_live(args_5) @@ -216,16 +206,13 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(end_1: usize, len_2 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) + _11 = transmute<*const usize, NonNull<()>>(copy _14) 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_live(_22) + _22 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _22 } storage_dead(_12) storage_dead(_11) _7 = Argument { 0: move _10 } @@ -233,42 +220,39 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(end_1: usize, len_2 storage_dead(_14) storage_dead(_13) storage_live(_8) + storage_live(_18) storage_live(_19) - storage_live(_20) + storage_live(_15) storage_live(_16) + _19 = &raw const (*args_5) + _16 = transmute<*const usize, NonNull<()>>(copy _19) 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) + _18 = 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>) + _17 = 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 _18) + storage_live(_23) + _23 = PhantomData { } + _15 = ArgumentType::Placeholder { value: move _16, formatter: copy _17, _lifetime: move _23 } storage_dead(_17) - _8 = Argument { 0: move _16 } storage_dead(_16) - storage_dead(_20) + _8 = Argument { 0: move _15 } + storage_dead(_15) storage_dead(_19) + storage_dead(_18) 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) + storage_live(_20) + storage_live(_24) + _24 = [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(_25) + _25 = &_24 + _20 = transmute<&'44 [u8; 55 : usize], NonNull>(move _25) + storage_live(_21) + _21 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { 0: move _20, 1: move _21 } + storage_dead(_21) + storage_dead(_20) panic(core::panicking::panic_fmt) } @@ -289,19 +273,17 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(start_1: usize, end 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 + let _15: ArgumentType<'16>; // anonymous local + let _16: NonNull<()>; // anonymous local + let _17: 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 _18: 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 _19: *const usize; // anonymous local + let _20: NonNull; // anonymous local + let _21: NonNull>; // anonymous local + let _22: PhantomData<&'30 ()>; // anonymous local + let _23: PhantomData<&'39 ()>; // anonymous local + let _24: [u8; 40 : usize]; // anonymous local + let _25: &'44 [u8; 40 : usize]; // anonymous local storage_live(args_4) storage_live(args_5) @@ -316,16 +298,13 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(start_1: usize, end 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) + _11 = transmute<*const usize, NonNull<()>>(copy _14) 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_live(_22) + _22 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _22 } storage_dead(_12) storage_dead(_11) _7 = Argument { 0: move _10 } @@ -333,42 +312,39 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(start_1: usize, end storage_dead(_14) storage_dead(_13) storage_live(_8) + storage_live(_18) storage_live(_19) - storage_live(_20) + storage_live(_15) storage_live(_16) + _19 = &raw const (*args_5) + _16 = transmute<*const usize, NonNull<()>>(copy _19) 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) + _18 = 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>) + _17 = 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 _18) + storage_live(_23) + _23 = PhantomData { } + _15 = ArgumentType::Placeholder { value: move _16, formatter: copy _17, _lifetime: move _23 } storage_dead(_17) - _8 = Argument { 0: move _16 } storage_dead(_16) - storage_dead(_20) + _8 = Argument { 0: move _15 } + storage_dead(_15) storage_dead(_19) + storage_dead(_18) 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) + storage_live(_20) + storage_live(_24) + _24 = [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(_25) + _25 = &_24 + _20 = transmute<&'44 [u8; 40 : usize], NonNull>(move _25) + storage_live(_21) + _21 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { 0: move _20, 1: move _21 } + storage_dead(_21) + storage_dead(_20) panic(core::panicking::panic_fmt) } @@ -389,19 +365,17 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(end_1: usize, len_2 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 + let _15: ArgumentType<'16>; // anonymous local + let _16: NonNull<()>; // anonymous local + let _17: 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 _18: 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 _19: *const usize; // anonymous local + let _20: NonNull; // anonymous local + let _21: NonNull>; // anonymous local + let _22: PhantomData<&'30 ()>; // anonymous local + let _23: PhantomData<&'39 ()>; // anonymous local + let _24: [u8; 55 : usize]; // anonymous local + let _25: &'44 [u8; 55 : usize]; // anonymous local storage_live(args_4) storage_live(args_5) @@ -416,16 +390,13 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(end_1: usize, len_2 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) + _11 = transmute<*const usize, NonNull<()>>(copy _14) 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_live(_22) + _22 = PhantomData { } + _10 = ArgumentType::Placeholder { value: move _11, formatter: copy _12, _lifetime: move _22 } storage_dead(_12) storage_dead(_11) _7 = Argument { 0: move _10 } @@ -433,42 +404,39 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(end_1: usize, len_2 storage_dead(_14) storage_dead(_13) storage_live(_8) + storage_live(_18) storage_live(_19) - storage_live(_20) + storage_live(_15) storage_live(_16) + _19 = &raw const (*args_5) + _16 = transmute<*const usize, NonNull<()>>(copy _19) 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) + _18 = 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>) + _17 = 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 _18) + storage_live(_23) + _23 = PhantomData { } + _15 = ArgumentType::Placeholder { value: move _16, formatter: copy _17, _lifetime: move _23 } storage_dead(_17) - _8 = Argument { 0: move _16 } storage_dead(_16) - storage_dead(_20) + _8 = Argument { 0: move _15 } + storage_dead(_15) storage_dead(_19) + storage_dead(_18) 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) + storage_live(_20) + storage_live(_24) + _24 = [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(_25) + _25 = &_24 + _20 = transmute<&'44 [u8; 55 : usize], NonNull>(move _25) + storage_live(_21) + _21 = transmute<&'12 [Argument<'13>; 2 : usize], NonNull>>(copy args_9) + _3 = Arguments { 0: move _20, 1: move _21 } + storage_dead(_21) + storage_dead(_20) panic(core::panicking::panic_fmt) } diff --git a/flake.nix b/flake.nix index 614436f9e..68c7fa91c 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/5177426d9f8f7f1827001c9749b9a9c5570d456b"; + url = "github:oxalica/rust-overlay/40b0a3a193e0840c76174b4a322874c8f6dd0a63"; inputs.nixpkgs.follows = "nixpkgs"; }; crane.url = "github:ipetkov/crane"; From 76d8abba5f2ac279575c6dad3e264a8a3edbc091 Mon Sep 17 00:00:00 2001 From: N1ark Date: Fri, 29 May 2026 17:26:56 +0100 Subject: [PATCH 2/4] Handle pattern types in const uneval --- .../hax/constant_utils/uneval.rs | 6 +++++- charon/tests/ui/simple/const_pat_value.out | 19 +++++++++++++++++++ charon/tests/ui/simple/const_pat_value.rs | 6 ++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 charon/tests/ui/simple/const_pat_value.out create mode 100644 charon/tests/ui/simple/const_pat_value.rs diff --git a/charon/src/bin/charon-driver/hax/constant_utils/uneval.rs b/charon/src/bin/charon-driver/hax/constant_utils/uneval.rs index 2e2490b9a..62da4652b 100644 --- a/charon/src/bin/charon-driver/hax/constant_utils/uneval.rs +++ b/charon/src/bin/charon-driver/hax/constant_utils/uneval.rs @@ -42,6 +42,7 @@ pub(crate) fn scalar_int_to_constant_literal<'tcx, S: UnderOwnerState<'tcx>>( let v = x.to_bits_unchecked(); bits_and_type_to_float_constant_literal(v, kind.sinto(s)) } + ty::Pat(inner, _) => scalar_int_to_constant_literal(s, x, *inner), _ => { let ty_sinto: Ty = ty.sinto(s); supposely_unreachable_fatal!( @@ -371,9 +372,12 @@ fn op_to_const<'tcx, S: UnderOwnerState<'tcx>>( ConstantExprKind::Literal(lit) } } + ty::Pat(..) => { + let op = ecx.project_field(&op, FieldIdx::from_u16(0))?; + *op_to_const(s, span, ecx, op)?.contents + } ty::Dynamic(..) | ty::Foreign(..) - | ty::Pat(..) | ty::UnsafeBinder(..) | ty::CoroutineClosure(..) | ty::Coroutine(..) diff --git a/charon/tests/ui/simple/const_pat_value.out b/charon/tests/ui/simple/const_pat_value.out new file mode 100644 index 000000000..a126cdc1a --- /dev/null +++ b/charon/tests/ui/simple/const_pat_value.out @@ -0,0 +1,19 @@ +# Final LLBC before serialization: + +// Full name: test_crate::Positive +pub type Positive = i32 is 1 : i32..=2147483647 : i32 + +// Full name: test_crate::ONE +fn ONE() -> i32 is 1 : i32..=2147483647 : i32 +{ + let _0: i32 is 1 : i32..=2147483647 : i32; // return + + _0 = const 1 : i32 + return +} + +// Full name: test_crate::ONE +const ONE: i32 is 1 : i32..=2147483647 : i32 = ONE() + + + diff --git a/charon/tests/ui/simple/const_pat_value.rs b/charon/tests/ui/simple/const_pat_value.rs new file mode 100644 index 000000000..26aec04ed --- /dev/null +++ b/charon/tests/ui/simple/const_pat_value.rs @@ -0,0 +1,6 @@ +#![feature(pattern_type_macro)] +#![feature(pattern_types)] +#![allow(internal_features)] + +pub type Positive = std::pat::pattern_type!(i32 is 1..); +const ONE: Positive = const { unsafe { std::mem::transmute(1) } }; From 1f1839aa51f42df36223624a7c97bc74cf2ee3b0 Mon Sep 17 00:00:00 2001 From: N1ark Date: Sat, 30 May 2026 19:08:13 +0100 Subject: [PATCH 3/4] Add `Attribute::Transparent` --- charon-ml/src/CharonVersion.ml | 2 +- charon-ml/src/generated/Generated_Meta.ml | 3 +++ charon-ml/src/generated/Generated_OfJson.ml | 1 + charon-ml/src/generated/Generated_OfPostcard.ml | 5 +++-- charon/Cargo.lock | 2 +- charon/Cargo.toml | 2 +- charon/src/ast/meta.rs | 3 +++ charon/src/ast/names.rs | 1 + charon/src/ast/types/vars.rs | 1 + .../charon-driver/translate/translate_meta.rs | 2 ++ charon/src/bin/generate-ml/of_json.rs | 14 +------------- charon/src/bin/generate-ml/of_postcard.rs | 16 ++-------------- charon/src/bin/generate-ml/to_ocaml_ty.rs | 3 +-- charon/src/pretty/fmt_with_ctx.rs | 2 +- .../simplify_output/inline_selected_functions.rs | 2 +- 15 files changed, 23 insertions(+), 36 deletions(-) diff --git a/charon-ml/src/CharonVersion.ml b/charon-ml/src/CharonVersion.ml index 2fe140183..d1cdda052 100644 --- a/charon-ml/src/CharonVersion.ml +++ b/charon-ml/src/CharonVersion.ml @@ -1,3 +1,3 @@ (* This is an automatically generated file, generated from `charon/Cargo.toml`. *) (* To re-generate this file, rune `make` in the root directory *) -let supported_charon_version = "0.1.207" +let supported_charon_version = "0.1.208" diff --git a/charon-ml/src/generated/Generated_Meta.ml b/charon-ml/src/generated/Generated_Meta.ml index 62015a49e..faf4e82b8 100644 --- a/charon-ml/src/generated/Generated_Meta.ml +++ b/charon-ml/src/generated/Generated_Meta.ml @@ -57,6 +57,9 @@ and attribute = | AttrVariantsSuffix of string (** Same as [VariantsPrefix], but appends to the name instead of pre-pending. *) + | AttrTransparent + (** The structure is treated as a transparent wrapper around its sole + field. Written [#[charon::transparent]]. *) | AttrDocComment of string (** A doc-comment such as [/// ...]. *) | AttrUnknown of raw_attribute (** A non-charon-specific attribute. *) diff --git a/charon-ml/src/generated/Generated_OfJson.ml b/charon-ml/src/generated/Generated_OfJson.ml index 57a081230..45a0b994c 100644 --- a/charon-ml/src/generated/Generated_OfJson.ml +++ b/charon-ml/src/generated/Generated_OfJson.ml @@ -1954,6 +1954,7 @@ and attribute_of_json (ctx : of_json_ctx) (js : json) : | `Assoc [ ("VariantsSuffix", variants_suffix) ] -> let* variants_suffix = string_of_json ctx variants_suffix in Ok (AttrVariantsSuffix variants_suffix) + | `String "Transparent" -> Ok AttrTransparent | `Assoc [ ("DocComment", doc_comment) ] -> let* doc_comment = string_of_json ctx doc_comment in Ok (AttrDocComment doc_comment) diff --git a/charon-ml/src/generated/Generated_OfPostcard.ml b/charon-ml/src/generated/Generated_OfPostcard.ml index 3bb6de4e7..2fe43a1d5 100644 --- a/charon-ml/src/generated/Generated_OfPostcard.ml +++ b/charon-ml/src/generated/Generated_OfPostcard.ml @@ -1714,10 +1714,11 @@ and attribute_of_postcard (ctx : of_postcard_ctx) (st : postcard_state) : | 4 -> let* x_0 = string_of_postcard ctx st in Ok (AttrVariantsSuffix x_0) - | 5 -> + | 5 -> Ok AttrTransparent + | 6 -> let* x_0 = string_of_postcard ctx st in Ok (AttrDocComment x_0) - | 6 -> + | 7 -> let* x_0 = raw_attribute_of_postcard ctx st in Ok (AttrUnknown x_0) | _ -> Error ("unknown enum variant tag: " ^ string_of_int __tag)) diff --git a/charon/Cargo.lock b/charon/Cargo.lock index 157edd890..69e88fce3 100644 --- a/charon/Cargo.lock +++ b/charon/Cargo.lock @@ -252,7 +252,7 @@ checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "charon" -version = "0.1.207" +version = "0.1.208" dependencies = [ "annotate-snippets", "anstream", diff --git a/charon/Cargo.toml b/charon/Cargo.toml index efee0f4a0..83a69a5cc 100644 --- a/charon/Cargo.toml +++ b/charon/Cargo.toml @@ -25,7 +25,7 @@ tracing = { version = "0.1", features = ["max_level_trace"] } [package] name = "charon" -version = "0.1.207" +version = "0.1.208" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/charon/src/ast/meta.rs b/charon/src/ast/meta.rs index 36bea94c8..7a80a92ea 100644 --- a/charon/src/ast/meta.rs +++ b/charon/src/ast/meta.rs @@ -127,6 +127,9 @@ pub enum Attribute { VariantsPrefix(String), /// Same as `VariantsPrefix`, but appends to the name instead of pre-pending. VariantsSuffix(String), + /// The structure is treated as a transparent wrapper around its sole field. + /// Written `#[charon::transparent]`. + Transparent, /// A doc-comment such as `/// ...`. DocComment(String), /// A non-charon-specific attribute. diff --git a/charon/src/ast/names.rs b/charon/src/ast/names.rs index 9337e61b0..d858cbc02 100644 --- a/charon/src/ast/names.rs +++ b/charon/src/ast/names.rs @@ -90,6 +90,7 @@ pub enum ImplElem { Debug, Default, Clone, PartialEq, Eq, Hash, SerializeState, DeserializeState, Drive, DriveMut, )] #[serde(transparent)] +#[cfg_attr(feature = "charon_on_charon", charon::transparent)] pub struct Name { pub name: Vec, } diff --git a/charon/src/ast/types/vars.rs b/charon/src/ast/types/vars.rs index d171f1618..cfbbf5b68 100644 --- a/charon/src/ast/types/vars.rs +++ b/charon/src/ast/types/vars.rs @@ -28,6 +28,7 @@ use crate::{ast::*, impl_from_enum}; DriveMut, )] #[serde(transparent)] +#[cfg_attr(feature = "charon_on_charon", charon::transparent)] #[drive(skip)] pub struct DeBruijnId { pub index: usize, diff --git a/charon/src/bin/charon-driver/translate/translate_meta.rs b/charon/src/bin/charon-driver/translate/translate_meta.rs index 9a52b1793..bbd382b6f 100644 --- a/charon/src/bin/charon-driver/translate/translate_meta.rs +++ b/charon/src/bin/charon-driver/translate/translate_meta.rs @@ -497,6 +497,8 @@ impl<'tcx> TranslateCtx<'tcx> { "opaque" if args.is_none() => Attribute::Opaque, // `#[charon::opaque]` "exclude" if args.is_none() => Attribute::Exclude, + // `#[charon::transparent]` + "transparent" if args.is_none() => Attribute::Transparent, // `#[charon::rename("new_name")]` "rename" if let Some(attr) = args => { let Some(attr) = attr diff --git a/charon/src/bin/generate-ml/of_json.rs b/charon/src/bin/generate-ml/of_json.rs index 7d166a933..839ef3d53 100644 --- a/charon/src/bin/generate-ml/of_json.rs +++ b/charon/src/bin/generate-ml/of_json.rs @@ -254,8 +254,7 @@ impl<'a> GenerateCtx<'a> { .attr_info .attributes .iter() - .filter_map(|a| a.as_unknown()) - .any(|a| a.to_string() == "serde(transparent)")) => + .any(|a| a.is_transparent())) => { let ty = &fields[0].ty; let call = self.type_to_ocaml_call(ty); @@ -285,17 +284,6 @@ impl<'a> GenerateCtx<'a> { self.build_branch(&pat, &fields, &construct) } TypeDeclKind::Struct(fields) => { - let fields = fields - .iter() - .filter(|field| { - !field - .attr_info - .attributes - .iter() - .filter_map(|a| a.as_unknown()) - .any(|a| a.to_string() == "serde(skip)") - }) - .collect_vec(); let pat: String = fields .iter() .map(|f| { diff --git a/charon/src/bin/generate-ml/of_postcard.rs b/charon/src/bin/generate-ml/of_postcard.rs index cac510132..6e0c9a98d 100644 --- a/charon/src/bin/generate-ml/of_postcard.rs +++ b/charon/src/bin/generate-ml/of_postcard.rs @@ -241,8 +241,7 @@ impl<'a> GenerateCtx<'a> { .attr_info .attributes .iter() - .filter_map(|a| a.as_unknown()) - .any(|a| a.to_string() == "serde(transparent)")) => + .any(|a| a.is_transparent())) => { let call = self.type_to_ocaml_postcard_call(&fields[0].ty); format!("{call} ctx st") @@ -265,18 +264,7 @@ impl<'a> GenerateCtx<'a> { format!("{convert}\nOk ({construct})") } TypeDeclKind::Struct(fields) => { - let fields = fields - .iter() - .filter(|field| { - !field - .attr_info - .attributes - .iter() - .filter_map(|a| a.as_unknown()) - .any(|a| a.to_string() == "serde(skip)") - }) - .collect_vec(); - let convert = self.convert_postcard_vars(fields.iter().copied()); + let convert = self.convert_postcard_vars(fields); let construct = fields .iter() .filter(|f| !f.is_opaque()) diff --git a/charon/src/bin/generate-ml/to_ocaml_ty.rs b/charon/src/bin/generate-ml/to_ocaml_ty.rs index 6f96181d1..98d5caa79 100644 --- a/charon/src/bin/generate-ml/to_ocaml_ty.rs +++ b/charon/src/bin/generate-ml/to_ocaml_ty.rs @@ -176,8 +176,7 @@ impl<'a> GenerateCtx<'a> { .attr_info .attributes .iter() - .filter_map(|a| a.as_unknown()) - .any(|a| a.to_string() == "serde(transparent)")) => + .any(|a| a.is_transparent())) => { let ty = self.type_to_ocaml_name(&fields[0].ty); format!("{ty} {opaque}") diff --git a/charon/src/pretty/fmt_with_ctx.rs b/charon/src/pretty/fmt_with_ctx.rs index 459773ae0..9191b4c39 100644 --- a/charon/src/pretty/fmt_with_ctx.rs +++ b/charon/src/pretty/fmt_with_ctx.rs @@ -638,7 +638,7 @@ impl FmtWithCtx for FunDecl { .collect(), }; let mut args: Vec = Vec::new(); - for (ty, name) in self.signature.inputs.iter().zip(arg_names.into_iter()) { + for (ty, name) in self.signature.inputs.iter().zip(arg_names) { args.push(format!("{}: {}", name, ty.with_ctx(ctx))); } let args = args.join(", "); diff --git a/charon/src/transform/simplify_output/inline_selected_functions.rs b/charon/src/transform/simplify_output/inline_selected_functions.rs index ed7738593..772f7ee9b 100644 --- a/charon/src/transform/simplify_output/inline_selected_functions.rs +++ b/charon/src/transform/simplify_output/inline_selected_functions.rs @@ -167,7 +167,7 @@ impl UllbcPass for Transform { target: start_block, }; // Add the blocks for the inner body. - outer_body.body.extend(inner_body.body.into_iter()); + outer_body.body.extend(inner_body.body); } } } From 42836b36b666a980cbc9d438a8aed340ad3b848b Mon Sep 17 00:00:00 2001 From: N1ark Date: Sun, 31 May 2026 18:08:31 +0100 Subject: [PATCH 4/4] Make `TransformCtx::run_pass` pub --- charon/src/transform/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charon/src/transform/mod.rs b/charon/src/transform/mod.rs index f0e10ff74..8d9ec016c 100644 --- a/charon/src/transform/mod.rs +++ b/charon/src/transform/mod.rs @@ -278,7 +278,7 @@ pub enum Pass { } impl TransformCtx { - fn run_pass(&mut self, mut pass: Pass) { + pub fn run_pass(&mut self, mut pass: Pass) { match &mut pass { Pass::NonBody(pass) => { if pass.should_run(&self.options) { @@ -320,7 +320,7 @@ impl TransformCtx { } }; } - fn run_passes(&mut self, passes: impl IntoIterator) { + pub fn run_passes(&mut self, passes: impl IntoIterator) { for pass in passes { self.run_pass(pass); }