From 4b23a26fddb89ebb6385b9539f20e4ec4890fc2d Mon Sep 17 00:00:00 2001 From: Joshua Liebow-Feeser Date: Thu, 16 Apr 2026 14:10:49 +0000 Subject: [PATCH] Roll pinned Rust toolchain --- charon-ml/src/CharonVersion.ml | 2 +- charon-ml/src/NameMatcher.ml | 37 +- charon-ml/src/PrintTypes.ml | 4 +- charon-ml/src/Substitute.ml | 11 +- charon-ml/src/TypesUtils.ml | 8 +- .../src/generated/Generated_GAstOfJson.ml | 12 +- charon-ml/src/generated/Generated_Types.ml | 4 +- charon/Cargo.lock | 2 +- charon/Cargo.toml | 2 +- .../hax-frontend/src/constant_utils/uneval.rs | 4 +- charon/hax-frontend/src/lib.rs | 1 - charon/hax-frontend/src/rustc_utils.rs | 11 +- charon/hax-frontend/src/traits.rs | 2 +- charon/hax-frontend/src/traits/resolution.rs | 24 +- charon/hax-frontend/src/traits/utils.rs | 20 +- charon/hax-frontend/src/types/def_id.rs | 46 +- charon/hax-frontend/src/types/mod.rs | 2 +- charon/hax-frontend/src/types/new/full_def.rs | 4 +- charon/hax-frontend/src/types/new/item_ref.rs | 2 +- charon/hax-frontend/src/types/ty.rs | 71 +- charon/macros/src/lib.rs | 2 +- charon/rust-toolchain | 2 +- charon/src/ast/hash_cons.rs | 1 - charon/src/bin/charon-driver/main.rs | 3 - .../charon-driver/translate/resolve_path.rs | 2 +- .../translate/translate_bodies.rs | 7 +- charon/src/bin/generate-ml/main.rs | 11 +- .../bin/generate-ml/templates/GAstOfJson.ml | 1 + charon/src/lib.rs | 4 - .../simplify_output/inline_anon_consts.rs | 7 +- 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 | 396 ++- .../tests/ui/dyn-with-diamond-supertraits.out | 62 +- charon/tests/ui/issue-114-opaque-bodies.out | 347 +-- charon/tests/ui/issue-114-opaque-bodies.rs | 1 + charon/tests/ui/issue-165-vec-macro.out | 87 +- charon/tests/ui/issue-393-shallowinitbox.out | 172 +- charon/tests/ui/issue-393-shallowinitbox.rs | 1 - charon/tests/ui/iterator.out | 138 +- .../tests/ui/monomorphization/dyn-trait.out | 4 +- charon/tests/ui/ptr-offset.out | 2 +- charon/tests/ui/raw-boxes.out | 2417 +++++++++-------- .../issue-1073-out-of-bounds-body-region.out | 576 ++-- charon/tests/ui/result-unwrap.out | 28 +- charon/tests/ui/rvalues.out | 7 +- charon/tests/ui/rvalues.rs | 2 +- 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 | 408 ++- charon/tests/ui/simple/vec-push.out | 4 +- charon/tests/ui/simple/vec-with-capacity.out | 2 +- charon/tests/ui/slice-index-range.out | 336 ++- flake.lock | 8 +- flake.nix | 2 +- 57 files changed, 2515 insertions(+), 2819 deletions(-) diff --git a/charon-ml/src/CharonVersion.ml b/charon-ml/src/CharonVersion.ml index 3799aa07f..706fe2c35 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.180" +let supported_charon_version = "0.1.181" diff --git a/charon-ml/src/NameMatcher.ml b/charon-ml/src/NameMatcher.ml index 256010a46..5b15a002b 100644 --- a/charon-ml/src/NameMatcher.ml +++ b/charon-ml/src/NameMatcher.ml @@ -342,7 +342,7 @@ let update_rmap (c : match_config) (m : maps) (id : var) (v : T.region) : bool = | RVar var -> let dbid, varid = match var with - | Bound (dbid, varid) -> (dbid, varid) + | Bound (dbid, varid) -> (dbid.index, varid) | Free varid -> (List.length m.rmap.bound_regions - 1, varid) in begin @@ -457,7 +457,7 @@ let rec match_name_with_generics (ctx : 'fun_body ctx) (c : match_config) element, use the monomorphized args and continue matching without that element *) let n, g = - match List.rev n with + match List.rev n.name with | PeInstantiated binder :: rest_rev -> let mono_args = binder.binder_value in (* In this case, we may still have some late-bound generics in `g`, this could ONLY happen for regions *) @@ -475,7 +475,7 @@ let rec match_name_with_generics (ctx : 'fun_body ctx) (c : match_config) else mono_args in (List.rev rest_rev, merged_args) - | _ -> (n, g) + | _ -> (n.name, g) in match (p, n) with | [], [] -> @@ -511,7 +511,7 @@ let rec match_name_with_generics (ctx : 'fun_body ctx) (c : match_config) pid = id && T.Disambiguator.of_int pd = d && pg = [] - && match_name_with_generics ctx c p n g + && match_name_with_generics ctx c p { name = n } g | PImpl pty :: p, PeImpl impl :: n -> ( (* We have to distinguish two cases: - the impl is an inherent impl (linked to a type) @@ -520,13 +520,13 @@ let rec match_name_with_generics (ctx : 'fun_body ctx) (c : match_config) match impl with | ImplElemTy bound_ty -> match_expr_with_ty ctx c (mk_empty_maps ()) pty bound_ty.binder_value - && match_name_with_generics ctx c p n g + && match_name_with_generics ctx c p { name = n } g | ImplElemTrait impl_id -> match_expr_with_trait_impl_id ctx c pty impl_id - && match_name_with_generics ctx c p n g) + && match_name_with_generics ctx c p { name = n } g) | PWild :: p, _ :: n -> (* Wildcard: skip this element in the name *) - match_name_with_generics ctx c p n g + match_name_with_generics ctx c p { name = n } g | _ -> false and match_name (ctx : 'fun_body ctx) (c : match_config) (p : pattern) @@ -733,7 +733,7 @@ let match_fn_ptr (ctx : 'fun_body ctx) (c : match_config) (p : pattern) match func.kind with | FunId (FBuiltin fid) -> ( let to_name (s : string list) : T.name = - List.map (fun s -> T.PeIdent (s, T.Disambiguator.of_int 0)) s + { name = List.map (fun s -> T.PeIdent (s, T.Disambiguator.of_int 0)) s } in match fid with | BoxNew -> ( @@ -841,7 +841,7 @@ let lookup_var_in_maps (m : constraints) 'a option = let dbid, varid = match var with - | Bound (dbid, varid) -> (dbid, varid) + | Bound (dbid, varid) -> (dbid.index, varid) | Free varid -> (List.length m - 1, varid) in match List.nth_opt m dbid with @@ -956,12 +956,12 @@ let literal_to_pattern (_c : to_pat_config) (lit : Values.literal) : literal = let rec name_with_generic_args_to_pattern_aux (ctx : 'fun_body ctx) (c : to_pat_config) (n : T.name) (generics : generic_args option) : pattern = - match n with + match n.name with | [] -> raise (Failure "Empty names are not valid") | [ e ] -> path_elem_with_generic_args_to_pattern ctx c e generics - | e :: n -> + | e :: n_tail -> path_elem_with_generic_args_to_pattern ctx c e None - @ name_with_generic_args_to_pattern_aux ctx c n generics + @ name_with_generic_args_to_pattern_aux ctx c { name = n_tail } generics and name_to_pattern_aux (ctx : 'fun_body ctx) (c : to_pat_config) (n : T.name) : pattern = @@ -1490,20 +1490,21 @@ module NameMatcherMap = struct let match_name_with_generics_prefix (ctx : 'fun_body ctx) (c : match_config) (p : pattern) (n : T.name) (g : T.generic_args) : (T.name * T.generic_args) option = - if List.length p = List.length n then + if List.length p = List.length n.name then if match_name_with_generics ctx c p n g then - Some ([], TypesUtils.empty_generic_args) + Some ({ name = [] }, TypesUtils.empty_generic_args) + else None + else if List.length p < List.length n.name then + let npre, nend = Collections.List.split_at n.name (List.length p) in + if match_name ctx c p { name = npre } then Some ({ name = nend }, g) else None - else if List.length p < List.length n then - let npre, nend = Collections.List.split_at n (List.length p) in - if match_name ctx c p npre then Some (nend, g) else None else None let rec find_with_generics_opt (ctx : 'fun_body ctx) (c : match_config) (name : Types.name) (g : Types.generic_args) (m : 'a t) : 'a option = let (Node (node_v, children)) = m in (* Check if we reached the destination *) - match name with + match name.name with | [] | [ PeInstantiated _ ] -> (* For tree search, we also consider monomorphized elements as terminal since they represent instantiation details, not logical structure. diff --git a/charon-ml/src/PrintTypes.ml b/charon-ml/src/PrintTypes.ml index 010b05ef5..b4d6fd483 100644 --- a/charon-ml/src/PrintTypes.ml +++ b/charon-ml/src/PrintTypes.ml @@ -95,7 +95,7 @@ let lookup_var_in_env (env : 'a fmt_env) else let dbid, varid = match var with - | Bound (dbid, varid) -> (dbid, varid) + | Bound (dbid, varid) -> (dbid.index, varid) | Free varid -> let len = List.length env.generics in let dbid = len - 1 in @@ -483,7 +483,7 @@ and path_elem_to_string (env : 'a fmt_env) (e : path_elem) : string = | PeTarget target -> target and name_to_string (env : 'a fmt_env) (n : name) : string = - let name = List.map (path_elem_to_string env) n in + let name = List.map (path_elem_to_string env) n.name in String.concat "::" name and raw_attribute_to_string (attr : raw_attribute) : string = diff --git a/charon-ml/src/Substitute.ml b/charon-ml/src/Substitute.ml index 4ea0443d0..adbb40576 100644 --- a/charon-ml/src/Substitute.ml +++ b/charon-ml/src/Substitute.ml @@ -99,7 +99,7 @@ let subst_free_vars (subst : single_binder_subst) : subst = *) let subst_at_binder_zero (subst : single_binder_subst) : subst = let subst_if_zero subst nosubst = function - | Bound (dbid, id) when dbid = 0 -> subst id + | Bound (dbid, id) when dbid.index = 0 -> subst id | var -> nosubst var in { @@ -114,8 +114,9 @@ let subst_at_binder_zero (subst : single_binder_subst) : subst = variables to remove the current binder level. *) let subst_remove_binder_zero (subst : single_binder_subst) : subst = let subst_remove_zero subst nosubst = function - | Bound (dbid, id) when dbid = 0 -> subst id - | Bound (dbid, varid) when dbid > 0 -> nosubst (Bound (dbid - 1, varid)) + | Bound (dbid, id) when dbid.index = 0 -> subst id + | Bound (dbid, varid) when dbid.index > 0 -> + nosubst (Bound ({ index = dbid.index - 1 }, varid)) | var -> nosubst var in { @@ -129,7 +130,7 @@ let subst_remove_binder_zero (subst : single_binder_subst) : subst = (** Move a whole expression under one level of binder. *) let move_under_binder_subst : subst = let shift = function - | Bound (dbid, var) -> Bound (dbid + 1, var) + | Bound (dbid, var) -> Bound ({ index = dbid.index + 1 }, var) | Free _ as var -> var in { @@ -144,7 +145,7 @@ let move_under_binder_subst : subst = let st_shift_visitor = object (self) inherit [_] map_statement - method! visit_de_bruijn_id delta dbid = dbid + delta + method! visit_de_bruijn_id delta dbid = { index = dbid.index + delta } end (* Shift the the substitution under one binder. *) diff --git a/charon-ml/src/TypesUtils.ml b/charon-ml/src/TypesUtils.ml index 38df0c8c6..cbb72ef8a 100644 --- a/charon-ml/src/TypesUtils.ml +++ b/charon-ml/src/TypesUtils.ml @@ -28,7 +28,7 @@ type 'a item_binder = { type bound_fun_sig = fun_sig item_binder let to_name (ls : string list) : name = - List.map (fun s -> PeIdent (s, Disambiguator.zero)) ls + { name = List.map (fun s -> PeIdent (s, Disambiguator.zero)) ls } let as_ident (e : path_elem) : string = match e with @@ -178,7 +178,7 @@ let trait_instance_id_as_trait_impl (id : trait_ref_kind) : | _ -> raise (Failure "Unreachable") (* Make a debruijn variable of index 0 *) -let zero_db_var (varid : 'id) : 'id de_bruijn_var = Bound (0, varid) +let zero_db_var (varid : 'id) : 'id de_bruijn_var = Bound ({ index = 0 }, varid) let free_var_of_db_var (var : 'id de_bruijn_var) : 'id option = match var with @@ -187,11 +187,11 @@ let free_var_of_db_var (var : 'id de_bruijn_var) : 'id option = let decr_db_var : 'id de_bruijn_var -> 'id de_bruijn_var = function | Free id -> Free id - | Bound (dbid, id) -> Bound (dbid - 1, id) + | Bound (dbid, id) -> Bound ({ index = dbid.index - 1 }, id) let incr_db_var : 'id de_bruijn_var -> 'id de_bruijn_var = function | Free id -> Free id - | Bound (dbid, id) -> Bound (dbid + 1, id) + | Bound (dbid, id) -> Bound ({ index = dbid.index + 1 }, id) let empty_generic_args : generic_args = { regions = []; types = []; const_generics = []; trait_refs = [] } diff --git a/charon-ml/src/generated/Generated_GAstOfJson.ml b/charon-ml/src/generated/Generated_GAstOfJson.ml index 06dc03f86..d9ad0d7c7 100644 --- a/charon-ml/src/generated/Generated_GAstOfJson.ml +++ b/charon-ml/src/generated/Generated_GAstOfJson.ml @@ -695,7 +695,10 @@ and de_bruijn_id_of_json (ctx : of_json_ctx) (js : json) : (de_bruijn_id, string) result = combine_error_msgs js __FUNCTION__ (match js with - | x -> int_of_json ctx x + | `Assoc [ ("index", index) ] -> + let* index = int_of_json ctx index in + Ok ({ index } : de_bruijn_id) + | `Int i -> Ok ({ index = i } : de_bruijn_id) | _ -> Error "") and de_bruijn_var_of_json : @@ -1483,7 +1486,12 @@ and monomorphize_mut_of_json (ctx : of_json_ctx) (js : json) : and name_of_json (ctx : of_json_ctx) (js : json) : (name, string) result = combine_error_msgs js __FUNCTION__ (match js with - | x -> list_of_json path_elem_of_json ctx x + | `Assoc [ ("name", name) ] -> + let* name = list_of_json path_elem_of_json ctx name in + Ok ({ name } : name) + | `List _ -> + let* name = list_of_json path_elem_of_json ctx js in + Ok ({ name } : name) | _ -> Error "") and nullop_of_json (ctx : of_json_ctx) (js : json) : (nullop, string) result = diff --git a/charon-ml/src/generated/Generated_Types.ml b/charon-ml/src/generated/Generated_Types.ml index 5a33f98bf..196fb63fd 100644 --- a/charon-ml/src/generated/Generated_Types.ml +++ b/charon-ml/src/generated/Generated_Types.ml @@ -38,7 +38,7 @@ type trait_type_constraint_id = TraitTypeConstraintId.id (** The index of a binder, counting from the innermost. See [[DeBruijnVar]] for details. *) -type de_bruijn_id = int +type de_bruijn_id = { index : int } (** Type-level variable. @@ -985,7 +985,7 @@ and layout = { Also note that the first path element in the name is always the crate name. *) -and name = (path_elem list[@visitors.opaque]) +and name = { name : path_elem list [@visitors.opaque] } (** See the comments for [Name] *) and path_elem = diff --git a/charon/Cargo.lock b/charon/Cargo.lock index d2402f4de..0bb03625e 100644 --- a/charon/Cargo.lock +++ b/charon/Cargo.lock @@ -221,7 +221,7 @@ checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "charon" -version = "0.1.180" +version = "0.1.181" dependencies = [ "annotate-snippets", "anstream", diff --git a/charon/Cargo.toml b/charon/Cargo.toml index b2a2aae95..9cb14bea1 100644 --- a/charon/Cargo.toml +++ b/charon/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "charon" -version = "0.1.180" +version = "0.1.181" authors = [ "Son Ho ", "Guillaume Boisseau ", diff --git a/charon/hax-frontend/src/constant_utils/uneval.rs b/charon/hax-frontend/src/constant_utils/uneval.rs index dcc51464e..23dbacce1 100644 --- a/charon/hax-frontend/src/constant_utils/uneval.rs +++ b/charon/hax-frontend/src/constant_utils/uneval.rs @@ -3,6 +3,7 @@ use super::*; use rustc_const_eval::interpret::{FnVal, InterpResult, interp_ok}; use rustc_middle::mir::interpret; use rustc_middle::{mir, ty}; +use rustc_middle::query::QueryKey; impl ConstantLiteral { /// Rustc always represents string constants as `&[u8]`, but this @@ -133,7 +134,6 @@ impl<'tcx, S: UnderOwnerState<'tcx>> SInto for ty::Const<'tcx> { val.sinto(s) } else { - use crate::rustc_middle::query::Key; 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/hax-frontend/src/lib.rs b/charon/hax-frontend/src/lib.rs index f4c940b96..d10d82b2e 100644 --- a/charon/hax-frontend/src/lib.rs +++ b/charon/hax-frontend/src/lib.rs @@ -1,5 +1,4 @@ #![allow(rustdoc::private_intra_doc_links)] -#![feature(if_let_guard)] #![feature(macro_metavar_expr)] #![feature(rustc_private)] #![feature(sized_hierarchy)] diff --git a/charon/hax-frontend/src/rustc_utils.rs b/charon/hax-frontend/src/rustc_utils.rs index cd6a3cc1b..3a6082587 100644 --- a/charon/hax-frontend/src/rustc_utils.rs +++ b/charon/hax-frontend/src/rustc_utils.rs @@ -81,10 +81,9 @@ 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, - } + let tcx = self.base().tcx; + let def_id = self.owner_id(); + ty::TypingEnv::post_analysis(tcx, def_id) } } @@ -211,7 +210,7 @@ pub fn assoc_tys_for_trait<'tcx>( .in_definition_order() .filter(|assoc| matches!(assoc.kind, ty::AssocKind::Type { .. })) .filter(|assoc| tcx.generics_of(assoc.def_id).own_params.is_empty()) - .map(|assoc| ty::AliasTy::new(tcx, assoc.def_id, tref.args)), + .map(|assoc| ty::AliasTy::new(tcx, ty::AliasTyKind::Projection { def_id: assoc.def_id }, tref.args)), ); for clause in tcx .explicit_super_predicates_of(tref.def_id) @@ -250,7 +249,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/hax-frontend/src/traits.rs b/charon/hax-frontend/src/traits.rs index 0f1f8b119..272835b4e 100644 --- a/charon/hax-frontend/src/traits.rs +++ b/charon/hax-frontend/src/traits.rs @@ -224,7 +224,7 @@ pub fn translate_item_ref<'tcx, S: UnderOwnerState<'tcx>>( pub fn inherits_parent_clauses<'tcx>(tcx: ty::TyCtxt<'tcx>, def_id: RDefId) -> bool { use rustc_hir::def::DefKind::*; match tcx.def_kind(def_id) { - AssocTy | AssocFn | AssocConst | Closure | Ctor(..) | Variant | AnonConst | InlineConst => { + AssocTy { .. } | AssocFn { .. } | AssocConst { .. } | Closure { .. } | Ctor(..) | Variant | AnonConst { .. } | InlineConst { .. } => { true } _ => false, diff --git a/charon/hax-frontend/src/traits/resolution.rs b/charon/hax-frontend/src/traits/resolution.rs index cc16428ce..6fde587a1 100644 --- a/charon/hax-frontend/src/traits/resolution.rs +++ b/charon/hax-frontend/src/traits/resolution.rs @@ -230,10 +230,7 @@ impl<'tcx> PredicateSearcher<'tcx> { let initial_self_pred = initial_self_pred(tcx, owner_id); let mut out = Self { tcx, - typing_env: TypingEnv { - param_env: tcx.param_env(owner_id), - typing_mode: TypingMode::PostAnalysis, - }, + typing_env: ty::TypingEnv::post_analysis(tcx, owner_id), candidates: Default::default(), options, implicit_self_clause: initial_self_pred.is_some(), @@ -333,7 +330,10 @@ impl<'tcx> PredicateSearcher<'tcx> { ) -> Result<(), String> { let tcx = self.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) = ty.skip_binder().kind() else { + return Ok(()); + }; + let AliasTyKind::Projection { def_id } = alias_ty.kind else { return Ok(()); }; let trait_ref = ty.rebind(alias_ty.trait_ref(tcx)).upcast(tcx); @@ -345,7 +345,7 @@ impl<'tcx> PredicateSearcher<'tcx> { }; // The bounds that hold on the associated type. - let item_bounds = implied_predicates(tcx, alias_ty.def_id, self.options); + let item_bounds = implied_predicates(tcx, def_id, self.options); let item_bounds = item_bounds .iter() .filter_map(|pred| pred.clause.as_trait_clause()) @@ -361,7 +361,7 @@ impl<'tcx> PredicateSearcher<'tcx> { origin: trait_candidate.origin, }; candidate.path.push(PathChunk::AssocItem { - item: tcx.associated_item(alias_ty.def_id), + item: tcx.associated_item(def_id), generic_args: alias_ty.args, predicate: pred, index, @@ -469,8 +469,14 @@ impl<'tcx> PredicateSearcher<'tcx> { let ty = Ty::new_projection(tcx, assoc.def_id, erased_tref.skip_binder().args); let ty = erase_and_norm(tcx, self.typing_env, ty); - if let TyKind::Alias(_, alias_ty) = ty.kind() { - if alias_ty.def_id == assoc.def_id { + if let TyKind::Alias(alias_ty) = ty.kind() { + let def_id = match alias_ty.kind { + AliasTyKind::Projection { def_id } => def_id, + AliasTyKind::Inherent { def_id } => def_id, + AliasTyKind::Opaque { def_id } => def_id, + AliasTyKind::Free { def_id } => def_id, + }; + if 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 // `DiscriminantKind::Discriminant`. diff --git a/charon/hax-frontend/src/traits/utils.rs b/charon/hax-frontend/src/traits/utils.rs index 1ed8327bc..9183f3611 100644 --- a/charon/hax-frontend/src/traits/utils.rs +++ b/charon/hax-frontend/src/traits/utils.rs @@ -202,21 +202,21 @@ pub fn required_predicates<'tcx>( use DefKind::*; let def_kind = tcx.def_kind(def_id); let mut predicates = match def_kind { - AssocConst - | AssocFn - | AssocTy - | Const - | Enum - | Fn + AssocConst { .. } + | AssocFn { .. } + | AssocTy { .. } + | Const { .. } + | Enum { .. } + | Fn { .. } | ForeignTy | Impl { .. } | OpaqueTy | Static { .. } - | Struct - | TyAlias - | Union => predicates_defined_on(tcx, def_id, true), + | Struct { .. } + | TyAlias { .. } + | Union { .. } => predicates_defined_on(tcx, def_id, true), // We consider all predicates on traits to be outputs - Trait | TraitAlias => Default::default(), + Trait { .. } | TraitAlias { .. } => Default::default(), // `predicates_defined_on` ICEs on other def kinds. _ => Default::default(), }; diff --git a/charon/hax-frontend/src/types/def_id.rs b/charon/hax-frontend/src/types/def_id.rs index 861ffe731..56f40575d 100644 --- a/charon/hax-frontend/src/types/def_id.rs +++ b/charon/hax-frontend/src/types/def_id.rs @@ -20,8 +20,6 @@ sinto_reexport!(rustc_span::symbol::Symbol); sinto_reexport!(rustc_span::symbol::ByteSymbol); /// Reflects [`rustc_hir::def::DefKind`] -#[derive(AdtInto)] -#[args(, from: rustc_hir::def::DefKind, state: S as tcx)] #[derive(Debug, Clone, PartialEq, Hash, Eq)] pub enum DefKind { Mod, @@ -52,7 +50,6 @@ pub enum DefKind { ForeignMod, AnonConst, InlineConst, - #[disable_mapping] /// Added by hax: promoted constants don't have def_ids in rustc but they do in hax. PromotedConst, OpaqueTy, @@ -66,6 +63,49 @@ pub enum DefKind { SyntheticCoroutineBody, } +impl SInto for rustc_hir::def::DefKind { + fn sinto(&self, s: &S) -> DefKind { + use rustc_hir::def::DefKind as RDefKind; + match self { + RDefKind::Mod => DefKind::Mod, + RDefKind::Struct => DefKind::Struct, + RDefKind::Union => DefKind::Union, + RDefKind::Enum => DefKind::Enum, + RDefKind::Variant => DefKind::Variant, + RDefKind::Trait => DefKind::Trait, + RDefKind::TyAlias => DefKind::TyAlias, + RDefKind::ForeignTy => DefKind::ForeignTy, + RDefKind::TraitAlias => DefKind::TraitAlias, + RDefKind::AssocTy => DefKind::AssocTy, + RDefKind::TyParam => DefKind::TyParam, + RDefKind::Fn => DefKind::Fn, + RDefKind::Const { .. } => DefKind::Const, + RDefKind::ConstParam => DefKind::ConstParam, + RDefKind::Static { safety, mutability, nested } => DefKind::Static { + safety: safety.sinto(s), + mutability: mutability.sinto(s), + nested: *nested, + }, + RDefKind::Ctor(of, kind) => DefKind::Ctor(of.sinto(s), kind.sinto(s)), + RDefKind::AssocFn => DefKind::AssocFn, + RDefKind::AssocConst { .. } => DefKind::AssocConst, + RDefKind::Macro(kind) => DefKind::Macro(kind.sinto(s)), + RDefKind::ExternCrate => DefKind::ExternCrate, + RDefKind::Use => DefKind::Use, + RDefKind::ForeignMod => DefKind::ForeignMod, + RDefKind::AnonConst => DefKind::AnonConst, + RDefKind::InlineConst => DefKind::InlineConst, + RDefKind::OpaqueTy => DefKind::OpaqueTy, + RDefKind::Field => DefKind::Field, + RDefKind::LifetimeParam => DefKind::LifetimeParam, + RDefKind::GlobalAsm => DefKind::GlobalAsm, + RDefKind::Impl { of_trait } => DefKind::Impl { of_trait: *of_trait }, + RDefKind::Closure => DefKind::Closure, + RDefKind::SyntheticCoroutineBody => DefKind::SyntheticCoroutineBody, + } + } +} + pub use rustc_middle::mir::Promoted as PromotedId; /// The crate name under which synthetic items are exported under. diff --git a/charon/hax-frontend/src/types/mod.rs b/charon/hax-frontend/src/types/mod.rs index 162597e36..96d6c5584 100644 --- a/charon/hax-frontend/src/types/mod.rs +++ b/charon/hax-frontend/src/types/mod.rs @@ -13,7 +13,7 @@ use crate::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/hax-frontend/src/types/new/full_def.rs b/charon/hax-frontend/src/types/new/full_def.rs index 1c5041be0..36ab8a50d 100644 --- a/charon/hax-frontend/src/types/new/full_def.rs +++ b/charon/hax-frontend/src/types/new/full_def.rs @@ -926,7 +926,7 @@ where value: const_value(s, def_id, args_or_default()), } } - RDefKind::AssocConst { .. } => FullDefKind::AssocConst { + RDefKind::AssocConst { is_type_const: _ } => FullDefKind::AssocConst { param_env: get_param_env(s, args), associated_item: AssocItem::sfrom_instantiated(s, &tcx.associated_item(def_id), args), ty: type_of_self().sinto(s), @@ -1181,7 +1181,7 @@ impl FullDef { 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/hax-frontend/src/types/new/item_ref.rs b/charon/hax-frontend/src/types/new/item_ref.rs index 169a67440..a425fd88b 100644 --- a/charon/hax-frontend/src/types/new/item_ref.rs +++ b/charon/hax-frontend/src/types/new/item_ref.rs @@ -214,7 +214,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/hax-frontend/src/types/ty.rs b/charon/hax-frontend/src/types/ty.rs index fb6cf98d7..bb070361b 100644 --- a/charon/hax-frontend/src/types/ty.rs +++ b/charon/hax-frontend/src/types/ty.rs @@ -655,7 +655,6 @@ 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 { let tcx = s.base().tcx; @@ -663,49 +662,43 @@ impl Alias { 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::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, def_id) = match alias_ty.kind { + RustAliasKind::Projection { def_id } => { let trait_ref = alias_ty.trait_ref(tcx); - // In a case like: - // ``` - // impl Trait for Result - // where - // for<'a> &'a Result: IntoIterator, - // for<'a> <&'a Result as IntoIterator>::Item: Copy, - // {} - // ``` - // the `&'a Result as IntoIterator` trait ref has escaping bound variables - // yet we dont have a binder around (could even be several). Binding this correctly - // is therefore difficult. Since our trait resolution ignores lifetimes anyway, we - // just erase them. See also https://github.com/hacspec/hax/issues/747. let trait_ref = crate::traits::erase_free_regions(tcx, trait_ref); - let item = tcx.associated_item(alias_ty.def_id); - AliasKind::Projection { - assoc_item: AssocItem::sfrom(s, &item), - impl_expr: solve_trait(s, ty::Binder::dummy(trait_ref)), - } + let item = tcx.associated_item(def_id); + ( + AliasKind::Projection { + assoc_item: AssocItem::sfrom(s, &item), + impl_expr: solve_trait(s, ty::Binder::dummy(trait_ref)), + }, + def_id, + ) } - RustAliasKind::Inherent => AliasKind::Inherent, - RustAliasKind::Opaque => { + RustAliasKind::Inherent { def_id } => (AliasKind::Inherent, def_id), + RustAliasKind::Opaque { def_id } => { // Reveal the underlying `impl Trait` type. - let ty = tcx.type_of(alias_ty.def_id).instantiate(tcx, alias_ty.args); - AliasKind::Opaque { - hidden_ty: ty.sinto(s), - } + let ty = tcx.type_of(def_id).instantiate(tcx, alias_ty.args); + ( + AliasKind::Opaque { + hidden_ty: ty.sinto(s), + }, + def_id, + ) } - RustAliasKind::Free => AliasKind::Free, + RustAliasKind::Free { def_id } => (AliasKind::Free, def_id), }; TyKind::Alias(Alias { kind, args: alias_ty.args.sinto(s), - def_id: alias_ty.def_id.sinto(s), + def_id: def_id.sinto(s), }) } } @@ -825,7 +818,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), @@ -932,7 +925,13 @@ 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 def_id = match alias_ty.kind { + rustc_type_ir::AliasTyKind::Projection { def_id } => def_id, + rustc_type_ir::AliasTyKind::Inherent { def_id } => def_id, + rustc_type_ir::AliasTyKind::Opaque { def_id } => def_id, + rustc_type_ir::AliasTyKind::Free { def_id } => def_id, + }; + let item = tcx.associated_item(def_id); ProjectionPredicate { impl_expr, assoc_item: AssocItem::sfrom(s, &item), @@ -1227,7 +1226,13 @@ 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 def_id = match alias_ty.kind { + rustc_type_ir::AliasTyKind::Projection { def_id } => def_id, + rustc_type_ir::AliasTyKind::Inherent { def_id } => def_id, + rustc_type_ir::AliasTyKind::Opaque { def_id } => def_id, + rustc_type_ir::AliasTyKind::Free { def_id } => def_id, + }; + let item = tcx.associated_item(def_id); ProjectionPredicate { impl_expr: solve_trait(s, poly_trait_ref), assoc_item: AssocItem::sfrom(s, &item), diff --git a/charon/macros/src/lib.rs b/charon/macros/src/lib.rs index 4061652d6..b2fe19819 100644 --- a/charon/macros/src/lib.rs +++ b/charon/macros/src/lib.rs @@ -1,7 +1,7 @@ //! This module contains some macros for Charon. Due to technical reasons, Rust //! forces users to define such macros in a separate, dedicated library. Note //! that this doesn't apply to `macro_rules`. -#![feature(non_exhaustive_omitted_patterns_lint)] + extern crate proc_macro; diff --git a/charon/rust-toolchain b/charon/rust-toolchain index 3bace3451..864475235 100644 --- a/charon/rust-toolchain +++ b/charon/rust-toolchain @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2026-02-07" +channel = "nightly-2026-04-12" components = [ "rustc-dev", "llvm-tools-preview", "rust-src", "miri" ] targets = [ "x86_64-apple-darwin", "aarch64-apple-darwin", "i686-unknown-linux-gnu", "powerpc64-unknown-linux-gnu", "riscv64gc-unknown-none-elf" ] diff --git a/charon/src/ast/hash_cons.rs b/charon/src/ast/hash_cons.rs index 52f17d6f9..eeca57247 100644 --- a/charon/src/ast/hash_cons.rs +++ b/charon/src/ast/hash_cons.rs @@ -60,7 +60,6 @@ mod intern_table { pub fn intern(inner: T) -> HashConsed { // Fast read-only check. - #[expect(irrefutable_let_patterns)] // https://github.com/rust-lang/rust/issues/139369 let arc = if let read_guard = INTERNED.read().unwrap() && let Some(set) = read_guard.get::() && let Some(arc) = set.get(&inner) diff --git a/charon/src/bin/charon-driver/main.rs b/charon/src/bin/charon-driver/main.rs index 04a87c470..92e19f24f 100644 --- a/charon/src/bin/charon-driver/main.rs +++ b/charon/src/bin/charon-driver/main.rs @@ -7,10 +7,7 @@ #![allow(clippy::derivable_impls)] #![allow(clippy::borrowed_box)] #![allow(clippy::field_reassign_with_default)] -#![expect(incomplete_features)] -#![feature(box_patterns)] #![feature(deref_patterns)] -#![feature(if_let_guard)] #![feature(iter_array_chunks)] #![feature(iterator_try_collect)] diff --git a/charon/src/bin/charon-driver/translate/resolve_path.rs b/charon/src/bin/charon-driver/translate/resolve_path.rs index 8dfd54fd6..41c2b0f14 100644 --- a/charon/src/bin/charon-driver/translate/resolve_path.rs +++ b/charon/src/bin/charon-driver/translate/resolve_path.rs @@ -117,7 +117,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 f758961eb..0d88d47c4 100644 --- a/charon/src/bin/charon-driver/translate/translate_bodies.rs +++ b/charon/src/bin/charon-driver/translate/translate_bodies.rs @@ -855,7 +855,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 { @@ -895,11 +895,6 @@ impl<'tcx> BlockTransCtx<'tcx, '_, '_, '_> { } } } - mir::Rvalue::ShallowInitBox(op, ty) => { - let op = self.translate_operand(span, op)?; - let ty = self.translate_rustc_ty(span, ty)?; - Ok(Rvalue::ShallowInitBox(op, ty)) - } mir::Rvalue::ThreadLocalRef(_) => { raise_error!( self, diff --git a/charon/src/bin/generate-ml/main.rs b/charon/src/bin/generate-ml/main.rs index 22511f36f..556bbbe28 100644 --- a/charon/src/bin/generate-ml/main.rs +++ b/charon/src/bin/generate-ml/main.rs @@ -6,7 +6,6 @@ //! //! To run it, call `cargo run --bin generate-ml`. It is also run by `make generate-ml` in the //! crate root. Don't forget to format the output code after regenerating. -#![feature(if_let_guard)] use anyhow::{Context, Result, bail}; use assert_cmd::cargo::CommandCargoExt; @@ -556,6 +555,16 @@ fn type_decl_to_json_deserializer(ctx: &GenerateCtx, decl: &TypeDecl) -> String TypeDeclKind::Opaque => todo!(), TypeDeclKind::Error(_) => todo!(), }; + let ty_name = type_name_to_ocaml_ident(&decl.item_meta); + let branches = if ty_name == "name" { + format!( + "{branches}\n| `List _ ->\n let* name = list_of_json path_elem_of_json ctx js in\n Ok ({{ name }} : name)" + ) + } else if ty_name == "de_bruijn_id" { + format!("{branches}\n| `Int i -> Ok ({{ index = i }} : de_bruijn_id)") + } else { + branches + }; build_function(ctx, decl, &branches) } diff --git a/charon/src/bin/generate-ml/templates/GAstOfJson.ml b/charon/src/bin/generate-ml/templates/GAstOfJson.ml index e57168c55..7666ca1df 100644 --- a/charon/src/bin/generate-ml/templates/GAstOfJson.ml +++ b/charon/src/bin/generate-ml/templates/GAstOfJson.ml @@ -70,3 +70,4 @@ let big_int_of_json _ (js : json) : (big_int, string) result = | _ -> Error "") (* __REPLACE0__ *) + diff --git a/charon/src/lib.rs b/charon/src/lib.rs index 6539f92ad..2a631a9f6 100644 --- a/charon/src/lib.rs +++ b/charon/src/lib.rs @@ -20,14 +20,10 @@ #![allow(clippy::mem_replace_with_default)] #![allow(clippy::new_without_default)] #![allow(clippy::useless_format)] -#![expect(incomplete_features)] -#![feature(assert_matches)] #![feature(box_patterns)] #![feature(deref_patterns)] #![feature(deref_pure_trait)] -#![feature(if_let_guard)] #![feature(impl_trait_in_assoc_type)] -#![feature(iterator_try_collect)] #![feature(register_tool)] #![feature(trait_alias)] #![feature(trivial_bounds)] diff --git a/charon/src/transform/simplify_output/inline_anon_consts.rs b/charon/src/transform/simplify_output/inline_anon_consts.rs index 1b53e5395..5676ddf45 100644 --- a/charon/src/transform/simplify_output/inline_anon_consts.rs +++ b/charon/src/transform/simplify_output/inline_anon_consts.rs @@ -89,10 +89,7 @@ impl UllbcPass for Transform { } }); - outer_body - .locals - .locals - .extend(inner_body.locals.locals.into_iter()); + outer_body.locals.locals.extend(inner_body.locals.locals); new_blocks.extend(inner_body.body); *op = Operand::Move(outer_body.locals.place_for_var(return_local)); } @@ -106,7 +103,7 @@ impl UllbcPass for Transform { // Add the new blocks. They've been set up so that each new inner body // returns to what follows it in the sequence. Hence the last added body // points to the not-yet-existing block at `start_new_bodies` - outer_body.body.extend(new_blocks.into_iter()); + outer_body.body.extend(new_blocks); // Push the current block to be executed after the newly-added ones. outer_body.body.push(block); } diff --git a/charon/src/transform/typecheck_and_unify.rs b/charon/src/transform/typecheck_and_unify.rs index 22e42391d..456bd93cc 100644 --- a/charon/src/transform/typecheck_and_unify.rs +++ b/charon/src/transform/typecheck_and_unify.rs @@ -403,10 +403,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 f9eeb7ee3..f00d06042 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 b64921a58..4c1751e28 100644 --- a/charon/tests/layout.rs +++ b/charon/tests/layout.rs @@ -1,4 +1,3 @@ -#![feature(box_patterns)] use std::path::PathBuf; use charon_lib::ast::*; diff --git a/charon/tests/ui/advanced-const-generics.out b/charon/tests/ui/advanced-const-generics.out index 742b2b44b..616c1eb5f 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 { parent_clause0 : [@TraitClause0]: 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]: Eq, = @@ -106,8 +106,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>(_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>(_1: &'_0 Foo) { let _0: (); // return let self_1: &'1 Foo; // arg #1 @@ -161,7 +161,7 @@ impl PartialEq for Foo { // Full name: test_crate::{impl Eq for Foo} impl Eq for Foo { parent_clause0 = {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 8a284cb11..a342c56ad 100644 --- a/charon/tests/ui/copy_nonoverlapping.out +++ b/charon/tests/ui/copy_nonoverlapping.out @@ -184,7 +184,8 @@ where undefined_behavior } -pub fn core::intrinsics::align_of() -> usize +// Full name: core::intrinsics::align_of +pub fn align_of() -> usize where [@TraitClause0]: Sized, { @@ -204,6 +205,79 @@ impl Copy for usize { unsafe fn drop_in_place(_1: *mut Self) = +// Full name: core::mem::alignment::AlignmentEnum +enum AlignmentEnum { + _Align1Shl0, + _Align1Shl1, + _Align1Shl2, + _Align1Shl3, + _Align1Shl4, + _Align1Shl5, + _Align1Shl6, + _Align1Shl7, + _Align1Shl8, + _Align1Shl9, + _Align1Shl10, + _Align1Shl11, + _Align1Shl12, + _Align1Shl13, + _Align1Shl14, + _Align1Shl15, + _Align1Shl16, + _Align1Shl17, + _Align1Shl18, + _Align1Shl19, + _Align1Shl20, + _Align1Shl21, + _Align1Shl22, + _Align1Shl23, + _Align1Shl24, + _Align1Shl25, + _Align1Shl26, + _Align1Shl27, + _Align1Shl28, + _Align1Shl29, + _Align1Shl30, + _Align1Shl31, + _Align1Shl32, + _Align1Shl33, + _Align1Shl34, + _Align1Shl35, + _Align1Shl36, + _Align1Shl37, + _Align1Shl38, + _Align1Shl39, + _Align1Shl40, + _Align1Shl41, + _Align1Shl42, + _Align1Shl43, + _Align1Shl44, + _Align1Shl45, + _Align1Shl46, + _Align1Shl47, + _Align1Shl48, + _Align1Shl49, + _Align1Shl50, + _Align1Shl51, + _Align1Shl52, + _Align1Shl53, + _Align1Shl54, + _Align1Shl55, + _Align1Shl56, + _Align1Shl57, + _Align1Shl58, + _Align1Shl59, + _Align1Shl60, + _Align1Shl61, + _Align1Shl62, + _Align1Shl63, +} + +// Full name: core::mem::alignment::Alignment +pub struct Alignment { + _inner_repr_trick: AlignmentEnum, +} + // Full name: core::panicking::panic_nounwind_fmt pub fn panic_nounwind_fmt<'_0>(_1: Arguments<'_0>, _2: bool) -> ! { @@ -225,7 +299,7 @@ pub fn panic_nounwind_fmt<'_0>(_1: Arguments<'_0>, _2: bool) -> ! _0 = compiletime<'6>(move _3.0, move _3.1) } -fn core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(_1: usize) +fn core::mem::alignment::{Alignment}::new_unchecked::precondition_check(_1: usize) { let _0: (); // return let align_1: usize; // arg #1 @@ -286,79 +360,6 @@ fn core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(_1: usiz return } -// Full name: core::ptr::alignment::AlignmentEnum -enum AlignmentEnum { - _Align1Shl0, - _Align1Shl1, - _Align1Shl2, - _Align1Shl3, - _Align1Shl4, - _Align1Shl5, - _Align1Shl6, - _Align1Shl7, - _Align1Shl8, - _Align1Shl9, - _Align1Shl10, - _Align1Shl11, - _Align1Shl12, - _Align1Shl13, - _Align1Shl14, - _Align1Shl15, - _Align1Shl16, - _Align1Shl17, - _Align1Shl18, - _Align1Shl19, - _Align1Shl20, - _Align1Shl21, - _Align1Shl22, - _Align1Shl23, - _Align1Shl24, - _Align1Shl25, - _Align1Shl26, - _Align1Shl27, - _Align1Shl28, - _Align1Shl29, - _Align1Shl30, - _Align1Shl31, - _Align1Shl32, - _Align1Shl33, - _Align1Shl34, - _Align1Shl35, - _Align1Shl36, - _Align1Shl37, - _Align1Shl38, - _Align1Shl39, - _Align1Shl40, - _Align1Shl41, - _Align1Shl42, - _Align1Shl43, - _Align1Shl44, - _Align1Shl45, - _Align1Shl46, - _Align1Shl47, - _Align1Shl48, - _Align1Shl49, - _Align1Shl50, - _Align1Shl51, - _Align1Shl52, - _Align1Shl53, - _Align1Shl54, - _Align1Shl55, - _Align1Shl56, - _Align1Shl57, - _Align1Shl58, - _Align1Shl59, - _Align1Shl60, - _Align1Shl61, - _Align1Shl62, - _Align1Shl63, -} - -// Full name: core::ptr::alignment::Alignment -pub struct Alignment { - _inner_repr_trick: AlignmentEnum, -} - // Full name: core::option::Option #[lang_item("Option")] pub enum Option @@ -369,7 +370,7 @@ where Some(T), } -// Full name: core::ptr::alignment::{Alignment}::new +// Full name: core::mem::alignment::{Alignment}::new pub fn new(_1: usize) -> Option[{built_in impl Sized for Alignment}] { let _0: Option[{built_in impl Sized for Alignment}]; // return @@ -399,7 +400,7 @@ pub fn new(_1: usize) -> Option[{built_in impl Sized for Alignment}] 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) @@ -408,6 +409,57 @@ pub fn new(_1: usize) -> Option[{built_in impl Sized for Alignment}] return } +// Full name: core::mem::SizedTypeProperties +pub trait SizedTypeProperties +{ + parent_clause0 : [@TraitClause0]: Sized + const SIZE : usize + const ALIGN : usize + const ALIGNMENT : Alignment + const IS_ZST : bool + const LAYOUT : Layout + const MAX_SLICE_LEN : usize + non-dyn-compatible +} + +// Full name: core::mem::SizedTypeProperties::SIZE +#[lang_item("mem_size_const")] +pub fn SIZE() -> usize +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: usize; // return + + _0 = size_of[@TraitClause0::parent_clause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::SIZE +#[lang_item("mem_size_const")] +pub const SIZE: usize +where + [@TraitClause0]: SizedTypeProperties, + = SIZE() + +// Full name: core::mem::SizedTypeProperties::ALIGN +#[lang_item("mem_align_const")] +pub fn ALIGN() -> usize +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: usize; // return + + _0 = align_of[@TraitClause0::parent_clause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::ALIGN +#[lang_item("mem_align_const")] +pub const ALIGN: usize +where + [@TraitClause0]: SizedTypeProperties, + = ALIGN() + // Full name: core::option::unwrap_failed fn unwrap_failed() -> ! { @@ -438,6 +490,61 @@ where _2 = unwrap_failed() } +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub fn ALIGNMENT() -> Alignment +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: Alignment; // return + let _1: Option[{built_in impl Sized for Alignment}]; // anonymous local + + storage_live(_1) + _1 = 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]: SizedTypeProperties, + = ALIGNMENT() + +// Full name: core::mem::SizedTypeProperties::IS_ZST +pub fn IS_ZST() -> bool +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: bool; // return + + _0 = const @TraitClause0::SIZE == const 0 : usize + return +} + +// Full name: core::mem::SizedTypeProperties::IS_ZST +pub const IS_ZST: bool +where + [@TraitClause0]: SizedTypeProperties, + = IS_ZST() + +// Full name: core::mem::SizedTypeProperties::LAYOUT +pub fn LAYOUT() -> Layout +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: Layout; // return + + _0 = from_size_align_unchecked(const @TraitClause0::SIZE, const @TraitClause0::ALIGN) + return +} + +// Full name: core::mem::SizedTypeProperties::LAYOUT +pub const LAYOUT: Layout +where + [@TraitClause0]: SizedTypeProperties, + = LAYOUT() + pub fn core::num::{usize}::MAX() -> usize { let _0: usize; // return @@ -462,19 +569,6 @@ pub fn core::num::{isize}::MAX() -> isize pub const core::num::{isize}::MAX: isize = core::num::{isize}::MAX() -// Full name: core::mem::SizedTypeProperties -pub trait SizedTypeProperties -{ - parent_clause0 : [@TraitClause0]: Sized - const SIZE : usize - const ALIGN : usize - const ALIGNMENT : Alignment - const IS_ZST : bool - const LAYOUT : Layout - const MAX_SLICE_LEN : usize - non-dyn-compatible -} - // Full name: core::mem::SizedTypeProperties::MAX_SLICE_LEN pub fn MAX_SLICE_LEN() -> usize where @@ -515,106 +609,6 @@ where [@TraitClause0]: SizedTypeProperties, = MAX_SLICE_LEN() -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub fn LAYOUT() -> Layout -where - [@TraitClause0]: SizedTypeProperties, -{ - let _0: Layout; // return - - _0 = from_size_align_unchecked(const @TraitClause0::SIZE, const @TraitClause0::ALIGN) - return -} - -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub const LAYOUT: Layout -where - [@TraitClause0]: SizedTypeProperties, - = LAYOUT() - -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub fn IS_ZST() -> bool -where - [@TraitClause0]: SizedTypeProperties, -{ - let _0: bool; // return - - _0 = const @TraitClause0::SIZE == const 0 : usize - return -} - -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub const IS_ZST: bool -where - [@TraitClause0]: SizedTypeProperties, - = IS_ZST() - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub fn ALIGN() -> usize -where - [@TraitClause0]: SizedTypeProperties, -{ - let _0: usize; // return - - _0 = core::intrinsics::align_of[@TraitClause0::parent_clause0]() - return -} - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub const ALIGN: usize -where - [@TraitClause0]: SizedTypeProperties, - = ALIGN() - -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub fn SIZE() -> usize -where - [@TraitClause0]: SizedTypeProperties, -{ - let _0: usize; // return - - _0 = size_of[@TraitClause0::parent_clause0]() - return -} - -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub const SIZE: usize -where - [@TraitClause0]: SizedTypeProperties, - = SIZE() - -#[lang_item("mem_align_of")] -pub fn core::mem::align_of() -> usize -where - [@TraitClause0]: Sized, -{ - let _0: usize; // return - - _0 = const {impl SizedTypeProperties for T}[@TraitClause0]::ALIGN - return -} - -// Full name: core::mem::SizedTypeProperties::ALIGNMENT -pub fn ALIGNMENT() -> Alignment -where - [@TraitClause0]: SizedTypeProperties, -{ - let _0: Alignment; // return - - _0 = of[@TraitClause0::parent_clause0]() - return -} - -// Full name: core::mem::SizedTypeProperties::ALIGNMENT -pub const ALIGNMENT: Alignment -where - [@TraitClause0]: SizedTypeProperties, - = ALIGNMENT() - // Full name: core::mem::{impl SizedTypeProperties for T} impl SizedTypeProperties for T where @@ -630,28 +624,6 @@ where non-dyn-compatible } -// Full name: core::ptr::alignment::{Alignment}::of -pub fn of() -> Alignment -where - [@TraitClause0]: Sized, -{ - let _0: Alignment; // return - let _1: Alignment; // anonymous local - let _2: Option[{built_in impl Sized for Alignment}]; // anonymous local - let _3: usize; // anonymous local - - storage_live(_1) - storage_live(_2) - storage_live(_3) - _3 = core::mem::align_of[@TraitClause0]() - _2 = new(move _3) - storage_dead(_3) - _1 = unwrap[{built_in impl Sized for Alignment}](move _2) - storage_dead(_2) - _0 = move _1 - return -} - fn core::ptr::copy_nonoverlapping::precondition_check(_1: *const (), _2: *mut (), _3: usize, _4: usize, _5: usize) = diff --git a/charon/tests/ui/dyn-with-diamond-supertraits.out b/charon/tests/ui/dyn-with-diamond-supertraits.out index 345a32243..7701269d1 100644 --- a/charon/tests/ui/dyn-with-diamond-supertraits.out +++ b/charon/tests/ui/dyn-with-diamond-supertraits.out @@ -78,10 +78,10 @@ where struct test_crate::Left::{vtable} { size: usize, align: usize, - drop: unsafe fn(*mut (dyn Left)), - method_left_method: fn<'_0_1>(&'_0_1 (dyn Left)) -> Ty1, + drop: unsafe fn(*mut (dyn Left)), + method_left_method: fn<'_0_1>(&'_0_1 (dyn Left)) -> Ty0, super_trait_0: &'static core::marker::MetaSized::{vtable}, - super_trait_1: &'static test_crate::Internal::{vtable}, + super_trait_1: &'static test_crate::Internal::{vtable}, } // Full name: test_crate::Left @@ -103,10 +103,10 @@ where struct test_crate::Right::{vtable} { size: usize, align: usize, - drop: unsafe fn(*mut (dyn Right)), - method_right_method: fn<'_0_1>(&'_0_1 (dyn Right)) -> Ty1, + drop: unsafe fn(*mut (dyn Right)), + method_right_method: fn<'_0_1>(&'_0_1 (dyn Right)) -> Ty0, super_trait_0: &'static core::marker::MetaSized::{vtable}, - super_trait_1: &'static test_crate::Internal::{vtable}, + super_trait_1: &'static test_crate::Internal::{vtable}, super_trait_2: &'static test_crate::Super::{vtable}, } @@ -131,11 +131,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)) -> (Ty3, Ty2), + drop: unsafe fn(*mut (dyn Join)), + method_join_method: fn<'_0_1>(&'_0_1 (dyn Join)) -> (Ty0, Ty1), 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 @@ -314,28 +314,28 @@ fn {impl Left for i32}::left_method<'_0>(_1: &'_0 i32) -> i32 } // Full name: test_crate::{impl Left for i32}::left_method::{vtable_method} -fn {impl Left for i32}::left_method::{vtable_method}<'_0>(_1: &'_0 (dyn Left)) -> i32 +fn {impl Left for i32}::left_method::{vtable_method}<'_0>(_1: &'_0 (dyn Left)) -> i32 { let _0: i32; // return - let _1: &'_0 (dyn Left + '0); // arg #1 + let _1: &'_0 (dyn Left + '0); // arg #1 let _2: &'_0 i32; // anonymous local storage_live(_2) - _2 = concretize<&'_0 (dyn Left + '1), &'_0 i32>(move _1) + _2 = concretize<&'_0 (dyn Left + '1), &'_0 i32>(move _1) _0 = {impl Left for i32}::left_method<'_0>(move _2) return } // Full name: test_crate::{impl Left for i32}::{vtable_drop_shim} -unsafe fn {impl Left for i32}::{vtable_drop_shim}(_1: *mut (dyn Left)) +unsafe fn {impl Left for i32}::{vtable_drop_shim}(_1: *mut (dyn Left)) { let ret_0: (); // return - let dyn_self_1: *mut (dyn Left + '0); // arg #1 + let dyn_self_1: *mut (dyn Left + '0); // arg #1 let target_self_2: *mut i32; // local ret_0 = () storage_live(target_self_2) - target_self_2 = concretize<*mut (dyn Left + '1), *mut i32>(move dyn_self_1) + target_self_2 = concretize<*mut (dyn Left + '1), *mut i32>(move dyn_self_1) return } @@ -418,28 +418,28 @@ fn {impl Right for i32}::right_method<'_0>(_1: &'_0 i32) -> i32 } // Full name: test_crate::{impl Right for i32}::right_method::{vtable_method} -fn {impl Right for i32}::right_method::{vtable_method}<'_0>(_1: &'_0 (dyn Right)) -> i32 +fn {impl Right for i32}::right_method::{vtable_method}<'_0>(_1: &'_0 (dyn Right)) -> i32 { let _0: i32; // return - let _1: &'_0 (dyn Right + '0); // arg #1 + let _1: &'_0 (dyn Right + '0); // arg #1 let _2: &'_0 i32; // anonymous local storage_live(_2) - _2 = concretize<&'_0 (dyn Right + '1), &'_0 i32>(move _1) + _2 = concretize<&'_0 (dyn Right + '1), &'_0 i32>(move _1) _0 = {impl Right for i32}::right_method<'_0>(move _2) return } // Full name: test_crate::{impl Right for i32}::{vtable_drop_shim} -unsafe fn {impl Right for i32}::{vtable_drop_shim}(_1: *mut (dyn Right)) +unsafe fn {impl Right for i32}::{vtable_drop_shim}(_1: *mut (dyn Right)) { let ret_0: (); // return - let dyn_self_1: *mut (dyn Right + '0); // arg #1 + let dyn_self_1: *mut (dyn Right + '0); // arg #1 let target_self_2: *mut i32; // local ret_0 = () storage_live(target_self_2) - target_self_2 = concretize<*mut (dyn Right + '1), *mut i32>(move dyn_self_1) + target_self_2 = concretize<*mut (dyn Right + '1), *mut i32>(move dyn_self_1) return } @@ -506,28 +506,28 @@ fn {impl Join for i32}::join_method<'_0>(_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}(_1: *mut (dyn Join)) +unsafe fn {impl Join for i32}::{vtable_drop_shim}(_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 } @@ -569,11 +569,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: &'19 i32; // anonymous local let _8: i32; // anonymous local @@ -590,7 +590,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 06f4feb7f..1306edfb3 100644 --- a/charon/tests/ui/issue-114-opaque-bodies.out +++ b/charon/tests/ui/issue-114-opaque-bodies.out @@ -1,338 +1,9 @@ -# Final LLBC before serialization: - -// Full name: core::marker::MetaSized -#[lang_item("meta_sized")] -pub trait MetaSized - -// Full name: core::marker::Sized -#[lang_item("sized")] -pub trait Sized -{ - parent_clause0 : [@TraitClause0]: MetaSized - non-dyn-compatible -} - -// Full name: core::option::Option -#[lang_item("Option")] -pub enum Option -where - [@TraitClause0]: Sized, -{ - None, - Some(T), -} - -// Full name: core::marker::Destruct -#[lang_item("destruct")] -pub trait Destruct -{ - fn drop_in_place = core::marker::Destruct::drop_in_place - non-dyn-compatible -} - -// Full name: core::bool::{bool}::then_some -pub fn then_some(_1: bool, _2: T) -> Option[@TraitClause0] -where - [@TraitClause0]: Sized, - [@TraitClause1]: Destruct, -{ - let _0: Option[@TraitClause0]; // return - let self_1: bool; // arg #1 - let t_2: T; // arg #2 - let _3: T; // anonymous local - - if copy self_1 { - } else { - _0 = Option::None { } - drop[@TraitClause1] t_2 - return - } - storage_live(_3) - _3 = move t_2 - _0 = Option::Some { 0: move _3 } - storage_dead(_3) - return -} - -// Full name: core::cmp::PartialEq -#[lang_item("eq")] -pub trait PartialEq -{ - fn eq<'_0_1, '_1_1> = eq<'_0_1, '_1_1, Self, Rhs>[Self] - fn ne<'_0_1, '_1_1> = ne<'_0_1, '_1_1, Self, Rhs>[Self] - vtable: core::cmp::PartialEq::{vtable} -} - -// Full name: core::cmp::PartialEq::eq -#[lang_item("cmp_partialeq_eq")] -pub fn eq<'_0, '_1, Self, Rhs>(_1: &'_0 Self, _2: &'_1 Rhs) -> bool -where - [@TraitClause0]: PartialEq, -= - -// Full name: core::cmp::PartialEq::ne -#[lang_item("cmp_partialeq_ne")] -pub fn ne<'_0, '_1, Self, Rhs>(_1: &'_0 Self, _2: &'_1 Rhs) -> bool -where - [@TraitClause0]: PartialEq, -{ - let _0: bool; // return - let self_1: &'1 Self; // arg #1 - let other_2: &'3 Rhs; // arg #2 - let _3: bool; // anonymous local - - storage_live(_3) - _3 = @TraitClause0::eq<'6, '7>(move self_1, move other_2) - _0 = ~(move _3) - storage_dead(_3) - return -} - -// Full name: core::convert::num::{impl From for i64}::from -pub fn {impl From for i64}::from(_1: i32) -> i64 -{ - let _0: i64; // return - let small_1: i32; // arg #1 - - _0 = cast(copy small_1) - return -} - -// Full name: core::marker::PhantomData -#[lang_item("phantom_data")] -pub struct PhantomData {} - -unsafe fn core::marker::Destruct::drop_in_place(_1: *mut Self) -= - -// Full name: core::num::niche_types::UsizeNoHighBit -pub struct UsizeNoHighBit { - usize, -} - -// Full name: core::num::{usize}::MAX -pub fn MAX() -> usize -{ - let _0: usize; // return - - _0 = ~(const 0 : usize) - return -} - -// Full name: core::num::{usize}::MAX -pub const MAX: usize = MAX() - -// Full name: core::ptr::non_null::NonNull -#[lang_item("NonNull")] -pub struct NonNull { - pointer: *const T, -} - -// Full name: core::ptr::unique::Unique -pub struct Unique { - pointer: NonNull, - _marker: PhantomData, -} - -// Full name: alloc::alloc::Global -#[lang_item("global_alloc_ty")] -pub struct Global {} - -// Full name: alloc::raw_vec::RawVecInner -struct RawVecInner -where - [@TraitClause0]: Sized, -{ - ptr: Unique, - cap: UsizeNoHighBit, - alloc: A, -} - -// Full name: alloc::raw_vec::RawVec -struct RawVec -where - [@TraitClause0]: Sized, - [@TraitClause1]: Sized, -{ - inner: RawVecInner[@TraitClause1], - _marker: PhantomData, -} - -// Full name: alloc::vec::Vec -#[lang_item("Vec")] -pub struct Vec -where - [@TraitClause0]: Sized, - [@TraitClause1]: Sized, -{ - buf: RawVec[@TraitClause0, @TraitClause1], - len: usize, -} - -// Full name: alloc::vec::Vec::{impl Destruct for Vec[@TraitClause0, @TraitClause1]}::drop_in_place -unsafe fn {impl Destruct for Vec[@TraitClause0, @TraitClause1]}::drop_in_place(_1: *mut Vec[@TraitClause0, @TraitClause1]) -where - [@TraitClause0]: Sized, - [@TraitClause1]: Sized, -= - -// Full name: alloc::vec::Vec::{impl Destruct for Vec[@TraitClause0, @TraitClause1]} -impl Destruct for Vec[@TraitClause0, @TraitClause1] -where - [@TraitClause0]: Sized, - [@TraitClause1]: Sized, -{ - fn drop_in_place = {impl Destruct for Vec[@TraitClause0, @TraitClause1]}::drop_in_place[@TraitClause0, @TraitClause1] - non-dyn-compatible -} - -// Full name: issue_114_opaque_bodies_aux::inline_always -pub fn inline_always() -> u32 -{ - let _0: u32; // return - - _0 = const 42 : u32 - return -} - -// Full name: issue_114_opaque_bodies_aux::inline_sometimes -pub fn inline_sometimes() -> u32 -{ - let _0: u32; // return - - _0 = const 42 : u32 - return -} - -// Full name: issue_114_opaque_bodies_aux::inline_never -pub fn inline_never() -> u32 -{ - let _0: u32; // return - - _0 = const 42 : u32 - return -} - -// Full name: issue_114_opaque_bodies_aux::inline_generic -pub fn inline_generic() -> u32 -where - [@TraitClause0]: Sized, -{ - let _0: u32; // return - - _0 = const 42 : u32 - return -} - -// Full name: test_crate::use_inlines -fn use_inlines() -> u32 -{ - let _0: u32; // return - let _1: u32; // anonymous local - let _2: u32; // anonymous local - let _3: u32; // anonymous local - let _4: u32; // anonymous local - let _5: u32; // anonymous local - let _6: u32; // anonymous local - let _7: u32; // anonymous local - let _8: u32; // anonymous local - let _9: u32; // anonymous local - - storage_live(_5) - storage_live(_7) - storage_live(_9) - storage_live(_1) - storage_live(_2) - storage_live(_3) - _3 = inline_always() - storage_live(_4) - _4 = inline_sometimes() - _5 = copy _3 panic.+ copy _4 - _2 = move _5 - storage_dead(_4) - storage_dead(_3) - storage_live(_6) - _6 = inline_never() - _7 = copy _2 panic.+ copy _6 - _1 = move _7 - storage_dead(_6) - storage_dead(_2) - storage_live(_8) - _8 = inline_generic[{built_in impl Sized for bool}]() - _9 = copy _1 panic.+ copy _8 - _0 = move _9 - storage_dead(_8) - storage_dead(_1) - return -} - -// Full name: test_crate::bool_to_opt -fn bool_to_opt(_1: bool) -> Option<()>[{built_in impl Sized for ()}] -{ - let _0: Option<()>[{built_in impl Sized for ()}]; // return - let b_1: bool; // arg #1 - let _2: bool; // anonymous local - let _3: (); // anonymous local - - storage_live(_2) - _2 = copy b_1 - storage_live(_3) - _3 = () - _0 = then_some<()>[{built_in impl Sized for ()}, {built_in impl Destruct for ()}](move _2, move _3) - storage_dead(_3) - storage_dead(_2) - return -} - -// Full name: test_crate::convert -fn convert(_1: i32) -> i64 -{ - let _0: i64; // return - let x_1: i32; // arg #1 - let _2: i32; // anonymous local - - storage_live(_2) - _2 = copy x_1 - _0 = {impl From for i64}::from(move _2) - storage_dead(_2) - return -} - -// Full name: test_crate::vec -fn vec(_1: Vec[{built_in impl Sized for u32}, {built_in impl Sized for Global}]) -{ - let _0: (); // return - let _x_1: Vec[{built_in impl Sized for u32}, {built_in impl Sized for Global}]; // arg #1 - - _0 = () - _0 = () - conditional_drop[{impl Destruct for Vec[@TraitClause0, @TraitClause1]}[{built_in impl Sized for u32}, {built_in impl Sized for Global}]] _x_1 - return -} - -// Full name: test_crate::max -fn max() -> usize -{ - let _0: usize; // return - - _0 = copy MAX - return -} - -// Full name: test_crate::partial_eq -fn partial_eq(_1: T) -where - [@TraitClause0]: Sized, - [@TraitClause1]: PartialEq, -{ - let _0: (); // return - let _x_1: T; // arg #1 - - _0 = () - _0 = () - conditional_drop[{built_in impl Destruct for T}] _x_1 - return -} - - - +error: Unsupported type: "pattern_type!(usize is 0..=core::::num::niche_types::UsizeNoHighBit::0::{constant#1})" + --> /rustc/library/core/src/num/niche_types.rs:20:27 + +note: the error occurred when translating `core::num::niche_types::UsizeNoHighBit`, which is (transitively) used at the following location(s): + --> tests/ui/issue-114-opaque-bodies.rs:19:1 + | +19 | fn vec(_x: Vec) {} + | ----------------------- +ERROR Charon failed to translate this code (1 errors) diff --git a/charon/tests/ui/issue-114-opaque-bodies.rs b/charon/tests/ui/issue-114-opaque-bodies.rs index 01173e272..13178a2c8 100644 --- a/charon/tests/ui/issue-114-opaque-bodies.rs +++ b/charon/tests/ui/issue-114-opaque-bodies.rs @@ -1,3 +1,4 @@ +//@ known-failure //@ charon-args=--extract-opaque-bodies //@ charon-arg=--opaque={impl core::marker::Destruct for alloc::vec::Vec} //@ aux-crate=issue-114-opaque-bodies-aux.rs diff --git a/charon/tests/ui/issue-165-vec-macro.out b/charon/tests/ui/issue-165-vec-macro.out index a97f0bbd4..69b9ce8f2 100644 --- a/charon/tests/ui/issue-165-vec-macro.out +++ b/charon/tests/ui/issue-165-vec-macro.out @@ -49,6 +49,24 @@ pub trait Destruct unsafe fn core::marker::Destruct::drop_in_place(_1: *mut Self) = +// Full name: core::mem::manually_drop::ManuallyDrop +#[lang_item("manually_drop")] +pub opaque type ManuallyDrop +where + [@TraitClause0]: MetaSized, + +// Full name: core::mem::maybe_dangling::MaybeDangling +#[lang_item("maybe_dangling")] +pub opaque type MaybeDangling

+where + [@TraitClause0]: MetaSized

, + +// Full name: core::mem::maybe_uninit::MaybeUninit +#[lang_item("maybe_uninit")] +pub opaque type MaybeUninit +where + [@TraitClause0]: Sized, + // Full name: alloc::alloc::Global #[lang_item("global_alloc_ty")] pub struct Global {} @@ -77,12 +95,17 @@ where [@TraitClause0]: Sized, [@TraitClause1]: Sized, -// Full name: alloc::slice::{[T]}::into_vec -#[lang_item("slice_into_vec")] -pub fn into_vec(_1: alloc::boxed::Box<[T]>[{built_in impl MetaSized for [T]}, @TraitClause1]) -> Vec[@TraitClause0, @TraitClause1] +// Full name: alloc::boxed::box_assume_init_into_vec_unsafe +#[lang_item("box_assume_init_into_vec_unsafe")] +pub fn box_assume_init_into_vec_unsafe(_1: alloc::boxed::Box[{built_in impl Sized for [T; N]}]>[{built_in impl MetaSized for MaybeUninit<[T; N]>[{built_in impl Sized for [T; N]}]}, {built_in impl Sized for Global}]) -> Vec[@TraitClause0, {built_in impl Sized for Global}] +where + [@TraitClause0]: Sized, += + +// Full name: alloc::boxed::{alloc::boxed::Box[@TraitClause0::parent_clause0, {built_in impl Sized for Global}]}::new_uninit +pub fn new_uninit() -> alloc::boxed::Box[@TraitClause0]>[{built_in impl MetaSized for MaybeUninit[@TraitClause0]}, {built_in impl Sized for Global}] where [@TraitClause0]: Sized, - [@TraitClause1]: Sized, = // Full name: alloc::vec::Vec::{impl Destruct for Vec[@TraitClause0, @TraitClause1]}::drop_in_place @@ -115,33 +138,26 @@ fn foo() { let _0: (); // return let _v_1: Vec[{built_in impl Sized for i32}, {built_in impl Sized for Global}]; // local - let _2: alloc::boxed::Box<[i32]>[{built_in impl MetaSized for [i32]}, {built_in impl Sized for Global}]; // anonymous local - let _3: alloc::boxed::Box<[i32; 1 : usize]>[{built_in impl MetaSized for [i32; 1 : usize]}, {built_in impl Sized for Global}]; // anonymous local - let _4: alloc::boxed::Box<[i32; 1 : usize]>[{built_in impl MetaSized for [i32; 1 : usize]}, {built_in impl Sized for Global}]; // anonymous local - let _v2_5: Vec[{built_in impl Sized for i32}, {built_in impl Sized for Global}]; // local - let _6: [i32; 1 : usize]; // anonymous local + let _2: alloc::boxed::Box[{built_in impl Sized for [i32; 1 : usize]}]>[{built_in impl MetaSized for MaybeUninit<[i32; 1 : usize]>[{built_in impl Sized for [i32; 1 : usize]}]}, {built_in impl Sized for Global}]; // anonymous local + let _3: alloc::boxed::Box[{built_in impl Sized for [i32; 1 : usize]}]>[{built_in impl MetaSized for MaybeUninit<[i32; 1 : usize]>[{built_in impl Sized for [i32; 1 : usize]}]}, {built_in impl Sized for Global}]; // anonymous local + let _v2_4: Vec[{built_in impl Sized for i32}, {built_in impl Sized for Global}]; // local _0 = () storage_live(_v_1) storage_live(_2) storage_live(_3) - storage_live(_6) - _6 = [const 1 : i32] - storage_live(_4) - _4 = @BoxNew<[i32; 1 : usize]>[{built_in impl MetaSized for [i32; 1 : usize]}, {built_in impl Sized for Global}](move _6) - _3 = move _4 - _2 = unsize_cast[{built_in impl MetaSized for [i32; 1 : usize]}, {built_in impl Sized for Global}], alloc::boxed::Box<[i32]>[{built_in impl MetaSized for [i32]}, {built_in impl Sized for Global}], 1 : usize>(move _3) - conditional_drop[{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}<[i32; 1 : usize], Global>[{built_in impl MetaSized for [i32; 1 : usize]}, {built_in impl Sized for Global}]] _3 - conditional_drop[{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}<[i32; 1 : usize], Global>[{built_in impl MetaSized for [i32; 1 : usize]}, {built_in impl Sized for Global}]] _4 - storage_dead(_4) + _3 = new_uninit<[i32; 1 : usize]>[{built_in impl Sized for [i32; 1 : usize]}]() + ((((*_3)).1).0).0 = [const 1 : i32] + _2 = move _3 + conditional_drop[{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}[{built_in impl Sized for [i32; 1 : usize]}], Global>[{built_in impl MetaSized for MaybeUninit<[i32; 1 : usize]>[{built_in impl Sized for [i32; 1 : usize]}]}, {built_in impl Sized for Global}]] _3 storage_dead(_3) - _v_1 = into_vec[{built_in impl Sized for i32}, {built_in impl Sized for Global}](move _2) + _v_1 = box_assume_init_into_vec_unsafe[{built_in impl Sized for i32}](move _2) storage_dead(_2) - storage_live(_v2_5) - _v2_5 = from_elem[{built_in impl Sized for i32}, {impl Clone for i32}](const 1 : i32, const 10 : usize) + storage_live(_v2_4) + _v2_4 = from_elem[{built_in impl Sized for i32}, {impl Clone for i32}](const 1 : i32, const 10 : usize) _0 = () - conditional_drop[{impl Destruct for Vec[@TraitClause0, @TraitClause1]}[{built_in impl Sized for i32}, {built_in impl Sized for Global}]] _v2_5 - storage_dead(_v2_5) + conditional_drop[{impl Destruct for Vec[@TraitClause0, @TraitClause1]}[{built_in impl Sized for i32}, {built_in impl Sized for Global}]] _v2_4 + storage_dead(_v2_4) conditional_drop[{impl Destruct for Vec[@TraitClause0, @TraitClause1]}[{built_in impl Sized for i32}, {built_in impl Sized for Global}]] _v_1 storage_dead(_v_1) return @@ -155,30 +171,23 @@ pub fn bar() { let _0: (); // return let _1: Vec[{built_in impl Sized for Foo}, {built_in impl Sized for Global}]; // anonymous local - let _2: alloc::boxed::Box<[Foo]>[{built_in impl MetaSized for [Foo]}, {built_in impl Sized for Global}]; // anonymous local - let _3: alloc::boxed::Box<[Foo; 1 : usize]>[{built_in impl MetaSized for [Foo; 1 : usize]}, {built_in impl Sized for Global}]; // anonymous local - let _4: alloc::boxed::Box<[Foo; 1 : usize]>[{built_in impl MetaSized for [Foo; 1 : usize]}, {built_in impl Sized for Global}]; // anonymous local - let _5: Foo; // anonymous local - let _6: [Foo; 1 : usize]; // anonymous local + let _2: alloc::boxed::Box[{built_in impl Sized for [Foo; 1 : usize]}]>[{built_in impl MetaSized for MaybeUninit<[Foo; 1 : usize]>[{built_in impl Sized for [Foo; 1 : usize]}]}, {built_in impl Sized for Global}]; // anonymous local + let _3: alloc::boxed::Box[{built_in impl Sized for [Foo; 1 : usize]}]>[{built_in impl MetaSized for MaybeUninit<[Foo; 1 : usize]>[{built_in impl Sized for [Foo; 1 : usize]}]}, {built_in impl Sized for Global}]; // anonymous local + let _4: Foo; // anonymous local _0 = () storage_live(_1) storage_live(_2) storage_live(_3) - storage_live(_6) - _6 = [move _5] + _3 = new_uninit<[Foo; 1 : usize]>[{built_in impl Sized for [Foo; 1 : usize]}]() storage_live(_4) - _4 = @BoxNew<[Foo; 1 : usize]>[{built_in impl MetaSized for [Foo; 1 : usize]}, {built_in impl Sized for Global}](move _6) - storage_live(_5) - _5 = Foo { } - storage_dead(_5) - _3 = move _4 - _2 = unsize_cast[{built_in impl MetaSized for [Foo; 1 : usize]}, {built_in impl Sized for Global}], alloc::boxed::Box<[Foo]>[{built_in impl MetaSized for [Foo]}, {built_in impl Sized for Global}], 1 : usize>(move _3) - conditional_drop[{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}<[Foo; 1 : usize], Global>[{built_in impl MetaSized for [Foo; 1 : usize]}, {built_in impl Sized for Global}]] _3 - conditional_drop[{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}<[Foo; 1 : usize], Global>[{built_in impl MetaSized for [Foo; 1 : usize]}, {built_in impl Sized for Global}]] _4 + _4 = Foo { } + ((((*_3)).1).0).0 = [move _4] storage_dead(_4) + _2 = move _3 + conditional_drop[{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}[{built_in impl Sized for [Foo; 1 : usize]}], Global>[{built_in impl MetaSized for MaybeUninit<[Foo; 1 : usize]>[{built_in impl Sized for [Foo; 1 : usize]}]}, {built_in impl Sized for Global}]] _3 storage_dead(_3) - _1 = into_vec[{built_in impl Sized for Foo}, {built_in impl Sized for Global}](move _2) + _1 = box_assume_init_into_vec_unsafe[{built_in impl Sized for Foo}](move _2) storage_dead(_2) conditional_drop[{impl Destruct for Vec[@TraitClause0, @TraitClause1]}[{built_in impl Sized for Foo}, {built_in impl Sized for Global}]] _1 storage_dead(_1) diff --git a/charon/tests/ui/issue-393-shallowinitbox.out b/charon/tests/ui/issue-393-shallowinitbox.out index eb06e48ea..d079e9539 100644 --- a/charon/tests/ui/issue-393-shallowinitbox.out +++ b/charon/tests/ui/issue-393-shallowinitbox.out @@ -1,10 +1,162 @@ -error: Could not reconstruct `Box` initialization; branching during `Box` initialization is not supported. - --> tests/ui/issue-393-shallowinitbox.rs:2:1 - | -2 | / pub fn next(b: bool) -> Option> { -3 | | let vec = vec![if b { 42 } else { return None }]; -4 | | Some(vec) -5 | | } - | |_^ - -ERROR Charon failed to translate this code (1 errors) +# Final LLBC before serialization: + +// Full name: core::marker::MetaSized +#[lang_item("meta_sized")] +pub trait MetaSized + +// Full name: core::marker::Sized +#[lang_item("sized")] +pub trait Sized +{ + parent_clause0 : [@TraitClause0]: MetaSized + non-dyn-compatible +} + +// Full name: core::marker::Destruct +#[lang_item("destruct")] +pub trait Destruct +{ + fn drop_in_place = core::marker::Destruct::drop_in_place + non-dyn-compatible +} + +unsafe fn core::marker::Destruct::drop_in_place(_1: *mut Self) += + +// Full name: core::mem::manually_drop::ManuallyDrop +#[lang_item("manually_drop")] +pub opaque type ManuallyDrop +where + [@TraitClause0]: MetaSized, + +// Full name: core::mem::maybe_dangling::MaybeDangling +#[lang_item("maybe_dangling")] +pub opaque type MaybeDangling

+where + [@TraitClause0]: MetaSized

, + +// Full name: core::mem::maybe_uninit::MaybeUninit +#[lang_item("maybe_uninit")] +pub opaque type MaybeUninit +where + [@TraitClause0]: Sized, + +// Full name: core::option::Option +#[lang_item("Option")] +pub enum Option +where + [@TraitClause0]: Sized, +{ + None, + Some(T), +} + +// Full name: alloc::alloc::Global +#[lang_item("global_alloc_ty")] +pub struct Global {} + +// Full name: alloc::boxed::Box::{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}::drop_in_place +unsafe fn {impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}::drop_in_place(_1: *mut alloc::boxed::Box[@TraitClause0, @TraitClause1]) +where + [@TraitClause0]: MetaSized, + [@TraitClause1]: Sized, += + +// Full name: alloc::boxed::Box::{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]} +impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1] +where + [@TraitClause0]: MetaSized, + [@TraitClause1]: Sized, +{ + fn drop_in_place = {impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}::drop_in_place[@TraitClause0, @TraitClause1] + non-dyn-compatible +} + +// Full name: alloc::vec::Vec +#[lang_item("Vec")] +pub opaque type Vec +where + [@TraitClause0]: Sized, + [@TraitClause1]: Sized, + +// Full name: alloc::boxed::box_assume_init_into_vec_unsafe +#[lang_item("box_assume_init_into_vec_unsafe")] +pub fn box_assume_init_into_vec_unsafe(_1: alloc::boxed::Box[{built_in impl Sized for [T; N]}]>[{built_in impl MetaSized for MaybeUninit<[T; N]>[{built_in impl Sized for [T; N]}]}, {built_in impl Sized for Global}]) -> Vec[@TraitClause0, {built_in impl Sized for Global}] +where + [@TraitClause0]: Sized, += + +// Full name: alloc::boxed::{alloc::boxed::Box[@TraitClause0::parent_clause0, {built_in impl Sized for Global}]}::new_uninit +pub fn new_uninit() -> alloc::boxed::Box[@TraitClause0]>[{built_in impl MetaSized for MaybeUninit[@TraitClause0]}, {built_in impl Sized for Global}] +where + [@TraitClause0]: Sized, += + +// Full name: alloc::vec::Vec::{impl Destruct for Vec[@TraitClause0, @TraitClause1]}::drop_in_place +unsafe fn {impl Destruct for Vec[@TraitClause0, @TraitClause1]}::drop_in_place(_1: *mut Vec[@TraitClause0, @TraitClause1]) +where + [@TraitClause0]: Sized, + [@TraitClause1]: Sized, += + +// Full name: alloc::vec::Vec::{impl Destruct for Vec[@TraitClause0, @TraitClause1]} +impl Destruct for Vec[@TraitClause0, @TraitClause1] +where + [@TraitClause0]: Sized, + [@TraitClause1]: Sized, +{ + fn drop_in_place = {impl Destruct for Vec[@TraitClause0, @TraitClause1]}::drop_in_place[@TraitClause0, @TraitClause1] + non-dyn-compatible +} + +// Full name: test_crate::next +pub fn next(_1: bool) -> Option[{built_in impl Sized for u8}, {built_in impl Sized for Global}]>[{built_in impl Sized for Vec[{built_in impl Sized for u8}, {built_in impl Sized for Global}]}] +{ + let _0: Option[{built_in impl Sized for u8}, {built_in impl Sized for Global}]>[{built_in impl Sized for Vec[{built_in impl Sized for u8}, {built_in impl Sized for Global}]}]; // return + let b_1: bool; // arg #1 + let vec_2: Vec[{built_in impl Sized for u8}, {built_in impl Sized for Global}]; // local + let _3: alloc::boxed::Box[{built_in impl Sized for [u8; 1 : usize]}]>[{built_in impl MetaSized for MaybeUninit<[u8; 1 : usize]>[{built_in impl Sized for [u8; 1 : usize]}]}, {built_in impl Sized for Global}]; // anonymous local + let _4: alloc::boxed::Box[{built_in impl Sized for [u8; 1 : usize]}]>[{built_in impl MetaSized for MaybeUninit<[u8; 1 : usize]>[{built_in impl Sized for [u8; 1 : usize]}]}, {built_in impl Sized for Global}]; // anonymous local + let _5: u8; // anonymous local + let _6: bool; // anonymous local + let _7: Vec[{built_in impl Sized for u8}, {built_in impl Sized for Global}]; // anonymous local + + storage_live(vec_2) + storage_live(_3) + storage_live(_4) + _4 = new_uninit<[u8; 1 : usize]>[{built_in impl Sized for [u8; 1 : usize]}]() + storage_live(_5) + storage_live(_6) + _6 = copy b_1 + if move _6 { + } else { + _0 = Option::None { } + storage_dead(_6) + storage_dead(_5) + conditional_drop[{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}[{built_in impl Sized for [u8; 1 : usize]}], Global>[{built_in impl MetaSized for MaybeUninit<[u8; 1 : usize]>[{built_in impl Sized for [u8; 1 : usize]}]}, {built_in impl Sized for Global}]] _4 + storage_dead(_4) + storage_dead(_3) + storage_dead(vec_2) + return + } + _5 = const 42 : u8 + storage_dead(_6) + ((((*_4)).1).0).0 = [move _5] + storage_dead(_5) + _3 = move _4 + conditional_drop[{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}[{built_in impl Sized for [u8; 1 : usize]}], Global>[{built_in impl MetaSized for MaybeUninit<[u8; 1 : usize]>[{built_in impl Sized for [u8; 1 : usize]}]}, {built_in impl Sized for Global}]] _4 + storage_dead(_4) + vec_2 = box_assume_init_into_vec_unsafe[{built_in impl Sized for u8}](move _3) + storage_dead(_3) + storage_live(_7) + _7 = move vec_2 + _0 = Option::Some { 0: move _7 } + conditional_drop[{impl Destruct for Vec[@TraitClause0, @TraitClause1]}[{built_in impl Sized for u8}, {built_in impl Sized for Global}]] _7 + storage_dead(_7) + conditional_drop[{impl Destruct for Vec[@TraitClause0, @TraitClause1]}[{built_in impl Sized for u8}, {built_in impl Sized for Global}]] vec_2 + storage_dead(vec_2) + return +} + + + diff --git a/charon/tests/ui/issue-393-shallowinitbox.rs b/charon/tests/ui/issue-393-shallowinitbox.rs index aa8278a28..712a45d2f 100644 --- a/charon/tests/ui/issue-393-shallowinitbox.rs +++ b/charon/tests/ui/issue-393-shallowinitbox.rs @@ -1,4 +1,3 @@ -//@ known-failure pub fn next(b: bool) -> Option> { let vec = vec![if b { 42 } else { return None }]; Some(vec) diff --git a/charon/tests/ui/iterator.out b/charon/tests/ui/iterator.out index 9044675fd..0035455ae 100644 --- a/charon/tests/ui/iterator.out +++ b/charon/tests/ui/iterator.out @@ -422,6 +422,7 @@ pub trait Eq { parent_clause0 : [@TraitClause0]: 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 } @@ -561,8 +562,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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Sized, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Try, @TraitClause4_1::parent_clause1::Output = R, @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, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: FnMut, @TraitClause3_1::parent_clause1::Output = B> = rfold[Self, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1, @TraitClause3_1] + fn try_rfold<'_0_1, B, F, R, [@TraitClause0_1]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Sized, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Destruct, [@TraitClause6_1]: Try, @TraitClause4_1::parent_clause1::Output = R, @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, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Destruct, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Destruct, @TraitClause4_1::parent_clause1::Output = B> = rfold[Self, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1, @TraitClause3_1, @TraitClause4_1, @TraitClause5_1] fn rfind<'_0_1, P, [@TraitClause0_1]: Sized

, [@TraitClause1_1]: Sized, [@TraitClause2_1]: for<'_0_2> FnMut, for<'_0_2> @TraitClause2_1::parent_clause1::Output = bool> = rfind<'_0_1, Self, P>[Self, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1] vtable: core::iter::traits::double_ended::DoubleEndedIterator::{vtable} } @@ -587,8 +588,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]: 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<[@TraitClause0_1]: Sized> = core::iter::traits::iterator::Iterator::count[Self, @TraitClause0_1] - fn last<[@TraitClause0_1]: Sized> = core::iter::traits::iterator::Iterator::last[Self, @TraitClause0_1] + fn count<[@TraitClause0_1]: Sized, [@TraitClause1_1]: Destruct, [@TraitClause2_1]: Destruct> = core::iter::traits::iterator::Iterator::count[Self, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1] + fn last<[@TraitClause0_1]: Sized, [@TraitClause1_1]: Destruct, [@TraitClause2_1]: Destruct> = 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<[@TraitClause0_1]: Sized> = core::iter::traits::iterator::Iterator::step_by[Self, @TraitClause0_1] @@ -620,11 +621,11 @@ pub trait Iterator fn partition, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Default, [@TraitClause4_1]: Extend, [@TraitClause5_1]: for<'_0_2> FnMut, for<'_0_2> @TraitClause5_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized

, [@TraitClause2_1]: Sized, [@TraitClause3_1]: DoubleEndedIterator, [@TraitClause4_1]: for<'_0_2> FnMut, T : 'a, Self::Item = &'a mut T, for<'_0_2> @TraitClause4_1::parent_clause1::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, [@TraitClause1_1]: Sized, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Sized, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Try, @TraitClause4_1::parent_clause1::Output = R, @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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Sized, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Destruct, [@TraitClause6_1]: Try, @TraitClause4_1::parent_clause1::Output = R, @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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: FnMut, [@TraitClause4_1]: Try, @TraitClause3_1::parent_clause1::Output = R, @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, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: FnMut, @TraitClause3_1::parent_clause1::Output = B> = core::iter::traits::iterator::Iterator::fold[Self, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1, @TraitClause3_1] - fn reduce, [@TraitClause1_1]: Sized, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Try, [@TraitClause4_1]: Residual<@TraitClause3_1::Residual, Option[Self::parent_clause1]>, [@TraitClause5_1]: FnMut, @TraitClause3_1::Output = Self::Item, @TraitClause5_1::parent_clause1::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, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Destruct, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Destruct, @TraitClause4_1::parent_clause1::Output = B> = core::iter::traits::iterator::Iterator::fold[Self, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1, @TraitClause3_1, @TraitClause4_1, @TraitClause5_1] + fn reduce, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Destruct, [@TraitClause3_1]: FnMut, [@TraitClause4_1]: Destruct, @TraitClause3_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Try, [@TraitClause4_1]: Residual<@TraitClause3_1::Residual, Option[Self::parent_clause1]>, [@TraitClause5_1]: FnMut, [@TraitClause6_1]: Destruct, @TraitClause3_1::Output = Self::Item, @TraitClause5_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized

, [@TraitClause1_1]: Sized, [@TraitClause2_1]: for<'_0_2> FnMut, for<'_0_2> @TraitClause2_1::parent_clause1::Output = bool> = core::iter::traits::iterator::Iterator::find<'_0_1, Self, P>[Self, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1] @@ -1102,6 +1103,7 @@ where [@TraitClause4]: Try, [@TraitClause5]: Residual<@TraitClause4::Residual, Option[{impl Iterator for IntoIter[@TraitClause0]}[@TraitClause0]::parent_clause1]>, [@TraitClause6]: FnMut, + [@TraitClause7]: Destruct, @TraitClause4::Output = T, @TraitClause6::parent_clause1::Output = R, = @@ -1112,8 +1114,10 @@ where [@TraitClause0]: Sized, [@TraitClause1]: Sized, [@TraitClause2]: Sized[@TraitClause0]>, - [@TraitClause3]: FnMut, - @TraitClause3::parent_clause1::Output = T, + [@TraitClause3]: Destruct[@TraitClause0]>, + [@TraitClause4]: FnMut, + [@TraitClause5]: Destruct, + @TraitClause4::parent_clause1::Output = T, = // Full name: core::array::iter::{impl Iterator for IntoIter[@TraitClause0]}::try_for_each @@ -1471,8 +1475,8 @@ where fn try_fold<'_0_1, B, F, R, [@TraitClause0_1]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Sized[@TraitClause0]>, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Try, @TraitClause4_1::parent_clause1::Output = R, @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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: FnMut, [@TraitClause4_1]: Try, @TraitClause3_1::parent_clause1::Output = R, @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, [@TraitClause1_1]: Sized, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::Output = Acc> = {impl Iterator for IntoIter[@TraitClause0]}::fold[@TraitClause0, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1] - fn reduce, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::Output = T> = {impl Iterator for IntoIter[@TraitClause0]}::reduce[@TraitClause0, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1] - fn try_reduce<'_0_1, R, T2, [@TraitClause0_1]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Try, [@TraitClause4_1]: Residual<@TraitClause3_1::Residual, Option[{impl Iterator for IntoIter[@TraitClause0]}[@TraitClause0]::parent_clause1]>, [@TraitClause5_1]: FnMut, @TraitClause3_1::Output = T, @TraitClause5_1::parent_clause1::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, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: Destruct[@TraitClause0]>, [@TraitClause3_1]: FnMut, [@TraitClause4_1]: Destruct, @TraitClause3_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Try, [@TraitClause4_1]: Residual<@TraitClause3_1::Residual, Option[{impl Iterator for IntoIter[@TraitClause0]}[@TraitClause0]::parent_clause1]>, [@TraitClause5_1]: FnMut, [@TraitClause6_1]: Destruct, @TraitClause3_1::Output = T, @TraitClause5_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized

, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: for<'_0_2> FnMut, for<'_0_2> @TraitClause2_1::parent_clause1::Output = bool> = {impl Iterator for IntoIter[@TraitClause0]}::find<'_0_1, T, P, N>[@TraitClause0, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1] @@ -1537,11 +1541,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]: Eq, = +// Full name: core::cmp::Eq::assert_fields_are_eq +pub fn assert_fields_are_eq<'_0, Self>(_1: &'_0 Self) +where + [@TraitClause0]: Eq, += + #[lang_item("ord_cmp_method")] pub fn core::cmp::Ord::cmp<'_0, '_1, Self>(_1: &'_0 Self, _2: &'_1 Self) -> Ordering where @@ -1742,9 +1753,10 @@ where [@TraitClause3]: Sized, [@TraitClause4]: Sized, [@TraitClause5]: FnMut, - [@TraitClause6]: Try, + [@TraitClause6]: Destruct, + [@TraitClause7]: Try, @TraitClause5::parent_clause1::Output = R, - @TraitClause6::Output = B, + @TraitClause7::Output = B, = // Full name: core::iter::traits::double_ended::DoubleEndedIterator::rfold @@ -1754,8 +1766,10 @@ where [@TraitClause1]: Sized, [@TraitClause2]: Sized, [@TraitClause3]: Sized, - [@TraitClause4]: FnMut, - @TraitClause4::parent_clause1::Output = B, + [@TraitClause4]: Destruct, + [@TraitClause5]: FnMut, + [@TraitClause6]: Destruct, + @TraitClause5::parent_clause1::Output = B, = // Full name: core::iter::traits::double_ended::DoubleEndedIterator::rfind @@ -1801,12 +1815,16 @@ pub fn core::iter::traits::iterator::Iterator::count(_1: Self) -> usize where [@TraitClause0]: Iterator, [@TraitClause1]: Sized, + [@TraitClause2]: Destruct, + [@TraitClause3]: Destruct<@TraitClause0::Item>, = pub fn core::iter::traits::iterator::Iterator::last(_1: Self) -> Option<@TraitClause0::Item>[@TraitClause0::parent_clause1] where [@TraitClause0]: Iterator, [@TraitClause1]: Sized, + [@TraitClause2]: Destruct, + [@TraitClause3]: Destruct<@TraitClause0::Item>, = 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}]}] @@ -2080,9 +2098,10 @@ where [@TraitClause3]: Sized, [@TraitClause4]: Sized, [@TraitClause5]: FnMut, - [@TraitClause6]: Try, + [@TraitClause6]: Destruct, + [@TraitClause7]: Try, @TraitClause5::parent_clause1::Output = R, - @TraitClause6::Output = B, + @TraitClause7::Output = B, = pub fn core::iter::traits::iterator::Iterator::try_for_each<'_0, Self, F, R>(_1: &'_0 mut Self, _2: F) -> R @@ -2103,8 +2122,10 @@ where [@TraitClause1]: Sized, [@TraitClause2]: Sized, [@TraitClause3]: Sized, - [@TraitClause4]: FnMut, - @TraitClause4::parent_clause1::Output = B, + [@TraitClause4]: Destruct, + [@TraitClause5]: FnMut, + [@TraitClause6]: Destruct, + @TraitClause5::parent_clause1::Output = B, = pub fn core::iter::traits::iterator::Iterator::reduce(_1: Self, _2: F) -> Option<@TraitClause0::Item>[@TraitClause0::parent_clause1] @@ -2112,8 +2133,10 @@ where [@TraitClause0]: Iterator, [@TraitClause1]: Sized, [@TraitClause2]: Sized, - [@TraitClause3]: FnMut, - @TraitClause3::parent_clause1::Output = @TraitClause0::Item, + [@TraitClause3]: Destruct, + [@TraitClause4]: FnMut, + [@TraitClause5]: Destruct, + @TraitClause4::parent_clause1::Output = @TraitClause0::Item, = pub fn core::iter::traits::iterator::Iterator::try_reduce<'_0, Self, R, T2>(_1: &'_0 mut Self, _2: T2) -> @TraitClause5::TryType @@ -2125,6 +2148,7 @@ where [@TraitClause4]: Try, [@TraitClause5]: Residual<@TraitClause4::Residual, Option<@TraitClause0::Item>[@TraitClause0::parent_clause1]>, [@TraitClause6]: FnMut, + [@TraitClause7]: Destruct, @TraitClause4::Output = @TraitClause0::Item, @TraitClause6::parent_clause1::Output = R, = @@ -2965,6 +2989,7 @@ where [@TraitClause4]: Try, [@TraitClause5]: Residual<@TraitClause4::Residual, Option<&'a T>[{impl Iterator for Iter<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::parent_clause1]>, [@TraitClause6]: FnMut, + [@TraitClause7]: Destruct, @TraitClause4::Output = &'a T, @TraitClause6::parent_clause1::Output = R, = @@ -2975,8 +3000,10 @@ where [@TraitClause0]: Sized, [@TraitClause1]: Sized, [@TraitClause2]: Sized[@TraitClause0]>, - [@TraitClause3]: FnMut, - @TraitClause3::parent_clause1::Output = &'a T, + [@TraitClause3]: Destruct[@TraitClause0]>, + [@TraitClause4]: FnMut, + [@TraitClause5]: Destruct, + @TraitClause4::parent_clause1::Output = &'a T, = // Full name: core::slice::iter::{impl Iterator for Iter<'a, T>[@TraitClause0]}::try_for_each @@ -3001,9 +3028,10 @@ where [@TraitClause3]: Sized, [@TraitClause4]: Sized[@TraitClause0]>, [@TraitClause5]: FnMut, - [@TraitClause6]: Try, + [@TraitClause6]: Destruct, + [@TraitClause7]: Try, @TraitClause5::parent_clause1::Output = R, - @TraitClause6::Output = B, + @TraitClause7::Output = B, = // Full name: core::slice::iter::{impl Iterator for Iter<'a, T>[@TraitClause0]}::is_partitioned @@ -3322,11 +3350,11 @@ where fn partition, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Default, [@TraitClause4_1]: Extend, [@TraitClause5_1]: for<'_0_2> FnMut, for<'_0_2> @TraitClause5_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized

, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: DoubleEndedIterator[@TraitClause0]>, [@TraitClause4_1]: for<'_0_2> FnMut, T : 'a, {impl Iterator for Iter<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::Item = &'a mut T, for<'_0_2> @TraitClause4_1::parent_clause1::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, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Sized[@TraitClause0]>, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Try, @TraitClause4_1::parent_clause1::Output = R, @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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Sized[@TraitClause0]>, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Destruct, [@TraitClause6_1]: Try, @TraitClause4_1::parent_clause1::Output = R, @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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: FnMut, [@TraitClause4_1]: Try, @TraitClause3_1::parent_clause1::Output = R, @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, [@TraitClause1_1]: Sized, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::Output = B> = {impl Iterator for Iter<'a, T>[@TraitClause0]}::fold<'a, T, B, F>[@TraitClause0, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1] - fn reduce, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Try, [@TraitClause4_1]: Residual<@TraitClause3_1::Residual, Option<&'a T>[{impl Iterator for Iter<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::parent_clause1]>, [@TraitClause5_1]: FnMut, @TraitClause3_1::Output = &'a T, @TraitClause5_1::parent_clause1::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, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: Destruct[@TraitClause0]>, [@TraitClause3_1]: FnMut, [@TraitClause4_1]: Destruct, @TraitClause3_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Try, [@TraitClause4_1]: Residual<@TraitClause3_1::Residual, Option<&'a T>[{impl Iterator for Iter<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::parent_clause1]>, [@TraitClause5_1]: FnMut, [@TraitClause6_1]: Destruct, @TraitClause3_1::Output = &'a T, @TraitClause5_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized

, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: for<'_0_2> FnMut, for<'_0_2> @TraitClause2_1::parent_clause1::Output = bool> = {impl Iterator for Iter<'a, T>[@TraitClause0]}::find<'a, '_0_1, T, P>[@TraitClause0, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1] @@ -3787,6 +3815,7 @@ where [@TraitClause4]: Try, [@TraitClause5]: Residual<@TraitClause4::Residual, Option<&'a [T]>[{impl Iterator for Chunks<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::parent_clause1]>, [@TraitClause6]: FnMut, + [@TraitClause7]: Destruct, @TraitClause4::Output = &'a [T], @TraitClause6::parent_clause1::Output = R, = @@ -3797,8 +3826,10 @@ where [@TraitClause0]: Sized, [@TraitClause1]: Sized, [@TraitClause2]: Sized[@TraitClause0]>, - [@TraitClause3]: FnMut, - @TraitClause3::parent_clause1::Output = &'a [T], + [@TraitClause3]: Destruct[@TraitClause0]>, + [@TraitClause4]: FnMut, + [@TraitClause5]: Destruct, + @TraitClause4::parent_clause1::Output = &'a [T], = // Full name: core::slice::iter::{impl Iterator for Chunks<'a, T>[@TraitClause0]}::fold @@ -3808,8 +3839,10 @@ where [@TraitClause1]: Sized, [@TraitClause2]: Sized, [@TraitClause3]: Sized[@TraitClause0]>, - [@TraitClause4]: FnMut, - @TraitClause4::parent_clause1::Output = B, + [@TraitClause4]: Destruct[@TraitClause0]>, + [@TraitClause5]: FnMut, + [@TraitClause6]: Destruct, + @TraitClause5::parent_clause1::Output = B, = // Full name: core::slice::iter::{impl Iterator for Chunks<'a, T>[@TraitClause0]}::try_for_each @@ -3834,9 +3867,10 @@ where [@TraitClause3]: Sized, [@TraitClause4]: Sized[@TraitClause0]>, [@TraitClause5]: FnMut, - [@TraitClause6]: Try, + [@TraitClause6]: Destruct, + [@TraitClause7]: Try, @TraitClause5::parent_clause1::Output = R, - @TraitClause6::Output = B, + @TraitClause7::Output = B, = // Full name: core::slice::iter::{impl Iterator for Chunks<'a, T>[@TraitClause0]}::is_partitioned @@ -4178,11 +4212,11 @@ where fn partition, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Default, [@TraitClause4_1]: Extend, [@TraitClause5_1]: for<'_0_2> FnMut, for<'_0_2> @TraitClause5_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized

, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: DoubleEndedIterator[@TraitClause0]>, [@TraitClause4_1]: for<'_0_2> FnMut, T : 'a, {impl Iterator for Chunks<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::Item = &'a mut T, for<'_0_2> @TraitClause4_1::parent_clause1::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, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Sized[@TraitClause0]>, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Try, @TraitClause4_1::parent_clause1::Output = R, @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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Sized[@TraitClause0]>, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Destruct, [@TraitClause6_1]: Try, @TraitClause4_1::parent_clause1::Output = R, @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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: FnMut, [@TraitClause4_1]: Try, @TraitClause3_1::parent_clause1::Output = R, @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, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: FnMut, @TraitClause3_1::parent_clause1::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, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Try, [@TraitClause4_1]: Residual<@TraitClause3_1::Residual, Option<&'a [T]>[{impl Iterator for Chunks<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::parent_clause1]>, [@TraitClause5_1]: FnMut, @TraitClause3_1::Output = &'a [T], @TraitClause5_1::parent_clause1::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, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Destruct[@TraitClause0]>, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Destruct, @TraitClause4_1::parent_clause1::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, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: Destruct[@TraitClause0]>, [@TraitClause3_1]: FnMut, [@TraitClause4_1]: Destruct, @TraitClause3_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Try, [@TraitClause4_1]: Residual<@TraitClause3_1::Residual, Option<&'a [T]>[{impl Iterator for Chunks<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::parent_clause1]>, [@TraitClause5_1]: FnMut, [@TraitClause6_1]: Destruct, @TraitClause3_1::Output = &'a [T], @TraitClause5_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized

, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: for<'_0_2> FnMut, for<'_0_2> @TraitClause2_1::parent_clause1::Output = bool> = {impl Iterator for Chunks<'a, T>[@TraitClause0]}::find<'a, '_0_1, T, P>[@TraitClause0, @TraitClause0_1, @TraitClause1_1, @TraitClause2_1] @@ -4643,6 +4677,7 @@ where [@TraitClause4]: Try, [@TraitClause5]: Residual<@TraitClause4::Residual, Option<&'a [T]>[{impl Iterator for ChunksExact<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::parent_clause1]>, [@TraitClause6]: FnMut, + [@TraitClause7]: Destruct, @TraitClause4::Output = &'a [T], @TraitClause6::parent_clause1::Output = R, = @@ -4653,8 +4688,10 @@ where [@TraitClause0]: Sized, [@TraitClause1]: Sized, [@TraitClause2]: Sized[@TraitClause0]>, - [@TraitClause3]: FnMut, - @TraitClause3::parent_clause1::Output = &'a [T], + [@TraitClause3]: Destruct[@TraitClause0]>, + [@TraitClause4]: FnMut, + [@TraitClause5]: Destruct, + @TraitClause4::parent_clause1::Output = &'a [T], = // Full name: core::slice::iter::{impl Iterator for ChunksExact<'a, T>[@TraitClause0]}::fold @@ -4664,8 +4701,10 @@ where [@TraitClause1]: Sized, [@TraitClause2]: Sized, [@TraitClause3]: Sized[@TraitClause0]>, - [@TraitClause4]: FnMut, - @TraitClause4::parent_clause1::Output = B, + [@TraitClause4]: Destruct[@TraitClause0]>, + [@TraitClause5]: FnMut, + [@TraitClause6]: Destruct, + @TraitClause5::parent_clause1::Output = B, = // Full name: core::slice::iter::{impl Iterator for ChunksExact<'a, T>[@TraitClause0]}::try_for_each @@ -4690,9 +4729,10 @@ where [@TraitClause3]: Sized, [@TraitClause4]: Sized[@TraitClause0]>, [@TraitClause5]: FnMut, - [@TraitClause6]: Try, + [@TraitClause6]: Destruct, + [@TraitClause7]: Try, @TraitClause5::parent_clause1::Output = R, - @TraitClause6::Output = B, + @TraitClause7::Output = B, = // Full name: core::slice::iter::{impl Iterator for ChunksExact<'a, T>[@TraitClause0]}::is_partitioned @@ -5034,11 +5074,11 @@ where fn partition, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Default, [@TraitClause4_1]: Extend, [@TraitClause5_1]: for<'_0_2> FnMut, for<'_0_2> @TraitClause5_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized

, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: DoubleEndedIterator[@TraitClause0]>, [@TraitClause4_1]: for<'_0_2> FnMut, T : 'a, {impl Iterator for ChunksExact<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::Item = &'a mut T, for<'_0_2> @TraitClause4_1::parent_clause1::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, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Sized[@TraitClause0]>, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Try, @TraitClause4_1::parent_clause1::Output = R, @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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized, [@TraitClause3_1]: Sized[@TraitClause0]>, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Destruct, [@TraitClause6_1]: Try, @TraitClause4_1::parent_clause1::Output = R, @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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: FnMut, [@TraitClause4_1]: Try, @TraitClause3_1::parent_clause1::Output = R, @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, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: FnMut, @TraitClause3_1::parent_clause1::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, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Try, [@TraitClause4_1]: Residual<@TraitClause3_1::Residual, Option<&'a [T]>[{impl Iterator for ChunksExact<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::parent_clause1]>, [@TraitClause5_1]: FnMut, @TraitClause3_1::Output = &'a [T], @TraitClause5_1::parent_clause1::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, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Destruct[@TraitClause0]>, [@TraitClause4_1]: FnMut, [@TraitClause5_1]: Destruct, @TraitClause4_1::parent_clause1::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, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: Destruct[@TraitClause0]>, [@TraitClause3_1]: FnMut, [@TraitClause4_1]: Destruct, @TraitClause3_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized, [@TraitClause2_1]: Sized[@TraitClause0]>, [@TraitClause3_1]: Try, [@TraitClause4_1]: Residual<@TraitClause3_1::Residual, Option<&'a [T]>[{impl Iterator for ChunksExact<'a, T>[@TraitClause0]}<'a, T>[@TraitClause0]::parent_clause1]>, [@TraitClause5_1]: FnMut, [@TraitClause6_1]: Destruct, @TraitClause3_1::Output = &'a [T], @TraitClause5_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: FnMut, @TraitClause2_1::parent_clause1::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]: Sized

, [@TraitClause1_1]: Sized[@TraitClause0]>, [@TraitClause2_1]: for<'_0_2> FnMut, for<'_0_2> @TraitClause2_1::parent_clause1::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/monomorphization/dyn-trait.out b/charon/tests/ui/monomorphization/dyn-trait.out index d2a48aef3..a1c798c0f 100644 --- a/charon/tests/ui/monomorphization/dyn-trait.out +++ b/charon/tests/ui/monomorphization/dyn-trait.out @@ -3,7 +3,7 @@ thread 'rustc' panicked at src/bin/charon-driver/translate/translate_trait_objec Could not determine method index for drop in vtable note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: Thread panicked when extracting item `core::fmt::Display`. - --> /rustc/library/core/src/fmt/mod.rs:1186:1 + --> /rustc/library/core/src/fmt/mod.rs:1187:1 note: the error occurred when translating `core::fmt::Display::{vtable_drop_preshim}`, which is (transitively) used at the following location(s): --> tests/ui/monomorphization/dyn-trait.rs:12:27 @@ -14,7 +14,7 @@ note: the error occurred when translating `core::fmt::Display::{vtable_drop_pres thread 'rustc' panicked at src/bin/charon-driver/translate/translate_trait_objects.rs:1584:13: Could not determine method index for method_fmt in vtable error: Thread panicked when extracting item `core::fmt::Display`. - --> /rustc/library/core/src/fmt/mod.rs:1186:1 + --> /rustc/library/core/src/fmt/mod.rs:1187:1 note: the error occurred when translating `core::fmt::Display::fmt::{vtable_method_preshim}`, which is (transitively) used at the following location(s): --> tests/ui/monomorphization/dyn-trait.rs:12:27 diff --git a/charon/tests/ui/ptr-offset.out b/charon/tests/ui/ptr-offset.out index 82086a9b5..6f3c0df30 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 4d6fd1a06..33b029b7d 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, } @@ -249,7 +249,7 @@ where undefined_behavior } -fn core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(_1: usize) +fn core::mem::alignment::{Alignment}::new_unchecked::precondition_check(_1: usize) { let _0: (); // return let align_1: usize; // arg #1 @@ -348,7 +348,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) @@ -615,501 +615,199 @@ where Break(B), } -// Full name: core::option::Option -#[lang_item("Option")] -pub enum Option +// Full name: core::intrinsics::write_bytes +pub unsafe fn write_bytes(_1: *mut T, _2: u8, _3: usize) where [@TraitClause0]: Sized, { - None, - Some(T), + let _0: (); // return + let dst_1: *mut T; // arg #1 + let val_2: u8; // arg #2 + let count_3: usize; // arg #3 + + _0 = () + undefined_behavior +} + +// Full name: core::convert::Infallible +pub enum Infallible { } -pub fn core::ptr::alignment::{Alignment}::new(_1: usize) -> Option[{built_in impl Sized for Alignment}] +pub fn core::alloc::Allocator::allocate_zeroed<'_0, Self>(_1: &'_0 Self, _2: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +where + [@TraitClause0]: Allocator, { - 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 + 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(_4) + storage_live(_5) + storage_live(ptr_6) + storage_live(_7) + storage_live(self_9) + storage_live(_13) + storage_live(_16) storage_live(_3) - _3 = ctpop[{built_in impl Sized for usize}, {impl Copy for usize}](copy align_1) - switch copy _3 { - 1 : u32 => { + 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) - storage_live(_6) - _6 = Option::None { } - _0 = move _6 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(_2) - storage_live(_5) - _5 = ub_checks - if move _5 { - _4 = core::ptr::alignment::{Alignment}::new_unchecked::precondition_check(copy align_1) + 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 { } - _2 = transmute(copy align_1) - _0 = Option::Some { 0: move _2 } - storage_dead(_2) + _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::option::unwrap_failed -fn unwrap_failed() -> ! -{ - let _0: !; // return - - panic(core::panicking::panic) -} - -// Full name: core::option::{Option[@TraitClause0]}::unwrap -#[lang_item("option_unwrap")] -pub fn unwrap(_1: Option[@TraitClause0]) -> T +pub unsafe fn core::alloc::Allocator::deallocate<'_0, Self>(_1: &'_0 Self, _2: NonNull, _3: Layout) where - [@TraitClause0]: Sized, -{ - let val_0: T; // return - let self_1: Option[@TraitClause0]; // arg #1 - let _2: !; // anonymous local - - storage_live(_2) - match self_1 { - Option::None => { - }, - Option::Some => { - val_0 = move (self_1 as variant Option::Some).0 - return - }, - } - _2 = unwrap_failed() -} + [@TraitClause0]: Allocator, += -pub fn core::num::{usize}::MAX() -> usize +// Full name: core::fmt::{Arguments<'a>}::from_str +pub fn from_str<'a>(_1: &'static Str) -> Arguments<'a> { - let _0: usize; // 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 = ~(const 0 : usize) + 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 } -pub const core::num::{usize}::MAX: usize = core::num::{usize}::MAX() - -pub fn core::num::{isize}::MAX() -> isize +// Full name: core::panicking::panic_nounwind +#[lang_item("panic_nounwind")] +pub fn panic_nounwind(_1: &'static Str) -> ! { - let _0: isize; // return - let _1: usize; // anonymous local - let _2: u32; // anonymous local - let _3: bool; // anonymous local + 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(_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 -pub trait SizedTypeProperties -{ - parent_clause0 : [@TraitClause0]: Sized - const SIZE : usize - const ALIGN : usize - const ALIGNMENT : Alignment - const IS_ZST : bool - const LAYOUT : Layout - const MAX_SLICE_LEN : usize - non-dyn-compatible + 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::MAX_SLICE_LEN -pub fn MAX_SLICE_LEN() -> usize +// Full name: core::option::Option +#[lang_item("Option")] +pub enum Option where - [@TraitClause0]: SizedTypeProperties, + [@TraitClause0]: Sized, { - 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 + None, + Some(T), } -// Full name: core::mem::SizedTypeProperties::MAX_SLICE_LEN -pub const MAX_SLICE_LEN: usize -where - [@TraitClause0]: SizedTypeProperties, - = MAX_SLICE_LEN() - -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub fn LAYOUT() -> Layout -where - [@TraitClause0]: SizedTypeProperties, +// Full name: core::intrinsics::cold_path +pub fn cold_path() { - let _0: Layout; // return + let _0: (); // return - _0 = from_size_align_unchecked(const @TraitClause0::SIZE, const @TraitClause0::ALIGN) - return -} - -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub const LAYOUT: Layout -where - [@TraitClause0]: SizedTypeProperties, - = LAYOUT() - -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub fn IS_ZST() -> bool -where - [@TraitClause0]: SizedTypeProperties, -{ - let _0: bool; // return - - _0 = const @TraitClause0::SIZE == const 0 : usize - return -} - -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub const IS_ZST: bool -where - [@TraitClause0]: SizedTypeProperties, - = IS_ZST() - -pub fn core::intrinsics::align_of() -> usize -where - [@TraitClause0]: Sized, -{ - let _0: usize; // return - - undefined_behavior -} - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub fn ALIGN() -> usize -where - [@TraitClause0]: SizedTypeProperties, -{ - let _0: usize; // return - - _0 = core::intrinsics::align_of[@TraitClause0::parent_clause0]() - return -} - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub const ALIGN: usize -where - [@TraitClause0]: SizedTypeProperties, - = ALIGN() - -// Full name: core::intrinsics::size_of -pub fn size_of() -> usize -where - [@TraitClause0]: Sized, -{ - let _0: usize; // return - - undefined_behavior -} - -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub fn SIZE() -> usize -where - [@TraitClause0]: SizedTypeProperties, -{ - let _0: usize; // return - - _0 = size_of[@TraitClause0::parent_clause0]() - return -} - -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub const SIZE: usize -where - [@TraitClause0]: SizedTypeProperties, - = SIZE() - -#[lang_item("mem_align_of")] -pub fn core::mem::align_of() -> usize -where - [@TraitClause0]: Sized, -{ - let _0: usize; // return - - _0 = const {impl SizedTypeProperties for T}[@TraitClause0]::ALIGN - return -} - -// Full name: core::mem::SizedTypeProperties::ALIGNMENT -pub fn ALIGNMENT() -> Alignment -where - [@TraitClause0]: SizedTypeProperties, -{ - let _0: Alignment; // return - - _0 = of[@TraitClause0::parent_clause0]() - return -} - -// Full name: core::mem::SizedTypeProperties::ALIGNMENT -pub const ALIGNMENT: Alignment -where - [@TraitClause0]: SizedTypeProperties, - = ALIGNMENT() - -// Full name: core::mem::{impl SizedTypeProperties for T} -impl SizedTypeProperties for T -where - [@TraitClause0]: Sized, -{ - parent_clause0 = @TraitClause0 - const SIZE = SIZE[{impl SizedTypeProperties for T}[@TraitClause0]] - const ALIGN = ALIGN[{impl SizedTypeProperties for T}[@TraitClause0]] - const ALIGNMENT = ALIGNMENT[{impl SizedTypeProperties for T}[@TraitClause0]] - const IS_ZST = IS_ZST[{impl SizedTypeProperties for T}[@TraitClause0]] - const LAYOUT = LAYOUT[{impl SizedTypeProperties for T}[@TraitClause0]] - const MAX_SLICE_LEN = MAX_SLICE_LEN[{impl SizedTypeProperties for T}[@TraitClause0]] - non-dyn-compatible -} - -// Full name: core::ptr::alignment::{Alignment}::of -pub fn of() -> Alignment -where - [@TraitClause0]: Sized, -{ - let _0: Alignment; // return - let _1: Alignment; // anonymous local - let _2: Option[{built_in impl Sized for Alignment}]; // anonymous local - let _3: usize; // anonymous local - - storage_live(_1) - storage_live(_2) - storage_live(_3) - _3 = core::mem::align_of[@TraitClause0]() - _2 = core::ptr::alignment::{Alignment}::new(move _3) - storage_dead(_3) - _1 = unwrap[{built_in impl Sized for Alignment}](move _2) - storage_dead(_2) - _0 = move _1 - return -} - -// Full name: core::intrinsics::write_bytes -pub unsafe fn write_bytes(_1: *mut T, _2: u8, _3: usize) -where - [@TraitClause0]: Sized, -{ - let _0: (); // return - let dst_1: *mut T; // arg #1 - let val_2: u8; // arg #2 - let count_3: usize; // arg #3 - - _0 = () - undefined_behavior -} - -// Full name: core::convert::Infallible -pub enum Infallible { -} - -pub fn core::alloc::Allocator::allocate_zeroed<'_0, Self>(_1: &'_0 Self, _2: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] -where - [@TraitClause0]: 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 ptr_5: NonNull<[u8]>; // local - let _6: (); // anonymous local - let self_7: *mut u8; // local - let self_8: NonNull; // local - let count_9: usize; // local - let v_10: NonNull<[u8]>; // local - let _11: *const u8; // anonymous local - let _12: *mut [u8]; // anonymous local - let _13: (); // anonymous local - let _14: *const (); // anonymous local - let _15: bool; // anonymous local - let _16: bool; // anonymous local - let _17: AllocError; // anonymous local - let _18: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - - storage_live(ptr_5) - storage_live(_6) - storage_live(_12) - storage_live(_13) - storage_live(_3) - storage_live(self_4) - self_4 = @TraitClause0::allocate<'3>(move self_1, move layout_2) - storage_live(v_10) - match self_4 { - Result::Ok => { - }, - Result::Err => { - storage_dead(v_10) - storage_dead(self_4) - storage_live(_17) - _17 = AllocError { } - storage_live(_18) - _18 = Result::Err { 0: move _17 } - _0 = move _18 - storage_dead(_3) - return - }, - } - v_10 = move (self_4 as variant Result::Ok).0 - _3 = ControlFlow::Continue { 0: copy v_10 } - storage_dead(v_10) - storage_dead(self_4) - ptr_5 = copy (_3 as variant ControlFlow::Continue).0 - storage_dead(_3) - storage_live(self_7) - storage_live(self_8) - storage_live(_11) - _12 = transmute, *mut [u8]>(copy ptr_5) - _11 = cast<*mut [u8], *const u8>(copy _12) - self_8 = NonNull { pointer: copy _11 } - storage_dead(_11) - self_7 = cast<*mut [u8], *mut u8>(copy _12) - storage_dead(self_8) - storage_live(count_9) - count_9 = copy _12.metadata - storage_live(_16) - _16 = ub_checks - if move _16 { - storage_live(_14) - _14 = cast<*mut [u8], *const ()>(copy _12) - storage_live(_15) - _15 = copy count_9 == const 0 : usize - _13 = core::ptr::write_bytes::precondition_check(move _14, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, move _15) - storage_dead(_15) - storage_dead(_14) - } else { - } - _6 = write_bytes[{built_in impl Sized for u8}](move self_7, const 0 : u8, move count_9) - storage_dead(count_9) - storage_dead(self_7) - _0 = Result::Ok { 0: copy ptr_5 } - return -} - -pub unsafe fn core::alloc::Allocator::deallocate<'_0, Self>(_1: &'_0 Self, _2: NonNull, _3: Layout) -where - [@TraitClause0]: Allocator, -= - -// Full name: core::fmt::{Arguments<'a>}::from_str -pub fn from_str<'a>(_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(_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() -{ - let _0: (); // return - - _0 = () + _0 = () return } @@ -1391,281 +1089,622 @@ where 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 new_ptr_7: NonNull<[u8]>; // local - let src_8: *const u8; // local - let dst_9: *mut u8; // local - let count_10: usize; // local - let _11: (); // anonymous local - let v_12: NonNull<[u8]>; // local - let _13: *mut [u8]; // anonymous local - let _14: (); // anonymous local - let _15: *const (); // anonymous local - let _16: *mut (); // anonymous local - let _17: bool; // anonymous local - let _18: AllocError; // anonymous local - let _19: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - - storage_live(new_ptr_7) - storage_live(_11) - storage_live(_13) - storage_live(_14) + 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_12) + storage_live(v_13) match self_6 { Result::Ok => { }, Result::Err => { - storage_dead(v_12) + storage_dead(v_13) storage_dead(self_6) - storage_live(_18) - _18 = AllocError { } - storage_live(_19) - _19 = Result::Err { 0: move _18 } - _0 = move _19 + 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_12 = move (self_6 as variant Result::Ok).0 - _5 = ControlFlow::Continue { 0: copy v_12 } - storage_dead(v_12) + 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_7 = copy (_5 as variant ControlFlow::Continue).0 + new_ptr_8 = copy (_5 as variant ControlFlow::Continue).0 storage_dead(_5) - storage_live(src_8) - src_8 = transmute, *const u8>(copy ptr_2) - storage_live(dst_9) - _13 = transmute, *mut [u8]>(copy new_ptr_7) - dst_9 = cast<*mut [u8], *mut u8>(copy _13) - storage_live(count_10) - count_10 = copy (old_layout_3).size + storage_live(src_9) + src_9 = transmute, *const u8>(copy ptr_2) + storage_live(dst_10) storage_live(_17) - _17 = ub_checks - if move _17 { - storage_live(_15) - _15 = transmute, *const ()>(copy ptr_2) - storage_live(_16) - _16 = cast<*mut [u8], *mut ()>(copy _13) - _14 = core::ptr::copy_nonoverlapping::precondition_check(move _15, move _16, 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_10) - storage_dead(_16) - storage_dead(_15) + 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_8, copy dst_9, copy count_10) - storage_dead(count_10) - storage_dead(dst_9) - storage_dead(src_8) - _11 = @TraitClause0::deallocate<'11>(move self_1, move ptr_2, move old_layout_3) - _0 = Result::Ok { 0: copy new_ptr_7 } + 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>(_1: &'_0 Self, _2: NonNull, _3: Layout, _4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +where + [@TraitClause0]: 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) + _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::shrink<'_0, Self>(_1: &'_0 Self, _2: NonNull, _3: Layout, _4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +where + [@TraitClause0]: 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, 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(_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 (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) + 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 fn core::alloc::Allocator::by_ref<'_0, Self>(_1: &'_0 Self) -> &'_0 Self +where + [@TraitClause0]: Allocator, + [@TraitClause1]: 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]: Clone, += + +pub fn core::clone::Clone::clone_from<'_0, '_1, Self>(_1: &'_0 mut Self, _2: &'_1 Self) +where + [@TraitClause0]: Clone, + [@TraitClause1]: Destruct, +{ + let _0: (); // return + let self_1: &'1 mut Self; // arg #1 + let source_2: &'3 Self; // arg #2 + let _3: Self; // anonymous local + + _0 = () + storage_live(_3) + _3 = @TraitClause0::clone<'5>(move source_2) + drop[@TraitClause1] (*self_1) + (*self_1) = move _3 + storage_dead(_3) return } -pub unsafe fn core::alloc::Allocator::grow_zeroed<'_0, Self>(_1: &'_0 Self, _2: NonNull, _3: Layout, _4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +// Full name: core::intrinsics::size_of +pub fn size_of() -> usize where - [@TraitClause0]: Allocator, + [@TraitClause0]: 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 new_ptr_7: NonNull<[u8]>; // local - let src_8: *const u8; // local - let dst_9: *mut u8; // local - let count_10: usize; // local - let _11: (); // anonymous local - let v_12: NonNull<[u8]>; // local - let _13: *mut [u8]; // anonymous local - let _14: (); // anonymous local - let _15: *const (); // anonymous local - let _16: *mut (); // anonymous local - let _17: bool; // anonymous local - let _18: AllocError; // anonymous local - let _19: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - - storage_live(new_ptr_7) - storage_live(_11) - storage_live(_13) - storage_live(_14) - storage_live(_5) - storage_live(self_6) - self_6 = @TraitClause0::allocate_zeroed<'9>(copy self_1, move new_layout_4) - storage_live(v_12) - match self_6 { - Result::Ok => { + let _0: usize; // return + + undefined_behavior +} + +// Full name: core::intrinsics::align_of +pub fn align_of() -> usize +where + [@TraitClause0]: Sized, +{ + let _0: usize; // return + + undefined_behavior +} + +unsafe fn core::marker::Destruct::drop_in_place(_1: *mut Self) += + +pub fn core::mem::alignment::{Alignment}::new(_1: usize) -> Option[{built_in impl Sized for Alignment}] +{ + let _0: Option[{built_in impl Sized for Alignment}]; // return + let align_1: usize; // arg #1 + let _2: Alignment; // anonymous local + let _3: u32; // anonymous local + let _4: (); // anonymous local + let _5: bool; // anonymous local + let _6: Option[{built_in impl Sized for Alignment}]; // anonymous local + + storage_live(_4) + storage_live(_3) + _3 = ctpop[{built_in impl Sized for usize}, {impl Copy for usize}](copy align_1) + switch copy _3 { + 1 : u32 => { }, - Result::Err => { - storage_dead(v_12) - storage_dead(self_6) - storage_live(_18) - _18 = AllocError { } - storage_live(_19) - _19 = Result::Err { 0: move _18 } - _0 = move _19 - storage_dead(_5) + _ => { + storage_dead(_3) + storage_live(_6) + _6 = Option::None { } + _0 = move _6 return }, } - v_12 = move (self_6 as variant Result::Ok).0 - _5 = ControlFlow::Continue { 0: copy v_12 } - storage_dead(v_12) - storage_dead(self_6) - new_ptr_7 = copy (_5 as variant ControlFlow::Continue).0 - storage_dead(_5) - storage_live(src_8) - src_8 = transmute, *const u8>(copy ptr_2) - storage_live(dst_9) - _13 = transmute, *mut [u8]>(copy new_ptr_7) - dst_9 = cast<*mut [u8], *mut u8>(copy _13) - storage_live(count_10) - count_10 = copy (old_layout_3).size - storage_live(_17) - _17 = ub_checks - if move _17 { - storage_live(_15) - _15 = transmute, *const ()>(copy ptr_2) - storage_live(_16) - _16 = cast<*mut [u8], *mut ()>(copy _13) - _14 = core::ptr::copy_nonoverlapping::precondition_check(move _15, move _16, 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_10) - storage_dead(_16) - storage_dead(_15) + 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 { } - copy_nonoverlapping(copy src_8, copy dst_9, copy count_10) - storage_dead(count_10) - storage_dead(dst_9) - storage_dead(src_8) - _11 = @TraitClause0::deallocate<'11>(move self_1, move ptr_2, move old_layout_3) - _0 = Result::Ok { 0: copy new_ptr_7 } + _2 = transmute(copy align_1) + _0 = Option::Some { 0: move _2 } + storage_dead(_2) return } -pub unsafe fn core::alloc::Allocator::shrink<'_0, Self>(_1: &'_0 Self, _2: NonNull, _3: Layout, _4: Layout) -> Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}] +// Full name: core::mem::SizedTypeProperties +pub trait SizedTypeProperties +{ + parent_clause0 : [@TraitClause0]: Sized + const SIZE : usize + const ALIGN : usize + const ALIGNMENT : Alignment + const IS_ZST : bool + const LAYOUT : Layout + const MAX_SLICE_LEN : usize + non-dyn-compatible +} + +// Full name: core::mem::SizedTypeProperties::SIZE +#[lang_item("mem_size_const")] +pub fn SIZE() -> usize where - [@TraitClause0]: Allocator, + [@TraitClause0]: 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 new_ptr_7: NonNull<[u8]>; // local - let src_8: *const u8; // local - let dst_9: *mut u8; // local - let count_10: usize; // local - let _11: (); // anonymous local - let v_12: NonNull<[u8]>; // local - let _13: *mut [u8]; // anonymous local - let _14: (); // anonymous local - let _15: *const (); // anonymous local - let _16: *mut (); // anonymous local - let _17: bool; // anonymous local - let _18: AllocError; // anonymous local - let _19: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - - storage_live(new_ptr_7) - storage_live(_11) - storage_live(_13) - storage_live(_14) - storage_live(_5) - storage_live(self_6) - self_6 = @TraitClause0::allocate<'9>(copy self_1, copy new_layout_4) - storage_live(v_12) - match self_6 { - Result::Ok => { + let _0: usize; // return + + _0 = size_of[@TraitClause0::parent_clause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::SIZE +#[lang_item("mem_size_const")] +pub const SIZE: usize +where + [@TraitClause0]: SizedTypeProperties, + = SIZE() + +// Full name: core::mem::SizedTypeProperties::ALIGN +#[lang_item("mem_align_const")] +pub fn ALIGN() -> usize +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: usize; // return + + _0 = align_of[@TraitClause0::parent_clause0]() + return +} + +// Full name: core::mem::SizedTypeProperties::ALIGN +#[lang_item("mem_align_const")] +pub const ALIGN: usize +where + [@TraitClause0]: SizedTypeProperties, + = ALIGN() + +// Full name: core::option::unwrap_failed +fn unwrap_failed() -> ! +{ + let _0: !; // return + + panic(core::panicking::panic) +} + +// Full name: core::option::{Option[@TraitClause0]}::unwrap +#[lang_item("option_unwrap")] +pub fn unwrap(_1: Option[@TraitClause0]) -> T +where + [@TraitClause0]: Sized, +{ + let val_0: T; // return + let self_1: Option[@TraitClause0]; // arg #1 + let _2: !; // anonymous local + + storage_live(_2) + match self_1 { + Option::None => { }, - Result::Err => { - storage_dead(v_12) - storage_dead(self_6) - storage_live(_18) - _18 = AllocError { } - storage_live(_19) - _19 = Result::Err { 0: move _18 } - _0 = move _19 - storage_dead(_5) + Option::Some => { + val_0 = move (self_1 as variant Option::Some).0 return }, } - v_12 = move (self_6 as variant Result::Ok).0 - _5 = ControlFlow::Continue { 0: copy v_12 } - storage_dead(v_12) - storage_dead(self_6) - new_ptr_7 = copy (_5 as variant ControlFlow::Continue).0 - storage_dead(_5) - storage_live(src_8) - src_8 = transmute, *const u8>(copy ptr_2) - storage_live(dst_9) - _13 = transmute, *mut [u8]>(copy new_ptr_7) - dst_9 = cast<*mut [u8], *mut u8>(copy _13) - storage_live(count_10) - count_10 = copy (new_layout_4).size - storage_live(_17) - _17 = ub_checks - if move _17 { - storage_live(_15) - _15 = transmute, *const ()>(copy ptr_2) - storage_live(_16) - _16 = cast<*mut [u8], *mut ()>(copy _13) - _14 = core::ptr::copy_nonoverlapping::precondition_check(move _15, move _16, 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_10) - storage_dead(_16) - storage_dead(_15) - } else { - } - copy_nonoverlapping(copy src_8, copy dst_9, copy count_10) - storage_dead(count_10) - storage_dead(dst_9) - storage_dead(src_8) - _11 = @TraitClause0::deallocate<'11>(move self_1, move ptr_2, move old_layout_3) - _0 = Result::Ok { 0: copy new_ptr_7 } + _2 = unwrap_failed() +} + +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub fn ALIGNMENT() -> Alignment +where + [@TraitClause0]: 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 +} + +// Full name: core::mem::SizedTypeProperties::ALIGNMENT +pub const ALIGNMENT: Alignment +where + [@TraitClause0]: SizedTypeProperties, + = ALIGNMENT() + +// Full name: core::mem::SizedTypeProperties::IS_ZST +pub fn IS_ZST() -> bool +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: bool; // return + + _0 = const @TraitClause0::SIZE == const 0 : usize + return +} + +// Full name: core::mem::SizedTypeProperties::IS_ZST +pub const IS_ZST: bool +where + [@TraitClause0]: SizedTypeProperties, + = IS_ZST() + +// Full name: core::mem::SizedTypeProperties::LAYOUT +pub fn LAYOUT() -> Layout +where + [@TraitClause0]: SizedTypeProperties, +{ + let _0: Layout; // return + + _0 = from_size_align_unchecked(const @TraitClause0::SIZE, const @TraitClause0::ALIGN) + return +} + +// Full name: core::mem::SizedTypeProperties::LAYOUT +pub const LAYOUT: Layout +where + [@TraitClause0]: SizedTypeProperties, + = LAYOUT() + +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 fn core::alloc::Allocator::by_ref<'_0, Self>(_1: &'_0 Self) -> &'_0 Self +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]: Allocator, - [@TraitClause1]: Sized, + [@TraitClause0]: SizedTypeProperties, { - let _0: &'1 Self; // return - let self_1: &'2 Self; // arg #1 + 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 - _0 = copy self_1 + 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]: Clone, -= + [@TraitClause0]: SizedTypeProperties, + = MAX_SLICE_LEN() -pub fn core::clone::Clone::clone_from<'_0, '_1, Self>(_1: &'_0 mut Self, _2: &'_1 Self) +// Full name: core::mem::{impl SizedTypeProperties for T} +impl SizedTypeProperties for T where - [@TraitClause0]: Clone, - [@TraitClause1]: Destruct, + [@TraitClause0]: 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] (*self_1) - (*self_1) = move _3 - storage_dead(_3) - return + parent_clause0 = @TraitClause0 + const SIZE = SIZE[{impl SizedTypeProperties for T}[@TraitClause0]] + const ALIGN = ALIGN[{impl SizedTypeProperties for T}[@TraitClause0]] + const ALIGNMENT = ALIGNMENT[{impl SizedTypeProperties for T}[@TraitClause0]] + const IS_ZST = IS_ZST[{impl SizedTypeProperties for T}[@TraitClause0]] + const LAYOUT = LAYOUT[{impl SizedTypeProperties for T}[@TraitClause0]] + const MAX_SLICE_LEN = MAX_SLICE_LEN[{impl SizedTypeProperties for T}[@TraitClause0]] + non-dyn-compatible } -unsafe fn core::marker::Destruct::drop_in_place(_1: *mut Self) -= - // Full name: core::ptr::unique::Unique pub struct Unique { pointer: NonNull, @@ -1787,19 +1826,19 @@ fn core::hint::assert_unchecked::precondition_check(_1: bool) } // Full name: alloc::alloc::__rust_alloc -unsafe fn __rust_alloc(_1: usize, _2: usize) -> *mut u8 +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: usize) +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: usize, _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 -unsafe fn __rust_alloc_zeroed(_1: usize, _2: usize) -> *mut u8 +unsafe fn __rust_alloc_zeroed(_1: usize, _2: Alignment) -> *mut u8 = // Full name: alloc::alloc::__rust_no_alloc_shim_is_unstable_v2 @@ -1823,186 +1862,174 @@ fn alloc_impl_runtime(_1: Layout, _2: bool) -> Result, AllocError> let _7: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull}]; // anonymous local let self_8: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // local let self_9: Option>[{built_in impl Sized for NonNull}]; // local - let ptr_10: NonNull; // local - let _11: NonNull<[u8]>; // anonymous local - let _12: Alignment; // anonymous local - let _13: *const u8; // anonymous local + let _10: Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]; // anonymous local + let ptr_11: NonNull; // local + let _12: NonNull<[u8]>; // anonymous local + let _13: Alignment; // anonymous local let ptr_14: *mut [u8]; // local let data_15: *mut u8; // local let _16: (); // anonymous local let _17: *mut (); // anonymous local - let _18: *const [u8]; // anonymous local - let _19: (); // anonymous local - let _20: usize; // anonymous local + let _18: (); // anonymous local + let _19: Alignment; // anonymous local + let _20: (); // anonymous local let _21: Alignment; // anonymous local - let _22: (); // anonymous local + let _22: NonNull; // anonymous local let _23: usize; // anonymous local - let _24: Alignment; // anonymous local - let _25: NonNull; // anonymous local - let _26: *const u8; // anonymous local - let _27: usize; // anonymous local - let _28: (); // anonymous local - let _29: *mut (); // anonymous local - let v_30: NonNull; // local - let v_31: NonNull; // local - let ptr_32: *mut [u8]; // local - let data_33: *mut u8; // local - let _34: (); // anonymous local - let _35: *mut (); // anonymous local - let _36: *const [u8]; // anonymous local - let _37: bool; // anonymous local - let _38: bool; // anonymous local - let _39: bool; // anonymous local - let _40: Option>[{built_in impl Sized for NonNull}]; // anonymous local - let _41: AllocError; // anonymous local - let _42: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local - let _43: AllocError; // anonymous local - let _44: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // 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(ptr_10) - storage_live(_12) + storage_live(_10) + storage_live(ptr_11) + storage_live(_13) storage_live(_16) - storage_live(_19) - storage_live(_22) - storage_live(_26) - storage_live(_28) - storage_live(_34) + storage_live(_18) + storage_live(_20) + storage_live(_24) + storage_live(_30) size_3 = copy (layout_1).size switch copy size_3 { 0 : usize => { }, _ => { if copy zeroed_2 { - _19 = __rust_no_alloc_shim_is_unstable_v2() - storage_live(_20) + _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 - _20 = transmute(copy _21) + raw_ptr_6 = __rust_alloc(copy size_3, move _21) storage_dead(_21) - raw_ptr_6 = __rust_alloc_zeroed(copy size_3, move _20) - storage_dead(_20) - } else { - _22 = __rust_no_alloc_shim_is_unstable_v2() - storage_live(_23) - storage_live(_24) - _24 = copy (layout_1).align - _23 = transmute(copy _24) - storage_dead(_24) - raw_ptr_6 = __rust_alloc(copy size_3, move _23) - storage_dead(_23) } storage_live(_7) storage_live(self_8) storage_live(self_9) - _26 = cast<*mut u8, *const u8>(copy raw_ptr_6) - storage_live(_27) - _27 = transmute<*mut u8, usize>(copy raw_ptr_6) - switch copy _27 { + storage_live(_23) + _23 = transmute<*mut u8, usize>(copy raw_ptr_6) + switch copy _23 { 0 : usize => { }, _ => { - storage_dead(_27) - storage_live(_25) - storage_live(_38) - _38 = ub_checks - if move _38 { - storage_live(_29) - _29 = cast<*mut u8, *mut ()>(copy raw_ptr_6) - _28 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _29) - storage_dead(_29) + 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 { } - _25 = NonNull { pointer: copy _26 } - self_9 = Option::Some { 0: move _25 } - storage_dead(_25) - storage_live(v_30) - v_30 = move (self_9 as variant Option::Some).0 - self_8 = Result::Ok { 0: copy v_30 } - storage_dead(v_30) + _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_31) - v_31 = move (self_8 as variant Result::Ok).0 - _7 = ControlFlow::Continue { 0: copy v_31 } - storage_dead(v_31) + 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_10 = copy (_7 as variant ControlFlow::Continue).0 + ptr_11 = copy (_7 as variant ControlFlow::Continue).0 storage_dead(_7) - storage_live(_11) - storage_live(ptr_32) - storage_live(data_33) - data_33 = transmute, *mut u8>(copy ptr_10) - ptr_32 = *mut (copy data_33, copy size_3) - storage_dead(data_33) + storage_live(_12) + 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) - storage_live(_39) - _39 = ub_checks - if move _39 { - storage_live(_35) - _35 = transmute, *mut ()>(copy ptr_10) - _34 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _35) - storage_dead(_35) + _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 { } - _36 = cast<*mut [u8], *const [u8]>(copy ptr_32) - _11 = NonNull { pointer: copy _36 } - storage_dead(_36) - storage_dead(ptr_32) - _0 = Result::Ok { 0: move _11 } - storage_dead(_11) + _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(_27) - storage_live(_40) - _40 = Option::None { } - self_9 = move _40 - storage_live(v_30) - storage_live(_41) - _41 = AllocError { } - storage_live(_42) - _42 = Result::Err { 0: move _41 } - self_8 = move _42 - storage_dead(v_30) + 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_31) - storage_dead(v_31) + storage_live(v_27) + storage_dead(v_27) storage_dead(self_8) - storage_live(_43) - _43 = AllocError { } - storage_live(_44) - _44 = Result::Err { 0: move _43 } - _0 = move _44 + 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 }, } storage_live(_4) storage_live(data_5) - _12 = copy (layout_1).align - storage_live(_13) - _13 = transmute(copy _12) - data_5 = NonNull { pointer: copy _13 } - storage_dead(_13) + _13 = copy (layout_1).align + data_5 = transmute>(copy _13) storage_live(ptr_14) storage_live(data_15) - data_15 = transmute(copy _12) + data_15 = transmute(copy _13) ptr_14 = *mut (copy data_15, const 0 : usize) storage_dead(data_15) - storage_live(_18) - storage_live(_37) - _37 = ub_checks - if move _37 { + storage_live(_34) + _34 = ub_checks + if move _34 { storage_live(_17) - _17 = transmute(copy _12) + _17 = transmute(copy _13) _16 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _17) storage_dead(_17) } else { } - _18 = cast<*mut [u8], *const [u8]>(copy ptr_14) - _4 = NonNull { pointer: copy _18 } - storage_dead(_18) + _4 = transmute<*mut [u8], NonNull<[u8]>>(copy ptr_14) storage_dead(ptr_14) storage_dead(data_5) _0 = Result::Ok { 0: move _4 } @@ -2026,10 +2053,10 @@ fn grow_impl_runtime<'_0>(_1: &'_0 Global, _2: NonNull, _3: Layout, _4: Layo 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 _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 @@ -2037,70 +2064,74 @@ fn grow_impl_runtime<'_0>(_1: &'_0 Global, _2: NonNull, _3: Layout, _4: Layo let _21: NonNull<[u8]>; // anonymous local let _22: ControlFlow[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}], NonNull<[u8]>>[{built_in impl Sized for Result[{built_in impl Sized for Infallible}, {built_in impl Sized for AllocError}]}, {built_in impl Sized for NonNull<[u8]>}]; // anonymous local let self_23: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // local - let new_ptr_24: NonNull<[u8]>; // local - let src_25: *const u8; // local - let ptr_26: *mut u8; // local + let _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: *const u8; // anonymous local - let _34: usize; // anonymous local - let _35: (); // anonymous local - let _36: *mut (); // 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 v_38: NonNull; // local - let _39: (); // anonymous local - let _40: *const (); // anonymous local - let _41: bool; // anonymous local - let ptr_42: *mut [u8]; // local - let data_43: *mut u8; // local - let _44: (); // anonymous local - let _45: *mut (); // anonymous local - let _46: *const [u8]; // anonymous 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 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: *mut [u8]; // anonymous local - let _49: (); // anonymous local - let _50: *const (); // anonymous local - let _51: *mut (); // anonymous local - let _52: bool; // anonymous local - let _53: bool; // anonymous local - let _54: bool; // anonymous local - let _55: bool; // anonymous local + let _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: AllocError; // anonymous local - let _58: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - let _59: Option>[{built_in impl Sized for NonNull}]; // anonymous local - let _60: AllocError; // anonymous local - let _61: Result, AllocError>[{built_in impl Sized for NonNull}, {built_in impl Sized for AllocError}]; // anonymous local - let _62: AllocError; // anonymous local - let _63: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local + let _57: bool; // anonymous local + let _58: bool; // anonymous local + let _59: bool; // anonymous local + let _60: bool; // 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<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local storage_live(old_size_6) - storage_live(_8) storage_live(new_size_10) storage_live(raw_ptr_12) + storage_live(_16) storage_live(ptr_17) storage_live(_18) - storage_live(new_ptr_24) - storage_live(ptr_26) + 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(_39) - storage_live(_44) - storage_live(_48) - storage_live(_49) + 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 => { }, _ => { storage_live(_7) + storage_live(_8) _29 = copy (old_layout_3).align _8 = transmute(copy _29) storage_live(_9) @@ -2108,10 +2139,11 @@ fn grow_impl_runtime<'_0>(_1: &'_0 Global, _2: NonNull, _3: Layout, _4: Layo _30 = copy (new_layout_4).align _9 = transmute(copy _30) storage_dead(_30) - _7 = copy _8 == move _9 + _7 = move _8 == move _9 if move _7 { } else { storage_dead(_9) + storage_dead(_8) storage_dead(_7) storage_live(_22) storage_live(self_23) @@ -2123,11 +2155,18 @@ fn grow_impl_runtime<'_0>(_1: &'_0 Global, _2: NonNull, _3: Layout, _4: Layo Result::Err => { storage_dead(v_47) storage_dead(self_23) - storage_live(_57) - _57 = AllocError { } - storage_live(_58) - _58 = Result::Err { 0: move _57 } - _0 = move _58 + 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 }, @@ -2136,101 +2175,103 @@ fn grow_impl_runtime<'_0>(_1: &'_0 Global, _2: NonNull, _3: Layout, _4: Layo _22 = ControlFlow::Continue { 0: copy v_47 } storage_dead(v_47) storage_dead(self_23) - new_ptr_24 = copy (_22 as variant ControlFlow::Continue).0 + new_ptr_25 = copy (_22 as variant ControlFlow::Continue).0 storage_dead(_22) - storage_live(src_25) - ptr_26 = transmute, *mut u8>(copy ptr_2) - src_25 = transmute, *const u8>(copy ptr_2) + storage_live(src_26) + src_26 = transmute, *const u8>(copy ptr_2) storage_live(dst_27) - _48 = transmute, *mut [u8]>(copy new_ptr_24) - dst_27 = cast<*mut [u8], *mut u8>(copy _48) - storage_live(_53) - _53 = ub_checks - if move _53 { - storage_live(_50) - _50 = transmute, *const ()>(copy ptr_2) - storage_live(_51) - _51 = cast<*mut [u8], *mut ()>(copy _48) - _49 = core::ptr::copy_nonoverlapping::precondition_check(move _50, move _51, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::SIZE, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, copy old_size_6) - storage_dead(_51) - storage_dead(_50) + 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_25, copy dst_27, copy old_size_6) + copy_nonoverlapping(copy src_26, copy dst_27, copy old_size_6) storage_dead(dst_27) - storage_dead(src_25) - _28 = __rust_dealloc(move ptr_26, move old_size_6, move _8) - _0 = Result::Ok { 0: copy new_ptr_24 } + 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) + storage_dead(_8) storage_dead(_7) new_size_10 = copy (new_layout_4).size storage_live(cond_11) cond_11 = copy new_size_10 >= copy old_size_6 - storage_live(_52) - _52 = ub_checks - if move _52 { + 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 _8, 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) - _33 = cast<*mut u8, *const u8>(copy raw_ptr_12) - storage_live(_34) - _34 = transmute<*mut u8, usize>(copy raw_ptr_12) - switch copy _34 { + storage_live(_33) + _33 = transmute<*mut u8, usize>(copy raw_ptr_12) + switch copy _33 { 0 : usize => { }, _ => { - storage_dead(_34) + storage_dead(_33) storage_live(_32) - storage_live(_54) - _54 = ub_checks - if move _54 { - storage_live(_36) - _36 = cast<*mut u8, *mut ()>(copy raw_ptr_12) - _35 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _36) - storage_dead(_36) + 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 { } - _32 = NonNull { pointer: copy _33 } - self_16 = Option::Some { 0: move _32 } + _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) storage_live(v_37) - v_37 = move (self_16 as variant Option::Some).0 - self_15 = Result::Ok { 0: copy 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_16) - storage_live(v_38) - v_38 = move (self_15 as variant Result::Ok).0 - _14 = ControlFlow::Continue { 0: copy v_38 } - storage_dead(v_38) - storage_dead(self_15) - ptr_17 = copy (_14 as variant ControlFlow::Continue).0 - storage_dead(_14) + storage_dead(self_14) + ptr_17 = copy (_13 as variant ControlFlow::Continue).0 + storage_dead(_13) if copy zeroed_5 { storage_live(self_19) self_19 = copy raw_ptr_12 offset copy old_size_6 storage_live(count_20) count_20 = copy new_size_10 wrap.- copy old_size_6 - storage_live(_55) - _55 = ub_checks - if move _55 { - storage_live(_40) - _40 = cast<*mut u8, *const ()>(copy self_19) + storage_live(_59) + _59 = ub_checks + if move _59 { storage_live(_41) - _41 = copy count_20 == const 0 : usize - _39 = core::ptr::write_bytes::precondition_check(move _40, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, move _41) + _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) - storage_dead(_40) } else { } _18 = write_bytes[{built_in impl Sized for u8}](move self_19, const 0 : u8, move count_20) @@ -2239,51 +2280,55 @@ fn grow_impl_runtime<'_0>(_1: &'_0 Global, _2: NonNull, _3: Layout, _4: Layo } else { } storage_live(_21) - storage_live(ptr_42) - storage_live(data_43) - data_43 = transmute, *mut u8>(copy ptr_17) - ptr_42 = *mut (copy data_43, copy new_size_10) - storage_dead(data_43) - storage_live(_46) - storage_live(_56) - _56 = ub_checks - if move _56 { - storage_live(_45) - _45 = transmute, *mut ()>(copy ptr_17) - _44 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _45) - storage_dead(_45) + 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 { } - _46 = cast<*mut [u8], *const [u8]>(copy ptr_42) - _21 = NonNull { pointer: copy _46 } - storage_dead(_46) - storage_dead(ptr_42) + _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(_34) - storage_live(_59) - _59 = Option::None { } - self_16 = move _59 + 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 = Result::Err { 0: move _64 } + self_14 = move _65 + storage_dead(v_36) + storage_dead(self_15) storage_live(v_37) - storage_live(_60) - _60 = AllocError { } - storage_live(_61) - _61 = Result::Err { 0: move _60 } - self_15 = move _61 storage_dead(v_37) - storage_dead(self_16) - storage_live(v_38) - storage_dead(v_38) - storage_dead(self_15) - storage_live(_62) - _62 = AllocError { } - storage_live(_63) - _63 = Result::Err { 0: move _62 } - _0 = move _63 - storage_dead(_14) + 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 } + _0 = move _67 + storage_dead(_39) + storage_dead(_38) + storage_dead(_13) return }, } @@ -2310,46 +2355,46 @@ fn shrink_impl_runtime<'_0>(_1: &'_0 Global, _2: NonNull, _3: Layout, _4: La 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 _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 new_ptr_24: NonNull<[u8]>; // local - let src_25: *const u8; // local - let ptr_26: *mut u8; // 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 ptr_31: *mut u8; // local - let _32: usize; // anonymous local - let _33: Alignment; // anonymous local - let _34: Alignment; // anonymous local - let _35: *const u8; // anonymous local - let ptr_36: *mut [u8]; // local - let data_37: *mut u8; // local + let _31: Alignment; // 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: *mut (); // anonymous local - let _40: *const [u8]; // anonymous local - let _41: Alignment; // anonymous local - let _42: (); // anonymous local - let _43: NonNull; // anonymous local - let _44: *const u8; // anonymous local - let _45: usize; // anonymous local - let _46: (); // anonymous local - let _47: *mut (); // anonymous local - let v_48: NonNull; // local - let v_49: NonNull; // local - let ptr_50: *mut [u8]; // local - let data_51: *mut u8; // local - let _52: (); // anonymous local - let _53: *mut (); // anonymous local - let _54: *const [u8]; // anonymous local - let v_55: NonNull<[u8]>; // local + let _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 _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 @@ -2370,21 +2415,20 @@ fn shrink_impl_runtime<'_0>(_1: &'_0 Global, _2: NonNull, _3: Layout, _4: La storage_live(new_size_6) storage_live(_7) - storage_live(_11) storage_live(_14) storage_live(raw_ptr_15) + storage_live(_19) storage_live(ptr_20) - storage_live(new_ptr_24) - storage_live(ptr_26) + storage_live(_24) + storage_live(new_ptr_25) storage_live(_28) storage_live(_29) - storage_live(_34) + storage_live(_32) + storage_live(_35) storage_live(_38) - storage_live(_42) - storage_live(_44) - storage_live(_46) - storage_live(_52) - storage_live(_56) + storage_live(_41) + storage_live(_47) + storage_live(_54) storage_live(_57) new_size_6 = copy (new_layout_4).size switch copy new_size_6 { @@ -2392,78 +2436,93 @@ fn shrink_impl_runtime<'_0>(_1: &'_0 Global, _2: NonNull, _3: Layout, _4: La }, _ => { storage_live(_10) + storage_live(_11) _29 = copy (old_layout_3).align _11 = transmute(copy _29) storage_live(_12) - storage_live(_41) - _41 = copy (new_layout_4).align - _12 = transmute(copy _41) - storage_dead(_41) - _10 = copy _11 == move _12 + 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(_22) storage_live(self_23) self_23 = alloc_impl_runtime(move new_layout_4, const false) - storage_live(v_55) + storage_live(v_51) match self_23 { Result::Ok => { }, Result::Err => { - storage_dead(v_55) + 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_55 = move (self_23 as variant Result::Ok).0 - _22 = ControlFlow::Continue { 0: copy v_55 } - storage_dead(v_55) + 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_24 = copy (_22 as variant ControlFlow::Continue).0 + new_ptr_25 = copy (_22 as variant ControlFlow::Continue).0 storage_dead(_22) - storage_live(src_25) - ptr_26 = transmute, *mut u8>(copy ptr_2) - src_25 = transmute, *const u8>(copy ptr_2) + storage_live(src_26) + src_26 = transmute, *const u8>(copy ptr_2) storage_live(dst_27) - _56 = transmute, *mut [u8]>(copy new_ptr_24) - dst_27 = cast<*mut [u8], *mut u8>(copy _56) + storage_live(_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 = cast<*mut [u8], *mut ()>(copy _56) - _57 = core::ptr::copy_nonoverlapping::precondition_check(move _58, move _59, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::SIZE, const {impl SizedTypeProperties for T}[{built_in impl Sized for u8}]::ALIGN, copy new_size_6) + _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_25, copy dst_27, copy new_size_6) + copy_nonoverlapping(copy src_26, copy dst_27, copy new_size_6) storage_dead(dst_27) - storage_dead(src_25) + storage_dead(src_26) storage_live(_60) _60 = copy (old_layout_3).size switch copy _60 { 0 : usize => { }, _ => { - _28 = __rust_dealloc(move ptr_26, move _60, move _11) + _28 = __rust_dealloc(move ptr_2, move _60, move _29) }, } storage_dead(_60) - _0 = Result::Ok { 0: copy new_ptr_24 } + _0 = Result::Ok { 0: copy new_ptr_25 } return } storage_dead(_12) + storage_dead(_11) storage_dead(_10) storage_live(cond_13) _14 = copy (old_layout_3).size @@ -2471,97 +2530,97 @@ fn shrink_impl_runtime<'_0>(_1: &'_0 Global, _2: NonNull, _3: Layout, _4: La storage_live(_62) _62 = ub_checks if move _62 { - _42 = core::hint::assert_unchecked::precondition_check(copy cond_13) + _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 _11, 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) - _44 = cast<*mut u8, *const u8>(copy raw_ptr_15) - storage_live(_45) - _45 = transmute<*mut u8, usize>(copy raw_ptr_15) - switch copy _45 { + storage_live(_40) + _40 = transmute<*mut u8, usize>(copy raw_ptr_15) + switch copy _40 { 0 : usize => { }, _ => { - storage_dead(_45) - storage_live(_43) + storage_dead(_40) + storage_live(_39) storage_live(_64) _64 = ub_checks if move _64 { - storage_live(_47) - _47 = cast<*mut u8, *mut ()>(copy raw_ptr_15) - _46 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _47) - storage_dead(_47) + 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 { } - _43 = NonNull { pointer: copy _44 } - self_19 = Option::Some { 0: move _43 } - storage_dead(_43) - storage_live(v_48) - v_48 = move (self_19 as variant Option::Some).0 - self_18 = Result::Ok { 0: copy v_48 } - storage_dead(v_48) - storage_dead(self_19) - storage_live(v_49) - v_49 = move (self_18 as variant Result::Ok).0 - _17 = ControlFlow::Continue { 0: copy v_49 } - storage_dead(v_49) + _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_20 = copy (_17 as variant ControlFlow::Continue).0 - storage_dead(_17) + 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_50) - storage_live(data_51) - data_51 = transmute, *mut u8>(copy ptr_20) - ptr_50 = *mut (copy data_51, copy new_size_6) - storage_dead(data_51) - storage_live(_54) + storage_live(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(_53) - _53 = transmute, *mut ()>(copy ptr_20) - _52 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _53) - storage_dead(_53) + 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 { } - _54 = cast<*mut [u8], *const [u8]>(copy ptr_50) - _21 = NonNull { pointer: copy _54 } - storage_dead(_54) - storage_dead(ptr_50) + _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(_45) + storage_dead(_40) storage_live(_68) _68 = Option::None { } - self_19 = move _68 - storage_live(v_48) + self_18 = move _68 + storage_live(v_43) storage_live(_69) _69 = AllocError { } storage_live(_70) _70 = Result::Err { 0: move _69 } - self_18 = move _70 - storage_dead(v_48) - storage_dead(self_19) - storage_live(v_49) - storage_dead(v_49) + self_17 = move _70 + storage_dead(v_43) storage_dead(self_18) + 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(_17) + storage_dead(_50) + storage_dead(_49) + storage_dead(_16) return }, } @@ -2571,45 +2630,33 @@ fn shrink_impl_runtime<'_0>(_1: &'_0 Global, _2: NonNull, _3: Layout, _4: La 0 : usize => { }, _ => { - storage_live(ptr_31) - ptr_31 = transmute, *mut u8>(copy ptr_2) - storage_live(_32) - storage_live(_33) - _33 = copy (old_layout_3).align - _32 = transmute(copy _33) - storage_dead(_33) - _7 = __rust_dealloc(move ptr_31, move _30, move _32) - storage_dead(_32) - storage_dead(ptr_31) + storage_live(_31) + _31 = copy (old_layout_3).align + _7 = __rust_dealloc(move ptr_2, move _30, move _31) + storage_dead(_31) }, } storage_dead(_30) storage_live(_8) storage_live(data_9) - _34 = copy (new_layout_4).align - storage_live(_35) - _35 = transmute(copy _34) - data_9 = NonNull { pointer: copy _35 } - storage_dead(_35) - storage_live(ptr_36) - storage_live(data_37) - data_37 = transmute(copy _34) - ptr_36 = *mut (copy data_37, const 0 : usize) - storage_dead(data_37) - storage_live(_40) + _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(_39) - _39 = transmute(copy _34) - _38 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _39) - storage_dead(_39) + storage_live(_36) + _36 = transmute(copy _32) + _35 = core::ptr::non_null::{NonNull}::new_unchecked::precondition_check(move _36) + storage_dead(_36) } else { } - _40 = cast<*mut [u8], *const [u8]>(copy ptr_36) - _8 = NonNull { pointer: copy _40 } - storage_dead(_40) - storage_dead(ptr_36) + _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) @@ -2663,9 +2710,7 @@ pub unsafe fn {impl Allocator for Global}::deallocate<'_0>(_1: &'_0 Global, _2: 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: usize; // anonymous local - let _7: Alignment; // anonymous local + let _5: Alignment; // anonymous local _0 = () storage_live(_4) @@ -2674,16 +2719,10 @@ pub unsafe fn {impl Allocator for Global}::deallocate<'_0>(_1: &'_0 Global, _2: 0 : usize => { }, _ => { - storage_live(ptr_5) - ptr_5 = transmute, *mut u8>(copy ptr_2) - storage_live(_6) - storage_live(_7) - _7 = copy (layout_3).align - _6 = transmute(copy _7) - storage_dead(_7) - _0 = __rust_dealloc(move ptr_5, move _4, move _6) - storage_dead(_6) - storage_dead(ptr_5) + storage_live(_5) + _5 = copy (layout_3).align + _0 = __rust_dealloc(move ptr_2, move _4, move _5) + storage_dead(_5) }, } storage_dead(_4) @@ -2765,54 +2804,6 @@ pub fn handle_alloc_error(_1: Layout) -> ! _0 = ct_error(move _2.0) } -// Full name: alloc::alloc::exchange_malloc -#[lang_item("exchange_malloc")] -unsafe fn exchange_malloc(_1: usize, _2: usize) -> *mut u8 -{ - let _0: *mut u8; // return - let size_1: usize; // arg #1 - let align_2: usize; // arg #2 - let layout_3: Layout; // local - let _4: Result, AllocError>[{built_in impl Sized for NonNull<[u8]>}, {built_in impl Sized for AllocError}]; // anonymous local - let ptr_5: NonNull<[u8]>; // local - let _6: !; // anonymous local - let _7: (); // anonymous local - let _8: Alignment; // anonymous local - let _9: *mut [u8]; // anonymous local - let _10: bool; // anonymous local - - storage_live(layout_3) - storage_live(ptr_5) - storage_live(_6) - storage_live(_7) - storage_live(_10) - _10 = ub_checks - if move _10 { - _7 = core::alloc::layout::{Layout}::from_size_align_unchecked::precondition_check(copy size_1, copy align_2) - } else { - } - storage_live(_8) - _8 = transmute(copy align_2) - layout_3 = Layout { size: copy size_1, align: move _8 } - storage_dead(_8) - storage_live(_4) - _4 = alloc_impl_runtime(copy layout_3, const false) - match _4 { - Result::Ok => { - }, - Result::Err => { - _6 = handle_alloc_error(move layout_3) - }, - } - ptr_5 = copy (_4 as variant Result::Ok).0 - storage_live(_9) - _9 = transmute, *mut [u8]>(copy ptr_5) - _0 = cast<*mut [u8], *mut u8>(copy _9) - storage_dead(_9) - storage_dead(_4) - return -} - // Full name: alloc::boxed::Box #[lang_item("owned_box")] pub struct Box @@ -2844,6 +2835,44 @@ where non-dyn-compatible } +// Full name: alloc::boxed::box_new_uninit +fn box_new_uninit(_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::parent_clause0, {built_in impl Sized for Global}, {impl Allocator for Global}]}::new(_1: T) -> Box[@TraitClause0::parent_clause0, {built_in impl Sized for Global}, {impl Allocator for Global}] where @@ -2851,27 +2880,15 @@ where { let _0: Box[@TraitClause0::parent_clause0, {built_in impl Sized for Global}, {impl Allocator for Global}]; // return let x_1: T; // arg #1 - let _2: *mut u8; // anonymous local - let _3: *const T; // anonymous local - let _4: NonNull; // anonymous local - let _5: Unique; // anonymous local - let _6: PhantomData; // anonymous local - let _7: Global; // anonymous local + let ptr_2: *mut T; // local + let _3: *mut u8; // anonymous local - storage_live(_2) + storage_live(ptr_2) storage_live(_3) - storage_live(_4) - storage_live(_5) - _2 = exchange_malloc(const {impl SizedTypeProperties for T}[@TraitClause0]::SIZE, const {impl SizedTypeProperties for T}[@TraitClause0]::ALIGN) - _3 = cast<*mut u8, *const T>(copy _2) - _4 = NonNull { pointer: copy _3 } - storage_live(_6) - _6 = PhantomData { } - _5 = Unique { pointer: copy _4, _marker: move _6 } - storage_live(_7) - _7 = Global { } - _0 = Box { 0: move _5, 1: move _7 } - (*_3) = move x_1 + _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 u8, Box[@TraitClause0::parent_clause0, {built_in impl Sized for Global}, {impl Allocator for Global}]>(copy _3) return } @@ -2886,34 +2903,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 a52f5905b..263c0c8ce 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 -{ - parent_clause0 : [@TraitClause0]: Sized - const SIZE : usize - const ALIGN : usize - const ALIGNMENT : Alignment - const IS_ZST : bool - const LAYOUT : Layout - const MAX_SLICE_LEN : usize - non-dyn-compatible -} - -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub fn SIZE() -> usize -where - [@TraitClause0]: SizedTypeProperties, -= - -// Full name: core::mem::SizedTypeProperties::SIZE -#[lang_item("mem_size_const")] -pub const SIZE: usize -where - [@TraitClause0]: SizedTypeProperties, - = SIZE() - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub fn ALIGN() -> usize -where - [@TraitClause0]: SizedTypeProperties, -= - -// Full name: core::mem::SizedTypeProperties::ALIGN -#[lang_item("mem_align_const")] -pub const ALIGN: usize -where - [@TraitClause0]: SizedTypeProperties, - = ALIGN() - -// Full name: core::mem::SizedTypeProperties::ALIGNMENT -pub fn ALIGNMENT() -> Alignment -where - [@TraitClause0]: SizedTypeProperties, -= - -// Full name: core::mem::SizedTypeProperties::ALIGNMENT -pub const ALIGNMENT: Alignment -where - [@TraitClause0]: SizedTypeProperties, - = ALIGNMENT() - -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub fn IS_ZST() -> bool -where - [@TraitClause0]: SizedTypeProperties, -= - -// Full name: core::mem::SizedTypeProperties::IS_ZST -pub const IS_ZST: bool -where - [@TraitClause0]: SizedTypeProperties, - = IS_ZST() - -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub fn LAYOUT() -> Layout -where - [@TraitClause0]: SizedTypeProperties, -= - -// Full name: core::mem::SizedTypeProperties::LAYOUT -pub const LAYOUT: Layout -where - [@TraitClause0]: SizedTypeProperties, - = LAYOUT() - -// Full name: core::mem::SizedTypeProperties::MAX_SLICE_LEN -pub fn MAX_SLICE_LEN() -> usize -where - [@TraitClause0]: SizedTypeProperties, -= - -// Full name: core::mem::SizedTypeProperties::MAX_SLICE_LEN -pub const MAX_SLICE_LEN: usize -where - [@TraitClause0]: SizedTypeProperties, - = MAX_SLICE_LEN() - -// Full name: core::mem::{impl SizedTypeProperties for T} -impl SizedTypeProperties for T -where - [@TraitClause0]: Sized, -{ - parent_clause0 = @TraitClause0 - const SIZE = SIZE[{impl SizedTypeProperties for T}[@TraitClause0]] - const ALIGN = ALIGN[{impl SizedTypeProperties for T}[@TraitClause0]] - const ALIGNMENT = ALIGNMENT[{impl SizedTypeProperties for T}[@TraitClause0]] - const IS_ZST = IS_ZST[{impl SizedTypeProperties for T}[@TraitClause0]] - const LAYOUT = LAYOUT[{impl SizedTypeProperties for T}[@TraitClause0]] - const MAX_SLICE_LEN = MAX_SLICE_LEN[{impl SizedTypeProperties for T}[@TraitClause0]] - non-dyn-compatible -} - // Full name: core::option::Option #[lang_item("Option")] pub enum Option @@ -216,67 +105,69 @@ pub fn advance_slices<'a, '_1, '_2>(_1: &'_1 mut &'_2 mut [std::io::IoSlice<'a>] 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: &'226 mut [std::io::IoSlice<'178>; 0 : usize]; // anonymous local - let _76: [std::io::IoSlice<'178>; 0 : usize]; // anonymous local - let _77: PhantomData<&'134 std::io::IoSlice<'135>>; // anonymous local - let _78: &'_ mut [std::io::IoSlice<'209>]; // anonymous local - let _79: &'_ 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: &'231 mut [std::io::IoSlice<'183>; 0 : usize]; // anonymous local + let _78: [std::io::IoSlice<'183>; 0 : usize]; // anonymous local + let _79: PhantomData<&'139 std::io::IoSlice<'140>>; // anonymous local + let _80: &'_ mut [std::io::IoSlice<'214>]; // anonymous local + let _81: &'_ mut std::io::IoSlice<'214>; // anonymous local storage_live(remove_3) storage_live(iter_4) @@ -288,110 +179,119 @@ pub fn advance_slices<'a, '_1, '_2>(_1: &'_1 mut &'_2 mut [std::io::IoSlice<'a>] 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(_77) - _77 = PhantomData { } - iter_4 = Iter { 0: copy ptr_18, 1: copy end_or_len_19, 2: move _77 } - 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(_79) + _79 = PhantomData { } + iter_4 = Iter { 0: copy ptr_18, 1: copy end_or_len_20, 2: move _79 } + 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 @@ -400,147 +300,147 @@ pub fn advance_slices<'a, '_1, '_2>(_1: &'_1 mut &'_2 mut [std::io::IoSlice<'a>] continue 0 } } - storage_live(_75) - storage_live(_76) - _76 = [] - _75 = &mut _76 + storage_live(_77) + storage_live(_78) + _78 = [] + _77 = &mut _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(_78) - _78 = &mut (*_16) with_metadata(copy _16.metadata) - storage_live(_79) - _79 = @SliceIndexMut<'_, std::io::IoSlice<'209>>(move _78, const 0 : usize) - self_12 = &two-phase-mut (*_79) - 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(_80) + _80 = &mut (*_16) with_metadata(copy _16.metadata) + storage_live(_81) + _81 = @SliceIndexMut<'_, std::io::IoSlice<'214>>(move _80, const 0 : usize) + self_12 = &two-phase-mut (*_81) + 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 8da60149d..e47687d20 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>(_1: &'_0 u32, _2: &'_1 mut Forma 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>(_1: &'_0 u32, _2: &'_1 mut Forma 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/rvalues.out b/charon/tests/ui/rvalues.out index b3eda3e72..12af1e36a 100644 --- a/charon/tests/ui/rvalues.out +++ b/charon/tests/ui/rvalues.out @@ -465,15 +465,10 @@ fn boxes() { let _0: (); // return let _1: alloc::boxed::Box[{built_in impl MetaSized for i32}, {built_in impl Sized for Global}]; // anonymous local - let _2: alloc::boxed::Box[{built_in impl MetaSized for i32}, {built_in impl Sized for Global}]; // anonymous local _0 = () storage_live(_1) - storage_live(_2) - _2 = @BoxNew[{built_in impl MetaSized for i32}, {built_in impl Sized for Global}](const 42 : i32) - _1 = move _2 - conditional_drop[{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}[{built_in impl MetaSized for i32}, {built_in impl Sized for Global}]] _2 - storage_dead(_2) + _1 = @BoxNew[{built_in impl Sized for i32}](const 42 : i32) conditional_drop[{impl Destruct for alloc::boxed::Box[@TraitClause0, @TraitClause1]}[{built_in impl MetaSized for i32}, {built_in impl Sized for Global}]] _1 storage_dead(_1) _0 = () diff --git a/charon/tests/ui/rvalues.rs b/charon/tests/ui/rvalues.rs index d02edfae2..f141a8d4a 100644 --- a/charon/tests/ui/rvalues.rs +++ b/charon/tests/ui/rvalues.rs @@ -47,7 +47,7 @@ fn fn_casts() { } fn boxes() { - let _ = std::boxed::box_new(42); + let _ = Box::new(42); } // We force stealing to get the optimized_mir of the function. Optimizing the whole file would diff --git a/charon/tests/ui/simple/box-into-inner.out b/charon/tests/ui/simple/box-into-inner.out index 4df928eec..036c7f52e 100644 --- a/charon/tests/ui/simple/box-into-inner.out +++ b/charon/tests/ui/simple/box-into-inner.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/drop-glue-with-const-generic.out b/charon/tests/ui/simple/drop-glue-with-const-generic.out index 8f578c6d6..c69b9b8e6 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/efc9e1b50cbf2cede7ebe25f0a1fc64fd8b3e942/compiler/rustc_middle/src/ty/sty.rs:352:13: cannot find `K/#0` in param-env: ParamEnv { +error: internal compiler error: /rustc-dev/bf4fbfb7a18d74e7cd8eef93af7329c58fbb5344/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/efc9e1b50cbf2cede7ebe25f0a1fc64fd8b3e } -thread 'rustc' panicked at /rustc-dev/efc9e1b50cbf2cede7ebe25f0a1fc64fd8b3e942/compiler/rustc_middle/src/ty/sty.rs:352:13: +thread 'rustc' panicked at /rustc-dev/bf4fbfb7a18d74e7cd8eef93af7329c58fbb5344/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 bd2f66dc1..fac26d294 100644 --- a/charon/tests/ui/simple/slice_index_range.out +++ b/charon/tests/ui/simple/slice_index_range.out @@ -88,19 +88,17 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(_1: usize, _2: usize) 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) @@ -115,16 +113,13 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(_1: usize, _2: usize) 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 } @@ -132,42 +127,39 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(_1: usize, _2: usize) 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) } @@ -188,19 +180,17 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(_1: usize, _2: usiz 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) @@ -215,16 +205,13 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(_1: usize, _2: usiz 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 } @@ -232,42 +219,39 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(_1: usize, _2: usiz 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) } @@ -288,19 +272,17 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(_1: usize, _2: usiz 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) @@ -315,16 +297,13 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(_1: usize, _2: usiz 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 } @@ -332,42 +311,39 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(_1: usize, _2: usiz 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) } @@ -388,19 +364,17 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(_1: usize, _2: usiz 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) @@ -415,16 +389,13 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(_1: usize, _2: usiz 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 } @@ -432,42 +403,39 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(_1: usize, _2: usiz 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) } @@ -481,18 +449,6 @@ fn compiletime<'_0>(_1: Arguments<'_0>, _2: bool) -> ! panic(core::panicking::panic_fmt) } -// Full name: core::num::{usize}::MAX -pub fn MAX() -> usize -{ - let _0: usize; // return - - _0 = ~(const 0 : usize) - return -} - -// Full name: core::num::{usize}::MAX -pub const MAX: usize = MAX() - // Full name: core::ops::range::RangeInclusive #[lang_item("RangeInclusive")] pub struct RangeInclusive @@ -1200,9 +1156,9 @@ where let slice_2: &'9 mut [T]; // arg #2 let _3: bool; // anonymous local let self_4: usize; // local - let exclusive_end_5: usize; // local - let _6: bool; // anonymous local - let _7: usize; // anonymous local + let _5: usize; // anonymous local + let exclusive_end_6: usize; // local + let _7: bool; // anonymous local let _8: &'12 mut [T]; // anonymous local let _9: *mut [T]; // anonymous local let ptr_10: *mut [T]; // local @@ -1216,13 +1172,15 @@ where let _18: Option<&'16 mut [T]>[{built_in impl Sized for &'18 mut [T]}]; // anonymous local storage_live(self_4) - storage_live(exclusive_end_5) + storage_live(_5) + storage_live(exclusive_end_6) storage_live(new_len_12) storage_live(self_15) storage_live(self_16) storage_live(_3) self_4 = copy (self_1).end - _3 = copy self_4 == copy MAX + _5 = copy slice_2.metadata + _3 = copy self_4 >= copy _5 if move _3 { storage_live(_17) _17 = Option::None { } @@ -1230,28 +1188,25 @@ where } else { self_15 = move (self_1).start self_16 = move (self_1).exhausted - exclusive_end_5 = copy self_4 wrap.+ const 1 : usize + exclusive_end_6 = copy self_4 wrap.+ const 1 : usize if copy self_16 { - self_15 = copy exclusive_end_5 + self_15 = copy exclusive_end_6 } else { } storage_live(_8) storage_live(_11) - _11 = copy exclusive_end_5 < copy self_15 + _11 = copy exclusive_end_6 < copy self_15 if move _11 { storage_dead(_11) storage_live(_18) _18 = Option::None { } _0 = move _18 } else { - new_len_12 = copy exclusive_end_5 ub.- copy self_15 + new_len_12 = copy exclusive_end_6 ub.- copy self_15 storage_dead(_11) - storage_live(_6) storage_live(_7) - _7 = copy slice_2.metadata - _6 = copy exclusive_end_5 <= move _7 - if move _6 { - storage_dead(_7) + _7 = copy exclusive_end_6 <= copy _5 + if move _7 { storage_live(_9) storage_live(ptr_10) ptr_10 = &raw mut (*slice_2) with_metadata(copy slice_2.metadata) @@ -1267,13 +1222,12 @@ where _0 = Option::Some { 0: copy _8 } storage_dead(_9) } else { - storage_dead(_7) storage_live(_18) _18 = Option::None { } _0 = move _18 } } - storage_dead(_6) + storage_dead(_7) storage_dead(_8) } storage_dead(_3) @@ -1290,9 +1244,9 @@ where let slice_2: &'9 [T]; // arg #2 let _3: bool; // anonymous local let self_4: usize; // local - let exclusive_end_5: usize; // local - let _6: bool; // anonymous local - let _7: usize; // anonymous local + let _5: usize; // anonymous local + let exclusive_end_6: usize; // local + let _7: bool; // anonymous local let _8: &'12 [T]; // anonymous local let _9: *const [T]; // anonymous local let _10: *const [T]; // anonymous local @@ -1306,13 +1260,15 @@ where let _18: Option<&'16 [T]>[{built_in impl Sized for &'18 [T]}]; // anonymous local storage_live(self_4) - storage_live(exclusive_end_5) + storage_live(_5) + storage_live(exclusive_end_6) storage_live(new_len_12) storage_live(self_15) storage_live(self_16) storage_live(_3) self_4 = copy (self_1).end - _3 = copy self_4 == copy MAX + _5 = copy slice_2.metadata + _3 = copy self_4 >= copy _5 if move _3 { storage_live(_17) _17 = Option::None { } @@ -1320,28 +1276,25 @@ where } else { self_15 = move (self_1).start self_16 = move (self_1).exhausted - exclusive_end_5 = copy self_4 wrap.+ const 1 : usize + exclusive_end_6 = copy self_4 wrap.+ const 1 : usize if copy self_16 { - self_15 = copy exclusive_end_5 + self_15 = copy exclusive_end_6 } else { } storage_live(_8) storage_live(_11) - _11 = copy exclusive_end_5 < copy self_15 + _11 = copy exclusive_end_6 < copy self_15 if move _11 { storage_dead(_11) storage_live(_18) _18 = Option::None { } _0 = move _18 } else { - new_len_12 = copy exclusive_end_5 ub.- copy self_15 + new_len_12 = copy exclusive_end_6 ub.- copy self_15 storage_dead(_11) - storage_live(_6) storage_live(_7) - _7 = copy slice_2.metadata - _6 = copy exclusive_end_5 <= move _7 - if move _6 { - storage_dead(_7) + _7 = copy exclusive_end_6 <= copy _5 + if move _7 { storage_live(_9) storage_live(_10) _10 = &raw const (*slice_2) with_metadata(copy slice_2.metadata) @@ -1357,13 +1310,12 @@ where _0 = Option::Some { 0: copy _8 } storage_dead(_9) } else { - storage_dead(_7) storage_live(_18) _18 = Option::None { } _0 = move _18 } } - storage_dead(_6) + storage_dead(_7) storage_dead(_8) } storage_dead(_3) diff --git a/charon/tests/ui/simple/vec-push.out b/charon/tests/ui/simple/vec-push.out index 83cd99adf..3de24c5c8 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 @@ -258,7 +258,7 @@ where storage_dead(self_9) storage_live(src_10) src_10 = move value_2 - (*end_8) = copy src_10 + (*end_8) = move src_10 storage_dead(src_10) ((*self_1)).len = copy len_3 wrap.+ const 1 : usize _0 = &mut (*end_8) diff --git a/charon/tests/ui/simple/vec-with-capacity.out b/charon/tests/ui/simple/vec-with-capacity.out index 61333ced7..e7a15709b 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 cc7b4e473..a18e67130 100644 --- a/charon/tests/ui/slice-index-range.out +++ b/charon/tests/ui/slice-index-range.out @@ -101,19 +101,17 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(_1: usize, _2: usize) 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) @@ -128,16 +126,13 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(_1: usize, _2: usize) 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 } @@ -145,42 +140,39 @@ fn core::slice::index::slice_index_fail::do_panic::runtime(_1: usize, _2: usize) 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) } @@ -201,19 +193,17 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(_1: usize, _2: usiz 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) @@ -228,16 +218,13 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(_1: usize, _2: usiz 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 } @@ -245,42 +232,39 @@ fn core::slice::index::slice_index_fail::do_panic#1::runtime(_1: usize, _2: usiz 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) } @@ -301,19 +285,17 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(_1: usize, _2: usiz 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) @@ -328,16 +310,13 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(_1: usize, _2: usiz 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 } @@ -345,42 +324,39 @@ fn core::slice::index::slice_index_fail::do_panic#2::runtime(_1: usize, _2: usiz 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) } @@ -401,19 +377,17 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(_1: usize, _2: usiz 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) @@ -428,16 +402,13 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(_1: usize, _2: usiz 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 } @@ -445,42 +416,39 @@ fn core::slice::index::slice_index_fail::do_panic#3::runtime(_1: usize, _2: usiz 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.lock b/flake.lock index 3344f3601..85f60d101 100644 --- a/flake.lock +++ b/flake.lock @@ -79,17 +79,17 @@ ] }, "locked": { - "lastModified": 1771902481, - "narHash": "sha256-svI5ivzggtu4KhCdoab3xR5+Btop24o7yLFtIPXrsPM=", + "lastModified": 1776309239, + "narHash": "sha256-XzTecca59093jBsVAE4PVAMcJO+PAYHYHBPRnOR8iWs=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "5177426d9f8f7f1827001c9749b9a9c5570d456b", + "rev": "3717ee024da7b0a20744f12c39b41e27cbc12f2d", "type": "github" }, "original": { "owner": "oxalica", "repo": "rust-overlay", - "rev": "5177426d9f8f7f1827001c9749b9a9c5570d456b", + "rev": "3717ee024da7b0a20744f12c39b41e27cbc12f2d", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 4ed66b226..643e652a2 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/3717ee024da7b0a20744f12c39b41e27cbc12f2d"; inputs.nixpkgs.follows = "nixpkgs"; }; crane.url = "github:ipetkov/crane";