diff --git a/Cargo.lock b/Cargo.lock index b398d06c347df..d61f745e0bc3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4055,19 +4055,29 @@ dependencies = [ "rustc_lexer", "rustc_lint_defs", "rustc_macros", - "rustc_middle", "rustc_parse", "rustc_proc_macro", "rustc_serialize", "rustc_session", "rustc_span", "rustc_structures", - "scoped-tls", "smallvec", "thin-vec", "tracing", ] +[[package]] +name = "rustc_expand_queries" +version = "0.0.0" +dependencies = [ + "rustc_ast", + "rustc_expand", + "rustc_middle", + "rustc_proc_macro", + "rustc_span", + "scoped-tls", +] + [[package]] name = "rustc_feature" version = "0.0.0" @@ -4271,6 +4281,7 @@ dependencies = [ "rustc_data_structures", "rustc_errors", "rustc_expand", + "rustc_expand_queries", "rustc_feature", "rustc_fs_util", "rustc_hir", diff --git a/compiler/rustc_codegen_cranelift/src/inline_asm.rs b/compiler/rustc_codegen_cranelift/src/inline_asm.rs index d4d64cb3fbaf2..cd2b06cc1defb 100644 --- a/compiler/rustc_codegen_cranelift/src/inline_asm.rs +++ b/compiler/rustc_codegen_cranelift/src/inline_asm.rs @@ -443,11 +443,12 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> { .supported_types(self.arch, true) .iter() .map(|(ty, _)| ty.size()) + .filter_map(InlineAsmSize::fixed_size_bytes) .max() - .unwrap(); - let align = rustc_abi::Align::from_bytes(reg_size.bytes()).unwrap(); + .expect("expected fixed-size type"); + let align = rustc_abi::Align::from_bytes(reg_size).unwrap(); let offset = slot_size.align_to(align); - *slot_size = offset + reg_size; + *slot_size = offset + rustc_abi::Size::from_bytes(reg_size); offset }; let mut new_slot = |x| new_slot_fn(&mut slot_size, x); diff --git a/compiler/rustc_codegen_gcc/src/asm.rs b/compiler/rustc_codegen_gcc/src/asm.rs index 5b17b4f83fea2..8fd438d847d29 100644 --- a/compiler/rustc_codegen_gcc/src/asm.rs +++ b/compiler/rustc_codegen_gcc/src/asm.rs @@ -692,7 +692,9 @@ fn reg_class_to_gcc(reg_class: InlineAsmRegClass) -> &'static str { InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::reg) => "r", InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::vreg) => "w", InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::vreg_low16) => "x", - InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::preg) => { + InlineAsmRegClass::AArch64( + AArch64InlineAsmRegClass::preg | AArch64InlineAsmRegClass::ffr, + ) => { unreachable!("clobber-only") } InlineAsmRegClass::Amdgpu(AmdgpuInlineAsmRegClass::Sgpr(_)) => "Sg", @@ -807,7 +809,9 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl | InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::vreg_low16) => { cx.type_vector(cx.type_i64(), 2) } - InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::preg) => { + InlineAsmRegClass::AArch64( + AArch64InlineAsmRegClass::preg | AArch64InlineAsmRegClass::ffr, + ) => { unreachable!("clobber-only") } InlineAsmRegClass::Amdgpu(_) => cx.type_i32(), @@ -1056,7 +1060,9 @@ fn modifier_to_gcc( | InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::vreg_low16) => { if modifier == Some('v') { None } else { modifier } } - InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::preg) => { + InlineAsmRegClass::AArch64( + AArch64InlineAsmRegClass::preg | AArch64InlineAsmRegClass::ffr, + ) => { unreachable!("clobber-only") } InlineAsmRegClass::Amdgpu(_) => None, diff --git a/compiler/rustc_codegen_llvm/src/asm.rs b/compiler/rustc_codegen_llvm/src/asm.rs index f9bcc6fe0b6ce..3d2362be02f27 100644 --- a/compiler/rustc_codegen_llvm/src/asm.rs +++ b/compiler/rustc_codegen_llvm/src/asm.rs @@ -732,18 +732,25 @@ fn reg_to_llvm(reg: InlineAsmRegOrRegClass, layout: Option<&TyAndLayout<'_>>) -> format!("{{{}{}}}", class, idx) } } else if let Some(idx) = a64_vreg_index(reg) { - let class = if let Some(layout) = layout { - match layout.size.bytes() { + let class = match layout { + Some(layout) + if matches!( + layout.backend_repr, + BackendRepr::SimdScalableVector { .. } + ) => + { + 'z' + } + Some(layout) => match layout.size.bytes() { 16 => 'q', 8 => 'd', 4 => 's', 2 => 'h', 1 => 'd', // We fixup i8 to i8x8 _ => unreachable!(), - } - } else { + }, // We use i64x2 as the type for discarded outputs - 'q' + None => 'q', }; format!("{{{}{}}}", class, idx) } else if let Some(idx) = hexagon_reg_pair_index(reg) { @@ -775,7 +782,10 @@ fn reg_to_llvm(reg: InlineAsmRegOrRegClass, layout: Option<&TyAndLayout<'_>>) -> AArch64(AArch64InlineAsmRegClass::reg) => "r", AArch64(AArch64InlineAsmRegClass::vreg) => "w", AArch64(AArch64InlineAsmRegClass::vreg_low16) => "x", - AArch64(AArch64InlineAsmRegClass::preg) => unreachable!("clobber-only"), + // Although the above link suggests its just 'Upa', llvm's own tests seem to suggest its + // '@3Upa'. (see "src/llvm-project/clang/test/CodeGen/AArch64/sve-inline-asm-datatypes.c" line 139) + AArch64(AArch64InlineAsmRegClass::preg) => "@3Upa", + AArch64(AArch64InlineAsmRegClass::ffr) => unreachable!("clobber-only"), Arm(ArmInlineAsmRegClass::reg) => "r", Arm(ArmInlineAsmRegClass::sreg) | Arm(ArmInlineAsmRegClass::dreg_low16) @@ -885,7 +895,7 @@ fn modifier_to_llvm( modifier } } - AArch64(AArch64InlineAsmRegClass::preg) => unreachable!("clobber-only"), + AArch64(AArch64InlineAsmRegClass::preg | AArch64InlineAsmRegClass::ffr) => None, Arm(ArmInlineAsmRegClass::reg) => None, Arm(ArmInlineAsmRegClass::sreg) | Arm(ArmInlineAsmRegClass::sreg_low16) => None, Arm(ArmInlineAsmRegClass::dreg) @@ -990,7 +1000,8 @@ fn dummy_output_type<'ll>(cx: &CodegenCx<'ll, '_>, reg: InlineAsmRegClass) -> &' AArch64(AArch64InlineAsmRegClass::vreg) | AArch64(AArch64InlineAsmRegClass::vreg_low16) => { cx.type_vector(cx.type_i64(), 2) } - AArch64(AArch64InlineAsmRegClass::preg) => unreachable!("clobber-only"), + AArch64(AArch64InlineAsmRegClass::preg) => cx.type_scalable_vector(cx.type_i1(), 16), + AArch64(AArch64InlineAsmRegClass::ffr) => unreachable!("clobber-only"), Arm(ArmInlineAsmRegClass::reg) => cx.type_i32(), Arm(ArmInlineAsmRegClass::sreg) | Arm(ArmInlineAsmRegClass::sreg_low16) => cx.type_f32(), Arm(ArmInlineAsmRegClass::dreg) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 25003e071beb7..8c6998407e89e 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -4129,7 +4129,7 @@ fn add_lld_args( // `lld` as the linker. // // Note that wasm targets skip this step since the only option there anyway - // is to use LLD but the `wasm32-wasip2` target relies on a wrapper around + // is to use LLD but component-producing targets rely on a wrapper around // this, `wasm-component-ld`, which is overridden if this option is passed. if !sess.target.is_like_wasm { cmd.cc_arg("-fuse-ld=lld"); diff --git a/compiler/rustc_codegen_ssa/src/mir/retag.rs b/compiler/rustc_codegen_ssa/src/mir/retag.rs index 397fb423e8da3..a71a57f02c82a 100644 --- a/compiler/rustc_codegen_ssa/src/mir/retag.rs +++ b/compiler/rustc_codegen_ssa/src/mir/retag.rs @@ -73,7 +73,7 @@ impl<'a, 'tcx, V> RetagPlan { // the outermost `Box` is what determines the permission that gets created. ty::Adt(adt, _) if adt.is_box() => Self::visit_box(bx, layout, is_fn_entry), // Skip traversing for everything inside of `MaybeDangling` - ty::Adt(adt, _) if adt.is_maybe_dangling() => None, + _ if layout.ty.is_like_maybe_dangling() => None, _ => Self::walk_value(bx, layout, is_fn_entry), } } diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index 2cd4caf5ba250..f388bb80b13ce 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -7,7 +7,6 @@ use std::borrow::Cow; use std::fmt::{self, Write}; use std::hash::Hash; -use std::mem; use std::num::NonZero; use either::{Left, Right}; @@ -1528,15 +1527,10 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValueVisitor<'tcx, M> for ValidityVisitor<'rt, BackendRepr::Memory { .. } => unreachable!() } } - ty::Adt(adt, _) if adt.is_maybe_dangling() => { - let old_may_dangle = mem::replace(&mut self.may_dangle, true); - - let inner = self.ecx.project_field(val, FieldIdx::ZERO)?; - self.visit_value(&inner)?; - - self.may_dangle = old_may_dangle; - } _ => { + let old_may_dangle = self.may_dangle; + self.may_dangle |= val.layout.ty.is_like_maybe_dangling(); + // default handler try_validation!( self.walk_value(val), @@ -1546,6 +1540,8 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValueVisitor<'tcx, M> for ValidityVisitor<'rt, Ub(InvalidVTableTrait { vtable_dyn_type, expected_dyn_type }) => InvalidMetaWrongTrait { expected_dyn_type, vtable_dyn_type }, ); + + self.may_dangle = old_may_dangle; } } diff --git a/compiler/rustc_expand/Cargo.toml b/compiler/rustc_expand/Cargo.toml index 0f216aa9f68df..1d0864ff7b201 100644 --- a/compiler/rustc_expand/Cargo.toml +++ b/compiler/rustc_expand/Cargo.toml @@ -20,7 +20,6 @@ rustc_hir = { path = "../rustc_hir" } rustc_lexer = { path = "../rustc_lexer" } rustc_lint_defs = { path = "../rustc_lint_defs" } rustc_macros = { path = "../rustc_macros" } -rustc_middle = { path = "../rustc_middle" } rustc_parse = { path = "../rustc_parse" } # We must use the proc_macro version that we will compile proc-macros against, # not the one from our own sysroot. @@ -29,7 +28,6 @@ rustc_serialize = { path = "../rustc_serialize" } rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } rustc_structures = { path = "../rustc_structures" } -scoped-tls = "1.0" smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } thin-vec = "0.2.19" tracing = "0.1" diff --git a/compiler/rustc_expand/src/lib.rs b/compiler/rustc_expand/src/lib.rs index 8bbca0ddf0f90..c81d9eb12aa48 100644 --- a/compiler/rustc_expand/src/lib.rs +++ b/compiler/rustc_expand/src/lib.rs @@ -23,7 +23,3 @@ pub mod config; pub mod expand; pub mod module; pub mod proc_macro; - -pub fn provide(providers: &mut rustc_middle::query::Providers) { - providers.derive_macro_expansion = proc_macro::provide_derive_macro_expansion; -} diff --git a/compiler/rustc_expand/src/mbe/diagnostics.rs b/compiler/rustc_expand/src/mbe/diagnostics.rs index 89b4aac3299fc..024a0542a5f64 100644 --- a/compiler/rustc_expand/src/mbe/diagnostics.rs +++ b/compiler/rustc_expand/src/mbe/diagnostics.rs @@ -6,7 +6,6 @@ use rustc_attr_ir::diagnostic::{CustomDiagnostic, Directive, FormatArgs}; use rustc_data_structures::fx::FxHashSet; use rustc_errors::{Applicability, Diag, DiagCtxtHandle, DiagMessage, pluralize}; use rustc_macros::Subdiagnostic; -use rustc_middle::bug; use rustc_parse::parser::{Parser, Recovery, token_descr}; use rustc_session::parse::ParseSess; use rustc_span::source_map::SourceMap; @@ -203,7 +202,7 @@ impl BestFailure { impl<'dcx, 'matcher> Tracker<'matcher> for CollectTrackerAndEmitter<'dcx, 'matcher> { fn prepare(&mut self, which_matcher: WhichMatcher, matcher: &'matcher [MatcherLoc]) { if self.current.is_some() { - bug!("`Self::after_arm()` was not called to clean up context"); + panic!("`Self::after_arm()` was not called to clean up context"); } self.current = Some((which_matcher, matcher)); @@ -236,12 +235,12 @@ impl<'dcx, 'matcher> Tracker<'matcher> for CollectTrackerAndEmitter<'dcx, 'match } Failure => { if self.best_failure.is_none() { - bug!("A matching failure occurred but `Self::failure()` was not called"); + panic!("A matching failure occurred but `Self::failure()` was not called"); } } Ambiguity => { if self.result.is_none() { - bug!("An ambiguity error occurred but `Self::ambiguity()` was not called"); + panic!("An ambiguity error occurred but `Self::ambiguity()` was not called"); } } ErrorReported(guar) => self.result = Some((self.root_span, guar)), @@ -253,7 +252,7 @@ impl<'dcx, 'matcher> Tracker<'matcher> for CollectTrackerAndEmitter<'dcx, 'match fn failure(&mut self, parser: &Parser<'_>) { let Some((which_matcher, _)) = self.current else { - bug!("`Self::prepare()` was not called to initialize context"); + panic!("`Self::prepare()` was not called to initialize context"); }; let mut token = parser.token; @@ -290,7 +289,7 @@ impl<'dcx, 'matcher> Tracker<'matcher> for CollectTrackerAndEmitter<'dcx, 'match fn ambiguity(&mut self, parser: &Parser<'_>) { let Some((_, matcher)) = self.current else { - bug!("`Self::prepare()` was not called to initialize context"); + panic!("`Self::prepare()` was not called to initialize context"); }; #[expect( diff --git a/compiler/rustc_expand/src/mbe/macro_parser.rs b/compiler/rustc_expand/src/mbe/macro_parser.rs index 95a4ebc63d38b..3e94e0ca34773 100644 --- a/compiler/rustc_expand/src/mbe/macro_parser.rs +++ b/compiler/rustc_expand/src/mbe/macro_parser.rs @@ -80,7 +80,6 @@ pub(crate) use ParseResult::*; use rustc_ast::token::{self, DocComment, NonterminalKind, Token, TokenKind}; use rustc_data_structures::fx::FxHashMap; use rustc_errors::{Diag, ErrorGuaranteed}; -use rustc_middle::span_bug; use rustc_parse::parser::{ParseNtResult, Parser, token_descr}; use rustc_span::{Ident, MacroRulesNormalizedIdent, Span}; @@ -732,17 +731,14 @@ impl TtParser { // `NamedParseResult`. Otherwise, it's an error. let mut ret_val = FxHashMap::default(); for loc in matcher { - if let &MatcherLoc::MetaVarDecl { span, bind, .. } = loc + if let &MatcherLoc::MetaVarDecl { bind, .. } = loc && ret_val .insert(MacroRulesNormalizedIdent::new(bind), res.next().unwrap()) .is_some() { // Duplicate binds are checked for when the macro definition is processed, // and should have prevented the definition from ever being used. - span_bug!( - span, - "duplicate meta-variable binding went undetected at macro definition" - ) + panic!("duplicate meta-variable binding went undetected at macro definition") } } ret_val diff --git a/compiler/rustc_expand/src/proc_macro.rs b/compiler/rustc_expand/src/proc_macro.rs index 105d2d796aa80..5e01b851b75c7 100644 --- a/compiler/rustc_expand/src/proc_macro.rs +++ b/compiler/rustc_expand/src/proc_macro.rs @@ -1,8 +1,8 @@ use rustc_ast as ast; use rustc_ast::tokenstream::TokenStream; +use rustc_data_structures::AtomicRef; use rustc_data_structures::profiling::TimingGuard; use rustc_errors::ErrorGuaranteed; -use rustc_middle::ty::{self, TyCtxt}; use rustc_parse::parser::{AllowConstBlockItems, ForceCollect, Parser}; use rustc_proc_macro as pm; use rustc_session::Session; @@ -113,14 +113,7 @@ impl MultiItemModifier for DeriveProcMacro { let res = if ecx.sess.opts.incremental.is_some() && ecx.sess.opts.unstable_opts.cache_proc_macros { - ty::tls::with(|tcx| { - let input = &*tcx.arena.alloc(input); - let key: (LocalExpnId, &TokenStream) = (invoc_id, input); - - QueryDeriveExpandCtx::enter(ecx, self.client, move || { - tcx.derive_macro_expansion(key).cloned() - }) - }) + (*EXPAND_DERIVE_MACRO_CACHED)(invoc_id, input, ecx, self.client) } else { expand_derive_macro(invoc_id, input, ecx, self.client) }; @@ -163,24 +156,9 @@ impl MultiItemModifier for DeriveProcMacro { } } -/// Provide a query for computing the output of a derive macro. -pub(super) fn provide_derive_macro_expansion<'tcx>( - tcx: TyCtxt<'tcx>, - key: (LocalExpnId, &'tcx TokenStream), -) -> Result<&'tcx TokenStream, ()> { - let (invoc_id, input) = key; - - // Make sure that we invalidate the query when the crate defining the proc macro changes - let _ = tcx.crate_hash(invoc_id.expn_data().macro_def_id.unwrap().krate); - - QueryDeriveExpandCtx::with(|ecx, client| { - expand_derive_macro(invoc_id, input.clone(), ecx, client).map(|ts| &*tcx.arena.alloc(ts)) - }) -} - type DeriveClient = pm::bridge::client::Client; -fn expand_derive_macro( +pub fn expand_derive_macro( invoc_id: LocalExpnId, input: TokenStream, ecx: &mut ExtCtxt<'_>, @@ -216,47 +194,12 @@ fn expand_derive_macro( } } -/// Stores the context necessary to expand a derive proc macro via a query. -struct QueryDeriveExpandCtx { - /// Type-erased version of `&mut ExtCtxt` - expansion_ctx: *mut (), - client: DeriveClient, -} - -impl QueryDeriveExpandCtx { - /// Store the extension context and the client into the thread local value. - /// It will be accessible via the `with` method while `f` is active. - fn enter(ecx: &mut ExtCtxt<'_>, client: DeriveClient, f: F) -> R - where - F: FnOnce() -> R, - { - // We need erasure to get rid of the lifetime - let ctx = Self { expansion_ctx: ecx as *mut _ as *mut (), client }; - DERIVE_EXPAND_CTX.set(&ctx, f) - } - - /// Accesses the thread local value of the derive expansion context. - /// Must be called while the `enter` function is active. - fn with(f: F) -> R - where - F: for<'a, 'b> FnOnce(&'b mut ExtCtxt<'a>, DeriveClient) -> R, - { - DERIVE_EXPAND_CTX.with(|ctx| { - let ectx = { - let casted = ctx.expansion_ctx.cast::>(); - // SAFETY: We can only get the value from `with` while the `enter` function - // is active (on the callstack), and that function's signature ensures that the - // lifetime is valid. - // If `with` is called at some other time, it will panic due to usage of - // `scoped_tls::with`. - unsafe { casted.as_mut().unwrap() } - }; - - f(ectx, ctx.client) - }) - } -} - -// When we invoke a query to expand a derive proc macro, we need to provide it with the expansion -// context and derive Client. We do that using a thread-local. -scoped_tls::scoped_thread_local!(static DERIVE_EXPAND_CTX: QueryDeriveExpandCtx); +pub static EXPAND_DERIVE_MACRO_CACHED: AtomicRef< + fn(LocalExpnId, TokenStream, &mut ExtCtxt<'_>, DeriveClient) -> Result, +> = AtomicRef::new( + &(|_, _, _: &mut ExtCtxt<'_>, _| -> Result<_, _> { + panic!( + "`EXPAND_DERIVE_MACRO_CACHED` callback was not setup; it must be set in `rustc_interface::callbacks`" + ) + } as _), +); diff --git a/compiler/rustc_expand_queries/Cargo.toml b/compiler/rustc_expand_queries/Cargo.toml new file mode 100644 index 0000000000000..abf932e24716d --- /dev/null +++ b/compiler/rustc_expand_queries/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "rustc_expand_queries" +version = "0.0.0" +edition = "2024" +build = false + +[lib] +doctest = false + +[dependencies] +# tidy-alphabetical-start +rustc_ast = { path = "../rustc_ast" } +rustc_expand = { path = "../rustc_expand" } +rustc_middle = { path = "../rustc_middle" } +# We must use the proc_macro version that we will compile proc-macros against, +# not the one from our own sysroot. +rustc_proc_macro = { path = "../rustc_proc_macro" } +rustc_span = { path = "../rustc_span" } +scoped-tls = "1.0" +# tidy-alphabetical-end diff --git a/compiler/rustc_expand_queries/src/derive.rs b/compiler/rustc_expand_queries/src/derive.rs new file mode 100644 index 0000000000000..1254013ad89bb --- /dev/null +++ b/compiler/rustc_expand_queries/src/derive.rs @@ -0,0 +1,82 @@ +use rustc_ast::tokenstream::TokenStream; +use rustc_expand::base::ExtCtxt; +use rustc_middle::ty::{TyCtxt, tls}; +use rustc_proc_macro as pm; +use rustc_span::LocalExpnId; + +type DeriveClient = pm::bridge::client::Client; + +/// Stores the context necessary to expand a derive proc macro via a query. +struct QueryDeriveExpandCtx { + /// Type-erased version of `&mut ExtCtxt` + expansion_ctx: *mut (), + client: DeriveClient, +} + +impl QueryDeriveExpandCtx { + /// Store the extension context and the client into the thread local value. + /// It will be accessible via the `with` method while `f` is active. + fn enter(ecx: &mut ExtCtxt<'_>, client: DeriveClient, f: F) -> R + where + F: FnOnce() -> R, + { + // We need erasure to get rid of the lifetime + let ctx = Self { expansion_ctx: ecx as *mut _ as *mut (), client }; + DERIVE_EXPAND_CTX.set(&ctx, f) + } + + /// Accesses the thread local value of the derive expansion context. + /// Must be called while the `enter` function is active. + fn with(f: F) -> R + where + F: for<'a, 'b> FnOnce(&'b mut ExtCtxt<'a>, DeriveClient) -> R, + { + DERIVE_EXPAND_CTX.with(|ctx| { + let ectx = { + let casted = ctx.expansion_ctx.cast::>(); + // SAFETY: We can only get the value from `with` while the `enter` function + // is active (on the callstack), and that function's signature ensures that the + // lifetime is valid. + // If `with` is called at some other time, it will panic due to usage of + // `scoped_tls::with`. + unsafe { casted.as_mut().unwrap() } + }; + + f(ectx, ctx.client) + }) + } +} + +// When we invoke a query to expand a derive proc macro, we need to provide it with the expansion +// context and derive Client. We do that using a thread-local. +scoped_tls::scoped_thread_local!(static DERIVE_EXPAND_CTX: QueryDeriveExpandCtx); + +pub(crate) fn expand_derive_macro_cached( + invoc_id: LocalExpnId, + input: TokenStream, + ecx: &mut ExtCtxt<'_>, + client: DeriveClient, +) -> Result { + tls::with(|tcx| { + let input = &*tcx.arena.alloc(input); + let key: (LocalExpnId, &TokenStream) = (invoc_id, input); + + QueryDeriveExpandCtx::enter(ecx, client, move || tcx.derive_macro_expansion(key).cloned()) + }) +} + +/// Provide a query for computing the output of a derive macro. +pub(crate) fn derive_macro_expansion<'tcx>( + tcx: TyCtxt<'tcx>, + key: (LocalExpnId, &'tcx TokenStream), +) -> Result<&'tcx TokenStream, ()> { + let (invoc_id, input) = key; + + // Make sure that we invalidate the query when the crate defining the proc macro changes + let _ = tcx.crate_hash(invoc_id.expn_data().macro_def_id.unwrap().krate); + + QueryDeriveExpandCtx::with(|ecx, client| { + rustc_expand::proc_macro::expand_derive_macro(invoc_id, input.clone(), ecx, client) + .map(|ts| &*tcx.arena.alloc(ts)) + }) +} diff --git a/compiler/rustc_expand_queries/src/lib.rs b/compiler/rustc_expand_queries/src/lib.rs new file mode 100644 index 0000000000000..ef669460aeec2 --- /dev/null +++ b/compiler/rustc_expand_queries/src/lib.rs @@ -0,0 +1,13 @@ +#![allow(internal_features, reason = "proc macro internals")] +#![feature(proc_macro_internals)] + +mod derive; + +pub fn setup_callbacks() { + rustc_expand::proc_macro::EXPAND_DERIVE_MACRO_CACHED + .swap(&(derive::expand_derive_macro_cached as _)); +} + +pub fn provide(providers: &mut rustc_middle::query::Providers) { + providers.derive_macro_expansion = derive::derive_macro_expansion; +} diff --git a/compiler/rustc_hir_typeck/src/inline_asm.rs b/compiler/rustc_hir_typeck/src/inline_asm.rs index 0e522b58ea280..e0fccce9577eb 100644 --- a/compiler/rustc_hir_typeck/src/inline_asm.rs +++ b/compiler/rustc_hir_typeck/src/inline_asm.rs @@ -13,7 +13,8 @@ use rustc_middle::ty::{ use rustc_span::def_id::LocalDefId; use rustc_span::{ErrorGuaranteed, Span, Symbol, sym}; use rustc_target::asm::{ - InlineAsmReg, InlineAsmRegClass, InlineAsmRegOrRegClass, InlineAsmType, ModifierInfo, + InlineAsmReg, InlineAsmRegClass, InlineAsmRegOrRegClass, InlineAsmSize, InlineAsmType, + ModifierInfo, }; use rustc_trait_selection::infer::InferCtxtExt; @@ -158,6 +159,28 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> { _ => Err(NonAsmTypeReason::InvalidElement(field.did, ty)), } } + ty::Adt(adt, _args) if adt.repr().scalable() => { + let (_element_count, elem_ty, _number_of_vectors) = + ty.scalable_vector_parts(self.tcx()).unwrap(); + + match elem_ty.kind() { + ty::Int(IntTy::I8) | ty::Uint(UintTy::U8) => Ok(InlineAsmType::SveVecI8), + ty::Int(IntTy::I16) | ty::Uint(UintTy::U16) => Ok(InlineAsmType::SveVecI16), + ty::Int(IntTy::I32) | ty::Uint(UintTy::U32) => Ok(InlineAsmType::SveVecI32), + ty::Int(IntTy::I64) | ty::Uint(UintTy::U64) => Ok(InlineAsmType::SveVecI64), + ty::Int(IntTy::I128) | ty::Uint(UintTy::U128) => Ok(InlineAsmType::SveVecI128), + ty::Float(FloatTy::F16) => Ok(InlineAsmType::SveVecF16), + ty::Float(FloatTy::F32) => Ok(InlineAsmType::SveVecF32), + ty::Float(FloatTy::F64) => Ok(InlineAsmType::SveVecF64), + ty::Float(FloatTy::F128) => Ok(InlineAsmType::SveVecF128), + ty::Bool => Ok(InlineAsmType::SveVecBool), + _ => { + let fields = &adt.non_enum_variant().fields; + let field = &fields[FieldIdx::ZERO]; + Err(NonAsmTypeReason::InvalidElement(field.did, ty)) + } + } + } ty::Infer(_) => bug!("unexpected infer ty in asm operand"), _ => Err(NonAsmTypeReason::Invalid(ty)), } @@ -177,10 +200,10 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> { idx: usize, suggested_modifier: char, suggested_result: &'a str, - suggested_size: u16, + suggested_size: InlineAsmSize, default_modifier: char, default_result: &'a str, - default_size: u16, + default_size: InlineAsmSize, } impl<'a, 'b> Diagnostic<'a, ()> for FormattingSubRegisterArg<'b> { @@ -195,13 +218,24 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> { default_result, default_size, } = self; + + fn format_size(size: InlineAsmSize) -> String { + match size { + InlineAsmSize::FixedBytes(size) => format!("{size}-byte values"), + InlineAsmSize::Scalable => "scalable values".to_string(), + } + } Diag::new(dcx, level, "formatting may not be suitable for sub-register argument") .with_span_label(expr_span, "for this argument") .with_help(format!( - "use `{{{idx}:{suggested_modifier}}}` to have the register formatted as `{suggested_result}` (for {suggested_size}-bit values)", + "use `{{{idx}:{suggested_modifier}}}` to have the register formatted as \ + `{suggested_result}` (for {})", + format_size(suggested_size) )) .with_help(format!( - "or use `{{{idx}:{default_modifier}}}` to keep the default formatting of `{default_result}` (for {default_size}-bit values)", + "or use `{{{idx}:{default_modifier}}}` to keep the default formatting of \ + `{default_result}` (for {})", + format_size(default_size) )) } } @@ -239,8 +273,8 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> { NonAsmTypeReason::Invalid(ty) => { let msg = format!("cannot use value of type `{ty}` for inline assembly"); self.fcx.dcx().struct_span_err(expr.span, msg).with_note( - "only integers, floats, SIMD vectors, pointers and function pointers \ - can be used as arguments for inline assembly", + "only integers, floats, SIMD vectors, scalable vectors, pointers and function \ + pointers can be used as arguments for inline assembly", ).emit(); } NonAsmTypeReason::NotSizedPtr(ty) => { diff --git a/compiler/rustc_index/src/vec.rs b/compiler/rustc_index/src/vec.rs index 13f0dda180be9..97aad8e6e8c04 100644 --- a/compiler/rustc_index/src/vec.rs +++ b/compiler/rustc_index/src/vec.rs @@ -197,6 +197,11 @@ impl IndexVec { pub fn append(&mut self, other: &mut Self) { self.raw.append(&mut other.raw); } + + #[inline] + pub fn debug_map_view(&self) -> IndexSliceMapView<'_, I, T> { + IndexSliceMapView(self.as_slice()) + } } /// `IndexVec` is often used as a map, so it provides some map-like APIs. @@ -220,11 +225,44 @@ impl IndexVec> { pub fn contains(&self, index: I) -> bool { self.get(index).and_then(Option::as_ref).is_some() } + + /// This debug view will skip printing `None` entries. + /// This is useful when the slice is actually like a map and `None` means + /// a value is absent under that key. + #[inline] + pub fn debug_map_view_compact(&self) -> IndexSliceMapViewCompact<'_, I, T> { + IndexSliceMapViewCompact(self.as_slice()) + } } +pub struct IndexSliceMapView<'a, I: Idx, T>(&'a IndexSlice); +pub struct IndexSliceMapViewCompact<'a, I: Idx, T>(&'a IndexSlice>); + impl fmt::Debug for IndexVec { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Debug::fmt(&self.raw, fmt) + fmt::Debug::fmt(self.as_slice(), fmt) + } +} + +impl<'a, I: Idx, T: fmt::Debug> fmt::Debug for IndexSliceMapView<'a, I, T> { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + let mut entries = fmt.debug_map(); + for (idx, val) in self.0.iter_enumerated() { + entries.entry(&idx, val); + } + entries.finish() + } +} + +impl<'a, I: Idx, T: fmt::Debug> fmt::Debug for IndexSliceMapViewCompact<'a, I, T> { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + let mut entries = fmt.debug_map(); + for (idx, val) in self.0.iter_enumerated() { + if let Some(val) = val { + entries.entry(&idx, val); + } + } + entries.finish() } } diff --git a/compiler/rustc_interface/Cargo.toml b/compiler/rustc_interface/Cargo.toml index 4e99ba176d57b..cbf961f4cc58b 100644 --- a/compiler/rustc_interface/Cargo.toml +++ b/compiler/rustc_interface/Cargo.toml @@ -20,6 +20,7 @@ rustc_crate_store = { path = "../rustc_crate_store" } rustc_data_structures = { path = "../rustc_data_structures" } rustc_errors = { path = "../rustc_errors" } rustc_expand = { path = "../rustc_expand" } +rustc_expand_queries = { path = "../rustc_expand_queries" } rustc_feature = { path = "../rustc_feature" } rustc_fs_util = { path = "../rustc_fs_util" } rustc_hir = { path = "../rustc_hir" } diff --git a/compiler/rustc_interface/src/callbacks.rs b/compiler/rustc_interface/src/callbacks.rs index 2fad0297e31e0..a0a2317dc7532 100644 --- a/compiler/rustc_interface/src/callbacks.rs +++ b/compiler/rustc_interface/src/callbacks.rs @@ -91,4 +91,5 @@ pub fn setup_callbacks() { rustc_hir::def_id::DEF_ID_DEBUG.swap(&(def_id_debug as fn(_, &mut fmt::Formatter<'_>) -> _)); rustc_errors::TRACK_DIAGNOSTIC.swap(&(track_diagnostic as _)); rustc_feature::TRACK_FEATURE.swap(&(track_feature as _)); + rustc_expand_queries::setup_callbacks(); } diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index c829864b02288..3a8a4224ffa95 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -907,7 +907,7 @@ pub static DEFAULT_QUERY_PROVIDERS: LazyLock = LazyLock::new(|| { providers.queries.proc_macro_decls_static = |tcx, _| tcx.hir_crate_items(()).proc_macro_decls(); rustc_ast_lowering::provide(&mut providers.queries); limits::provide(&mut providers.queries); - rustc_expand::provide(&mut providers.queries); + rustc_expand_queries::provide(&mut providers.queries); rustc_const_eval::provide(providers); rustc_middle::hir::provide(&mut providers.queries); rustc_borrowck::provide(&mut providers.queries); diff --git a/compiler/rustc_middle/src/ich.rs b/compiler/rustc_middle/src/ich.rs index 20c4b3babe9e1..6e0a855707f9d 100644 --- a/compiler/rustc_middle/src/ich.rs +++ b/compiler/rustc_middle/src/ich.rs @@ -8,7 +8,7 @@ use rustc_data_structures::stable_hash::{ use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_session::Session; use rustc_span::source_map::SourceMap; -use rustc_span::{CachingSourceMapView, DUMMY_SP, Pos, Span}; +use rustc_span::{BytePos, CachingSourceMapView, DUMMY_SP, Pos, Span}; // Very often, we are hashing something that does not need the `CachingSourceMapView`, so we // initialize it lazily. @@ -91,6 +91,20 @@ impl<'a> StableHashCtxt for StableHashState<'a> { const TAG_INVALID_SPAN: u8 = 1; const TAG_RELATIVE_SPAN: u8 = 2; + #[inline] + fn pack_span_location( + line_lo: usize, + col_lo: BytePos, + line_hi: usize, + col_hi: BytePos, + ) -> u64 { + let col_lo_trunc = (col_lo.0 as u64) & 0xFF; + let line_lo_trunc = ((line_lo as u64) & 0xFF_FF_FF) << 8; + let col_hi_trunc = ((col_hi.0 as u64) & 0xFF) << 32; + let line_hi_trunc = ((line_hi as u64) & 0xFF_FF_FF) << 40; + col_lo_trunc | line_lo_trunc | col_hi_trunc | line_hi_trunc + } + if !self.stable_hash_controls().hash_spans { return; } @@ -149,11 +163,7 @@ impl<'a> StableHashCtxt for StableHashState<'a> { // issue #74890). A similar analysis applies if some query depends specifically on the // length of the span, but we only hash the end location. So hash both. - let col_lo_trunc = (col_lo.0 as u64) & 0xFF; - let line_lo_trunc = ((line_lo as u64) & 0xFF_FF_FF) << 8; - let col_hi_trunc = (col_hi.0 as u64) & 0xFF << 32; - let line_hi_trunc = ((line_hi as u64) & 0xFF_FF_FF) << 40; - let col_line = col_lo_trunc | line_lo_trunc | col_hi_trunc | line_hi_trunc; + let col_line = pack_span_location(line_lo, col_lo, line_hi, col_hi); let len = (span.hi - span.lo).0; Hash::hash(&col_line, hasher); Hash::hash(&len, hasher); diff --git a/compiler/rustc_middle/src/ty/adt.rs b/compiler/rustc_middle/src/ty/adt.rs index 0eea804b7cb53..af25d881f53bd 100644 --- a/compiler/rustc_middle/src/ty/adt.rs +++ b/compiler/rustc_middle/src/ty/adt.rs @@ -65,6 +65,8 @@ bitflags::bitflags! { /// Indicates whether the type is `FieldRepresentingType`. const IS_FIELD_REPRESENTING_TYPE = 1 << 13; /// Indicates whether the type is `MaybeDangling<_>`. + /// Note that this is not the only type with "maybe dangling" semantics! + /// Use `ty.is_like_maybe_dangling()` to check for that. const IS_MAYBE_DANGLING = 1 << 14; } } @@ -528,12 +530,6 @@ impl<'tcx> AdtDef<'tcx> { self.flags().contains(AdtFlags::IS_MANUALLY_DROP) } - /// Returns `true` if this is `MaybeDangling`. - #[inline] - pub fn is_maybe_dangling(self) -> bool { - self.flags().contains(AdtFlags::IS_MAYBE_DANGLING) - } - /// Returns `true` if this is `Pin`. #[inline] pub fn is_pin(self) -> bool { diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index 764f3b5b93318..c18bf81121377 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -1090,20 +1090,6 @@ where }) } - ty::Adt(adt_def, ..) if adt_def.is_maybe_dangling() => { - Self::ty_and_layout_pointee_info_at(this.field(cx, 0), cx, offset).map(|info| { - PointeeInfo { - // Mark the pointer as raw - // (thus removing noalias/readonly/etc in case of the llvm backend) - safe: None, - // Make sure we don't assert dereferenceability of the pointer. - size: Size::ZERO, - // Preserve the alignment assertion! That is required even inside `MaybeDangling`. - align: info.align, - } - }) - } - _ => { let mut data_variant = match &this.variants { // Within the discriminant field, only the niche itself is @@ -1179,6 +1165,21 @@ where } } + // Patch result if we are a MaybeDangling-like type. + if this.ty.is_like_maybe_dangling() + && let Some(info) = result + { + result = Some(PointeeInfo { + // Mark the pointer as raw + // (thus removing noalias/readonly/etc in case of the llvm backend) + safe: None, + // Make sure we don't assert dereferenceability of the pointer. + size: Size::ZERO, + // Preserve the alignment assertion! That is required even inside `MaybeDangling`. + align: info.align, + }); + } + result } }; diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 013064b5cec4b..462f10c39866e 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -23,7 +23,7 @@ use rustc_type_ir::{ use tracing::instrument; use ty::util::IntTypeExt; -use super::GenericParamDefKind; +use super::{AdtFlags, GenericParamDefKind}; use crate::infer::canonical::Canonical; use crate::traits::ObligationCause; use crate::ty::InferTy::*; @@ -2183,6 +2183,22 @@ impl<'tcx> Ty<'tcx> { pub fn walk(self) -> TypeWalker> { TypeWalker::new(self.into()) } + + /// Returns `true` if this is a `MaybeDangling`-like type, i.e., a type whose inner + /// references are not required to be dereferenceable and are not reborrowed. + #[inline] + pub fn is_like_maybe_dangling(self) -> bool { + match self.kind() { + ty::Adt(def, _) => { + // ManuallyDrop is "natively" like maybe-dangling so that we don't have + // to nest field types even deeper. + def.flags().contains(AdtFlags::IS_MAYBE_DANGLING) + || def.flags().contains(AdtFlags::IS_MANUALLY_DROP) + } + ty::Closure(..) | ty::Coroutine(..) | ty::CoroutineClosure(..) => true, + _ => false, + } + } } impl<'tcx> rustc_type_ir::inherent::Tys> for &'tcx ty::List> { diff --git a/compiler/rustc_mir_build/src/builder/expr/into.rs b/compiler/rustc_mir_build/src/builder/expr/into.rs index 72135df46e904..d5ce1dab1b417 100644 --- a/compiler/rustc_mir_build/src/builder/expr/into.rs +++ b/compiler/rustc_mir_build/src/builder/expr/into.rs @@ -457,9 +457,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let place = b.project_deeper(&[ProjectionElem::Deref], tcx); // Current type: `MaybeUninit`. Field #1 is `ManuallyDrop`. let place = place.project_to_field(FieldIdx::from_u32(1), decls, tcx); - // Current type: `ManuallyDrop`. Field #0 is `MaybeDangling`. - let place = place.project_to_field(FieldIdx::ZERO, decls, tcx); - // Current type: `MaybeDangling`. Field #0 is `T`. + // Current type: `ManuallyDrop`. Field #0 is `T`. let place = place.project_to_field(FieldIdx::ZERO, decls, tcx); // Sanity check. assert_eq!(place.ty(decls, tcx).ty, generic_args.type_at(0)); diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 768f1be1cd48d..7665df4a4e5ae 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -957,6 +957,7 @@ symbols! { ffi_const, ffi_pure, ffi_returns_twice, + ffr, field, field_base, field_init_shorthand, @@ -2067,6 +2068,7 @@ symbols! { suggestion, super_let, supertrait_item_shadowing, + sve, sve_cast, sve_tuple_create2, sve_tuple_create3, diff --git a/compiler/rustc_target/src/asm/aarch64.rs b/compiler/rustc_target/src/asm/aarch64.rs index 2db8a7ff3020d..83d249262c104 100644 --- a/compiler/rustc_target/src/asm/aarch64.rs +++ b/compiler/rustc_target/src/asm/aarch64.rs @@ -1,9 +1,10 @@ +use core::convert::Into; use std::fmt; use rustc_data_structures::fx::FxIndexSet; use rustc_span::{Symbol, sym}; -use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; +use super::{InlineAsmArch, InlineAsmSize, InlineAsmType, ModifierInfo}; use crate::spec::{Env, Os, RelocModel, Target}; def_reg_class! { @@ -12,6 +13,7 @@ def_reg_class! { vreg, vreg_low16, preg, + ffr, } } @@ -19,8 +21,8 @@ impl AArch64InlineAsmRegClass { pub fn valid_modifiers(self, _arch: super::InlineAsmArch) -> &'static [char] { match self { Self::reg => &['w', 'x'], - Self::vreg | Self::vreg_low16 => &['b', 'h', 's', 'd', 'q', 'v'], - Self::preg => &[], + Self::vreg | Self::vreg_low16 => &['b', 'h', 's', 'd', 'q', 'v', 'z'], + Self::preg | Self::ffr => &[], } } @@ -30,43 +32,67 @@ impl AArch64InlineAsmRegClass { pub fn suggest_modifier(self, _arch: InlineAsmArch, ty: InlineAsmType) -> Option { match self { - Self::reg => match ty.size().bits() { - 64 => None, - _ => Some(('w', "w0", 32).into()), + Self::reg => match ty.size() { + InlineAsmSize::FixedBytes(8) => None, + _ => Some(('w', "w0", InlineAsmSize::FixedBytes(4)).into()), }, - Self::vreg | Self::vreg_low16 => match ty.size().bits() { - 8 => Some(('b', "b0", 8).into()), - 16 => Some(('h', "h0", 16).into()), - 32 => Some(('s', "s0", 32).into()), - 64 => Some(('d', "d0", 64).into()), - 128 => Some(('q', "q0", 128).into()), + Self::vreg | Self::vreg_low16 => match ty.size() { + InlineAsmSize::FixedBytes(1) => Some(('b', "b0", ty.size()).into()), + InlineAsmSize::FixedBytes(2) => Some(('h', "h0", ty.size()).into()), + InlineAsmSize::FixedBytes(4) => Some(('s', "s0", ty.size()).into()), + InlineAsmSize::FixedBytes(8) => Some(('d', "d0", ty.size()).into()), + InlineAsmSize::FixedBytes(16) => Some(('q', "q0", ty.size()).into()), + InlineAsmSize::Scalable => Some(('z', "z0", InlineAsmSize::Scalable).into()), _ => None, }, - Self::preg => None, + Self::preg | Self::ffr => None, } } pub fn default_modifier(self, _arch: InlineAsmArch) -> Option { match self { - Self::reg => Some(('x', "x0", 64).into()), - Self::vreg | Self::vreg_low16 => Some(('v', "v0", 128).into()), - Self::preg => None, + Self::reg => Some(('x', "x0", InlineAsmSize::FixedBytes(8)).into()), + Self::vreg | Self::vreg_low16 => { + Some(('v', "v0", InlineAsmSize::FixedBytes(16)).into()) + } + Self::preg | Self::ffr => None, } } pub fn supported_types( self, _arch: InlineAsmArch, + allow_experimental_reg: bool, ) -> &'static [(InlineAsmType, Option)] { match self { Self::reg => types! { _: I8, I16, I32, I64, F16, F32, F64; }, - Self::vreg | Self::vreg_low16 => types! { - neon: I8, I16, I32, I64, F16, F32, F64, F128, - VecI8(8), VecI16(4), VecI32(2), VecI64(1), VecF16(4), VecF32(2), VecF64(1), - VecI8(16), VecI16(8), VecI32(4), VecI64(2), VecF16(8), VecF32(4), VecF64(2); - // Note: When adding support for SVE vector types, they must be rejected for Arm64EC. - }, - Self::preg => &[], + Self::vreg | Self::vreg_low16 => { + if allow_experimental_reg { + types! { + neon: I8, I16, I32, I64, F16, F32, F64, F128, + VecI8(8), VecI16(4), VecI32(2), VecI64(1), VecF16(4), VecF32(2), VecF64(1), + VecI8(16), VecI16(8), VecI32(4), VecI64(2), VecF16(8), VecF32(4), VecF64(2); + sve: SveVecI8, SveVecI16, SveVecI32, SveVecI64, SveVecI128, SveVecF16, SveVecF32, + SveVecF64, SveVecI128, SveVecF128; + } + } else { + types! { + neon: I8, I16, I32, I64, F16, F32, F64, F128, + VecI8(8), VecI16(4), VecI32(2), VecI64(1), VecF16(4), VecF32(2), VecF64(1), + VecI8(16), VecI16(8), VecI32(4), VecI64(2), VecF16(8), VecF32(4), VecF64(2); + } + } + } + Self::preg => { + if allow_experimental_reg { + types! { + sve: SveVecBool; + } + } else { + &[] + } + } + Self::ffr => &[], } } } @@ -190,7 +216,7 @@ def_regs! { p13: preg = ["p13"] % restricted_for_arm64ec, p14: preg = ["p14"] % restricted_for_arm64ec, p15: preg = ["p15"] % restricted_for_arm64ec, - ffr: preg = ["ffr"] % restricted_for_arm64ec, + ffr: ffr = ["ffr"] % restricted_for_arm64ec, #error = ["x19", "w19"] => "x19 is used internally by LLVM and cannot be used as an operand for inline asm", #error = ["x29", "w29", "fp", "wfp"] => diff --git a/compiler/rustc_target/src/asm/amdgpu.rs b/compiler/rustc_target/src/asm/amdgpu.rs index 0f24ae5dea225..a344ad15bfa21 100644 --- a/compiler/rustc_target/src/asm/amdgpu.rs +++ b/compiler/rustc_target/src/asm/amdgpu.rs @@ -168,7 +168,7 @@ impl AmdgpuInlineAsmRegClass { return None; } - Some(Self::Vgpr(ty.size().bits().try_into().ok()?)) + Some(Self::Vgpr(ty.size().fixed_size_bytes().map(|byte| byte * 8)?.try_into().ok()?)) } pub fn suggest_modifier( diff --git a/compiler/rustc_target/src/asm/mod.rs b/compiler/rustc_target/src/asm/mod.rs index 03301e50b489b..6f9751e807490 100644 --- a/compiler/rustc_target/src/asm/mod.rs +++ b/compiler/rustc_target/src/asm/mod.rs @@ -1,7 +1,6 @@ use std::borrow::Cow; use std::fmt; -use rustc_abi::Size; use rustc_data_structures::fx::{FxHashMap, FxIndexSet}; use rustc_macros::{Decodable, Encodable, StableHash}; use rustc_span::Symbol; @@ -11,11 +10,11 @@ use crate::spec::{Arch, RelocModel, Target}; pub struct ModifierInfo { pub modifier: char, pub result: &'static str, - pub size: u16, + pub size: InlineAsmSize, } -impl From<(char, &'static str, u16)> for ModifierInfo { - fn from((modifier, result, size): (char, &'static str, u16)) -> Self { +impl From<(char, &'static str, InlineAsmSize)> for ModifierInfo { + fn from((modifier, result, size): (char, &'static str, InlineAsmSize)) -> Self { Self { modifier, result, size } } } @@ -649,7 +648,7 @@ impl InlineAsmRegClass { match self { Self::X86(r) => r.supported_types(arch, allow_experimental_reg).into(), Self::Arm(r) => r.supported_types(arch).into(), - Self::AArch64(r) => r.supported_types(arch).into(), + Self::AArch64(r) => r.supported_types(arch, allow_experimental_reg).into(), Self::Amdgpu(r) => r.supported_types(arch).into(), Self::RiscV(r) => r.supported_types(arch).into(), Self::Nvptx(r) => r.supported_types(arch).into(), @@ -796,6 +795,31 @@ pub enum InlineAsmType { VecF32(u64), VecF64(u64), VecF128(u64), + SveVecI8, + SveVecI16, + SveVecI32, + SveVecI64, + SveVecI128, + SveVecF16, + SveVecF32, + SveVecF64, + SveVecF128, + SveVecBool, +} + +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +pub enum InlineAsmSize { + FixedBytes(u64), + Scalable, +} + +impl InlineAsmSize { + pub fn fixed_size_bytes(self) -> Option { + match self { + Self::FixedBytes(size) => Some(size), + Self::Scalable => None, + } + } } impl InlineAsmType { @@ -803,27 +827,29 @@ impl InlineAsmType { matches!(self, Self::I8 | Self::I16 | Self::I32 | Self::I64 | Self::I128) } - pub fn size(self) -> Size { - Size::from_bytes(match self { - Self::I8 => 1, - Self::I16 => 2, - Self::I32 => 4, - Self::I64 => 8, - Self::I128 => 16, - Self::F16 => 2, - Self::F32 => 4, - Self::F64 => 8, - Self::F128 => 16, - Self::VecI8(n) => n * 1, - Self::VecI16(n) => n * 2, - Self::VecI32(n) => n * 4, - Self::VecI64(n) => n * 8, - Self::VecI128(n) => n * 16, - Self::VecF16(n) => n * 2, - Self::VecF32(n) => n * 4, - Self::VecF64(n) => n * 8, - Self::VecF128(n) => n * 16, - }) + pub fn size(self) -> InlineAsmSize { + match self { + Self::I8 => InlineAsmSize::FixedBytes(1), + Self::I16 | Self::F16 => InlineAsmSize::FixedBytes(2), + Self::I32 | Self::F32 => InlineAsmSize::FixedBytes(4), + Self::I64 | Self::F64 => InlineAsmSize::FixedBytes(8), + Self::I128 | Self::F128 => InlineAsmSize::FixedBytes(16), + Self::VecI8(n) => InlineAsmSize::FixedBytes(n), + Self::VecI16(n) | Self::VecF16(n) => InlineAsmSize::FixedBytes(n * 2), + Self::VecI32(n) | Self::VecF32(n) => InlineAsmSize::FixedBytes(n * 4), + Self::VecI64(n) | Self::VecF64(n) => InlineAsmSize::FixedBytes(n * 8), + Self::VecI128(n) | Self::VecF128(n) => InlineAsmSize::FixedBytes(n * 16), + Self::SveVecI8 + | Self::SveVecI16 + | Self::SveVecI32 + | Self::SveVecI64 + | Self::SveVecI128 + | Self::SveVecF16 + | Self::SveVecF32 + | Self::SveVecF64 + | Self::SveVecF128 + | Self::SveVecBool => InlineAsmSize::Scalable, + } } } @@ -848,6 +874,16 @@ impl fmt::Display for InlineAsmType { Self::VecF32(n) => write!(f, "f32x{n}"), Self::VecF64(n) => write!(f, "f64x{n}"), Self::VecF128(n) => write!(f, "f128x{n}"), + Self::SveVecI8 => f.write_str("svint8_t"), + Self::SveVecI16 => f.write_str("svint16_t"), + Self::SveVecI32 => f.write_str("svint32_t"), + Self::SveVecI64 => f.write_str("svint64_t"), + Self::SveVecI128 => f.write_str("svint128_t"), + Self::SveVecF16 => f.write_str("svfloat26_t"), + Self::SveVecF32 => f.write_str("svfloat32_t"), + Self::SveVecF64 => f.write_str("svfloat64_t"), + Self::SveVecF128 => f.write_str("svfloat128_t"), + Self::SveVecBool => f.write_str("svbool_t"), } } } diff --git a/compiler/rustc_target/src/asm/x86.rs b/compiler/rustc_target/src/asm/x86.rs index c582c06d8f4bb..a4775db7e79f8 100644 --- a/compiler/rustc_target/src/asm/x86.rs +++ b/compiler/rustc_target/src/asm/x86.rs @@ -3,7 +3,7 @@ use std::fmt; use rustc_data_structures::fx::FxIndexSet; use rustc_span::Symbol; -use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; +use super::{InlineAsmArch, InlineAsmSize, InlineAsmType, ModifierInfo}; use crate::spec::{RelocModel, Target}; def_reg_class! { @@ -49,33 +49,45 @@ impl X86InlineAsmRegClass { pub fn suggest_class(self, _arch: InlineAsmArch, ty: InlineAsmType) -> Option { match self { - Self::reg | Self::reg_abcd if ty.size().bits() == 8 => Some(Self::reg_byte), + Self::reg | Self::reg_abcd if ty.size() == InlineAsmSize::FixedBytes(1) => { + Some(Self::reg_byte) + } _ => None, } } pub fn suggest_modifier(self, arch: InlineAsmArch, ty: InlineAsmType) -> Option { match self { - Self::reg => match ty.size().bits() { - 16 => Some(('x', "ax", 16).into()), - 32 if arch == InlineAsmArch::X86_64 => Some(('e', "eax", 32).into()), + Self::reg => match ty.size() { + InlineAsmSize::FixedBytes(2) => { + Some(('x', "ax", InlineAsmSize::FixedBytes(2)).into()) + } + InlineAsmSize::FixedBytes(4) if arch == InlineAsmArch::X86_64 => { + Some(('e', "eax", InlineAsmSize::FixedBytes(4)).into()) + } _ => None, }, - Self::reg_abcd => match ty.size().bits() { - 16 => Some(('x', "ax", 16).into()), - 32 if arch == InlineAsmArch::X86_64 => Some(('e', "eax", 32).into()), + Self::reg_abcd => match ty.size() { + InlineAsmSize::FixedBytes(2) => { + Some(('x', "ax", InlineAsmSize::FixedBytes(2)).into()) + } + InlineAsmSize::FixedBytes(4) if arch == InlineAsmArch::X86_64 => { + Some(('e', "eax", InlineAsmSize::FixedBytes(4)).into()) + } _ => None, }, Self::reg_byte => None, Self::xmm_reg => None, - Self::ymm_reg => match ty.size().bits() { - 256 => None, - _ => Some(('x', "xmm0", 128).into()), + Self::ymm_reg => match ty.size() { + InlineAsmSize::FixedBytes(32) => None, + _ => Some(('x', "xmm0", InlineAsmSize::FixedBytes(16)).into()), }, - Self::zmm_reg => match ty.size().bits() { - 512 => None, - 256 => Some(('y', "ymm0", 256).into()), - _ => Some(('x', "xmm0", 128).into()), + Self::zmm_reg => match ty.size() { + InlineAsmSize::FixedBytes(64) => None, + InlineAsmSize::FixedBytes(32) => { + Some(('y', "ymm0", InlineAsmSize::FixedBytes(32)).into()) + } + _ => Some(('x', "xmm0", InlineAsmSize::FixedBytes(16)).into()), }, Self::kreg | Self::kreg0 => None, Self::mmx_reg | Self::x87_reg => None, @@ -87,15 +99,15 @@ impl X86InlineAsmRegClass { match self { Self::reg | Self::reg_abcd => { if arch == InlineAsmArch::X86_64 { - Some(('r', "rax", 64).into()) + Some(('r', "rax", InlineAsmSize::FixedBytes(8)).into()) } else { - Some(('e', "eax", 32).into()) + Some(('e', "eax", InlineAsmSize::FixedBytes(4)).into()) } } Self::reg_byte => None, - Self::xmm_reg => Some(('x', "xmm0", 128).into()), - Self::ymm_reg => Some(('y', "ymm0", 256).into()), - Self::zmm_reg => Some(('z', "zmm0", 512).into()), + Self::xmm_reg => Some(('x', "xmm0", InlineAsmSize::FixedBytes(16)).into()), + Self::ymm_reg => Some(('y', "ymm0", InlineAsmSize::FixedBytes(32)).into()), + Self::zmm_reg => Some(('z', "zmm0", InlineAsmSize::FixedBytes(64)).into()), Self::kreg | Self::kreg0 => None, Self::mmx_reg | Self::x87_reg => None, Self::tmm_reg => None, diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip3.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip3.rs index 9e981cd73f5a7..dea9a130e6e56 100644 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip3.rs +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip3.rs @@ -2,38 +2,44 @@ //! `wasm32-wasip2`, then WASIp3. The main feature of WASIp3 is native async //! support in the component model itself. //! -//! Like `wasm32-wasip2` this target produces a component by default. Support -//! for `wasm32-wasip3` is very early as of the time of this writing so -//! components produced will still import WASIp2 APIs, but that's ok since it's -//! all component-model-level imports anyway. Over time the imports of the -//! standard library will change to WASIp3. +//! Like `wasm32-wasip2` this target produces a component by default. use crate::spec::{Cc, Env, LinkerFlavor, Target, add_link_args}; pub(crate) fn target() -> Target { - // As of now WASIp3 is a lightly edited wasip2 target, so start with that - // and this may grow over time as more features are supported. + // For now wasip3 is a lightly-edited wasip2 target. let mut target = super::wasm32_wasip2::target(); target.llvm_target = "wasm32-wasip3".into(); target.metadata = crate::spec::TargetMetadata { description: Some("WebAssembly".into()), - tier: Some(3), + tier: Some(2), host_tools: Some(false), std: Some(true), }; target.options.env = Env::P3; - // The `--cooperative-threading` flag to the linker dictates the ABI that's - // being used on this target which is to store the stack pointer in a - // component model intrinsic location, for example, rather than a wasm - // global. - // - // Note that this is only specified for `Cc::No`, because when `clang` is - // being used as a linker it'll already pass this. add_link_args( &mut target.pre_link_args, LinkerFlavor::WasmLld(Cc::No), - &["--cooperative-threading"], + &[ + // The `--cooperative-threading` flag to the linker dictates the ABI + // that's being used on this target which is to store the stack + // pointer in a component model intrinsic location, for example, + // rather than a wasm global. + // + // Note that this is only specified for `Cc::No`, because when + // `clang` is being used as a linker it'll already pass this. + "--cooperative-threading", + // This is used as the wasi-libc-defined symbol here is required for + // this target to function. The Rust compiler's symbol exports + // otherwise don't know about this symbol so it's manually exported + // here. + // + // Note that this additionally is only specified for `Cc::No` + // because when `clang` is used the symbol exports happen naturally + // and this isn't needed. + "--export-if-defined=__wasm_task_hook", + ], ); target diff --git a/library/core/src/mem/manually_drop.rs b/library/core/src/mem/manually_drop.rs index 6c2f77a373393..3fb844c7c2927 100644 --- a/library/core/src/mem/manually_drop.rs +++ b/library/core/src/mem/manually_drop.rs @@ -1,7 +1,5 @@ -use crate::cmp::Ordering; -use crate::hash::{Hash, Hasher}; -use crate::marker::{Destruct, StructuralPartialEq}; -use crate::mem::MaybeDangling; +use crate::hash::Hash; +use crate::marker::Destruct; use crate::ops::{Deref, DerefMut, DerefPure}; use crate::ptr; @@ -152,11 +150,11 @@ use crate::ptr; /// [`MaybeUninit`]: crate::mem::MaybeUninit #[stable(feature = "manually_drop", since = "1.20.0")] #[lang = "manually_drop"] -#[derive(Copy, Clone, Debug, Default)] +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(transparent)] #[rustc_pub_transparent] pub struct ManuallyDrop { - value: MaybeDangling, + value: T, } impl ManuallyDrop { @@ -180,7 +178,7 @@ impl ManuallyDrop { #[inline(always)] #[rustc_no_writable] pub const fn new(value: T) -> ManuallyDrop { - ManuallyDrop { value: MaybeDangling::new(value) } + ManuallyDrop { value } } /// Extracts the value from the `ManuallyDrop` container. @@ -198,9 +196,7 @@ impl ManuallyDrop { #[rustc_const_stable(feature = "const_manually_drop", since = "1.32.0")] #[inline(always)] pub const fn into_inner(slot: ManuallyDrop) -> T { - // Cannot use `MaybeDangling::into_inner` as that does not yet have the desired semantics. - // SAFETY: We know this is a valid `T`. `slot` will not be dropped. - unsafe { (&raw const slot).cast::().read() } + slot.value } /// Takes the value from the `ManuallyDrop` container out. @@ -225,7 +221,7 @@ impl ManuallyDrop { pub const unsafe fn take(slot: &mut ManuallyDrop) -> T { // SAFETY: we are reading from a reference, which is guaranteed // to be valid for reads. - unsafe { ptr::read(slot.value.as_ref()) } + unsafe { ptr::read(&slot.value) } } } @@ -262,7 +258,7 @@ impl ManuallyDrop { // SAFETY: we are dropping the value pointed to by a mutable reference // which is guaranteed to be valid for writes. // It is up to the caller to make sure that `slot` isn't dropped again. - unsafe { ptr::drop_in_place(slot.value.as_mut()) } + unsafe { ptr::drop_in_place(&mut slot.value) } } } @@ -272,7 +268,7 @@ const impl Deref for ManuallyDrop { type Target = T; #[inline(always)] fn deref(&self) -> &T { - self.value.as_ref() + &self.value } } @@ -281,43 +277,9 @@ const impl Deref for ManuallyDrop { const impl DerefMut for ManuallyDrop { #[inline(always)] fn deref_mut(&mut self) -> &mut T { - self.value.as_mut() + &mut self.value } } #[unstable(feature = "deref_pure_trait", issue = "87121")] unsafe impl DerefPure for ManuallyDrop {} - -#[stable(feature = "manually_drop", since = "1.20.0")] -impl Eq for ManuallyDrop {} - -#[stable(feature = "manually_drop", since = "1.20.0")] -impl PartialEq for ManuallyDrop { - fn eq(&self, other: &Self) -> bool { - self.value.as_ref().eq(other.value.as_ref()) - } -} - -#[stable(feature = "manually_drop", since = "1.20.0")] -impl StructuralPartialEq for ManuallyDrop {} - -#[stable(feature = "manually_drop", since = "1.20.0")] -impl Ord for ManuallyDrop { - fn cmp(&self, other: &Self) -> Ordering { - self.value.as_ref().cmp(other.value.as_ref()) - } -} - -#[stable(feature = "manually_drop", since = "1.20.0")] -impl PartialOrd for ManuallyDrop { - fn partial_cmp(&self, other: &Self) -> Option { - self.value.as_ref().partial_cmp(other.value.as_ref()) - } -} - -#[stable(feature = "manually_drop", since = "1.20.0")] -impl Hash for ManuallyDrop { - fn hash(&self, state: &mut H) { - self.value.as_ref().hash(state); - } -} diff --git a/library/core/src/slice/index.rs b/library/core/src/slice/index.rs index b82d79232becc..47f934c37cab4 100644 --- a/library/core/src/slice/index.rs +++ b/library/core/src/slice/index.rs @@ -204,7 +204,7 @@ const unsafe impl SliceIndex<[T]> for usize { #[track_caller] unsafe fn get_unchecked(self, slice: *const [T]) -> *const T { assert_unsafe_precondition!( - check_language_ub, // okay because of the `assume` below + check_library_ub, // Hitting the `assume` provides worse const-eval and Miri diagnostics. "slice::get_unchecked requires that the index is within the slice", (this: usize = self, len: usize = slice.len()) => this < len ); diff --git a/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs b/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs index f4115ca6124a7..5a91305c5b9f0 100644 --- a/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs +++ b/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs @@ -253,11 +253,9 @@ where unsafe { // Mustn't call alloc with size 0. let ptr = if size > 0 { - // `copy_to_userspace` is more efficient when data is 8-byte aligned - let alignment = cmp::max(T::align_of(), 8); - rtunwrap!(Ok, super::alloc(size, alignment)) as _ + rtunwrap!(Ok, super::alloc(size, T::align_of())) as _ } else { - T::align_of() as _ // dangling pointer ok for size 0 + crate::ptr::dangling_mut() // dangling pointer ok for size 0 }; if let Ok(v) = crate::panic::catch_unwind(|| T::from_raw_sized(ptr, size)) { User(NonNull::new_userref(v)) diff --git a/library/std/src/thread/lifecycle.rs b/library/std/src/thread/lifecycle.rs index d3a97bbf08fa2..11ab2190c5444 100644 --- a/library/std/src/thread/lifecycle.rs +++ b/library/std/src/thread/lifecycle.rs @@ -7,7 +7,6 @@ use super::thread::Thread; use super::{Result, spawnhook}; use crate::cell::UnsafeCell; use crate::marker::PhantomData; -use crate::mem::MaybeDangling; use crate::sync::Arc; use crate::sync::atomic::{Atomic, AtomicUsize, Ordering}; use crate::sys::{AsInner, IntoInner, thread as imp}; @@ -57,14 +56,9 @@ where Arc::new(Packet { scope: scope_data, result: UnsafeCell::new(None), _marker: PhantomData }); let their_packet = my_packet.clone(); - // Pass `f` in `MaybeDangling` because actually that closure might *run longer than the lifetime of `F`*. - // See for more details. - let f = MaybeDangling::new(f); - // The entrypoint of the Rust thread, after platform-specific thread // initialization is done. let rust_start = move || { - let f = f.into_inner(); let try_result = panic::catch_unwind(panic::AssertUnwindSafe(|| { crate::sys::backtrace::__rust_begin_short_backtrace(|| hooks.inherit_and_run()); crate::sys::backtrace::__rust_begin_short_backtrace(f) diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index a729e1ebfb7bf..a85921214fe51 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -439,15 +439,6 @@ fn copy_self_contained_objects( ) }); - // wasm32-wasip3 doesn't exist in wasi-libc yet, so instead use libs - // from the wasm32-wasip2 target. Once wasi-libc supports wasip3 this - // should be deleted and the native objects should be used. - let srcdir = if target == "wasm32-wasip3" { - assert!(!srcdir.exists(), "wasip3 support is in wasi-libc, this should be updated now"); - builder.wasi_libdir(TargetSelection::from_user("wasm32-wasip2")).unwrap() - } else { - srcdir - }; for &obj in &["libc.a", "crt1-command.o", "crt1-reactor.o"] { copy_and_stamp( builder, @@ -2529,7 +2520,8 @@ impl CommandLineStep for Assemble { } // In addition to `rust-lld` also install `wasm-component-ld` when - // is enabled. This is used by the `wasm32-wasip2` target of Rust. + // is enabled. This is used by targets that produce WebAssembly + // components in Rust such as `wasm32-wasip{2,3}`. if builder.tool_enabled("wasm-component-ld") { let wasm_component = builder.ensure( crate::core::build_steps::tool::WasmComponentLd::for_use_by_compiler( diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index 4ae56503a114e..127dd3b40f787 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -1153,7 +1153,7 @@ impl CommandLineStep for Rustc { target_doc_dir.join("rustc_middle").join("index.html") } else if let Some(krate) = self.crates.first() { // Let's open the first crate documentation page: - target_doc_dir.join(krate).join("index.html") + target_doc_dir.join(normalize_doc_crate_name(krate)).join("index.html") } else { target_doc_dir.clone() }; diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index 3d16806a9581f..0a6ae88316f56 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -5,6 +5,7 @@ use std::{env, fs}; use super::{Builder, Kind}; use crate::core::build_steps::compile::is_lto_stage; +use crate::core::build_steps::llvm::Llvm; use crate::core::build_steps::test; use crate::core::build_steps::tool::SourceType; use crate::core::compiler::Compiler; @@ -1243,12 +1244,18 @@ impl Builder<'_> { if (mode == Mode::ToolRustcPrivate || mode == Mode::Codegen) && self.is_llvm_enabled_for(target) { - let llvm_libdir_raw = command(self.host_llvm_config()) - .cached() - .arg("--libdir") - .run_capture_stdout(self) - .stdout(); - let llvm_libdir = llvm_libdir_raw.trim(); + let llvm_libdir = if self.config.is_host_target(target) { + command(self.host_llvm_config()) + .cached() + .arg("--libdir") + .run_capture_stdout(self) + .stdout() + .trim() + .to_owned() + } else { + let llvm_output = self.ensure(Llvm { target }); + llvm_output.root_dir().join("lib").to_string_lossy().into_owned() + }; if target.is_msvc() { rustflags.arg(&format!("-Clink-arg=-LIBPATH:{llvm_libdir}")); } else { diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_bench.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_bench.snap index bb55f31c405d6..c609f5ffd51fa 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_bench.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_bench.snap @@ -45,6 +45,7 @@ expression: bench - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_build_compiler.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_build_compiler.snap index 9d3ff75cc1cce..41529a664a189 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_build_compiler.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_build_compiler.snap @@ -27,6 +27,7 @@ expression: build compiler - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check.snap index 812bc18078999..d5754846441a2 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check.snap @@ -29,6 +29,7 @@ expression: check - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiler.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiler.snap index dc069febfcebe..efedf514001c2 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiler.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiler.snap @@ -29,6 +29,7 @@ expression: check compiler - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiletest_include_default_paths.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiletest_include_default_paths.snap index 921060318f5e5..cb48844356717 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiletest_include_default_paths.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiletest_include_default_paths.snap @@ -29,6 +29,7 @@ expression: check compiletest --include-default-paths - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_clippy.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_clippy.snap index dfb838638bf68..17b69d85ff821 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_clippy.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_clippy.snap @@ -44,6 +44,7 @@ expression: clippy - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_fix.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_fix.snap index 356be4863d1a6..8ed386a4f219a 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_fix.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_fix.snap @@ -29,6 +29,7 @@ expression: fix - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap index 49a1c04c6af63..32ed54050dc3d 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap @@ -93,6 +93,7 @@ expression: test - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap index 397f8dbd794a3..d1cdf81a14e08 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap @@ -90,6 +90,7 @@ expression: test --skip=coverage - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_map.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_map.snap index d4723f9070859..df4b8a2ce1299 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_map.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_map.snap @@ -93,6 +93,7 @@ expression: test --skip=coverage-map - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_run.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_run.snap index 40d211627d7e0..75992df8aa616 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_run.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_run.snap @@ -93,6 +93,7 @@ expression: test --skip=coverage-run - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap index bdd627ae37cc3..72839a9dddb10 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap @@ -54,6 +54,7 @@ expression: test --skip=tests - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_coverage.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_coverage.snap index 7551afd31a79c..a44052fac41f9 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_coverage.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_coverage.snap @@ -90,6 +90,7 @@ expression: test --skip=tests/coverage - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_etc.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_etc.snap index 4457208ab56b9..ee846481847cd 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_etc.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_etc.snap @@ -38,6 +38,7 @@ expression: test --skip=tests --skip=library --skip=tidyselftest - Set({compiler/rustc_error_messages}) - Set({compiler/rustc_errors}) - Set({compiler/rustc_expand}) + - Set({compiler/rustc_expand_queries}) - Set({compiler/rustc_feature}) - Set({compiler/rustc_fs_util}) - Set({compiler/rustc_graphviz}) diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 4d8a7e58e19fd..6ef38d07e45bb 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -1600,7 +1600,7 @@ mod snapshot { insta::assert_snapshot!( ctx.config("check") .path("compiler") - .render_steps(), @"[check] rustc 0 -> rustc 1 (77 crates)"); + .render_steps(), @"[check] rustc 0 -> rustc 1 (78 crates)"); } #[test] @@ -1626,7 +1626,7 @@ mod snapshot { ctx.config("check") .path("compiler") .stage(1) - .render_steps(), @"[check] rustc 0 -> rustc 1 (77 crates)"); + .render_steps(), @"[check] rustc 0 -> rustc 1 (78 crates)"); } #[test] @@ -1640,7 +1640,7 @@ mod snapshot { [build] llvm [build] rustc 0 -> rustc 1 [build] rustc 1 -> std 1 - [check] rustc 1 -> rustc 2 (77 crates) + [check] rustc 1 -> rustc 2 (78 crates) "); } @@ -1656,7 +1656,7 @@ mod snapshot { [build] rustc 0 -> rustc 1 [build] rustc 1 -> std 1 [check] rustc 1 -> std 1 - [check] rustc 1 -> rustc 2 (77 crates) + [check] rustc 1 -> rustc 2 (78 crates) [check] rustc 1 -> rustc 2 [check] rustc 1 -> Rustdoc 2 [check] rustc 1 -> rustc_codegen_cranelift 2 @@ -1753,7 +1753,7 @@ mod snapshot { ctx.config("check") .paths(&["library", "compiler"]) .args(&args) - .render_steps(), @"[check] rustc 0 -> rustc 1 (77 crates)"); + .render_steps(), @"[check] rustc 0 -> rustc 1 (78 crates)"); } #[test] @@ -2982,7 +2982,7 @@ mod snapshot { #[test] fn fix_compiler() { let ctx = TestCtx::new(); - insta::assert_snapshot!(ctx.config("fix").path("compiler").render_steps(), @"[fix] rustc 0 -> rustc 1 (77 crates)"); + insta::assert_snapshot!(ctx.config("fix").path("compiler").render_steps(), @"[fix] rustc 0 -> rustc 1 (78 crates)"); } } diff --git a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile index efdbcbae63467..d753d16aff66c 100644 --- a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile @@ -104,6 +104,7 @@ ENV TARGETS=$TARGETS,wasm32-unknown-unknown ENV TARGETS=$TARGETS,wasm32-wasip1 ENV TARGETS=$TARGETS,wasm32-wasip1-threads ENV TARGETS=$TARGETS,wasm32-wasip2 +ENV TARGETS=$TARGETS,wasm32-wasip3 ENV TARGETS=$TARGETS,wasm32v1-none ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32 ENV TARGETS=$TARGETS,x86_64-fortanix-unknown-sgx diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md index 7518ee9fabbbc..25cecb9be3c2c 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -218,6 +218,7 @@ target | std | notes [`wasm32-wasip1`](platform-support/wasm32-wasip1.md) | ✓ | WebAssembly with WASIp1 [`wasm32-wasip1-threads`](platform-support/wasm32-wasip1-threads.md) | ✓ | WebAssembly with WASI Preview 1 and threads [`wasm32-wasip2`](platform-support/wasm32-wasip2.md) | ✓ | WebAssembly with WASIp2 +[`wasm32-wasip3`](platform-support/wasm32-wasip3.md) | ✓ | WebAssembly with WASIp3 [`wasm32v1-none`](platform-support/wasm32v1-none.md) | * | WebAssembly limited to 1.0 features and no imports [`x86_64-apple-ios`](platform-support/apple-ios.md) | ✓ | 64-bit x86 iOS [`x86_64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | Mac Catalyst on x86_64 @@ -445,7 +446,6 @@ target | std | host | notes [`thumbv8m.main-nuttx-eabihf`](platform-support/nuttx.md) | ✓ | | ARMv8M Mainline with NuttX, hardfloat [`wasm64-unknown-unknown`](platform-support/wasm64-unknown-unknown.md) | ? | | WebAssembly [`wasm32-wali-linux-musl`](platform-support/wasm32-wali-linux.md) | ? | | WebAssembly with [WALI](https://github.com/arjunr2/WALI) -[`wasm32-wasip3`](platform-support/wasm32-wasip3.md) | ✓ | | WebAssembly with WASIp3 [`x86_64-apple-tvos`](platform-support/apple-tvos.md) | ✓ | | x86 64-bit tvOS [`x86_64-apple-watchos-sim`](platform-support/apple-watchos.md) | ✓ | | x86 64-bit Apple WatchOS simulator [`x86_64-lynx-lynxos178`](platform-support/lynxos178.md) | | | x86_64 LynxOS-178 diff --git a/src/doc/rustc/src/platform-support/wasm32-unknown-emscripten.md b/src/doc/rustc/src/platform-support/wasm32-unknown-emscripten.md index 0d15097468b17..fcf6e42be224b 100644 --- a/src/doc/rustc/src/platform-support/wasm32-unknown-emscripten.md +++ b/src/doc/rustc/src/platform-support/wasm32-unknown-emscripten.md @@ -25,14 +25,15 @@ does not (easily) support interop with C/C++ code. Please refer to the [wasm-bindgen](https://crates.io/crates/wasm-bindgen) crate in case you want to interoperate with JavaScript with this target. -Like Emscripten, the WASI targets [`wasm32-wasip1`](./wasm32-wasip1.md) and -[`wasm32-wasip2`](./wasm32-wasip2.md) also provide access to the host environment, -support interop with C/C++ (and other languages), and support most of the Rust -standard library. While the WASI targets are portable across different hosts -(web and non-web), WASI has no standard way of accessing web APIs, whereas -Emscripten has the ability to run arbitrary JS from WASM and access many web APIs. -If you are only targeting the web and need to access web APIs, the -`wasm32-unknown-emscripten` target may be preferable. +Like Emscripten, the WASI targets [`wasm32-wasip1`](./wasm32-wasip1.md), +[`wasm32-wasip2`](./wasm32-wasip2.md), and +[`wasm32-wasip3`](./wasm32-wasip3.md), also provide access to the host +environment, support interop with C/C++ (and other languages), and support most +of the Rust standard library. While the WASI targets are portable across +different hosts (web and non-web), WASI has no standard way of accessing web +APIs, whereas Emscripten has the ability to run arbitrary JS from WASM and +access many web APIs. If you are only targeting the web and need to access web +APIs, the `wasm32-unknown-emscripten` target may be preferable. ## Target maintainers diff --git a/src/doc/rustc/src/platform-support/wasm32-unknown-unknown.md b/src/doc/rustc/src/platform-support/wasm32-unknown-unknown.md index 3dc608e704308..362bf6f255d9d 100644 --- a/src/doc/rustc/src/platform-support/wasm32-unknown-unknown.md +++ b/src/doc/rustc/src/platform-support/wasm32-unknown-unknown.md @@ -15,8 +15,9 @@ but many parts of the standard library do not work and return errors. For example `println!` does nothing, `std::fs` always return errors, and `std::thread::spawn` will panic. There is no means by which this can be overridden. For a WebAssembly target that more fully supports the standard -library see the [`wasm32-wasip1`](./wasm32-wasip1.md) or -[`wasm32-wasip2`](./wasm32-wasip2.md) targets. +library see the [`wasm32-wasip1`](./wasm32-wasip1.md), +[`wasm32-wasip2`](./wasm32-wasip2.md), or +[`wasm32-wasip3`](./wasm32-wasip3.md), targets. The `wasm32-unknown-unknown` target has full support for the `core` and `alloc` crates. It additionally supports the `HashMap` type in the `std` crate, although diff --git a/src/doc/rustc/src/platform-support/wasm32-wasip3.md b/src/doc/rustc/src/platform-support/wasm32-wasip3.md index e8063a1bdcfed..4807adc0c2982 100644 --- a/src/doc/rustc/src/platform-support/wasm32-wasip3.md +++ b/src/doc/rustc/src/platform-support/wasm32-wasip3.md @@ -1,42 +1,49 @@ # `wasm32-wasip3` -**Tier: 3** +**Tier: 2** The `wasm32-wasip3` target is the next stage of evolution of the [`wasm32-wasip2`](./wasm32-wasip2.md) target. The `wasm32-wasip3` target enables the Rust standard library to use WASIp3 APIs to implement various pieces of functionality. WASIp3 brings native async support over WASIp2, which integrates -well with Rust's `async` ecosystem. - -> **Note**: As of 2025-10-01 WASIp3 has not yet been approved by the WASI -> subgroup of the WebAssembly Community Group. Development is expected to -> conclude in late 2025 or early 2026. Until then the Rust standard library -> won't actually use WASIp3 APIs on the `wasm32-wasip3` target as they are not -> yet stable and would reduce the stability of this target. Once WASIp3 is -> approved, however, the standard library will update to use WASIp3 natively. - -> **Note**: This target does not yet build as of 2025-10-01 due to and update -> needed in the `libc` crate. Using it will require a `[patch]` for now. - -> **Note**: Until the standard library is fully migrated to use the `wasip3` -> crate then components produced for `wasm32-wasip3` may import WASIp2 APIs. -> This is considered a transitionary phase until fully support of libstd is -> implemented. +well with Rust's `async` ecosystem. Additionally a future release of Rust's +`wasm32-wasip3` target will support cooperative threading and `std::thread` +APIs. + +The original proposal for adding this target can be found in +[rust-lang/compiler-team#1001] and this target is first available on stable in +Rust 1.100.0. A notable major change from historical WebAssembly targets is that +the ABI of this target is slightly different. The linear memory shadow stack +pointer is stored in a component model task context slot instead of a +WebAssembly` global`. Additionally the base pointer of TLS is managed +differently than other targets. These changes are made to enable cooperative +multithreading on this target. + +> **Note**: As of 2026-09-03 cooperative multithreading is not yet supported on +> this target in Rust. The component model specification and library support +> work for this is in-development and not yet complete, but it's expected to be +> complete before the end of the year. Before that time spawning a thread via +> `std::thread` will return an error. Note though that this support can be +> tested through the [instructions below](#testing-cooperative-multithreading). + +[rust-lang/compiler-team#1001]: https://github.com/rust-lang/compiler-team/issues/1001 ## Target maintainers [@alexcrichton](https://github.com/alexcrichton) +[@yoshuawuyts](https://github.com/yoshuawuyts) ## Requirements -This target is cross-compiled. The target supports `std` fully. +This target is cross-compiled. The target supports `std` fully. This target +requires LLVM 23 to be used and additionally requires `wasi-sdk-34`-or-later if +you're building it locally or linking with this externally. ## Platform requirements -The WebAssembly runtime should support both WASIp2 and WASIp3. Runtimes also -are required to support components since this target outputs a component as -opposed to a core wasm module. Two example runtimes for WASIp3 are [Wasmtime] -and [Jco]. +WebAssembly runtimes that want to execute components compiled for this target +must support WASI 0.3.0 and the requisite required component model features +(notably async). Two example runtimes for WASIp3 are [Wasmtime] and [Jco]. [Wasmtime]: https://wasmtime.dev/ [Jco]: https://github.com/bytecodealliance/jco @@ -44,14 +51,14 @@ and [Jco]. ## Building the target To build this target first acquire a copy of -[`wasi-sdk`](https://github.com/WebAssembly/wasi-sdk/). At this time version 22 +[`wasi-sdk`](https://github.com/WebAssembly/wasi-sdk/). At this time version 34 is the minimum needed. Next configure the `WASI_SDK_PATH` environment variable to point to where this is installed. For example: ```text -export WASI_SDK_PATH=/path/to/wasi-sdk-22.0 +export WASI_SDK_PATH=/path/to/wasi-sdk-34.0 ``` Next be sure to enable LLD when building Rust from source as LLVM's `wasm-ld` @@ -81,3 +88,91 @@ It's recommended to conditionally compile code for this target with: The default set of WebAssembly features enabled for compilation is currently the same as [`wasm32-unknown-unknown`](./wasm32-unknown-unknown.md). See the documentation there for more information. + +## Testing Cooperative Multithreading + +The [component model specification][spec] is in the process of adding intrinsics +to support cooperative multithreading in a component guest. These intrinsics can +be found in the [explainer] and are all gated by the 🧵 emoji. Support for +cooperative multithreading is a work-in-progress and not yet complete, but the +adventurous can configure this target to go ahead and test things out. + +The majority of changes necessary to get cooperative multithreading lie within +Rust's [wasi-libc dependency][wasi-libc]. This means that to test cooperative +multithreading a different build than the default wasi-libc needs to be used. +Starting with [wasi-sdk-34] there is a temporary sysroot which contains support +for a wasip3 target that has multithreading enabled in wasi-libc. To test out +the `wasm32-wasip3` Rust target with threads your compilation needs to be +configured to use this sysroot. + +An example of doing this is this program: + +```rust +fn main() { + std::thread::spawn(|| { + println!("hi"); + }) + .join() + .unwrap(); +} +``` + +is compiled and run by default as: + +```console +$ rustc foo.rs --target wasm32-wasip3 +$ wasmtime foo.wasm + +thread 'main' (1) panicked at library/std/src/thread/functions.rs:131:29: +failed to spawn thread: Os { code: 58, kind: Unsupported, message: "Not supported" } +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +Error: failed to run main module `foo.wasm` + +... +``` + +which shows that by default threads cannot be spawned. By configuring a custom +sysroot to be used, however: + +```console +$ rustc foo.rs --target wasm32-wasip3 \ + -Clink-self-contained=n \ + -Clinker=$WASI_SDK_PATH/bin/wasm32-wasip3-clang \ + -Clink-arg=--sysroot=$WASI_SDK_PATH/share/wasi-sysroot/experimental-coop-threads \ + -Clink-arg=-Wl,--export=cabi_realloc +$ wasmtime -W component-model-threading foo.wasm +hi +``` + +Here `-Clink-self-contained=n` avoids the vendored files in the standard library +which come from a build of wasi-libc incompatible with cooperative +multithreading. The `-Clinker` flag changes to use `clang` to be able to pass a +custom `--sysroot` argument and follow its logic for startup objects. The +`--sysroot` flag then points to the experimental sysroot for coop threads and +`--export` is required right now as a minor workaround. + +When compiling with Cargo you can use these environment variables: + +```console +$ export CARGO_TARGET_WASM32_WASIP3_LINKER=$WASI_SDK_PATH/bin/wasm32-wasip3-clang +$ export CARGO_TARGET_WASM32_WASIP3_RUNNER='wasmtime -W component-model-threading' +$ export CARGO_TARGET_WASM32_WASIP3_RUSTFLAGS="\ + -Clink-self-contained=n \ + -Clink-arg=--sysroot=$WASI_SDK_PATH/share/wasi-sysroot/experimental-coop-threads \ + -Clink-arg=-Wl,--export=cabi_realloc" +$ cargo run --target wasm32-wasip3 +hi +``` + +Standard synchronization primitives in `std::thread` and `std::sync` should all +work on this target with cooperative multithreading. Should you run into any +issues please don't hesitate to file an issue and cc the target maintainers. + +Note that it is currently intended that by the end of 2026 this support will all +be enabled by default and this section of the documentation will be deleted +since working with threads should "just work". + +[spec]: https://github.com/webassembly/component-model +[explainer]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md +[wasi-libc]: https://github.com/webassembly/wasi-libc +[wasi-sdk-34]: https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-34 diff --git a/src/doc/unstable-book/src/language-features/asm-experimental-reg.md b/src/doc/unstable-book/src/language-features/asm-experimental-reg.md index 854d66f96756c..89e82126ece3a 100644 --- a/src/doc/unstable-book/src/language-features/asm-experimental-reg.md +++ b/src/doc/unstable-book/src/language-features/asm-experimental-reg.md @@ -14,6 +14,7 @@ This tracks support for additional registers in architectures where inline assem | ------------ | -------------- | --------- | -------------------- | | LoongArch | `vreg` | `$vr[0-31]` | `f` | | LoongArch | `xreg` | `$xr[0-31]` | `f` | +| AArch64 | `preg` | `p[0-16]` | `Upa` | ## Register class supported types @@ -21,6 +22,8 @@ This tracks support for additional registers in architectures where inline assem | ------------ | -------------- | -------------- | ------------- | | LoongArch | `vreg` | `lsx` | `i128`, `f32`, `f64`,
`i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` | | LoongArch | `xreg` | `lasx` | `i128`, `f32`, `f64`,
`i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2`,
`i8x32`, `i16x16`, `i32x8`, `i64x4`, `f32x8`, `f64x4` | +| AArch64 | `vreg` | `sve` | `i8xN`, `i16xB`, `i32xN`, `i64xN`, `f16xN`, `f32xN`, `f64xN` (scalable vector) | +| AArch64 | `preg` | `sve` | `i1xN` (scalable vector predicate) | ## Register aliases @@ -45,3 +48,4 @@ This tracks support for additional registers in architectures where inline assem | LoongArch | `vreg` | `u` | `$xr0` | `u` | | LoongArch | `xreg` | None | `$xr0` | `u` | | LoongArch | `xreg` | `w` | `$vr0` | `w` | +| AArch64 | `vreg` | `z` | `z0` | `z` | diff --git a/src/etc/gdb_providers.py b/src/etc/gdb_providers.py index a6ef59738c8c7..9c50d7e472000 100644 --- a/src/etc/gdb_providers.py +++ b/src/etc/gdb_providers.py @@ -330,7 +330,7 @@ def cast_to_internal(node): for i in xrange(0, length + 1): if height > 0: - child_ptr = edges[i]["value"]["value"][ZERO_FIELD] + child_ptr = edges[i]["value"]["value"] for child in children_of_node(child_ptr, height - 1): yield child if i < length: @@ -338,12 +338,12 @@ def cast_to_internal(node): key_type_size = keys.type.sizeof val_type_size = vals.type.sizeof key = ( - keys[i]["value"]["value"][ZERO_FIELD] + keys[i]["value"]["value"] if key_type_size > 0 else gdb.parse_and_eval("()") ) val = ( - vals[i]["value"]["value"][ZERO_FIELD] + vals[i]["value"]["value"] if val_type_size > 0 else gdb.parse_and_eval("()") ) diff --git a/src/etc/natvis/libcore.natvis b/src/etc/natvis/libcore.natvis index 4e2f09743a031..20ce1cae447cf 100644 --- a/src/etc/natvis/libcore.natvis +++ b/src/etc/natvis/libcore.natvis @@ -35,9 +35,9 @@ - {value.__0} + {value} - value.__0 + value diff --git a/src/tools/cargotest/lockfiles/diesel.lock b/src/tools/cargotest/lockfiles/diesel.lock new file mode 100644 index 0000000000000..9e2770c7c3e47 --- /dev/null +++ b/src/tools/cargotest/lockfiles/diesel.lock @@ -0,0 +1,2990 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "accessory" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc86a613208ca7d144ca24f6ec49c5cdfa5c05a46f2f7ab5880ff99371f165de" +dependencies = [ + "macroific 3.0.1", + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "advanced-blog-cli" +version = "0.1.0" +dependencies = [ + "argon2", + "assert_matches", + "chrono", + "clap", + "diesel", + "diesel_migrations", + "dotenvy", + "lazy_static", + "openssl-sys", + "pq-sys", + "tempfile", +] + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "all_about_inserts" +version = "0.1.0" +dependencies = [ + "diesel", + "diesel_migrations", + "openssl-sys", + "pq-sys", + "serde", + "serde_json", +] + +[[package]] +name = "all_about_inserts_mysql" +version = "0.1.0" +dependencies = [ + "chrono", + "diesel", + "mysqlclient-sys", + "openssl-sys", + "serde", + "serde_json", +] + +[[package]] +name = "all_about_inserts_sqlite" +version = "0.1.0" +dependencies = [ + "chrono", + "diesel", + "libsqlite3-sys", + "serde", + "serde_json", +] + +[[package]] +name = "all_about_updates" +version = "0.1.0" +dependencies = [ + "diesel", + "openssl-sys", + "pq-sys", +] + +[[package]] +name = "android_system_properties" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "ar_archive_writer" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73cd58deff2140a0a8eae87e417bd01db68a33e148aa93d1e8cd837e55e312b6" +dependencies = [ + "object", +] + +[[package]] +name = "argon2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" +dependencies = [ + "base64ct", + "blake2", + "cpufeatures", + "password-hash", +] + +[[package]] +name = "assert_cmd" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aa3a22042e45de04255c7bf3626e239f450200fd0493c1e382263544b20aea6" +dependencies = [ + "anstyle", + "bstr", + "libc", + "predicates", + "predicates-core", + "predicates-tree", + "wait-timeout", +] + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "async-trait" +version = "0.1.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bigdecimal" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d6867f1565b3aad85681f1015055b087fcfd840d6aeee6eee7f2da317603695" +dependencies = [ + "autocfg", + "libm", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bstr" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" +dependencies = [ + "memchr", + "regex-automata", + "serde_core", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "camino" +version = "1.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb1307f12aa967b5a58416e87b3653360e0fd614a016b6e970db08fecbb1b80d" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad534f4357a5264cce5019c989cf66a4f0dc4e0d1b1d15f8aacec0ff7360273" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "num-traits", + "windows-link", +] + +[[package]] +name = "clap" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473c7e07f409a8d772161724aa8db6a765a2532a70f9667eeb7b49d3d02fbdca" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b48fea5a88e9ae728a2dcbedbfc0e730f7d60da42e1cb049a83c9fb8b789889" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_complete" +version = "4.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be2ad0423bdbbb0e25bc89add796f3559706d4a95e1bc98e4d9662a957b6a19" +dependencies = [ + "clap", +] + +[[package]] +name = "clap_derive" +version = "4.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "composite_types" +version = "0.1.0" +dependencies = [ + "diesel", + "dotenvy", + "openssl-sys", + "pq-sys", +] + +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "windows-sys 0.59.0", +] + +[[package]] +name = "console" +version = "0.16.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe5f465a4f6fee88fad41b85d990f84c835335e85b5d9e6e63e0d06d28cba7c" +dependencies = [ + "encode_unicode", + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "custom_arrays" +version = "0.1.0" +dependencies = [ + "diesel", + "diesel_migrations", + "dotenvy", + "openssl-sys", + "pq-sys", +] + +[[package]] +name = "custom_types" +version = "0.1.0" +dependencies = [ + "diesel", + "openssl-sys", + "pq-sys", +] + +[[package]] +name = "darling" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.119", +] + +[[package]] +name = "darling_macro" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "delegate-display" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e3a499943fd5180aeffcb708164ffb22125ceeccb05491b5297981d37d6249" +dependencies = [ + "impartial-ord", + "itoa", + "macroific 3.0.1", + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.119", + "unicode-xid", +] + +[[package]] +name = "diesel" +version = "2.3.5" +dependencies = [ + "bigdecimal", + "bitflags", + "byteorder", + "cfg-if", + "chrono", + "diesel_derives", + "diesel_test_helper", + "dotenvy", + "downcast-rs", + "getrandom 0.2.17", + "ipnet", + "ipnetwork", + "itoa", + "libc", + "libsqlite3-sys", + "mysqlclient-src", + "mysqlclient-sys", + "num-bigint", + "num-integer", + "num-traits", + "percent-encoding", + "pq-src", + "pq-sys", + "quickcheck", + "r2d2", + "serde_json", + "sqlite-wasm-rs", + "tempfile", + "time", + "url", + "uuid", + "wasm-bindgen-test", +] + +[[package]] +name = "diesel-dynamic-schema" +version = "0.2.4" +dependencies = [ + "diesel", + "dotenvy", +] + +[[package]] +name = "diesel_cli" +version = "2.3.5" +dependencies = [ + "chrono", + "clap", + "clap_complete", + "diesel", + "diesel_infer_query", + "diesel_migrations", + "diesel_table_macro_syntax", + "diffy", + "dotenvy", + "dunce", + "fd-lock", + "heck", + "insta", + "libsqlite3-sys", + "mysqlclient-sys", + "openssl-sys", + "pq-sys", + "regex", + "serde", + "serde_regex", + "similar-asserts", + "syn 2.0.119", + "tempfile", + "thiserror", + "toml", + "tracing", + "tracing-subscriber", + "url", +] + +[[package]] +name = "diesel_derives" +version = "2.3.6" +dependencies = [ + "cfg-if", + "diesel", + "diesel_table_macro_syntax", + "dotenvy", + "dsl_auto_type", + "insta", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "diesel_infer_query" +version = "0.1.0" +dependencies = [ + "insta", + "sqlparser", + "thiserror", +] + +[[package]] +name = "diesel_migrations" +version = "2.3.1" +dependencies = [ + "cfg-if", + "diesel", + "dotenvy", + "migrations_internals", + "migrations_macros", + "tempfile", +] + +[[package]] +name = "diesel_table_macro_syntax" +version = "0.3.0" +dependencies = [ + "syn 2.0.119", +] + +[[package]] +name = "diesel_test_helper" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "diesel_tests" +version = "0.1.0" +dependencies = [ + "assert_matches", + "bigdecimal", + "chrono", + "diesel", + "diesel_migrations", + "diesel_test_helper", + "dotenvy", + "getrandom 0.2.17", + "getrandom 0.3.4", + "ipnet", + "ipnetwork", + "libsqlite3-sys", + "mysqlclient-src", + "mysqlclient-sys", + "pq-src", + "pq-sys", + "quickcheck", + "rand 0.9.5", + "serde_json", + "sqlite-wasm-rs", + "uuid", + "wasm-bindgen-test", +] + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "diffy" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b545b8c50194bdd008283985ab0b31dba153cfd5b3066a92770634fbc0d7d291" +dependencies = [ + "nu-ansi-term", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "downcast-rs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" + +[[package]] +name = "dsl_auto_type" +version = "0.2.0" +dependencies = [ + "darling", + "diesel", + "either", + "heck", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "either" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "env_filter" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900d271a03799a1ee8d1ca9b19893b48ca674a9284fefcfb85f05e74ed314217" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de671bd27a75a797dc9ae289ba1e77276e75e2026408aab65185384e2d5cd3f6" +dependencies = [ + "env_filter", + "log", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fancy_constructor" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a8211ab12c36b63c269e17873331dc1da196a3edb7a5c79015677ef972da34a" +dependencies = [ + "macroific 3.0.1", + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "fd-lock" +version = "4.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce92ff622d6dadf7349484f42c93271a0d49b7cc4d466a936405bacbe10aa78" +dependencies = [ + "cfg-if", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d45db016d36b838f563236e9193d0ee6ce38f3f68b6c94e914b4929c96bbb890" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 5.3.0", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "rand_core 0.10.1", +] + +[[package]] +name = "getting_started_step_1_mysql" +version = "0.1.0" +dependencies = [ + "assert_cmd", + "diesel", + "diesel_migrations", + "dotenvy", + "mysqlclient-sys", + "openssl-sys", + "url", +] + +[[package]] +name = "getting_started_step_1_pg" +version = "0.1.0" +dependencies = [ + "assert_cmd", + "diesel", + "diesel_migrations", + "dotenvy", + "openssl-sys", + "pq-sys", + "url", +] + +[[package]] +name = "getting_started_step_1_sqlite" +version = "0.1.0" +dependencies = [ + "assert_cmd", + "diesel", + "diesel_migrations", + "dotenvy", + "libsqlite3-sys", + "tempfile", +] + +[[package]] +name = "getting_started_step_2_mysql" +version = "0.1.0" +dependencies = [ + "assert_cmd", + "diesel", + "diesel_migrations", + "dotenvy", + "mysqlclient-sys", + "openssl-sys", + "url", +] + +[[package]] +name = "getting_started_step_2_pg" +version = "0.1.0" +dependencies = [ + "assert_cmd", + "diesel", + "diesel_migrations", + "dotenvy", + "openssl-sys", + "pq-sys", + "url", +] + +[[package]] +name = "getting_started_step_2_sqlite" +version = "0.1.0" +dependencies = [ + "assert_cmd", + "diesel", + "diesel_migrations", + "dotenvy", + "libsqlite3-sys", + "tempfile", +] + +[[package]] +name = "getting_started_step_3_mysql" +version = "0.1.0" +dependencies = [ + "assert_cmd", + "diesel", + "diesel_migrations", + "dotenvy", + "mysqlclient-sys", + "openssl-sys", + "url", +] + +[[package]] +name = "getting_started_step_3_pg" +version = "0.1.0" +dependencies = [ + "assert_cmd", + "diesel", + "diesel_migrations", + "dotenvy", + "openssl-sys", + "pq-sys", + "url", +] + +[[package]] +name = "getting_started_step_3_sqlite" +version = "0.1.0" +dependencies = [ + "assert_cmd", + "diesel", + "diesel_migrations", + "dotenvy", + "libsqlite3-sys", + "tempfile", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0" + +[[package]] +name = "icu_properties" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa" + +[[package]] +name = "icu_provider" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "impartial-ord" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc680e03d1a08bdc1c01b60e0c39723430ced63d8cabd93cee0449b6ba916a25" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "indexed_db_futures" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69ff41758cbd104e91033bb53bc449bec7eea65652960c81eddf3fc146ecea19" +dependencies = [ + "accessory", + "cfg-if", + "delegate-display", + "derive_more", + "fancy_constructor", + "indexed_db_futures_macros_internal", + "js-sys", + "sealed 0.6.0", + "smallvec", + "thiserror", + "tokio", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "indexed_db_futures_macros_internal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caeba94923b68f254abef921cea7e7698bf4675fdd89d7c58bf1ed885b49a27d" +dependencies = [ + "macroific 2.0.0", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "insta" +version = "1.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0f8fee8c926415c58d6ae43a08523a26faccb2323f5e6b644fe7dd4ef6b82" +dependencies = [ + "console 0.16.4", + "once_cell", + "similar", + "tempfile", +] + +[[package]] +name = "ipnet" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a756c3fac73139e83f14c2d742155dd2b78d3ee56597b419a0579b7bdd6dd78" + +[[package]] +name = "ipnetwork" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf370abdafd54d13e54a620e8c3e1145f28e46cc9d704bc6d94414559df41763" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "libsqlite3-sys" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f78c730aaa7d0b9336a299029ea49f9ee53b0ed06e9202e8cb7db9bae7b8c82" +dependencies = [ + "cc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" + +[[package]] +name = "macroific" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89f276537b4b8f981bf1c13d79470980f71134b7bdcc5e6e911e910e556b0285" +dependencies = [ + "macroific_attr_parse 2.0.0", + "macroific_core 2.0.0", + "macroific_macro 2.0.0", +] + +[[package]] +name = "macroific" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c437abb3bf40939b00d1dff858ed2050d948bc230dee39546ed16795fcf10ec2" +dependencies = [ + "macroific_attr_parse 3.0.1", + "macroific_core 3.0.1", + "macroific_macro 3.0.1", +] + +[[package]] +name = "macroific_attr_parse" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad4023761b45fcd36abed8fb7ae6a80456b0a38102d55e89a57d9a594a236be9" +dependencies = [ + "proc-macro2", + "quote", + "sealed 0.6.0", + "syn 2.0.119", +] + +[[package]] +name = "macroific_attr_parse" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeb7a82ec1aa16094da719be18615d79cb2574b037358e4e6c6d96eedcff3a93" +dependencies = [ + "proc-macro2", + "quote", + "sealed 0.7.0", + "syn 3.0.4", +] + +[[package]] +name = "macroific_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a7594d3c14916fa55bef7e9d18c5daa9ed410dd37504251e4b75bbdeec33e3" +dependencies = [ + "proc-macro2", + "quote", + "sealed 0.6.0", + "syn 2.0.119", +] + +[[package]] +name = "macroific_core" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26c8e789484d2fa216eee9d5e0565ba80ccda389bcf0e111143a7b8f4792336e" +dependencies = [ + "proc-macro2", + "quote", + "sealed 0.7.0", + "syn 3.0.4", +] + +[[package]] +name = "macroific_macro" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4da6f2ed796261b0a74e2b52b42c693bb6dee1effba3a482c49592659f824b3b" +dependencies = [ + "macroific_attr_parse 2.0.0", + "macroific_core 2.0.0", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "macroific_macro" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e30d63cb102648965753f0d47a6ab171b1cbb1fb5c363f4784ea986782fc7b77" +dependencies = [ + "macroific_attr_parse 3.0.1", + "macroific_core 3.0.1", + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "migrations_internals" +version = "2.3.0" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "migrations_macros" +version = "2.3.0" +dependencies = [ + "cfg-if", + "diesel", + "diesel_migrations", + "dotenvy", + "migrations_internals", + "proc-macro2", + "quote", + "tempfile", +] + +[[package]] +name = "minicov" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3aa3aa12b448ac225b3102217d1ac5cc717908f02722926524b0599c933c7a0" +dependencies = [ + "cc", + "walkdir", +] + +[[package]] +name = "mysqlclient-src" +version = "0.2.2+9.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5918bf2cec3b9a991a82fe9a9e0773997255b7bb6d11a50e8200bdfee9f2953" +dependencies = [ + "cmake", + "link-cplusplus", + "openssl-sys", +] + +[[package]] +name = "mysqlclient-sys" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b72511f8f6991fe4ac86421ea0625630fd94e360b906cc59720506499f9e8f3b" +dependencies = [ + "mysqlclient-src", + "openssl-sys", + "pkg-config", + "semver", + "vcpkg", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-bigint" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" + +[[package]] +name = "num-integer" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "object" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5a6c098c7a3b6547378093f5cc30bc54fd361ce711e05293a5cc589562739b" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "oorandom" +version = "11.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" + +[[package]] +name = "openssl-src" +version = "300.6.1+3.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46eb8fb9fb3b61ce1c0f8a026c4c1a0714d3a9e138e7fbde78753ce2babc3846" +dependencies = [ + "cc", +] + +[[package]] +name = "openssl-sys" +version = "0.9.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" +dependencies = [ + "cc", + "libc", + "openssl-src", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "pq-src" +version = "0.3.11+libpq-18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb5bfbe0c3445d371dd8acf7d6c912ece8baf2f61f7c571af85a1d7687c2d0f" +dependencies = [ + "cc", + "openssl-sys", +] + +[[package]] +name = "pq-sys" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "574ddd6a267294433f140b02a726b0640c43cf7c6f717084684aaa3b285aba61" +dependencies = [ + "libc", + "pkg-config", + "pq-src", + "vcpkg", +] + +[[package]] +name = "predicates" +version = "3.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ada8f2932f28a27ee7b70dd6c1c39ea0675c55a36879ab92f3a715eaa1e63cfe" +dependencies = [ + "anstyle", + "difflib", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cad38746f3166b4031b1a0d39ad9f954dd291e7854fcc0eed52ee41a0b50d144" + +[[package]] +name = "predicates-tree" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0de1b847b39c8131db0467e9df1ff60e6d0562ab8e9a16e568ad0fdb372e2f2" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.119", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd034599e63b970727f70d79e02d62390a4a84f7c6b827c27c46d5ac3fa622" +dependencies = [ + "ar_archive_writer", + "cc", +] + +[[package]] +name = "quickcheck" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95c589f335db0f6aaa168a7cd27b1fc6920f5e1470c804f814d9cd6e62a0f70b" +dependencies = [ + "env_logger", + "log", + "rand 0.10.2", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "r2d2" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93" +dependencies = [ + "log", + "parking_lot", + "scheduled-thread-pool", +] + +[[package]] +name = "rand" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" +dependencies = [ + "rand_chacha", + "rand_core 0.9.5", +] + +[[package]] +name = "rand" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +dependencies = [ + "getrandom 0.4.3", + "rand_core 0.10.1", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "recursive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0786a43debb760f491b1bc0269fe5e84155353c67482b9e60d0cfb596054b43e" +dependencies = [ + "recursive-proc-macro-impl", + "stacker", +] + +[[package]] +name = "recursive-proc-macro-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76009fbe0614077fc1a2ce255e3a1881a2e3a3527097d5dc6d8212c585e7e38b" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "relations" +version = "0.1.0" +dependencies = [ + "diesel", + "dotenvy", + "openssl-sys", + "pq-sys", +] + +[[package]] +name = "relations_sqlite" +version = "0.1.0" +dependencies = [ + "diesel", + "dotenvy", + "libsqlite3-sys", +] + +[[package]] +name = "rsqlite-vfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c" +dependencies = [ + "hashbrown", + "thiserror", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scheduled-thread-pool" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19" +dependencies = [ + "parking_lot", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sealed" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f968c5ea23d555e670b449c1c5e7b2fc399fdaec1d304a17cd48e288abc107" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "sealed" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b68e2ea526d9fb32f23ca8894fb5da9e743f34c2f41701f0501dc8a25c4b343" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_regex" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bafc8d0c5330cecff10f16b459b479fd9acaa5b4acd7167301414e21b0057012" +dependencies = [ + "regex", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "similar" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" +dependencies = [ + "bstr", + "unicode-segmentation", +] + +[[package]] +name = "similar-asserts" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b441962c817e33508847a22bd82f03a30cff43642dc2fae8b050566121eb9a" +dependencies = [ + "console 0.15.11", + "similar", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f" + +[[package]] +name = "sqlite-wasm-example" +version = "0.1.0" +dependencies = [ + "diesel", + "diesel_migrations", + "serde", + "serde-wasm-bindgen", + "sqlite-wasm-rs", + "sqlite-wasm-vfs", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "sqlite-wasm-rs" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3efc0da82635d7e1ced0053bbbfa8c7ab9645d0bf36ceb4f7127bb85315d75" +dependencies = [ + "cc", + "js-sys", + "rsqlite-vfs", + "wasm-bindgen", +] + +[[package]] +name = "sqlite-wasm-vfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0eaef67248b9c7ef44d71890a532978a012e201033ec560603b30226e6f6070" +dependencies = [ + "indexed_db_futures", + "js-sys", + "sqlite-wasm-rs", + "thiserror", + "tokio", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "sqlparser" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4591acadbcf52f0af60eafbb2c003232b2b4cd8de5f0e9437cb8b1b59046cc0f" +dependencies = [ + "log", + "recursive", + "sqlparser_derive", +] + +[[package]] +name = "sqlparser_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da5fc6819faabb412da764b99d3b713bb55083c11e7e0c00144d386cd6a1939c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "stacker" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707f49d46706bacf8a2b00d51dace3f9de527c13eec3778f570c411f89e69967" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "windows-sys 0.61.2", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.3", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "termtree" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" + +[[package]] +name = "thiserror" +version = "2.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "thread_local" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" + +[[package]] +name = "time-macros" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +dependencies = [ + "pin-project-lite", +] + +[[package]] +name = "toml" +version = "0.9.12+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" +dependencies = [ + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "winnow 0.7.15", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_parser" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" +dependencies = [ + "winnow 1.0.4", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5772d71c9be8a8a6ac2117d949c5b224c1b72241bb611d9a3012edcf8af7812" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b7777d5cc23d0e91404e53ce2d5e8ec7acae3026b16233dba62cd3246457950" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.119", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-bindgen-test" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "895a2607575412a4eda1df892084a375ea10dfeadc4d7d2ab87b854e4ddc7ba1" +dependencies = [ + "async-trait", + "cast", + "js-sys", + "libm", + "minicov", + "nu-ansi-term", + "num-traits", + "oorandom", + "serde", + "serde_json", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", + "wasm-bindgen-test-shared", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288cb0ebe215033bf949ae1fd046726daa4c32a157f24b9dc6ac387a52aa759" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "wasm-bindgen-test-shared" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ff1c1b360982e93b6d8ea9c04836f71dba0817a16f91e229cf3a51bdd9d987" + +[[package]] +name = "web-sys" +version = "0.3.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c435338968042f4f59a557f690a253676d47ce13ceb55d70100e7facf6620a30" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" + +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "xtask" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "clap", + "dotenvy", + "tempfile", +] + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/src/tools/cargotest/lockfiles/iron.lock b/src/tools/cargotest/lockfiles/iron.lock new file mode 100644 index 0000000000000..3cf1adc82af12 --- /dev/null +++ b/src/tools/cargotest/lockfiles/iron.lock @@ -0,0 +1,831 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +dependencies = [ + "byteorder", + "either", + "iovec", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "lazy_static", + "maybe-uninit", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg", + "cfg-if", + "lazy_static", +] + +[[package]] +name = "either" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futures" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" + +[[package]] +name = "futures-cpupool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +dependencies = [ + "futures", + "num_cpus", +] + +[[package]] +name = "h2" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" +dependencies = [ + "byteorder", + "bytes", + "fnv", + "futures", + "http", + "indexmap", + "log", + "slab", + "string", + "tokio-io", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hermit-abi" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" + +[[package]] +name = "http" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" +dependencies = [ + "bytes", + "futures", + "http", + "tokio-buf", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "0.12.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c843caf6296fc1f93444735205af9ed4e109a539005abb2564ae1d6fad34c52" +dependencies = [ + "bytes", + "futures", + "futures-cpupool", + "h2", + "http", + "http-body", + "httparse", + "iovec", + "itoa", + "log", + "net2", + "rustc_version", + "time", + "tokio", + "tokio-buf", + "tokio-executor", + "tokio-io", + "tokio-reactor", + "tokio-tcp", + "tokio-threadpool", + "tokio-timer", + "want", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "iron" +version = "0.6.0" +dependencies = [ + "futures", + "futures-cpupool", + "http", + "hyper", + "log", + "mime", + "mime_guess", + "modifier", + "plugin", + "time", + "typemap", + "url", +] + +[[package]] +name = "iron-exmaples" +version = "0.1.0" +dependencies = [ + "futures", + "futures-cpupool", + "hyper", + "iron", + "time", + "typemap", + "url", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "mio" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +dependencies = [ + "cfg-if", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "modifier" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f5c9112cb662acd3b204077e0de5bc66305fa8df65c8019d5adb10e9ab6e58" + +[[package]] +name = "mount" +version = "0.4.0" +dependencies = [ + "iron", + "sequence_trie", +] + +[[package]] +name = "net2" +version = "0.2.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" +dependencies = [ + "cfg-if", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "parking_lot" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +dependencies = [ + "lock_api", + "parking_lot_core", + "rustc_version", +] + +[[package]] +name = "parking_lot_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66b810a62be75176a80873726630147a5ca780cd33921e0b5709033e66b0a" +dependencies = [ + "cfg-if", + "cloudabi", + "libc", + "redox_syscall", + "rustc_version", + "smallvec", + "winapi 0.3.9", +] + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" + +[[package]] +name = "persistent" +version = "0.4.0" +dependencies = [ + "iron", + "plugin", +] + +[[package]] +name = "plugin" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a6a0dc3910bc8db877ffed8e457763b317cf880df4ae19109b9f77d277cf6e0" +dependencies = [ + "typemap", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "sequence_trie" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee22067b7ccd072eeb64454b9c6e1b33b61cd0d49e895fd48676a184580e0c3" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" +dependencies = [ + "maybe-uninit", +] + +[[package]] +name = "string" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" +dependencies = [ + "bytes", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi", + "winapi 0.3.9", +] + +[[package]] +name = "tinyvec" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" +dependencies = [ + "bytes", + "futures", + "mio", + "num_cpus", + "tokio-current-thread", + "tokio-executor", + "tokio-io", + "tokio-reactor", + "tokio-threadpool", + "tokio-timer", +] + +[[package]] +name = "tokio-buf" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" +dependencies = [ + "bytes", + "either", + "futures", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" +dependencies = [ + "futures", + "tokio-executor", +] + +[[package]] +name = "tokio-executor" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" +dependencies = [ + "crossbeam-utils", + "futures", +] + +[[package]] +name = "tokio-io" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" +dependencies = [ + "bytes", + "futures", + "log", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" +dependencies = [ + "crossbeam-utils", + "futures", + "lazy_static", + "log", + "mio", + "num_cpus", + "parking_lot", + "slab", + "tokio-executor", + "tokio-io", + "tokio-sync", +] + +[[package]] +name = "tokio-sync" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" +dependencies = [ + "fnv", + "futures", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" +dependencies = [ + "bytes", + "futures", + "iovec", + "mio", + "tokio-io", + "tokio-reactor", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" +dependencies = [ + "crossbeam-deque", + "crossbeam-queue", + "crossbeam-utils", + "futures", + "lazy_static", + "log", + "num_cpus", + "slab", + "tokio-executor", +] + +[[package]] +name = "tokio-timer" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" +dependencies = [ + "crossbeam-utils", + "futures", + "slab", + "tokio-executor", +] + +[[package]] +name = "traitobject" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04a79e25382e2e852e8da874249358d382ebaf259d0d34e75d8db16a7efabbc7" + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typemap" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" +dependencies = [ + "unsafe-any", +] + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unsafe-any" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" +dependencies = [ + "traitobject", +] + +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +dependencies = [ + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "want" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +dependencies = [ + "futures", + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] diff --git a/src/tools/cargotest/lockfiles/stylo.lock b/src/tools/cargotest/lockfiles/stylo.lock new file mode 100644 index 0000000000000..2686716cc67e9 --- /dev/null +++ b/src/tools/cargotest/lockfiles/stylo.lock @@ -0,0 +1,1426 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "app_units" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "467b60e4ee6761cd6fd4e03ea58acefc8eec0d1b1def995c1b3b783fa7be8a60" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "arrayvec" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" + +[[package]] +name = "atomic_refcell" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21e4227379beff4205943696e6c3e0cd809bacdf3f0edd6e3dd153e2269571a4" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "bindgen" +version = "0.69.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.12.1", + "lazy_static", + "lazycell", + "proc-macro2", + "quote", + "regex", + "rustc-hash 1.1.0", + "shlex", + "syn 2.0.119", +] + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clang-sys" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" +dependencies = [ + "glob", + "libc", +] + +[[package]] +name = "core_maths" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30" +dependencies = [ + "libm", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" + +[[package]] +name = "cssparser" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9cdaae01d5ed7882b04d795e7f752f46ff52d2fa3b50a20d28c464510bba98" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "phf", + "serde", + "smallvec", +] + +[[package]] +name = "cssparser-macros" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a2a99df6e410a8ff4245aa2006499ea662245f967cc7c0a38c83ef8eb44dbf" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.119", +] + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "dtoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "either" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "euclid" +version = "0.22.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" + +[[package]] +name = "icu_collections" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb" +dependencies = [ + "displaydoc", + "litemap", + "serde", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locale_fallback" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "251af8e57c9400e3eb58242fe5b8b1152b2a64fdf4cf632f923c38ccee6f2fa9" +dependencies = [ + "icu_locale_core", + "icu_locale_fallback_data", + "icu_provider", + "potential_utf", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locale_fallback_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "decf2a22ec8fa68f1a0c1129a3f8583f8f8bc24e8b9ccbe98ead99f62a4dc3a8" + +[[package]] +name = "icu_normalizer" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0" + +[[package]] +name = "icu_properties" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa" + +[[package]] +name = "icu_provider" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73" +dependencies = [ + "displaydoc", + "icu_locale_core", + "serde", + "stable_deref_trait", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_segmenter" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d07aafccd67af15d02512a6adf5896fbc5ed00f2e99b471d2efa14016db3db" +dependencies = [ + "core_maths", + "icu_collections", + "icu_locale_fallback", + "icu_provider", + "icu_segmenter_data", + "potential_utf", + "smallvec", + "utf8_iter", + "zerovec", +] + +[[package]] +name = "icu_segmenter_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae293c039020f9ec10710af98d29ce6aa2051486638b49c9a6409f3b4a9e98ad" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07aa2048142242915a31d35844fb311e0e53fcca590c3a0a40dcf1b841fa09eb" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" + +[[package]] +name = "malloc_size_of_derive" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f44db74bde26fdf427af23f1d146c211aed857c59e3be750cf2617f6b0b05c94" +dependencies = [ + "proc-macro2", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mozbuild" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a051f109c6fe91717f24441d810cf2a90a344628d686a093eeb12546ab6910cf" + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "num-integer" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros", + "phf_shared", + "serde", +] + +[[package]] +name = "phf_codegen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared", +] + +[[package]] +name = "phf_macros" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher", +] + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "serde_core", + "writeable", + "zerovec", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "selectors" +version = "0.40.0" +dependencies = [ + "bitflags", + "cssparser", + "derive_more", + "log", + "new_debug_unreachable", + "phf", + "phf_codegen", + "precomputed-hash", + "rustc-hash 2.1.3", + "servo_arc", + "smallvec", + "to_shmem", + "to_shmem_derive", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "servo_arc" +version = "0.4.3" +dependencies = [ + "serde", + "stable_deref_trait", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "siphasher" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" + +[[package]] +name = "smallbitvec" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b0e903ee191d8f7a8fbf0d712c3a1699d19e04ceba5ad1eb673053c7d938a09" + +[[package]] +name = "smallvec" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f" + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "string_cache" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", +] + +[[package]] +name = "strum" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" + +[[package]] +name = "strum_macros" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "stylo" +version = "0.20.0" +dependencies = [ + "app_units", + "arrayvec", + "atomic_refcell", + "bindgen", + "bitflags", + "byteorder", + "cssparser", + "derive_more", + "encoding_rs", + "euclid", + "icu_segmenter", + "indexmap", + "itertools 0.14.0", + "itoa", + "log", + "malloc_size_of_derive", + "mime", + "mozbuild", + "new_debug_unreachable", + "num-derive", + "num-integer", + "num-traits", + "num_cpus", + "parking_lot", + "precomputed-hash", + "rayon", + "rayon-core", + "regex", + "rustc-hash 2.1.3", + "selectors", + "serde", + "servo_arc", + "smallbitvec", + "smallvec", + "static_assertions", + "string_cache", + "strum", + "strum_macros", + "stylo_atoms", + "stylo_derive", + "stylo_dom", + "stylo_malloc_size_of", + "stylo_static_prefs", + "stylo_traits", + "thin-vec", + "to_shmem", + "to_shmem_derive", + "toml 0.5.11", + "uluru", + "url", + "void", + "walkdir", + "web_atoms", +] + +[[package]] +name = "stylo_atoms" +version = "0.20.0" +dependencies = [ + "string_cache", + "string_cache_codegen", +] + +[[package]] +name = "stylo_derive" +version = "0.20.0" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "stylo_dom" +version = "0.20.0" +dependencies = [ + "bitflags", + "stylo_malloc_size_of", +] + +[[package]] +name = "stylo_malloc_size_of" +version = "0.20.0" +dependencies = [ + "app_units", + "cssparser", + "euclid", + "selectors", + "servo_arc", + "smallbitvec", + "smallvec", + "string_cache", + "thin-vec", + "void", +] + +[[package]] +name = "stylo_static_prefs" +version = "0.20.0" +dependencies = [ + "toml 1.1.5+spec-1.1.0", +] + +[[package]] +name = "stylo_traits" +version = "0.20.0" +dependencies = [ + "app_units", + "bitflags", + "cssparser", + "euclid", + "malloc_size_of_derive", + "selectors", + "serde", + "servo_arc", + "stylo_atoms", + "stylo_malloc_size_of", + "thin-vec", + "to_shmem", + "to_shmem_derive", + "url", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "thin-vec" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79def32ffcd477db1ff26f76dab9e3a91f0bd42a85ca96577089b24623056f9d" + +[[package]] +name = "tinystr" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643" +dependencies = [ + "displaydoc", + "serde_core", + "zerovec", +] + +[[package]] +name = "to_shmem" +version = "0.5.0" +dependencies = [ + "cssparser", + "servo_arc", + "smallbitvec", + "smallvec", + "string_cache", + "thin-vec", +] + +[[package]] +name = "to_shmem_derive" +version = "0.1.0" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "1.1.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12c0ba9680044b4ce98d391a62094047eada0d64860b80166c39f4a6b5640785" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_parser" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_writer" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" + +[[package]] +name = "uluru" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c8a2469e56e6e5095c82ccd3afb98dad95f7af7929aab6d8ba8d6e0f73657da" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "web_atoms" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba8b815c1b593dc0baf78dd0f4fc8fdb2de53198fb1163738093e9a311c33fb3" +dependencies = [ + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "zerovec" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8" +dependencies = [ + "serde", + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] diff --git a/src/tools/cargotest/main.rs b/src/tools/cargotest/main.rs index 82531f328da66..a56fe260e3c99 100644 --- a/src/tools/cargotest/main.rs +++ b/src/tools/cargotest/main.rs @@ -19,7 +19,7 @@ const TEST_REPOS: &[Test] = &[ name: "iron", repo: "https://github.com/iron/iron", sha: "cf056ea5e8052c1feea6141e40ab0306715a2c33", - lock: None, + lock: Some(include_str!("lockfiles/iron.lock")), packages: &[], features: None, manifest_path: None, @@ -73,7 +73,7 @@ const TEST_REPOS: &[Test] = &[ name: "stylo", repo: "https://github.com/servo/stylo", sha: "127b0b5cab6a6927552e889debb20beb031b79d1", - lock: None, + lock: Some(include_str!("lockfiles/stylo.lock")), packages: &["selectors", "stylo"], features: None, manifest_path: None, @@ -83,7 +83,7 @@ const TEST_REPOS: &[Test] = &[ name: "diesel", repo: "https://github.com/diesel-rs/diesel", sha: "3db7c17c5b069656ed22750e84d6498c8ab5b81d", - lock: None, + lock: Some(include_str!("lockfiles/diesel.lock")), packages: &[], // Test the embedded sqlite variant of diesel // This does not require any dependency to be present, @@ -113,9 +113,16 @@ fn main() { fn test_repo(cargo: &Path, out_dir: &Path, test: &Test) { println!("testing {}", test.repo); let dir = clone_repo(test, out_dir); + let lockfile_path = dir.join("Cargo.lock"); if let Some(lockfile) = test.lock { - fs::write(&dir.join("Cargo.lock"), lockfile).unwrap(); + fs::write(&lockfile_path, lockfile).expect("failed to write lockfile"); } + // Ensure all tests have a lockfile (either provided by us or checked in to the repository). + assert!( + lockfile_path.try_exists().expect("try_exists failed"), + "test '{}' is missing a lockfile", + test.name + ); if !run_cargo_test(cargo, &dir, test.packages, test.features, test.manifest_path, test.filters) { panic!("tests failed for {}", test.repo); diff --git a/src/tools/miri/.github/workflows/ci.yml b/src/tools/miri/.github/workflows/ci.yml index 4c1b791dbacb8..65d91ffc9ef15 100644 --- a/src/tools/miri/.github/workflows/ci.yml +++ b/src/tools/miri/.github/workflows/ci.yml @@ -232,7 +232,7 @@ jobs: - name: Install nightly toolchain run: rustup toolchain install nightly --profile minimal - name: Install rustup-toolchain-install-master - run: cargo install -f rustup-toolchain-install-master + run: cargo install --locked -f rustup-toolchain-install-master # Create a token for the next step so it can create a PR that actually runs CI. - uses: actions/create-github-app-token@v3 id: app-token diff --git a/src/tools/miri/.github/workflows/setup/action.yml b/src/tools/miri/.github/workflows/setup/action.yml index a6c591154a94d..cc00ec71a644f 100644 --- a/src/tools/miri/.github/workflows/setup/action.yml +++ b/src/tools/miri/.github/workflows/setup/action.yml @@ -38,7 +38,7 @@ runs: - name: Install the tools we need if: steps.cache.outputs.cache-hit != 'true' - run: cargo install -f rustup-toolchain-install-master hyperfine + run: cargo install --locked -f rustup-toolchain-install-master hyperfine shell: bash - name: Install "master" toolchain diff --git a/src/tools/miri/.github/workflows/sysroots.yml b/src/tools/miri/.github/workflows/sysroots.yml index a488e480c0c58..a8a9306a50ff9 100644 --- a/src/tools/miri/.github/workflows/sysroots.yml +++ b/src/tools/miri/.github/workflows/sysroots.yml @@ -20,7 +20,7 @@ jobs: - name: Build the sysroots run: | rustup toolchain install nightly - cargo install -f rustup-toolchain-install-master + cargo install --locked -f rustup-toolchain-install-master ./miri toolchain -c rust-docs # Docs are the only place targets are separated by tier ./miri install python3 -m pip install beautifulsoup4 diff --git a/src/tools/miri/.gitpod.yml b/src/tools/miri/.gitpod.yml index 724cf26df2b9b..507fbff56733f 100644 --- a/src/tools/miri/.gitpod.yml +++ b/src/tools/miri/.gitpod.yml @@ -3,7 +3,7 @@ image: ubuntu:latest tasks: - before: echo "..." init: | - cargo install rustup-toolchain-install-master + cargo install --locked rustup-toolchain-install-master ./miri toolchain ./miri build command: echo "Run tests with ./miri test" diff --git a/src/tools/miri/CONTRIBUTING.md b/src/tools/miri/CONTRIBUTING.md index 4524f79456612..0a330cdd45537 100644 --- a/src/tools/miri/CONTRIBUTING.md +++ b/src/tools/miri/CONTRIBUTING.md @@ -252,7 +252,7 @@ and on macOS, `rm -rf ~/Library/Caches/org.rust-lang.miri`). Miri comes with a few benchmarks; you can run `./miri bench` to run them with the locally built Miri. Note: this will run `./miri install` as a side-effect. Also requires `hyperfine` to be -installed (`cargo install hyperfine`). +installed (`cargo install --locked hyperfine`). To compare the benchmark results with a baseline, do the following: - Before applying your changes, run `./miri bench --save-baseline=baseline.json`. diff --git a/src/tools/miri/Cargo.lock b/src/tools/miri/Cargo.lock index 3775531a3f16d..166d45491242c 100644 --- a/src/tools/miri/Cargo.lock +++ b/src/tools/miri/Cargo.lock @@ -180,9 +180,9 @@ checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" [[package]] name = "chacha20" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", "cpufeatures", diff --git a/src/tools/miri/README.md b/src/tools/miri/README.md index 2eb9ababffc8b..66971d5fa7ccc 100644 --- a/src/tools/miri/README.md +++ b/src/tools/miri/README.md @@ -648,6 +648,7 @@ Definite bugs found: * [`VecDeque::splice` confusing physical and logical indices](https://github.com/rust-lang/rust/issues/151758) * [Data race in `oneshot` channel](https://github.com/faern/oneshot/issues/69) * [Memory leak in serde-yaml-bw](https://github.com/bourumir-wyngs/serde-yaml-bw/issues/197) +* [Incorrect use of SSE4.1 intrinsic in SSE2 backend in chacha20](https://github.com/RustCrypto/stream-ciphers/issues/579) Violations of [Stacked Borrows] found that are likely bugs (but Stacked Borrows is currently just an experiment): diff --git a/src/tools/miri/cargo-miri/src/phases.rs b/src/tools/miri/cargo-miri/src/phases.rs index 50a0f671aca4d..15ddc19aefffd 100644 --- a/src/tools/miri/cargo-miri/src/phases.rs +++ b/src/tools/miri/cargo-miri/src/phases.rs @@ -606,13 +606,17 @@ pub fn phase_runner(mut binary_args: impl Iterator, phase: Runner // We need to remove `--error-format` as cargo specifies that to be JSON, // but when we run here, cargo does not interpret the JSON any more. `--json` // then also needs to be dropped. - for arg in &info.args { + // We also need to remove `--force-warn=unused_crate_dependencies` as cargo is not there to + // process the output. + for arg in info.args { if let Some(suffix) = arg.strip_prefix("--error-format") { assert!(suffix.starts_with('=')); // Drop this argument. } else if let Some(suffix) = arg.strip_prefix("--json") { assert!(suffix.starts_with('=')); // Drop this argument. + } else if arg == "--force-warn=unused_crate_dependencies" { + // Drop this argument. } else { cmd.arg(arg); } diff --git a/src/tools/miri/miri-script/src/commands.rs b/src/tools/miri/miri-script/src/commands.rs index 0a372dfbf0c6d..e8fdcd80f8ddb 100644 --- a/src/tools/miri/miri-script/src/commands.rs +++ b/src/tools/miri/miri-script/src/commands.rs @@ -158,7 +158,7 @@ impl Command { cmd!(sh, "rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt -c clippy {flags...} -- {new_commit}") .run() - .context("Failed to run rustup-toolchain-install-master. If it is not installed, run 'cargo install rustup-toolchain-install-master'.")?; + .context("Failed to run rustup-toolchain-install-master. If it is not installed, run 'cargo install --locked rustup-toolchain-install-master'.")?; cmd!(sh, "rustup override set miri").run()?; // Cleanup. cmd!(sh, "cargo clean").run()?; diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 1f775b7c771f8..0e85574e7b0ec 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -9bb55c8c865411b7d9dea6ff743e583d510d89f5 +0ed41eb4142dda2df61eb1145a312c1a9d62eb56 diff --git a/src/tools/miri/src/concurrency/genmc/helper.rs b/src/tools/miri/src/concurrency/genmc/helper.rs index 34314c84db4bc..87daa05bd224c 100644 --- a/src/tools/miri/src/concurrency/genmc/helper.rs +++ b/src/tools/miri/src/concurrency/genmc/helper.rs @@ -40,15 +40,14 @@ pub fn scalar_to_genmc_scalar<'tcx>( let value: u64 = scalar_int.to_uint(scalar_int.size()).try_into().unwrap(); GenmcScalar { value, provenance: 0, is_init: true } } - rustc_const_eval::interpret::Scalar::Ptr(pointer, size) => { + rustc_const_eval::interpret::Scalar::Ptr(pointer, _ptr_size) => { // FIXME(genmc,borrow tracking): Borrow tracking information is lost. let addr = crate::Pointer::from(pointer).addr(); if let crate::Provenance::Wildcard = pointer.provenance { throw_unsup_format!("Pointers with wildcard provenance not allowed in GenMC mode"); } let (alloc_id, _size, _prov_extra) = - rustc_const_eval::interpret::Machine::ptr_get_alloc(ecx, pointer, size.into()) - .unwrap(); + rustc_const_eval::interpret::Machine::ptr_get_alloc(ecx, pointer, 0).unwrap(); let base_addr = ecx.addr_from_alloc_id(alloc_id, None)?; // Add the base_addr alloc_id pair to the map. genmc_ctx.exec_state.genmc_shared_allocs_map.borrow_mut().insert(base_addr, alloc_id); diff --git a/src/tools/miri/src/intrinsics/math.rs b/src/tools/miri/src/intrinsics/math.rs index 637c8b089a9ea..d60959ea73835 100644 --- a/src/tools/miri/src/intrinsics/math.rs +++ b/src/tools/miri/src/intrinsics/math.rs @@ -252,6 +252,41 @@ pub(crate) fn compute_crc32(crc: u32, data: u64, bit_size: u32, polynomial: u128 u32::try_from(dividend).unwrap().reverse_bits() } +/// AES primitives +pub(crate) mod aes { + /// AES S-box + /// + /// Source: [NIST Advanced Encryption Standar][1], Figure 7 (page 16) + /// + /// [1]: https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=901427 + const SBOX: [u8; 256] = [ + 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, + 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, + 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, + 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, + 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, + 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, + 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, + 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, + 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, + 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, + 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, + 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, + 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, + 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, + 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, + 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, + 0x16, + ]; + + /// Applies S-box substitution to each byte of a 32-bit word + pub(crate) fn sub_word(word: u32) -> u32 { + let bytes = word.to_ne_bytes().map(|b| SBOX[usize::from(b)]); + u32::from_ne_bytes(bytes) + } +} + // sha256 primitives shared by the x86 and aarch64 intrinsics. Math helpers adapted from RustCrypto soft impl: // https://github.com/RustCrypto/hashes/blob/3d2bc57db40fd6aeb25d6c6da98d67e2784c2985/sha2/src/sha256/soft/compact.rs pub(crate) mod sha256 { diff --git a/src/tools/miri/src/intrinsics/x86/aesni.rs b/src/tools/miri/src/intrinsics/x86/aesni.rs index 4cb3b0c98757b..d36261ca5b87a 100644 --- a/src/tools/miri/src/intrinsics/x86/aesni.rs +++ b/src/tools/miri/src/intrinsics/x86/aesni.rs @@ -110,8 +110,21 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { this.write_scalar(Scalar::from_u128(u128::from_le_bytes(state.into())), &dest)?; } - // TODO: Implement the `llvm.x86.aesni.aeskeygenassist` when possible - // with an external crate. + // Used to implement the _mm_aeskeygenassist_si128 function. + // Assists in expanding the AES cipher key. + "aeskeygenassist" => { + let [ckey, rcon] = this.check_shim_sig_llvm_intrinsic(link_name, args)?; + // Transmute `__m128i` to `u128`. + let ckey = ckey.transmute(this.machine.layouts.u128, this)?; + let dest = dest.transmute(this.machine.layouts.u128, this)?; + + let rcon = this.read_scalar(rcon)?.to_u8()?; + let ckey = this.read_scalar(&ckey)?.to_u128()?; + + let res = aeskeygenassist(ckey, rcon); + + this.write_scalar(Scalar::from_u128(res), &dest)?; + } _ => return interp_ok(EmulateItemResult::NotSupported), } interp_ok(EmulateItemResult::NeedsReturn) @@ -152,3 +165,36 @@ fn aes_round<'tcx>( interp_ok(()) } + +/// AES Key Generation Assist +/// +/// From [Intel Intrinsics Guide][1]: +/// ```text +/// X3[31:0] := a[127:96] +/// X2[31:0] := a[95:64] +/// X1[31:0] := a[63:32] +/// X0[31:0] := a[31:0] +/// RCON[31:0] := ZeroExtend32(imm8[7:0]) +/// dst[31:0] := SubWord(X1) +/// dst[63:32] := RotWord(SubWord(X1)) XOR RCON +/// dst[95:64] := SubWord(X3) +/// dst[127:96] := RotWord(SubWord(X3)) XOR RCON +/// ``` +/// +/// [1]: https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_aeskeygenassist_si128 +#[expect(clippy::as_conversions, reason = "deliberately truncating")] +fn aeskeygenassist(a: u128, rcon: u8) -> u128 { + use crate::intrinsics::math::aes::sub_word; + + let rcon = u32::from(rcon); + // TODO: use `truncate` method on stabilization + let x1 = (a >> 32) as u32; + let x3 = (a >> 96) as u32; + + let x0 = sub_word(x1); + let x1 = x0.rotate_right(8) ^ rcon; + let x2 = sub_word(x3); + let x3 = x2.rotate_right(8) ^ rcon; + + (u128::from(x3) << 96) | (u128::from(x2) << 64) | (u128::from(x1) << 32) | u128::from(x0) +} diff --git a/src/tools/miri/src/shims/foreign_items.rs b/src/tools/miri/src/shims/foreign_items.rs index 9eaadffb55922..aebe0a4d2c836 100644 --- a/src/tools/miri/src/shims/foreign_items.rs +++ b/src/tools/miri/src/shims/foreign_items.rs @@ -317,10 +317,8 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { name if name == this.mangle_internal_symbol(NO_ALLOC_SHIM_IS_UNSTABLE) => { // This is a no-op shim that only exists to prevent making the allocator shims // instantly stable. - let [] = this.check_shim_sig( - shim_sig!(extern "Rust" fn() -> ()), - (link_name, abi, args), - )?; + let [] = this + .check_shim_sig(shim_sig!(extern "Rust" fn() -> ()), (link_name, abi, args))?; } // Miri-specific extern functions diff --git a/src/tools/miri/src/shims/windows/foreign_items.rs b/src/tools/miri/src/shims/windows/foreign_items.rs index 4c9436771a21e..5e8d6ef34327b 100644 --- a/src/tools/miri/src/shims/windows/foreign_items.rs +++ b/src/tools/miri/src/shims/windows/foreign_items.rs @@ -828,7 +828,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { shim_sig!(extern "system" fn(winapi::HMODULE, *_) -> winapi::FARPROC), (link_name, abi, args), )?; - this.read_target_isize(module)?; + this.read_target_isize(module)?; // FIXME validate the module! let name = this.read_c_str(this.read_pointer(proc_name)?)?; if let Ok(name) = str::from_utf8(name) && is_dyn_sym(name) diff --git a/src/tools/miri/test-cargo-miri/proc-macro-crate/Cargo.toml b/src/tools/miri/test-cargo-miri/proc-macro-crate/Cargo.toml index f1dc4acb6dff6..7aa787776d197 100644 --- a/src/tools/miri/test-cargo-miri/proc-macro-crate/Cargo.toml +++ b/src/tools/miri/test-cargo-miri/proc-macro-crate/Cargo.toml @@ -10,3 +10,6 @@ proc-macro = true [dependencies] # A common dependency of proc macros, let's make sure that works. proc-macro2 = "1.0" + +[lints.cargo] +unused_dependencies = "allow" diff --git a/src/tools/miri/tests/fail/async-shared-mutable.stack.stderr b/src/tools/miri/tests/fail/async-shared-mutable.stack.stderr index bdd004d5da99f..4435541bc0a1c 100644 --- a/src/tools/miri/tests/fail/async-shared-mutable.stack.stderr +++ b/src/tools/miri/tests/fail/async-shared-mutable.stack.stderr @@ -9,12 +9,8 @@ LL | *x = 1; help: was created by a Unique retag at offsets [RANGE] --> tests/fail/async-shared-mutable.rs:LL:CC | -LL | / core::future::poll_fn(move |_| { -LL | | *x = 1; -LL | | Poll::<()>::Pending -LL | | }) -LL | | .await - | |______________^ +LL | let x = &mut 0u8; + | ^^^^^^^^ help: was later invalidated at offsets [RANGE] by a SharedReadOnly retag --> tests/fail/async-shared-mutable.rs:LL:CC | diff --git a/src/tools/miri/tests/fail/async-shared-mutable.tree.stderr b/src/tools/miri/tests/fail/async-shared-mutable.tree.stderr index f9e75082758dd..bbb62a7e27b2b 100644 --- a/src/tools/miri/tests/fail/async-shared-mutable.tree.stderr +++ b/src/tools/miri/tests/fail/async-shared-mutable.tree.stderr @@ -10,12 +10,8 @@ LL | *x = 1; help: the accessed tag was created here, in the initial state Reserved --> tests/fail/async-shared-mutable.rs:LL:CC | -LL | / core::future::poll_fn(move |_| { -LL | | *x = 1; -LL | | Poll::<()>::Pending -LL | | }) -LL | | .await - | |______________^ +LL | let x = &mut 0u8; + | ^^^^^^^^ help: the accessed tag later transitioned to Unique due to a child write access at offsets [RANGE] --> tests/fail/async-shared-mutable.rs:LL:CC | diff --git a/src/tools/miri/tests/fail/unaligned_pointers/maybe_dangling_unalighed.stderr b/src/tools/miri/tests/fail/unaligned_pointers/maybe_dangling_unalighed.stderr index 190976c4f046f..594c91352d796 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/maybe_dangling_unalighed.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/maybe_dangling_unalighed.stderr @@ -1,4 +1,4 @@ -error: Undefined Behavior: constructing invalid value of type std::mem::MaybeDangling<&u16>: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN) +error: Undefined Behavior: constructing invalid value of type std::mem::MaybeDangling<&u16>: at .0, encountered an unaligned reference (required ALIGN byte alignment but found ALIGN) --> tests/fail/unaligned_pointers/maybe_dangling_unalighed.rs:LL:CC | LL | transmute::, MaybeDangling<&u16>>(unaligned) diff --git a/src/tools/miri/tests/fail/validity/maybe_dangling_null.stderr b/src/tools/miri/tests/fail/validity/maybe_dangling_null.stderr index 041a6b1b96e0c..da8c88e16a1fe 100644 --- a/src/tools/miri/tests/fail/validity/maybe_dangling_null.stderr +++ b/src/tools/miri/tests/fail/validity/maybe_dangling_null.stderr @@ -1,4 +1,4 @@ -error: Undefined Behavior: constructing invalid value of type std::mem::MaybeDangling<&u8>: encountered a null reference +error: Undefined Behavior: constructing invalid value of type std::mem::MaybeDangling<&u8>: at .0, encountered a null reference --> tests/fail/validity/maybe_dangling_null.rs:LL:CC | LL | unsafe { transmute::, MaybeDangling<&u8>>(null) }; diff --git a/src/tools/miri/tests/fail/validity/maybe_dangling_ref_too_big.stderr b/src/tools/miri/tests/fail/validity/maybe_dangling_ref_too_big.stderr index f0966586d4dc7..2c82b2719e711 100644 --- a/src/tools/miri/tests/fail/validity/maybe_dangling_ref_too_big.stderr +++ b/src/tools/miri/tests/fail/validity/maybe_dangling_ref_too_big.stderr @@ -1,4 +1,4 @@ -error: Undefined Behavior: constructing invalid value of type std::mem::MaybeDangling<&i8>: encountered a reference that is too close to the end of the address space for a pointee of 1 bytes +error: Undefined Behavior: constructing invalid value of type std::mem::MaybeDangling<&i8>: at .0, encountered a reference that is too close to the end of the address space for a pointee of 1 bytes --> tests/fail/validity/maybe_dangling_ref_too_big.rs:LL:CC | LL | let _x: MaybeDangling<&i8> = unsafe { transmute(usize::MAX) }; diff --git a/src/tools/miri/tests/pass/both_borrows/maybe_dangling.rs b/src/tools/miri/tests/pass/both_borrows/maybe_dangling.rs index 028dcef8fa2d3..2d37344d24072 100644 --- a/src/tools/miri/tests/pass/both_borrows/maybe_dangling.rs +++ b/src/tools/miri/tests/pass/both_borrows/maybe_dangling.rs @@ -14,6 +14,7 @@ fn main() { reference(); write_through_shared_ref(); large(); + closure(); } fn boxy() { @@ -64,3 +65,16 @@ fn large() { // Used to be rejected due to faulty logic for the "does this fit the address space" check. let _x: MaybeDangling<&i8> = unsafe { mem::transmute(usize::MAX - 127) }; } + +// A closure acts like MaybeDangling. +fn closure() { + fn invoke(f: impl FnOnce()) { + // The closure has captured a reference that will be freed while `invoke` runs. + f() + } + + let p = Box::leak(Box::new(0i32)); + invoke(move || { + drop(unsafe { Box::from_raw(p) }); + }); +} diff --git a/src/tools/miri/tests/pass/float.rs b/src/tools/miri/tests/pass/float.rs index 703077e303a6b..8eee645dce69c 100644 --- a/src/tools/miri/tests/pass/float.rs +++ b/src/tools/miri/tests/pass/float.rs @@ -158,7 +158,7 @@ where /// Helper function to avoid promotion so that this tests "run-time" casts, not CTFE. /// Doesn't make a big difference when running this in Miri, but it means we can compare this -/// with the LLVM backend by running `rustc -Zmir-opt-level=0 -Zsaturating-float-casts`. +/// with the LLVM backend by running `rustc -Zmir-opt-level=0`. #[track_caller] #[inline(never)] fn assert_eq(x: T, y: T) { diff --git a/src/tools/miri/tests/pass/generators.rs b/src/tools/miri/tests/pass/generators.rs new file mode 100644 index 0000000000000..c5ab3fcb8e28f --- /dev/null +++ b/src/tools/miri/tests/pass/generators.rs @@ -0,0 +1,115 @@ +//@edition: 2024 +//@revisions: stack tree tree_implicit_writes +//@[tree_implicit_writes]compile-flags: -Zmiri-tree-borrows -Zmiri-tree-borrows-implicit-writes +//@[tree]compile-flags: -Zmiri-tree-borrows + +#![feature(gen_blocks)] + +fn main() { + basic(); + iterate(); + movable_gen(); + movable_gen2(); +} + +fn basic() { + gen fn foo() -> i32 { + yield 42; + for i in 5..10 { + if i % 2 == 0 { + continue; + } + yield i * 2; + } + } + + let v = foo().collect::>(); + assert_eq!(v, &[42, 10, 14, 18]); +} + +fn iterate() { + fn foo() -> impl Iterator { + gen { + yield 42; + for x in 3..6 { + yield x + } + } + } + + fn moved() -> impl Iterator { + let mut x = "foo".to_string(); + gen move { + yield 42; + if x == "foo" { + return; + } + x.clear(); + for x in 3..6 { + yield x + } + } + } + + let mut iter = foo(); + assert_eq!(iter.next(), Some(42)); + assert_eq!(iter.next(), Some(3)); + assert_eq!(iter.next(), Some(4)); + assert_eq!(iter.next(), Some(5)); + assert_eq!(iter.next(), None); + // `gen` blocks are fused + assert_eq!(iter.next(), None); + + let mut iter = moved(); + assert_eq!(iter.next(), Some(42)); + assert_eq!(iter.next(), None); +} + +/// Ensure a generator can reborrow from a reference it captured. +/// Regression test for . +pub fn movable_gen() { + fn make_gen(r: &mut u8) -> impl Iterator { + gen move { + let a = r; + *a = 1; + yield 1; + *a = 2; + } + } + + let mut a = 1; + let mut i = make_gen(&mut a); + assert_eq!(i.next(), Some(1)); + let mut j = i; + assert_eq!(j.next(), None); +} + +/// Regression test for . +fn movable_gen2() { + // a struct that has a drop flag and contains a reference + struct DropMut(&'static mut T); + impl Drop for DropMut { + fn drop(&mut self) { + drop(unsafe { Box::from_raw(self.0) }); + } + } + + let mut a = gen { + let b = DropMut(Box::leak(Box::new(1))); + + // create a drop flag on `b` + let c; + if true { + c = b; // and ensure it's set to false + } else { + c = DropMut(Box::leak(Box::new(2))); + } + + *c.0 = 3; + 4.yield; + *c.0 = 5; + }; + let _ = a.next(); + let mut d = a; + let _ = d.next(); +} diff --git a/src/tools/miri/tests/pass/intrinsics/portable-simd.rs b/src/tools/miri/tests/pass/intrinsics/portable-simd.rs index eac901e7c5a56..c16bc21636f78 100644 --- a/src/tools/miri/tests/pass/intrinsics/portable-simd.rs +++ b/src/tools/miri/tests/pass/intrinsics/portable-simd.rs @@ -16,7 +16,7 @@ #![cfg_attr(not(miri), allow(unused))] use std::fmt::{self, Debug, Formatter}; -use std::intrinsics::simd as intrinsics; +use std::intrinsics::simd::*; use std::ptr; use std::simd::StdFloat; use std::simd::prelude::*; @@ -31,7 +31,7 @@ macro_rules! assert_eq { }} } -// The `portable_simd` crate currently does not support f16 or f128 vectors, so we define our own. +// The `portable_simd` crate currently does not support f128 vectors, so we define our own. #[repr(simd, packed)] #[derive(Copy)] struct PackedSimd([T; N]); @@ -54,10 +54,6 @@ impl Debug for PackedSimd { } } -type f16x2 = PackedSimd; -type f16x4 = PackedSimd; -type f16x8 = PackedSimd; - type f128x2 = PackedSimd; type f128x4 = PackedSimd; @@ -79,95 +75,81 @@ impl PackedSimd { pub const unsafe fn simd_shuffle_const_generic(x: T, y: T) -> U; #[cfg(any(miri, target_has_reliable_f16_math))] -fn simd_ops_f16() { - use intrinsics::*; - +fn test_simd_ops_f16() { let a = f16x4::splat(10.0); let b = f16x4::from_array([1.0, 2.0, 3.0, -4.0]); + assert_eq!(-b, f16x4::from_array([-1.0, -2.0, -3.0, 4.0])); + assert_eq!(a + b, f16x4::from_array([11.0, 12.0, 13.0, 6.0])); + assert_eq!(a - b, f16x4::from_array([9.0, 8.0, 7.0, 14.0])); + assert_eq!(a * b, f16x4::from_array([10.0, 20.0, 30.0, -40.0])); + assert_eq!(b / a, f16x4::from_array([0.1, 0.2, 0.3, -0.4])); + assert_eq!(a / f16x4::splat(2.0), f16x4::splat(5.0)); + assert_eq!(a % b, f16x4::from_array([0.0, 0.0, 1.0, 2.0])); + assert_eq!(b.abs(), f16x4::from_array([1.0, 2.0, 3.0, 4.0])); + assert_eq!(a.simd_max(b * f16x4::splat(4.0)), f16x4::from_array([10.0, 10.0, 12.0, 10.0])); + assert_eq!(a.simd_min(b * f16x4::splat(4.0)), f16x4::from_array([4.0, 8.0, 10.0, -16.0])); - unsafe { - assert_eq!(simd_neg(b), f16x4::from_array([-1.0, -2.0, -3.0, 4.0])); - assert_eq!(simd_add(a, b), f16x4::from_array([11.0, 12.0, 13.0, 6.0])); - assert_eq!(simd_sub(a, b), f16x4::from_array([9.0, 8.0, 7.0, 14.0])); - assert_eq!(simd_mul(a, b), f16x4::from_array([10.0, 20.0, 30.0, -40.0])); - assert_eq!(simd_div(b, a), f16x4::from_array([0.1, 0.2, 0.3, -0.4])); - assert_eq!(simd_div(a, f16x4::splat(2.0)), f16x4::splat(5.0)); - assert_eq!(simd_rem(a, b), f16x4::from_array([0.0, 0.0, 1.0, 2.0])); - assert_eq!(simd_fabs(b), f16x4::from_array([1.0, 2.0, 3.0, 4.0])); - assert_eq!( - simd_maximum_number_nsz(a, simd_mul(b, f16x4::splat(4.0))), - f16x4::from_array([10.0, 10.0, 12.0, 10.0]) - ); - assert_eq!( - simd_minimum_number_nsz(a, simd_mul(b, f16x4::splat(4.0))), - f16x4::from_array([4.0, 8.0, 10.0, -16.0]) - ); - - assert_eq!(simd_fma(a, b, a), simd_add(simd_mul(a, b), a)); - assert_eq!(simd_fma(b, b, a), simd_add(simd_mul(b, b), a)); - assert_eq!(simd_fma(a, b, b), simd_add(simd_mul(a, b), b)); - assert_eq!( - simd_fma(f16x4::splat(-3.2), b, f16x4::splat(f16::NEG_INFINITY)), - f16x4::splat(f16::NEG_INFINITY) - ); + assert_eq!(a.mul_add(b, a), (a * b) + a); + assert_eq!(b.mul_add(b, a), (b * b) + a); + assert_eq!(a.mul_add(b, b), (a * b) + b); + assert_eq!( + f16x4::splat(-3.2).mul_add(b, f16x4::splat(f16::NEG_INFINITY)), + f16x4::splat(f16::NEG_INFINITY) + ); - assert_eq!(simd_relaxed_fma(a, b, a), simd_add(simd_mul(a, b), a)); - assert_eq!(simd_relaxed_fma(b, b, a), simd_add(simd_mul(b, b), a)); - assert_eq!(simd_relaxed_fma(a, b, b), simd_add(simd_mul(a, b), b)); + // All intermediate values can be precisely represented so even relaxed FMA are deterministic. + unsafe { + assert_eq!(simd_relaxed_fma(a, b, a), (a * b) + a); + assert_eq!(simd_relaxed_fma(b, b, a), (b * b) + a); + assert_eq!(simd_relaxed_fma(a, b, b), (a * b) + b); assert_eq!( simd_relaxed_fma(f16x4::splat(-3.2), b, f16x4::splat(f16::NEG_INFINITY)), f16x4::splat(f16::NEG_INFINITY) ); + } - assert_eq!(simd_fsqrt(simd_mul(a, a)), a); - assert_eq!(simd_fsqrt(simd_mul(b, b)), simd_fabs(b)); + assert_eq!((a * a).sqrt(), a); + assert_eq!((b * b).sqrt(), b.abs()); - assert_eq!(simd_eq(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([0, !0, 0, 0])); - assert_eq!(simd_ne(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([!0, 0, !0, !0])); - assert_eq!(simd_le(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([0, !0, !0, 0])); - assert_eq!(simd_lt(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([0, 0, !0, 0])); - assert_eq!(simd_ge(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([!0, !0, 0, !0])); - assert_eq!(simd_gt(a, simd_mul(f16x4::splat(5.0), b)), i32x4::from_array([!0, 0, 0, !0])); + assert_eq!(a.simd_eq(f16x4::splat(5.0) * b), Mask::from_array([false, true, false, false])); + assert_eq!(a.simd_ne(f16x4::splat(5.0) * b), Mask::from_array([true, false, true, true])); + assert_eq!(a.simd_le(f16x4::splat(5.0) * b), Mask::from_array([false, true, true, false])); + assert_eq!(a.simd_lt(f16x4::splat(5.0) * b), Mask::from_array([false, false, true, false])); + assert_eq!(a.simd_ge(f16x4::splat(5.0) * b), Mask::from_array([true, true, false, true])); + assert_eq!(a.simd_gt(f16x4::splat(5.0) * b), Mask::from_array([true, false, false, true])); - assert_eq!(simd_reduce_add_ordered(a, 0.0), 40.0f16); - assert_eq!(simd_reduce_add_ordered(b, 0.0), 2.0f16); - assert_eq!(simd_reduce_mul_ordered(a, 1.0), 10000.0f16); - assert_eq!(simd_reduce_mul_ordered(b, 1.0), -24.0f16); + assert_eq!(a.reduce_sum(), 40.0); + assert_eq!(b.reduce_sum(), 2.0); + assert_eq!(a.reduce_product(), 100.0 * 100.0); + assert_eq!(b.reduce_product(), -24.0); - assert_eq!( - simd_maximum_number_nsz( - f16x2::from_array([0.0, f16::NAN]), - f16x2::from_array([f16::NAN, 0.0]) - ), - f16x2::from_array([0.0, 0.0]) - ); - assert_eq!( - simd_minimum_number_nsz( - f16x2::from_array([0.0, f16::NAN]), - f16x2::from_array([f16::NAN, 0.0]) - ), - f16x2::from_array([0.0, 0.0]) - ); + assert_eq!( + f16x2::from_array([0.0, f16::NAN]).simd_max(f16x2::from_array([f16::NAN, 0.0])), + f16x2::from_array([0.0, 0.0]) + ); + assert_eq!( + f16x2::from_array([0.0, f16::NAN]).simd_min(f16x2::from_array([f16::NAN, 0.0])), + f16x2::from_array([0.0, 0.0]) + ); - // FIXME(llvm): The LLVM backend rejects float `simd_reduce_{min,max}`, - // see https://github.com/llvm/llvm-project/issues/185827. - #[cfg(miri)] - { - assert_eq!(simd_reduce_max(a), 10.0f16); - assert_eq!(simd_reduce_max(b), 3.0f16); - assert_eq!(simd_reduce_min(a), 10.0f16); - assert_eq!(simd_reduce_min(b), -4.0f16); + // FIXME(llvm): The LLVM backend rejects float `simd_reduce_{min,max}`, + // see https://github.com/llvm/llvm-project/issues/185827. + #[cfg(miri)] + unsafe { + assert_eq!(simd_reduce_max(a), 10.0f16); + assert_eq!(simd_reduce_max(b), 3.0f16); + assert_eq!(simd_reduce_min(a), 10.0f16); + assert_eq!(simd_reduce_min(b), -4.0f16); - assert_eq!(simd_reduce_max(f16x2::from_array([0.0, f16::NAN])), 0.0f16); - assert_eq!(simd_reduce_max(f16x2::from_array([f16::NAN, 0.0])), 0.0f16); + assert_eq!(simd_reduce_max(f16x2::from_array([0.0, f16::NAN])), 0.0f16); + assert_eq!(simd_reduce_max(f16x2::from_array([f16::NAN, 0.0])), 0.0f16); - assert_eq!(simd_reduce_min(f16x2::from_array([0.0, f16::NAN])), 0.0f16); - assert_eq!(simd_reduce_min(f16x2::from_array([f16::NAN, 0.0])), 0.0f16); - } + assert_eq!(simd_reduce_min(f16x2::from_array([0.0, f16::NAN])), 0.0f16); + assert_eq!(simd_reduce_min(f16x2::from_array([f16::NAN, 0.0])), 0.0f16); } } -fn simd_ops_f32() { +fn test_simd_ops_f32() { let a = f32x4::splat(10.0); let b = f32x4::from_array([1.0, 2.0, 3.0, -4.0]); assert_eq!(-b, f32x4::from_array([-1.0, -2.0, -3.0, 4.0])); @@ -189,12 +171,13 @@ fn simd_ops_f32() { f32x4::splat(f32::NEG_INFINITY) ); + // All intermediate values can be precisely represented so even relaxed FMA are deterministic. unsafe { - assert_eq!(intrinsics::simd_relaxed_fma(a, b, a), (a * b) + a); - assert_eq!(intrinsics::simd_relaxed_fma(b, b, a), (b * b) + a); - assert_eq!(intrinsics::simd_relaxed_fma(a, b, b), (a * b) + b); + assert_eq!(simd_relaxed_fma(a, b, a), (a * b) + a); + assert_eq!(simd_relaxed_fma(b, b, a), (b * b) + a); + assert_eq!(simd_relaxed_fma(a, b, b), (a * b) + b); assert_eq!( - intrinsics::simd_relaxed_fma(f32x4::splat(-3.2), b, f32x4::splat(f32::NEG_INFINITY)), + simd_relaxed_fma(f32x4::splat(-3.2), b, f32x4::splat(f32::NEG_INFINITY)), f32x4::splat(f32::NEG_INFINITY) ); } @@ -227,8 +210,6 @@ fn simd_ops_f32() { // see https://github.com/llvm/llvm-project/issues/185827. #[cfg(miri)] unsafe { - use intrinsics::{simd_reduce_max, simd_reduce_min}; - assert_eq!(simd_reduce_max(a), 10.0f32); assert_eq!(simd_reduce_max(b), 3.0f32); assert_eq!(simd_reduce_min(a), 10.0f32); @@ -242,7 +223,7 @@ fn simd_ops_f32() { } } -fn simd_ops_f64() { +fn test_simd_ops_f64() { let a = f64x4::splat(10.0); let b = f64x4::from_array([1.0, 2.0, 3.0, -4.0]); assert_eq!(-b, f64x4::from_array([-1.0, -2.0, -3.0, 4.0])); @@ -264,12 +245,13 @@ fn simd_ops_f64() { f64x4::splat(f64::NEG_INFINITY) ); + // All intermediate values can be precisely represented so even relaxed FMA are deterministic. unsafe { - assert_eq!(intrinsics::simd_relaxed_fma(a, b, a), (a * b) + a); - assert_eq!(intrinsics::simd_relaxed_fma(b, b, a), (b * b) + a); - assert_eq!(intrinsics::simd_relaxed_fma(a, b, b), (a * b) + b); + assert_eq!(simd_relaxed_fma(a, b, a), (a * b) + a); + assert_eq!(simd_relaxed_fma(b, b, a), (b * b) + a); + assert_eq!(simd_relaxed_fma(a, b, b), (a * b) + b); assert_eq!( - intrinsics::simd_relaxed_fma(f64x4::splat(-3.2), b, f64x4::splat(f64::NEG_INFINITY)), + simd_relaxed_fma(f64x4::splat(-3.2), b, f64x4::splat(f64::NEG_INFINITY)), f64x4::splat(f64::NEG_INFINITY) ); } @@ -302,8 +284,6 @@ fn simd_ops_f64() { // see https://github.com/llvm/llvm-project/issues/185827. #[cfg(miri)] unsafe { - use intrinsics::{simd_reduce_max, simd_reduce_min}; - assert_eq!(simd_reduce_max(a), 10.0f64); assert_eq!(simd_reduce_max(b), 3.0f64); assert_eq!(simd_reduce_min(a), 10.0f64); @@ -318,9 +298,7 @@ fn simd_ops_f64() { } #[cfg(any(miri, target_has_reliable_f128_math))] -fn simd_ops_f128() { - use intrinsics::*; - +fn test_simd_ops_f128() { let a = f128x4::splat(10.0); let b = f128x4::from_array([1.0, 2.0, 3.0, -4.0]); @@ -350,6 +328,7 @@ fn simd_ops_f128() { f128x4::splat(f128::NEG_INFINITY) ); + // All intermediate values can be precisely represented so even relaxed FMA are deterministic. assert_eq!(simd_relaxed_fma(a, b, a), simd_add(simd_mul(a, b), a)); assert_eq!(simd_relaxed_fma(b, b, a), simd_add(simd_mul(b, b), a)); assert_eq!(simd_relaxed_fma(a, b, b), simd_add(simd_mul(a, b), b)); @@ -406,7 +385,7 @@ fn simd_ops_f128() { } } -fn simd_ops_i32() { +fn test_simd_ops_i32() { let a = i32x4::splat(10); let b = i32x4::from_array([1, 2, 3, -4]); assert_eq!(-b, i32x4::from_array([-1, -2, -3, 4])); @@ -517,17 +496,15 @@ fn simd_ops_i32() { let d = u32x4::splat(0x2fe78e45); unsafe { - assert_eq!(intrinsics::simd_funnel_shl(c, d, u32x4::splat(0)), c); - assert_eq!(intrinsics::simd_funnel_shl(c, d, u32x4::splat(8)), u32x4::splat(0x0000b32f)); + assert_eq!(simd_funnel_shl(c, d, u32x4::splat(0)), c); + assert_eq!(simd_funnel_shl(c, d, u32x4::splat(8)), u32x4::splat(0x0000b32f)); - assert_eq!(intrinsics::simd_funnel_shr(c, d, u32x4::splat(0)), d); - assert_eq!(intrinsics::simd_funnel_shr(c, d, u32x4::splat(8)), u32x4::splat(0xb32fe78e)); + assert_eq!(simd_funnel_shr(c, d, u32x4::splat(0)), d); + assert_eq!(simd_funnel_shr(c, d, u32x4::splat(8)), u32x4::splat(0xb32fe78e)); } } -fn simd_mask() { - use std::intrinsics::simd::*; - +fn test_simd_mask() { let intmask = Mask::from_simd(i32x4::from_array([0, -1, 0, 0])); assert_eq!(intmask, Mask::from_array([false, true, false, false])); assert_eq!(intmask.to_array(), [false, true, false, false]); @@ -705,7 +682,7 @@ fn simd_mask() { } } -fn simd_cast() { +fn test_simd_cast() { // between integer types assert_eq!(i32x4::from_array([1, 2, 3, -4]), i16x4::from_array([1, 2, 3, -4]).cast()); assert_eq!(i16x4::from_array([1, 2, 3, -4]), i32x4::from_array([1, 2, 3, -4]).cast()); @@ -783,7 +760,7 @@ fn simd_cast() { } } -fn simd_swizzle() { +fn test_simd_swizzle() { let a = f32x4::splat(10.0); let b = f32x4::from_array([1.0, 2.0, 3.0, -4.0]); @@ -792,7 +769,7 @@ fn simd_swizzle() { assert_eq!(simd_swizzle!(b, a, [3, 4]), f32x2::from_array([-4.0, 10.0])); } -fn simd_swizzle_dyn() { +fn test_simd_swizzle_dyn() { if cfg!(target_arch = "loongarch64") { // We don't support the required intrinsic here. return; @@ -815,7 +792,7 @@ fn simd_swizzle_dyn() { check_swizzle_dyn::<64>(); } -fn simd_gather_scatter() { +fn test_simd_gather_scatter() { let mut vec: Vec = vec![10, 11, 12, 13, 14, 15, 16, 17, 18]; let idxs = Simd::from_array([9, 3, 0, 17]); let result = Simd::gather_or_default(&vec, idxs); // Note the lane that is out-of-bounds. @@ -831,7 +808,7 @@ fn simd_gather_scatter() { Simd::from_array([ptr::null(), ptr::addr_of!(val), ptr::addr_of!(val), ptr::addr_of!(val)]); let default = u8x4::splat(0); let mask = i8x4::from_array([0, !0, 0, !0]); - let vals = unsafe { intrinsics::simd_gather(default, ptrs, mask) }; + let vals = unsafe { simd_gather(default, ptrs, mask) }; assert_eq!(vals, u8x4::from_array([0, 42, 0, 42]),); let mut val1 = 0u8; @@ -843,7 +820,7 @@ fn simd_gather_scatter() { ptr::addr_of_mut!(val2), ]); let vals = u8x4::from_array([1, 2, 3, 4]); - unsafe { intrinsics::simd_scatter(vals, ptrs, mask) }; + unsafe { simd_scatter(vals, ptrs, mask) }; assert_eq!(val1, 2); assert_eq!(val2, 4); @@ -856,33 +833,31 @@ fn simd_gather_scatter() { ptr::addr_of_mut!(val), ]); let vals = u8x4::from_array([1, 2, 3, 4]); - unsafe { intrinsics::simd_scatter(vals, ptrs, mask) }; + unsafe { simd_scatter(vals, ptrs, mask) }; assert_eq!(val, 4); } -fn simd_round() { +fn test_simd_round() { #[cfg(any(miri, target_has_reliable_f16_math))] - unsafe { - use intrinsics::*; - + { assert_eq!( - simd_ceil(f16x4::from_array([0.9, 1.001, 2.0, -4.5])), + f16x4::from_array([0.9, 1.001, 2.0, -4.5]).ceil(), f16x4::from_array([1.0, 2.0, 2.0, -4.0]) ); assert_eq!( - simd_floor(f16x4::from_array([0.9, 1.001, 2.0, -4.5])), + f16x4::from_array([0.9, 1.001, 2.0, -4.5]).floor(), f16x4::from_array([0.0, 1.0, 2.0, -5.0]) ); assert_eq!( - simd_round(f16x4::from_array([0.9, 1.001, 2.0, -4.5])), + f16x4::from_array([0.9, 1.001, 2.0, -4.5]).round(), f16x4::from_array([1.0, 1.0, 2.0, -5.0]) ); assert_eq!( - simd_round_ties_even(f16x4::from_array([0.9, 1.001, 2.0, -4.5])), + f16x4::from_array([0.9, 1.001, 2.0, -4.5]).round_ties_even(), f16x4::from_array([1.0, 1.0, 2.0, -4.0]) ); assert_eq!( - simd_trunc(f16x4::from_array([0.9, 1.001, 2.0, -4.5])), + f16x4::from_array([0.9, 1.001, 2.0, -4.5]).trunc(), f16x4::from_array([0.0, 1.0, 2.0, -4.0]) ); } @@ -900,7 +875,7 @@ fn simd_round() { f32x4::from_array([1.0, 1.0, 2.0, -5.0]) ); assert_eq!( - unsafe { intrinsics::simd_round_ties_even(f32x4::from_array([0.9, 1.001, 2.0, -4.5])) }, + unsafe { simd_round_ties_even(f32x4::from_array([0.9, 1.001, 2.0, -4.5])) }, f32x4::from_array([1.0, 1.0, 2.0, -4.0]) ); assert_eq!( @@ -921,7 +896,7 @@ fn simd_round() { f64x4::from_array([1.0, 1.0, 2.0, -5.0]) ); assert_eq!( - unsafe { intrinsics::simd_round_ties_even(f64x4::from_array([0.9, 1.001, 2.0, -4.5])) }, + unsafe { simd_round_ties_even(f64x4::from_array([0.9, 1.001, 2.0, -4.5])) }, f64x4::from_array([1.0, 1.0, 2.0, -4.0]) ); assert_eq!( @@ -931,8 +906,6 @@ fn simd_round() { #[cfg(any(miri, target_has_reliable_f128_math))] unsafe { - use intrinsics::*; - assert_eq!( simd_ceil(f128x4::from_array([0.9, 1.001, 2.0, -4.5])), f128x4::from_array([1.0, 2.0, 2.0, -4.0]) @@ -956,9 +929,7 @@ fn simd_round() { } } -fn simd_intrinsics() { - use intrinsics::*; - +fn test_simd_intrinsics() { unsafe { // Make sure simd_eq returns all-1 for `true` let a = i32x4::splat(10); @@ -1012,9 +983,7 @@ fn simd_intrinsics() { } } -fn simd_float_intrinsics() { - use intrinsics::*; - +fn test_simd_float_intrinsics() { // These are just smoke tests to ensure the intrinsics can be called. unsafe { let a = f16x8::splat(10.0); @@ -1058,9 +1027,7 @@ fn simd_float_intrinsics() { } } -fn simd_masked_loadstore() { - use intrinsics::*; - +fn test_simd_masked_loadstore() { // The buffer is deliberarely too short, so reading the last element would be UB. let buf = [3i32; 3]; let default = i32x4::splat(0); @@ -1148,7 +1115,7 @@ fn simd_masked_loadstore() { assert_eq!(buf, vals); } -fn simd_ops_non_pow2() { +fn test_simd_ops_non_pow2() { // Just a little smoke test for operations on non-power-of-two vectors. #[repr(simd, packed)] #[derive(Copy, Clone)] @@ -1159,31 +1126,31 @@ fn simd_ops_non_pow2() { let x = SimdPacked([1u32; 3]); let y = SimdPacked([2u32; 3]); - let z = unsafe { intrinsics::simd_add(x, y) }; + let z = unsafe { simd_add(x, y) }; assert_eq!(unsafe { *(&raw const z).cast::<[u32; 3]>() }, [3u32; 3]); let x = SimdPadded([1u32; 3]); let y = SimdPadded([2u32; 3]); - let z = unsafe { intrinsics::simd_add(x, y) }; + let z = unsafe { simd_add(x, y) }; assert_eq!(unsafe { *(&raw const z).cast::<[u32; 3]>() }, [3u32; 3]); } fn main() { - simd_mask(); + test_simd_mask(); #[cfg(any(miri, target_has_reliable_f16_math))] - simd_ops_f16(); - simd_ops_f32(); - simd_ops_f64(); + test_simd_ops_f16(); + test_simd_ops_f32(); + test_simd_ops_f64(); #[cfg(any(miri, target_has_reliable_f128_math))] - simd_ops_f128(); - simd_ops_i32(); - simd_ops_non_pow2(); - simd_cast(); - simd_swizzle(); - simd_swizzle_dyn(); - simd_gather_scatter(); - simd_round(); - simd_intrinsics(); - simd_float_intrinsics(); - simd_masked_loadstore(); + test_simd_ops_f128(); + test_simd_ops_i32(); + test_simd_ops_non_pow2(); + test_simd_cast(); + test_simd_swizzle(); + test_simd_swizzle_dyn(); + test_simd_gather_scatter(); + test_simd_round(); + test_simd_intrinsics(); + test_simd_float_intrinsics(); + test_simd_masked_loadstore(); } diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs index 82b0d26d4df1b..11fa75962a954 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs @@ -90,6 +90,16 @@ unsafe fn test_aes() { assert_eq_m128i(r, e); } test_mm_aesimc_si128(); + + #[target_feature(enable = "aes")] + unsafe fn test_mm_aeskeygenassist_si128() { + // Constants taken from https://msdn.microsoft.com/en-us/library/cc714195.aspx. + let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff); + let e = _mm_set_epi64x(0x857c266b7c266e85, 0xeac4eea9c4eeacea); + let r = _mm_aeskeygenassist_si128(a, 5); + assert_eq_m128i(r, e); + } + test_mm_aeskeygenassist_si128(); } // The constants in the tests below are just bit patterns. They should not diff --git a/src/tools/miri/tests/pass/stacked_borrows/stack-printing.stdout b/src/tools/miri/tests/pass/stacked_borrows/stack-printing.stdout index 296339e738455..838733078209d 100644 --- a/src/tools/miri/tests/pass/stacked_borrows/stack-printing.stdout +++ b/src/tools/miri/tests/pass/stacked_borrows/stack-printing.stdout @@ -1,6 +1,6 @@ 0..1: [ SharedReadWrite ] 0..1: [ SharedReadWrite ] 0..1: [ SharedReadWrite ] -0..1: [ SharedReadWrite Unique Unique Unique Unique Unique Unique Unique ] -0..1: [ SharedReadWrite Disabled Disabled Disabled Disabled Disabled Disabled Disabled SharedReadOnly ] +0..1: [ SharedReadWrite Unique Unique Unique Unique Unique ] +0..1: [ SharedReadWrite Disabled Disabled Disabled Disabled Disabled SharedReadOnly ] 0..1: [ unknown-bottom(..) ] diff --git a/tests/assembly-llvm/asm/aarch64-modifiers.rs b/tests/assembly-llvm/asm/aarch64-modifiers.rs index 6cb028461ddd1..66be35de574f6 100644 --- a/tests/assembly-llvm/asm/aarch64-modifiers.rs +++ b/tests/assembly-llvm/asm/aarch64-modifiers.rs @@ -1,7 +1,7 @@ //@ add-minicore //@ assembly-output: emit-asm //@ compile-flags: -Copt-level=3 -C panic=abort -//@ compile-flags: --target aarch64-unknown-linux-gnu +//@ compile-flags: --target aarch64-unknown-linux-gnu -C target-feature=+sve //@ compile-flags: -Zmerge-functions=disabled //@ needs-llvm-components: aarch64 @@ -85,6 +85,12 @@ check!(vreg_q vreg "ldr {:q}, [x0]"); // CHECK: //NO_APP check!(vreg_v vreg "add {0:v}.4s, {0:v}.4s, {0:v}.4s"); +// CHECK-LABEL: vreg_z: +// CHECK: //APP +// CHECK: mov z0.d, z0.d +// CHECK: //NO_APP +check!(vreg_z vreg "mov {0:z}.d, {0:z}.d"); + // CHECK-LABEL: vreg_low16: // CHECK: //APP // CHECK: add v0.4s, v0.4s, v0.4s diff --git a/tests/assembly-llvm/asm/aarch64-types.rs b/tests/assembly-llvm/asm/aarch64-types.rs index c171ba3b11e13..da625b1211602 100644 --- a/tests/assembly-llvm/asm/aarch64-types.rs +++ b/tests/assembly-llvm/asm/aarch64-types.rs @@ -1,7 +1,7 @@ //@ add-minicore //@ revisions: aarch64 aarch64_be arm64ec //@ assembly-output: emit-asm -//@ [aarch64] compile-flags: --target aarch64-unknown-linux-gnu +//@ [aarch64] compile-flags: --target aarch64-unknown-linux-gnu -C target-feature=+sve //@ [aarch64] needs-llvm-components: aarch64 //@ [aarch64_be] compile-flags: --target aarch64_be-unknown-linux-gnu //@ [aarch64_be] needs-llvm-components: aarch64 @@ -9,7 +9,7 @@ //@ [arm64ec] needs-llvm-components: aarch64 //@ compile-flags: -Zmerge-functions=disabled -#![feature(no_core, f16, f128)] +#![feature(asm_experimental_reg, no_core, f16, f128, rustc_attrs)] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register, non_camel_case_types)] @@ -20,6 +20,62 @@ use minicore::*; type ptr = *mut u8; +#[cfg(target_feature = "sve")] +#[rustc_scalable_vector(16)] +pub struct svint8_t(i8); + +#[cfg(target_feature = "sve")] +impl Copy for svint8_t {} + +#[cfg(target_feature = "sve")] +#[rustc_scalable_vector(8)] +pub struct svint16_t(i16); + +#[cfg(target_feature = "sve")] +impl Copy for svint16_t {} + +#[cfg(target_feature = "sve")] +#[rustc_scalable_vector(4)] +pub struct svint32_t(i32); + +#[cfg(target_feature = "sve")] +impl Copy for svint32_t {} + +#[cfg(target_feature = "sve")] +#[rustc_scalable_vector(2)] +pub struct svint64_t(i64); + +#[cfg(target_feature = "sve")] +impl Copy for svint64_t {} + +#[cfg(target_feature = "sve")] +#[rustc_scalable_vector(8)] +pub struct svfloat16_t(f16); + +#[cfg(target_feature = "sve")] +impl Copy for svfloat16_t {} + +#[cfg(target_feature = "sve")] +#[rustc_scalable_vector(4)] +pub struct svfloat32_t(f32); + +#[cfg(target_feature = "sve")] +impl Copy for svfloat32_t {} + +#[cfg(target_feature = "sve")] +#[rustc_scalable_vector(2)] +pub struct svfloat64_t(f64); + +#[cfg(target_feature = "sve")] +impl Copy for svfloat64_t {} + +#[cfg(target_feature = "sve")] +#[rustc_scalable_vector(16)] +pub struct svbool_t(bool); + +#[cfg(target_feature = "sve")] +impl Copy for svbool_t {} + extern "C" { fn extern_func(); static extern_static: u8; @@ -74,6 +130,25 @@ macro_rules! check { }; } +macro_rules! check_sve { + ($func:ident $ty:ident $class:ident $suffix:literal $zm:literal) => { + #[cfg(target_feature = "sve")] + #[no_mangle] + pub unsafe fn $func(inp: &$ty, pred: &svbool_t) -> $ty { + let x = *inp; + let z = *pred; + let y; + asm!( + concat!("mov {0}.", $suffix, ", p0/", $zm, ", {1}.", $suffix), + out($class) y, + in($class) x, + in("p0") z + ); + y + } + }; +} + macro_rules! check_reg { ($func:ident $ty:ident $reg:tt $mov:literal) => { // FIXME(f128): See FIXME in `check!` @@ -87,6 +162,25 @@ macro_rules! check_reg { }; } +macro_rules! check_reg_sve { + ($func:ident $ty:ident $reg:tt $suffix:literal $zm:literal) => { + #[cfg(target_feature = "sve")] + #[no_mangle] + pub unsafe fn $func(inp: &$ty, pred: &svbool_t) -> $ty { + let x = *inp; + let z = *pred; + let y; + asm!( + concat!("mov ", $reg, ".", $suffix, ", p0/", $zm, ", ", $reg, ".", $suffix), + in("p0") z, + lateout($reg) y, + in($reg) x + ); + y + } + }; +} + // CHECK-LABEL: {{("#)?}}reg_i8{{"?}} // CHECK: //APP // CHECK: mov x{{[0-9]+}}, x{{[0-9]+}} @@ -405,6 +499,96 @@ check!(vreg_low16_f32x4 f32x4 vreg_low16 "fmov" "s"); // CHECK: //NO_APP check!(vreg_low16_f64x2 f64x2 vreg_low16 "fmov" "s"); +// aarch64-LABEL: {{("#)?}}vreg_sve_i8{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.b, p0/m, z{{[0-9]+}}.b +// aarch64: //NO_APP +check_sve!(vreg_sve_i8 svint8_t vreg "b" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_sve_i16{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.h, p0/m, z{{[0-9]+}}.h +// aarch64: //NO_APP +check_sve!(vreg_sve_i16 svint16_t vreg "h" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_sve_f16{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.h, p0/m, z{{[0-9]+}}.h +// aarch64: //NO_APP +check_sve!(vreg_sve_f16 svfloat16_t vreg "h" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_sve_i32{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.s, p0/m, z{{[0-9]+}}.s +// aarch64: //NO_APP +check_sve!(vreg_sve_i32 svint32_t vreg "s" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_sve_f32{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.s, p0/m, z{{[0-9]+}}.s +// aarch64: //NO_APP +check_sve!(vreg_sve_f32 svfloat32_t vreg "s" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_sve_i64{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.d, p0/m, z{{[0-9]+}}.d +// aarch64: //NO_APP +check_sve!(vreg_sve_i64 svint64_t vreg "d" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_sve_f64{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.d, p0/m, z{{[0-9]+}}.d +// aarch64: //NO_APP +check_sve!(vreg_sve_f64 svfloat64_t vreg "d" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_low16_sve_i8{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.b, p0/m, z{{[0-9]+}}.b +// aarch64: //NO_APP +check_sve!(vreg_low16_sve_i8 svint8_t vreg_low16 "b" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_low16_sve_i16{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.h, p0/m, z{{[0-9]+}}.h +// aarch64: //NO_APP +check_sve!(vreg_low16_sve_i16 svint16_t vreg_low16 "h" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_low16_sve_f16{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.h, p0/m, z{{[0-9]+}}.h +// aarch64: //NO_APP +check_sve!(vreg_low16_sve_f16 svfloat16_t vreg_low16 "h" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_low16_sve_i32{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.s, p0/m, z{{[0-9]+}}.s +// aarch64: //NO_APP +check_sve!(vreg_low16_sve_i32 svint32_t vreg_low16 "s" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_low16_sve_f32{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.s, p0/m, z{{[0-9]+}}.s +// aarch64: //NO_APP +check_sve!(vreg_low16_sve_f32 svfloat32_t vreg_low16 "s" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_low16_sve_i64{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.d, p0/m, z{{[0-9]+}}.d +// aarch64: //NO_APP +check_sve!(vreg_low16_sve_i64 svint64_t vreg_low16 "d" "m"); + +// aarch64-LABEL: {{("#)?}}vreg_low16_sve_f64{{"?}} +// aarch64: //APP +// aarch64: mov z{{[0-9]+}}.d, p0/m, z{{[0-9]+}}.d +// aarch64: //NO_APP +check_sve!(vreg_low16_sve_f64 svfloat64_t vreg_low16 "d" "m"); + +// aarch64-LABEL: {{("#)?}}preg_bool{{"?}} +// aarch64: //APP +// aarch64: mov p{{[0-9]+}}.b, p0/z, p{{[0-9]+}}.b +// aarch64: //NO_APP +check_sve!(preg_bool svbool_t preg "b" "z"); + // CHECK-LABEL: {{("#)?}}x0_i8{{"?}} // CHECK: //APP // CHECK: mov x{{[0-9]+}}, x{{[0-9]+}} @@ -501,6 +685,62 @@ check_reg!(v0_f64 f64 "s0" "fmov"); // CHECK: //NO_APP check_reg!(v0_f128 f128 "s0" "fmov"); +// aarch64-LABEL: {{("#)?}}z0_i8{{"?}} +// aarch64: //APP +// aarch64: mov z0.b, p0/m, z0.b +// aarch64: //NO_APP +check_reg_sve!(z0_i8 svint8_t "z0" "b" "m"); + +// aarch64-LABEL: {{("#)?}}z0_i16{{"?}} +// aarch64: //APP +// aarch64: mov z0.h, p0/m, z0.h +// aarch64: //NO_APP +check_reg_sve!(z0_i16 svint16_t "z0" "h" "m"); + +// aarch64-LABEL: {{("#)?}}z0_f16{{"?}} +// aarch64: //APP +// aarch64: mov z0.h, p0/m, z0.h +// aarch64: //NO_APP +check_reg_sve!(z0_f16 svfloat16_t "z0" "h" "m"); + +// aarch64-LABEL: {{("#)?}}z0_i32{{"?}} +// aarch64: //APP +// aarch64: mov z0.s, p0/m, z0.s +// aarch64: //NO_APP +check_reg_sve!(z0_i32 svint32_t "z0" "s" "m"); + +// aarch64-LABEL: {{("#)?}}z0_f32{{"?}} +// aarch64: //APP +// aarch64: mov z0.s, p0/m, z0.s +// aarch64: //NO_APP +check_reg_sve!(z0_f32 svfloat32_t "z0" "s" "m"); + +// aarch64-LABEL: {{("#)?}}z0_i64{{"?}} +// aarch64: //APP +// aarch64: mov z0.d, p0/m, z0.d +// aarch64: //NO_APP +check_reg_sve!(z0_i64 svint64_t "z0" "d" "m"); + +// aarch64-LABEL: {{("#)?}}z0_f64{{"?}} +// aarch64: //APP +// aarch64: mov z0.d, p0/m, z0.d +// aarch64: //NO_APP +check_reg_sve!(z0_f64 svfloat64_t "z0" "d" "m"); + +// aarch64-LABEL: {{("#)?}}p0_bool{{"?}} +// aarch64: //APP +// aarch64: mov p0.b, p1/z, p0.b +// aarch64: //NO_APP +#[cfg(target_feature = "sve")] +#[no_mangle] +pub unsafe fn p0_bool(inp: &svbool_t, pred: &svbool_t) -> svbool_t { + let x = *inp; + let z = *pred; + let y; + asm!("mov p0.b, p1/z, p0.b", in("p1") z, lateout("p0") y, in("p0") x); + y +} + // CHECK-LABEL: {{("#)?}}v0_ptr{{"?}} // CHECK: //APP // CHECK: fmov s0, s0 diff --git a/tests/codegen-llvm/maybe_dangling_refs.rs b/tests/codegen-llvm/maybe_dangling_refs.rs index 07493ecac79c5..5d097151db4d7 100644 --- a/tests/codegen-llvm/maybe_dangling_refs.rs +++ b/tests/codegen-llvm/maybe_dangling_refs.rs @@ -7,7 +7,7 @@ #![crate_type = "lib"] #![feature(maybe_dangling)] -use std::mem::MaybeDangling; +use std::mem::{ManuallyDrop, MaybeDangling}; // CHECK: define {{(dso_local )?}}noundef nonnull ptr @f(ptr noundef nonnull %x) unnamed_addr #[no_mangle] @@ -15,6 +15,12 @@ pub fn f(x: MaybeDangling>) -> MaybeDangling> { x } +// CHECK: define {{(dso_local )?}}noundef nonnull ptr @f2(ptr noundef nonnull %x) unnamed_addr +#[no_mangle] +pub fn f2(x: ManuallyDrop>) -> ManuallyDrop> { + x +} + // CHECK: define {{(dso_local )?}}noundef nonnull ptr @g(ptr noundef nonnull %x) unnamed_addr #[no_mangle] pub fn g(x: MaybeDangling<&u8>) -> MaybeDangling<&u8> { diff --git a/tests/coverage/assert.cov-map b/tests/coverage/assert.cov-map index 543ab89628281..4500eab355739 100644 --- a/tests/coverage/assert.cov-map +++ b/tests/coverage/assert.cov-map @@ -1,42 +1,72 @@ -Function name: assert::main -Raw bytes (76): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 0c, 01, 09, 01, 00, 1c, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 02, 0a, 06, 02, 13, 00, 20, 0d, 00, 21, 02, 0a, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02] +Function name: assert::assert_a_plain +Raw bytes (54): 0x[01, 01, 00, 0a, 01, 06, 01, 00, 25, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 10, 01, 00, 11, 00, 18, 05, 01, 05, 00, 0f, 09, 01, 05, 00, 0f, 15, 01, 05, 00, 14, 0d, 00, 15, 00, 18, 11, 00, 1f, 00, 25, 15, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/assert.rs -Number of expressions: 6 -- expression 0 operands: lhs = Counter(1), rhs = Counter(0) -- expression 1 operands: lhs = Counter(1), rhs = Expression(5, Add) -- expression 2 operands: lhs = Counter(0), rhs = Counter(2) -- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) -- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3) -- expression 5 operands: lhs = Counter(0), rhs = Counter(2) -Number of file 0 mappings: 12 -- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 28) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27) -- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 24) -- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 26) - = (c1 - c0) -- Code(Counter(2)) at (prev + 0, 27) to (start + 2, 10) -- Code(Expression(1, Sub)) at (prev + 2, 19) to (start + 0, 32) - = (c1 - (c0 + c2)) -- Code(Counter(3)) at (prev + 0, 33) to (start + 2, 10) -- Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10) - = (c1 - ((c0 + c2) + c3)) -- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23) - = (c1 - c0) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 11) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c3 +Number of expressions: 0 +Number of file 0 mappings: 10 +- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 37) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 24) +- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(5)) at (prev + 1, 5) to (start + 0, 20) +- Code(Counter(3)) at (prev + 0, 21) to (start + 0, 24) +- Code(Counter(4)) at (prev + 0, 31) to (start + 0, 37) +- Code(Counter(5)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c5 + +Function name: assert::assert_b_message +Raw bytes (54): 0x[01, 01, 00, 0a, 01, 0d, 01, 00, 27, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 10, 01, 00, 11, 00, 18, 05, 01, 05, 00, 0f, 09, 01, 05, 00, 0f, 15, 01, 05, 00, 14, 0d, 00, 15, 00, 18, 11, 00, 1f, 00, 25, 15, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/assert.rs +Number of expressions: 0 +Number of file 0 mappings: 10 +- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 39) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 24) +- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(5)) at (prev + 1, 5) to (start + 0, 20) +- Code(Counter(3)) at (prev + 0, 21) to (start + 0, 24) +- Code(Counter(4)) at (prev + 0, 31) to (start + 0, 37) +- Code(Counter(5)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c5 + +Function name: assert::assert_c_format_inline +Raw bytes (54): 0x[01, 01, 00, 0a, 01, 14, 01, 00, 38, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 10, 01, 00, 11, 00, 18, 05, 01, 05, 00, 0f, 09, 01, 05, 00, 0f, 15, 01, 05, 00, 14, 0d, 00, 15, 00, 18, 11, 00, 1f, 00, 25, 15, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/assert.rs +Number of expressions: 0 +Number of file 0 mappings: 10 +- Code(Counter(0)) at (prev + 20, 1) to (start + 0, 56) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 24) +- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(5)) at (prev + 1, 5) to (start + 0, 20) +- Code(Counter(3)) at (prev + 0, 21) to (start + 0, 24) +- Code(Counter(4)) at (prev + 0, 31) to (start + 0, 37) +- Code(Counter(5)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c5 -Function name: assert::might_fail_assert -Raw bytes (24): 0x[01, 01, 00, 04, 01, 04, 01, 00, 28, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 05, 01, 01, 00, 02] +Function name: assert::assert_d_format_arg +Raw bytes (54): 0x[01, 01, 00, 0a, 01, 1b, 01, 00, 35, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 10, 01, 00, 11, 00, 18, 05, 01, 05, 00, 0f, 09, 01, 05, 00, 0f, 15, 01, 05, 00, 14, 0d, 00, 15, 00, 18, 11, 00, 1f, 00, 25, 15, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/assert.rs Number of expressions: 0 -Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 40) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c1 +Number of file 0 mappings: 10 +- Code(Counter(0)) at (prev + 27, 1) to (start + 0, 53) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 24) +- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(5)) at (prev + 1, 5) to (start + 0, 20) +- Code(Counter(3)) at (prev + 0, 21) to (start + 0, 24) +- Code(Counter(4)) at (prev + 0, 31) to (start + 0, 37) +- Code(Counter(5)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c5 diff --git a/tests/coverage/assert.coverage b/tests/coverage/assert.coverage index 29a5b48c0566a..d9171fd705c99 100644 --- a/tests/coverage/assert.coverage +++ b/tests/coverage/assert.coverage @@ -1,33 +1,42 @@ - LL| |#![allow(unused_assignments)] - LL| |//@ failure-status: 101 + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 LL| | - LL| 4|fn might_fail_assert(one_plus_one: u32) { - LL| 4| println!("does 1 + 1 = {}?", one_plus_one); - LL| 4| assert_eq!(1 + 1, one_plus_one, "the argument was wrong"); - LL| 3|} + LL| |use core::assert_matches; LL| | - LL| 1|fn main() -> Result<(), u8> { - LL| 1| let mut countdown = 10; - LL| 10| while countdown > 0 { - LL| 9| if countdown == 1 { - LL| 1| might_fail_assert(3); - LL| 8| } else if countdown < 5 { - LL| 3| might_fail_assert(2); - LL| 5| } - LL| 9| countdown -= 1; - LL| | } - LL| 1| Ok(()) + LL| 1|fn assert_a_plain(opt: Option<&str>) { + LL| 1| assert!(opt.is_some()); + LL| 1| assert_eq!(opt, Some("true")); + LL| 1| assert_ne!(opt, None); + LL| 1| assert_matches!(opt, Some("true")); LL| 1|} LL| | - LL| |// Notes: - LL| |// 1. Compare this program and its coverage results to those of the very similar test - LL| |// `panic_unwind.rs`, and similar tests `abort.rs` and `try_error_result.rs`. - LL| |// 2. This test confirms the coverage generated when a program passes or fails an `assert!()` or - LL| |// related `assert_*!()` macro. - LL| |// 3. Notably, the `assert` macros *do not* generate `TerminatorKind::Assert`. The macros produce - LL| |// conditional expressions, `TerminatorKind::SwitchInt` branches, and a possible call to - LL| |// `begin_panic_fmt()` (that begins a panic unwind, if the assertion test fails). - LL| |// 4. `TerminatorKind::Assert` is, however, also present in the MIR generated for this test - LL| |// (and in many other coverage tests). The `Assert` terminator is typically generated by the - LL| |// Rust compiler to check for runtime failures, such as numeric overflows. + LL| 1|fn assert_b_message(opt: Option<&str>) { + LL| 1| assert!(opt.is_some(), "message"); + LL| 1| assert_eq!(opt, Some("true"), "message"); + LL| 1| assert_ne!(opt, None, "message"); + LL| 1| assert_matches!(opt, Some("true"), "message"); + LL| 1|} + LL| | + LL| 1|fn assert_c_format_inline(opt: Option<&str>, msg: &str) { + LL| 1| assert!(opt.is_some(), "message: {msg}"); + LL| 1| assert_eq!(opt, Some("true"), "message: {msg}"); + LL| 1| assert_ne!(opt, None, "message: {msg}"); + LL| 1| assert_matches!(opt, Some("true"), "message: {msg}"); + LL| 1|} + LL| | + LL| 1|fn assert_d_format_arg(opt: Option<&str>, msg: &str) { + LL| 1| assert!(opt.is_some(), "message: {}", msg); + LL| 1| assert_eq!(opt, Some("true"), "message: {}", msg); + LL| 1| assert_ne!(opt, None, "message: {}", msg); + LL| 1| assert_matches!(opt, Some("true"), "message: {}", msg); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt = core::hint::black_box(Some("true")); + LL| | assert_a_plain(opt); + LL| | assert_b_message(opt); + LL| | assert_c_format_inline(opt, "message"); + LL| | assert_d_format_arg(opt, "message"); + LL| |} diff --git a/tests/coverage/assert.rs b/tests/coverage/assert.rs index 30d511f8f7a89..9c3151ba4ce17 100644 --- a/tests/coverage/assert.rs +++ b/tests/coverage/assert.rs @@ -1,32 +1,41 @@ -#![allow(unused_assignments)] -//@ failure-status: 101 +#![feature(coverage_attribute)] +//@ edition: 2024 -fn might_fail_assert(one_plus_one: u32) { - println!("does 1 + 1 = {}?", one_plus_one); - assert_eq!(1 + 1, one_plus_one, "the argument was wrong"); +use core::assert_matches; + +fn assert_a_plain(opt: Option<&str>) { + assert!(opt.is_some()); + assert_eq!(opt, Some("true")); + assert_ne!(opt, None); + assert_matches!(opt, Some("true")); +} + +fn assert_b_message(opt: Option<&str>) { + assert!(opt.is_some(), "message"); + assert_eq!(opt, Some("true"), "message"); + assert_ne!(opt, None, "message"); + assert_matches!(opt, Some("true"), "message"); } -fn main() -> Result<(), u8> { - let mut countdown = 10; - while countdown > 0 { - if countdown == 1 { - might_fail_assert(3); - } else if countdown < 5 { - might_fail_assert(2); - } - countdown -= 1; - } - Ok(()) +fn assert_c_format_inline(opt: Option<&str>, msg: &str) { + assert!(opt.is_some(), "message: {msg}"); + assert_eq!(opt, Some("true"), "message: {msg}"); + assert_ne!(opt, None, "message: {msg}"); + assert_matches!(opt, Some("true"), "message: {msg}"); } -// Notes: -// 1. Compare this program and its coverage results to those of the very similar test -// `panic_unwind.rs`, and similar tests `abort.rs` and `try_error_result.rs`. -// 2. This test confirms the coverage generated when a program passes or fails an `assert!()` or -// related `assert_*!()` macro. -// 3. Notably, the `assert` macros *do not* generate `TerminatorKind::Assert`. The macros produce -// conditional expressions, `TerminatorKind::SwitchInt` branches, and a possible call to -// `begin_panic_fmt()` (that begins a panic unwind, if the assertion test fails). -// 4. `TerminatorKind::Assert` is, however, also present in the MIR generated for this test -// (and in many other coverage tests). The `Assert` terminator is typically generated by the -// Rust compiler to check for runtime failures, such as numeric overflows. +fn assert_d_format_arg(opt: Option<&str>, msg: &str) { + assert!(opt.is_some(), "message: {}", msg); + assert_eq!(opt, Some("true"), "message: {}", msg); + assert_ne!(opt, None, "message: {}", msg); + assert_matches!(opt, Some("true"), "message: {}", msg); +} + +#[coverage(off)] +fn main() { + let opt = core::hint::black_box(Some("true")); + assert_a_plain(opt); + assert_b_message(opt); + assert_c_format_inline(opt, "message"); + assert_d_format_arg(opt, "message"); +} diff --git a/tests/coverage/async.cov-map b/tests/coverage/async/async.cov-map similarity index 100% rename from tests/coverage/async.cov-map rename to tests/coverage/async/async.cov-map diff --git a/tests/coverage/async.coverage b/tests/coverage/async/async.coverage similarity index 100% rename from tests/coverage/async.coverage rename to tests/coverage/async/async.coverage diff --git a/tests/coverage/async.rs b/tests/coverage/async/async.rs similarity index 100% rename from tests/coverage/async.rs rename to tests/coverage/async/async.rs diff --git a/tests/coverage/async2.cov-map b/tests/coverage/async/async2.cov-map similarity index 100% rename from tests/coverage/async2.cov-map rename to tests/coverage/async/async2.cov-map diff --git a/tests/coverage/async2.coverage b/tests/coverage/async/async2.coverage similarity index 100% rename from tests/coverage/async2.coverage rename to tests/coverage/async/async2.coverage diff --git a/tests/coverage/async2.rs b/tests/coverage/async/async2.rs similarity index 100% rename from tests/coverage/async2.rs rename to tests/coverage/async/async2.rs diff --git a/tests/coverage/async_block.cov-map b/tests/coverage/async/async_block.cov-map similarity index 100% rename from tests/coverage/async_block.cov-map rename to tests/coverage/async/async_block.cov-map diff --git a/tests/coverage/async_block.coverage b/tests/coverage/async/async_block.coverage similarity index 100% rename from tests/coverage/async_block.coverage rename to tests/coverage/async/async_block.coverage diff --git a/tests/coverage/async_block.rs b/tests/coverage/async/async_block.rs similarity index 100% rename from tests/coverage/async_block.rs rename to tests/coverage/async/async_block.rs diff --git a/tests/coverage/async_closure.cov-map b/tests/coverage/async/async_closure.cov-map similarity index 100% rename from tests/coverage/async_closure.cov-map rename to tests/coverage/async/async_closure.cov-map diff --git a/tests/coverage/async_closure.coverage b/tests/coverage/async/async_closure.coverage similarity index 100% rename from tests/coverage/async_closure.coverage rename to tests/coverage/async/async_closure.coverage diff --git a/tests/coverage/async_closure.rs b/tests/coverage/async/async_closure.rs similarity index 100% rename from tests/coverage/async_closure.rs rename to tests/coverage/async/async_closure.rs diff --git a/tests/coverage/async_closure2.cov-map b/tests/coverage/async/async_closure2.cov-map similarity index 100% rename from tests/coverage/async_closure2.cov-map rename to tests/coverage/async/async_closure2.cov-map diff --git a/tests/coverage/async_closure2.coverage b/tests/coverage/async/async_closure2.coverage similarity index 100% rename from tests/coverage/async_closure2.coverage rename to tests/coverage/async/async_closure2.coverage diff --git a/tests/coverage/async_closure2.rs b/tests/coverage/async/async_closure2.rs similarity index 100% rename from tests/coverage/async_closure2.rs rename to tests/coverage/async/async_closure2.rs diff --git a/tests/coverage/auxiliary/executor.rs b/tests/coverage/async/auxiliary/executor.rs similarity index 100% rename from tests/coverage/auxiliary/executor.rs rename to tests/coverage/async/auxiliary/executor.rs diff --git a/tests/coverage/await_ready.cov-map b/tests/coverage/async/await_ready.cov-map similarity index 100% rename from tests/coverage/await_ready.cov-map rename to tests/coverage/async/await_ready.cov-map diff --git a/tests/coverage/await_ready.coverage b/tests/coverage/async/await_ready.coverage similarity index 100% rename from tests/coverage/await_ready.coverage rename to tests/coverage/async/await_ready.coverage diff --git a/tests/coverage/await_ready.rs b/tests/coverage/async/await_ready.rs similarity index 100% rename from tests/coverage/await_ready.rs rename to tests/coverage/async/await_ready.rs diff --git a/tests/coverage/closure_macro_async.cov-map b/tests/coverage/async/closure_macro_async.cov-map similarity index 100% rename from tests/coverage/closure_macro_async.cov-map rename to tests/coverage/async/closure_macro_async.cov-map diff --git a/tests/coverage/closure_macro_async.coverage b/tests/coverage/async/closure_macro_async.coverage similarity index 100% rename from tests/coverage/closure_macro_async.coverage rename to tests/coverage/async/closure_macro_async.coverage diff --git a/tests/coverage/closure_macro_async.rs b/tests/coverage/async/closure_macro_async.rs similarity index 100% rename from tests/coverage/closure_macro_async.rs rename to tests/coverage/async/closure_macro_async.rs diff --git a/tests/coverage/call-method.cov-map b/tests/coverage/call-method.cov-map new file mode 100644 index 0000000000000..534cc4b6a58af --- /dev/null +++ b/tests/coverage/call-method.cov-map @@ -0,0 +1,19 @@ +Function name: call_method::call_method +Raw bytes (59): 0x[01, 01, 00, 0b, 01, 08, 01, 00, 11, 01, 01, 09, 00, 0e, 01, 00, 11, 00, 16, 01, 02, 05, 00, 0a, 01, 02, 09, 00, 0f, 01, 02, 0d, 00, 12, 01, 04, 05, 05, 0a, 01, 00, 05, 00, 0a, 01, 07, 09, 00, 0f, 01, 02, 0d, 00, 12, 01, 03, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/call-method.rs +Number of expressions: 0 +Number of file 0 mappings: 11 +- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 17) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 22) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 10) +- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 18) +- Code(Counter(0)) at (prev + 4, 5) to (start + 5, 10) +- Code(Counter(0)) at (prev + 0, 5) to (start + 0, 10) +- Code(Counter(0)) at (prev + 7, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 18) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/call-method.coverage b/tests/coverage/call-method.coverage new file mode 100644 index 0000000000000..afcdb0adc7b73 --- /dev/null +++ b/tests/coverage/call-method.coverage @@ -0,0 +1,46 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ min-llvm-version: 23 + LL| | + LL| |// Basic test for method calls and chained method calls. + LL| | + LL| |#[rustfmt::skip] + LL| 1|fn call_method() { + LL| 1| let thing = Thing; + LL| | + LL| 1| thing + LL| | . + LL| 1| method + LL| | ( + LL| 1| "arg" + LL| | ) + LL| | ; + LL| | + LL| 1| thing + LL| 1| . + LL| 1| method + LL| 1| ( + LL| 1| "arg" + LL| 1| ) + LL| | . + LL| 1| method + LL| | ( + LL| 1| "arg" + LL| | ) + LL| | ; + LL| 1|} + LL| | + LL| |struct Thing; + LL| | + LL| |#[coverage(off)] + LL| |impl Thing { + LL| | fn method(&self, _arg: &str) -> &Self { + LL| | self + LL| | } + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | call_method(); + LL| |} + diff --git a/tests/coverage/call-method.rs b/tests/coverage/call-method.rs new file mode 100644 index 0000000000000..42b753503331b --- /dev/null +++ b/tests/coverage/call-method.rs @@ -0,0 +1,45 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ min-llvm-version: 23 + +// Basic test for method calls and chained method calls. + +#[rustfmt::skip] +fn call_method() { + let thing = Thing; + + thing + . + method + ( + "arg" + ) + ; + + thing + . + method + ( + "arg" + ) + . + method + ( + "arg" + ) + ; +} + +struct Thing; + +#[coverage(off)] +impl Thing { + fn method(&self, _arg: &str) -> &Self { + self + } +} + +#[coverage(off)] +fn main() { + call_method(); +} diff --git a/tests/coverage/for.many.coverage b/tests/coverage/for.many.coverage new file mode 100644 index 0000000000000..c6908b64cd615 --- /dev/null +++ b/tests/coverage/for.many.coverage @@ -0,0 +1,39 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: zero one many + LL| |//@[one] ignore-coverage-map + LL| |//@[many] ignore-coverage-map + LL| | + LL| |// Basic test of `for` loops. + LL| | + LL| 1|fn for_loop(items: &[&str]) { + LL| 1| say("hello"); + LL| | + LL| 3| for item in items { + ^1 + LL| 3| say(item); + LL| 3| } + LL| | + LL| 3| for item in items { + ^1 + LL| 3| say(item) + LL| | } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let items = cfg_select!( + LL| | zero => &[], + LL| | one => &["one"], + LL| | many => &["one", "two", "three"], + LL| | ); + LL| | for_loop(items); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/for.one.coverage b/tests/coverage/for.one.coverage new file mode 100644 index 0000000000000..285d379c526f9 --- /dev/null +++ b/tests/coverage/for.one.coverage @@ -0,0 +1,37 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: zero one many + LL| |//@[one] ignore-coverage-map + LL| |//@[many] ignore-coverage-map + LL| | + LL| |// Basic test of `for` loops. + LL| | + LL| 1|fn for_loop(items: &[&str]) { + LL| 1| say("hello"); + LL| | + LL| 1| for item in items { + LL| 1| say(item); + LL| 1| } + LL| | + LL| 1| for item in items { + LL| 1| say(item) + LL| | } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let items = cfg_select!( + LL| | zero => &[], + LL| | one => &["one"], + LL| | many => &["one", "two", "three"], + LL| | ); + LL| | for_loop(items); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/for.rs b/tests/coverage/for.rs new file mode 100644 index 0000000000000..55a2cfc2c18d2 --- /dev/null +++ b/tests/coverage/for.rs @@ -0,0 +1,36 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ revisions: zero one many +//@[one] ignore-coverage-map +//@[many] ignore-coverage-map + +// Basic test of `for` loops. + +fn for_loop(items: &[&str]) { + say("hello"); + + for item in items { + say(item); + } + + for item in items { + say(item) + } + + say("goodbye"); +} + +#[coverage(off)] +fn main() { + let items = cfg_select!( + zero => &[], + one => &["one"], + many => &["one", "two", "three"], + ); + for_loop(items); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/for.zero.cov-map b/tests/coverage/for.zero.cov-map new file mode 100644 index 0000000000000..4ac461b85719f --- /dev/null +++ b/tests/coverage/for.zero.cov-map @@ -0,0 +1,30 @@ +Function name: for::for_loop +Raw bytes (77): 0x[01, 01, 04, 05, 01, 09, 01, 09, 01, 09, 01, 0d, 01, 09, 01, 00, 1c, 01, 01, 05, 00, 08, 01, 00, 09, 00, 10, 02, 02, 09, 00, 0d, 01, 00, 11, 00, 16, 02, 00, 17, 02, 06, 0e, 04, 09, 00, 0d, 01, 00, 11, 00, 16, 0e, 01, 09, 00, 0c, 0e, 00, 0d, 00, 11, 01, 03, 05, 00, 08, 01, 00, 09, 00, 12, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/for.rs +Number of expressions: 4 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +- expression 1 operands: lhs = Counter(2), rhs = Counter(0) +- expression 2 operands: lhs = Counter(2), rhs = Counter(0) +- expression 3 operands: lhs = Counter(2), rhs = Counter(0) +Number of file 0 mappings: 13 +- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 16) +- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 13) + = (c1 - c0) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 22) +- Code(Expression(0, Sub)) at (prev + 0, 23) to (start + 2, 6) + = (c1 - c0) +- Code(Expression(3, Sub)) at (prev + 4, 9) to (start + 0, 13) + = (c2 - c0) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 22) +- Code(Expression(3, Sub)) at (prev + 1, 9) to (start + 0, 12) + = (c2 - c0) +- Code(Expression(3, Sub)) at (prev + 0, 13) to (start + 0, 17) + = (c2 - c0) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/for.zero.coverage b/tests/coverage/for.zero.coverage new file mode 100644 index 0000000000000..9376a371275d4 --- /dev/null +++ b/tests/coverage/for.zero.coverage @@ -0,0 +1,39 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: zero one many + LL| |//@[one] ignore-coverage-map + LL| |//@[many] ignore-coverage-map + LL| | + LL| |// Basic test of `for` loops. + LL| | + LL| 1|fn for_loop(items: &[&str]) { + LL| 1| say("hello"); + LL| | + LL| 1| for item in items { + ^0 + LL| 0| say(item); + LL| 0| } + LL| | + LL| 1| for item in items { + ^0 + LL| 0| say(item) + LL| | } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let items = cfg_select!( + LL| | zero => &[], + LL| | one => &["one"], + LL| | many => &["one", "two", "three"], + LL| | ); + LL| | for_loop(items); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-let-chain.none.cov-map b/tests/coverage/if-let-chain.none.cov-map new file mode 100644 index 0000000000000..9626b6cc8553b --- /dev/null +++ b/tests/coverage/if-let-chain.none.cov-map @@ -0,0 +1,40 @@ +Function name: if_let_chain::if_let_chain +Raw bytes (105): 0x[01, 01, 08, 09, 05, 0b, 09, 01, 05, 11, 0d, 11, 0d, 11, 0d, 1f, 11, 01, 0d, 11, 01, 09, 01, 00, 33, 09, 01, 11, 00, 18, 01, 00, 1c, 00, 27, 02, 01, 15, 00, 18, 09, 00, 1c, 00, 23, 02, 01, 05, 02, 06, 06, 02, 05, 00, 06, 11, 02, 11, 00, 18, 01, 00, 1c, 00, 27, 16, 01, 15, 00, 18, 11, 00, 1c, 00, 23, 16, 02, 09, 00, 0c, 16, 00, 0d, 00, 10, 1a, 01, 05, 00, 06, 01, 02, 05, 00, 08, 01, 00, 09, 00, 12, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/if-let-chain.rs +Number of expressions: 8 +- expression 0 operands: lhs = Counter(2), rhs = Counter(1) +- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(2) +- expression 2 operands: lhs = Counter(0), rhs = Counter(1) +- expression 3 operands: lhs = Counter(4), rhs = Counter(3) +- expression 4 operands: lhs = Counter(4), rhs = Counter(3) +- expression 5 operands: lhs = Counter(4), rhs = Counter(3) +- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(4) +- expression 7 operands: lhs = Counter(0), rhs = Counter(3) +Number of file 0 mappings: 17 +- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 51) +- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 24) +- Code(Counter(0)) at (prev + 0, 28) to (start + 0, 39) +- Code(Expression(0, Sub)) at (prev + 1, 21) to (start + 0, 24) + = (c2 - c1) +- Code(Counter(2)) at (prev + 0, 28) to (start + 0, 35) +- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 2, 6) + = (c2 - c1) +- Code(Expression(1, Sub)) at (prev + 2, 5) to (start + 0, 6) + = ((c0 + c1) - c2) +- Code(Counter(4)) at (prev + 2, 17) to (start + 0, 24) +- Code(Counter(0)) at (prev + 0, 28) to (start + 0, 39) +- Code(Expression(5, Sub)) at (prev + 1, 21) to (start + 0, 24) + = (c4 - c3) +- Code(Counter(4)) at (prev + 0, 28) to (start + 0, 35) +- Code(Expression(5, Sub)) at (prev + 2, 9) to (start + 0, 12) + = (c4 - c3) +- Code(Expression(5, Sub)) at (prev + 0, 13) to (start + 0, 16) + = (c4 - c3) +- Code(Expression(6, Sub)) at (prev + 1, 5) to (start + 0, 6) + = ((c0 + c3) - c4) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 + diff --git a/tests/coverage/if-let-chain.none.coverage b/tests/coverage/if-let-chain.none.coverage new file mode 100644 index 0000000000000..a5aba75201ead --- /dev/null +++ b/tests/coverage/if-let-chain.none.coverage @@ -0,0 +1,41 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: none one two + LL| |//@[one] ignore-coverage-map + LL| |//@[two] ignore-coverage-map + LL| | + LL| |// Basic test for if-let chains. + LL| | + LL| 1|fn if_let_chain(opt_opt_msg: Option>) { + LL| 1| if let Some(opt_msg) = opt_opt_msg + ^0 + LL| 0| && let Some(msg) = opt_msg + LL| 0| { + LL| 0| say(msg); + LL| 1| } + LL| | + LL| 1| if let Some(opt_msg) = opt_opt_msg + ^0 + LL| 0| && let Some(msg) = opt_msg + LL| | { + LL| 0| say(msg) + LL| 1| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt_opt_msg = cfg_select!( + LL| | none => None, + LL| | one => Some(None), + LL| | two => Some(Some("hello")), + LL| | ); + LL| | if_let_chain(opt_opt_msg); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-let-chain.one.coverage b/tests/coverage/if-let-chain.one.coverage new file mode 100644 index 0000000000000..b4789e8593af6 --- /dev/null +++ b/tests/coverage/if-let-chain.one.coverage @@ -0,0 +1,41 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: none one two + LL| |//@[one] ignore-coverage-map + LL| |//@[two] ignore-coverage-map + LL| | + LL| |// Basic test for if-let chains. + LL| | + LL| 1|fn if_let_chain(opt_opt_msg: Option>) { + LL| 1| if let Some(opt_msg) = opt_opt_msg + LL| 1| && let Some(msg) = opt_msg + ^0 + LL| 0| { + LL| 0| say(msg); + LL| 1| } + LL| | + LL| 1| if let Some(opt_msg) = opt_opt_msg + LL| 1| && let Some(msg) = opt_msg + ^0 + LL| | { + LL| 0| say(msg) + LL| 1| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt_opt_msg = cfg_select!( + LL| | none => None, + LL| | one => Some(None), + LL| | two => Some(Some("hello")), + LL| | ); + LL| | if_let_chain(opt_opt_msg); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-let-chain.rs b/tests/coverage/if-let-chain.rs new file mode 100644 index 0000000000000..816a22015a4c7 --- /dev/null +++ b/tests/coverage/if-let-chain.rs @@ -0,0 +1,38 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ revisions: none one two +//@[one] ignore-coverage-map +//@[two] ignore-coverage-map + +// Basic test for if-let chains. + +fn if_let_chain(opt_opt_msg: Option>) { + if let Some(opt_msg) = opt_opt_msg + && let Some(msg) = opt_msg + { + say(msg); + } + + if let Some(opt_msg) = opt_opt_msg + && let Some(msg) = opt_msg + { + say(msg) + } + + say("goodbye"); +} + +#[coverage(off)] +fn main() { + let opt_opt_msg = cfg_select!( + none => None, + one => Some(None), + two => Some(Some("hello")), + ); + if_let_chain(opt_opt_msg); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/if-let-chain.two.coverage b/tests/coverage/if-let-chain.two.coverage new file mode 100644 index 0000000000000..491a704da1289 --- /dev/null +++ b/tests/coverage/if-let-chain.two.coverage @@ -0,0 +1,40 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: none one two + LL| |//@[one] ignore-coverage-map + LL| |//@[two] ignore-coverage-map + LL| | + LL| |// Basic test for if-let chains. + LL| | + LL| 1|fn if_let_chain(opt_opt_msg: Option>) { + LL| 1| if let Some(opt_msg) = opt_opt_msg + LL| 1| && let Some(msg) = opt_msg + LL| 1| { + LL| 1| say(msg); + LL| 1| } + ^0 + LL| | + LL| 1| if let Some(opt_msg) = opt_opt_msg + LL| 1| && let Some(msg) = opt_msg + LL| | { + LL| 1| say(msg) + LL| 0| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt_opt_msg = cfg_select!( + LL| | none => None, + LL| | one => Some(None), + LL| | two => Some(Some("hello")), + LL| | ); + LL| | if_let_chain(opt_opt_msg); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-tail-expr.no.cov-map b/tests/coverage/if-tail-expr.no.cov-map new file mode 100644 index 0000000000000..3849ec62daae8 --- /dev/null +++ b/tests/coverage/if-tail-expr.no.cov-map @@ -0,0 +1,45 @@ +Function name: if_tail_expr::if_true +Raw bytes (135): 0x[01, 01, 08, 01, 05, 01, 09, 01, 09, 01, 0d, 01, 1f, 0d, 11, 01, 1f, 0d, 11, 17, 01, 09, 01, 00, 24, 01, 01, 05, 00, 08, 01, 00, 09, 00, 10, 01, 02, 08, 00, 0c, 05, 01, 09, 00, 0c, 05, 00, 0d, 00, 13, 02, 01, 05, 00, 06, 01, 02, 08, 00, 0c, 09, 01, 09, 00, 0c, 09, 00, 0d, 00, 13, 0a, 02, 09, 00, 0c, 0a, 00, 0d, 00, 14, 01, 03, 08, 00, 0c, 0d, 01, 09, 00, 0c, 0d, 00, 0d, 00, 13, 0e, 01, 0f, 00, 14, 11, 01, 09, 00, 0c, 11, 00, 0d, 00, 14, 1a, 02, 09, 00, 0c, 1a, 00, 0d, 00, 16, 01, 03, 05, 00, 08, 01, 00, 09, 00, 12, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/if-tail-expr.rs +Number of expressions: 8 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(0), rhs = Counter(3) +- expression 4 operands: lhs = Counter(0), rhs = Expression(7, Add) +- expression 5 operands: lhs = Counter(3), rhs = Counter(4) +- expression 6 operands: lhs = Counter(0), rhs = Expression(7, Add) +- expression 7 operands: lhs = Counter(3), rhs = Counter(4) +Number of file 0 mappings: 23 +- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 36) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 16) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12) +- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 19) +- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 6) + = (c0 - c1) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) +- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 12) +- Code(Counter(2)) at (prev + 0, 13) to (start + 0, 19) +- Code(Expression(2, Sub)) at (prev + 2, 9) to (start + 0, 12) + = (c0 - c2) +- Code(Expression(2, Sub)) at (prev + 0, 13) to (start + 0, 20) + = (c0 - c2) +- Code(Counter(0)) at (prev + 3, 8) to (start + 0, 12) +- Code(Counter(3)) at (prev + 1, 9) to (start + 0, 12) +- Code(Counter(3)) at (prev + 0, 13) to (start + 0, 19) +- Code(Expression(3, Sub)) at (prev + 1, 15) to (start + 0, 20) + = (c0 - c3) +- Code(Counter(4)) at (prev + 1, 9) to (start + 0, 12) +- Code(Counter(4)) at (prev + 0, 13) to (start + 0, 20) +- Code(Expression(6, Sub)) at (prev + 2, 9) to (start + 0, 12) + = (c0 - (c3 + c4)) +- Code(Expression(6, Sub)) at (prev + 0, 13) to (start + 0, 22) + = (c0 - (c3 + c4)) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 + diff --git a/tests/coverage/if-tail-expr.no.coverage b/tests/coverage/if-tail-expr.no.coverage new file mode 100644 index 0000000000000..a33a58a6c30e6 --- /dev/null +++ b/tests/coverage/if-tail-expr.no.coverage @@ -0,0 +1,46 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: no yes + LL| |//@[yes] ignore-coverage-map + LL| | + LL| |// A variety of simple `if` expressions, in which the then/else blocks end with + LL| |// an expression. Contrast with `if-tail-stmt.rs`. + LL| | + LL| 1|fn if_true(cond: bool, other: bool) { + LL| 1| say("hello"); + LL| | + LL| 1| if cond { + LL| 0| say("true") + LL| 1| } + LL| | + LL| 1| if cond { + LL| 0| say("true") + LL| | } else { + LL| 1| say("false") + LL| | } + LL| | + LL| 1| if cond { + LL| 0| say("cond") + LL| 1| } else if other { + LL| 1| say("other") + LL| | } else { + LL| 0| say("neither") + LL| | } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let cond = cfg_select!( + LL| | no => false, + LL| | yes => true, + LL| | ); + LL| | if_true(cond, !cond); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-tail-expr.rs b/tests/coverage/if-tail-expr.rs new file mode 100644 index 0000000000000..778a9ecc8380c --- /dev/null +++ b/tests/coverage/if-tail-expr.rs @@ -0,0 +1,45 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ revisions: no yes +//@[yes] ignore-coverage-map + +// A variety of simple `if` expressions, in which the then/else blocks end with +// an expression. Contrast with `if-tail-stmt.rs`. + +fn if_true(cond: bool, other: bool) { + say("hello"); + + if cond { + say("true") + } + + if cond { + say("true") + } else { + say("false") + } + + if cond { + say("cond") + } else if other { + say("other") + } else { + say("neither") + } + + say("goodbye"); +} + +#[coverage(off)] +fn main() { + let cond = cfg_select!( + no => false, + yes => true, + ); + if_true(cond, !cond); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/if-tail-expr.yes.coverage b/tests/coverage/if-tail-expr.yes.coverage new file mode 100644 index 0000000000000..111efccf59b15 --- /dev/null +++ b/tests/coverage/if-tail-expr.yes.coverage @@ -0,0 +1,46 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: no yes + LL| |//@[yes] ignore-coverage-map + LL| | + LL| |// A variety of simple `if` expressions, in which the then/else blocks end with + LL| |// an expression. Contrast with `if-tail-stmt.rs`. + LL| | + LL| 1|fn if_true(cond: bool, other: bool) { + LL| 1| say("hello"); + LL| | + LL| 1| if cond { + LL| 1| say("true") + LL| 0| } + LL| | + LL| 1| if cond { + LL| 1| say("true") + LL| | } else { + LL| 0| say("false") + LL| | } + LL| | + LL| 1| if cond { + LL| 1| say("cond") + LL| 0| } else if other { + LL| 0| say("other") + LL| | } else { + LL| 0| say("neither") + LL| | } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let cond = cfg_select!( + LL| | no => false, + LL| | yes => true, + LL| | ); + LL| | if_true(cond, !cond); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-tail-stmt.no.cov-map b/tests/coverage/if-tail-stmt.no.cov-map new file mode 100644 index 0000000000000..e5721e2dc4a74 --- /dev/null +++ b/tests/coverage/if-tail-stmt.no.cov-map @@ -0,0 +1,34 @@ +Function name: if_tail_stmt::if_true +Raw bytes (99): 0x[01, 01, 05, 01, 05, 01, 09, 01, 0d, 01, 13, 0d, 11, 11, 01, 09, 01, 00, 24, 01, 01, 05, 00, 08, 01, 00, 09, 00, 10, 01, 02, 08, 00, 0c, 05, 00, 0d, 02, 06, 02, 02, 05, 00, 06, 01, 02, 08, 00, 0c, 09, 00, 0d, 02, 06, 06, 02, 0c, 02, 06, 01, 04, 08, 00, 0c, 0d, 00, 0d, 02, 06, 0a, 02, 0f, 00, 14, 11, 00, 15, 02, 06, 0e, 02, 0c, 02, 06, 01, 04, 05, 00, 08, 01, 00, 09, 00, 12, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/if-tail-stmt.rs +Number of expressions: 5 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +- expression 2 operands: lhs = Counter(0), rhs = Counter(3) +- expression 3 operands: lhs = Counter(0), rhs = Expression(4, Add) +- expression 4 operands: lhs = Counter(3), rhs = Counter(4) +Number of file 0 mappings: 17 +- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 36) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 16) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) +- Code(Counter(1)) at (prev + 0, 13) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) + = (c0 - c1) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) +- Code(Counter(2)) at (prev + 0, 13) to (start + 2, 6) +- Code(Expression(1, Sub)) at (prev + 2, 12) to (start + 2, 6) + = (c0 - c2) +- Code(Counter(0)) at (prev + 4, 8) to (start + 0, 12) +- Code(Counter(3)) at (prev + 0, 13) to (start + 2, 6) +- Code(Expression(2, Sub)) at (prev + 2, 15) to (start + 0, 20) + = (c0 - c3) +- Code(Counter(4)) at (prev + 0, 21) to (start + 2, 6) +- Code(Expression(3, Sub)) at (prev + 2, 12) to (start + 2, 6) + = (c0 - (c3 + c4)) +- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 + diff --git a/tests/coverage/if-tail-stmt.no.coverage b/tests/coverage/if-tail-stmt.no.coverage new file mode 100644 index 0000000000000..ca311f21ff229 --- /dev/null +++ b/tests/coverage/if-tail-stmt.no.coverage @@ -0,0 +1,46 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: no yes + LL| |//@[yes] ignore-coverage-map + LL| | + LL| |// A variety of simple `if` expressions, in which the then/else blocks end with + LL| |// a semicolon. Contrast with `if-tail-expr.rs`. + LL| | + LL| 1|fn if_true(cond: bool, other: bool) { + LL| 1| say("hello"); + LL| | + LL| 1| if cond { + LL| 0| say("true"); + LL| 1| } + LL| | + LL| 1| if cond { + LL| 0| say("true"); + LL| 1| } else { + LL| 1| say("false"); + LL| 1| } + LL| | + LL| 1| if cond { + LL| 0| say("cond"); + LL| 1| } else if other { + LL| 1| say("other"); + LL| 1| } else { + LL| 0| say("neither"); + LL| 0| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let cond = cfg_select!( + LL| | no => false, + LL| | yes => true, + LL| | ); + LL| | if_true(cond, !cond); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-tail-stmt.rs b/tests/coverage/if-tail-stmt.rs new file mode 100644 index 0000000000000..f350c4eba90b0 --- /dev/null +++ b/tests/coverage/if-tail-stmt.rs @@ -0,0 +1,45 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ revisions: no yes +//@[yes] ignore-coverage-map + +// A variety of simple `if` expressions, in which the then/else blocks end with +// a semicolon. Contrast with `if-tail-expr.rs`. + +fn if_true(cond: bool, other: bool) { + say("hello"); + + if cond { + say("true"); + } + + if cond { + say("true"); + } else { + say("false"); + } + + if cond { + say("cond"); + } else if other { + say("other"); + } else { + say("neither"); + } + + say("goodbye"); +} + +#[coverage(off)] +fn main() { + let cond = cfg_select!( + no => false, + yes => true, + ); + if_true(cond, !cond); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/if-tail-stmt.yes.coverage b/tests/coverage/if-tail-stmt.yes.coverage new file mode 100644 index 0000000000000..b4fa1884315e6 --- /dev/null +++ b/tests/coverage/if-tail-stmt.yes.coverage @@ -0,0 +1,48 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: no yes + LL| |//@[yes] ignore-coverage-map + LL| | + LL| |// A variety of simple `if` expressions, in which the then/else blocks end with + LL| |// a semicolon. Contrast with `if-tail-expr.rs`. + LL| | + LL| 1|fn if_true(cond: bool, other: bool) { + LL| 1| say("hello"); + LL| | + LL| 1| if cond { + LL| 1| say("true"); + LL| 1| } + ^0 + LL| | + LL| 1| if cond { + LL| 1| say("true"); + LL| 1| } else { + LL| 0| say("false"); + LL| 0| } + LL| | + LL| 1| if cond { + LL| 1| say("cond"); + LL| 1| } else if other { + ^0 + LL| 0| say("other"); + LL| 0| } else { + LL| 0| say("neither"); + LL| 0| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let cond = cfg_select!( + LL| | no => false, + LL| | yes => true, + LL| | ); + LL| | if_true(cond, !cond); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/iffy/README.md b/tests/coverage/iffy/README.md new file mode 100644 index 0000000000000..0d8a866ed2685 --- /dev/null +++ b/tests/coverage/iffy/README.md @@ -0,0 +1,4 @@ +# `tests/coverage/iffy` + +Older tests that are of limited value for investigating specific problems, +but still have some worth in detecting regressions by adding variety to the test corpus. diff --git a/tests/coverage/abort.cov-map b/tests/coverage/iffy/abort.cov-map similarity index 100% rename from tests/coverage/abort.cov-map rename to tests/coverage/iffy/abort.cov-map diff --git a/tests/coverage/abort.coverage b/tests/coverage/iffy/abort.coverage similarity index 100% rename from tests/coverage/abort.coverage rename to tests/coverage/iffy/abort.coverage diff --git a/tests/coverage/abort.rs b/tests/coverage/iffy/abort.rs similarity index 100% rename from tests/coverage/abort.rs rename to tests/coverage/iffy/abort.rs diff --git a/tests/coverage/iffy/assert.cov-map b/tests/coverage/iffy/assert.cov-map new file mode 100644 index 0000000000000..543ab89628281 --- /dev/null +++ b/tests/coverage/iffy/assert.cov-map @@ -0,0 +1,42 @@ +Function name: assert::main +Raw bytes (76): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 0c, 01, 09, 01, 00, 1c, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 02, 0a, 06, 02, 13, 00, 20, 0d, 00, 21, 02, 0a, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/assert.rs +Number of expressions: 6 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +- expression 1 operands: lhs = Counter(1), rhs = Expression(5, Add) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) +- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3) +- expression 5 operands: lhs = Counter(0), rhs = Counter(2) +Number of file 0 mappings: 12 +- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27) +- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 24) +- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 26) + = (c1 - c0) +- Code(Counter(2)) at (prev + 0, 27) to (start + 2, 10) +- Code(Expression(1, Sub)) at (prev + 2, 19) to (start + 0, 32) + = (c1 - (c0 + c2)) +- Code(Counter(3)) at (prev + 0, 33) to (start + 2, 10) +- Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10) + = (c1 - ((c0 + c2) + c3)) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23) + = (c1 - c0) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 11) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c3 + +Function name: assert::might_fail_assert +Raw bytes (24): 0x[01, 01, 00, 04, 01, 04, 01, 00, 28, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 05, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/assert.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 40) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 + diff --git a/tests/coverage/iffy/assert.coverage b/tests/coverage/iffy/assert.coverage new file mode 100644 index 0000000000000..29a5b48c0566a --- /dev/null +++ b/tests/coverage/iffy/assert.coverage @@ -0,0 +1,33 @@ + LL| |#![allow(unused_assignments)] + LL| |//@ failure-status: 101 + LL| | + LL| 4|fn might_fail_assert(one_plus_one: u32) { + LL| 4| println!("does 1 + 1 = {}?", one_plus_one); + LL| 4| assert_eq!(1 + 1, one_plus_one, "the argument was wrong"); + LL| 3|} + LL| | + LL| 1|fn main() -> Result<(), u8> { + LL| 1| let mut countdown = 10; + LL| 10| while countdown > 0 { + LL| 9| if countdown == 1 { + LL| 1| might_fail_assert(3); + LL| 8| } else if countdown < 5 { + LL| 3| might_fail_assert(2); + LL| 5| } + LL| 9| countdown -= 1; + LL| | } + LL| 1| Ok(()) + LL| 1|} + LL| | + LL| |// Notes: + LL| |// 1. Compare this program and its coverage results to those of the very similar test + LL| |// `panic_unwind.rs`, and similar tests `abort.rs` and `try_error_result.rs`. + LL| |// 2. This test confirms the coverage generated when a program passes or fails an `assert!()` or + LL| |// related `assert_*!()` macro. + LL| |// 3. Notably, the `assert` macros *do not* generate `TerminatorKind::Assert`. The macros produce + LL| |// conditional expressions, `TerminatorKind::SwitchInt` branches, and a possible call to + LL| |// `begin_panic_fmt()` (that begins a panic unwind, if the assertion test fails). + LL| |// 4. `TerminatorKind::Assert` is, however, also present in the MIR generated for this test + LL| |// (and in many other coverage tests). The `Assert` terminator is typically generated by the + LL| |// Rust compiler to check for runtime failures, such as numeric overflows. + diff --git a/tests/coverage/iffy/assert.rs b/tests/coverage/iffy/assert.rs new file mode 100644 index 0000000000000..30d511f8f7a89 --- /dev/null +++ b/tests/coverage/iffy/assert.rs @@ -0,0 +1,32 @@ +#![allow(unused_assignments)] +//@ failure-status: 101 + +fn might_fail_assert(one_plus_one: u32) { + println!("does 1 + 1 = {}?", one_plus_one); + assert_eq!(1 + 1, one_plus_one, "the argument was wrong"); +} + +fn main() -> Result<(), u8> { + let mut countdown = 10; + while countdown > 0 { + if countdown == 1 { + might_fail_assert(3); + } else if countdown < 5 { + might_fail_assert(2); + } + countdown -= 1; + } + Ok(()) +} + +// Notes: +// 1. Compare this program and its coverage results to those of the very similar test +// `panic_unwind.rs`, and similar tests `abort.rs` and `try_error_result.rs`. +// 2. This test confirms the coverage generated when a program passes or fails an `assert!()` or +// related `assert_*!()` macro. +// 3. Notably, the `assert` macros *do not* generate `TerminatorKind::Assert`. The macros produce +// conditional expressions, `TerminatorKind::SwitchInt` branches, and a possible call to +// `begin_panic_fmt()` (that begins a panic unwind, if the assertion test fails). +// 4. `TerminatorKind::Assert` is, however, also present in the MIR generated for this test +// (and in many other coverage tests). The `Assert` terminator is typically generated by the +// Rust compiler to check for runtime failures, such as numeric overflows. diff --git a/tests/coverage/auxiliary/inline_always_with_dead_code.rs b/tests/coverage/iffy/auxiliary/inline_always_with_dead_code.rs similarity index 100% rename from tests/coverage/auxiliary/inline_always_with_dead_code.rs rename to tests/coverage/iffy/auxiliary/inline_always_with_dead_code.rs diff --git a/tests/coverage/auxiliary/used_crate.rs b/tests/coverage/iffy/auxiliary/used_crate.rs similarity index 100% rename from tests/coverage/auxiliary/used_crate.rs rename to tests/coverage/iffy/auxiliary/used_crate.rs diff --git a/tests/coverage/auxiliary/used_inline_crate.rs b/tests/coverage/iffy/auxiliary/used_inline_crate.rs similarity index 100% rename from tests/coverage/auxiliary/used_inline_crate.rs rename to tests/coverage/iffy/auxiliary/used_inline_crate.rs diff --git a/tests/coverage/closure.cov-map b/tests/coverage/iffy/closure.cov-map similarity index 100% rename from tests/coverage/closure.cov-map rename to tests/coverage/iffy/closure.cov-map diff --git a/tests/coverage/closure.coverage b/tests/coverage/iffy/closure.coverage similarity index 100% rename from tests/coverage/closure.coverage rename to tests/coverage/iffy/closure.coverage diff --git a/tests/coverage/closure.rs b/tests/coverage/iffy/closure.rs similarity index 100% rename from tests/coverage/closure.rs rename to tests/coverage/iffy/closure.rs diff --git a/tests/coverage/closure_macro.cov-map b/tests/coverage/iffy/closure_macro.cov-map similarity index 100% rename from tests/coverage/closure_macro.cov-map rename to tests/coverage/iffy/closure_macro.cov-map diff --git a/tests/coverage/closure_macro.coverage b/tests/coverage/iffy/closure_macro.coverage similarity index 100% rename from tests/coverage/closure_macro.coverage rename to tests/coverage/iffy/closure_macro.coverage diff --git a/tests/coverage/closure_macro.rs b/tests/coverage/iffy/closure_macro.rs similarity index 100% rename from tests/coverage/closure_macro.rs rename to tests/coverage/iffy/closure_macro.rs diff --git a/tests/coverage/conditions.cov-map b/tests/coverage/iffy/conditions.cov-map similarity index 100% rename from tests/coverage/conditions.cov-map rename to tests/coverage/iffy/conditions.cov-map diff --git a/tests/coverage/conditions.coverage b/tests/coverage/iffy/conditions.coverage similarity index 100% rename from tests/coverage/conditions.coverage rename to tests/coverage/iffy/conditions.coverage diff --git a/tests/coverage/conditions.rs b/tests/coverage/iffy/conditions.rs similarity index 100% rename from tests/coverage/conditions.rs rename to tests/coverage/iffy/conditions.rs diff --git a/tests/coverage/continue.cov-map b/tests/coverage/iffy/continue.cov-map similarity index 100% rename from tests/coverage/continue.cov-map rename to tests/coverage/iffy/continue.cov-map diff --git a/tests/coverage/continue.coverage b/tests/coverage/iffy/continue.coverage similarity index 100% rename from tests/coverage/continue.coverage rename to tests/coverage/iffy/continue.coverage diff --git a/tests/coverage/continue.rs b/tests/coverage/iffy/continue.rs similarity index 100% rename from tests/coverage/continue.rs rename to tests/coverage/iffy/continue.rs diff --git a/tests/coverage/coroutine.cov-map b/tests/coverage/iffy/coroutine.cov-map similarity index 100% rename from tests/coverage/coroutine.cov-map rename to tests/coverage/iffy/coroutine.cov-map diff --git a/tests/coverage/coroutine.coverage b/tests/coverage/iffy/coroutine.coverage similarity index 100% rename from tests/coverage/coroutine.coverage rename to tests/coverage/iffy/coroutine.coverage diff --git a/tests/coverage/coroutine.rs b/tests/coverage/iffy/coroutine.rs similarity index 100% rename from tests/coverage/coroutine.rs rename to tests/coverage/iffy/coroutine.rs diff --git a/tests/coverage/drop_trait.cov-map b/tests/coverage/iffy/drop_trait.cov-map similarity index 100% rename from tests/coverage/drop_trait.cov-map rename to tests/coverage/iffy/drop_trait.cov-map diff --git a/tests/coverage/drop_trait.coverage b/tests/coverage/iffy/drop_trait.coverage similarity index 100% rename from tests/coverage/drop_trait.coverage rename to tests/coverage/iffy/drop_trait.coverage diff --git a/tests/coverage/drop_trait.rs b/tests/coverage/iffy/drop_trait.rs similarity index 100% rename from tests/coverage/drop_trait.rs rename to tests/coverage/iffy/drop_trait.rs diff --git a/tests/coverage/generics.cov-map b/tests/coverage/iffy/generics.cov-map similarity index 100% rename from tests/coverage/generics.cov-map rename to tests/coverage/iffy/generics.cov-map diff --git a/tests/coverage/generics.coverage b/tests/coverage/iffy/generics.coverage similarity index 100% rename from tests/coverage/generics.coverage rename to tests/coverage/iffy/generics.coverage diff --git a/tests/coverage/generics.rs b/tests/coverage/iffy/generics.rs similarity index 100% rename from tests/coverage/generics.rs rename to tests/coverage/iffy/generics.rs diff --git a/tests/coverage/if.cov-map b/tests/coverage/iffy/if.cov-map similarity index 100% rename from tests/coverage/if.cov-map rename to tests/coverage/iffy/if.cov-map diff --git a/tests/coverage/if.coverage b/tests/coverage/iffy/if.coverage similarity index 100% rename from tests/coverage/if.coverage rename to tests/coverage/iffy/if.coverage diff --git a/tests/coverage/if.rs b/tests/coverage/iffy/if.rs similarity index 100% rename from tests/coverage/if.rs rename to tests/coverage/iffy/if.rs diff --git a/tests/coverage/if_else.cov-map b/tests/coverage/iffy/if_else.cov-map similarity index 100% rename from tests/coverage/if_else.cov-map rename to tests/coverage/iffy/if_else.cov-map diff --git a/tests/coverage/if_else.coverage b/tests/coverage/iffy/if_else.coverage similarity index 100% rename from tests/coverage/if_else.coverage rename to tests/coverage/iffy/if_else.coverage diff --git a/tests/coverage/if_else.rs b/tests/coverage/iffy/if_else.rs similarity index 100% rename from tests/coverage/if_else.rs rename to tests/coverage/iffy/if_else.rs diff --git a/tests/coverage/inline-dead.cov-map b/tests/coverage/iffy/inline-dead.cov-map similarity index 100% rename from tests/coverage/inline-dead.cov-map rename to tests/coverage/iffy/inline-dead.cov-map diff --git a/tests/coverage/inline-dead.coverage b/tests/coverage/iffy/inline-dead.coverage similarity index 100% rename from tests/coverage/inline-dead.coverage rename to tests/coverage/iffy/inline-dead.coverage diff --git a/tests/coverage/inline-dead.rs b/tests/coverage/iffy/inline-dead.rs similarity index 100% rename from tests/coverage/inline-dead.rs rename to tests/coverage/iffy/inline-dead.rs diff --git a/tests/coverage/inline.cov-map b/tests/coverage/iffy/inline.cov-map similarity index 100% rename from tests/coverage/inline.cov-map rename to tests/coverage/iffy/inline.cov-map diff --git a/tests/coverage/inline.coverage b/tests/coverage/iffy/inline.coverage similarity index 100% rename from tests/coverage/inline.coverage rename to tests/coverage/iffy/inline.coverage diff --git a/tests/coverage/inline.rs b/tests/coverage/iffy/inline.rs similarity index 100% rename from tests/coverage/inline.rs rename to tests/coverage/iffy/inline.rs diff --git a/tests/coverage/inner_items.cov-map b/tests/coverage/iffy/inner_items.cov-map similarity index 100% rename from tests/coverage/inner_items.cov-map rename to tests/coverage/iffy/inner_items.cov-map diff --git a/tests/coverage/inner_items.coverage b/tests/coverage/iffy/inner_items.coverage similarity index 100% rename from tests/coverage/inner_items.coverage rename to tests/coverage/iffy/inner_items.coverage diff --git a/tests/coverage/inner_items.rs b/tests/coverage/iffy/inner_items.rs similarity index 100% rename from tests/coverage/inner_items.rs rename to tests/coverage/iffy/inner_items.rs diff --git a/tests/coverage/issue-83601.cov-map b/tests/coverage/iffy/issue-83601.cov-map similarity index 100% rename from tests/coverage/issue-83601.cov-map rename to tests/coverage/iffy/issue-83601.cov-map diff --git a/tests/coverage/issue-83601.coverage b/tests/coverage/iffy/issue-83601.coverage similarity index 100% rename from tests/coverage/issue-83601.coverage rename to tests/coverage/iffy/issue-83601.coverage diff --git a/tests/coverage/issue-83601.rs b/tests/coverage/iffy/issue-83601.rs similarity index 100% rename from tests/coverage/issue-83601.rs rename to tests/coverage/iffy/issue-83601.rs diff --git a/tests/coverage/issue-84561.cov-map b/tests/coverage/iffy/issue-84561.cov-map similarity index 100% rename from tests/coverage/issue-84561.cov-map rename to tests/coverage/iffy/issue-84561.cov-map diff --git a/tests/coverage/issue-84561.coverage b/tests/coverage/iffy/issue-84561.coverage similarity index 100% rename from tests/coverage/issue-84561.coverage rename to tests/coverage/iffy/issue-84561.coverage diff --git a/tests/coverage/issue-84561.rs b/tests/coverage/iffy/issue-84561.rs similarity index 100% rename from tests/coverage/issue-84561.rs rename to tests/coverage/iffy/issue-84561.rs diff --git a/tests/coverage/issue-85461.cov-map b/tests/coverage/iffy/issue-85461.cov-map similarity index 100% rename from tests/coverage/issue-85461.cov-map rename to tests/coverage/iffy/issue-85461.cov-map diff --git a/tests/coverage/issue-85461.coverage b/tests/coverage/iffy/issue-85461.coverage similarity index 100% rename from tests/coverage/issue-85461.coverage rename to tests/coverage/iffy/issue-85461.coverage diff --git a/tests/coverage/issue-85461.rs b/tests/coverage/iffy/issue-85461.rs similarity index 100% rename from tests/coverage/issue-85461.rs rename to tests/coverage/iffy/issue-85461.rs diff --git a/tests/coverage/issue-93054.cov-map b/tests/coverage/iffy/issue-93054.cov-map similarity index 100% rename from tests/coverage/issue-93054.cov-map rename to tests/coverage/iffy/issue-93054.cov-map diff --git a/tests/coverage/issue-93054.coverage b/tests/coverage/iffy/issue-93054.coverage similarity index 100% rename from tests/coverage/issue-93054.coverage rename to tests/coverage/iffy/issue-93054.coverage diff --git a/tests/coverage/issue-93054.rs b/tests/coverage/iffy/issue-93054.rs similarity index 100% rename from tests/coverage/issue-93054.rs rename to tests/coverage/iffy/issue-93054.rs diff --git a/tests/coverage/lazy_boolean.cov-map b/tests/coverage/iffy/lazy_boolean.cov-map similarity index 100% rename from tests/coverage/lazy_boolean.cov-map rename to tests/coverage/iffy/lazy_boolean.cov-map diff --git a/tests/coverage/lazy_boolean.coverage b/tests/coverage/iffy/lazy_boolean.coverage similarity index 100% rename from tests/coverage/lazy_boolean.coverage rename to tests/coverage/iffy/lazy_boolean.coverage diff --git a/tests/coverage/lazy_boolean.rs b/tests/coverage/iffy/lazy_boolean.rs similarity index 100% rename from tests/coverage/lazy_boolean.rs rename to tests/coverage/iffy/lazy_boolean.rs diff --git a/tests/coverage/loops_branches.cov-map b/tests/coverage/iffy/loops_branches.cov-map similarity index 100% rename from tests/coverage/loops_branches.cov-map rename to tests/coverage/iffy/loops_branches.cov-map diff --git a/tests/coverage/loops_branches.coverage b/tests/coverage/iffy/loops_branches.coverage similarity index 100% rename from tests/coverage/loops_branches.coverage rename to tests/coverage/iffy/loops_branches.coverage diff --git a/tests/coverage/loops_branches.rs b/tests/coverage/iffy/loops_branches.rs similarity index 100% rename from tests/coverage/loops_branches.rs rename to tests/coverage/iffy/loops_branches.rs diff --git a/tests/coverage/match_or_pattern.cov-map b/tests/coverage/iffy/match_or_pattern.cov-map similarity index 100% rename from tests/coverage/match_or_pattern.cov-map rename to tests/coverage/iffy/match_or_pattern.cov-map diff --git a/tests/coverage/match_or_pattern.coverage b/tests/coverage/iffy/match_or_pattern.coverage similarity index 100% rename from tests/coverage/match_or_pattern.coverage rename to tests/coverage/iffy/match_or_pattern.coverage diff --git a/tests/coverage/match_or_pattern.rs b/tests/coverage/iffy/match_or_pattern.rs similarity index 100% rename from tests/coverage/match_or_pattern.rs rename to tests/coverage/iffy/match_or_pattern.rs diff --git a/tests/coverage/nested_loops.cov-map b/tests/coverage/iffy/nested_loops.cov-map similarity index 100% rename from tests/coverage/nested_loops.cov-map rename to tests/coverage/iffy/nested_loops.cov-map diff --git a/tests/coverage/nested_loops.coverage b/tests/coverage/iffy/nested_loops.coverage similarity index 100% rename from tests/coverage/nested_loops.coverage rename to tests/coverage/iffy/nested_loops.coverage diff --git a/tests/coverage/nested_loops.rs b/tests/coverage/iffy/nested_loops.rs similarity index 100% rename from tests/coverage/nested_loops.rs rename to tests/coverage/iffy/nested_loops.rs diff --git a/tests/coverage/no_cov_crate.cov-map b/tests/coverage/iffy/no_cov_crate.cov-map similarity index 100% rename from tests/coverage/no_cov_crate.cov-map rename to tests/coverage/iffy/no_cov_crate.cov-map diff --git a/tests/coverage/no_cov_crate.coverage b/tests/coverage/iffy/no_cov_crate.coverage similarity index 100% rename from tests/coverage/no_cov_crate.coverage rename to tests/coverage/iffy/no_cov_crate.coverage diff --git a/tests/coverage/no_cov_crate.rs b/tests/coverage/iffy/no_cov_crate.rs similarity index 100% rename from tests/coverage/no_cov_crate.rs rename to tests/coverage/iffy/no_cov_crate.rs diff --git a/tests/coverage/overflow.cov-map b/tests/coverage/iffy/overflow.cov-map similarity index 100% rename from tests/coverage/overflow.cov-map rename to tests/coverage/iffy/overflow.cov-map diff --git a/tests/coverage/overflow.coverage b/tests/coverage/iffy/overflow.coverage similarity index 100% rename from tests/coverage/overflow.coverage rename to tests/coverage/iffy/overflow.coverage diff --git a/tests/coverage/overflow.rs b/tests/coverage/iffy/overflow.rs similarity index 100% rename from tests/coverage/overflow.rs rename to tests/coverage/iffy/overflow.rs diff --git a/tests/coverage/panic_unwind.cov-map b/tests/coverage/iffy/panic_unwind.cov-map similarity index 100% rename from tests/coverage/panic_unwind.cov-map rename to tests/coverage/iffy/panic_unwind.cov-map diff --git a/tests/coverage/panic_unwind.coverage b/tests/coverage/iffy/panic_unwind.coverage similarity index 100% rename from tests/coverage/panic_unwind.coverage rename to tests/coverage/iffy/panic_unwind.coverage diff --git a/tests/coverage/panic_unwind.rs b/tests/coverage/iffy/panic_unwind.rs similarity index 100% rename from tests/coverage/panic_unwind.rs rename to tests/coverage/iffy/panic_unwind.rs diff --git a/tests/coverage/partial_eq.cov-map b/tests/coverage/iffy/partial_eq.cov-map similarity index 100% rename from tests/coverage/partial_eq.cov-map rename to tests/coverage/iffy/partial_eq.cov-map diff --git a/tests/coverage/partial_eq.coverage b/tests/coverage/iffy/partial_eq.coverage similarity index 100% rename from tests/coverage/partial_eq.coverage rename to tests/coverage/iffy/partial_eq.coverage diff --git a/tests/coverage/partial_eq.rs b/tests/coverage/iffy/partial_eq.rs similarity index 100% rename from tests/coverage/partial_eq.rs rename to tests/coverage/iffy/partial_eq.rs diff --git a/tests/coverage/simple_loop.cov-map b/tests/coverage/iffy/simple_loop.cov-map similarity index 100% rename from tests/coverage/simple_loop.cov-map rename to tests/coverage/iffy/simple_loop.cov-map diff --git a/tests/coverage/simple_loop.coverage b/tests/coverage/iffy/simple_loop.coverage similarity index 100% rename from tests/coverage/simple_loop.coverage rename to tests/coverage/iffy/simple_loop.coverage diff --git a/tests/coverage/simple_loop.rs b/tests/coverage/iffy/simple_loop.rs similarity index 100% rename from tests/coverage/simple_loop.rs rename to tests/coverage/iffy/simple_loop.rs diff --git a/tests/coverage/simple_match.cov-map b/tests/coverage/iffy/simple_match.cov-map similarity index 100% rename from tests/coverage/simple_match.cov-map rename to tests/coverage/iffy/simple_match.cov-map diff --git a/tests/coverage/simple_match.coverage b/tests/coverage/iffy/simple_match.coverage similarity index 100% rename from tests/coverage/simple_match.coverage rename to tests/coverage/iffy/simple_match.coverage diff --git a/tests/coverage/simple_match.rs b/tests/coverage/iffy/simple_match.rs similarity index 100% rename from tests/coverage/simple_match.rs rename to tests/coverage/iffy/simple_match.rs diff --git a/tests/coverage/try_error_result.cov-map b/tests/coverage/iffy/try_error_result.cov-map similarity index 100% rename from tests/coverage/try_error_result.cov-map rename to tests/coverage/iffy/try_error_result.cov-map diff --git a/tests/coverage/try_error_result.coverage b/tests/coverage/iffy/try_error_result.coverage similarity index 100% rename from tests/coverage/try_error_result.coverage rename to tests/coverage/iffy/try_error_result.coverage diff --git a/tests/coverage/try_error_result.rs b/tests/coverage/iffy/try_error_result.rs similarity index 100% rename from tests/coverage/try_error_result.rs rename to tests/coverage/iffy/try_error_result.rs diff --git a/tests/coverage/uses_crate.cov-map b/tests/coverage/iffy/uses_crate.cov-map similarity index 100% rename from tests/coverage/uses_crate.cov-map rename to tests/coverage/iffy/uses_crate.cov-map diff --git a/tests/coverage/uses_crate.coverage b/tests/coverage/iffy/uses_crate.coverage similarity index 100% rename from tests/coverage/uses_crate.coverage rename to tests/coverage/iffy/uses_crate.coverage diff --git a/tests/coverage/uses_crate.rs b/tests/coverage/iffy/uses_crate.rs similarity index 100% rename from tests/coverage/uses_crate.rs rename to tests/coverage/iffy/uses_crate.rs diff --git a/tests/coverage/uses_inline_crate.cov-map b/tests/coverage/iffy/uses_inline_crate.cov-map similarity index 100% rename from tests/coverage/uses_inline_crate.cov-map rename to tests/coverage/iffy/uses_inline_crate.cov-map diff --git a/tests/coverage/uses_inline_crate.coverage b/tests/coverage/iffy/uses_inline_crate.coverage similarity index 100% rename from tests/coverage/uses_inline_crate.coverage rename to tests/coverage/iffy/uses_inline_crate.coverage diff --git a/tests/coverage/uses_inline_crate.rs b/tests/coverage/iffy/uses_inline_crate.rs similarity index 100% rename from tests/coverage/uses_inline_crate.rs rename to tests/coverage/iffy/uses_inline_crate.rs diff --git a/tests/coverage/iffy/while.cov-map b/tests/coverage/iffy/while.cov-map new file mode 100644 index 0000000000000..c4183e18e021d --- /dev/null +++ b/tests/coverage/iffy/while.cov-map @@ -0,0 +1,14 @@ +Function name: while::main +Raw bytes (34): 0x[01, 01, 00, 06, 01, 01, 01, 00, 0a, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 10, 01, 01, 0b, 00, 14, 00, 00, 15, 02, 06, 01, 03, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/while.rs +Number of expressions: 0 +Number of file 0 mappings: 6 +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 11) to (start + 0, 20) +- Code(Zero) at (prev + 0, 21) to (start + 2, 6) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/iffy/while.coverage b/tests/coverage/iffy/while.coverage new file mode 100644 index 0000000000000..90c16288d668c --- /dev/null +++ b/tests/coverage/iffy/while.coverage @@ -0,0 +1,7 @@ + LL| 1|fn main() { + LL| 1| let num = 9; + LL| 1| while num >= 10 { + LL| 0| // loop body + LL| 0| } + LL| 1|} + diff --git a/tests/coverage/iffy/while.rs b/tests/coverage/iffy/while.rs new file mode 100644 index 0000000000000..d60916a979818 --- /dev/null +++ b/tests/coverage/iffy/while.rs @@ -0,0 +1,6 @@ +fn main() { + let num = 9; + while num >= 10 { + // loop body + } +} diff --git a/tests/coverage/while_early_ret.cov-map b/tests/coverage/iffy/while_early_ret.cov-map similarity index 100% rename from tests/coverage/while_early_ret.cov-map rename to tests/coverage/iffy/while_early_ret.cov-map diff --git a/tests/coverage/while_early_ret.coverage b/tests/coverage/iffy/while_early_ret.coverage similarity index 100% rename from tests/coverage/while_early_ret.coverage rename to tests/coverage/iffy/while_early_ret.coverage diff --git a/tests/coverage/while_early_ret.rs b/tests/coverage/iffy/while_early_ret.rs similarity index 100% rename from tests/coverage/while_early_ret.rs rename to tests/coverage/iffy/while_early_ret.rs diff --git a/tests/coverage/yield.cov-map b/tests/coverage/iffy/yield.cov-map similarity index 100% rename from tests/coverage/yield.cov-map rename to tests/coverage/iffy/yield.cov-map diff --git a/tests/coverage/yield.coverage b/tests/coverage/iffy/yield.coverage similarity index 100% rename from tests/coverage/yield.coverage rename to tests/coverage/iffy/yield.coverage diff --git a/tests/coverage/yield.rs b/tests/coverage/iffy/yield.rs similarity index 100% rename from tests/coverage/yield.rs rename to tests/coverage/iffy/yield.rs diff --git a/tests/coverage/let-else.none.cov-map b/tests/coverage/let-else.none.cov-map new file mode 100644 index 0000000000000..af5b34cb36f79 --- /dev/null +++ b/tests/coverage/let-else.none.cov-map @@ -0,0 +1,38 @@ +Function name: let_else::let_else_no_semi +Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 10, 01, 00, 2b, 02, 01, 0e, 00, 11, 01, 00, 15, 00, 1c, 05, 01, 09, 00, 0f, 02, 02, 05, 00, 08, 02, 00, 09, 00, 0c, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/let-else.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 7 +- Code(Counter(0)) at (prev + 16, 1) to (start + 0, 43) +- Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 17) + = (c0 - c1) +- Code(Counter(0)) at (prev + 0, 21) to (start + 0, 28) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 8) + = (c0 - c1) +- Code(Expression(0, Sub)) at (prev + 0, 9) to (start + 0, 12) + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 + +Function name: let_else::let_else_semi +Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 08, 01, 00, 28, 02, 01, 0e, 00, 11, 01, 00, 15, 00, 1c, 05, 01, 09, 00, 0f, 02, 02, 05, 00, 08, 02, 00, 09, 00, 0c, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/let-else.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 7 +- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 40) +- Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 17) + = (c0 - c1) +- Code(Counter(0)) at (prev + 0, 21) to (start + 0, 28) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 8) + = (c0 - c1) +- Code(Expression(0, Sub)) at (prev + 0, 9) to (start + 0, 12) + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 + diff --git a/tests/coverage/let-else.none.coverage b/tests/coverage/let-else.none.coverage new file mode 100644 index 0000000000000..a24877eb90a03 --- /dev/null +++ b/tests/coverage/let-else.none.coverage @@ -0,0 +1,39 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: none some + LL| |//@[some] ignore-coverage-map + LL| | + LL| |// Basic test for let-else statements. + LL| | + LL| 1|fn let_else_semi(opt_msg: Option<&str>) { + LL| 1| let Some(msg) = opt_msg else { + ^0 + LL| 1| return; + LL| | }; + LL| 0| say(msg); + LL| 1|} + LL| | + LL| |#[rustfmt::skip] + LL| 1|fn let_else_no_semi(opt_msg: Option<&str>) { + LL| 1| let Some(msg) = opt_msg else { + ^0 + LL| 1| return + LL| | }; + LL| 0| say(msg); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt_msg = cfg_select!( + LL| | some => Some("hello"), + LL| | none => None, + LL| | ); + LL| | let_else_semi(opt_msg); + LL| | let_else_no_semi(opt_msg); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/let-else.rs b/tests/coverage/let-else.rs new file mode 100644 index 0000000000000..0ebef52d649c7 --- /dev/null +++ b/tests/coverage/let-else.rs @@ -0,0 +1,36 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ revisions: none some +//@[some] ignore-coverage-map + +// Basic test for let-else statements. + +fn let_else_semi(opt_msg: Option<&str>) { + let Some(msg) = opt_msg else { + return; + }; + say(msg); +} + +#[rustfmt::skip] +fn let_else_no_semi(opt_msg: Option<&str>) { + let Some(msg) = opt_msg else { + return + }; + say(msg); +} + +#[coverage(off)] +fn main() { + let opt_msg = cfg_select!( + some => Some("hello"), + none => None, + ); + let_else_semi(opt_msg); + let_else_no_semi(opt_msg); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/let-else.some.coverage b/tests/coverage/let-else.some.coverage new file mode 100644 index 0000000000000..828731b199f95 --- /dev/null +++ b/tests/coverage/let-else.some.coverage @@ -0,0 +1,37 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: none some + LL| |//@[some] ignore-coverage-map + LL| | + LL| |// Basic test for let-else statements. + LL| | + LL| 1|fn let_else_semi(opt_msg: Option<&str>) { + LL| 1| let Some(msg) = opt_msg else { + LL| 0| return; + LL| | }; + LL| 1| say(msg); + LL| 1|} + LL| | + LL| |#[rustfmt::skip] + LL| 1|fn let_else_no_semi(opt_msg: Option<&str>) { + LL| 1| let Some(msg) = opt_msg else { + LL| 0| return + LL| | }; + LL| 1| say(msg); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt_msg = cfg_select!( + LL| | some => Some("hello"), + LL| | none => None, + LL| | ); + LL| | let_else_semi(opt_msg); + LL| | let_else_no_semi(opt_msg); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/match.cov-map b/tests/coverage/match.cov-map new file mode 100644 index 0000000000000..ac9433fda2dcb --- /dev/null +++ b/tests/coverage/match.cov-map @@ -0,0 +1,49 @@ +Function name: match::match_expr +Raw bytes (131): 0x[01, 01, 0b, 1d, 07, 0b, 19, 0f, 15, 05, 0d, 0d, 11, 0d, 11, 05, 09, 05, 09, 05, 09, 01, 1d, 01, 1d, 15, 01, 06, 01, 00, 2a, 0d, 01, 0b, 00, 0c, 02, 01, 14, 00, 17, 02, 00, 18, 00, 1e, 19, 03, 0d, 00, 10, 19, 00, 11, 00, 16, 15, 02, 14, 02, 0a, 11, 03, 17, 00, 18, 11, 00, 1c, 02, 0a, 16, 03, 14, 00, 17, 16, 00, 18, 00, 1f, 09, 01, 0e, 00, 13, 05, 00, 18, 00, 1d, 09, 00, 21, 00, 22, 09, 00, 26, 02, 0a, 22, 03, 0e, 00, 13, 22, 00, 18, 00, 1b, 22, 00, 1c, 00, 23, 2a, 01, 11, 00, 14, 2a, 00, 15, 00, 1b, 01, 02, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/match.rs +Number of expressions: 11 +- expression 0 operands: lhs = Counter(7), rhs = Expression(1, Add) +- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(6) +- expression 2 operands: lhs = Expression(3, Add), rhs = Counter(5) +- expression 3 operands: lhs = Counter(1), rhs = Counter(3) +- expression 4 operands: lhs = Counter(3), rhs = Counter(4) +- expression 5 operands: lhs = Counter(3), rhs = Counter(4) +- expression 6 operands: lhs = Counter(1), rhs = Counter(2) +- expression 7 operands: lhs = Counter(1), rhs = Counter(2) +- expression 8 operands: lhs = Counter(1), rhs = Counter(2) +- expression 9 operands: lhs = Counter(0), rhs = Counter(7) +- expression 10 operands: lhs = Counter(0), rhs = Counter(7) +Number of file 0 mappings: 21 +- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 42) +- Code(Counter(3)) at (prev + 1, 11) to (start + 0, 12) +- Code(Expression(0, Sub)) at (prev + 1, 20) to (start + 0, 23) + = (c7 - (((c1 + c3) + c5) + c6)) +- Code(Expression(0, Sub)) at (prev + 0, 24) to (start + 0, 30) + = (c7 - (((c1 + c3) + c5) + c6)) +- Code(Counter(6)) at (prev + 3, 13) to (start + 0, 16) +- Code(Counter(6)) at (prev + 0, 17) to (start + 0, 22) +- Code(Counter(5)) at (prev + 2, 20) to (start + 2, 10) +- Code(Counter(4)) at (prev + 3, 23) to (start + 0, 24) +- Code(Counter(4)) at (prev + 0, 28) to (start + 2, 10) +- Code(Expression(5, Sub)) at (prev + 3, 20) to (start + 0, 23) + = (c3 - c4) +- Code(Expression(5, Sub)) at (prev + 0, 24) to (start + 0, 31) + = (c3 - c4) +- Code(Counter(2)) at (prev + 1, 14) to (start + 0, 19) +- Code(Counter(1)) at (prev + 0, 24) to (start + 0, 29) +- Code(Counter(2)) at (prev + 0, 33) to (start + 0, 34) +- Code(Counter(2)) at (prev + 0, 38) to (start + 2, 10) +- Code(Expression(8, Sub)) at (prev + 3, 14) to (start + 0, 19) + = (c1 - c2) +- Code(Expression(8, Sub)) at (prev + 0, 24) to (start + 0, 27) + = (c1 - c2) +- Code(Expression(8, Sub)) at (prev + 0, 28) to (start + 0, 35) + = (c1 - c2) +- Code(Expression(10, Sub)) at (prev + 1, 17) to (start + 0, 20) + = (c0 - c7) +- Code(Expression(10, Sub)) at (prev + 0, 21) to (start + 0, 27) + = (c0 - c7) +- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +Highest counter ID seen: c6 + diff --git a/tests/coverage/match.coverage b/tests/coverage/match.coverage new file mode 100644 index 0000000000000..a69a8652b3c75 --- /dev/null +++ b/tests/coverage/match.coverage @@ -0,0 +1,43 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| | + LL| |// Basic test for `match` expressions with various kinds of arms and guards. + LL| | + LL| 16|fn match_expr(x: Option, cond: bool) { + LL| 3| match x { + LL| 0| Some(0) => say("zero"), + LL| | Some(1) => { + LL| | // (block with a trailing expression) + LL| 1| say("one") + LL| | } + LL| 2| Some(2) => { + LL| 2| say("two"); + LL| 2| } + LL| 0| Some(3) if cond => { + LL| 0| say("three-cond"); + LL| 0| } + LL| 3| Some(3) => say("three"), + LL| 9| Some(other) if other == 4 => { + ^4 ^4 + LL| 4| say("four"); + LL| 4| } + LL| 5| Some(other) => say("other"), + LL| 1| None => say("none"), + LL| | } + LL| 16|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | for i in 0..=5 { + LL| | for _ in 0..i { + LL| | match_expr(Some(i), false); + LL| | } + LL| | } + LL| | match_expr(None, true); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/match.rs b/tests/coverage/match.rs new file mode 100644 index 0000000000000..c9d4fd75bdc18 --- /dev/null +++ b/tests/coverage/match.rs @@ -0,0 +1,41 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 + +// Basic test for `match` expressions with various kinds of arms and guards. + +fn match_expr(x: Option, cond: bool) { + match x { + Some(0) => say("zero"), + Some(1) => { + // (block with a trailing expression) + say("one") + } + Some(2) => { + say("two"); + } + Some(3) if cond => { + say("three-cond"); + } + Some(3) => say("three"), + Some(other) if other == 4 => { + say("four"); + } + Some(other) => say("other"), + None => say("none"), + } +} + +#[coverage(off)] +fn main() { + for i in 0..=5 { + for _ in 0..i { + match_expr(Some(i), false); + } + } + match_expr(None, true); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/while.cov-map b/tests/coverage/while.cov-map index c4183e18e021d..52bef0a80dfb1 100644 --- a/tests/coverage/while.cov-map +++ b/tests/coverage/while.cov-map @@ -1,14 +1,42 @@ -Function name: while::main -Raw bytes (34): 0x[01, 01, 00, 06, 01, 01, 01, 00, 0a, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 10, 01, 01, 0b, 00, 14, 00, 00, 15, 02, 06, 01, 03, 01, 00, 02] +Function name: while::while_with_tail_expr +Raw bytes (56): 0x[01, 01, 01, 05, 01, 0a, 01, 06, 01, 00, 1a, 01, 01, 09, 00, 0e, 01, 00, 11, 00, 12, 05, 01, 0b, 00, 10, 02, 01, 09, 00, 0f, 02, 01, 09, 00, 0c, 02, 00, 0d, 00, 1a, 01, 02, 05, 00, 08, 01, 00, 09, 00, 12, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/while.rs -Number of expressions: 0 -Number of file 0 mappings: 6 -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) -- Code(Counter(0)) at (prev + 1, 11) to (start + 0, 20) -- Code(Zero) at (prev + 0, 21) to (start + 2, 6) -- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) -Highest counter ID seen: c0 +Number of expressions: 1 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +Number of file 0 mappings: 10 +- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) +- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 16) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) + = (c1 - c0) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 12) + = (c1 - c0) +- Code(Expression(0, Sub)) at (prev + 0, 13) to (start + 0, 26) + = (c1 - c0) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 + +Function name: while::while_with_tail_stmt +Raw bytes (51): 0x[01, 01, 01, 05, 01, 09, 01, 0f, 01, 00, 1a, 01, 01, 09, 00, 0e, 01, 00, 11, 00, 12, 05, 01, 0b, 00, 10, 02, 00, 11, 03, 06, 02, 01, 09, 00, 0f, 01, 03, 05, 00, 08, 01, 00, 09, 00, 12, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/while.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +Number of file 0 mappings: 9 +- Code(Counter(0)) at (prev + 15, 1) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) +- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 16) +- Code(Expression(0, Sub)) at (prev + 0, 17) to (start + 3, 6) + = (c1 - c0) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) + = (c1 - c0) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 diff --git a/tests/coverage/while.coverage b/tests/coverage/while.coverage index 90c16288d668c..a83198bbc675e 100644 --- a/tests/coverage/while.coverage +++ b/tests/coverage/while.coverage @@ -1,7 +1,34 @@ - LL| 1|fn main() { - LL| 1| let num = 9; - LL| 1| while num >= 10 { - LL| 0| // loop body - LL| 0| } + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| | + LL| |// Basic test for `while` expressions. + LL| | + LL| 1|fn while_with_tail_expr() { + LL| 1| let mut x = 5; + LL| 6| while x > 0 { + LL| 5| x -= 1; + LL| 5| say("decreased x") + LL| | } + LL| 1| say("goodbye"); LL| 1|} + LL| | + LL| 1|fn while_with_tail_stmt() { + LL| 1| let mut x = 5; + LL| 6| while x > 0 { + LL| 5| x -= 1; + LL| 5| say("decreased x"); + LL| 5| } + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | while_with_tail_expr(); + LL| | while_with_tail_stmt(); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} diff --git a/tests/coverage/while.rs b/tests/coverage/while.rs index d60916a979818..77ef50d09a6ac 100644 --- a/tests/coverage/while.rs +++ b/tests/coverage/while.rs @@ -1,6 +1,33 @@ -fn main() { - let num = 9; - while num >= 10 { - // loop body +#![feature(coverage_attribute)] +//@ edition: 2024 + +// Basic test for `while` expressions. + +fn while_with_tail_expr() { + let mut x = 5; + while x > 0 { + x -= 1; + say("decreased x") + } + say("goodbye"); +} + +fn while_with_tail_stmt() { + let mut x = 5; + while x > 0 { + x -= 1; + say("decreased x"); } + say("goodbye"); +} + +#[coverage(off)] +fn main() { + while_with_tail_expr(); + while_with_tail_stmt(); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); } diff --git a/tests/mir-opt/building/write_box_via_move.box_new.CleanupPostBorrowck.after.mir b/tests/mir-opt/building/write_box_via_move.box_new.CleanupPostBorrowck.after.mir index 0050151e89b1b..158a1ea103a63 100644 --- a/tests/mir-opt/building/write_box_via_move.box_new.CleanupPostBorrowck.after.mir +++ b/tests/mir-opt/building/write_box_via_move.box_new.CleanupPostBorrowck.after.mir @@ -23,7 +23,7 @@ fn box_new(_1: T) -> Box<[T; 1024]> { _4 = move _2; StorageLive(_5); _5 = copy _1; - ((((*_4).1: std::mem::ManuallyDrop<[T; 1024]>).0: std::mem::MaybeDangling<[T; 1024]>).0: [T; 1024]) = [move _5; 1024]; + (((*_4).1: std::mem::ManuallyDrop<[T; 1024]>).0: [T; 1024]) = [move _5; 1024]; StorageDead(_5); _3 = move _4; drop(_4) -> [return: bb2, unwind: bb5]; diff --git a/tests/mir-opt/building/write_box_via_move.vec_macro.CleanupPostBorrowck.after.mir b/tests/mir-opt/building/write_box_via_move.vec_macro.CleanupPostBorrowck.after.mir index 2410e4d31b486..d2f67cd6932c2 100644 --- a/tests/mir-opt/building/write_box_via_move.vec_macro.CleanupPostBorrowck.after.mir +++ b/tests/mir-opt/building/write_box_via_move.vec_macro.CleanupPostBorrowck.after.mir @@ -12,7 +12,7 @@ fn vec_macro() -> Vec { } bb1: { - ((((*_2).1: std::mem::ManuallyDrop<[i32; 8]>).0: std::mem::MaybeDangling<[i32; 8]>).0: [i32; 8]) = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32, const 6_i32, const 7_i32]; + (((*_2).1: std::mem::ManuallyDrop<[i32; 8]>).0: [i32; 8]) = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32, const 6_i32, const 7_i32]; _1 = move _2; drop(_2) -> [return: bb2, unwind: bb4]; } diff --git a/tests/mir-opt/coroutine/unwind_in_vec.build-{closure#0}.built.after.mir b/tests/mir-opt/coroutine/unwind_in_vec.build-{closure#0}.built.after.mir index fc75f261ea01b..6b9927949ffe2 100644 --- a/tests/mir-opt/coroutine/unwind_in_vec.build-{closure#0}.built.after.mir +++ b/tests/mir-opt/coroutine/unwind_in_vec.build-{closure#0}.built.after.mir @@ -91,7 +91,7 @@ yields () bb6: { StorageDead(_19); - ((((*_5).1: std::mem::ManuallyDrop<[std::string::String; 5]>).0: std::mem::MaybeDangling<[std::string::String; 5]>).0: [std::string::String; 5]) = [move _6, move _9, move _12, move _15, move _18]; + (((*_5).1: std::mem::ManuallyDrop<[std::string::String; 5]>).0: [std::string::String; 5]) = [move _6, move _9, move _12, move _15, move _18]; drop(_18) -> [return: bb7, unwind: bb25, drop: bb15]; } diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-abort.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-abort.mir index afee76707e8a4..e8efb9b7c3483 100644 --- a/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-abort.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-abort.mir @@ -55,7 +55,7 @@ fn test() -> Option> { _11 = copy ((_5 as Continue).0: u32); _4 = copy _11; StorageDead(_11); - ((((*_3).1: std::mem::ManuallyDrop<[u32; 1]>).0: std::mem::MaybeDangling<[u32; 1]>).0: [u32; 1]) = [move _4]; + (((*_3).1: std::mem::ManuallyDrop<[u32; 1]>).0: [u32; 1]) = [move _4]; StorageDead(_4); _2 = move _3; goto -> bb7; diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir index d44db1eb1c8c6..4da1eed4484bb 100644 --- a/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir @@ -55,7 +55,7 @@ fn test() -> Option> { _11 = copy ((_5 as Continue).0: u32); _4 = copy _11; StorageDead(_11); - ((((*_3).1: std::mem::ManuallyDrop<[u32; 1]>).0: std::mem::MaybeDangling<[u32; 1]>).0: [u32; 1]) = [move _4]; + (((*_3).1: std::mem::ManuallyDrop<[u32; 1]>).0: [u32; 1]) = [move _4]; StorageDead(_4); _2 = move _3; goto -> bb7; diff --git a/tests/mir-opt/pre-codegen/loops.vec_move.runtime-optimized.after.mir b/tests/mir-opt/pre-codegen/loops.vec_move.runtime-optimized.after.mir index a49688ae891de..cad38c437e3c3 100644 --- a/tests/mir-opt/pre-codegen/loops.vec_move.runtime-optimized.after.mir +++ b/tests/mir-opt/pre-codegen/loops.vec_move.runtime-optimized.after.mir @@ -3,327 +3,309 @@ fn vec_move(_1: Vec) -> () { debug v => _1; let mut _0: (); + let mut _21: std::vec::IntoIter; let mut _22: std::vec::IntoIter; - let mut _23: std::vec::IntoIter; - let mut _24: &mut std::vec::IntoIter; - let mut _25: std::option::Option; - let mut _26: isize; - let _28: (); + let mut _23: &mut std::vec::IntoIter; + let mut _24: std::option::Option; + let mut _25: isize; + let _27: (); scope 1 { - debug iter => _23; - let _27: impl Sized; + debug iter => _22; + let _26: impl Sized; scope 2 { - debug x => _27; + debug x => _26; } } scope 3 (inlined as IntoIterator>::into_iter) { debug self => _1; - let _3: std::mem::ManuallyDrop>; - let mut _4: *const std::alloc::Global; - let mut _8: usize; - let mut _10: *mut impl Sized; - let mut _11: *const impl Sized; - let mut _12: usize; - let _29: &std::vec::Vec; - let mut _30: &std::mem::ManuallyDrop>; - let mut _31: &alloc::raw_vec::RawVec; - let mut _32: &std::mem::ManuallyDrop>; - let _33: &std::vec::Vec; - let mut _34: &std::mem::ManuallyDrop>; - let _35: &std::vec::Vec; - let mut _36: &std::mem::ManuallyDrop>; - let mut _37: &alloc::raw_vec::RawVec; - let mut _38: &std::mem::ManuallyDrop>; + let _2: std::mem::ManuallyDrop>; + let mut _3: *const std::alloc::Global; + let mut _7: usize; + let mut _9: *mut impl Sized; + let mut _10: *const impl Sized; + let mut _11: usize; + let _28: &std::vec::Vec; + let mut _29: &std::mem::ManuallyDrop>; + let mut _30: &alloc::raw_vec::RawVec; + let mut _31: &std::mem::ManuallyDrop>; + let _32: &std::vec::Vec; + let mut _33: &std::mem::ManuallyDrop>; + let _34: &std::vec::Vec; + let mut _35: &std::mem::ManuallyDrop>; + let mut _36: &alloc::raw_vec::RawVec; + let mut _37: &std::mem::ManuallyDrop>; scope 4 { - debug me => _3; + debug me => _2; scope 5 { - debug alloc => const ManuallyDrop:: {{ value: MaybeDangling::(std::alloc::Global) }}; - let _6: std::ptr::NonNull; + debug alloc => const ManuallyDrop:: {{ value: std::alloc::Global }}; + let _5: std::ptr::NonNull; scope 6 { - debug buf => _6; - let _7: *mut impl Sized; + debug buf => _5; + let _6: *mut impl Sized; scope 7 { - debug begin => _7; + debug begin => _6; scope 8 { - debug end => _11; - let _20: usize; + debug end => _10; + let _19: usize; scope 9 { - debug cap => _20; + debug cap => _19; } - scope 45 (inlined > as Deref>::deref) { - debug self => _38; - scope 46 (inlined MaybeDangling::>::as_ref) { - } - } - scope 47 (inlined alloc::raw_vec::RawVec::::capacity) { + scope 39 (inlined > as Deref>::deref) { debug self => _37; - let mut _39: &alloc::raw_vec::RawVecInner; - scope 48 (inlined std::mem::size_of::) { + } + scope 40 (inlined alloc::raw_vec::RawVec::::capacity) { + debug self => _36; + let mut _38: &alloc::raw_vec::RawVecInner; + scope 41 (inlined std::mem::size_of::) { } - scope 49 (inlined alloc::raw_vec::RawVecInner::capacity) { - debug self => _39; + scope 42 (inlined alloc::raw_vec::RawVecInner::capacity) { + debug self => _38; debug elem_size => const ::SIZE; - let mut _21: core::num::niche_types::UsizeNoHighBit; - scope 50 (inlined core::num::niche_types::UsizeNoHighBit::as_inner) { - debug self => _21; + let mut _20: core::num::niche_types::UsizeNoHighBit; + scope 43 (inlined core::num::niche_types::UsizeNoHighBit::as_inner) { + debug self => _20; } } } } - scope 29 (inlined > as Deref>::deref) { - debug self => _34; - scope 30 (inlined MaybeDangling::>::as_ref) { - } - } - scope 31 (inlined Vec::::len) { + scope 25 (inlined > as Deref>::deref) { debug self => _33; - let mut _13: bool; - scope 32 { + } + scope 26 (inlined Vec::::len) { + debug self => _32; + let mut _12: bool; + scope 27 { } } - scope 33 (inlined std::ptr::mut_ptr::::wrapping_byte_add) { - debug self => _7; - debug count => _12; - let mut _14: *mut u8; - let mut _18: *mut u8; - let mut _19: *const impl Sized; - scope 34 (inlined std::ptr::mut_ptr::::cast::) { - debug self => _7; + scope 28 (inlined std::ptr::mut_ptr::::wrapping_byte_add) { + debug self => _6; + debug count => _11; + let mut _13: *mut u8; + let mut _17: *mut u8; + let mut _18: *const impl Sized; + scope 29 (inlined std::ptr::mut_ptr::::cast::) { + debug self => _6; } - scope 35 (inlined std::ptr::mut_ptr::::wrapping_add) { - debug self => _14; - debug count => _12; - let mut _15: isize; - scope 36 (inlined std::ptr::mut_ptr::::wrapping_offset) { - debug self => _14; - debug count => _15; + scope 30 (inlined std::ptr::mut_ptr::::wrapping_add) { + debug self => _13; + debug count => _11; + let mut _14: isize; + scope 31 (inlined std::ptr::mut_ptr::::wrapping_offset) { + debug self => _13; + debug count => _14; + let mut _15: *const u8; let mut _16: *const u8; - let mut _17: *const u8; } } - scope 37 (inlined std::ptr::mut_ptr::::with_metadata_of::) { - debug self => _18; - debug meta => _19; - scope 38 (inlined std::ptr::metadata::) { - debug ptr => _19; + scope 32 (inlined std::ptr::mut_ptr::::with_metadata_of::) { + debug self => _17; + debug meta => _18; + scope 33 (inlined std::ptr::metadata::) { + debug ptr => _18; } - scope 39 (inlined std::ptr::from_raw_parts_mut::) { + scope 34 (inlined std::ptr::from_raw_parts_mut::) { } } } - scope 40 (inlined > as Deref>::deref) { - debug self => _36; - scope 41 (inlined MaybeDangling::>::as_ref) { - } - } - scope 42 (inlined Vec::::len) { + scope 35 (inlined > as Deref>::deref) { debug self => _35; - let mut _9: bool; - scope 43 { + } + scope 36 (inlined Vec::::len) { + debug self => _34; + let mut _8: bool; + scope 37 { } } - scope 44 (inlined #[track_caller] std::ptr::mut_ptr::::add) { - debug self => _7; - debug count => _8; + scope 38 (inlined #[track_caller] std::ptr::mut_ptr::::add) { + debug self => _6; + debug count => _7; } } - scope 28 (inlined NonNull::::as_ptr) { - debug self => _6; - } - } - scope 20 (inlined > as Deref>::deref) { - debug self => _32; - scope 21 (inlined MaybeDangling::>::as_ref) { + scope 24 (inlined NonNull::::as_ptr) { + debug self => _5; } } - scope 22 (inlined alloc::raw_vec::RawVec::::non_null) { + scope 17 (inlined > as Deref>::deref) { debug self => _31; - scope 23 (inlined alloc::raw_vec::RawVecInner::non_null::) { - let mut _5: std::ptr::NonNull; - scope 24 (inlined std::ptr::Unique::::cast::) { - scope 25 (inlined NonNull::::cast::) { - scope 26 (inlined NonNull::::as_ptr) { + } + scope 18 (inlined alloc::raw_vec::RawVec::::non_null) { + debug self => _30; + scope 19 (inlined alloc::raw_vec::RawVecInner::non_null::) { + let mut _4: std::ptr::NonNull; + scope 20 (inlined std::ptr::Unique::::cast::) { + scope 21 (inlined NonNull::::cast::) { + scope 22 (inlined NonNull::::as_ptr) { } } } - scope 27 (inlined std::ptr::Unique::::as_non_null_ptr) { + scope 23 (inlined std::ptr::Unique::::as_non_null_ptr) { } } } } - scope 12 (inlined > as Deref>::deref) { - debug self => _30; - scope 13 (inlined MaybeDangling::>::as_ref) { - } - } - scope 14 (inlined Vec::::allocator) { + scope 11 (inlined > as Deref>::deref) { debug self => _29; - scope 15 (inlined alloc::raw_vec::RawVec::::allocator) { - scope 16 (inlined alloc::raw_vec::RawVecInner::allocator) { + } + scope 12 (inlined Vec::::allocator) { + debug self => _28; + scope 13 (inlined alloc::raw_vec::RawVec::::allocator) { + scope 14 (inlined alloc::raw_vec::RawVecInner::allocator) { } } } - scope 17 (inlined #[track_caller] std::ptr::read::) { - debug src => _4; + scope 15 (inlined #[track_caller] std::ptr::read::) { + debug src => _3; } - scope 18 (inlined ManuallyDrop::::new) { + scope 16 (inlined ManuallyDrop::::new) { debug value => const std::alloc::Global; - scope 19 (inlined MaybeDangling::::new) { - } } } scope 10 (inlined ManuallyDrop::>::new) { debug value => _1; - let mut _2: std::mem::MaybeDangling>; - scope 11 (inlined MaybeDangling::>::new) { - } } } bb0: { - StorageLive(_22); - StorageLive(_11); - StorageLive(_20); - StorageLive(_5); - StorageLive(_17); - StorageLive(_3); - StorageLive(_2); - _2 = MaybeDangling::>(copy _1); - _3 = ManuallyDrop::> { value: move _2 }; - StorageDead(_2); + StorageLive(_21); + StorageLive(_10); + StorageLive(_19); StorageLive(_4); - // DBG: _30 = &_3; - // DBG: _29 = &((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec); - _4 = &raw const (((((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).2: std::alloc::Global); - StorageDead(_4); + StorageLive(_16); + StorageLive(_2); + _2 = ManuallyDrop::> { value: copy _1 }; + StorageLive(_3); + // DBG: _29 = &_2; + // DBG: _28 = &(_2.0: std::vec::Vec); + _3 = &raw const ((((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).2: std::alloc::Global); + StorageDead(_3); + StorageLive(_5); + // DBG: _31 = &_2; + // DBG: _30 = &((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec); + _4 = copy (((((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); + _5 = copy _4 as std::ptr::NonNull (Transmute); StorageLive(_6); - // DBG: _32 = &_3; - // DBG: _31 = &(((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec); - _5 = copy ((((((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); - _6 = copy _5 as std::ptr::NonNull (Transmute); - StorageLive(_7); - _7 = copy _5 as *mut impl Sized (Transmute); + _6 = copy _4 as *mut impl Sized (Transmute); switchInt(const ::IS_ZST) -> [0: bb1, otherwise: bb2]; } bb1: { - StorageLive(_10); - StorageLive(_8); - // DBG: _36 = &_3; - // DBG: _35 = &((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec); - _8 = copy (((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).1: usize); StorageLive(_9); - _9 = Le(copy _8, const ::MAX_SLICE_LEN); - assume(move _9); - StorageDead(_9); - _10 = Offset(copy _7, copy _8); - _11 = copy _10 as *const impl Sized (PtrToPtr); + StorageLive(_7); + // DBG: _35 = &_2; + // DBG: _34 = &(_2.0: std::vec::Vec); + _7 = copy ((_2.0: std::vec::Vec).1: usize); + StorageLive(_8); + _8 = Le(copy _7, const ::MAX_SLICE_LEN); + assume(move _8); StorageDead(_8); - StorageDead(_10); + _9 = Offset(copy _6, copy _7); + _10 = copy _9 as *const impl Sized (PtrToPtr); + StorageDead(_7); + StorageDead(_9); goto -> bb4; } bb2: { + StorageLive(_11); + // DBG: _33 = &_2; + // DBG: _32 = &(_2.0: std::vec::Vec); + _11 = copy ((_2.0: std::vec::Vec).1: usize); StorageLive(_12); - // DBG: _34 = &_3; - // DBG: _33 = &((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec); - _12 = copy (((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).1: usize); + _12 = Le(copy _11, const ::MAX_SLICE_LEN); + assume(move _12); + StorageDead(_12); + StorageLive(_17); StorageLive(_13); - _13 = Le(copy _12, const ::MAX_SLICE_LEN); - assume(move _13); - StorageDead(_13); - StorageLive(_18); + _13 = copy _4 as *mut u8 (Transmute); StorageLive(_14); - _14 = copy _5 as *mut u8 (Transmute); + _14 = copy _11 as isize (IntToInt); StorageLive(_15); - _15 = copy _12 as isize (IntToInt); - StorageLive(_16); - _16 = copy _5 as *const u8 (Transmute); - _17 = arith_offset::(move _16, move _15) -> [return: bb3, unwind unreachable]; + _15 = copy _4 as *const u8 (Transmute); + _16 = arith_offset::(move _15, move _14) -> [return: bb3, unwind unreachable]; } bb3: { - StorageDead(_16); - _18 = copy _17 as *mut u8 (PtrToPtr); StorageDead(_15); + _17 = copy _16 as *mut u8 (PtrToPtr); StorageDead(_14); - StorageLive(_19); - _19 = copy _5 as *const impl Sized (Transmute); - StorageDead(_19); + StorageDead(_13); + StorageLive(_18); + _18 = copy _4 as *const impl Sized (Transmute); StorageDead(_18); - StorageDead(_12); - _11 = copy _17 as *const impl Sized (PtrToPtr); + StorageDead(_17); + StorageDead(_11); + _10 = copy _16 as *const impl Sized (PtrToPtr); goto -> bb4; } bb4: { - // DBG: _38 = &_3; - // DBG: _37 = &(((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec); - // DBG: _39 = &((((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner); + // DBG: _37 = &_2; + // DBG: _36 = &((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec); + // DBG: _38 = &(((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner); switchInt(const ::SIZE) -> [0: bb5, otherwise: bb6]; } bb5: { - _20 = const usize::MAX; + _19 = const usize::MAX; goto -> bb7; } bb6: { - StorageLive(_21); - _21 = copy (((((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).1: core::num::niche_types::UsizeNoHighBit); - _20 = copy _21 as usize (Transmute); - StorageDead(_21); + StorageLive(_20); + _20 = copy ((((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).1: core::num::niche_types::UsizeNoHighBit); + _19 = copy _20 as usize (Transmute); + StorageDead(_20); goto -> bb7; } bb7: { - _22 = std::vec::IntoIter:: { buf: copy _6, phantom: const ZeroSized: PhantomData, cap: move _20, alloc: const ManuallyDrop:: {{ value: MaybeDangling::(std::alloc::Global) }}, ptr: copy _6, end: copy _11 }; - StorageDead(_7); + _21 = std::vec::IntoIter:: { buf: copy _5, phantom: const ZeroSized: PhantomData, cap: move _19, alloc: const ManuallyDrop:: {{ value: std::alloc::Global }}, ptr: copy _5, end: copy _10 }; StorageDead(_6); - StorageDead(_3); - StorageDead(_17); StorageDead(_5); - StorageDead(_20); - StorageDead(_11); - StorageLive(_23); - _23 = move _22; + StorageDead(_2); + StorageDead(_16); + StorageDead(_4); + StorageDead(_19); + StorageDead(_10); + StorageLive(_22); + _22 = move _21; goto -> bb8; } bb8: { - StorageLive(_25); StorageLive(_24); - _24 = &mut _23; - _25 = as Iterator>::next(move _24) -> [return: bb9, unwind: bb15]; + StorageLive(_23); + _23 = &mut _22; + _24 = as Iterator>::next(move _23) -> [return: bb9, unwind: bb15]; } bb9: { - _26 = discriminant(_25); - switchInt(move _26) -> [0: bb10, 1: bb12, otherwise: bb14]; + _25 = discriminant(_24); + switchInt(move _25) -> [0: bb10, 1: bb12, otherwise: bb14]; } bb10: { + StorageDead(_23); StorageDead(_24); - StorageDead(_25); - drop(_23) -> [return: bb11, unwind continue]; + drop(_22) -> [return: bb11, unwind continue]; } bb11: { - StorageDead(_23); StorageDead(_22); + StorageDead(_21); return; } bb12: { - StorageLive(_27); - _27 = move ((_25 as Some).0: impl Sized); - _28 = opaque::(move _27) -> [return: bb13, unwind: bb15]; + StorageLive(_26); + _26 = move ((_24 as Some).0: impl Sized); + _27 = opaque::(move _26) -> [return: bb13, unwind: bb15]; } bb13: { - StorageDead(_27); + StorageDead(_26); + StorageDead(_23); StorageDead(_24); - StorageDead(_25); goto -> bb8; } @@ -332,7 +314,7 @@ fn vec_move(_1: Vec) -> () { } bb15 (cleanup): { - drop(_23) -> [return: bb16, unwind terminate(cleanup)]; + drop(_22) -> [return: bb16, unwind terminate(cleanup)]; } bb16 (cleanup): { diff --git a/tests/ui/asm/aarch64/aarch64-sve.rs b/tests/ui/asm/aarch64/aarch64-sve.rs index a146d73345554..daa4ab98dee75 100644 --- a/tests/ui/asm/aarch64/aarch64-sve.rs +++ b/tests/ui/asm/aarch64/aarch64-sve.rs @@ -15,6 +15,7 @@ use minicore::*; fn f(x: f64) { unsafe { asm!("", out("p0") _); + asm!("", out("z0") _); asm!("", out("ffr") _); } } diff --git a/tests/ui/asm/aarch64/bad-reg.rs b/tests/ui/asm/aarch64/bad-reg.rs index 39a3e386bb6e5..daaca4746cf37 100644 --- a/tests/ui/asm/aarch64/bad-reg.rs +++ b/tests/ui/asm/aarch64/bad-reg.rs @@ -1,5 +1,5 @@ //@ add-minicore -//@ compile-flags: --target aarch64-unknown-linux-gnu -C target-feature=+neon +//@ compile-flags: --target aarch64-unknown-linux-gnu -C target-feature=+neon,+sve //@ needs-llvm-components: aarch64 //@ ignore-backends: gcc #![crate_type = "lib"] @@ -38,15 +38,15 @@ fn main() { asm!("", in("x19") foo); //~^ ERROR invalid register `x19`: x19 is used internally by LLVM and cannot be used as an operand for inline asm - asm!("", in("p0") foo); - //~^ ERROR register class `preg` can only be used as a clobber, not as an input or output + asm!("", in("ffr") foo); + //~^ ERROR register class `ffr` can only be used as a clobber, not as an input or output //~| ERROR type `i32` cannot be used with this register class - asm!("", out("p0") _); - asm!("{}", in(preg) foo); - //~^ ERROR register class `preg` can only be used as a clobber, not as an input or output + asm!("", out("ffr") _); + asm!("{}", in(ffr) foo); + //~^ ERROR register class `ffr` can only be used as a clobber, not as an input or output //~| ERROR type `i32` cannot be used with this register class - asm!("{}", out(preg) _); - //~^ ERROR register class `preg` can only be used as a clobber, not as an input or output + asm!("{}", out(ffr) _); + //~^ ERROR register class `ffr` can only be used as a clobber, not as an input or output // Explicit register conflicts // (except in/lateout which don't conflict) diff --git a/tests/ui/asm/aarch64/bad-reg.stderr b/tests/ui/asm/aarch64/bad-reg.stderr index 9f3d54eb46660..8937509763dec 100644 --- a/tests/ui/asm/aarch64/bad-reg.stderr +++ b/tests/ui/asm/aarch64/bad-reg.stderr @@ -4,7 +4,7 @@ error: invalid register class `foo`: unknown register class LL | asm!("{}", in(foo) foo); | ^^^^^^^^^^^ | - = note: the following register classes are supported on this target: `reg`, `vreg`, `vreg_low16`, and `preg` + = note: the following register classes are supported on this target: `reg`, `vreg`, `vreg_low16`, `preg`, and `ffr` error: invalid register `foo`: unknown register --> $DIR/bad-reg.rs:20:18 @@ -30,7 +30,7 @@ LL | asm!("{:r}", in(vreg) foo); | | | template modifier | - = note: the `vreg` register class supports the following template modifiers: `b`, `h`, `s`, `d`, `q`, and `v` + = note: the `vreg` register class supports the following template modifiers: `b`, `h`, `s`, `d`, `q`, `v`, and `z` error: invalid asm template modifier `r` for this register class --> $DIR/bad-reg.rs:26:15 @@ -40,7 +40,7 @@ LL | asm!("{:r}", in(vreg_low16) foo); | | | template modifier | - = note: the `vreg_low16` register class supports the following template modifiers: `b`, `h`, `s`, `d`, `q`, and `v` + = note: the `vreg_low16` register class supports the following template modifiers: `b`, `h`, `s`, `d`, `q`, `v`, and `z` error: asm template modifiers are not allowed for `const` arguments --> $DIR/bad-reg.rs:28:15 @@ -82,23 +82,23 @@ error: invalid register `x19`: x19 is used internally by LLVM and cannot be used LL | asm!("", in("x19") foo); | ^^^^^^^^^^^^^ -error: register class `preg` can only be used as a clobber, not as an input or output +error: register class `ffr` can only be used as a clobber, not as an input or output --> $DIR/bad-reg.rs:41:18 | -LL | asm!("", in("p0") foo); - | ^^^^^^^^^^^^ +LL | asm!("", in("ffr") foo); + | ^^^^^^^^^^^^^ -error: register class `preg` can only be used as a clobber, not as an input or output +error: register class `ffr` can only be used as a clobber, not as an input or output --> $DIR/bad-reg.rs:45:20 | -LL | asm!("{}", in(preg) foo); - | ^^^^^^^^^^^^ +LL | asm!("{}", in(ffr) foo); + | ^^^^^^^^^^^ -error: register class `preg` can only be used as a clobber, not as an input or output +error: register class `ffr` can only be used as a clobber, not as an input or output --> $DIR/bad-reg.rs:48:20 | -LL | asm!("{}", out(preg) _); - | ^^^^^^^^^^^ +LL | asm!("{}", out(ffr) _); + | ^^^^^^^^^^ error: register `w0` conflicts with register `x0` --> $DIR/bad-reg.rs:54:32 @@ -145,20 +145,20 @@ LL | asm!("", in("v0") foo, out("q0") bar); | ^^^^^^^^^^^^ error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:41:27 + --> $DIR/bad-reg.rs:41:28 | -LL | asm!("", in("p0") foo); - | ^^^ +LL | asm!("", in("ffr") foo); + | ^^^ | - = note: register class `preg` supports these types: + = note: register class `ffr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:45:29 + --> $DIR/bad-reg.rs:45:28 | -LL | asm!("{}", in(preg) foo); - | ^^^ +LL | asm!("{}", in(ffr) foo); + | ^^^ | - = note: register class `preg` supports these types: + = note: register class `ffr` supports these types: error: aborting due to 20 previous errors diff --git a/tests/ui/asm/aarch64/type-check-2.stderr b/tests/ui/asm/aarch64/type-check-2.stderr index 2cd767db0334a..325e2c43b3035 100644 --- a/tests/ui/asm/aarch64/type-check-2.stderr +++ b/tests/ui/asm/aarch64/type-check-2.stderr @@ -12,7 +12,7 @@ error: cannot use value of type `{closure@$DIR/type-check-2.rs:32:28: 32:36}` fo LL | asm!("{}", in(reg) |x: i32| x); | ^^^^^^^^^^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `Vec` for inline assembly --> $DIR/type-check-2.rs:34:28 @@ -20,7 +20,7 @@ error: cannot use value of type `Vec` for inline assembly LL | asm!("{}", in(reg) vec![0]); | ^^^^^^^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `(i32, i32, i32)` for inline assembly --> $DIR/type-check-2.rs:36:28 @@ -28,7 +28,7 @@ error: cannot use value of type `(i32, i32, i32)` for inline assembly LL | asm!("{}", in(reg) (1, 2, 3)); | ^^^^^^^^^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `[i32; 3]` for inline assembly --> $DIR/type-check-2.rs:38:28 @@ -36,7 +36,7 @@ error: cannot use value of type `[i32; 3]` for inline assembly LL | asm!("{}", in(reg) [1, 2, 3]); | ^^^^^^^^^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `fn() {main}` for inline assembly --> $DIR/type-check-2.rs:46:31 @@ -44,7 +44,7 @@ error: cannot use value of type `fn() {main}` for inline assembly LL | asm!("{}", inout(reg) f); | ^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `&mut i32` for inline assembly --> $DIR/type-check-2.rs:49:31 @@ -52,7 +52,7 @@ error: cannot use value of type `&mut i32` for inline assembly LL | asm!("{}", inout(reg) r); | ^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: aborting due to 7 previous errors diff --git a/tests/ui/asm/aarch64/type-check-3.rs b/tests/ui/asm/aarch64/type-check-3.rs index 2f8439d0a0f9e..6c01a3380f169 100644 --- a/tests/ui/asm/aarch64/type-check-3.rs +++ b/tests/ui/asm/aarch64/type-check-3.rs @@ -1,9 +1,9 @@ //@ only-aarch64 -//@ compile-flags: -C target-feature=+neon +//@ compile-flags: -C target-feature=+neon,+sve -#![feature(repr_simd)] +#![feature(asm_experimental_reg, repr_simd, stdarch_aarch64_sve)] -use std::arch::aarch64::float64x2_t; +use std::arch::aarch64::{float64x2_t, svdup_n_f64, svdup_n_s16, svdup_n_s32, svptrue_b8}; use std::arch::{asm, global_asm}; #[repr(simd)] @@ -13,6 +13,10 @@ struct Simd256bit([f64; 4]); fn main() { let f64x2: float64x2_t = unsafe { std::mem::transmute(0i128) }; let f64x4 = Simd256bit([0.0, 0.0, 0.0, 0.0]); + let svi16 = unsafe { svdup_n_s16(0i16) }; + let svi32 = unsafe { svdup_n_s32(0i32) }; + let svf64 = unsafe { svdup_n_f64(0f64) }; + let svb8 = unsafe { svptrue_b8() }; unsafe { // Types must be listed in the register class. @@ -33,9 +37,12 @@ fn main() { asm!("{:d}", in(vreg) 0f64); asm!("{:q}", in(vreg) f64x2); asm!("{:v}", in(vreg) f64x2); + asm!("{:z}", in(vreg) svi32); + asm!("{}", in(preg) svb8); // Should be the same as vreg asm!("{:q}", in(vreg_low16) f64x2); + asm!("{:z}", in(vreg_low16) svi32); // Template modifiers of a different size to the argument are fine asm!("{:w}", in(reg) 0u64); @@ -62,6 +69,12 @@ fn main() { //~^ WARN formatting may not be suitable for sub-register argument asm!("{}", in(vreg_low16) 0f64); //~^ WARN formatting may not be suitable for sub-register argument + asm!("{}", in(vreg) svi16); + //~^ WARN formatting may not be suitable for sub-register argument + asm!("{}", in(vreg) svi32); + //~^ WARN formatting may not be suitable for sub-register argument + asm!("{}", in(vreg) svf64); + //~^ WARN formatting may not be suitable for sub-register argument asm!("{0} {0}", in(reg) 0i16); //~^ WARN formatting may not be suitable for sub-register argument @@ -76,9 +89,16 @@ fn main() { //~^ ERROR type `float64x2_t` cannot be used with this register class asm!("{}", in(vreg) f64x4); //~^ ERROR type `Simd256bit` cannot be used with this register class + asm!("{}", in(reg) svi32); + //~^ ERROR type `svint32_t` cannot be used with this register class + asm!("{}", in(reg) svb8); + //~^ ERROR type `svbool_t` cannot be used with this register class + asm!("{}", in(vreg) svb8); + //~^ ERROR type `svbool_t` cannot be used with this register class + asm!("{}", in(preg) svi32); + //~^ ERROR type `svint32_t` cannot be used with this register class // Split inout operands must have compatible types - let mut val_i16: i16; let mut val_f32: f32; let mut val_u32: u32; diff --git a/tests/ui/asm/aarch64/type-check-3.stderr b/tests/ui/asm/aarch64/type-check-3.stderr index 9d84d2666b33c..e407ed3a9d3ac 100644 --- a/tests/ui/asm/aarch64/type-check-3.stderr +++ b/tests/ui/asm/aarch64/type-check-3.stderr @@ -1,96 +1,123 @@ warning: formatting may not be suitable for sub-register argument - --> $DIR/type-check-3.rs:48:15 + --> $DIR/type-check-3.rs:55:15 | LL | asm!("{}", in(reg) 0u8); | ^^ --- for this argument | - = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values) - = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values) + = help: use `{0:w}` to have the register formatted as `w0` (for 4-byte values) + = help: or use `{0:x}` to keep the default formatting of `x0` (for 8-byte values) = note: `#[warn(asm_sub_register)]` on by default warning: formatting may not be suitable for sub-register argument - --> $DIR/type-check-3.rs:50:15 + --> $DIR/type-check-3.rs:57:15 | LL | asm!("{}", in(reg) 0u16); | ^^ ---- for this argument | - = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values) - = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values) + = help: use `{0:w}` to have the register formatted as `w0` (for 4-byte values) + = help: or use `{0:x}` to keep the default formatting of `x0` (for 8-byte values) warning: formatting may not be suitable for sub-register argument - --> $DIR/type-check-3.rs:52:15 + --> $DIR/type-check-3.rs:59:15 | LL | asm!("{}", in(reg) 0i32); | ^^ ---- for this argument | - = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values) - = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values) + = help: use `{0:w}` to have the register formatted as `w0` (for 4-byte values) + = help: or use `{0:x}` to keep the default formatting of `x0` (for 8-byte values) warning: formatting may not be suitable for sub-register argument - --> $DIR/type-check-3.rs:54:15 + --> $DIR/type-check-3.rs:61:15 | LL | asm!("{}", in(reg) 0f32); | ^^ ---- for this argument | - = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values) - = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values) + = help: use `{0:w}` to have the register formatted as `w0` (for 4-byte values) + = help: or use `{0:x}` to keep the default formatting of `x0` (for 8-byte values) warning: formatting may not be suitable for sub-register argument - --> $DIR/type-check-3.rs:57:15 + --> $DIR/type-check-3.rs:64:15 | LL | asm!("{}", in(vreg) 0i16); | ^^ ---- for this argument | - = help: use `{0:h}` to have the register formatted as `h0` (for 16-bit values) - = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values) + = help: use `{0:h}` to have the register formatted as `h0` (for 2-byte values) + = help: or use `{0:v}` to keep the default formatting of `v0` (for 16-byte values) warning: formatting may not be suitable for sub-register argument - --> $DIR/type-check-3.rs:59:15 + --> $DIR/type-check-3.rs:66:15 | LL | asm!("{}", in(vreg) 0f32); | ^^ ---- for this argument | - = help: use `{0:s}` to have the register formatted as `s0` (for 32-bit values) - = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values) + = help: use `{0:s}` to have the register formatted as `s0` (for 4-byte values) + = help: or use `{0:v}` to keep the default formatting of `v0` (for 16-byte values) warning: formatting may not be suitable for sub-register argument - --> $DIR/type-check-3.rs:61:15 + --> $DIR/type-check-3.rs:68:15 | LL | asm!("{}", in(vreg) 0f64); | ^^ ---- for this argument | - = help: use `{0:d}` to have the register formatted as `d0` (for 64-bit values) - = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values) + = help: use `{0:d}` to have the register formatted as `d0` (for 8-byte values) + = help: or use `{0:v}` to keep the default formatting of `v0` (for 16-byte values) warning: formatting may not be suitable for sub-register argument - --> $DIR/type-check-3.rs:63:15 + --> $DIR/type-check-3.rs:70:15 | LL | asm!("{}", in(vreg_low16) 0f64); | ^^ ---- for this argument | - = help: use `{0:d}` to have the register formatted as `d0` (for 64-bit values) - = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values) + = help: use `{0:d}` to have the register formatted as `d0` (for 8-byte values) + = help: or use `{0:v}` to keep the default formatting of `v0` (for 16-byte values) warning: formatting may not be suitable for sub-register argument - --> $DIR/type-check-3.rs:66:15 + --> $DIR/type-check-3.rs:72:15 + | +LL | asm!("{}", in(vreg) svi16); + | ^^ ----- for this argument + | + = help: use `{0:z}` to have the register formatted as `z0` (for scalable values) + = help: or use `{0:v}` to keep the default formatting of `v0` (for 16-byte values) + +warning: formatting may not be suitable for sub-register argument + --> $DIR/type-check-3.rs:74:15 + | +LL | asm!("{}", in(vreg) svi32); + | ^^ ----- for this argument + | + = help: use `{0:z}` to have the register formatted as `z0` (for scalable values) + = help: or use `{0:v}` to keep the default formatting of `v0` (for 16-byte values) + +warning: formatting may not be suitable for sub-register argument + --> $DIR/type-check-3.rs:76:15 + | +LL | asm!("{}", in(vreg) svf64); + | ^^ ----- for this argument + | + = help: use `{0:z}` to have the register formatted as `z0` (for scalable values) + = help: or use `{0:v}` to keep the default formatting of `v0` (for 16-byte values) + +warning: formatting may not be suitable for sub-register argument + --> $DIR/type-check-3.rs:79:15 | LL | asm!("{0} {0}", in(reg) 0i16); | ^^^ ^^^ ---- for this argument | - = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values) - = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values) + = help: use `{0:w}` to have the register formatted as `w0` (for 4-byte values) + = help: or use `{0:x}` to keep the default formatting of `x0` (for 8-byte values) warning: formatting may not be suitable for sub-register argument - --> $DIR/type-check-3.rs:68:15 + --> $DIR/type-check-3.rs:81:15 | LL | asm!("{0} {0:x}", in(reg) 0i16); | ^^^ ---- for this argument | - = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values) - = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values) + = help: use `{0:w}` to have the register formatted as `w0` (for 4-byte values) + = help: or use `{0:x}` to keep the default formatting of `x0` (for 8-byte values) error: type `i128` cannot be used with this register class - --> $DIR/type-check-3.rs:73:28 + --> $DIR/type-check-3.rs:86:28 | LL | asm!("{}", in(reg) 0i128); | ^^^^^ @@ -98,7 +125,7 @@ LL | asm!("{}", in(reg) 0i128); = note: register class `reg` supports these types: i8, i16, i32, i64, f16, f32, f64 error: type `float64x2_t` cannot be used with this register class - --> $DIR/type-check-3.rs:75:28 + --> $DIR/type-check-3.rs:88:28 | LL | asm!("{}", in(reg) f64x2); | ^^^^^ @@ -106,15 +133,47 @@ LL | asm!("{}", in(reg) f64x2); = note: register class `reg` supports these types: i8, i16, i32, i64, f16, f32, f64 error: type `Simd256bit` cannot be used with this register class - --> $DIR/type-check-3.rs:77:29 + --> $DIR/type-check-3.rs:90:29 | LL | asm!("{}", in(vreg) f64x4); | ^^^^^ | - = note: register class `vreg` supports these types: i8, i16, i32, i64, f16, f32, f64, f128, i8x8, i16x4, i32x2, i64x1, f16x4, f32x2, f64x1, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2 + = note: register class `vreg` supports these types: i8, i16, i32, i64, f16, f32, f64, f128, i8x8, i16x4, i32x2, i64x1, f16x4, f32x2, f64x1, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2, svint8_t, svint16_t, svint32_t, svint64_t, svint128_t, svfloat26_t, svfloat32_t, svfloat64_t, svint128_t, svfloat128_t + +error: type `svint32_t` cannot be used with this register class + --> $DIR/type-check-3.rs:92:28 + | +LL | asm!("{}", in(reg) svi32); + | ^^^^^ + | + = note: register class `reg` supports these types: i8, i16, i32, i64, f16, f32, f64 + +error: type `svbool_t` cannot be used with this register class + --> $DIR/type-check-3.rs:94:28 + | +LL | asm!("{}", in(reg) svb8); + | ^^^^ + | + = note: register class `reg` supports these types: i8, i16, i32, i64, f16, f32, f64 + +error: type `svbool_t` cannot be used with this register class + --> $DIR/type-check-3.rs:96:29 + | +LL | asm!("{}", in(vreg) svb8); + | ^^^^ + | + = note: register class `vreg` supports these types: i8, i16, i32, i64, f16, f32, f64, f128, i8x8, i16x4, i32x2, i64x1, f16x4, f32x2, f64x1, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2, svint8_t, svint16_t, svint32_t, svint64_t, svint128_t, svfloat26_t, svfloat32_t, svfloat64_t, svint128_t, svfloat128_t + +error: type `svint32_t` cannot be used with this register class + --> $DIR/type-check-3.rs:98:29 + | +LL | asm!("{}", in(preg) svi32); + | ^^^^^ + | + = note: register class `preg` supports these types: svbool_t error: incompatible types for asm inout argument - --> $DIR/type-check-3.rs:88:33 + --> $DIR/type-check-3.rs:108:33 | LL | asm!("{:x}", inout(reg) 0u32 => val_f32); | ^^^^ ^^^^^^^ type `f32` @@ -124,7 +183,7 @@ LL | asm!("{:x}", inout(reg) 0u32 => val_f32); = note: asm inout arguments must have the same type, unless they are both pointers or integers of the same size error: incompatible types for asm inout argument - --> $DIR/type-check-3.rs:90:33 + --> $DIR/type-check-3.rs:110:33 | LL | asm!("{:x}", inout(reg) 0u32 => val_ptr); | ^^^^ ^^^^^^^ type `*mut u8` @@ -134,7 +193,7 @@ LL | asm!("{:x}", inout(reg) 0u32 => val_ptr); = note: asm inout arguments must have the same type, unless they are both pointers or integers of the same size error: incompatible types for asm inout argument - --> $DIR/type-check-3.rs:92:33 + --> $DIR/type-check-3.rs:112:33 | LL | asm!("{:x}", inout(reg) main => val_u32); | ^^^^ ^^^^^^^ type `u32` @@ -143,5 +202,5 @@ LL | asm!("{:x}", inout(reg) main => val_u32); | = note: asm inout arguments must have the same type, unless they are both pointers or integers of the same size -error: aborting due to 6 previous errors; 10 warnings emitted +error: aborting due to 10 previous errors; 13 warnings emitted diff --git a/tests/ui/asm/bad-template.aarch64.stderr b/tests/ui/asm/bad-template.aarch64.stderr index 5f7ebb539107c..268fcceb14a50 100644 --- a/tests/ui/asm/bad-template.aarch64.stderr +++ b/tests/ui/asm/bad-template.aarch64.stderr @@ -194,8 +194,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{:foo}", in(reg) foo); | ^^^^^^ --- for this argument | - = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values) - = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values) + = help: use `{0:w}` to have the register formatted as `w0` (for 4-byte values) + = help: or use `{0:x}` to keep the default formatting of `x0` (for 8-byte values) = note: `#[warn(asm_sub_register)]` on by default error: aborting due to 21 previous errors; 1 warning emitted diff --git a/tests/ui/asm/bad-template.x86_64.stderr b/tests/ui/asm/bad-template.x86_64.stderr index 9947117621f1c..cc8626deeb5fa 100644 --- a/tests/ui/asm/bad-template.x86_64.stderr +++ b/tests/ui/asm/bad-template.x86_64.stderr @@ -194,8 +194,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{:foo}", in(reg) foo); | ^^^^^^ --- for this argument | - = help: use `{0:e}` to have the register formatted as `eax` (for 32-bit values) - = help: or use `{0:r}` to keep the default formatting of `rax` (for 64-bit values) + = help: use `{0:e}` to have the register formatted as `eax` (for 4-byte values) + = help: or use `{0:r}` to keep the default formatting of `rax` (for 8-byte values) = note: `#[warn(asm_sub_register)]` on by default error: aborting due to 21 previous errors; 1 warning emitted diff --git a/tests/ui/asm/issue-87802.stderr b/tests/ui/asm/issue-87802.stderr index 64e91662919b2..da3f6815cd7da 100644 --- a/tests/ui/asm/issue-87802.stderr +++ b/tests/ui/asm/issue-87802.stderr @@ -4,7 +4,7 @@ error: cannot use value of type `!` for inline assembly LL | asm!("/* {0} */", out(reg) x); | ^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: aborting due to 1 previous error diff --git a/tests/ui/asm/type-check-1.stderr b/tests/ui/asm/type-check-1.stderr index aa9eed2fce65c..20e7017ee9ad5 100644 --- a/tests/ui/asm/type-check-1.stderr +++ b/tests/ui/asm/type-check-1.stderr @@ -43,7 +43,7 @@ error: cannot use value of type `[u64]` for inline assembly LL | asm!("{}", in(reg) v[..]); | ^^^^^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `[u64]` for inline assembly --> $DIR/type-check-1.rs:23:29 @@ -51,7 +51,7 @@ error: cannot use value of type `[u64]` for inline assembly LL | asm!("{}", out(reg) v[..]); | ^^^^^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `[u64]` for inline assembly --> $DIR/type-check-1.rs:26:31 @@ -59,7 +59,7 @@ error: cannot use value of type `[u64]` for inline assembly LL | asm!("{}", inout(reg) v[..]); | ^^^^^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: aborting due to 8 previous errors diff --git a/tests/ui/asm/x86_64/type-check-2.stderr b/tests/ui/asm/x86_64/type-check-2.stderr index e5d39b2fbd053..5e54f5af4c6d8 100644 --- a/tests/ui/asm/x86_64/type-check-2.stderr +++ b/tests/ui/asm/x86_64/type-check-2.stderr @@ -12,7 +12,7 @@ error: cannot use value of type `{closure@$DIR/type-check-2.rs:48:28: 48:36}` fo LL | asm!("{}", in(reg) |x: i32| x); | ^^^^^^^^^^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `Vec` for inline assembly --> $DIR/type-check-2.rs:50:28 @@ -20,7 +20,7 @@ error: cannot use value of type `Vec` for inline assembly LL | asm!("{}", in(reg) vec![0]); | ^^^^^^^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `(i32, i32, i32)` for inline assembly --> $DIR/type-check-2.rs:52:28 @@ -28,7 +28,7 @@ error: cannot use value of type `(i32, i32, i32)` for inline assembly LL | asm!("{}", in(reg) (1, 2, 3)); | ^^^^^^^^^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `[i32; 3]` for inline assembly --> $DIR/type-check-2.rs:54:28 @@ -36,7 +36,7 @@ error: cannot use value of type `[i32; 3]` for inline assembly LL | asm!("{}", in(reg) [1, 2, 3]); | ^^^^^^^^^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `fn() {main}` for inline assembly --> $DIR/type-check-2.rs:62:31 @@ -44,7 +44,7 @@ error: cannot use value of type `fn() {main}` for inline assembly LL | asm!("{}", inout(reg) f); | ^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error: cannot use value of type `&mut i32` for inline assembly --> $DIR/type-check-2.rs:65:31 @@ -52,7 +52,7 @@ error: cannot use value of type `&mut i32` for inline assembly LL | asm!("{}", inout(reg) r); | ^ | - = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly + = note: only integers, floats, SIMD vectors, scalable vectors, pointers and function pointers can be used as arguments for inline assembly error[E0381]: used binding `x` isn't initialized --> $DIR/type-check-2.rs:15:28 diff --git a/tests/ui/asm/x86_64/type-check-3.stderr b/tests/ui/asm/x86_64/type-check-3.stderr index ea9a3955e7078..e3ad64495904b 100644 --- a/tests/ui/asm/x86_64/type-check-3.stderr +++ b/tests/ui/asm/x86_64/type-check-3.stderr @@ -44,8 +44,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{0} {0}", in(reg) 0i16); | ^^^ ^^^ ---- for this argument | - = help: use `{0:x}` to have the register formatted as `ax` (for 16-bit values) - = help: or use `{0:r}` to keep the default formatting of `rax` (for 64-bit values) + = help: use `{0:x}` to have the register formatted as `ax` (for 2-byte values) + = help: or use `{0:r}` to keep the default formatting of `rax` (for 8-byte values) = note: `#[warn(asm_sub_register)]` on by default warning: formatting may not be suitable for sub-register argument @@ -54,8 +54,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{0} {0:x}", in(reg) 0i16); | ^^^ ---- for this argument | - = help: use `{0:x}` to have the register formatted as `ax` (for 16-bit values) - = help: or use `{0:r}` to keep the default formatting of `rax` (for 64-bit values) + = help: use `{0:x}` to have the register formatted as `ax` (for 2-byte values) + = help: or use `{0:r}` to keep the default formatting of `rax` (for 8-byte values) warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:36:15 @@ -63,8 +63,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(reg) 0i32); | ^^ ---- for this argument | - = help: use `{0:e}` to have the register formatted as `eax` (for 32-bit values) - = help: or use `{0:r}` to keep the default formatting of `rax` (for 64-bit values) + = help: use `{0:e}` to have the register formatted as `eax` (for 4-byte values) + = help: or use `{0:r}` to keep the default formatting of `rax` (for 8-byte values) warning: formatting may not be suitable for sub-register argument --> $DIR/type-check-3.rs:39:15 @@ -72,8 +72,8 @@ warning: formatting may not be suitable for sub-register argument LL | asm!("{}", in(ymm_reg) 0i64); | ^^ ---- for this argument | - = help: use `{0:x}` to have the register formatted as `xmm0` (for 128-bit values) - = help: or use `{0:y}` to keep the default formatting of `ymm0` (for 256-bit values) + = help: use `{0:x}` to have the register formatted as `xmm0` (for 16-byte values) + = help: or use `{0:y}` to keep the default formatting of `ymm0` (for 32-byte values) error: type `i8` cannot be used with this register class --> $DIR/type-check-3.rs:50:28 diff --git a/tests/ui/async-await/future-sizes/async-awaiting-fut.stdout b/tests/ui/async-await/future-sizes/async-awaiting-fut.stdout index 90381a12bbd4b..775f683a8f926 100644 --- a/tests/ui/async-await/future-sizes/async-awaiting-fut.stdout +++ b/tests/ui/async-await/future-sizes/async-awaiting-fut.stdout @@ -7,8 +7,6 @@ print-type-size variant `Returned`: 0 bytes print-type-size variant `Panicked`: 0 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of calls_fut<{async fn body of big_fut()}>()}>`: 3077 bytes, alignment: 1 bytes print-type-size field `.value`: 3077 bytes -print-type-size type: `std::mem::MaybeDangling<{async fn body of calls_fut<{async fn body of big_fut()}>()}>`: 3077 bytes, alignment: 1 bytes -print-type-size field `.0`: 3077 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of calls_fut<{async fn body of big_fut()}>()}>`: 3077 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 3077 bytes print-type-size field `.uninit`: 0 bytes @@ -38,8 +36,6 @@ print-type-size variant `Panicked`: 1025 bytes print-type-size upvar `.fut`: 1025 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of big_fut()}>`: 1025 bytes, alignment: 1 bytes print-type-size field `.value`: 1025 bytes -print-type-size type: `std::mem::MaybeDangling<{async fn body of big_fut()}>`: 1025 bytes, alignment: 1 bytes -print-type-size field `.0`: 1025 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of big_fut()}>`: 1025 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 1025 bytes print-type-size field `.uninit`: 0 bytes @@ -93,10 +89,6 @@ print-type-size type: `std::mem::ManuallyDrop`: 1 bytes, alignment: 1 byte print-type-size field `.value`: 1 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of wait()}>`: 1 bytes, alignment: 1 bytes print-type-size field `.value`: 1 bytes -print-type-size type: `std::mem::MaybeDangling`: 1 bytes, alignment: 1 bytes -print-type-size field `.0`: 1 bytes -print-type-size type: `std::mem::MaybeDangling<{async fn body of wait()}>`: 1 bytes, alignment: 1 bytes -print-type-size field `.0`: 1 bytes print-type-size type: `std::mem::MaybeUninit`: 1 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 1 bytes print-type-size field `.uninit`: 0 bytes diff --git a/tests/ui/async-await/future-sizes/large-arg.stdout b/tests/ui/async-await/future-sizes/large-arg.stdout index f65c5c1a7cb78..b6051da95ca42 100644 --- a/tests/ui/async-await/future-sizes/large-arg.stdout +++ b/tests/ui/async-await/future-sizes/large-arg.stdout @@ -7,8 +7,6 @@ print-type-size variant `Returned`: 0 bytes print-type-size variant `Panicked`: 0 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of a<[u8; 1024]>()}>`: 3075 bytes, alignment: 1 bytes print-type-size field `.value`: 3075 bytes -print-type-size type: `std::mem::MaybeDangling<{async fn body of a<[u8; 1024]>()}>`: 3075 bytes, alignment: 1 bytes -print-type-size field `.0`: 3075 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of a<[u8; 1024]>()}>`: 3075 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 3075 bytes print-type-size field `.uninit`: 0 bytes @@ -26,8 +24,6 @@ print-type-size variant `Panicked`: 1024 bytes print-type-size upvar `.t`: 1024 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of b<[u8; 1024]>()}>`: 2050 bytes, alignment: 1 bytes print-type-size field `.value`: 2050 bytes -print-type-size type: `std::mem::MaybeDangling<{async fn body of b<[u8; 1024]>()}>`: 2050 bytes, alignment: 1 bytes -print-type-size field `.0`: 2050 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of b<[u8; 1024]>()}>`: 2050 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 2050 bytes print-type-size field `.uninit`: 0 bytes @@ -45,8 +41,6 @@ print-type-size variant `Panicked`: 1024 bytes print-type-size upvar `.t`: 1024 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of c<[u8; 1024]>()}>`: 1025 bytes, alignment: 1 bytes print-type-size field `.value`: 1025 bytes -print-type-size type: `std::mem::MaybeDangling<{async fn body of c<[u8; 1024]>()}>`: 1025 bytes, alignment: 1 bytes -print-type-size field `.0`: 1025 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of c<[u8; 1024]>()}>`: 1025 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 1025 bytes print-type-size field `.uninit`: 0 bytes diff --git a/tests/ui/const-generics/unsized-const-param-default.rs b/tests/ui/const-generics/unsized-const-param-default.rs new file mode 100644 index 0000000000000..0f42f4eacb50a --- /dev/null +++ b/tests/ui/const-generics/unsized-const-param-default.rs @@ -0,0 +1,7 @@ +// Regression test for . + +//@ compile-flags: --crate-type=lib + +struct S; +//~^ ERROR the size for values of type `[()]` cannot be known at compilation time +//~| ERROR `[()]` is forbidden as the type of a const generic parameter diff --git a/tests/ui/const-generics/unsized-const-param-default.stderr b/tests/ui/const-generics/unsized-const-param-default.stderr new file mode 100644 index 0000000000000..f0f2b3b58c77b --- /dev/null +++ b/tests/ui/const-generics/unsized-const-param-default.stderr @@ -0,0 +1,28 @@ +error[E0277]: the size for values of type `[()]` cannot be known at compilation time + --> $DIR/unsized-const-param-default.rs:5:26 + | +LL | struct S; + | ^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `[()]` + = note: statics and constants must have a statically known size + +error: `[()]` is forbidden as the type of a const generic parameter + --> $DIR/unsized-const-param-default.rs:5:19 + | +LL | struct S; + | ^^^^ + | + = note: the only supported types are integers, `bool`, and `char` +help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(min_adt_const_params)] + | +help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait + | +LL + #![feature(unsized_const_params)] + | + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/consts/const-eval/ub-slice-get-unchecked.rs b/tests/ui/consts/const-eval/ub-slice-get-unchecked.rs index ad2b49e60498d..3196d7809f364 100644 --- a/tests/ui/consts/const-eval/ub-slice-get-unchecked.rs +++ b/tests/ui/consts/const-eval/ub-slice-get-unchecked.rs @@ -1,10 +1,24 @@ #![feature(const_index, const_trait_impl)] -const A: [(); 5] = [(), (), (), (), ()]; +const ZST_ARRAY: [(); 5] = [(), (), (), (), ()]; // Since the indexing is on a ZST, the addresses are all fine, // but we should still catch the bad range. -const B: &[()] = unsafe { A.get_unchecked(3..1) }; +const ZST_RANGE_OOB: &[()] = unsafe { ZST_ARRAY.get_unchecked(3..1) }; //~^ ERROR: slice::get_unchecked requires that the range is within the slice +const ZST_INDEX_OOB: &() = unsafe { ZST_ARRAY.get_unchecked(9) }; +//~^ ERROR: slice::get_unchecked requires that the index is within the slice + +const ARRAY: [i32; 5] = [1, 2, 3, 4, 5]; + +const INDEX_OOB: &i32 = unsafe { ARRAY.get_unchecked(9) }; +//~^ ERROR: slice::get_unchecked requires that the index is within the slice + +const INDEX_OOB_MUT: () = unsafe { + let mut array = ARRAY; + let _ = array.get_unchecked_mut(9); + //~^ ERROR: slice::get_unchecked_mut requires that the index is within the slice +}; + fn main() {} diff --git a/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr b/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr index 88ea310f19c68..052ddb527a546 100644 --- a/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr +++ b/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr @@ -1,11 +1,35 @@ error[E0080]: evaluation panicked: unsafe precondition(s) violated: slice::get_unchecked requires that the range is within the slice This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety. - --> $DIR/ub-slice-get-unchecked.rs:7:27 + --> $DIR/ub-slice-get-unchecked.rs:7:39 | -LL | const B: &[()] = unsafe { A.get_unchecked(3..1) }; - | ^^^^^^^^^^^^^^^^^^^^^ evaluation of `B` failed here +LL | const ZST_RANGE_OOB: &[()] = unsafe { ZST_ARRAY.get_unchecked(3..1) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `ZST_RANGE_OOB` failed here -error: aborting due to 1 previous error +error[E0080]: evaluation panicked: unsafe precondition(s) violated: slice::get_unchecked requires that the index is within the slice + + This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety. + --> $DIR/ub-slice-get-unchecked.rs:10:37 + | +LL | const ZST_INDEX_OOB: &() = unsafe { ZST_ARRAY.get_unchecked(9) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `ZST_INDEX_OOB` failed here + +error[E0080]: evaluation panicked: unsafe precondition(s) violated: slice::get_unchecked requires that the index is within the slice + + This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety. + --> $DIR/ub-slice-get-unchecked.rs:15:34 + | +LL | const INDEX_OOB: &i32 = unsafe { ARRAY.get_unchecked(9) }; + | ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `INDEX_OOB` failed here + +error[E0080]: evaluation panicked: unsafe precondition(s) violated: slice::get_unchecked_mut requires that the index is within the slice + + This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety. + --> $DIR/ub-slice-get-unchecked.rs:20:13 + | +LL | let _ = array.get_unchecked_mut(9); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `INDEX_OOB_MUT` failed here + +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/feature-gates/feature-gate-asm_experimental_reg.aarch64.stderr b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.aarch64.stderr new file mode 100644 index 0000000000000..f19cb17a04a29 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.aarch64.stderr @@ -0,0 +1,53 @@ +error[E0658]: register class `preg` can only be used as a clobber in stable + --> $DIR/feature-gate-asm_experimental_reg.rs:45:23 + | +LL | asm!("/* {0} */", in(preg) p); + | ^^^^^^^^^^ + | + = note: see issue #133416 for more information + = help: add `#![feature(asm_experimental_reg)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: type `svint32_t` cannot be used with this register class in stable + --> $DIR/feature-gate-asm_experimental_reg.rs:33:32 + | +LL | asm!("/* {0} */", in(vreg) x); + | ^ + | + = note: see issue #133416 for more information + = help: add `#![feature(asm_experimental_reg)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: type `svint32_t` cannot be used with this register class in stable + --> $DIR/feature-gate-asm_experimental_reg.rs:36:38 + | +LL | asm!("/* {0} */", in(vreg_low16) x); + | ^ + | + = note: see issue #133416 for more information + = help: add `#![feature(asm_experimental_reg)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: type `svint32_t` cannot be used with this register class in stable + --> $DIR/feature-gate-asm_experimental_reg.rs:39:23 + | +LL | asm!("", in("z0") x); + | ^ + | + = note: see issue #133416 for more information + = help: add `#![feature(asm_experimental_reg)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: type `svbool_t` cannot be used with this register class in stable + --> $DIR/feature-gate-asm_experimental_reg.rs:45:32 + | +LL | asm!("/* {0} */", in(preg) p); + | ^ + | + = note: see issue #133416 for more information + = help: add `#![feature(asm_experimental_reg)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-asm_experimental_reg.stderr b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.loongarch.stderr similarity index 90% rename from tests/ui/feature-gates/feature-gate-asm_experimental_reg.stderr rename to tests/ui/feature-gates/feature-gate-asm_experimental_reg.loongarch.stderr index fb54438ef589e..0f829dd65cb47 100644 --- a/tests/ui/feature-gates/feature-gate-asm_experimental_reg.stderr +++ b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.loongarch.stderr @@ -1,5 +1,5 @@ error[E0658]: register class `vreg` can only be used as a clobber in stable - --> $DIR/feature-gate-asm_experimental_reg.rs:21:41 + --> $DIR/feature-gate-asm_experimental_reg.rs:60:41 | LL | asm!("xvadd.h {1:u}, {0:u}, {0:u}", out(vreg) y, in(vreg) x); | ^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | asm!("xvadd.h {1:u}, {0:u}, {0:u}", out(vreg) y, in(vreg) x); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: register class `vreg` can only be used as a clobber in stable - --> $DIR/feature-gate-asm_experimental_reg.rs:21:54 + --> $DIR/feature-gate-asm_experimental_reg.rs:60:54 | LL | asm!("xvadd.h {1:u}, {0:u}, {0:u}", out(vreg) y, in(vreg) x); | ^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | asm!("xvadd.h {1:u}, {0:u}, {0:u}", out(vreg) y, in(vreg) x); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: type `i8x16` cannot be used with this register class in stable - --> $DIR/feature-gate-asm_experimental_reg.rs:21:51 + --> $DIR/feature-gate-asm_experimental_reg.rs:60:51 | LL | asm!("xvadd.h {1:u}, {0:u}, {0:u}", out(vreg) y, in(vreg) x); | ^ @@ -29,7 +29,7 @@ LL | asm!("xvadd.h {1:u}, {0:u}, {0:u}", out(vreg) y, in(vreg) x); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: type `i8x16` cannot be used with this register class in stable - --> $DIR/feature-gate-asm_experimental_reg.rs:21:63 + --> $DIR/feature-gate-asm_experimental_reg.rs:60:63 | LL | asm!("xvadd.h {1:u}, {0:u}, {0:u}", out(vreg) y, in(vreg) x); | ^ diff --git a/tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs index 0d2c4fe2b67c3..c91036366a028 100644 --- a/tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs +++ b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs @@ -1,6 +1,9 @@ //@ add-minicore -//@ compile-flags: --target loongarch64-unknown-none -//@ needs-llvm-components: loongarch +//@ revisions: aarch64 loongarch +//@ [aarch64] compile-flags: --target aarch64-unknown-linux-gnu -C target-feature=+sve +//@ [aarch64] needs-llvm-components: aarch64 +//@ [loongarch] compile-flags: --target loongarch64-unknown-none +//@ [loongarch] needs-llvm-components: loongarch //@ ignore-backends: gcc #![feature(no_core, lang_items, rustc_attrs, repr_simd)] @@ -11,17 +14,53 @@ extern crate minicore; use minicore::*; +#[cfg(aarch64)] +#[rustc_scalable_vector(4)] +pub struct svint32_t(i32); + +#[cfg(aarch64)] +impl Copy for svint32_t {} + +#[cfg(aarch64)] +#[rustc_scalable_vector(16)] +pub struct svbool_t(bool); + +#[cfg(aarch64)] +impl Copy for svbool_t {} + +#[cfg(aarch64)] +unsafe fn vector(x: svint32_t) { + asm!("/* {0} */", in(vreg) x); + //[aarch64]~^ ERROR type `svint32_t` cannot be used with this register class in stable + + asm!("/* {0} */", in(vreg_low16) x); + //[aarch64]~^ ERROR type `svint32_t` cannot be used with this register class in stable + + asm!("", in("z0") x); + //[aarch64]~^ ERROR type `svint32_t` cannot be used with this register class in stable +} + +#[cfg(aarch64)] +unsafe fn predicate(p: svbool_t) { + asm!("/* {0} */", in(preg) p); + //[aarch64]~^ ERROR register class `preg` can only be used as a clobber in stable + //[aarch64]~| ERROR type `svbool_t` cannot be used with this register class in stable +} + +#[cfg(loongarch)] #[repr(simd)] pub struct i8x16([i8; 16]); +#[cfg(loongarch)] impl Copy for i8x16 {} +#[cfg(loongarch)] unsafe fn main(x: i8x16) -> i8x16 { let y; asm!("xvadd.h {1:u}, {0:u}, {0:u}", out(vreg) y, in(vreg) x); - //~^ ERROR register class `vreg` can only be used as a clobber in stable - //~| ERROR register class `vreg` can only be used as a clobber in stable - //~| ERROR type `i8x16` cannot be used with this register class in stable - //~| ERROR type `i8x16` cannot be used with this register class in stable + //[loongarch]~^ ERROR register class `vreg` can only be used as a clobber in stable + //[loongarch]~| ERROR register class `vreg` can only be used as a clobber in stable + //[loongarch]~| ERROR type `i8x16` cannot be used with this register class in stable + //[loongarch]~| ERROR type `i8x16` cannot be used with this register class in stable y } diff --git a/tests/ui/print_type_sizes/async.stdout b/tests/ui/print_type_sizes/async.stdout index c068818fdc9a5..0499531158844 100644 --- a/tests/ui/print_type_sizes/async.stdout +++ b/tests/ui/print_type_sizes/async.stdout @@ -12,8 +12,6 @@ print-type-size variant `Panicked`: 8192 bytes print-type-size upvar `.arg`: 8192 bytes print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes print-type-size field `.value`: 8192 bytes -print-type-size type: `std::mem::MaybeDangling<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes -print-type-size field `.0`: 8192 bytes print-type-size type: `std::mem::MaybeUninit<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 8192 bytes print-type-size field `.uninit`: 0 bytes @@ -53,8 +51,6 @@ print-type-size type: `std::ptr::NonNull>`: 8 bytes, alig print-type-size field `.pointer`: 8 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of wait()}>`: 1 bytes, alignment: 1 bytes print-type-size field `.value`: 1 bytes -print-type-size type: `std::mem::MaybeDangling<{async fn body of wait()}>`: 1 bytes, alignment: 1 bytes -print-type-size field `.0`: 1 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of wait()}>`: 1 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 1 bytes print-type-size field `.uninit`: 0 bytes diff --git a/tests/ui/print_type_sizes/coroutine_discr_placement.stdout b/tests/ui/print_type_sizes/coroutine_discr_placement.stdout index b51beb514ba80..4ce1ce46f6e82 100644 --- a/tests/ui/print_type_sizes/coroutine_discr_placement.stdout +++ b/tests/ui/print_type_sizes/coroutine_discr_placement.stdout @@ -11,8 +11,6 @@ print-type-size variant `Returned`: 0 bytes print-type-size variant `Panicked`: 0 bytes print-type-size type: `std::mem::ManuallyDrop`: 4 bytes, alignment: 4 bytes print-type-size field `.value`: 4 bytes -print-type-size type: `std::mem::MaybeDangling`: 4 bytes, alignment: 4 bytes -print-type-size field `.0`: 4 bytes print-type-size type: `std::mem::MaybeUninit`: 4 bytes, alignment: 4 bytes print-type-size variant `MaybeUninit`: 4 bytes print-type-size field `.uninit`: 0 bytes