diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 02cdaa3b9584..feef7295254a 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -287,7 +287,7 @@ declare_features! ( /// Allows `extern "x86-interrupt" fn()`. (active, abi_x86_interrupt, "1.17.0", Some(40180), None), /// Allows additional const parameter types, such as `&'static str` or user defined types - (incomplete, adt_const_params, "1.56.0", Some(44580), None), + (incomplete, adt_const_params, "1.56.0", Some(95174), None), /// Allows defining an `#[alloc_error_handler]`. (active, alloc_error_handler, "1.29.0", Some(51540), None), /// Allows explicit discriminants on non-unit enum variants. diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index ebf6678d3ad3..4f9e1d3fa3bc 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -196,8 +196,7 @@ impl CheckAttrVisitor<'_> { fn inline_attr_str_error_with_macro_def(&self, hir_id: HirId, attr: &Attribute, sym: &str) { self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, attr.span, |lint| { lint.build(&format!( - "`#[{}]` is ignored on struct fields, match arms and macro defs", - sym, + "`#[{sym}]` is ignored on struct fields, match arms and macro defs", )) .warn( "this was previously accepted by the compiler but is \ @@ -214,7 +213,7 @@ impl CheckAttrVisitor<'_> { fn inline_attr_str_error_without_macro_def(&self, hir_id: HirId, attr: &Attribute, sym: &str) { self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, attr.span, |lint| { - lint.build(&format!("`#[{}]` is ignored on struct fields and match arms", sym)) + lint.build(&format!("`#[{sym}]` is ignored on struct fields and match arms")) .warn( "this was previously accepted by the compiler but is \ being phased out; it will become a hard error in \ @@ -721,7 +720,7 @@ impl CheckAttrVisitor<'_> { .sess .struct_span_err( meta.name_value_literal_span().unwrap_or_else(|| meta.span()), - &format!("`{}` is not a valid identifier", doc_keyword), + &format!("`{doc_keyword}` is not a valid identifier"), ) .emit(); return false; @@ -805,8 +804,7 @@ impl CheckAttrVisitor<'_> { .struct_span_err( meta.span(), &format!( - "`#![doc({} = \"...\")]` isn't allowed as a crate-level attribute", - attr_name, + "`#![doc({attr_name} = \"...\")]` isn't allowed as a crate-level attribute", ), ) .emit(); @@ -1035,8 +1033,7 @@ impl CheckAttrVisitor<'_> { attr.meta().unwrap().span, "use `doc = include_str!` instead", format!( - "#{}[doc = include_str!(\"{}\")]", - inner, value + "#{inner}[doc = include_str!(\"{value}\")]", ), applicability, ); @@ -1230,7 +1227,7 @@ impl CheckAttrVisitor<'_> { if let Some(value) = attr.value_str() { diag.span_help( attr.span, - &format!(r#"try `#[link(name = "{}")]` instead"#, value), + &format!(r#"try `#[link(name = "{value}")]` instead"#), ); } else { diag.span_help(attr.span, r#"try `#[link(name = "...")]` instead"#); @@ -1518,15 +1515,14 @@ impl CheckAttrVisitor<'_> { }; self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, attr.span, |lint| { lint.build(&format!( - "`#[no_mangle]` has no effect on a foreign {}", - foreign_item_kind + "`#[no_mangle]` has no effect on a foreign {foreign_item_kind}" )) .warn( "this was previously accepted by the compiler but is \ being phased out; it will become a hard error in \ a future release!", ) - .span_label(span, format!("foreign {}", foreign_item_kind)) + .span_label(span, format!("foreign {foreign_item_kind}")) .note("symbol names in extern blocks are not mangled") .span_suggestion( attr.span, @@ -1692,9 +1688,9 @@ impl CheckAttrVisitor<'_> { hint.span(), E0517, "{}", - &format!("attribute should be applied to {} {}", article, allowed_targets) + &format!("attribute should be applied to {article} {allowed_targets}") ) - .span_label(span, &format!("not {} {}", article, allowed_targets)) + .span_label(span, &format!("not {article} {allowed_targets}")) .emit(); } diff --git a/compiler/rustc_passes/src/check_const.rs b/compiler/rustc_passes/src/check_const.rs index 0fdbdb7b08d0..0e04a2cfb11a 100644 --- a/compiler/rustc_passes/src/check_const.rs +++ b/compiler/rustc_passes/src/check_const.rs @@ -80,8 +80,7 @@ impl<'tcx> hir::itemlikevisit::ItemLikeVisitor<'tcx> for CheckConstTraitVisitor< /// of the trait being implemented; as those provided functions can be non-const. fn visit_item<'hir>(&mut self, item: &'hir hir::Item<'hir>) { let _: Option<_> = try { - if let hir::ItemKind::Impl(ref imp) = item.kind { - if let hir::Constness::Const = imp.constness { + if let hir::ItemKind::Impl(ref imp) = item.kind && let hir::Constness::Const = imp.constness { let trait_def_id = imp.of_trait.as_ref()?.trait_def_id()?; let ancestors = self .tcx @@ -132,7 +131,6 @@ impl<'tcx> hir::itemlikevisit::ItemLikeVisitor<'tcx> for CheckConstTraitVisitor< .note(&format!("`{}` not implemented", to_implement.join("`, `"))) .emit(); } - } } }; } diff --git a/compiler/rustc_passes/src/diagnostic_items.rs b/compiler/rustc_passes/src/diagnostic_items.rs index 30a0071f0f2e..9cbb7917e9a3 100644 --- a/compiler/rustc_passes/src/diagnostic_items.rs +++ b/compiler/rustc_passes/src/diagnostic_items.rs @@ -61,10 +61,9 @@ fn collect_item(tcx: TyCtxt<'_>, items: &mut DiagnosticItems, name: Symbol, item if let Some(original_def_id) = items.name_to_id.insert(name, item_def_id) { if original_def_id != item_def_id { let mut err = match tcx.hir().span_if_local(item_def_id) { - Some(span) => tcx.sess.struct_span_err( - span, - &format!("duplicate diagnostic item found: `{}`.", name), - ), + Some(span) => tcx + .sess + .struct_span_err(span, &format!("duplicate diagnostic item found: `{name}`.")), None => tcx.sess.struct_err(&format!( "duplicate diagnostic item in crate `{}`: `{}`.", tcx.crate_name(item_def_id.krate), diff --git a/compiler/rustc_passes/src/entry.rs b/compiler/rustc_passes/src/entry.rs index f5040a373c29..5a1373ad1a21 100644 --- a/compiler/rustc_passes/src/entry.rs +++ b/compiler/rustc_passes/src/entry.rs @@ -148,33 +148,29 @@ fn configure_main(tcx: TyCtxt<'_>, visitor: &EntryContext<'_, '_>) -> Option<(De } else if let Some((def_id, _)) = visitor.attr_main_fn { Some((def_id.to_def_id(), EntryFnType::Main)) } else { - if let Some(main_def) = tcx.resolutions(()).main_def { - if let Some(def_id) = main_def.opt_fn_def_id() { - // non-local main imports are handled below - if let Some(def_id) = def_id.as_local() { - if matches!(tcx.hir().find_by_def_id(def_id), Some(Node::ForeignItem(_))) { - tcx.sess - .struct_span_err( - tcx.def_span(def_id), - "the `main` function cannot be declared in an `extern` block", - ) - .emit(); - return None; - } - } - - if main_def.is_import && !tcx.features().imported_main { - let span = main_def.span; - feature_err( - &tcx.sess.parse_sess, - sym::imported_main, - span, - "using an imported function as entry point `main` is experimental", + if let Some(main_def) = tcx.resolutions(()).main_def && let Some(def_id) = main_def.opt_fn_def_id() { + // non-local main imports are handled below + if let Some(def_id) = def_id.as_local() && matches!(tcx.hir().find_by_def_id(def_id), Some(Node::ForeignItem(_))) { + tcx.sess + .struct_span_err( + tcx.def_span(def_id), + "the `main` function cannot be declared in an `extern` block", ) .emit(); - } - return Some((def_id, EntryFnType::Main)); + return None; } + + if main_def.is_import && !tcx.features().imported_main { + let span = main_def.span; + feature_err( + &tcx.sess.parse_sess, + sym::imported_main, + span, + "using an imported function as entry point `main` is experimental", + ) + .emit(); + } + return Some((def_id, EntryFnType::Main)); } no_main_err(tcx, visitor); None @@ -225,11 +221,9 @@ fn no_main_err(tcx: TyCtxt<'_>, visitor: &EntryContext<'_, '_>) { err.note(¬e); } - if let Some(main_def) = tcx.resolutions(()).main_def { - if main_def.opt_fn_def_id().is_none() { - // There is something at `crate::main`, but it is not a function definition. - err.span_label(main_def.span, "non-function item at `crate::main` is found"); - } + if let Some(main_def) = tcx.resolutions(()).main_def && main_def.opt_fn_def_id().is_none(){ + // There is something at `crate::main`, but it is not a function definition. + err.span_label(main_def.span, "non-function item at `crate::main` is found"); } if tcx.sess.teach(&err.get_code().unwrap()) { diff --git a/compiler/rustc_passes/src/intrinsicck.rs b/compiler/rustc_passes/src/intrinsicck.rs index 6316f3b84591..027eac16bad3 100644 --- a/compiler/rustc_passes/src/intrinsicck.rs +++ b/compiler/rustc_passes/src/intrinsicck.rs @@ -79,27 +79,25 @@ impl<'tcx> ExprVisitor<'tcx> { // Special-case transmuting from `typeof(function)` and // `Option` to present a clearer error. let from = unpack_option_like(self.tcx, from); - if let (&ty::FnDef(..), SizeSkeleton::Known(size_to)) = (from.kind(), sk_to) { - if size_to == Pointer.size(&self.tcx) { - struct_span_err!(self.tcx.sess, span, E0591, "can't transmute zero-sized type") - .note(&format!("source type: {}", from)) - .note(&format!("target type: {}", to)) - .help("cast with `as` to a pointer instead") - .emit(); - return; - } + if let (&ty::FnDef(..), SizeSkeleton::Known(size_to)) = (from.kind(), sk_to) && size_to == Pointer.size(&self.tcx) { + struct_span_err!(self.tcx.sess, span, E0591, "can't transmute zero-sized type") + .note(&format!("source type: {from}")) + .note(&format!("target type: {to}")) + .help("cast with `as` to a pointer instead") + .emit(); + return; } } // Try to display a sensible error with as much information as possible. let skeleton_string = |ty: Ty<'tcx>, sk| match sk { Ok(SizeSkeleton::Known(size)) => format!("{} bits", size.bits()), - Ok(SizeSkeleton::Pointer { tail, .. }) => format!("pointer to `{}`", tail), + Ok(SizeSkeleton::Pointer { tail, .. }) => format!("pointer to `{tail}`"), Err(LayoutError::Unknown(bad)) => { if bad == ty { "this type does not have a fixed size".to_owned() } else { - format!("size can vary because of {}", bad) + format!("size can vary because of {bad}") } } Err(err) => err.to_string(), @@ -113,7 +111,7 @@ impl<'tcx> ExprVisitor<'tcx> { or dependently-sized types" ); if from == to { - err.note(&format!("`{}` does not have a fixed size", from)); + err.note(&format!("`{from}` does not have a fixed size")); } else { err.note(&format!("source type: `{}` ({})", from, skeleton_string(from, sk_from))) .note(&format!("target type: `{}` ({})", to, skeleton_string(to, sk_to))); @@ -201,7 +199,7 @@ impl<'tcx> ExprVisitor<'tcx> { _ => None, }; let Some(asm_ty) = asm_ty else { - let msg = &format!("cannot use value of type `{}` for inline assembly", ty); + let msg = &format!("cannot use value of type `{ty}` for inline assembly"); let mut err = self.tcx.sess.struct_span_err(expr.span, msg); err.note( "only integers, floats, SIMD vectors, pointers and function pointers \ @@ -216,7 +214,7 @@ impl<'tcx> ExprVisitor<'tcx> { if !ty.is_copy_modulo_regions(self.tcx.at(DUMMY_SP), self.param_env) { let msg = "arguments for inline assembly must be copyable"; let mut err = self.tcx.sess.struct_span_err(expr.span, msg); - err.note(&format!("`{}` does not implement the Copy trait", ty)); + err.note(&format!("`{ty}` does not implement the Copy trait")); err.emit(); } @@ -237,7 +235,7 @@ impl<'tcx> ExprVisitor<'tcx> { in_expr.span, &format!("type `{}`", self.typeck_results.expr_ty_adjusted(in_expr)), ); - err.span_label(expr.span, &format!("type `{}`", ty)); + err.span_label(expr.span, &format!("type `{ty}`")); err.note( "asm inout arguments must have the same type, \ unless they are both pointers or integers of the same size", @@ -256,7 +254,7 @@ impl<'tcx> ExprVisitor<'tcx> { let reg_class = reg.reg_class(); let supported_tys = reg_class.supported_types(asm_arch); let Some((_, feature)) = supported_tys.iter().find(|&&(t, _)| t == asm_ty) else { - let msg = &format!("type `{}` cannot be used with this register class", ty); + let msg = &format!("type `{ty}` cannot be used with this register class"); let mut err = self.tcx.sess.struct_span_err(expr.span, msg); let supported_tys: Vec<_> = supported_tys.iter().map(|(t, _)| t.to_string()).collect(); @@ -326,12 +324,10 @@ impl<'tcx> ExprVisitor<'tcx> { let mut err = lint.build(msg); err.span_label(expr.span, "for this argument"); err.help(&format!( - "use the `{}` modifier to have the register formatted as `{}`", - suggested_modifier, suggested_result, + "use the `{suggested_modifier}` modifier to have the register formatted as `{suggested_result}`", )); err.help(&format!( - "or use the `{}` modifier to keep the default formatting of `{}`", - default_modifier, default_result, + "or use the `{default_modifier}` modifier to keep the default formatting of `{default_result}`", )); err.emit(); }, @@ -509,14 +505,14 @@ impl<'tcx> Visitor<'tcx> for ExprVisitor<'tcx> { match expr.kind { hir::ExprKind::Path(ref qpath) => { let res = self.typeck_results.qpath_res(qpath, expr.hir_id); - if let Res::Def(DefKind::Fn, did) = res { - if self.def_id_is_transmute(did) { - let typ = self.typeck_results.node_type(expr.hir_id); - let sig = typ.fn_sig(self.tcx); - let from = sig.inputs().skip_binder()[0]; - let to = sig.output().skip_binder(); - self.check_transmute(expr.span, from, to); - } + if let Res::Def(DefKind::Fn, did) = res + && self.def_id_is_transmute(did) + { + let typ = self.typeck_results.node_type(expr.hir_id); + let sig = typ.fn_sig(self.tcx); + let from = sig.inputs().skip_binder()[0]; + let to = sig.output().skip_binder(); + self.check_transmute(expr.span, from, to); } } diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs index ecdbe12c9abd..bcae735bb7e5 100644 --- a/compiler/rustc_resolve/src/late/lifetimes.rs +++ b/compiler/rustc_resolve/src/late/lifetimes.rs @@ -1,3 +1,4 @@ +// ignore-tidy-filelength //! Name resolution for lifetimes. //! //! Name resolution for lifetimes follows *much* simpler rules than the @@ -230,6 +231,10 @@ enum Scope<'a> { hir_id: hir::HirId, s: ScopeRef<'a>, + + /// In some cases not allowing late bounds allows us to avoid ICEs. + /// This is almost ways set to true. + allow_late_bound: bool, }, /// Lifetimes introduced by a fn are scoped to the call-site for that fn, @@ -302,6 +307,7 @@ impl<'a> fmt::Debug for TruncatedScopeDebug<'a> { scope_type, hir_id, s: _, + allow_late_bound, } => f .debug_struct("Binder") .field("lifetimes", lifetimes) @@ -311,6 +317,7 @@ impl<'a> fmt::Debug for TruncatedScopeDebug<'a> { .field("scope_type", scope_type) .field("hir_id", hir_id) .field("s", &"..") + .field("allow_late_bound", allow_late_bound) .finish(), Scope::Body { id, s: _ } => { f.debug_struct("Body").field("id", id).field("s", &"..").finish() @@ -703,6 +710,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { track_lifetime_uses: true, opaque_type_parent: false, scope_type: BinderScopeType::Normal, + allow_late_bound: true, }; self.with(scope, move |_old_scope, this| { intravisit::walk_fn(this, fk, fd, b, s, hir_id) @@ -828,6 +836,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { track_lifetime_uses, scope_type: BinderScopeType::Normal, s: ROOT_SCOPE, + allow_late_bound: false, }; self.with(scope, |old_scope, this| { this.check_lifetime_params(old_scope, &generics.params); @@ -896,6 +905,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { track_lifetime_uses: true, opaque_type_parent: false, scope_type: BinderScopeType::Normal, + allow_late_bound: true, }; self.with(scope, |old_scope, this| { // a bare fn has no bounds, so everything @@ -1077,6 +1087,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { track_lifetime_uses: true, opaque_type_parent: false, scope_type: BinderScopeType::Normal, + allow_late_bound: false, }; this.with(scope, |_old_scope, this| { this.visit_generics(generics); @@ -1097,6 +1108,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { track_lifetime_uses: true, opaque_type_parent: false, scope_type: BinderScopeType::Normal, + allow_late_bound: false, }; self.with(scope, |_old_scope, this| { let scope = Scope::TraitRefBoundary { s: this.scope }; @@ -1156,6 +1168,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { track_lifetime_uses: true, opaque_type_parent: true, scope_type: BinderScopeType::Normal, + allow_late_bound: false, }; self.with(scope, |old_scope, this| { this.check_lifetime_params(old_scope, &generics.params); @@ -1225,6 +1238,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { track_lifetime_uses: true, opaque_type_parent: true, scope_type: BinderScopeType::Normal, + allow_late_bound: true, }; self.with(scope, |old_scope, this| { this.check_lifetime_params(old_scope, &generics.params); @@ -1378,6 +1392,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { track_lifetime_uses: true, opaque_type_parent: false, scope_type: BinderScopeType::Normal, + allow_late_bound: true, }; this.with(scope, |old_scope, this| { this.check_lifetime_params(old_scope, &bound_generic_params); @@ -1425,6 +1440,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { track_lifetime_uses: true, opaque_type_parent: false, scope_type, + allow_late_bound: true, }; self.with(scope, |_, this| { intravisit::walk_param_bound(this, bound); @@ -1477,6 +1493,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { track_lifetime_uses: true, opaque_type_parent: false, scope_type, + allow_late_bound: true, }; self.with(scope, |old_scope, this| { this.check_lifetime_params(old_scope, &trait_ref.bound_generic_params); @@ -2180,6 +2197,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { opaque_type_parent: true, track_lifetime_uses: false, scope_type: BinderScopeType::Normal, + allow_late_bound: true, }; self.with(scope, move |old_scope, this| { this.check_lifetime_params(old_scope, &generics.params); @@ -2602,7 +2620,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { let mut scope = &*self.scope; let hir_id = loop { match scope { - Scope::Binder { hir_id, .. } => { + Scope::Binder { hir_id, allow_late_bound: true, .. } => { break *hir_id; } Scope::ObjectLifetimeDefault { ref s, .. } @@ -2611,8 +2629,11 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { | Scope::TraitRefBoundary { ref s, .. } => { scope = *s; } - Scope::Root | Scope::Body { .. } => { + Scope::Root + | Scope::Body { .. } + | Scope::Binder { allow_late_bound: false, .. } => { // See issues #83907 and #83693. Just bail out from looking inside. + // See the issue #95023 for not allowing late bound self.tcx.sess.delay_span_bug( rustc_span::DUMMY_SP, "In fn_like_elision without appropriate scope above", diff --git a/src/doc/unstable-book/src/compiler-flags/check-cfg.md b/src/doc/unstable-book/src/compiler-flags/check-cfg.md index d7345ad0c33f..486b3d4414f3 100644 --- a/src/doc/unstable-book/src/compiler-flags/check-cfg.md +++ b/src/doc/unstable-book/src/compiler-flags/check-cfg.md @@ -92,8 +92,6 @@ and `cfg!(name = "value")` call. It will check that the `"value"` specified is p list of expected values. If `"value"` is not in it, then `rustc` will report an `unexpected_cfgs` lint diagnostic. The default diagnostic level for this lint is `Warn`. -The form `values()` is an error, because it does not specify a condition name. - To enable checking of values, but to provide an empty set of valid values, use this form: ```bash @@ -104,13 +102,17 @@ The `--check-cfg values(...)` option can be repeated, both for the same conditio different names. If it is repeated for the same condition name, then the sets of values for that condition are merged together. +If `values()` is specified, then `rustc` will enable the checking of well-known values defined +by itself. Note that it's necessary to specify the `values()` form to enable the checking of +well known values, specifying the other forms doesn't implicitly enable it. + ## Examples Consider this command line: ```bash rustc --check-cfg 'names(feature)' \ - --check-cfg 'values(feature,"lion","zebra")' \ + --check-cfg 'values(feature, "lion", "zebra")' \ --cfg 'feature="lion"' -Z unstable-options \ example.rs ``` diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 67adaa8702d8..ee265b8c4b54 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -400,7 +400,6 @@ nav.sub { .source .sidebar > *:not(#sidebar-toggle) { opacity: 0; visibility: hidden; - transition: opacity 0.5s; } .source .sidebar.expanded { @@ -1677,12 +1676,6 @@ details.rustdoc-toggle[open] > summary.hideme::after { display: none; } - /* It doesn't render well on mobile because of the layout, so better only have the transition - on desktop. */ - .rustdoc.source .sidebar { - transition: width .5s; - } - .source .sidebar.expanded { width: 300px; } diff --git a/src/test/rustdoc-gui/code-sidebar-toggle.goml b/src/test/rustdoc-gui/code-sidebar-toggle.goml index 1818f0dbcdf4..867db056948b 100644 --- a/src/test/rustdoc-gui/code-sidebar-toggle.goml +++ b/src/test/rustdoc-gui/code-sidebar-toggle.goml @@ -3,6 +3,5 @@ goto: file://|DOC_PATH|/test_docs/index.html click: ".srclink" wait-for: "#sidebar-toggle" click: "#sidebar-toggle" -wait-for: 500 fail: true assert-css: ("#source-sidebar", { "left": "-300px" }) diff --git a/src/test/ui/abi/abi-sysv64-register-usage.rs b/src/test/ui/abi/abi-sysv64-register-usage.rs index e3eff2eb1433..9404e71d0fe2 100644 --- a/src/test/ui/abi/abi-sysv64-register-usage.rs +++ b/src/test/ui/abi/abi-sysv64-register-usage.rs @@ -5,6 +5,7 @@ // ignore-android // ignore-arm // ignore-aarch64 +// needs-asm-support #![feature(asm_sym)] #[cfg(target_arch = "x86_64")] diff --git a/src/test/ui/asm/aarch64/const.rs b/src/test/ui/asm/aarch64/const.rs index 73512dcc4467..de299bfdbdfc 100644 --- a/src/test/ui/asm/aarch64/const.rs +++ b/src/test/ui/asm/aarch64/const.rs @@ -1,5 +1,6 @@ // only-aarch64 // run-pass +// needs-asm-support // revisions: mirunsafeck thirunsafeck // [thirunsafeck]compile-flags: -Z thir-unsafeck diff --git a/src/test/ui/asm/aarch64/duplicate-options.fixed b/src/test/ui/asm/aarch64/duplicate-options.fixed index a78e6867bd3a..fa1dd4aef5d1 100644 --- a/src/test/ui/asm/aarch64/duplicate-options.fixed +++ b/src/test/ui/asm/aarch64/duplicate-options.fixed @@ -1,4 +1,5 @@ // only-aarch64 +// needs-asm-support // run-rustfix use std::arch::asm; diff --git a/src/test/ui/asm/aarch64/duplicate-options.rs b/src/test/ui/asm/aarch64/duplicate-options.rs index bd1f15701368..b2d3fe7d9a73 100644 --- a/src/test/ui/asm/aarch64/duplicate-options.rs +++ b/src/test/ui/asm/aarch64/duplicate-options.rs @@ -1,4 +1,5 @@ // only-aarch64 +// needs-asm-support // run-rustfix use std::arch::asm; diff --git a/src/test/ui/asm/aarch64/duplicate-options.stderr b/src/test/ui/asm/aarch64/duplicate-options.stderr index 5063b0c1235f..feb3838f4f79 100644 --- a/src/test/ui/asm/aarch64/duplicate-options.stderr +++ b/src/test/ui/asm/aarch64/duplicate-options.stderr @@ -1,53 +1,53 @@ error: the `nomem` option was already provided - --> $DIR/duplicate-options.rs:8:33 + --> $DIR/duplicate-options.rs:9:33 | LL | asm!("", options(nomem, nomem)); | ^^^^^ this option was already provided error: the `preserves_flags` option was already provided - --> $DIR/duplicate-options.rs:10:43 + --> $DIR/duplicate-options.rs:11:43 | LL | asm!("", options(preserves_flags, preserves_flags)); | ^^^^^^^^^^^^^^^ this option was already provided error: the `nostack` option was already provided - --> $DIR/duplicate-options.rs:12:61 + --> $DIR/duplicate-options.rs:13:61 | LL | asm!("", options(nostack, preserves_flags), options(nostack)); | ^^^^^^^ this option was already provided error: the `nostack` option was already provided - --> $DIR/duplicate-options.rs:14:35 + --> $DIR/duplicate-options.rs:15:35 | LL | asm!("", options(nostack, nostack), options(nostack), options(nostack)); | ^^^^^^^ this option was already provided error: the `nostack` option was already provided - --> $DIR/duplicate-options.rs:14:53 + --> $DIR/duplicate-options.rs:15:53 | LL | asm!("", options(nostack, nostack), options(nostack), options(nostack)); | ^^^^^^^ this option was already provided error: the `nostack` option was already provided - --> $DIR/duplicate-options.rs:14:71 + --> $DIR/duplicate-options.rs:15:71 | LL | asm!("", options(nostack, nostack), options(nostack), options(nostack)); | ^^^^^^^ this option was already provided error: the `noreturn` option was already provided - --> $DIR/duplicate-options.rs:21:38 + --> $DIR/duplicate-options.rs:22:38 | LL | options(preserves_flags, noreturn), | ^^^^^^^^ this option was already provided error: the `nomem` option was already provided - --> $DIR/duplicate-options.rs:22:21 + --> $DIR/duplicate-options.rs:23:21 | LL | options(nomem, nostack), | ^^^^^ this option was already provided error: the `noreturn` option was already provided - --> $DIR/duplicate-options.rs:23:21 + --> $DIR/duplicate-options.rs:24:21 | LL | options(noreturn), | ^^^^^^^^ this option was already provided diff --git a/src/test/ui/asm/aarch64/interpolated-idents.rs b/src/test/ui/asm/aarch64/interpolated-idents.rs index ece62ce3930e..e87a88434991 100644 --- a/src/test/ui/asm/aarch64/interpolated-idents.rs +++ b/src/test/ui/asm/aarch64/interpolated-idents.rs @@ -1,5 +1,5 @@ // only-aarch64 - +// needs-asm-support use std::arch::asm; macro_rules! m { diff --git a/src/test/ui/asm/aarch64/srcloc.rs b/src/test/ui/asm/aarch64/srcloc.rs index 609f5e80d240..040d4df546fb 100644 --- a/src/test/ui/asm/aarch64/srcloc.rs +++ b/src/test/ui/asm/aarch64/srcloc.rs @@ -1,5 +1,6 @@ // only-aarch64 // build-fail +// needs-asm-support // compile-flags: -Ccodegen-units=1 use std::arch::asm; diff --git a/src/test/ui/asm/aarch64/srcloc.stderr b/src/test/ui/asm/aarch64/srcloc.stderr index 96dab1bce0b7..f8b645c23f5a 100644 --- a/src/test/ui/asm/aarch64/srcloc.stderr +++ b/src/test/ui/asm/aarch64/srcloc.stderr @@ -1,5 +1,5 @@ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:11:15 + --> $DIR/srcloc.rs:12:15 | LL | asm!("invalid_instruction"); | ^ @@ -11,7 +11,7 @@ LL | invalid_instruction | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:15:13 + --> $DIR/srcloc.rs:16:13 | LL | invalid_instruction | ^ @@ -23,7 +23,7 @@ LL | invalid_instruction | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:20:13 + --> $DIR/srcloc.rs:21:13 | LL | invalid_instruction | ^ @@ -35,7 +35,7 @@ LL | invalid_instruction | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:26:13 + --> $DIR/srcloc.rs:27:13 | LL | invalid_instruction | ^ @@ -47,7 +47,7 @@ LL | invalid_instruction | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:33:13 + --> $DIR/srcloc.rs:34:13 | LL | invalid_instruction | ^ @@ -59,7 +59,7 @@ LL | invalid_instruction | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:38:14 + --> $DIR/srcloc.rs:39:14 | LL | asm!(concat!("invalid", "_", "instruction")); | ^ @@ -71,7 +71,7 @@ LL | invalid_instruction | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:42:14 + --> $DIR/srcloc.rs:43:14 | LL | "invalid_instruction", | ^ @@ -83,7 +83,7 @@ LL | invalid_instruction | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:48:14 + --> $DIR/srcloc.rs:49:14 | LL | "invalid_instruction", | ^ @@ -95,7 +95,7 @@ LL | invalid_instruction | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:55:14 + --> $DIR/srcloc.rs:56:14 | LL | "invalid_instruction", | ^ @@ -107,7 +107,7 @@ LL | invalid_instruction | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:62:13 + --> $DIR/srcloc.rs:63:13 | LL | concat!("invalid", "_", "instruction"), | ^ @@ -119,7 +119,7 @@ LL | invalid_instruction | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:69:13 + --> $DIR/srcloc.rs:70:13 | LL | concat!("invalid", "_", "instruction"), | ^ @@ -131,7 +131,7 @@ LL | invalid_instruction | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:76:14 + --> $DIR/srcloc.rs:77:14 | LL | "invalid_instruction1", | ^ @@ -143,7 +143,7 @@ LL | invalid_instruction1 | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:77:14 + --> $DIR/srcloc.rs:78:14 | LL | "invalid_instruction2", | ^ @@ -155,7 +155,7 @@ LL | invalid_instruction2 | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:83:13 + --> $DIR/srcloc.rs:84:13 | LL | concat!( | ^ @@ -167,7 +167,7 @@ LL | invalid_instruction1 | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:83:13 + --> $DIR/srcloc.rs:84:13 | LL | concat!( | ^ @@ -179,7 +179,7 @@ LL | invalid_instruction2 | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:92:13 + --> $DIR/srcloc.rs:93:13 | LL | concat!( | ^ @@ -191,7 +191,7 @@ LL | invalid_instruction1 | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:92:13 + --> $DIR/srcloc.rs:93:13 | LL | concat!( | ^ @@ -203,7 +203,7 @@ LL | invalid_instruction2 | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:96:13 + --> $DIR/srcloc.rs:97:13 | LL | concat!( | ^ @@ -215,7 +215,7 @@ LL | invalid_instruction3 | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:96:13 + --> $DIR/srcloc.rs:97:13 | LL | concat!( | ^ @@ -227,7 +227,7 @@ LL | invalid_instruction4 | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:107:13 + --> $DIR/srcloc.rs:108:13 | LL | concat!( | ^ @@ -239,7 +239,7 @@ LL | invalid_instruction1 | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:107:13 + --> $DIR/srcloc.rs:108:13 | LL | concat!( | ^ @@ -251,7 +251,7 @@ LL | invalid_instruction2 | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:111:13 + --> $DIR/srcloc.rs:112:13 | LL | concat!( | ^ @@ -263,7 +263,7 @@ LL | invalid_instruction3 | ^ error: unrecognized instruction mnemonic - --> $DIR/srcloc.rs:111:13 + --> $DIR/srcloc.rs:112:13 | LL | concat!( | ^ diff --git a/src/test/ui/asm/aarch64/sym.rs b/src/test/ui/asm/aarch64/sym.rs index 4fd31070ec79..3f659363cc84 100644 --- a/src/test/ui/asm/aarch64/sym.rs +++ b/src/test/ui/asm/aarch64/sym.rs @@ -1,5 +1,6 @@ // only-aarch64 // only-linux +// needs-asm-support // run-pass #![feature(thread_local, asm_sym)] diff --git a/src/test/ui/asm/inline-syntax.arm.stderr b/src/test/ui/asm/inline-syntax.arm.stderr index bf6ea6b67f9b..1352fb3771be 100644 --- a/src/test/ui/asm/inline-syntax.arm.stderr +++ b/src/test/ui/asm/inline-syntax.arm.stderr @@ -13,7 +13,7 @@ LL | .intel_syntax noprefix | ^ error: unknown directive - --> $DIR/inline-syntax.rs:31:15 + --> $DIR/inline-syntax.rs:32:15 | LL | asm!(".intel_syntax noprefix", "nop"); | ^ @@ -25,7 +25,7 @@ LL | .intel_syntax noprefix | ^ error: unknown directive - --> $DIR/inline-syntax.rs:34:15 + --> $DIR/inline-syntax.rs:35:15 | LL | asm!(".intel_syntax aaa noprefix", "nop"); | ^ @@ -37,7 +37,7 @@ LL | .intel_syntax aaa noprefix | ^ error: unknown directive - --> $DIR/inline-syntax.rs:37:15 + --> $DIR/inline-syntax.rs:38:15 | LL | asm!(".att_syntax noprefix", "nop"); | ^ @@ -49,7 +49,7 @@ LL | .att_syntax noprefix | ^ error: unknown directive - --> $DIR/inline-syntax.rs:40:15 + --> $DIR/inline-syntax.rs:41:15 | LL | asm!(".att_syntax bbb noprefix", "nop"); | ^ @@ -61,7 +61,7 @@ LL | .att_syntax bbb noprefix | ^ error: unknown directive - --> $DIR/inline-syntax.rs:43:15 + --> $DIR/inline-syntax.rs:44:15 | LL | asm!(".intel_syntax noprefix; nop"); | ^ @@ -73,7 +73,7 @@ LL | .intel_syntax noprefix; nop | ^ error: unknown directive - --> $DIR/inline-syntax.rs:49:13 + --> $DIR/inline-syntax.rs:50:13 | LL | .intel_syntax noprefix | ^ diff --git a/src/test/ui/asm/inline-syntax.rs b/src/test/ui/asm/inline-syntax.rs index 481990398f4c..d06796e33d51 100644 --- a/src/test/ui/asm/inline-syntax.rs +++ b/src/test/ui/asm/inline-syntax.rs @@ -8,6 +8,7 @@ //[arm] compile-flags: --target armv7-unknown-linux-gnueabihf //[arm] build-fail //[arm] needs-llvm-components: arm +// needs-asm-support #![feature(no_core, lang_items, rustc_attrs)] #![crate_type = "rlib"] diff --git a/src/test/ui/asm/inline-syntax.x86_64.stderr b/src/test/ui/asm/inline-syntax.x86_64.stderr index dcbc17bb2608..840b250f87d7 100644 --- a/src/test/ui/asm/inline-syntax.x86_64.stderr +++ b/src/test/ui/asm/inline-syntax.x86_64.stderr @@ -1,5 +1,5 @@ warning: avoid using `.intel_syntax`, Intel syntax is the default - --> $DIR/inline-syntax.rs:57:14 + --> $DIR/inline-syntax.rs:58:14 | LL | global_asm!(".intel_syntax noprefix", "nop"); | ^^^^^^^^^^^^^^^^^^^^^^ @@ -7,37 +7,37 @@ LL | global_asm!(".intel_syntax noprefix", "nop"); = note: `#[warn(bad_asm_style)]` on by default warning: avoid using `.intel_syntax`, Intel syntax is the default - --> $DIR/inline-syntax.rs:31:15 + --> $DIR/inline-syntax.rs:32:15 | LL | asm!(".intel_syntax noprefix", "nop"); | ^^^^^^^^^^^^^^^^^^^^^^ warning: avoid using `.intel_syntax`, Intel syntax is the default - --> $DIR/inline-syntax.rs:34:15 + --> $DIR/inline-syntax.rs:35:15 | LL | asm!(".intel_syntax aaa noprefix", "nop"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: avoid using `.att_syntax`, prefer using `options(att_syntax)` instead - --> $DIR/inline-syntax.rs:37:15 + --> $DIR/inline-syntax.rs:38:15 | LL | asm!(".att_syntax noprefix", "nop"); | ^^^^^^^^^^^^^^^^^^^^ warning: avoid using `.att_syntax`, prefer using `options(att_syntax)` instead - --> $DIR/inline-syntax.rs:40:15 + --> $DIR/inline-syntax.rs:41:15 | LL | asm!(".att_syntax bbb noprefix", "nop"); | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: avoid using `.intel_syntax`, Intel syntax is the default - --> $DIR/inline-syntax.rs:43:15 + --> $DIR/inline-syntax.rs:44:15 | LL | asm!(".intel_syntax noprefix; nop"); | ^^^^^^^^^^^^^^^^^^^^^^ warning: avoid using `.intel_syntax`, Intel syntax is the default - --> $DIR/inline-syntax.rs:49:13 + --> $DIR/inline-syntax.rs:50:13 | LL | .intel_syntax noprefix | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/asm/issue-92378.rs b/src/test/ui/asm/issue-92378.rs index d595e88ff80c..6e3c26e98c3f 100644 --- a/src/test/ui/asm/issue-92378.rs +++ b/src/test/ui/asm/issue-92378.rs @@ -1,5 +1,6 @@ // compile-flags: --target armv5te-unknown-linux-gnueabi // needs-llvm-components: arm +// needs-asm-support // build-pass #![feature(no_core, lang_items, rustc_attrs, isa_attribute)] diff --git a/src/test/ui/asm/naked-functions-unused.aarch64.stderr b/src/test/ui/asm/naked-functions-unused.aarch64.stderr index cf4a1d9174e3..8d3c300e0586 100644 --- a/src/test/ui/asm/naked-functions-unused.aarch64.stderr +++ b/src/test/ui/asm/naked-functions-unused.aarch64.stderr @@ -1,66 +1,66 @@ error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:16:32 + --> $DIR/naked-functions-unused.rs:17:32 | LL | pub extern "C" fn function(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` | note: the lint level is defined here - --> $DIR/naked-functions-unused.rs:4:9 + --> $DIR/naked-functions-unused.rs:5:9 | LL | #![deny(unused)] | ^^^^^^ = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:16:42 + --> $DIR/naked-functions-unused.rs:17:42 | LL | pub extern "C" fn function(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:25:38 + --> $DIR/naked-functions-unused.rs:26:38 | LL | pub extern "C" fn associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:25:48 + --> $DIR/naked-functions-unused.rs:26:48 | LL | pub extern "C" fn associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:31:41 + --> $DIR/naked-functions-unused.rs:32:41 | LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:31:51 + --> $DIR/naked-functions-unused.rs:32:51 | LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:39:40 + --> $DIR/naked-functions-unused.rs:40:40 | LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:39:50 + --> $DIR/naked-functions-unused.rs:40:50 | LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:45:43 + --> $DIR/naked-functions-unused.rs:46:43 | LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:45:53 + --> $DIR/naked-functions-unused.rs:46:53 | LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` diff --git a/src/test/ui/asm/naked-functions-unused.rs b/src/test/ui/asm/naked-functions-unused.rs index 4360d9addf00..044a0e5b9408 100644 --- a/src/test/ui/asm/naked-functions-unused.rs +++ b/src/test/ui/asm/naked-functions-unused.rs @@ -1,4 +1,5 @@ // revisions: x86_64 aarch64 +// needs-asm-support //[x86_64] only-x86_64 //[aarch64] only-aarch64 #![deny(unused)] diff --git a/src/test/ui/asm/naked-functions-unused.x86_64.stderr b/src/test/ui/asm/naked-functions-unused.x86_64.stderr index cf4a1d9174e3..8d3c300e0586 100644 --- a/src/test/ui/asm/naked-functions-unused.x86_64.stderr +++ b/src/test/ui/asm/naked-functions-unused.x86_64.stderr @@ -1,66 +1,66 @@ error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:16:32 + --> $DIR/naked-functions-unused.rs:17:32 | LL | pub extern "C" fn function(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` | note: the lint level is defined here - --> $DIR/naked-functions-unused.rs:4:9 + --> $DIR/naked-functions-unused.rs:5:9 | LL | #![deny(unused)] | ^^^^^^ = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:16:42 + --> $DIR/naked-functions-unused.rs:17:42 | LL | pub extern "C" fn function(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:25:38 + --> $DIR/naked-functions-unused.rs:26:38 | LL | pub extern "C" fn associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:25:48 + --> $DIR/naked-functions-unused.rs:26:48 | LL | pub extern "C" fn associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:31:41 + --> $DIR/naked-functions-unused.rs:32:41 | LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:31:51 + --> $DIR/naked-functions-unused.rs:32:51 | LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:39:40 + --> $DIR/naked-functions-unused.rs:40:40 | LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:39:50 + --> $DIR/naked-functions-unused.rs:40:50 | LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:45:43 + --> $DIR/naked-functions-unused.rs:46:43 | LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:45:53 + --> $DIR/naked-functions-unused.rs:46:53 | LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` diff --git a/src/test/ui/asm/x86_64/const.rs b/src/test/ui/asm/x86_64/const.rs index aa4cdf99176c..d523ae021a5d 100644 --- a/src/test/ui/asm/x86_64/const.rs +++ b/src/test/ui/asm/x86_64/const.rs @@ -1,5 +1,6 @@ // only-x86_64 // run-pass +// needs-asm-support // revisions: mirunsafeck thirunsafeck // [thirunsafeck]compile-flags: -Z thir-unsafeck diff --git a/src/test/ui/asm/x86_64/issue-89875.rs b/src/test/ui/asm/x86_64/issue-89875.rs index e4b6687e00ba..669fd7e7e46e 100644 --- a/src/test/ui/asm/x86_64/issue-89875.rs +++ b/src/test/ui/asm/x86_64/issue-89875.rs @@ -1,4 +1,5 @@ // build-pass +// needs-asm-support // only-x86_64 #![feature(target_feature_11)] diff --git a/src/test/ui/asm/x86_64/sym.rs b/src/test/ui/asm/x86_64/sym.rs index fcb6c5fbfaf8..622365bc712a 100644 --- a/src/test/ui/asm/x86_64/sym.rs +++ b/src/test/ui/asm/x86_64/sym.rs @@ -1,6 +1,7 @@ // min-llvm-version: 12.0.1 // only-x86_64 // only-linux +// needs-asm-support // run-pass #![feature(thread_local, asm_sym)] diff --git a/src/test/ui/backtrace.rs b/src/test/ui/backtrace.rs index a7d17c43f051..c2d9e222b84a 100644 --- a/src/test/ui/backtrace.rs +++ b/src/test/ui/backtrace.rs @@ -88,28 +88,31 @@ fn runtest(me: &str) { assert!(!s.contains("stack backtrace") && !s.contains(" - foo"), "bad output3: {}", s); - // Make sure a stack trace is printed - let p = template(me).arg("double-fail").spawn().unwrap(); - let out = p.wait_with_output().unwrap(); - assert!(!out.status.success()); - let s = str::from_utf8(&out.stderr).unwrap(); - // loosened the following from double::h to double:: due to - // spurious failures on mac, 32bit, optimized - assert!(s.contains("stack backtrace") && contains_verbose_expected(s, "double"), - "bad output3: {}", s); + #[cfg(not(panic = "abort"))] + { + // Make sure a stack trace is printed + let p = template(me).arg("double-fail").spawn().unwrap(); + let out = p.wait_with_output().unwrap(); + assert!(!out.status.success()); + let s = str::from_utf8(&out.stderr).unwrap(); + // loosened the following from double::h to double:: due to + // spurious failures on mac, 32bit, optimized + assert!(s.contains("stack backtrace") && contains_verbose_expected(s, "double"), + "bad output3: {}", s); - // Make sure a stack trace isn't printed too many times - let p = template(me).arg("double-fail") - .env("RUST_BACKTRACE", "1").spawn().unwrap(); - let out = p.wait_with_output().unwrap(); - assert!(!out.status.success()); - let s = str::from_utf8(&out.stderr).unwrap(); - let mut i = 0; - for _ in 0..2 { - i += s[i + 10..].find("stack backtrace").unwrap() + 10; + // Make sure a stack trace isn't printed too many times + let p = template(me).arg("double-fail") + .env("RUST_BACKTRACE", "1").spawn().unwrap(); + let out = p.wait_with_output().unwrap(); + assert!(!out.status.success()); + let s = str::from_utf8(&out.stderr).unwrap(); + let mut i = 0; + for _ in 0..2 { + i += s[i + 10..].find("stack backtrace").unwrap() + 10; + } + assert!(s[i + 10..].find("stack backtrace").is_none(), + "bad output4: {}", s); } - assert!(s[i + 10..].find("stack backtrace").is_none(), - "bad output4: {}", s); } fn main() { diff --git a/src/test/ui/consts/refs_check_const_eq-issue-88384.stderr b/src/test/ui/consts/refs_check_const_eq-issue-88384.stderr index 55928b495b24..f2bad2f55275 100644 --- a/src/test/ui/consts/refs_check_const_eq-issue-88384.stderr +++ b/src/test/ui/consts/refs_check_const_eq-issue-88384.stderr @@ -5,7 +5,7 @@ LL | #![feature(adt_const_params)] | ^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information + = note: see issue #95174 for more information warning: 1 warning emitted diff --git a/src/test/ui/error-codes/E0771.stderr b/src/test/ui/error-codes/E0771.stderr index 730a7ef1284b..5a16d5845a60 100644 --- a/src/test/ui/error-codes/E0771.stderr +++ b/src/test/ui/error-codes/E0771.stderr @@ -5,7 +5,7 @@ LL | #![feature(adt_const_params)] | ^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information + = note: see issue #95174 for more information error[E0771]: use of non-static lifetime `'a` in const generic --> $DIR/E0771.rs:4:41 diff --git a/src/test/ui/issues/issue-28561.rs b/src/test/ui/issues/issue-28561.rs index 1241fb0b1f85..beb12c36dcaf 100644 --- a/src/test/ui/issues/issue-28561.rs +++ b/src/test/ui/issues/issue-28561.rs @@ -1,5 +1,5 @@ // check-pass -#[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] +#[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, Clone, Copy)] struct Array { f00: [T; 00], f01: [T; 01], @@ -36,44 +36,6 @@ struct Array { f32: [T; 32], } -// FIXME(#44580): merge with `Array` once `[T; N]: Clone` where `T: Clone` -#[derive(Clone, Copy)] -struct CopyArray { - f00: [T; 00], - f01: [T; 01], - f02: [T; 02], - f03: [T; 03], - f04: [T; 04], - f05: [T; 05], - f06: [T; 06], - f07: [T; 07], - f08: [T; 08], - f09: [T; 09], - f10: [T; 10], - f11: [T; 11], - f12: [T; 12], - f13: [T; 13], - f14: [T; 14], - f15: [T; 15], - f16: [T; 16], - f17: [T; 17], - f18: [T; 18], - f19: [T; 19], - f20: [T; 20], - f21: [T; 21], - f22: [T; 22], - f23: [T; 23], - f24: [T; 24], - f25: [T; 25], - f26: [T; 26], - f27: [T; 27], - f28: [T; 28], - f29: [T; 29], - f30: [T; 30], - f31: [T; 31], - f32: [T; 32], -} - #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] struct Fn { f00: fn(), diff --git a/src/test/ui/lifetimes/issue-95023.rs b/src/test/ui/lifetimes/issue-95023.rs new file mode 100644 index 000000000000..3fba8c00c572 --- /dev/null +++ b/src/test/ui/lifetimes/issue-95023.rs @@ -0,0 +1,11 @@ +struct ErrorKind; +struct Error(ErrorKind); +impl Fn(&isize) for Error { + //~^ ERROR manual implementations of `Fn` are experimental [E0183] + //~^^ ERROR associated type bindings are not allowed here [E0229] + fn foo(&self) -> Self::B<{N}>; + //~^ ERROR associated function in `impl` without body + //~^^ ERROR method `foo` is not a member of trait `Fn` [E0407] + //~^^^ ERROR associated type `B` not found for `Self` [E0220] +} +fn main() {} diff --git a/src/test/ui/lifetimes/issue-95023.stderr b/src/test/ui/lifetimes/issue-95023.stderr new file mode 100644 index 000000000000..35c3797c77a8 --- /dev/null +++ b/src/test/ui/lifetimes/issue-95023.stderr @@ -0,0 +1,38 @@ +error: associated function in `impl` without body + --> $DIR/issue-95023.rs:6:5 + | +LL | fn foo(&self) -> Self::B<{N}>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | help: provide a definition for the function: `{ }` + +error[E0407]: method `foo` is not a member of trait `Fn` + --> $DIR/issue-95023.rs:6:5 + | +LL | fn foo(&self) -> Self::B<{N}>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `Fn` + +error[E0183]: manual implementations of `Fn` are experimental + --> $DIR/issue-95023.rs:3:6 + | +LL | impl Fn(&isize) for Error { + | ^^^^^^^^^^ manual implementations of `Fn` are experimental + | + = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable + +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-95023.rs:3:6 + | +LL | impl Fn(&isize) for Error { + | ^^^^^^^^^^ associated type not allowed here + +error[E0220]: associated type `B` not found for `Self` + --> $DIR/issue-95023.rs:6:44 + | +LL | fn foo(&self) -> Self::B<{N}>; + | ^ associated type `B` not found + +error: aborting due to 5 previous errors + +Some errors have detailed explanations: E0183, E0220, E0229, E0407. +For more information about an error, try `rustc --explain E0183`. diff --git a/src/test/ui/numbers-arithmetic/issue-8460.rs b/src/test/ui/numbers-arithmetic/issue-8460.rs index a7de4bd74aae..77368b87e961 100644 --- a/src/test/ui/numbers-arithmetic/issue-8460.rs +++ b/src/test/ui/numbers-arithmetic/issue-8460.rs @@ -1,6 +1,7 @@ // run-pass #![allow(unused_must_use)] // ignore-emscripten no threads support +// needs-unwind #![feature(rustc_attrs)] use std::thread; diff --git a/src/test/ui/panic-while-printing.rs b/src/test/ui/panic-while-printing.rs index 96b35e45535a..098f54ac23f6 100644 --- a/src/test/ui/panic-while-printing.rs +++ b/src/test/ui/panic-while-printing.rs @@ -1,4 +1,5 @@ // run-pass +// needs-unwind // ignore-emscripten no subprocess support #![feature(internal_output_capture)] diff --git a/src/test/ui/process/multi-panic.rs b/src/test/ui/process/multi-panic.rs index 37e8b99c2f69..a1887c2180ec 100644 --- a/src/test/ui/process/multi-panic.rs +++ b/src/test/ui/process/multi-panic.rs @@ -1,6 +1,7 @@ // run-pass // ignore-emscripten no processes // ignore-sgx no processes +// needs-unwind fn check_for_no_backtrace(test: std::process::Output) { assert!(!test.status.success()); diff --git a/src/test/ui/test-attrs/test-panic-while-printing.rs b/src/test/ui/test-attrs/test-panic-while-printing.rs index 23f45407c1af..01e460da5ab5 100644 --- a/src/test/ui/test-attrs/test-panic-while-printing.rs +++ b/src/test/ui/test-attrs/test-panic-while-printing.rs @@ -1,5 +1,6 @@ // compile-flags:--test // run-pass +// needs-unwind // ignore-emscripten no subprocess support use std::fmt; diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 7b932b867f24..0e5e0c2616e5 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -7,7 +7,7 @@ use std::path::Path; const ENTRY_LIMIT: usize = 1000; // FIXME: The following limits should be reduced eventually. -const ROOT_ENTRY_LIMIT: usize = 984; +const ROOT_ENTRY_LIMIT: usize = 985; const ISSUES_ENTRY_LIMIT: usize = 2310; fn check_entries(path: &Path, bad: &mut bool) {