diff --git a/Cargo.lock b/Cargo.lock index d9f3e90d652e5..22bd53ced17c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4692,7 +4692,6 @@ dependencies = [ "rustc-demangle", "rustc_abi", "rustc_data_structures", - "rustc_errors", "rustc_hashes", "rustc_hir", "rustc_middle", diff --git a/compiler/rustc_ast_lowering/src/pat.rs b/compiler/rustc_ast_lowering/src/pat.rs index 40d42ffb5f4f9..25a1f2ae5a908 100644 --- a/compiler/rustc_ast_lowering/src/pat.rs +++ b/compiler/rustc_ast_lowering/src/pat.rs @@ -421,7 +421,11 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> { } _ => { let is_const_block = matches!(expr.kind, ExprKind::ConstBlock(_)); - let pattern_from_macro = expr.is_approximately_pattern(); + let pattern_from_macro = expr.is_approximately_pattern() + || matches!( + expr.peel_parens().kind, + ExprKind::Binary(Spanned { node: BinOpKind::BitOr, .. }, ..) + ); let guar = self.dcx().emit_err(ArbitraryExpressionInPattern { span, pattern_from_macro_note: pattern_from_macro, diff --git a/compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs b/compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs index 7c771a71bf638..e1b8b3b29bf00 100644 --- a/compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs +++ b/compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs @@ -1,9 +1,8 @@ -use rustc_hir::attrs::AttributeKind; +use rustc_hir::attrs::{AttributeKind, RustcDumpLayoutKind}; use rustc_hir::{MethodKind, Target}; use rustc_span::{Span, Symbol, sym}; -use crate::attributes::prelude::Allow; -use crate::attributes::{NoArgsAttributeParser, OnDuplicate}; +use super::prelude::*; use crate::context::Stage; use crate::target_checking::AllowedTargets; @@ -25,6 +24,39 @@ impl NoArgsAttributeParser for RustcDumpDefParentsParser { const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpDefParents; } +pub(crate) struct RustcDumpDefPathParser; + +impl SingleAttributeParser for RustcDumpDefPathParser { + const PATH: &[Symbol] = &[sym::rustc_dump_def_path]; + const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ + Allow(Target::Fn), + Allow(Target::Method(MethodKind::TraitImpl)), + Allow(Target::Method(MethodKind::Inherent)), + Allow(Target::Method(MethodKind::Trait { body: true })), + Allow(Target::ForeignFn), + Allow(Target::ForeignStatic), + Allow(Target::Impl { of_trait: false }), + ]); + const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; + const TEMPLATE: AttributeTemplate = template!(Word); + fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option { + if let Err(span) = args.no_args() { + cx.adcx().expected_no_args(span); + return None; + } + Some(AttributeKind::RustcDumpDefPath(cx.attr_span)) + } +} + +pub(crate) struct RustcDumpHiddenTypeOfOpaquesParser; + +impl NoArgsAttributeParser for RustcDumpHiddenTypeOfOpaquesParser { + const PATH: &[Symbol] = &[sym::rustc_dump_hidden_type_of_opaques]; + const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; + const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]); + const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpHiddenTypeOfOpaques; +} + pub(crate) struct RustcDumpInferredOutlivesParser; impl NoArgsAttributeParser for RustcDumpInferredOutlivesParser { @@ -48,6 +80,70 @@ impl NoArgsAttributeParser for RustcDumpItemBoundsParser { const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpItemBounds; } +pub(crate) struct RustcDumpLayoutParser; + +impl CombineAttributeParser for RustcDumpLayoutParser { + const PATH: &[Symbol] = &[sym::rustc_dump_layout]; + + type Item = RustcDumpLayoutKind; + + const CONVERT: ConvertFn = |items, _| AttributeKind::RustcDumpLayout(items); + + const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ + Allow(Target::Struct), + Allow(Target::Enum), + Allow(Target::Union), + Allow(Target::TyAlias), + ]); + + const TEMPLATE: AttributeTemplate = + template!(List: &["abi", "align", "size", "homogenous_aggregate", "debug"]); + fn extend( + cx: &mut AcceptContext<'_, '_, S>, + args: &ArgParser, + ) -> impl IntoIterator { + let ArgParser::List(items) = args else { + let attr_span = cx.attr_span; + cx.adcx().expected_list(attr_span, args); + return vec![]; + }; + + let mut result = Vec::new(); + for item in items.mixed() { + let Some(arg) = item.meta_item() else { + cx.adcx().expected_not_literal(item.span()); + continue; + }; + let Some(ident) = arg.ident() else { + cx.adcx().expected_identifier(arg.span()); + return vec![]; + }; + let kind = match ident.name { + sym::align => RustcDumpLayoutKind::Align, + sym::backend_repr => RustcDumpLayoutKind::BackendRepr, + sym::debug => RustcDumpLayoutKind::Debug, + sym::homogeneous_aggregate => RustcDumpLayoutKind::HomogenousAggregate, + sym::size => RustcDumpLayoutKind::Size, + _ => { + cx.adcx().expected_specific_argument( + ident.span, + &[ + sym::align, + sym::backend_repr, + sym::debug, + sym::homogeneous_aggregate, + sym::size, + ], + ); + continue; + } + }; + result.push(kind); + } + result + } +} + pub(crate) struct RustcDumpObjectLifetimeDefaultsParser; impl NoArgsAttributeParser for RustcDumpObjectLifetimeDefaultsParser { @@ -103,6 +199,30 @@ impl NoArgsAttributeParser for RustcDumpPredicatesParser { const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpPredicates; } +pub(crate) struct RustcDumpSymbolNameParser; + +impl SingleAttributeParser for RustcDumpSymbolNameParser { + const PATH: &[Symbol] = &[sym::rustc_dump_symbol_name]; + const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ + Allow(Target::Fn), + Allow(Target::Method(MethodKind::TraitImpl)), + Allow(Target::Method(MethodKind::Inherent)), + Allow(Target::Method(MethodKind::Trait { body: true })), + Allow(Target::ForeignFn), + Allow(Target::ForeignStatic), + Allow(Target::Impl { of_trait: false }), + ]); + const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; + const TEMPLATE: AttributeTemplate = template!(Word); + fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option { + if let Err(span) = args.no_args() { + cx.adcx().expected_no_args(span); + return None; + } + Some(AttributeKind::RustcDumpSymbolName(cx.attr_span)) + } +} + pub(crate) struct RustcDumpVariancesParser; impl NoArgsAttributeParser for RustcDumpVariancesParser { diff --git a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs index d77c804af697f..63a3773816756 100644 --- a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs +++ b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs @@ -4,8 +4,7 @@ use rustc_ast::{LitIntType, LitKind, MetaItemLit}; use rustc_hir::LangItem; use rustc_hir::attrs::{ BorrowckGraphvizFormatKind, CguFields, CguKind, DivergingBlockBehavior, - DivergingFallbackBehavior, RustcCleanAttribute, RustcCleanQueries, RustcLayoutType, - RustcMirKind, + DivergingFallbackBehavior, RustcCleanAttribute, RustcCleanQueries, RustcMirKind, }; use rustc_session::errors; use rustc_span::Symbol; @@ -681,14 +680,6 @@ impl NoArgsAttributeParser for PanicHandlerParser { const CREATE: fn(Span) -> AttributeKind = |span| AttributeKind::Lang(LangItem::PanicImpl, span); } -pub(crate) struct RustcHiddenTypeOfOpaquesParser; - -impl NoArgsAttributeParser for RustcHiddenTypeOfOpaquesParser { - const PATH: &[Symbol] = &[sym::rustc_hidden_type_of_opaques]; - const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; - const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]); - const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcHiddenTypeOfOpaques; -} pub(crate) struct RustcNounwindParser; impl NoArgsAttributeParser for RustcNounwindParser { @@ -713,64 +704,6 @@ impl NoArgsAttributeParser for RustcOffloadKernelParser { const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcOffloadKernel; } -pub(crate) struct RustcLayoutParser; - -impl CombineAttributeParser for RustcLayoutParser { - const PATH: &[Symbol] = &[sym::rustc_layout]; - - type Item = RustcLayoutType; - - const CONVERT: ConvertFn = |items, _| AttributeKind::RustcLayout(items); - - const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ - Allow(Target::Struct), - Allow(Target::Enum), - Allow(Target::Union), - Allow(Target::TyAlias), - ]); - - const TEMPLATE: AttributeTemplate = - template!(List: &["abi", "align", "size", "homogenous_aggregate", "debug"]); - fn extend( - cx: &mut AcceptContext<'_, '_, S>, - args: &ArgParser, - ) -> impl IntoIterator { - let ArgParser::List(items) = args else { - let attr_span = cx.attr_span; - cx.adcx().expected_list(attr_span, args); - return vec![]; - }; - - let mut result = Vec::new(); - for item in items.mixed() { - let Some(arg) = item.meta_item() else { - cx.adcx().expected_not_literal(item.span()); - continue; - }; - let Some(ident) = arg.ident() else { - cx.adcx().expected_identifier(arg.span()); - return vec![]; - }; - let ty = match ident.name { - sym::abi => RustcLayoutType::Abi, - sym::align => RustcLayoutType::Align, - sym::size => RustcLayoutType::Size, - sym::homogeneous_aggregate => RustcLayoutType::HomogenousAggregate, - sym::debug => RustcLayoutType::Debug, - _ => { - cx.adcx().expected_specific_argument( - ident.span, - &[sym::abi, sym::align, sym::size, sym::homogeneous_aggregate, sym::debug], - ); - continue; - } - }; - result.push(ty); - } - result - } -} - pub(crate) struct RustcMirParser; impl CombineAttributeParser for RustcMirParser { @@ -1210,54 +1143,6 @@ impl NoArgsAttributeParser for RustcNonnullOptimizationGuaranteedPa const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcNonnullOptimizationGuaranteed; } -pub(crate) struct RustcSymbolNameParser; - -impl SingleAttributeParser for RustcSymbolNameParser { - const PATH: &[Symbol] = &[sym::rustc_symbol_name]; - const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ - Allow(Target::Fn), - Allow(Target::Method(MethodKind::TraitImpl)), - Allow(Target::Method(MethodKind::Inherent)), - Allow(Target::Method(MethodKind::Trait { body: true })), - Allow(Target::ForeignFn), - Allow(Target::ForeignStatic), - Allow(Target::Impl { of_trait: false }), - ]); - const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; - const TEMPLATE: AttributeTemplate = template!(Word); - fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option { - if let Err(span) = args.no_args() { - cx.adcx().expected_no_args(span); - return None; - } - Some(AttributeKind::RustcSymbolName(cx.attr_span)) - } -} - -pub(crate) struct RustcDefPathParser; - -impl SingleAttributeParser for RustcDefPathParser { - const PATH: &[Symbol] = &[sym::rustc_def_path]; - const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ - Allow(Target::Fn), - Allow(Target::Method(MethodKind::TraitImpl)), - Allow(Target::Method(MethodKind::Inherent)), - Allow(Target::Method(MethodKind::Trait { body: true })), - Allow(Target::ForeignFn), - Allow(Target::ForeignStatic), - Allow(Target::Impl { of_trait: false }), - ]); - const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; - const TEMPLATE: AttributeTemplate = template!(Word); - fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option { - if let Err(span) = args.no_args() { - cx.adcx().expected_no_args(span); - return None; - } - Some(AttributeKind::RustcDefPath(cx.attr_span)) - } -} - pub(crate) struct RustcStrictCoherenceParser; impl NoArgsAttributeParser for RustcStrictCoherenceParser { @@ -1349,3 +1234,12 @@ impl NoArgsAttributeParser for RustcIntrinsicConstStableIndirectPar const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Fn)]); const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcIntrinsicConstStableIndirect; } + +pub(crate) struct RustcExhaustiveParser; + +impl NoArgsAttributeParser for RustcExhaustiveParser { + const PATH: &'static [Symbol] = &[sym::rustc_must_match_exhaustively]; + const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; + const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Enum)]); + const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcMustMatchExhaustively; +} diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs index 6ab3f98e2015c..ece59c2222a25 100644 --- a/compiler/rustc_attr_parsing/src/context.rs +++ b/compiler/rustc_attr_parsing/src/context.rs @@ -172,7 +172,7 @@ attribute_parsers!( Combine, Combine, Combine, - Combine, + Combine, Combine, Combine, Combine, @@ -211,11 +211,12 @@ attribute_parsers!( Single, Single, Single, - Single, Single, Single, Single, Single, + Single, + Single, Single, Single, Single, @@ -231,7 +232,6 @@ attribute_parsers!( Single, Single, Single, - Single, Single, Single, Single, @@ -285,6 +285,7 @@ attribute_parsers!( Single>, Single>, Single>, + Single>, Single>, Single>, Single>, @@ -297,8 +298,8 @@ attribute_parsers!( Single>, Single>, Single>, + Single>, Single>, - Single>, Single>, Single>, Single>, diff --git a/compiler/rustc_const_eval/src/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/check_consts/qualifs.rs index 1fbd0cd234057..a4f33ea05b2d3 100644 --- a/compiler/rustc_const_eval/src/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/check_consts/qualifs.rs @@ -103,13 +103,10 @@ impl Qualif for HasMutInterior { // FIXME(#132279): Once we've got a typing mode which reveals opaque types using the HIR // typeck results without causing query cycles, we should use this here instead of defining // opaque types. - let typing_env = ty::TypingEnv { - typing_mode: ty::TypingMode::analysis_in_body( - cx.tcx, - cx.body.source.def_id().expect_local(), - ), - param_env: cx.typing_env.param_env, - }; + let typing_env = ty::TypingEnv::new( + cx.typing_env.param_env, + ty::TypingMode::analysis_in_body(cx.tcx, cx.body.source.def_id().expect_local()), + ); let (infcx, param_env) = cx.tcx.infer_ctxt().build_with_typing_env(typing_env); let ocx = ObligationCtxt::new(&infcx); let obligation = Obligation::new( diff --git a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs index ccfdf571fb27c..316fc9ba5f97d 100644 --- a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs +++ b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs @@ -371,10 +371,20 @@ pub fn eval_to_allocation_raw_provider<'tcx>( // This shouldn't be used for statics, since statics are conceptually places, // not values -- so what we do here could break pointer identity. assert!(key.value.promoted.is_some() || !tcx.is_static(key.value.instance.def_id())); - // Const eval always happens in PostAnalysis mode . See the comment in - // `InterpCx::new` for more details. - debug_assert_eq!(key.typing_env.typing_mode, ty::TypingMode::PostAnalysis); + if cfg!(debug_assertions) { + match key.typing_env.typing_mode() { + ty::TypingMode::PostAnalysis => {} + ty::TypingMode::Coherence + | ty::TypingMode::Analysis { .. } + | ty::TypingMode::Borrowck { .. } + | ty::TypingMode::PostBorrowckAnalysis { .. } => { + bug!( + "Const eval should always happens in PostAnalysis mode. See the comment in `InterpCx::new` for more details." + ) + } + } + // Make sure we format the instance even if we do not print it. // This serves as a regression test against an ICE on printing. // The next two lines concatenated contain some discussion: diff --git a/compiler/rustc_const_eval/src/const_eval/valtrees.rs b/compiler/rustc_const_eval/src/const_eval/valtrees.rs index 4323debd80149..9e23f56d372b2 100644 --- a/compiler/rustc_const_eval/src/const_eval/valtrees.rs +++ b/compiler/rustc_const_eval/src/const_eval/valtrees.rs @@ -236,9 +236,19 @@ pub(crate) fn eval_to_valtree<'tcx>( typing_env: ty::TypingEnv<'tcx>, cid: GlobalId<'tcx>, ) -> EvalToValTreeResult<'tcx> { - // Const eval always happens in PostAnalysis mode . See the comment in - // `InterpCx::new` for more details. - debug_assert_eq!(typing_env.typing_mode, ty::TypingMode::PostAnalysis); + if cfg!(debug_assertions) { + match typing_env.typing_mode() { + ty::TypingMode::PostAnalysis => {} + ty::TypingMode::Coherence + | ty::TypingMode::Analysis { .. } + | ty::TypingMode::Borrowck { .. } + | ty::TypingMode::PostBorrowckAnalysis { .. } => { + bug!( + "Const eval should always happens in PostAnalysis mode. See the comment in `InterpCx::new` for more details." + ) + } + } + } let const_alloc = tcx.eval_to_allocation_raw(typing_env.as_query_input(cid))?; // FIXME Need to provide a span to `eval_to_valtree` diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs index 04f0e7099d840..466dcff359829 100644 --- a/compiler/rustc_const_eval/src/interpret/eval_context.rs +++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs @@ -1,5 +1,3 @@ -use std::debug_assert_matches; - use either::{Left, Right}; use rustc_abi::{Align, HasDataLayout, Size, TargetDataLayout}; use rustc_hir::def_id::DefId; @@ -11,9 +9,10 @@ use rustc_middle::ty::layout::{ LayoutOfHelpers, TyAndLayout, }; use rustc_middle::ty::{ - self, GenericArgsRef, Ty, TyCtxt, TypeFoldable, TypeVisitableExt, TypingEnv, Variance, + self, GenericArgsRef, Ty, TyCtxt, TypeFoldable, TypeVisitableExt, TypingEnv, TypingMode, + Variance, }; -use rustc_middle::{mir, span_bug}; +use rustc_middle::{bug, mir, span_bug}; use rustc_span::Span; use rustc_target::callconv::FnAbi; use tracing::{debug, trace}; @@ -243,7 +242,18 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { // opaque types. This is needed for trivial things like `size_of`, but also for using associated // types that are not specified in the opaque type. We also use MIR bodies whose opaque types have // already been revealed, so we'd be able to at least partially observe the hidden types anyways. - debug_assert_matches!(typing_env.typing_mode, ty::TypingMode::PostAnalysis); + if cfg!(debug_assertions) { + match typing_env.typing_mode() { + TypingMode::PostAnalysis => {} + TypingMode::Coherence + | TypingMode::Analysis { .. } + | TypingMode::Borrowck { .. } + | TypingMode::PostBorrowckAnalysis { .. } => { + bug!("Const eval should always happens in PostAnalysis mode."); + } + } + } + InterpCx { machine, tcx: tcx.at(root_span), diff --git a/compiler/rustc_errors/src/markdown/parse.rs b/compiler/rustc_errors/src/markdown/parse.rs index e1b1b32cd3ef9..6512d9ce19974 100644 --- a/compiler/rustc_errors/src/markdown/parse.rs +++ b/compiler/rustc_errors/src/markdown/parse.rs @@ -220,7 +220,7 @@ fn parse_codeblock(buf: &[u8]) -> Parsed<'_> { let mut found = None; for idx in (0..working.len()).filter(|idx| working[*idx..].starts_with(&end_pat)) { let (eol_txt, rest) = parse_to_newline(&working[(idx + end_pat.len())..]); - if !eol_txt.iter().any(u8::is_ascii_whitespace) { + if eol_txt.iter().all(u8::is_ascii_whitespace) { found = Some((&working[..idx], rest)); break; } diff --git a/compiler/rustc_errors/src/markdown/tests/parse.rs b/compiler/rustc_errors/src/markdown/tests/parse.rs index bfcb3de16fa0e..807fda3211799 100644 --- a/compiler/rustc_errors/src/markdown/tests/parse.rs +++ b/compiler/rustc_errors/src/markdown/tests/parse.rs @@ -364,3 +364,16 @@ fn test_snake_case() { let res = entrypoint(SNAKE_CASE); assert_eq!(res, expected); } + +#[test] +fn test_codeblock_trailing_whitespace() { + let buf = "```rust\ncode\n``` \nrest"; + let (t, r) = parse_codeblock(buf.as_bytes()); + assert_eq!(t, MdTree::CodeBlock { txt: "code", lang: Some("rust") }); + assert_eq!(r, b"\nrest"); + + let buf = "```rust\ncode\n```abc\nrest"; + let (t, r) = parse_codeblock(buf.as_bytes()); + assert_eq!(t, MdTree::CodeBlock { txt: "code\n```abc\nrest", lang: Some("rust") }); + assert_eq!(r, b""); +} diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs index d607a995e73b1..9f5a01452fdc3 100644 --- a/compiler/rustc_expand/src/expand.rs +++ b/compiler/rustc_expand/src/expand.rs @@ -815,6 +815,27 @@ impl<'a, 'b> MacroExpander<'a, 'b> { { rustc_parse::fake_token_stream_for_item(&self.cx.sess.psess, item_inner) } + Annotatable::Item(item_inner) if item_inner.tokens.is_none() => { + rustc_parse::fake_token_stream_for_item(&self.cx.sess.psess, item_inner) + } + // When a function has EII implementations attached (via `eii_impls`), + // use fake tokens so the pretty-printer re-emits the EII attribute + // (e.g. `#[hello]`) in the token stream. Without this, the EII + // attribute is lost during the token roundtrip performed by + // `AttrProcMacro` expanders like `contracts::requires/ensures`, + // breaking the EII link on the resulting re-parsed item. + Annotatable::Item(item_inner) + if matches!(&item_inner.kind, + ItemKind::Fn(f) if !f.eii_impls.is_empty()) => + { + rustc_parse::fake_token_stream_for_item(&self.cx.sess.psess, item_inner) + } + Annotatable::ForeignItem(item_inner) if item_inner.tokens.is_none() => { + rustc_parse::fake_token_stream_for_foreign_item( + &self.cx.sess.psess, + item_inner, + ) + } _ => item.to_tokens(), }; let attr_item = attr.get_normal_item(); diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index acbcba90fbcc0..4011f6ab2e4fa 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -1414,6 +1414,10 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ rustc_scalable_vector, Normal, template!(List: &["count"]), WarnFollowing, EncodeCrossCrate::Yes, "`#[rustc_scalable_vector]` defines a scalable vector type" ), + rustc_attr!( + rustc_must_match_exhaustively, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::Yes, + "enums with `#[rustc_must_match_exhaustively]` must be matched on with a match block that mentions all variants explicitly" + ), // ========================================================================== // Internal attributes, Testing: @@ -1449,11 +1453,11 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( - TEST, rustc_hidden_type_of_opaques, Normal, template!(Word), + TEST, rustc_dump_hidden_type_of_opaques, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( - TEST, rustc_layout, Normal, template!(List: &["field1, field2, ..."]), + TEST, rustc_dump_layout, Normal, template!(List: &["field1, field2, ..."]), WarnFollowing, EncodeCrossCrate::Yes ), rustc_attr!( @@ -1504,11 +1508,11 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ EncodeCrossCrate::No ), rustc_attr!( - TEST, rustc_symbol_name, Normal, template!(Word), + TEST, rustc_dump_symbol_name, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( - TEST, rustc_def_path, Normal, template!(Word), + TEST, rustc_dump_def_path, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No ), rustc_attr!( diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs index a18ddff947099..00f1c6c3863fe 100644 --- a/compiler/rustc_hir/src/attrs/data_structures.rs +++ b/compiler/rustc_hir/src/attrs/data_structures.rs @@ -757,12 +757,12 @@ impl IntoDiagArg for CrateType { } #[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] -pub enum RustcLayoutType { - Abi, +pub enum RustcDumpLayoutKind { Align, - Size, - HomogenousAggregate, + BackendRepr, Debug, + HomogenousAggregate, + Size, } #[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute, PartialEq, Eq)] @@ -1343,9 +1343,6 @@ pub enum AttributeKind { /// Represents `#[rustc_deallocator]` RustcDeallocator, - /// Represents `#[rustc_def_path]` - RustcDefPath(Span), - /// Represents `#[rustc_delayed_bug_from_inside_query]` RustcDelayedBugFromInsideQuery, @@ -1371,18 +1368,30 @@ pub enum AttributeKind { /// Represents `#[rustc_dump_def_parents]` RustcDumpDefParents, + /// Represents `#[rustc_dump_def_path]` + RustcDumpDefPath(Span), + + /// Represents `#[rustc_dump_hidden_type_of_opaques]` + RustcDumpHiddenTypeOfOpaques, + /// Represents `#[rustc_dump_inferred_outlives]` RustcDumpInferredOutlives, /// Represents `#[rustc_dump_item_bounds]` RustcDumpItemBounds, + /// Represents `#[rustc_dump_layout]` + RustcDumpLayout(ThinVec), + /// Represents `#[rustc_dump_object_lifetime_defaults]`. RustcDumpObjectLifetimeDefaults, /// Represents `#[rustc_dump_predicates]` RustcDumpPredicates, + /// Represents `#[rustc_dump_symbol_name]` + RustcDumpSymbolName(Span), + /// Represents `#[rustc_dump_user_args]` RustcDumpUserArgs, @@ -1409,9 +1418,6 @@ pub enum AttributeKind { RustcHasIncoherentInherentImpls, - /// Represents `#[rustc_hidden_type_of_opaques]` - RustcHiddenTypeOfOpaques, - /// Represents `#[rustc_if_this_changed]` RustcIfThisChanged(Span, Option), @@ -1427,9 +1433,6 @@ pub enum AttributeKind { /// Represents `#[rustc_intrinsic_const_stable_indirect]` RustcIntrinsicConstStableIndirect, - /// Represents `#[rustc_layout]` - RustcLayout(ThinVec), - /// Represents `#[rustc_layout_scalar_valid_range_end]`. RustcLayoutScalarValidRangeEnd(Box, Span), @@ -1471,6 +1474,9 @@ pub enum AttributeKind { fn_names: ThinVec, }, + /// Represents `#[rustc_must_match_exhaustively]` + RustcMustMatchExhaustively(Span), + /// Represents `#[rustc_never_returns_null_ptr]` RustcNeverReturnsNullPtr, @@ -1570,9 +1576,6 @@ pub enum AttributeKind { /// Represents `#[rustc_strict_coherence]`. RustcStrictCoherence(Span), - /// Represents `#[rustc_symbol_name]` - RustcSymbolName(Span), - /// Represents `#[rustc_test_marker]` RustcTestMarker(Symbol), diff --git a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs index c19fc6976c6e6..2740db1ef44d7 100644 --- a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs +++ b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs @@ -116,7 +116,6 @@ impl AttributeKind { RustcConstStableIndirect => No, RustcConversionSuggestion => Yes, RustcDeallocator => No, - RustcDefPath(..) => No, RustcDelayedBugFromInsideQuery => No, RustcDenyExplicitImpl(..) => No, RustcDeprecatedSafe2024 { .. } => Yes, @@ -125,10 +124,14 @@ impl AttributeKind { RustcDocPrimitive(..) => Yes, RustcDummy => No, RustcDumpDefParents => No, + RustcDumpDefPath(..) => No, + RustcDumpHiddenTypeOfOpaques => No, RustcDumpInferredOutlives => No, RustcDumpItemBounds => No, + RustcDumpLayout(..) => No, RustcDumpObjectLifetimeDefaults => No, RustcDumpPredicates => No, + RustcDumpSymbolName(..) => Yes, RustcDumpUserArgs => No, RustcDumpVariances => No, RustcDumpVariancesOfOpaques => No, @@ -138,13 +141,11 @@ impl AttributeKind { RustcEiiForeignItem => No, RustcEvaluateWhereClauses => Yes, RustcHasIncoherentInherentImpls => Yes, - RustcHiddenTypeOfOpaques => No, RustcIfThisChanged(..) => No, RustcInheritOverflowChecks => No, RustcInsignificantDtor => Yes, RustcIntrinsic => Yes, RustcIntrinsicConstStableIndirect => No, - RustcLayout(..) => No, RustcLayoutScalarValidRangeEnd(..) => Yes, RustcLayoutScalarValidRangeStart(..) => Yes, RustcLegacyConstGenerics { .. } => Yes, @@ -156,6 +157,7 @@ impl AttributeKind { RustcMain => No, RustcMir(..) => Yes, RustcMustImplementOneOf { .. } => No, + RustcMustMatchExhaustively(..) => Yes, RustcNeverReturnsNullPtr => Yes, RustcNeverTypeOptions { .. } => No, RustcNoImplicitAutorefs => Yes, @@ -183,7 +185,6 @@ impl AttributeKind { RustcSpecializationTrait(..) => No, RustcStdInternalSymbol(..) => No, RustcStrictCoherence(..) => Yes, - RustcSymbolName(..) => Yes, RustcTestMarker(..) => No, RustcThenThisWouldNeed(..) => No, RustcTrivialFieldReads => Yes, diff --git a/compiler/rustc_hir_analysis/src/collect/dump.rs b/compiler/rustc_hir_analysis/src/collect/dump.rs index 3e9c83b12df0a..f1bb90fcbe897 100644 --- a/compiler/rustc_hir_analysis/src/collect/dump.rs +++ b/compiler/rustc_hir_analysis/src/collect/dump.rs @@ -7,7 +7,7 @@ use rustc_middle::ty::{self, TyCtxt, TypeVisitableExt}; use rustc_span::sym; pub(crate) fn opaque_hidden_types(tcx: TyCtxt<'_>) { - if !find_attr!(tcx, crate, RustcHiddenTypeOfOpaques) { + if !find_attr!(tcx, crate, RustcDumpHiddenTypeOfOpaques) { return; } for id in tcx.hir_crate_items(()).opaques() { diff --git a/compiler/rustc_hir_analysis/src/delegation.rs b/compiler/rustc_hir_analysis/src/delegation.rs index 730288574e762..593284df38a3a 100644 --- a/compiler/rustc_hir_analysis/src/delegation.rs +++ b/compiler/rustc_hir_analysis/src/delegation.rs @@ -14,7 +14,7 @@ use rustc_middle::ty::{ use rustc_span::{ErrorGuaranteed, Span, kw}; use crate::collect::ItemCtxt; -use crate::hir_ty_lowering::{GenericArgPosition, HirTyLowerer}; +use crate::hir_ty_lowering::HirTyLowerer; type RemapTable = FxHashMap; @@ -581,14 +581,7 @@ fn get_delegation_user_specified_args<'tcx>( let self_ty = get_delegation_self_ty(tcx, delegation_id); lowerer - .lower_generic_args_of_path( - segment.ident.span, - def_id, - &[], - segment, - self_ty, - GenericArgPosition::Type, - ) + .lower_generic_args_of_path(segment.ident.span, def_id, &[], segment, self_ty) .0 .as_slice() }); @@ -610,14 +603,7 @@ fn get_delegation_user_specified_args<'tcx>( }; let args = lowerer - .lower_generic_args_of_path( - segment.ident.span, - def_id, - parent_args, - segment, - None, - GenericArgPosition::Value, - ) + .lower_generic_args_of_path(segment.ident.span, def_id, parent_args, segment, None) .0; &args[parent_args.len()..] diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs index 0ca57cb50cf25..596f538a9d3bb 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs @@ -385,17 +385,14 @@ pub fn lower_generic_args<'tcx: 'a, 'a>( /// Checks that the correct number of generic arguments have been provided. /// Used specifically for function calls. -pub fn check_generic_arg_count_for_call( +pub fn check_generic_arg_count_for_value_path( cx: &dyn HirTyLowerer<'_>, def_id: DefId, generics: &ty::Generics, seg: &hir::PathSegment<'_>, is_method_call: IsMethodCall, ) -> GenericArgCountResult { - let gen_pos = match is_method_call { - IsMethodCall::Yes => GenericArgPosition::MethodCall, - IsMethodCall::No => GenericArgPosition::Value, - }; + let gen_pos = GenericArgPosition::Value(is_method_call); check_generic_arg_count(cx, def_id, seg, generics, gen_pos, generics.has_own_self()) } @@ -649,7 +646,7 @@ pub(crate) fn prohibit_explicit_late_bound_lifetimes( let note = "the late bound lifetime parameter is introduced here"; let span = args.args[0].span(); - if position == GenericArgPosition::Value + if position == GenericArgPosition::Value(IsMethodCall::No) && args.num_lifetime_params() != param_counts.lifetimes { struct_span_code_err!(cx.dcx(), span, E0794, "{}", msg) diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs index d79f38e097fbd..37aad8ab10a31 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs @@ -318,7 +318,7 @@ pub enum ExplicitLateBound { No, } -#[derive(Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq)] pub enum IsMethodCall { Yes, No, @@ -329,8 +329,7 @@ pub enum IsMethodCall { #[derive(Debug, Copy, Clone, PartialEq)] pub(crate) enum GenericArgPosition { Type, - Value, // e.g., functions - MethodCall, + Value(IsMethodCall), } /// Whether to allow duplicate associated iten constraints in a trait ref, e.g. @@ -561,14 +560,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { def_id: DefId, item_segment: &hir::PathSegment<'tcx>, ) -> GenericArgsRef<'tcx> { - let (args, _) = self.lower_generic_args_of_path( - span, - def_id, - &[], - item_segment, - None, - GenericArgPosition::Type, - ); + let (args, _) = self.lower_generic_args_of_path(span, def_id, &[], item_segment, None); if let Some(c) = item_segment.args().constraints.first() { prohibit_assoc_item_constraint(self, c, Some((def_id, item_segment, span))); } @@ -617,7 +609,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { parent_args: &[ty::GenericArg<'tcx>], segment: &hir::PathSegment<'tcx>, self_ty: Option>, - pos: GenericArgPosition, ) -> (GenericArgsRef<'tcx>, GenericArgCountResult) { // If the type is parameterized by this region, then replace this // region with the current anon region binding (in other words, @@ -640,8 +631,14 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { assert!(self_ty.is_none()); } - let arg_count = - check_generic_arg_count(self, def_id, segment, generics, pos, self_ty.is_some()); + let arg_count = check_generic_arg_count( + self, + def_id, + segment, + generics, + GenericArgPosition::Type, + self_ty.is_some(), + ); // Skip processing if type has no generic parameters. // Traits always have `Self` as a generic parameter, which means they will not return early @@ -826,14 +823,8 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { item_segment: &hir::PathSegment<'tcx>, parent_args: GenericArgsRef<'tcx>, ) -> GenericArgsRef<'tcx> { - let (args, _) = self.lower_generic_args_of_path( - span, - item_def_id, - parent_args, - item_segment, - None, - GenericArgPosition::Type, - ); + let (args, _) = + self.lower_generic_args_of_path(span, item_def_id, parent_args, item_segment, None); if let Some(c) = item_segment.args().constraints.first() { prohibit_assoc_item_constraint(self, c, Some((item_def_id, item_segment, span))); } @@ -945,7 +936,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { &[], segment, Some(self_ty), - GenericArgPosition::Type, ); let constraints = segment.args().constraints; @@ -1121,14 +1111,8 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { ) -> ty::TraitRef<'tcx> { self.report_internal_fn_trait(span, trait_def_id, trait_segment, is_impl); - let (generic_args, _) = self.lower_generic_args_of_path( - span, - trait_def_id, - &[], - trait_segment, - Some(self_ty), - GenericArgPosition::Type, - ); + let (generic_args, _) = + self.lower_generic_args_of_path(span, trait_def_id, &[], trait_segment, Some(self_ty)); if let Some(c) = trait_segment.args().constraints.first() { prohibit_assoc_item_constraint(self, c, Some((trait_def_id, trait_segment, span))); } diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs index 6b8dcf1258d45..d3dcb65e71ee2 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs @@ -13,7 +13,7 @@ use rustc_hir::lang_items::LangItem; use rustc_hir::{self as hir, AmbigArg, ExprKind, GenericArg, HirId, Node, QPath, intravisit}; use rustc_hir_analysis::hir_ty_lowering::errors::GenericsArgsErrExtend; use rustc_hir_analysis::hir_ty_lowering::generics::{ - check_generic_arg_count_for_call, lower_generic_args, + check_generic_arg_count_for_value_path, lower_generic_args, }; use rustc_hir_analysis::hir_ty_lowering::{ ExplicitLateBound, GenericArgCountMismatch, GenericArgCountResult, GenericArgsLowerer, @@ -1098,8 +1098,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // parameter internally, but we don't allow users to specify the // parameter's value explicitly, so we have to do some error- // checking here. - let arg_count = - check_generic_arg_count_for_call(self, def_id, generics, seg, IsMethodCall::No); + let arg_count = check_generic_arg_count_for_value_path( + self, + def_id, + generics, + seg, + IsMethodCall::No, + ); if let ExplicitLateBound::Yes = arg_count.explicit_late_bound { explicit_late_bound = ExplicitLateBound::Yes; diff --git a/compiler/rustc_hir_typeck/src/method/confirm.rs b/compiler/rustc_hir_typeck/src/method/confirm.rs index ed75609eaecdc..6f8335f0cc82e 100644 --- a/compiler/rustc_hir_typeck/src/method/confirm.rs +++ b/compiler/rustc_hir_typeck/src/method/confirm.rs @@ -5,7 +5,7 @@ use rustc_hir as hir; use rustc_hir::GenericArg; use rustc_hir::def_id::DefId; use rustc_hir_analysis::hir_ty_lowering::generics::{ - check_generic_arg_count_for_call, lower_generic_args, + check_generic_arg_count_for_value_path, lower_generic_args, }; use rustc_hir_analysis::hir_ty_lowering::{ GenericArgsLowerer, HirTyLowerer, IsMethodCall, RegionInferReason, @@ -403,7 +403,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> { // variables. let generics = self.tcx.generics_of(pick.item.def_id); - let arg_count_correct = check_generic_arg_count_for_call( + let arg_count_correct = check_generic_arg_count_for_value_path( self.fcx, pick.item.def_id, generics, diff --git a/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs b/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs index 87d389a5dea5a..c889381586753 100644 --- a/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs +++ b/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs @@ -13,6 +13,7 @@ use rustc_middle::ty::{ self, BoundVar, GenericArg, InferConst, List, Ty, TyCtxt, TypeFlags, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt, }; +use rustc_type_ir::TypingModeEqWrapper; use smallvec::SmallVec; use tracing::debug; @@ -72,7 +73,7 @@ impl<'tcx> InferCtxt<'tcx> { query_state, ) .unchecked_map(|(param_env, value)| param_env.and(value)); - CanonicalQueryInput { canonical, typing_mode: self.typing_mode() } + CanonicalQueryInput { canonical, typing_mode: TypingModeEqWrapper(self.typing_mode()) } } /// Canonicalizes a query *response* `V`. When we canonicalize a diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 583eb1a6dbc4a..a38d4e819e298 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -564,16 +564,16 @@ impl<'tcx> InferCtxtBuilder<'tcx> { where T: TypeFoldable>, { - let infcx = self.build(input.typing_mode); + let infcx = self.build(input.typing_mode.0); let (value, args) = infcx.instantiate_canonical(span, &input.canonical); (infcx, value, args) } pub fn build_with_typing_env( mut self, - TypingEnv { typing_mode, param_env }: TypingEnv<'tcx>, + typing_env: TypingEnv<'tcx>, ) -> (InferCtxt<'tcx>, ty::ParamEnv<'tcx>) { - (self.build(typing_mode), param_env) + (self.build(typing_env.typing_mode()), typing_env.param_env) } pub fn build(&mut self, typing_mode: TypingMode<'tcx>) -> InferCtxt<'tcx> { @@ -1376,7 +1376,7 @@ impl<'tcx> InferCtxt<'tcx> { | ty::TypingMode::PostBorrowckAnalysis { .. } | ty::TypingMode::PostAnalysis) => mode, }; - ty::TypingEnv { typing_mode, param_env } + ty::TypingEnv::new(param_env, typing_mode) } /// Similar to [`Self::canonicalize_query`], except that it returns diff --git a/compiler/rustc_infer/src/infer/opaque_types/mod.rs b/compiler/rustc_infer/src/infer/opaque_types/mod.rs index 29cbbe5a1c9ed..0c447f7c69973 100644 --- a/compiler/rustc_infer/src/infer/opaque_types/mod.rs +++ b/compiler/rustc_infer/src/infer/opaque_types/mod.rs @@ -89,7 +89,7 @@ impl<'tcx> InferCtxt<'tcx> { if def_id.is_local() => { let def_id = def_id.expect_local(); - if let ty::TypingMode::Coherence = self.typing_mode() { + if self.typing_mode().is_coherence() { // See comment on `insert_hidden_type` for why this is sufficient in coherence return Some(self.register_hidden_type( OpaqueTypeKey { def_id, args }, diff --git a/compiler/rustc_infer/src/infer/relate/generalize.rs b/compiler/rustc_infer/src/infer/relate/generalize.rs index ffc04eabcec16..0229af53f2a67 100644 --- a/compiler/rustc_infer/src/infer/relate/generalize.rs +++ b/compiler/rustc_infer/src/infer/relate/generalize.rs @@ -7,7 +7,7 @@ use rustc_middle::bug; use rustc_middle::ty::error::TypeError; use rustc_middle::ty::{ self, AliasRelationDirection, InferConst, Term, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, - TypeVisitableExt, TypeVisitor, TypingMode, + TypeVisitableExt, TypeVisitor, }; use rustc_span::Span; use tracing::{debug, instrument, warn}; @@ -603,7 +603,7 @@ impl<'tcx> TypeRelation> for Generalizer<'_, 'tcx> { // // cc trait-system-refactor-initiative#108 if self.infcx.next_trait_solver() - && !matches!(self.infcx.typing_mode(), TypingMode::Coherence) + && !self.infcx.typing_mode().is_coherence() && self.in_alias { inner.type_variables().equate(vid, new_var_id); @@ -735,7 +735,7 @@ impl<'tcx> TypeRelation> for Generalizer<'_, 'tcx> { // See the comment for type inference variables // for more details. if self.infcx.next_trait_solver() - && !matches!(self.infcx.typing_mode(), TypingMode::Coherence) + && !self.infcx.typing_mode().is_coherence() && self.in_alias { variable_table.union(vid, new_var_id); diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index eadb099a3e1a2..20c8a245971bc 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -1273,7 +1273,7 @@ pub(crate) fn start_codegen<'tcx>( // Don't run this test assertions when not doing codegen. Compiletest tries to build // build-fail tests in check mode first and expects it to not give an error in that case. if tcx.sess.opts.output_types.should_codegen() { - rustc_symbol_mangling::test::report_symbol_names(tcx); + rustc_symbol_mangling::test::dump_symbol_names_and_def_paths(tcx); } // Don't do code generation if there were any errors. Likewise if diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs index 752c2220d4147..acfa3ec343975 100644 --- a/compiler/rustc_lint/src/context.rs +++ b/compiler/rustc_lint/src/context.rs @@ -637,7 +637,7 @@ impl<'tcx> LateContext<'tcx> { } pub fn typing_env(&self) -> TypingEnv<'tcx> { - TypingEnv { typing_mode: self.typing_mode(), param_env: self.param_env } + TypingEnv::new(self.param_env, self.typing_mode()) } pub fn type_is_copy_modulo_regions(&self, ty: Ty<'tcx>) -> bool { diff --git a/compiler/rustc_lint/src/internal.rs b/compiler/rustc_lint/src/internal.rs index 357aa94feb1ed..c0b113610f67a 100644 --- a/compiler/rustc_lint/src/internal.rs +++ b/compiler/rustc_lint/src/internal.rs @@ -15,8 +15,9 @@ use rustc_span::{Span, sym}; use crate::lints::{ AttributeKindInFindAttr, BadOptAccessDiag, DefaultHashTypesDiag, ImplicitSysrootCrateImportDiag, LintPassByHand, NonGlobImportTypeIrInherent, QueryInstability, - QueryUntracked, SpanUseEqCtxtDiag, SymbolInternStringLiteralDiag, TyQualified, TykindDiag, - TykindKind, TypeIrDirectUse, TypeIrInherentUsage, TypeIrTraitUsage, + QueryUntracked, RustcMustMatchExhaustivelyNotExhaustive, SpanUseEqCtxtDiag, + SymbolInternStringLiteralDiag, TyQualified, TykindDiag, TykindKind, TypeIrDirectUse, + TypeIrInherentUsage, TypeIrTraitUsage, }; use crate::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext}; @@ -713,3 +714,89 @@ impl EarlyLintPass for BadUseOfFindAttr { } } } + +declare_tool_lint! { + pub rustc::RUSTC_MUST_MATCH_EXHAUSTIVELY, + Allow, + "Forbids matches with wildcards, or if-let matching on enums marked with `#[rustc_must_match_exhaustively]`", + report_in_external_macro: true +} +declare_lint_pass!(RustcMustMatchExhaustively => [RUSTC_MUST_MATCH_EXHAUSTIVELY]); + +fn is_rustc_must_match_exhaustively(cx: &LateContext<'_>, id: HirId) -> Option { + let res = cx.typeck_results(); + + let ty = res.node_type(id); + + let ty = if let ty::Ref(_, ty, _) = ty.kind() { *ty } else { ty }; + + if let Some(adt_def) = ty.ty_adt_def() + && adt_def.is_enum() + { + find_attr!(cx.tcx, adt_def.did(), RustcMustMatchExhaustively(span) => *span) + } else { + None + } +} + +fn pat_is_not_exhaustive_heuristic(pat: &hir::Pat<'_>) -> Option<(Span, &'static str)> { + match pat.kind { + hir::PatKind::Missing => None, + hir::PatKind::Wild => Some((pat.span, "because of this wildcard pattern")), + hir::PatKind::Binding(_, _, _, Some(pat)) => pat_is_not_exhaustive_heuristic(pat), + hir::PatKind::Binding(..) => Some((pat.span, "because of this variable binding")), + hir::PatKind::Struct(..) => None, + hir::PatKind::TupleStruct(..) => None, + hir::PatKind::Or(..) => None, + hir::PatKind::Never => None, + hir::PatKind::Tuple(..) => None, + hir::PatKind::Box(pat) => pat_is_not_exhaustive_heuristic(&*pat), + hir::PatKind::Deref(pat) => pat_is_not_exhaustive_heuristic(&*pat), + hir::PatKind::Ref(pat, _, _) => pat_is_not_exhaustive_heuristic(&*pat), + hir::PatKind::Expr(..) => None, + hir::PatKind::Guard(..) => None, + hir::PatKind::Range(..) => None, + hir::PatKind::Slice(..) => None, + hir::PatKind::Err(..) => None, + } +} + +impl<'tcx> LateLintPass<'tcx> for RustcMustMatchExhaustively { + fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &hir::Expr<'_>) { + match expr.kind { + // This is not perfect exhaustiveness checking, that's why this is just a rustc internal + // attribute. But it catches most reasonable cases + hir::ExprKind::Match(expr, arms, _) => { + if let Some(attr_span) = is_rustc_must_match_exhaustively(cx, expr.hir_id) { + for arm in arms { + if let Some((span, message)) = pat_is_not_exhaustive_heuristic(arm.pat) { + cx.emit_span_lint( + RUSTC_MUST_MATCH_EXHAUSTIVELY, + expr.span, + RustcMustMatchExhaustivelyNotExhaustive { + attr_span, + pat_span: span, + message, + }, + ); + } + } + } + } + hir::ExprKind::If(expr, ..) if let ExprKind::Let(expr) = expr.kind => { + if let Some(attr_span) = is_rustc_must_match_exhaustively(cx, expr.init.hir_id) { + cx.emit_span_lint( + RUSTC_MUST_MATCH_EXHAUSTIVELY, + expr.span, + RustcMustMatchExhaustivelyNotExhaustive { + attr_span, + pat_span: expr.span, + message: "using if let only matches on one variant (try using `match`)", + }, + ); + } + } + _ => {} + } + } +} diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index 30b1e736ef3b1..9fa5501433453 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -668,6 +668,8 @@ fn register_internals(store: &mut LintStore) { store.register_early_pass(|| Box::new(ImplicitSysrootCrateImport)); store.register_lints(&BadUseOfFindAttr::lint_vec()); store.register_early_pass(|| Box::new(BadUseOfFindAttr)); + store.register_lints(&RustcMustMatchExhaustively::lint_vec()); + store.register_late_pass(|_| Box::new(RustcMustMatchExhaustively)); store.register_group( false, "rustc::internal", @@ -688,6 +690,7 @@ fn register_internals(store: &mut LintStore) { LintId::of(DIRECT_USE_OF_RUSTC_TYPE_IR), LintId::of(IMPLICIT_SYSROOT_CRATE_IMPORT), LintId::of(BAD_USE_OF_FIND_ATTR), + LintId::of(RUSTC_MUST_MATCH_EXHAUSTIVELY), ], ); } diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 4279ab230df55..bfc3d3989e10b 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -1162,6 +1162,18 @@ pub(crate) struct ImplicitSysrootCrateImportDiag<'a> { #[help("remove `AttributeKind`")] pub(crate) struct AttributeKindInFindAttr; +#[derive(Diagnostic)] +#[diag("match is not exhaustive")] +#[help("explicitly list all variants of the enum in a `match`")] +pub(crate) struct RustcMustMatchExhaustivelyNotExhaustive { + #[label("required because of this attribute")] + pub attr_span: Span, + + #[note("{$message}")] + pub pat_span: Span, + pub message: &'static str, +} + // let_underscore.rs #[derive(Diagnostic)] pub(crate) enum NonBindingLet { diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 1c14b94b8d7d3..36752bba9f722 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -415,10 +415,10 @@ impl<'tcx> Body<'tcx> { pub fn typing_env(&self, tcx: TyCtxt<'tcx>) -> TypingEnv<'tcx> { match self.phase { // FIXME(#132279): we should reveal the opaques defined in the body during analysis. - MirPhase::Built | MirPhase::Analysis(_) => TypingEnv { - typing_mode: ty::TypingMode::non_body_analysis(), - param_env: tcx.param_env(self.source.def_id()), - }, + MirPhase::Built | MirPhase::Analysis(_) => TypingEnv::new( + tcx.param_env(self.source.def_id()), + ty::TypingMode::non_body_analysis(), + ), MirPhase::Runtime(_) => TypingEnv::post_analysis(tcx, self.source.def_id()), } } diff --git a/compiler/rustc_middle/src/query/plumbing.rs b/compiler/rustc_middle/src/query/plumbing.rs index b0c6a8a508ccd..87fea2fc6aa94 100644 --- a/compiler/rustc_middle/src/query/plumbing.rs +++ b/compiler/rustc_middle/src/query/plumbing.rs @@ -99,12 +99,11 @@ pub struct QueryVTable<'tcx, C: QueryCache> { pub will_cache_on_disk_for_key_fn: fn(key: C::Key) -> bool, - pub try_load_from_disk_fn: fn( - tcx: TyCtxt<'tcx>, - key: C::Key, - prev_index: SerializedDepNodeIndex, - index: DepNodeIndex, - ) -> Option, + /// Function pointer that tries to load a query value from disk. + /// + /// This should only be called after a successful check of `will_cache_on_disk_for_key_fn`. + pub try_load_from_disk_fn: + fn(tcx: TyCtxt<'tcx>, prev_index: SerializedDepNodeIndex) -> Option, /// Function pointer that hashes this query's result values. /// diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index dbf7d643a42ce..bc971d7a43705 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -105,7 +105,8 @@ pub use self::sty::{ AliasTy, AliasTyKind, Article, Binder, BoundConst, BoundRegion, BoundRegionKind, BoundTy, BoundTyKind, BoundVariableKind, CanonicalPolyFnSig, CoroutineArgsExt, EarlyBinder, FnSig, InlineConstArgs, InlineConstArgsParts, ParamConst, ParamTy, PlaceholderConst, - PlaceholderRegion, PlaceholderType, PolyFnSig, TyKind, TypeAndMut, TypingMode, UpvarArgs, + PlaceholderRegion, PlaceholderType, PolyFnSig, TyKind, TypeAndMut, TypingMode, + TypingModeEqWrapper, UpvarArgs, }; pub use self::trait_def::TraitDef; pub use self::typeck_results::{ @@ -980,11 +981,19 @@ pub struct ParamEnvAnd<'tcx, T> { pub struct TypingEnv<'tcx> { #[type_foldable(identity)] #[type_visitable(ignore)] - pub typing_mode: TypingMode<'tcx>, + typing_mode: TypingModeEqWrapper<'tcx>, pub param_env: ParamEnv<'tcx>, } impl<'tcx> TypingEnv<'tcx> { + pub fn new(param_env: ParamEnv<'tcx>, typing_mode: TypingMode<'tcx>) -> Self { + Self { typing_mode: TypingModeEqWrapper(typing_mode), param_env } + } + + pub fn typing_mode(&self) -> TypingMode<'tcx> { + self.typing_mode.0 + } + /// Create a typing environment with no where-clauses in scope /// where all opaque types and default associated items are revealed. /// @@ -993,7 +1002,7 @@ impl<'tcx> TypingEnv<'tcx> { /// use `TypingMode::PostAnalysis`, they may still have where-clauses /// in scope. pub fn fully_monomorphized() -> TypingEnv<'tcx> { - TypingEnv { typing_mode: TypingMode::PostAnalysis, param_env: ParamEnv::empty() } + Self::new(ParamEnv::empty(), TypingMode::PostAnalysis) } /// Create a typing environment for use during analysis outside of a body. @@ -1006,7 +1015,7 @@ impl<'tcx> TypingEnv<'tcx> { def_id: impl IntoQueryKey, ) -> TypingEnv<'tcx> { let def_id = def_id.into_query_key(); - TypingEnv { typing_mode: TypingMode::non_body_analysis(), param_env: tcx.param_env(def_id) } + Self::new(tcx.param_env(def_id), TypingMode::non_body_analysis()) } pub fn post_analysis(tcx: TyCtxt<'tcx>, def_id: impl IntoQueryKey) -> TypingEnv<'tcx> { @@ -1018,8 +1027,12 @@ impl<'tcx> TypingEnv<'tcx> { /// opaque types in the `param_env`. pub fn with_post_analysis_normalized(self, tcx: TyCtxt<'tcx>) -> TypingEnv<'tcx> { let TypingEnv { typing_mode, param_env } = self; - if let TypingMode::PostAnalysis = typing_mode { - return self; + match typing_mode.0 { + TypingMode::Coherence + | TypingMode::Analysis { .. } + | TypingMode::Borrowck { .. } + | TypingMode::PostBorrowckAnalysis { .. } => {} + TypingMode::PostAnalysis => return self, } // No need to reveal opaques with the new solver enabled, @@ -1029,7 +1042,7 @@ impl<'tcx> TypingEnv<'tcx> { } else { ParamEnv::new(tcx.reveal_opaque_types_in_bounds(param_env.caller_bounds())) }; - TypingEnv { typing_mode: TypingMode::PostAnalysis, param_env } + TypingEnv { typing_mode: TypingModeEqWrapper(TypingMode::PostAnalysis), param_env } } /// Combine this typing environment with the given `value` to be used by diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 08bfe15137a24..9164f7b57e648 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -40,6 +40,7 @@ pub type FnSig<'tcx> = ir::FnSig>; pub type Binder<'tcx, T> = ir::Binder, T>; pub type EarlyBinder<'tcx, T> = ir::EarlyBinder, T>; pub type TypingMode<'tcx> = ir::TypingMode>; +pub type TypingModeEqWrapper<'tcx> = ir::TypingModeEqWrapper>; pub type Placeholder<'tcx, T> = ir::Placeholder, T>; pub type PlaceholderRegion<'tcx> = ir::PlaceholderRegion>; pub type PlaceholderType<'tcx> = ir::PlaceholderType>; diff --git a/compiler/rustc_mir_transform/src/elaborate_drop.rs b/compiler/rustc_mir_transform/src/elaborate_drop.rs index 1fe745a5d5197..3da9d6aac9be9 100644 --- a/compiler/rustc_mir_transform/src/elaborate_drop.rs +++ b/compiler/rustc_mir_transform/src/elaborate_drop.rs @@ -548,7 +548,16 @@ where let subpath = self.elaborator.field_subpath(variant_path, field_idx); let tcx = self.tcx(); - assert_eq!(self.elaborator.typing_env().typing_mode, ty::TypingMode::PostAnalysis); + match self.elaborator.typing_env().typing_mode() { + ty::TypingMode::PostAnalysis => {} + ty::TypingMode::Coherence + | ty::TypingMode::Analysis { .. } + | ty::TypingMode::Borrowck { .. } + | ty::TypingMode::PostBorrowckAnalysis { .. } => { + bug!() + } + } + let field_ty = field.ty(tcx, args); // We silently leave an unnormalized type here to support polymorphic drop // elaboration for users of rustc internal APIs diff --git a/compiler/rustc_next_trait_solver/src/canonical/mod.rs b/compiler/rustc_next_trait_solver/src/canonical/mod.rs index 1f64f09fe787f..7fdbfa023af4b 100644 --- a/compiler/rustc_next_trait_solver/src/canonical/mod.rs +++ b/compiler/rustc_next_trait_solver/src/canonical/mod.rs @@ -17,7 +17,7 @@ use rustc_type_ir::inherent::*; use rustc_type_ir::relate::solver_relating::RelateExt; use rustc_type_ir::{ self as ty, Canonical, CanonicalVarKind, CanonicalVarValues, InferCtxtLike, Interner, - TypeFoldable, + TypeFoldable, TypingModeEqWrapper, }; use tracing::instrument; @@ -66,7 +66,10 @@ where predefined_opaques_in_body: delegate.cx().mk_predefined_opaques_in_body(opaque_types), }, ); - let query_input = ty::CanonicalQueryInput { canonical, typing_mode: delegate.typing_mode() }; + let query_input = ty::CanonicalQueryInput { + canonical, + typing_mode: TypingModeEqWrapper(delegate.typing_mode()), + }; (orig_values, query_input) } diff --git a/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs b/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs index a4f331d3fe718..8d855be720252 100644 --- a/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs @@ -466,15 +466,20 @@ where // as we may want to weaken inference guidance in the future and don't want // to worry about causing major performance regressions when doing so. // See trait-system-refactor-initiative#226 for some ideas here. - if TypingMode::Coherence == self.typing_mode() - || !candidates.iter().any(|c| { + let assemble_impls = match self.typing_mode() { + TypingMode::Coherence => true, + TypingMode::Analysis { .. } + | TypingMode::Borrowck { .. } + | TypingMode::PostBorrowckAnalysis { .. } + | TypingMode::PostAnalysis => !candidates.iter().any(|c| { matches!( c.source, CandidateSource::ParamEnv(ParamEnvSource::NonGlobal) | CandidateSource::AliasBound(_) ) && has_no_inference_or_external_constraints(c.result) - }) - { + }), + }; + if assemble_impls { self.assemble_impl_candidates(goal, &mut candidates); self.assemble_object_bound_candidates(goal, &mut candidates); } diff --git a/compiler/rustc_next_trait_solver/src/solve/normalizes_to/opaque_types.rs b/compiler/rustc_next_trait_solver/src/solve/normalizes_to/opaque_types.rs index a5f857a1dd85b..9b2bd7cb74ff0 100644 --- a/compiler/rustc_next_trait_solver/src/solve/normalizes_to/opaque_types.rs +++ b/compiler/rustc_next_trait_solver/src/solve/normalizes_to/opaque_types.rs @@ -93,7 +93,9 @@ where }); self.eq(goal.param_env, expected, actual)?; } - _ => unreachable!(), + TypingMode::Coherence + | TypingMode::PostBorrowckAnalysis { .. } + | TypingMode::PostAnalysis => unreachable!(), } } diff --git a/compiler/rustc_next_trait_solver/src/solve/search_graph.rs b/compiler/rustc_next_trait_solver/src/solve/search_graph.rs index 73044b7943aeb..0490b285aedf0 100644 --- a/compiler/rustc_next_trait_solver/src/solve/search_graph.rs +++ b/compiler/rustc_next_trait_solver/src/solve/search_graph.rs @@ -62,7 +62,7 @@ where // See `tests/ui/traits/next-solver/cycles/unproductive-in-coherence.rs` for an // example where this would matter. We likely should change these cycles to `NoSolution` // even in coherence once this is a bit more settled. - PathKind::Inductive => match input.typing_mode { + PathKind::Inductive => match input.typing_mode.0 { TypingMode::Coherence => { response_no_constraints(cx, input, Certainty::overflow(false)) } diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs index 44a570fc4fa79..33c165fbea6c4 100644 --- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs @@ -1421,7 +1421,7 @@ where mut candidates: Vec>, failed_candidate_info: FailedCandidateInfo, ) -> Result<(CanonicalResponse, Option), NoSolution> { - if let TypingMode::Coherence = self.typing_mode() { + if self.typing_mode().is_coherence() { return if let Some((response, _)) = self.try_merge_candidates(&candidates) { Ok((response, Some(TraitGoalProvenVia::Misc))) } else { diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs index 6b8d6baac9458..4bfa899352393 100644 --- a/compiler/rustc_parse/src/lib.rs +++ b/compiler/rustc_parse/src/lib.rs @@ -257,6 +257,15 @@ pub fn fake_token_stream_for_item(psess: &ParseSess, item: &ast::Item) -> TokenS unwrap_or_emit_fatal(source_str_to_stream(psess, filename, source, Some(item.span))) } +pub fn fake_token_stream_for_foreign_item( + psess: &ParseSess, + item: &ast::ForeignItem, +) -> TokenStream { + let source = pprust::foreign_item_to_string(item); + let filename = FileName::macro_expansion_source_code(&source); + unwrap_or_emit_fatal(source_str_to_stream(psess, filename, source, Some(item.span))) +} + pub fn fake_token_stream_for_crate(psess: &ParseSess, krate: &ast::Crate) -> TokenStream { let source = pprust::crate_to_string_for_macros(krate); let filename = FileName::macro_expansion_source_code(&source); diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 6aeb0ae57e752..f0a7a341cdec5 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -302,7 +302,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> { | AttributeKind::RustcConstStableIndirect | AttributeKind::RustcConversionSuggestion | AttributeKind::RustcDeallocator - | AttributeKind::RustcDefPath(..) | AttributeKind::RustcDelayedBugFromInsideQuery | AttributeKind::RustcDenyExplicitImpl(..) | AttributeKind::RustcDeprecatedSafe2024 {..} @@ -311,9 +310,13 @@ impl<'tcx> CheckAttrVisitor<'tcx> { | AttributeKind::RustcDocPrimitive(..) | AttributeKind::RustcDummy | AttributeKind::RustcDumpDefParents + | AttributeKind::RustcDumpDefPath(..) + | AttributeKind::RustcDumpHiddenTypeOfOpaques | AttributeKind::RustcDumpInferredOutlives | AttributeKind::RustcDumpItemBounds + | AttributeKind::RustcDumpLayout(..) | AttributeKind::RustcDumpPredicates + | AttributeKind::RustcDumpSymbolName(..) | AttributeKind::RustcDumpUserArgs | AttributeKind::RustcDumpVariances | AttributeKind::RustcDumpVariancesOfOpaques @@ -323,13 +326,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> { | AttributeKind::RustcEiiForeignItem | AttributeKind::RustcEvaluateWhereClauses | AttributeKind::RustcHasIncoherentInherentImpls - | AttributeKind::RustcHiddenTypeOfOpaques | AttributeKind::RustcIfThisChanged(..) | AttributeKind::RustcInheritOverflowChecks | AttributeKind::RustcInsignificantDtor | AttributeKind::RustcIntrinsic | AttributeKind::RustcIntrinsicConstStableIndirect - | AttributeKind::RustcLayout(..) | AttributeKind::RustcLayoutScalarValidRangeEnd(..) | AttributeKind::RustcLayoutScalarValidRangeStart(..) | AttributeKind::RustcLintOptDenyFieldAccess { .. } @@ -339,6 +340,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { | AttributeKind::RustcMacroTransparency(_) | AttributeKind::RustcMain | AttributeKind::RustcMir(_) + | AttributeKind::RustcMustMatchExhaustively(..) | AttributeKind::RustcNeverReturnsNullPtr | AttributeKind::RustcNeverTypeOptions {..} | AttributeKind::RustcNoImplicitAutorefs @@ -365,7 +367,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> { | AttributeKind::RustcSpecializationTrait(..) | AttributeKind::RustcStdInternalSymbol (..) | AttributeKind::RustcStrictCoherence(..) - | AttributeKind::RustcSymbolName(..) | AttributeKind::RustcTestMarker(..) | AttributeKind::RustcThenThisWouldNeed(..) | AttributeKind::RustcTrivialFieldReads diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs index f9dc696f320e3..5de43f24b2dc6 100644 --- a/compiler/rustc_passes/src/errors.rs +++ b/compiler/rustc_passes/src/errors.rs @@ -460,47 +460,6 @@ pub(crate) struct DuplicateDiagnosticItemInCrate { pub name: Symbol, } -#[derive(Diagnostic)] -#[diag("abi: {$abi}")] -pub(crate) struct LayoutAbi { - #[primary_span] - pub span: Span, - pub abi: String, -} - -#[derive(Diagnostic)] -#[diag("align: {$align}")] -pub(crate) struct LayoutAlign { - #[primary_span] - pub span: Span, - pub align: String, -} - -#[derive(Diagnostic)] -#[diag("size: {$size}")] -pub(crate) struct LayoutSize { - #[primary_span] - pub span: Span, - pub size: String, -} - -#[derive(Diagnostic)] -#[diag("homogeneous_aggregate: {$homogeneous_aggregate}")] -pub(crate) struct LayoutHomogeneousAggregate { - #[primary_span] - pub span: Span, - pub homogeneous_aggregate: String, -} - -#[derive(Diagnostic)] -#[diag("layout_of({$normalized_ty}) = {$ty_layout}")] -pub(crate) struct LayoutOf<'tcx> { - #[primary_span] - pub span: Span, - pub normalized_ty: Ty<'tcx>, - pub ty_layout: String, -} - #[derive(Diagnostic)] #[diag("fn_abi_of({$fn_name}) = {$fn_abi}")] pub(crate) struct AbiOf { diff --git a/compiler/rustc_passes/src/layout_test.rs b/compiler/rustc_passes/src/layout_test.rs index 1a9054a51ca39..3317a8d03f6da 100644 --- a/compiler/rustc_passes/src/layout_test.rs +++ b/compiler/rustc_passes/src/layout_test.rs @@ -1,5 +1,5 @@ use rustc_abi::{HasDataLayout, TargetDataLayout}; -use rustc_hir::attrs::RustcLayoutType; +use rustc_hir::attrs::RustcDumpLayoutKind; use rustc_hir::def::DefKind; use rustc_hir::def_id::LocalDefId; use rustc_hir::find_attr; @@ -11,21 +11,18 @@ use rustc_trait_selection::error_reporting::InferCtxtErrorExt; use rustc_trait_selection::infer::TyCtxtInferExt; use rustc_trait_selection::traits; -use crate::errors::{LayoutAbi, LayoutAlign, LayoutHomogeneousAggregate, LayoutOf, LayoutSize}; - pub fn test_layout(tcx: TyCtxt<'_>) { if !tcx.features().rustc_attrs() { // if the `rustc_attrs` feature is not enabled, don't bother testing layout return; } for id in tcx.hir_crate_items(()).definitions() { - if let Some(attrs) = find_attr!(tcx, id, RustcLayout(attrs) => attrs) { + if let Some(kinds) = find_attr!(tcx, id, RustcDumpLayout(kinds) => kinds) { // Attribute parsing handles error reporting - if matches!( - tcx.def_kind(id), - DefKind::TyAlias | DefKind::Enum | DefKind::Struct | DefKind::Union - ) { - dump_layout_of(tcx, id, attrs); + if let DefKind::TyAlias | DefKind::Enum | DefKind::Struct | DefKind::Union = + tcx.def_kind(id) + { + dump_layout_of(tcx, id, kinds); } } } @@ -62,7 +59,7 @@ pub fn ensure_wf<'tcx>( } } -fn dump_layout_of(tcx: TyCtxt<'_>, item_def_id: LocalDefId, attrs: &[RustcLayoutType]) { +fn dump_layout_of(tcx: TyCtxt<'_>, item_def_id: LocalDefId, kinds: &[RustcDumpLayoutKind]) { let typing_env = ty::TypingEnv::post_analysis(tcx, item_def_id); let ty = tcx.type_of(item_def_id).instantiate_identity(); let span = tcx.def_span(item_def_id.to_def_id()); @@ -71,46 +68,25 @@ fn dump_layout_of(tcx: TyCtxt<'_>, item_def_id: LocalDefId, attrs: &[RustcLayout } match tcx.layout_of(typing_env.as_query_input(ty)) { Ok(ty_layout) => { - for attr in attrs { - match attr { - // FIXME: this never was about ABI and now this dump arg is confusing - RustcLayoutType::Abi => { - tcx.dcx().emit_err(LayoutAbi { - span, - abi: format!("{:?}", ty_layout.backend_repr), - }); - } - - RustcLayoutType::Align => { - tcx.dcx().emit_err(LayoutAlign { - span, - align: format!("{:?}", ty_layout.align), - }); - } - - RustcLayoutType::Size => { - tcx.dcx() - .emit_err(LayoutSize { span, size: format!("{:?}", ty_layout.size) }); + for kind in kinds { + let message = match kind { + RustcDumpLayoutKind::Align => format!("align: {:?}", *ty_layout.align), + RustcDumpLayoutKind::BackendRepr => { + format!("backend_repr: {:?}", ty_layout.backend_repr) } - - RustcLayoutType::HomogenousAggregate => { - tcx.dcx().emit_err(LayoutHomogeneousAggregate { - span, - homogeneous_aggregate: format!( - "{:?}", - ty_layout - .homogeneous_aggregate(&UnwrapLayoutCx { tcx, typing_env }) - ), - }); - } - - RustcLayoutType::Debug => { + RustcDumpLayoutKind::Debug => { let normalized_ty = tcx.normalize_erasing_regions(typing_env, ty); // FIXME: using the `Debug` impl here isn't ideal. - let ty_layout = format!("{:#?}", *ty_layout); - tcx.dcx().emit_err(LayoutOf { span, normalized_ty, ty_layout }); + format!("layout_of({normalized_ty}) = {:#?}", *ty_layout) } - } + RustcDumpLayoutKind::HomogenousAggregate => { + let data = + ty_layout.homogeneous_aggregate(&UnwrapLayoutCx { tcx, typing_env }); + format!("homogeneous_aggregate: {data:?}") + } + RustcDumpLayoutKind::Size => format!("size: {:?}", ty_layout.size), + }; + tcx.dcx().span_err(span, message); } } @@ -127,7 +103,10 @@ struct UnwrapLayoutCx<'tcx> { impl<'tcx> LayoutOfHelpers<'tcx> for UnwrapLayoutCx<'tcx> { fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! { - span_bug!(span, "`#[rustc_layout(..)]` test resulted in `layout_of({ty}) = Err({err})`",); + span_bug!( + span, + "`#[rustc_dump_layout(..)]` test resulted in `layout_of({ty}) = Err({err})`", + ); } } diff --git a/compiler/rustc_query_impl/src/execution.rs b/compiler/rustc_query_impl/src/execution.rs index 44995f3f9826a..45be65b02964e 100644 --- a/compiler/rustc_query_impl/src/execution.rs +++ b/compiler/rustc_query_impl/src/execution.rs @@ -477,16 +477,20 @@ fn load_from_disk_or_invoke_provider_green<'tcx, C: QueryCache>( debug_assert!(dep_graph_data.is_index_green(prev_index)); // First try to load the result from the on-disk cache. Some things are never cached on disk. - let value; - let verify; - match (query.try_load_from_disk_fn)(tcx, key, prev_index, dep_node_index) { - Some(loaded_value) => { + let try_value = if (query.will_cache_on_disk_for_key_fn)(key) { + let prof_timer = tcx.prof.incr_cache_loading(); + let value = (query.try_load_from_disk_fn)(tcx, prev_index); + prof_timer.finish_with_query_invocation_id(dep_node_index.into()); + value + } else { + None + }; + let (value, verify) = match try_value { + Some(value) => { if std::intrinsics::unlikely(tcx.sess.opts.unstable_opts.query_dep_graph) { dep_graph_data.mark_debug_loaded_from_disk(*dep_node) } - value = loaded_value; - let prev_fingerprint = dep_graph_data.prev_value_fingerprint_of(prev_index); // If `-Zincremental-verify-ich` is specified, re-hash results from // the cache and make sure that they have the expected fingerprint. @@ -495,17 +499,19 @@ fn load_from_disk_or_invoke_provider_green<'tcx, C: QueryCache>( // from disk. Re-hashing results is fairly expensive, so we can't // currently afford to verify every hash. This subset should still // give us some coverage of potential bugs. - verify = prev_fingerprint.split().1.as_u64().is_multiple_of(32) + let verify = prev_fingerprint.split().1.as_u64().is_multiple_of(32) || tcx.sess.opts.unstable_opts.incremental_verify_ich; + + (value, verify) } None => { // We could not load a result from the on-disk cache, so recompute. The dep-graph for // this computation is already in-place, so we can just call the query provider. let prof_timer = tcx.prof.query_provider(); - value = tcx.dep_graph.with_ignore(|| (query.invoke_provider_fn)(tcx, key)); + let value = tcx.dep_graph.with_ignore(|| (query.invoke_provider_fn)(tcx, key)); prof_timer.finish_with_query_invocation_id(dep_node_index.into()); - verify = true; + (value, true) } }; diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index dfc66a2225f26..11f960598c387 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -5,7 +5,7 @@ use rustc_hir::limit::Limit; use rustc_middle::bug; #[expect(unused_imports, reason = "used by doc comments")] use rustc_middle::dep_graph::DepKindVTable; -use rustc_middle::dep_graph::{DepNode, DepNodeIndex, DepNodeKey, SerializedDepNodeIndex}; +use rustc_middle::dep_graph::{DepNode, DepNodeKey, SerializedDepNodeIndex}; use rustc_middle::query::erase::{Erasable, Erased}; use rustc_middle::query::on_disk_cache::{CacheDecoder, CacheEncoder}; use rustc_middle::query::{QueryCache, QueryJobId, QueryMode, QueryVTable, erase}; @@ -184,23 +184,14 @@ pub(crate) fn loadable_from_disk<'tcx>(tcx: TyCtxt<'tcx>, id: SerializedDepNodeI pub(crate) fn try_load_from_disk<'tcx, V>( tcx: TyCtxt<'tcx>, prev_index: SerializedDepNodeIndex, - index: DepNodeIndex, ) -> Option where V: for<'a> Decodable>, { let on_disk_cache = tcx.query_system.on_disk_cache.as_ref()?; - let prof_timer = tcx.prof.incr_cache_loading(); - // The call to `with_query_deserialization` enforces that no new `DepNodes` // are created during deserialization. See the docs of that method for more // details. - let value = tcx - .dep_graph - .with_query_deserialization(|| on_disk_cache.try_load_query_value(tcx, prev_index)); - - prof_timer.finish_with_query_invocation_id(index.into()); - - value + tcx.dep_graph.with_query_deserialization(|| on_disk_cache.try_load_query_value(tcx, prev_index)) } diff --git a/compiler/rustc_query_impl/src/query_impl.rs b/compiler/rustc_query_impl/src/query_impl.rs index 101bf2c4e80f7..4425acc6b86b8 100644 --- a/compiler/rustc_query_impl/src/query_impl.rs +++ b/compiler/rustc_query_impl/src/query_impl.rs @@ -160,22 +160,17 @@ macro_rules! define_queries { $crate::query_impl::$name::will_cache_on_disk_for_key, #[cfg($cache_on_disk)] - try_load_from_disk_fn: |tcx, key, prev_index, index| { + try_load_from_disk_fn: |tcx, prev_index| { use rustc_middle::queries::$name::{ProvidedValue, provided_to_erased}; - // Check the cache-on-disk condition for this key. - if !$crate::query_impl::$name::will_cache_on_disk_for_key(key) { - return None; - } - let loaded_value: ProvidedValue<'tcx> = - $crate::plumbing::try_load_from_disk(tcx, prev_index, index)?; + $crate::plumbing::try_load_from_disk(tcx, prev_index)?; // Arena-alloc the value if appropriate, and erase it. Some(provided_to_erased(tcx, loaded_value)) }, #[cfg(not($cache_on_disk))] - try_load_from_disk_fn: |_tcx, _key, _prev_index, _index| None, + try_load_from_disk_fn: |_tcx, _prev_index| None, #[cfg($handle_cycle_error)] handle_cycle_error_fn: |tcx, key, cycle, err| { diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 57765cc379a5c..2c287045be7a9 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -441,6 +441,8 @@ pub(crate) enum PathSource<'a, 'ast, 'ra> { TraitItem(Namespace, &'a PathSource<'a, 'ast, 'ra>), /// Paths in delegation item Delegation, + /// Paths in externally implementable item declarations. + ExternItemImpl, /// An arg in a `use<'a, N>` precise-capturing bound. PreciseCapturingArg(Namespace), /// Paths that end with `(..)`, for return type notation. @@ -465,6 +467,7 @@ impl PathSource<'_, '_, '_> { | PathSource::Pat | PathSource::TupleStruct(..) | PathSource::Delegation + | PathSource::ExternItemImpl | PathSource::ReturnTypeNotation => ValueNS, PathSource::TraitItem(ns, _) => ns, PathSource::PreciseCapturingArg(ns) => ns, @@ -484,6 +487,7 @@ impl PathSource<'_, '_, '_> { | PathSource::TraitItem(..) | PathSource::DefineOpaques | PathSource::Delegation + | PathSource::ExternItemImpl | PathSource::PreciseCapturingArg(..) | PathSource::Macro | PathSource::Module => false, @@ -526,7 +530,9 @@ impl PathSource<'_, '_, '_> { }, _ => "value", }, - PathSource::ReturnTypeNotation | PathSource::Delegation => "function", + PathSource::ReturnTypeNotation + | PathSource::Delegation + | PathSource::ExternItemImpl => "function", PathSource::PreciseCapturingArg(..) => "type or const parameter", PathSource::Macro => "macro", PathSource::Module => "module", @@ -618,6 +624,9 @@ impl PathSource<'_, '_, '_> { _ => false, }, PathSource::Delegation => matches!(res, Res::Def(DefKind::Fn | DefKind::AssocFn, _)), + PathSource::ExternItemImpl => { + matches!(res, Res::Def(DefKind::Fn | DefKind::AssocFn | DefKind::Ctor(..), _)) + } PathSource::PreciseCapturingArg(ValueNS) => { matches!(res, Res::Def(DefKind::ConstParam, _)) } @@ -640,8 +649,12 @@ impl PathSource<'_, '_, '_> { (PathSource::Type | PathSource::DefineOpaques, false) => E0425, (PathSource::Struct(_), true) => E0574, (PathSource::Struct(_), false) => E0422, - (PathSource::Expr(..), true) | (PathSource::Delegation, true) => E0423, - (PathSource::Expr(..), false) | (PathSource::Delegation, false) => E0425, + (PathSource::Expr(..), true) + | (PathSource::Delegation, true) + | (PathSource::ExternItemImpl, true) => E0423, + (PathSource::Expr(..), false) + | (PathSource::Delegation, false) + | (PathSource::ExternItemImpl, false) => E0425, (PathSource::Pat | PathSource::TupleStruct(..), true) => E0532, (PathSource::Pat | PathSource::TupleStruct(..), false) => E0531, (PathSource::TraitItem(..) | PathSource::ReturnTypeNotation, true) => E0575, @@ -1091,7 +1104,7 @@ impl<'ast, 'ra, 'tcx> Visitor<'ast> for LateResolutionVisitor<'_, 'ast, 'ra, 'tc *node_id, &None, &target.foreign_item, - PathSource::Expr(None), + PathSource::ExternItemImpl, ); } else { self.smart_resolve_path(*node_id, &None, &eii_macro_path, PathSource::Macro); @@ -2198,7 +2211,8 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { | PathSource::Struct(_) | PathSource::TupleStruct(..) | PathSource::DefineOpaques - | PathSource::Delegation => true, + | PathSource::Delegation + | PathSource::ExternItemImpl => true, }; if inferred { // Do not create a parameter for patterns and expressions: type checking can infer @@ -3004,7 +3018,7 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { item.id, &None, extern_item_path, - PathSource::Expr(None), + PathSource::ExternItemImpl, ); } } diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 33bc5a578e8b6..e4e5729fa9710 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -505,6 +505,7 @@ symbols! { avx512f, await_macro, backchain, + backend_repr, bang, begin_panic, bench, @@ -1708,7 +1709,6 @@ symbols! { rustc_const_unstable, rustc_conversion_suggestion, rustc_deallocator, - rustc_def_path, rustc_default_body_unstable, rustc_delayed_bug_from_inside_query, rustc_deny_explicit_impl, @@ -1720,10 +1720,14 @@ symbols! { rustc_driver, rustc_dummy, rustc_dump_def_parents, + rustc_dump_def_path, + rustc_dump_hidden_type_of_opaques, rustc_dump_inferred_outlives, rustc_dump_item_bounds, + rustc_dump_layout, rustc_dump_object_lifetime_defaults, rustc_dump_predicates, + rustc_dump_symbol_name, rustc_dump_user_args, rustc_dump_variances, rustc_dump_variances_of_opaques, @@ -1735,13 +1739,11 @@ symbols! { rustc_expected_cgu_reuse, rustc_force_inline, rustc_has_incoherent_inherent_impls, - rustc_hidden_type_of_opaques, rustc_if_this_changed, rustc_inherit_overflow_checks, rustc_insignificant_dtor, rustc_intrinsic, rustc_intrinsic_const_stable_indirect, - rustc_layout, rustc_layout_scalar_valid_range_end, rustc_layout_scalar_valid_range_start, rustc_legacy_const_generics, @@ -1753,6 +1755,7 @@ symbols! { rustc_main, rustc_mir, rustc_must_implement_one_of, + rustc_must_match_exhaustively, rustc_never_returns_null_ptr, rustc_never_type_options, rustc_no_implicit_autorefs, @@ -1789,7 +1792,6 @@ symbols! { rustc_specialization_trait, rustc_std_internal_symbol, rustc_strict_coherence, - rustc_symbol_name, rustc_test_marker, rustc_then_this_would_need, rustc_trivial_field_reads, diff --git a/compiler/rustc_symbol_mangling/Cargo.toml b/compiler/rustc_symbol_mangling/Cargo.toml index d28eb3f047069..1df8d641a4caa 100644 --- a/compiler/rustc_symbol_mangling/Cargo.toml +++ b/compiler/rustc_symbol_mangling/Cargo.toml @@ -9,7 +9,6 @@ punycode = "0.4.0" rustc-demangle = "0.1.27" rustc_abi = { path = "../rustc_abi" } rustc_data_structures = { path = "../rustc_data_structures" } -rustc_errors = { path = "../rustc_errors" } rustc_hashes = { path = "../rustc_hashes" } rustc_hir = { path = "../rustc_hir" } rustc_middle = { path = "../rustc_middle" } diff --git a/compiler/rustc_symbol_mangling/src/errors.rs b/compiler/rustc_symbol_mangling/src/errors.rs deleted file mode 100644 index ada9e3fb15624..0000000000000 --- a/compiler/rustc_symbol_mangling/src/errors.rs +++ /dev/null @@ -1,41 +0,0 @@ -//! Errors emitted by symbol_mangling. - -use std::fmt; - -use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level}; -use rustc_span::Span; - -pub struct TestOutput { - pub span: Span, - pub kind: Kind, - pub content: String, -} - -// This diagnostic doesn't need translation because (a) it doesn't contain any -// natural language, and (b) it's only used in tests. So we construct it -// manually and avoid the fluent machinery. -impl Diagnostic<'_, G> for TestOutput { - fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> { - let TestOutput { span, kind, content } = self; - - Diag::new(dcx, level, format!("{kind}({content})")).with_span(span) - } -} - -pub enum Kind { - SymbolName, - Demangling, - DemanglingAlt, - DefPath, -} - -impl fmt::Display for Kind { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Kind::SymbolName => write!(f, "symbol-name"), - Kind::Demangling => write!(f, "demangling"), - Kind::DemanglingAlt => write!(f, "demangling-alt"), - Kind::DefPath => write!(f, "def-path"), - } - } -} diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs index 3ac8a566374cf..c052037f05b39 100644 --- a/compiler/rustc_symbol_mangling/src/lib.rs +++ b/compiler/rustc_symbol_mangling/src/lib.rs @@ -101,7 +101,6 @@ mod hashed; mod legacy; mod v0; -pub mod errors; pub mod test; pub use v0::mangle_internal_symbol; diff --git a/compiler/rustc_symbol_mangling/src/test.rs b/compiler/rustc_symbol_mangling/src/test.rs index b4d9031469dd5..a4364cc20b68e 100644 --- a/compiler/rustc_symbol_mangling/src/test.rs +++ b/compiler/rustc_symbol_mangling/src/test.rs @@ -1,17 +1,14 @@ //! Walks the crate looking for items/impl-items/trait-items that have -//! either a `rustc_symbol_name` or `rustc_def_path` attribute and +//! either a `rustc_dump_symbol_name` or `rustc_dump_def_path` attribute and //! generates an error giving, respectively, the symbol name or //! def-path. This is used for unit testing the code that generates //! paths etc in all kinds of annoying scenarios. -use rustc_hir::def_id::LocalDefId; -use rustc_hir::find_attr; +use rustc_hir::{CRATE_OWNER_ID, find_attr}; use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_middle::ty::{GenericArgs, Instance, TyCtxt}; -use crate::errors::{Kind, TestOutput}; - -pub fn report_symbol_names(tcx: TyCtxt<'_>) { +pub fn dump_symbol_names_and_def_paths(tcx: TyCtxt<'_>) { // if the `rustc_attrs` feature is not enabled, then the // attributes we are interested in cannot be present anyway, so // skip the walk. @@ -20,73 +17,33 @@ pub fn report_symbol_names(tcx: TyCtxt<'_>) { } tcx.dep_graph.with_ignore(|| { - let mut symbol_names = SymbolNamesTest { tcx }; - let crate_items = tcx.hir_crate_items(()); - - for id in crate_items.free_items() { - symbol_names.process_attrs(id.owner_id.def_id); - } - - for id in crate_items.trait_items() { - symbol_names.process_attrs(id.owner_id.def_id); - } - - for id in crate_items.impl_items() { - symbol_names.process_attrs(id.owner_id.def_id); - } + for id in tcx.hir_crate_items(()).owners() { + if id == CRATE_OWNER_ID { + continue; + } - for id in crate_items.foreign_items() { - symbol_names.process_attrs(id.owner_id.def_id); - } - }) -} + // The format `$tag($value)` is chosen so that tests can elect to test the + // entirety of the string, if they choose, or else just some subset. -struct SymbolNamesTest<'tcx> { - tcx: TyCtxt<'tcx>, -} + if let Some(&span) = find_attr!(tcx, id.def_id, RustcDumpSymbolName(span) => span) { + let def_id = id.def_id.to_def_id(); + let args = GenericArgs::identity_for_item(tcx, id.def_id); + let args = tcx.erase_and_anonymize_regions(args); + let instance = Instance::new_raw(def_id, args); + let mangled = tcx.symbol_name(instance); -impl SymbolNamesTest<'_> { - fn process_attrs(&mut self, def_id: LocalDefId) { - let tcx = self.tcx; - // The formatting of `tag({})` is chosen so that tests can elect - // to test the entirety of the string, if they choose, or else just - // some subset. + tcx.dcx().span_err(span, format!("symbol-name({mangled})")); - if let Some(attr_span) = find_attr!(tcx, def_id, RustcSymbolName(span) => span) { - let def_id = def_id.to_def_id(); - let instance = Instance::new_raw( - def_id, - tcx.erase_and_anonymize_regions(GenericArgs::identity_for_item(tcx, def_id)), - ); - let mangled = tcx.symbol_name(instance); - tcx.dcx().emit_err(TestOutput { - span: *attr_span, - kind: Kind::SymbolName, - content: format!("{mangled}"), - }); - if let Ok(demangling) = rustc_demangle::try_demangle(mangled.name) { - tcx.dcx().emit_err(TestOutput { - span: *attr_span, - kind: Kind::Demangling, - content: format!("{demangling}"), - }); - tcx.dcx().emit_err(TestOutput { - span: *attr_span, - kind: Kind::DemanglingAlt, - content: format!("{demangling:#}"), - }); + if let Ok(demangling) = rustc_demangle::try_demangle(mangled.name) { + tcx.dcx().span_err(span, format!("demangling({demangling})")); + tcx.dcx().span_err(span, format!("demangling-alt({demangling:#})")); + } } - } - if let Some(attr_span) = find_attr!( - tcx, def_id, - RustcDefPath(span) => span - ) { - tcx.dcx().emit_err(TestOutput { - span: *attr_span, - kind: Kind::DefPath, - content: with_no_trimmed_paths!(tcx.def_path_str(def_id)), - }); + if let Some(&span) = find_attr!(tcx, id.def_id, RustcDumpDefPath(span) => span) { + let def_path = with_no_trimmed_paths!(tcx.def_path_str(id.def_id)); + tcx.dcx().span_err(span, format!("def-path({def_path})")); + } } - } + }) } diff --git a/compiler/rustc_trait_selection/src/traits/effects.rs b/compiler/rustc_trait_selection/src/traits/effects.rs index 45e0b5d74af7d..9959c92a6f897 100644 --- a/compiler/rustc_trait_selection/src/traits/effects.rs +++ b/compiler/rustc_trait_selection/src/traits/effects.rs @@ -8,7 +8,7 @@ use rustc_middle::span_bug; use rustc_middle::traits::query::NoSolution; use rustc_middle::ty::elaborate::elaborate; use rustc_middle::ty::fast_reject::DeepRejectCtxt; -use rustc_middle::ty::{self, Ty, TypingMode}; +use rustc_middle::ty::{self, Ty}; use thin_vec::{ThinVec, thin_vec}; use super::SelectionContext; @@ -25,7 +25,7 @@ pub fn evaluate_host_effect_obligation<'tcx>( selcx: &mut SelectionContext<'_, 'tcx>, obligation: &HostEffectObligation<'tcx>, ) -> Result>, EvaluationFailure> { - if selcx.infcx.typing_mode() == TypingMode::Coherence { + if selcx.infcx.typing_mode().is_coherence() { span_bug!( obligation.cause.span, "should not select host obligation in old solver in intercrate mode" diff --git a/compiler/rustc_trait_selection/src/traits/fulfill.rs b/compiler/rustc_trait_selection/src/traits/fulfill.rs index a575630a05035..2dbeff4a50508 100644 --- a/compiler/rustc_trait_selection/src/traits/fulfill.rs +++ b/compiler/rustc_trait_selection/src/traits/fulfill.rs @@ -841,8 +841,7 @@ impl<'a, 'tcx> FulfillProcessor<'a, 'tcx> { stalled_on: &mut Vec, ) -> ProcessResult, FulfillmentErrorCode<'tcx>> { let infcx = self.selcx.infcx; - if obligation.predicate.is_global() && !matches!(infcx.typing_mode(), TypingMode::Coherence) - { + if obligation.predicate.is_global() && !infcx.typing_mode().is_coherence() { // no type variables present, can use evaluation for better caching. // FIXME: consider caching errors too. if infcx.predicate_must_hold_considering_regions(obligation) { @@ -896,8 +895,7 @@ impl<'a, 'tcx> FulfillProcessor<'a, 'tcx> { ) -> ProcessResult, FulfillmentErrorCode<'tcx>> { let tcx = self.selcx.tcx(); let infcx = self.selcx.infcx; - if obligation.predicate.is_global() && !matches!(infcx.typing_mode(), TypingMode::Coherence) - { + if obligation.predicate.is_global() && !infcx.typing_mode().is_coherence() { // no type variables present, can use evaluation for better caching. // FIXME: consider caching errors too. if infcx.predicate_must_hold_considering_regions(obligation) { diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index ab8e1354b6b3c..f7614e7c9730a 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -15,7 +15,7 @@ use rustc_hir::{self as hir, CoroutineDesugaring, CoroutineKind}; use rustc_infer::traits::{Obligation, PolyTraitObligation, PredicateObligation, SelectionError}; use rustc_middle::ty::fast_reject::DeepRejectCtxt; use rustc_middle::ty::{ - self, FieldInfo, SizedTraitKind, TraitRef, Ty, TypeVisitableExt, TypingMode, elaborate, + self, FieldInfo, SizedTraitKind, TraitRef, Ty, TypeVisitableExt, elaborate, }; use rustc_middle::{bug, span_bug}; use rustc_span::DUMMY_SP; @@ -849,7 +849,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { // // Note that this is only sound as projection candidates of opaque types // are always applicable for auto traits. - } else if let TypingMode::Coherence = self.infcx.typing_mode() { + } else if self.infcx.typing_mode().is_coherence() { // We do not emit auto trait candidates for opaque types in coherence. // Doing so can result in weird dependency cycles. candidates.ambiguous = true; diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 527353bed5ade..a564e8060d930 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -3,9 +3,9 @@ //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/traits/resolution.html#selection use std::cell::{Cell, RefCell}; +use std::cmp; use std::fmt::{self, Display}; use std::ops::ControlFlow; -use std::{assert_matches, cmp}; use hir::def::DefKind; use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; @@ -210,8 +210,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { /// Enables tracking of intercrate ambiguity causes. See /// the documentation of [`Self::intercrate_ambiguity_causes`] for more. pub fn enable_tracking_intercrate_ambiguity_causes(&mut self) { - assert_matches!(self.infcx.typing_mode(), TypingMode::Coherence); + assert!(self.infcx.typing_mode().is_coherence()); assert!(self.intercrate_ambiguity_causes.is_none()); + self.intercrate_ambiguity_causes = Some(FxIndexSet::default()); debug!("selcx: enable_tracking_intercrate_ambiguity_causes"); } @@ -222,7 +223,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { pub fn take_intercrate_ambiguity_causes( &mut self, ) -> FxIndexSet> { - assert_matches!(self.infcx.typing_mode(), TypingMode::Coherence); + assert!(self.infcx.typing_mode().is_coherence()); + self.intercrate_ambiguity_causes.take().unwrap_or_default() } @@ -1016,7 +1018,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { previous_stack: TraitObligationStackList<'o, 'tcx>, mut obligation: PolyTraitObligation<'tcx>, ) -> Result { - if !matches!(self.infcx.typing_mode(), TypingMode::Coherence) + if !self.infcx.typing_mode().is_coherence() && obligation.is_global() && obligation.param_env.caller_bounds().iter().all(|bound| bound.has_param()) { @@ -2548,7 +2550,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> { nested_obligations.extend(obligations); if impl_trait_header.polarity == ty::ImplPolarity::Reservation - && !matches!(self.infcx.typing_mode(), TypingMode::Coherence) + && !self.infcx.typing_mode().is_coherence() { debug!("reservation impls only apply in intercrate mode"); return Err(()); diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index cf881961b3ce3..e48e525e571d0 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -154,7 +154,7 @@ fn resolve_associated_item<'tcx>( // and the obligation is monomorphic, otherwise passes such as // transmute checking and polymorphic MIR optimizations could // get a result which isn't correct for all monomorphizations. - match typing_env.typing_mode { + match typing_env.typing_mode() { ty::TypingMode::Coherence | ty::TypingMode::Analysis { .. } | ty::TypingMode::Borrowck { .. } diff --git a/compiler/rustc_type_ir/src/canonical.rs b/compiler/rustc_type_ir/src/canonical.rs index 8e7414674c6e7..be5e483c808d4 100644 --- a/compiler/rustc_type_ir/src/canonical.rs +++ b/compiler/rustc_type_ir/src/canonical.rs @@ -11,7 +11,7 @@ use rustc_type_ir_macros::{ use crate::data_structures::HashMap; use crate::inherent::*; -use crate::{self as ty, Interner, TypingMode, UniverseIndex}; +use crate::{self as ty, Interner, TypingModeEqWrapper, UniverseIndex}; #[derive_where(Clone, Hash, PartialEq, Debug; I: Interner, V)] #[derive_where(Copy; I: Interner, V: Copy)] @@ -21,7 +21,7 @@ use crate::{self as ty, Interner, TypingMode, UniverseIndex}; )] pub struct CanonicalQueryInput { pub canonical: Canonical, - pub typing_mode: TypingMode, + pub typing_mode: TypingModeEqWrapper, } impl Eq for CanonicalQueryInput {} diff --git a/compiler/rustc_type_ir/src/infer_ctxt.rs b/compiler/rustc_type_ir/src/infer_ctxt.rs index feafcee7bad9e..ac6e345ec1de1 100644 --- a/compiler/rustc_type_ir/src/infer_ctxt.rs +++ b/compiler/rustc_type_ir/src/infer_ctxt.rs @@ -1,3 +1,5 @@ +use std::hash::{Hash, Hasher}; + use derive_where::derive_where; #[cfg(feature = "nightly")] use rustc_macros::{Decodable_NoContext, Encodable_NoContext, HashStable_NoContext}; @@ -18,11 +20,28 @@ use crate::{self as ty, Interner, TyVid}; /// /// If neither of these functions are available, feel free to reach out to /// t-types for help. -#[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner)] +/// +/// Because typing rules get subtly different based on what typing mode we're in, +/// subtle enough that changing the behavior of typing modes can sometimes cause +/// changes that we don't even have tests for, we'd like to enforce the rule that +/// any place where we specialize behavior based on the typing mode, we match +/// *exhaustively* on the typing mode. That way, it's easy to determine all the +/// places that must change when anything about typing modes changes. +/// +/// Hence, `TypingMode` does not implement `Eq`, though [`TypingModeEqWrapper`] is available +/// in the rare case that you do need this. Most cases where this currently matters is +/// where we pass typing modes through the query system and want to cache based on it. +/// See also `#[rustc_must_match_exhaustively]`, which tries to detect non-exhaustive +/// matches. +/// +/// Since matching on typing mode to single out `Coherence` is so common, and `Coherence` +/// is so different from the other modes: see also [`is_coherence`](TypingMode::is_coherence) +#[derive_where(Clone, Copy, Hash, Debug; I: Interner)] #[cfg_attr( feature = "nightly", derive(Encodable_NoContext, Decodable_NoContext, HashStable_NoContext) )] +#[cfg_attr(feature = "nightly", cfg_attr(not(bootstrap), rustc_must_match_exhaustively))] pub enum TypingMode { /// When checking whether impls overlap, we check whether any obligations /// are guaranteed to never hold when unifying the impls. This requires us @@ -90,9 +109,71 @@ pub enum TypingMode { PostAnalysis, } -impl Eq for TypingMode {} +/// We want to highly discourage using equality checks on typing modes. +/// Instead you should match, **exhaustively**, so when we ever modify the enum we get a compile +/// error. Only use `TypingModeEqWrapper` when you really really really have to. +/// Prefer unwrapping `TypingModeEqWrapper` in apis that should return a `TypingMode` whenever +/// possible, and if you ever get an `TypingModeEqWrapper`, prefer unwrapping it and matching on it **exhaustively**. +#[derive_where(Clone, Copy, Debug; I: Interner)] +#[cfg_attr( + feature = "nightly", + derive(Encodable_NoContext, Decodable_NoContext, HashStable_NoContext) +)] +pub struct TypingModeEqWrapper(pub TypingMode); + +impl Hash for TypingModeEqWrapper { + fn hash(&self, state: &mut H) { + self.0.hash(state); + } +} + +impl PartialEq for TypingModeEqWrapper { + fn eq(&self, other: &Self) -> bool { + match (self.0, other.0) { + (TypingMode::Coherence, TypingMode::Coherence) => true, + ( + TypingMode::Analysis { defining_opaque_types_and_generators: l }, + TypingMode::Analysis { defining_opaque_types_and_generators: r }, + ) => l == r, + ( + TypingMode::Borrowck { defining_opaque_types: l }, + TypingMode::Borrowck { defining_opaque_types: r }, + ) => l == r, + ( + TypingMode::PostBorrowckAnalysis { defined_opaque_types: l }, + TypingMode::PostBorrowckAnalysis { defined_opaque_types: r }, + ) => l == r, + (TypingMode::PostAnalysis, TypingMode::PostAnalysis) => true, + ( + TypingMode::Coherence + | TypingMode::Analysis { .. } + | TypingMode::Borrowck { .. } + | TypingMode::PostBorrowckAnalysis { .. } + | TypingMode::PostAnalysis, + _, + ) => false, + } + } +} + +impl Eq for TypingModeEqWrapper {} impl TypingMode { + /// There are a bunch of places in the compiler where we single out `Coherence`, + /// and alter behavior. We'd like to *always* match on `TypingMode` exhaustively, + /// but not having this method leads to a bunch of noisy code. + /// + /// See also the documentation on [`TypingMode`] about exhaustive matching. + pub fn is_coherence(&self) -> bool { + match self { + TypingMode::Coherence => true, + TypingMode::Analysis { .. } + | TypingMode::Borrowck { .. } + | TypingMode::PostBorrowckAnalysis { .. } + | TypingMode::PostAnalysis => false, + } + } + /// Analysis outside of a body does not define any opaque types. pub fn non_body_analysis() -> TypingMode { TypingMode::Analysis { defining_opaque_types_and_generators: Default::default() } @@ -322,6 +403,13 @@ where // Note: `feature_bound_holds_in_crate` does not consider a feature to be enabled // if we are in std/core even if there is a corresponding `feature` attribute on the crate. - (infcx.typing_mode() == TypingMode::PostAnalysis) - || infcx.cx().features().feature_bound_holds_in_crate(symbol) + match infcx.typing_mode() { + TypingMode::Coherence + | TypingMode::Analysis { .. } + | TypingMode::Borrowck { .. } + | TypingMode::PostBorrowckAnalysis { .. } => { + infcx.cx().features().feature_bound_holds_in_crate(symbol) + } + TypingMode::PostAnalysis => true, + } } diff --git a/src/doc/rustc-dev-guide/src/compiler-debugging.md b/src/doc/rustc-dev-guide/src/compiler-debugging.md index 25f7eb27eeea3..dc9d4b9a5cfe1 100644 --- a/src/doc/rustc-dev-guide/src/compiler-debugging.md +++ b/src/doc/rustc-dev-guide/src/compiler-debugging.md @@ -273,18 +273,18 @@ Here are some notable ones: | Attribute | Description | |----------------|-------------| -| `rustc_def_path` | Dumps the [`def_path_str`] of an item. | | `rustc_dump_def_parents` | Dumps the chain of `DefId` parents of certain definitions. | +| `rustc_dump_def_path` | Dumps the [`def_path_str`] of an item. | +| `rustc_dump_hidden_type_of_opaques` | Dumps the [hidden type of each opaque types][opaq] in the crate. | | `rustc_dump_inferred_outlives` | Dumps implied bounds of an item. More precisely, the [`inferred_outlives_of`] an item. | | `rustc_dump_item_bounds` | Dumps the [`item_bounds`] of an item. | +| `rustc_dump_layout` | [See this section](#debugging-type-layouts). | | `rustc_dump_object_lifetime_defaults` | Dumps the [object lifetime defaults] of an item. | | `rustc_dump_predicates` | Dumps the [`predicates_of`] an item. | +| `rustc_dump_symbol_name` | Dumps the mangled & demangled [`symbol_name`] of an item. | | `rustc_dump_variances` | Dumps the [variances] of an item. | | `rustc_dump_vtable` | Dumps the vtable layout of an impl, or a type alias of a dyn type. | -| `rustc_hidden_type_of_opaques` | Dumps the [hidden type of each opaque types][opaq] in the crate. | -| `rustc_layout` | [See this section](#debugging-type-layouts). | | `rustc_regions` | Dumps NLL closure region requirements. | -| `rustc_symbol_name` | Dumps the mangled & demangled [`symbol_name`] of an item. | Right below you can find elaborate explainers on a selected few. @@ -316,54 +316,55 @@ $ firefox maybe_init_suffix.pdf # Or your favorite pdf viewer ### Debugging type layouts -The internal attribute `#[rustc_layout]` can be used to dump the [`Layout`] of -the type it is attached to. +The internal attribute `#[rustc_dump_layout(...)]` can be used to dump the +[`Layout`] of the type it is attached to. For example: ```rust #![feature(rustc_attrs)] -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type T<'a> = &'a u32; ``` Will emit the following: ```text -error: layout_of(&'a u32) = Layout { - fields: Primitive, - variants: Single { - index: 0, - }, - abi: Scalar( - Scalar { - value: Pointer, - valid_range: 1..=18446744073709551615, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Pointer, - valid_range: 1..=18446744073709551615, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 3, - }, - pref: Align { - pow2: 3, - }, - }, - size: Size { - raw: 8, - }, -} +error: layout_of(&u32) = Layout { + size: Size(8 bytes), + align: AbiAlign { + abi: Align(8 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Pointer( + AddressSpace( + 0, + ), + ), + valid_range: 1..=18446744073709551615, + }, + ), + fields: Primitive, + largest_niche: Some( + Niche { + offset: Size(0 bytes), + value: Pointer( + AddressSpace( + 0, + ), + ), + valid_range: 1..=18446744073709551615, + }, + ), + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(8 bytes), + randomization_seed: 281492156579847, + } --> src/lib.rs:4:1 | 4 | type T<'a> = &'a u32; diff --git a/src/doc/unstable-book/src/language-features/rustc-attrs.md b/src/doc/unstable-book/src/language-features/rustc-attrs.md index c67b806f06af4..924f639a312c6 100644 --- a/src/doc/unstable-book/src/language-features/rustc-attrs.md +++ b/src/doc/unstable-book/src/language-features/rustc-attrs.md @@ -9,19 +9,20 @@ only discuss a few of them. ------------------------ The `rustc_attrs` feature allows debugging rustc type layouts by using -`#[rustc_layout(...)]` to debug layout at compile time (it even works +`#[rustc_dump_layout(...)]` to debug layout at compile time (it even works with `cargo check`) as an alternative to `rustc -Z print-type-sizes` that is way more verbose. -Options provided by `#[rustc_layout(...)]` are `debug`, `size`, `align`, -`abi`. Note that it only works on sized types without generics. +Options provided by `#[rustc_dump_layout(...)]` are `backend_repr`, `align`, +`debug`, `homogeneous_aggregate` and `size`. +Note that it only works on sized types without generics. ## Examples ```rust,compile_fail #![feature(rustc_attrs)] -#[rustc_layout(abi, size)] +#[rustc_dump_layout(backend_repr, size)] pub enum X { Y(u8, u8, u8), Z(isize), @@ -31,7 +32,7 @@ pub enum X { When that is compiled, the compiler will error with something like ```text -error: abi: Aggregate { sized: true } +error: backend_repr: Aggregate { sized: true } --> src/lib.rs:4:1 | 4 | / pub enum T { diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 42d7237f68e53..3c5b1e55de644 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -87,10 +87,7 @@ impl<'tcx> DocContext<'tcx> { } pub(crate) fn typing_env(&self) -> ty::TypingEnv<'tcx> { - ty::TypingEnv { - typing_mode: ty::TypingMode::non_body_analysis(), - param_env: self.param_env, - } + ty::TypingEnv::new(self.param_env, ty::TypingMode::non_body_analysis()) } /// Call the closure with the given parameters set as diff --git a/src/tools/clippy/clippy_lints/src/derive/derive_partial_eq_without_eq.rs b/src/tools/clippy/clippy_lints/src/derive/derive_partial_eq_without_eq.rs index fbace0bd73acf..22943cd9ee5e2 100644 --- a/src/tools/clippy/clippy_lints/src/derive/derive_partial_eq_without_eq.rs +++ b/src/tools/clippy/clippy_lints/src/derive/derive_partial_eq_without_eq.rs @@ -85,8 +85,8 @@ fn typing_env_for_derived_eq(tcx: TyCtxt<'_>, did: DefId, eq_trait_id: DefId) -> .upcast(tcx) }), ))); - ty::TypingEnv { - typing_mode: ty::TypingMode::non_body_analysis(), + ty::TypingEnv::new( param_env, - } + ty::TypingMode::non_body_analysis(), + ) } diff --git a/tests/debuginfo/msvc-pretty-enums.rs b/tests/debuginfo/msvc-pretty-enums.rs index 1f55adcb5c00c..de5dfef004a6e 100644 --- a/tests/debuginfo/msvc-pretty-enums.rs +++ b/tests/debuginfo/msvc-pretty-enums.rs @@ -275,7 +275,6 @@ enum NicheLayoutWithFields3 { #[repr(transparent)] struct Wrapping128(u128); -// #[rustc_layout(debug)] enum Wrapping128Niche { X(Wrapping128), Y, diff --git a/tests/ui-fulldeps/internal-lints/must_match_exhaustively.rs b/tests/ui-fulldeps/internal-lints/must_match_exhaustively.rs new file mode 100644 index 0000000000000..cc3dcebd11cdd --- /dev/null +++ b/tests/ui-fulldeps/internal-lints/must_match_exhaustively.rs @@ -0,0 +1,48 @@ +//@ compile-flags: -Z unstable-options +//@ ignore-stage1 + +#![feature(rustc_private)] +#![feature(rustc_attrs)] +#![deny(rustc::rustc_must_match_exhaustively)] + +#[rustc_must_match_exhaustively] +#[derive(Copy, Clone)] +enum Foo { + A { field: u32 }, + B, +} + +fn foo(f: Foo) { + match f { + Foo::A { .. } => {} + Foo::B => {} + } + + match f { + //~^ ERROR match is not exhaustive + Foo::A { .. } => {} + _ => {} + } + + match f { + //~^ ERROR match is not exhaustive + Foo::A { .. } => {} + a => {} + } + + match &f { + //~^ ERROR match is not exhaustive + Foo::A { .. } => {} + a => {} + } + + match f { + Foo::A { .. } => {} + a @ Foo::B => {} + } + + if let Foo::A { .. } = f {} + //~^ ERROR match is not exhaustive +} + +fn main() {} diff --git a/tests/ui-fulldeps/internal-lints/must_match_exhaustively.stderr b/tests/ui-fulldeps/internal-lints/must_match_exhaustively.stderr new file mode 100644 index 0000000000000..e17cfcefc4093 --- /dev/null +++ b/tests/ui-fulldeps/internal-lints/must_match_exhaustively.stderr @@ -0,0 +1,71 @@ +error: match is not exhaustive + --> $DIR/must_match_exhaustively.rs:21:11 + | +LL | #[rustc_must_match_exhaustively] + | -------------------------------- required because of this attribute +... +LL | match f { + | ^ + | + = help: explicitly list all variants of the enum in a `match` +note: because of this wildcard pattern + --> $DIR/must_match_exhaustively.rs:24:9 + | +LL | _ => {} + | ^ +note: the lint level is defined here + --> $DIR/must_match_exhaustively.rs:6:9 + | +LL | #![deny(rustc::rustc_must_match_exhaustively)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: match is not exhaustive + --> $DIR/must_match_exhaustively.rs:27:11 + | +LL | #[rustc_must_match_exhaustively] + | -------------------------------- required because of this attribute +... +LL | match f { + | ^ + | + = help: explicitly list all variants of the enum in a `match` +note: because of this variable binding + --> $DIR/must_match_exhaustively.rs:30:9 + | +LL | a => {} + | ^ + +error: match is not exhaustive + --> $DIR/must_match_exhaustively.rs:33:11 + | +LL | #[rustc_must_match_exhaustively] + | -------------------------------- required because of this attribute +... +LL | match &f { + | ^^ + | + = help: explicitly list all variants of the enum in a `match` +note: because of this variable binding + --> $DIR/must_match_exhaustively.rs:36:9 + | +LL | a => {} + | ^ + +error: match is not exhaustive + --> $DIR/must_match_exhaustively.rs:44:8 + | +LL | #[rustc_must_match_exhaustively] + | -------------------------------- required because of this attribute +... +LL | if let Foo::A { .. } = f {} + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: explicitly list all variants of the enum in a `match` +note: using if let only matches on one variant (try using `match`) + --> $DIR/must_match_exhaustively.rs:44:8 + | +LL | if let Foo::A { .. } = f {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/tests/ui/README.md b/tests/ui/README.md index a9e7f022c2b60..7c2df5048fc1b 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -1352,7 +1352,7 @@ See [Strict Version Hash](https://rustc-dev-guide.rust-lang.org/backend/libs-and ## `tests/ui/symbol-names/`: Symbol mangling and related attributes -These tests revolve around `#[no_mangle]` attribute, as well as consistently mangled symbol names (checked with the `rustc_symbol_name` attribute), which is important to build reproducible binaries. +These tests revolve around `#[no_mangle]` attribute, as well as consistently mangled symbol names (checked with the `rustc_dump_symbol_name` attribute), which is important to build reproducible binaries. ## `tests/ui/sync/`: `Sync` trait diff --git a/tests/ui/associated-types/issue-85103-layout-debug.rs b/tests/ui/associated-types/issue-85103-layout-debug.rs index 29a59924ef082..7f3fbd17e04cc 100644 --- a/tests/ui/associated-types/issue-85103-layout-debug.rs +++ b/tests/ui/associated-types/issue-85103-layout-debug.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type Edges<'a, E> = Cow<'a, [E]>; //~^ ERROR the trait bound `[E]: ToOwned` is not satisfied diff --git a/tests/ui/const-generics/associated-const-bindings/dyn-compat-symbol-mangling.rs b/tests/ui/const-generics/associated-const-bindings/dyn-compat-symbol-mangling.rs index 52ecd42b191df..99ed73cf5986f 100644 --- a/tests/ui/const-generics/associated-const-bindings/dyn-compat-symbol-mangling.rs +++ b/tests/ui/const-generics/associated-const-bindings/dyn-compat-symbol-mangling.rs @@ -18,7 +18,7 @@ trait Trait { type const N: usize; } -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name(_RMCs //~| ERROR demangling(>) diff --git a/tests/ui/const-generics/associated-const-bindings/dyn-compat-symbol-mangling.v0.stderr b/tests/ui/const-generics/associated-const-bindings/dyn-compat-symbol-mangling.v0.stderr index 8ca0f73494d38..a1403c80f2722 100644 --- a/tests/ui/const-generics/associated-const-bindings/dyn-compat-symbol-mangling.v0.stderr +++ b/tests/ui/const-generics/associated-const-bindings/dyn-compat-symbol-mangling.v0.stderr @@ -1,20 +1,20 @@ error: symbol-name(_RMCsCRATE_HASH_3symDNtB_5Traitp1NKj0_EL_) --> $DIR/dyn-compat-symbol-mangling.rs:21:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/dyn-compat-symbol-mangling.rs:21:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/dyn-compat-symbol-mangling.rs:21:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/tests/ui/delegation/generics/generics-gen-args-errors.rs b/tests/ui/delegation/generics/generics-gen-args-errors.rs index 3edcc70420145..68e26e41a5627 100644 --- a/tests/ui/delegation/generics/generics-gen-args-errors.rs +++ b/tests/ui/delegation/generics/generics-gen-args-errors.rs @@ -36,6 +36,7 @@ mod test_1 { //~| ERROR can't use generic parameters from outer item //~| ERROR can't use generic parameters from outer item //~| ERROR: unresolved item provided when a constant was expected + //~| ERROR: function takes 2 lifetime arguments but 0 lifetime arguments were supplied } } @@ -47,6 +48,7 @@ mod test_2 { reuse foo:: as bar2; //~^ ERROR: function takes 3 generic arguments but 2 generic arguments were supplied + //~| ERROR: function takes 2 lifetime arguments but 0 lifetime arguments were supplied reuse foo::<'static, _, 'asdasd, 'static, 'static, 'static, _> as bar3; //~^ ERROR: use of undeclared lifetime name `'asdasd` @@ -58,10 +60,12 @@ mod test_2 { reuse foo::<1, 2, _, 4, 5, _> as bar5; //~^ ERROR: function takes 3 generic arguments but 6 generic arguments were supplied + //~| ERROR: function takes 2 lifetime arguments but 0 lifetime arguments were supplied reuse foo::<1, 2,asd,String, { let x = 0; }> as bar6; //~^ ERROR: cannot find type `asd` in this scope //~| ERROR: function takes 3 generic arguments but 5 generic arguments were supplied + //~| ERROR: function takes 2 lifetime arguments but 0 lifetime arguments were supplied reuse foo::<"asdasd", asd, "askdn", 'static, 'a> as bar7; //~^ ERROR: use of undeclared lifetime name `'a` @@ -70,6 +74,7 @@ mod test_2 { reuse foo::<{}, {}, {}> as bar8; //~^ ERROR: constant provided when a type was expected + //~| ERROR: function takes 2 lifetime arguments but 0 lifetime arguments were supplied } mod test_3 { @@ -107,12 +112,14 @@ mod test_3 { //~| ERROR: trait takes 3 lifetime arguments but 1 lifetime argument was supplied //~| ERROR: trait takes 2 generic arguments but 3 generic arguments were supplied //~| ERROR: method takes 2 generic arguments but 6 generic arguments were supplied + //~| ERROR: method takes 1 lifetime argument but 0 lifetime arguments were supplied reuse Trait::::foo::<1, 2, 3, _, 6> as bar7; //~^ ERROR: missing lifetime specifiers [E0106] //~| ERROR: trait takes 3 lifetime arguments but 1 lifetime argument was supplied //~| ERROR: trait takes 2 generic arguments but 5 generic arguments were supplied //~| ERROR: method takes 2 generic arguments but 5 generic arguments were supplied + //~| ERROR: method takes 1 lifetime argument but 0 lifetime arguments were supplied } fn main() {} diff --git a/tests/ui/delegation/generics/generics-gen-args-errors.stderr b/tests/ui/delegation/generics/generics-gen-args-errors.stderr index 6c57c3bc8d514..0489e40eefeda 100644 --- a/tests/ui/delegation/generics/generics-gen-args-errors.stderr +++ b/tests/ui/delegation/generics/generics-gen-args-errors.stderr @@ -38,7 +38,7 @@ LL | reuse foo:: as xd; = note: nested items are independent from their parent item for everything except for privacy and name resolution error[E0261]: use of undeclared lifetime name `'asdasd` - --> $DIR/generics-gen-args-errors.rs:51:29 + --> $DIR/generics-gen-args-errors.rs:53:29 | LL | reuse foo::<'static, _, 'asdasd, 'static, 'static, 'static, _> as bar3; | ^^^^^^^ undeclared lifetime @@ -49,7 +49,7 @@ LL | reuse foo'asdasd, ::<'static, _, 'asdasd, 'static, 'static, 'static, _> | ++++++++ error[E0261]: use of undeclared lifetime name `'a` - --> $DIR/generics-gen-args-errors.rs:66:50 + --> $DIR/generics-gen-args-errors.rs:70:50 | LL | reuse foo::<"asdasd", asd, "askdn", 'static, 'a> as bar7; | ^^ undeclared lifetime @@ -60,7 +60,7 @@ LL | reuse foo'a, ::<"asdasd", asd, "askdn", 'static, 'a> as bar7; | +++ error[E0106]: missing lifetime specifiers - --> $DIR/generics-gen-args-errors.rs:111:19 + --> $DIR/generics-gen-args-errors.rs:117:19 | LL | reuse Trait::::foo::<1, 2, 3, _, 6> as bar7; | ^^^^^ expected 3 lifetime parameters @@ -114,84 +114,105 @@ LL | fn check() { | +++++ error[E0425]: cannot find type `asdasd` in this scope - --> $DIR/generics-gen-args-errors.rs:55:39 + --> $DIR/generics-gen-args-errors.rs:57:39 | LL | reuse foo:: as bar4; | ^^^^^^ not found in this scope error[E0425]: cannot find type `asd` in this scope - --> $DIR/generics-gen-args-errors.rs:62:22 + --> $DIR/generics-gen-args-errors.rs:65:22 | LL | reuse foo::<1, 2,asd,String, { let x = 0; }> as bar6; | ^^^ not found in this scope error[E0425]: cannot find type `asd` in this scope - --> $DIR/generics-gen-args-errors.rs:66:27 + --> $DIR/generics-gen-args-errors.rs:70:27 | LL | reuse foo::<"asdasd", asd, "askdn", 'static, 'a> as bar7; | ^^^ not found in this scope error[E0425]: cannot find type `asd` in this scope - --> $DIR/generics-gen-args-errors.rs:80:19 + --> $DIR/generics-gen-args-errors.rs:85:19 | LL | reuse Trait::::foo as bar1; | ^^^ not found in this scope error[E0425]: cannot find type `asd` in this scope - --> $DIR/generics-gen-args-errors.rs:80:24 + --> $DIR/generics-gen-args-errors.rs:85:24 | LL | reuse Trait::::foo as bar1; | ^^^ not found in this scope error[E0425]: cannot find type `asd` in this scope - --> $DIR/generics-gen-args-errors.rs:80:29 + --> $DIR/generics-gen-args-errors.rs:85:29 | LL | reuse Trait::::foo as bar1; | ^^^ not found in this scope error[E0425]: cannot find type `asd` in this scope - --> $DIR/generics-gen-args-errors.rs:80:34 + --> $DIR/generics-gen-args-errors.rs:85:34 | LL | reuse Trait::::foo as bar1; | ^^^ not found in this scope error[E0425]: cannot find type `asd` in this scope - --> $DIR/generics-gen-args-errors.rs:80:39 + --> $DIR/generics-gen-args-errors.rs:85:39 | LL | reuse Trait::::foo as bar1; | ^^^ not found in this scope error[E0425]: cannot find type `asdasa` in this scope - --> $DIR/generics-gen-args-errors.rs:80:44 + --> $DIR/generics-gen-args-errors.rs:85:44 | LL | reuse Trait::::foo as bar1; | ^^^^^^ not found in this scope error[E0425]: cannot find type `DDDD` in this scope - --> $DIR/generics-gen-args-errors.rs:105:34 + --> $DIR/generics-gen-args-errors.rs:110:34 | LL | reuse Trait::<1, 2, 'static, DDDD>::foo::<1, 2, 3, 4, 5, 6> as bar6; | ^^^^ not found in this scope -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/generics-gen-args-errors.rs:34:27 +error[E0107]: function takes 2 lifetime arguments but 0 lifetime arguments were supplied + --> $DIR/generics-gen-args-errors.rs:34:15 | LL | reuse foo:: as xd; - | ^ + | ^^^ expected 2 lifetime arguments | -help: if this generic argument was intended as a const parameter, surround it with braces +note: function defined here, with 2 lifetime parameters: `'a`, `'b` + --> $DIR/generics-gen-args-errors.rs:7:8 | -LL | reuse foo:: as xd; - | + + +LL | fn foo<'a: 'a, 'b: 'b, T: Clone, U: Clone, const N: usize>() {} + | ^^^ -- -- +help: add missing lifetime arguments + | +LL | reuse foo::<'a, 'b, A, B, C> as xd; + | +++++++ error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/generics-gen-args-errors.rs:45:11 + --> $DIR/generics-gen-args-errors.rs:46:11 | LL | reuse foo::<> as bar1; | ^^^ not allowed in type signatures +error[E0107]: function takes 2 lifetime arguments but 0 lifetime arguments were supplied + --> $DIR/generics-gen-args-errors.rs:49:11 + | +LL | reuse foo:: as bar2; + | ^^^ expected 2 lifetime arguments + | +note: function defined here, with 2 lifetime parameters: `'a`, `'b` + --> $DIR/generics-gen-args-errors.rs:44:8 + | +LL | fn foo<'a: 'a, 'b: 'b, T: Clone, U: Clone, const N: usize>() {} + | ^^^ -- -- +help: add missing lifetime arguments + | +LL | reuse foo::<'a, 'b, String, String> as bar2; + | +++++++ + error[E0107]: function takes 3 generic arguments but 2 generic arguments were supplied - --> $DIR/generics-gen-args-errors.rs:48:11 + --> $DIR/generics-gen-args-errors.rs:49:11 | LL | reuse foo:: as bar2; | ^^^ ------ ------ supplied 2 generic arguments @@ -199,7 +220,7 @@ LL | reuse foo:: as bar2; | expected 3 generic arguments | note: function defined here, with 3 generic parameters: `T`, `U`, `N` - --> $DIR/generics-gen-args-errors.rs:43:8 + --> $DIR/generics-gen-args-errors.rs:44:8 | LL | fn foo<'a: 'a, 'b: 'b, T: Clone, U: Clone, const N: usize>() {} | ^^^ - - -------------- @@ -209,7 +230,7 @@ LL | reuse foo:: as bar2; | +++ error[E0107]: function takes 2 lifetime arguments but 5 lifetime arguments were supplied - --> $DIR/generics-gen-args-errors.rs:51:11 + --> $DIR/generics-gen-args-errors.rs:53:11 | LL | reuse foo::<'static, _, 'asdasd, 'static, 'static, 'static, _> as bar3; | ^^^ --------------------------- help: remove the lifetime arguments @@ -217,19 +238,19 @@ LL | reuse foo::<'static, _, 'asdasd, 'static, 'static, 'static, _> as bar3; | expected 2 lifetime arguments | note: function defined here, with 2 lifetime parameters: `'a`, `'b` - --> $DIR/generics-gen-args-errors.rs:43:8 + --> $DIR/generics-gen-args-errors.rs:44:8 | LL | fn foo<'a: 'a, 'b: 'b, T: Clone, U: Clone, const N: usize>() {} | ^^^ -- -- error[E0107]: function takes 3 generic arguments but 2 generic arguments were supplied - --> $DIR/generics-gen-args-errors.rs:51:11 + --> $DIR/generics-gen-args-errors.rs:53:11 | LL | reuse foo::<'static, _, 'asdasd, 'static, 'static, 'static, _> as bar3; | ^^^ expected 3 generic arguments ------- - supplied 2 generic arguments | note: function defined here, with 3 generic parameters: `T`, `U`, `N` - --> $DIR/generics-gen-args-errors.rs:43:8 + --> $DIR/generics-gen-args-errors.rs:44:8 | LL | fn foo<'a: 'a, 'b: 'b, T: Clone, U: Clone, const N: usize>() {} | ^^^ - - -------------- @@ -239,7 +260,7 @@ LL | reuse foo::<'static, _, 'asdasd, 'static, 'static, 'static, _, N> as ba | +++ error[E0107]: function takes 2 lifetime arguments but 1 lifetime argument was supplied - --> $DIR/generics-gen-args-errors.rs:55:11 + --> $DIR/generics-gen-args-errors.rs:57:11 | LL | reuse foo:: as bar4; | ^^^ ------ supplied 1 lifetime argument @@ -247,7 +268,7 @@ LL | reuse foo:: as bar4; | expected 2 lifetime arguments | note: function defined here, with 2 lifetime parameters: `'a`, `'b` - --> $DIR/generics-gen-args-errors.rs:43:8 + --> $DIR/generics-gen-args-errors.rs:44:8 | LL | fn foo<'a: 'a, 'b: 'b, T: Clone, U: Clone, const N: usize>() {} | ^^^ -- -- @@ -256,8 +277,24 @@ help: add missing lifetime argument LL | reuse foo:: as bar4; | +++++++++ +error[E0107]: function takes 2 lifetime arguments but 0 lifetime arguments were supplied + --> $DIR/generics-gen-args-errors.rs:61:11 + | +LL | reuse foo::<1, 2, _, 4, 5, _> as bar5; + | ^^^ expected 2 lifetime arguments + | +note: function defined here, with 2 lifetime parameters: `'a`, `'b` + --> $DIR/generics-gen-args-errors.rs:44:8 + | +LL | fn foo<'a: 'a, 'b: 'b, T: Clone, U: Clone, const N: usize>() {} + | ^^^ -- -- +help: add missing lifetime arguments + | +LL | reuse foo::<'a, 'b, 1, 2, _, 4, 5, _> as bar5; + | +++++++ + error[E0107]: function takes 3 generic arguments but 6 generic arguments were supplied - --> $DIR/generics-gen-args-errors.rs:59:11 + --> $DIR/generics-gen-args-errors.rs:61:11 | LL | reuse foo::<1, 2, _, 4, 5, _> as bar5; | ^^^ --------- help: remove the unnecessary generic arguments @@ -265,13 +302,29 @@ LL | reuse foo::<1, 2, _, 4, 5, _> as bar5; | expected 3 generic arguments | note: function defined here, with 3 generic parameters: `T`, `U`, `N` - --> $DIR/generics-gen-args-errors.rs:43:8 + --> $DIR/generics-gen-args-errors.rs:44:8 | LL | fn foo<'a: 'a, 'b: 'b, T: Clone, U: Clone, const N: usize>() {} | ^^^ - - -------------- +error[E0107]: function takes 2 lifetime arguments but 0 lifetime arguments were supplied + --> $DIR/generics-gen-args-errors.rs:65:11 + | +LL | reuse foo::<1, 2,asd,String, { let x = 0; }> as bar6; + | ^^^ expected 2 lifetime arguments + | +note: function defined here, with 2 lifetime parameters: `'a`, `'b` + --> $DIR/generics-gen-args-errors.rs:44:8 + | +LL | fn foo<'a: 'a, 'b: 'b, T: Clone, U: Clone, const N: usize>() {} + | ^^^ -- -- +help: add missing lifetime arguments + | +LL | reuse foo::<'a, 'b, 1, 2,asd,String, { let x = 0; }> as bar6; + | +++++++ + error[E0107]: function takes 3 generic arguments but 5 generic arguments were supplied - --> $DIR/generics-gen-args-errors.rs:62:11 + --> $DIR/generics-gen-args-errors.rs:65:11 | LL | reuse foo::<1, 2,asd,String, { let x = 0; }> as bar6; | ^^^ ----------------------- help: remove the unnecessary generic arguments @@ -279,31 +332,41 @@ LL | reuse foo::<1, 2,asd,String, { let x = 0; }> as bar6; | expected 3 generic arguments | note: function defined here, with 3 generic parameters: `T`, `U`, `N` - --> $DIR/generics-gen-args-errors.rs:43:8 + --> $DIR/generics-gen-args-errors.rs:44:8 | LL | fn foo<'a: 'a, 'b: 'b, T: Clone, U: Clone, const N: usize>() {} | ^^^ - - -------------- error[E0747]: constant provided when a type was expected - --> $DIR/generics-gen-args-errors.rs:66:17 + --> $DIR/generics-gen-args-errors.rs:70:17 | LL | reuse foo::<"asdasd", asd, "askdn", 'static, 'a> as bar7; | ^^^^^^^^ -error[E0747]: constant provided when a type was expected - --> $DIR/generics-gen-args-errors.rs:71:17 +error[E0107]: function takes 2 lifetime arguments but 0 lifetime arguments were supplied + --> $DIR/generics-gen-args-errors.rs:75:11 | LL | reuse foo::<{}, {}, {}> as bar8; - | ^^ + | ^^^ expected 2 lifetime arguments + | +note: function defined here, with 2 lifetime parameters: `'a`, `'b` + --> $DIR/generics-gen-args-errors.rs:44:8 + | +LL | fn foo<'a: 'a, 'b: 'b, T: Clone, U: Clone, const N: usize>() {} + | ^^^ -- -- +help: add missing lifetime arguments + | +LL | reuse foo::<'a, 'b, {}, {}, {}> as bar8; + | +++++++ error[E0107]: trait takes 3 lifetime arguments but 0 lifetime arguments were supplied - --> $DIR/generics-gen-args-errors.rs:80:11 + --> $DIR/generics-gen-args-errors.rs:85:11 | LL | reuse Trait::::foo as bar1; | ^^^^^ expected 3 lifetime arguments | note: trait defined here, with 3 lifetime parameters: `'b`, `'c`, `'a` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ -- -- -- @@ -313,7 +376,7 @@ LL | reuse Trait::<'b, 'c, 'a, asd, asd, asd, asd, asd, asdasa>::foo as bar1 | +++++++++++ error[E0107]: trait takes 2 generic arguments but 6 generic arguments were supplied - --> $DIR/generics-gen-args-errors.rs:80:11 + --> $DIR/generics-gen-args-errors.rs:85:11 | LL | reuse Trait::::foo as bar1; | ^^^^^ ----------------------- help: remove the unnecessary generic arguments @@ -321,13 +384,13 @@ LL | reuse Trait::::foo as bar1; | expected 2 generic arguments | note: trait defined here, with 2 generic parameters: `T`, `N` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ - -------------- error[E0107]: trait takes 3 lifetime arguments but 2 lifetime arguments were supplied - --> $DIR/generics-gen-args-errors.rs:90:11 + --> $DIR/generics-gen-args-errors.rs:95:11 | LL | reuse Trait::<'static, 'static>::foo as bar2; | ^^^^^ ------- ------- supplied 2 lifetime arguments @@ -335,7 +398,7 @@ LL | reuse Trait::<'static, 'static>::foo as bar2; | expected 3 lifetime arguments | note: trait defined here, with 3 lifetime parameters: `'b`, `'c`, `'a` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ -- -- -- @@ -345,19 +408,19 @@ LL | reuse Trait::<'static, 'static, 'static>::foo as bar2; | +++++++++ error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/generics-gen-args-errors.rs:90:11 + --> $DIR/generics-gen-args-errors.rs:95:11 | LL | reuse Trait::<'static, 'static>::foo as bar2; | ^^^^^ not allowed in type signatures error[E0107]: trait takes 3 lifetime arguments but 0 lifetime arguments were supplied - --> $DIR/generics-gen-args-errors.rs:93:11 + --> $DIR/generics-gen-args-errors.rs:98:11 | LL | reuse Trait::<1, 2, 3, 4, 5>::foo as bar3; | ^^^^^ expected 3 lifetime arguments | note: trait defined here, with 3 lifetime parameters: `'b`, `'c`, `'a` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ -- -- -- @@ -367,7 +430,7 @@ LL | reuse Trait::<'b, 'c, 'a, 1, 2, 3, 4, 5>::foo as bar3; | +++++++++++ error[E0107]: trait takes 2 generic arguments but 5 generic arguments were supplied - --> $DIR/generics-gen-args-errors.rs:93:11 + --> $DIR/generics-gen-args-errors.rs:98:11 | LL | reuse Trait::<1, 2, 3, 4, 5>::foo as bar3; | ^^^^^ --------- help: remove the unnecessary generic arguments @@ -375,19 +438,19 @@ LL | reuse Trait::<1, 2, 3, 4, 5>::foo as bar3; | expected 2 generic arguments | note: trait defined here, with 2 generic parameters: `T`, `N` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ - -------------- error[E0107]: trait takes 3 lifetime arguments but 0 lifetime arguments were supplied - --> $DIR/generics-gen-args-errors.rs:97:11 + --> $DIR/generics-gen-args-errors.rs:102:11 | LL | reuse Trait::<1, 2, true>::foo as bar4; | ^^^^^ expected 3 lifetime arguments | note: trait defined here, with 3 lifetime parameters: `'b`, `'c`, `'a` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ -- -- -- @@ -397,7 +460,7 @@ LL | reuse Trait::<'b, 'c, 'a, 1, 2, true>::foo as bar4; | +++++++++++ error[E0107]: trait takes 2 generic arguments but 3 generic arguments were supplied - --> $DIR/generics-gen-args-errors.rs:97:11 + --> $DIR/generics-gen-args-errors.rs:102:11 | LL | reuse Trait::<1, 2, true>::foo as bar4; | ^^^^^ ------ help: remove the unnecessary generic argument @@ -405,13 +468,13 @@ LL | reuse Trait::<1, 2, true>::foo as bar4; | expected 2 generic arguments | note: trait defined here, with 2 generic parameters: `T`, `N` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ - -------------- error[E0107]: trait takes 3 lifetime arguments but 1 lifetime argument was supplied - --> $DIR/generics-gen-args-errors.rs:101:11 + --> $DIR/generics-gen-args-errors.rs:106:11 | LL | reuse Trait::<'static>::foo as bar5; | ^^^^^ ------- supplied 1 lifetime argument @@ -419,7 +482,7 @@ LL | reuse Trait::<'static>::foo as bar5; | expected 3 lifetime arguments | note: trait defined here, with 3 lifetime parameters: `'b`, `'c`, `'a` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ -- -- -- @@ -429,13 +492,13 @@ LL | reuse Trait::<'static, 'static, 'static>::foo as bar5; | ++++++++++++++++++ error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/generics-gen-args-errors.rs:101:11 + --> $DIR/generics-gen-args-errors.rs:106:11 | LL | reuse Trait::<'static>::foo as bar5; | ^^^^^ not allowed in type signatures error[E0107]: trait takes 3 lifetime arguments but 1 lifetime argument was supplied - --> $DIR/generics-gen-args-errors.rs:105:11 + --> $DIR/generics-gen-args-errors.rs:110:11 | LL | reuse Trait::<1, 2, 'static, DDDD>::foo::<1, 2, 3, 4, 5, 6> as bar6; | ^^^^^ - supplied 1 lifetime argument @@ -443,7 +506,7 @@ LL | reuse Trait::<1, 2, 'static, DDDD>::foo::<1, 2, 3, 4, 5, 6> as bar6; | expected 3 lifetime arguments | note: trait defined here, with 3 lifetime parameters: `'b`, `'c`, `'a` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ -- -- -- @@ -453,7 +516,7 @@ LL | reuse Trait::<1, 'static, 'static, 2, 'static, DDDD>::foo::<1, 2, 3, 4, | ++++++++++++++++++ error[E0107]: trait takes 2 generic arguments but 3 generic arguments were supplied - --> $DIR/generics-gen-args-errors.rs:105:11 + --> $DIR/generics-gen-args-errors.rs:110:11 | LL | reuse Trait::<1, 2, 'static, DDDD>::foo::<1, 2, 3, 4, 5, 6> as bar6; | ^^^^^ --------------- help: remove the unnecessary generic argument @@ -461,13 +524,29 @@ LL | reuse Trait::<1, 2, 'static, DDDD>::foo::<1, 2, 3, 4, 5, 6> as bar6; | expected 2 generic arguments | note: trait defined here, with 2 generic parameters: `T`, `N` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ - -------------- +error[E0107]: method takes 1 lifetime argument but 0 lifetime arguments were supplied + --> $DIR/generics-gen-args-errors.rs:110:41 + | +LL | reuse Trait::<1, 2, 'static, DDDD>::foo::<1, 2, 3, 4, 5, 6> as bar6; + | ^^^ expected 1 lifetime argument + | +note: method defined here, with 1 lifetime parameter: `'d` + --> $DIR/generics-gen-args-errors.rs:82:12 + | +LL | fn foo<'d: 'd, U, const M: bool>(self) {} + | ^^^ -- +help: add missing lifetime argument + | +LL | reuse Trait::<1, 2, 'static, DDDD>::foo::<'d, 1, 2, 3, 4, 5, 6> as bar6; + | +++ + error[E0107]: method takes 2 generic arguments but 6 generic arguments were supplied - --> $DIR/generics-gen-args-errors.rs:105:41 + --> $DIR/generics-gen-args-errors.rs:110:41 | LL | reuse Trait::<1, 2, 'static, DDDD>::foo::<1, 2, 3, 4, 5, 6> as bar6; | ^^^ ------------ help: remove the unnecessary generic arguments @@ -475,13 +554,13 @@ LL | reuse Trait::<1, 2, 'static, DDDD>::foo::<1, 2, 3, 4, 5, 6> as bar6; | expected 2 generic arguments | note: method defined here, with 2 generic parameters: `U`, `M` - --> $DIR/generics-gen-args-errors.rs:77:12 + --> $DIR/generics-gen-args-errors.rs:82:12 | LL | fn foo<'d: 'd, U, const M: bool>(self) {} | ^^^ - ------------- error[E0107]: trait takes 3 lifetime arguments but 1 lifetime argument was supplied - --> $DIR/generics-gen-args-errors.rs:111:11 + --> $DIR/generics-gen-args-errors.rs:117:11 | LL | reuse Trait::::foo::<1, 2, 3, _, 6> as bar7; | ^^^^^ ----- supplied 1 lifetime argument @@ -489,7 +568,7 @@ LL | reuse Trait::::foo::<1, 2, 3, _, | expected 3 lifetime arguments | note: trait defined here, with 3 lifetime parameters: `'b`, `'c`, `'a` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ -- -- -- @@ -499,7 +578,7 @@ LL | reuse Trait::: | ++++++++++++++++++ error[E0107]: trait takes 2 generic arguments but 5 generic arguments were supplied - --> $DIR/generics-gen-args-errors.rs:111:11 + --> $DIR/generics-gen-args-errors.rs:117:11 | LL | reuse Trait::::foo::<1, 2, 3, _, 6> as bar7; | ^^^^^ --- help: remove the unnecessary generic argument @@ -507,13 +586,29 @@ LL | reuse Trait::::foo::<1, 2, 3, _, | expected 2 generic arguments | note: trait defined here, with 2 generic parameters: `T`, `N` - --> $DIR/generics-gen-args-errors.rs:76:11 + --> $DIR/generics-gen-args-errors.rs:81:11 | LL | trait Trait<'b, 'c, 'a, T, const N: usize>: Sized { | ^^^^^ - -------------- +error[E0107]: method takes 1 lifetime argument but 0 lifetime arguments were supplied + --> $DIR/generics-gen-args-errors.rs:117:59 + | +LL | reuse Trait::::foo::<1, 2, 3, _, 6> as bar7; + | ^^^ expected 1 lifetime argument + | +note: method defined here, with 1 lifetime parameter: `'d` + --> $DIR/generics-gen-args-errors.rs:82:12 + | +LL | fn foo<'d: 'd, U, const M: bool>(self) {} + | ^^^ -- +help: add missing lifetime argument + | +LL | reuse Trait::::foo::<'d, 1, 2, 3, _, 6> as bar7; + | +++ + error[E0107]: method takes 2 generic arguments but 5 generic arguments were supplied - --> $DIR/generics-gen-args-errors.rs:111:59 + --> $DIR/generics-gen-args-errors.rs:117:59 | LL | reuse Trait::::foo::<1, 2, 3, _, 6> as bar7; | ^^^ --------- help: remove the unnecessary generic arguments @@ -521,11 +616,28 @@ LL | reuse Trait::::foo::<1, 2, 3, _, | expected 2 generic arguments | note: method defined here, with 2 generic parameters: `U`, `M` - --> $DIR/generics-gen-args-errors.rs:77:12 + --> $DIR/generics-gen-args-errors.rs:82:12 | LL | fn foo<'d: 'd, U, const M: bool>(self) {} | ^^^ - ------------- +error[E0747]: unresolved item provided when a constant was expected + --> $DIR/generics-gen-args-errors.rs:34:27 + | +LL | reuse foo:: as xd; + | ^ + | +help: if this generic argument was intended as a const parameter, surround it with braces + | +LL | reuse foo:: as xd; + | + + + +error[E0747]: constant provided when a type was expected + --> $DIR/generics-gen-args-errors.rs:75:17 + | +LL | reuse foo::<{}, {}, {}> as bar8; + | ^^ + error[E0107]: function takes 3 generic arguments but 6 generic arguments were supplied --> $DIR/generics-gen-args-errors.rs:11:9 | @@ -585,7 +697,7 @@ help: if this generic argument was intended as a const parameter, surround it wi LL | bar::(); | + + -error: aborting due to 51 previous errors +error: aborting due to 58 previous errors Some errors have detailed explanations: E0106, E0107, E0121, E0261, E0401, E0423, E0425, E0747. For more information about an error, try `rustc --explain E0106`. diff --git a/tests/ui/delegation/generics/mapping/free-to-free-pass.rs b/tests/ui/delegation/generics/mapping/free-to-free-pass.rs index c67e4c02a1b78..2b877cc668ff3 100644 --- a/tests/ui/delegation/generics/mapping/free-to-free-pass.rs +++ b/tests/ui/delegation/generics/mapping/free-to-free-pass.rs @@ -2,7 +2,6 @@ #![feature(fn_delegation)] #![allow(incomplete_features)] -#![allow(late_bound_lifetime_arguments)] //! This is one of the mapping tests, which tests mapping of delegee parent and child //! generic params, whose main goal is to create cases with diff --git a/tests/ui/delegation/generics/mapping/free-to-trait-pass.rs b/tests/ui/delegation/generics/mapping/free-to-trait-pass.rs index 04c8da0c81a95..0aa3798cdbef8 100644 --- a/tests/ui/delegation/generics/mapping/free-to-trait-pass.rs +++ b/tests/ui/delegation/generics/mapping/free-to-trait-pass.rs @@ -2,7 +2,6 @@ #![feature(fn_delegation)] #![allow(incomplete_features)] -#![allow(late_bound_lifetime_arguments)] //! This is one of the mapping tests, which tests mapping of delegee parent and child //! generic params, whose main goal is to create cases with diff --git a/tests/ui/delegation/generics/mapping/inherent-impl-to-free-pass.rs b/tests/ui/delegation/generics/mapping/inherent-impl-to-free-pass.rs index 69e0523a0c995..7d99bc753cc2e 100644 --- a/tests/ui/delegation/generics/mapping/inherent-impl-to-free-pass.rs +++ b/tests/ui/delegation/generics/mapping/inherent-impl-to-free-pass.rs @@ -2,7 +2,6 @@ #![feature(fn_delegation)] #![allow(incomplete_features)] -#![allow(late_bound_lifetime_arguments)] //! This is one of the mapping tests, which tests mapping of delegee parent and child //! generic params, whose main goal is to create cases with diff --git a/tests/ui/delegation/generics/mapping/trait-to-free-pass.rs b/tests/ui/delegation/generics/mapping/trait-to-free-pass.rs index 52e0a9c89394b..c43dc41931e9d 100644 --- a/tests/ui/delegation/generics/mapping/trait-to-free-pass.rs +++ b/tests/ui/delegation/generics/mapping/trait-to-free-pass.rs @@ -2,7 +2,6 @@ #![feature(fn_delegation)] #![allow(incomplete_features)] -#![allow(late_bound_lifetime_arguments)] //! This is one of the mapping tests, which tests mapping of delegee parent and child //! generic params, whose main goal is to create cases with diff --git a/tests/ui/delegation/generics/unelided-lifetime-ice-154178.rs b/tests/ui/delegation/generics/unelided-lifetime-ice-154178.rs new file mode 100644 index 0000000000000..3a53aad7132a5 --- /dev/null +++ b/tests/ui/delegation/generics/unelided-lifetime-ice-154178.rs @@ -0,0 +1,12 @@ +//@ compile-flags: -Z deduplicate-diagnostics=yes + +#![feature(fn_delegation)] + +fn foo<'b: 'b, const N: usize>() {} + +trait Trait { + reuse foo::<1>; + //~^ ERROR: function takes 1 lifetime argument but 0 lifetime arguments were supplied +} + +fn main() {} diff --git a/tests/ui/delegation/generics/unelided-lifetime-ice-154178.stderr b/tests/ui/delegation/generics/unelided-lifetime-ice-154178.stderr new file mode 100644 index 0000000000000..3938e66d71c95 --- /dev/null +++ b/tests/ui/delegation/generics/unelided-lifetime-ice-154178.stderr @@ -0,0 +1,19 @@ +error[E0107]: function takes 1 lifetime argument but 0 lifetime arguments were supplied + --> $DIR/unelided-lifetime-ice-154178.rs:8:11 + | +LL | reuse foo::<1>; + | ^^^ expected 1 lifetime argument + | +note: function defined here, with 1 lifetime parameter: `'b` + --> $DIR/unelided-lifetime-ice-154178.rs:5:4 + | +LL | fn foo<'b: 'b, const N: usize>() {} + | ^^^ -- +help: add missing lifetime argument + | +LL | reuse foo::<'b, 1>; + | +++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/eii/eii-declaration-not-fn-issue-152337.rs b/tests/ui/eii/eii-declaration-not-fn-issue-152337.rs new file mode 100644 index 0000000000000..8564a5a748477 --- /dev/null +++ b/tests/ui/eii/eii-declaration-not-fn-issue-152337.rs @@ -0,0 +1,12 @@ +// Regression test for ICE "unexpected sort of node in fn_sig()" (issue #152337). +// When the same name is used for a const and an #[eii] function, the declaration +// was incorrectly resolved to the const, causing fn_sig() to be called on a non-function. +#![feature(extern_item_impls)] + +const A: () = (); +#[eii] +fn A() {} //~ ERROR the name `A` is defined multiple times +//~^ ERROR expected function, found constant +//~| ERROR expected function, found constant + +fn main() {} diff --git a/tests/ui/eii/eii-declaration-not-fn-issue-152337.stderr b/tests/ui/eii/eii-declaration-not-fn-issue-152337.stderr new file mode 100644 index 0000000000000..ea4ec604e7aa4 --- /dev/null +++ b/tests/ui/eii/eii-declaration-not-fn-issue-152337.stderr @@ -0,0 +1,27 @@ +error[E0428]: the name `A` is defined multiple times + --> $DIR/eii-declaration-not-fn-issue-152337.rs:8:1 + | +LL | const A: () = (); + | ----------------- previous definition of the value `A` here +LL | #[eii] +LL | fn A() {} + | ^^^^^^ `A` redefined here + | + = note: `A` must be defined only once in the value namespace of this module + +error[E0423]: expected function, found constant `self::A` + --> $DIR/eii-declaration-not-fn-issue-152337.rs:8:4 + | +LL | fn A() {} + | ^ not a function + +error[E0423]: expected function, found constant `A` + --> $DIR/eii-declaration-not-fn-issue-152337.rs:8:4 + | +LL | fn A() {} + | ^ not a function + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0423, E0428. +For more information about an error, try `rustc --explain E0423`. diff --git a/tests/ui/eii/eii_impl_with_contract.rs b/tests/ui/eii/eii_impl_with_contract.rs new file mode 100644 index 0000000000000..43d34c294a79c --- /dev/null +++ b/tests/ui/eii/eii_impl_with_contract.rs @@ -0,0 +1,20 @@ +//@ run-pass +//@ ignore-backends: gcc +//@ ignore-windows + +#![feature(extern_item_impls)] +#![feature(contracts)] +#![allow(incomplete_features)] + +#[eii(hello)] +fn hello(x: u64); + +#[hello] +#[core::contracts::requires(x > 0)] +fn hello_impl(x: u64) { + println!("{x:?}") +} + +fn main() { + hello(42); +} diff --git a/tests/ui/eii/ice_contract_attr_on_eii_generated_item.rs b/tests/ui/eii/ice_contract_attr_on_eii_generated_item.rs new file mode 100644 index 0000000000000..fce142f6dc08b --- /dev/null +++ b/tests/ui/eii/ice_contract_attr_on_eii_generated_item.rs @@ -0,0 +1,11 @@ +//@ compile-flags: --crate-type rlib + +#![feature(extern_item_impls)] +#![feature(contracts)] +#![allow(incomplete_features)] + +#[eii] +#[core::contracts::ensures] +//~^ ERROR contract annotations is only supported in functions with bodies +//~| ERROR contract annotations can only be used on functions +fn implementation(); diff --git a/tests/ui/eii/ice_contract_attr_on_eii_generated_item.stderr b/tests/ui/eii/ice_contract_attr_on_eii_generated_item.stderr new file mode 100644 index 0000000000000..3335346e55eec --- /dev/null +++ b/tests/ui/eii/ice_contract_attr_on_eii_generated_item.stderr @@ -0,0 +1,14 @@ +error: contract annotations is only supported in functions with bodies + --> $DIR/ice_contract_attr_on_eii_generated_item.rs:8:1 + | +LL | #[core::contracts::ensures] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: contract annotations can only be used on functions + --> $DIR/ice_contract_attr_on_eii_generated_item.rs:8:1 + | +LL | #[core::contracts::ensures] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/tests/ui/enum-discriminant/wrapping_niche.rs b/tests/ui/enum-discriminant/wrapping_niche.rs index 8097414be687f..d16645bb20821 100644 --- a/tests/ui/enum-discriminant/wrapping_niche.rs +++ b/tests/ui/enum-discriminant/wrapping_niche.rs @@ -4,7 +4,7 @@ #![feature(rustc_attrs)] #[repr(u16)] -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] enum UnsignedAroundZero { //~^ ERROR: layout_of A = 65535, @@ -13,7 +13,7 @@ enum UnsignedAroundZero { } #[repr(i16)] -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] enum SignedAroundZero { //~^ ERROR: layout_of A = -1, diff --git a/tests/ui/impl-trait/erased-regions-in-hidden-ty.rs b/tests/ui/impl-trait/erased-regions-in-hidden-ty.rs index 766c37419cd80..2e2cbad35b7cc 100644 --- a/tests/ui/impl-trait/erased-regions-in-hidden-ty.rs +++ b/tests/ui/impl-trait/erased-regions-in-hidden-ty.rs @@ -5,7 +5,7 @@ //@ normalize-stderr: "DefId\([^\)]+\)" -> "DefId(..)" #![feature(rustc_attrs)] -#![rustc_hidden_type_of_opaques] +#![rustc_dump_hidden_type_of_opaques] // Make sure that the compiler can handle `ReErased` in the hidden type of an opaque. diff --git a/tests/ui/impl-trait/in-trait/dump.rs b/tests/ui/impl-trait/in-trait/dump.rs index 0a951b4fd99ad..5db5e4e70a8e7 100644 --- a/tests/ui/impl-trait/in-trait/dump.rs +++ b/tests/ui/impl-trait/in-trait/dump.rs @@ -1,7 +1,7 @@ //@ compile-flags: -Zverbose-internals #![feature(rustc_attrs)] -#![rustc_hidden_type_of_opaques] +#![rustc_dump_hidden_type_of_opaques] trait Foo { fn hello(&self) -> impl Sized; diff --git a/tests/ui/layout/debug.rs b/tests/ui/layout/debug.rs index 60415911d38e9..0c3e5bc92d5ba 100644 --- a/tests/ui/layout/debug.rs +++ b/tests/ui/layout/debug.rs @@ -3,49 +3,49 @@ #![feature(never_type, rustc_attrs, type_alias_impl_trait, repr_simd)] #![crate_type = "lib"] -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[derive(Copy, Clone)] enum E { Foo, Bar(!, i32, i32) } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] struct S { f1: i32, f2: (), f3: i32 } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] union U { f1: (i32, i32), f3: i32 } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type Test = Result; //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type T = impl std::fmt::Debug; //~ ERROR: layout_of #[define_opaque(T)] fn f() -> T { 0i32 } -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] pub union V { //~ ERROR: layout_of a: [u16; 0], b: u8, } -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] pub union W { //~ ERROR: layout_of b: u8, a: [u16; 0], } -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] pub union Y { //~ ERROR: layout_of b: [u8; 0], a: [u16; 0], } -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(packed(1))] union P1 { x: u32 } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(packed(1))] union P2 { x: (u32, u32) } //~ ERROR: layout_of @@ -53,38 +53,38 @@ union P2 { x: (u32, u32) } //~ ERROR: layout_of #[derive(Copy, Clone)] struct F32x4([f32; 4]); -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(packed(1))] union P3 { x: F32x4 } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(packed(1))] union P4 { x: E } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(packed(1))] union P5 { zst: [u16; 0], byte: u8 } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type X = std::mem::MaybeUninit; //~ ERROR: layout_of -#[rustc_layout(debug)] //~ ERROR: cannot be used on constants +#[rustc_dump_layout(debug)] //~ ERROR: cannot be used on constants const C: () = (); impl S { - #[rustc_layout(debug)] //~ ERROR: cannot be used on associated consts + #[rustc_dump_layout(debug)] //~ ERROR: cannot be used on associated consts const C: () = (); } -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type Impossible = (str, str); //~ ERROR: cannot be known at compilation time // Test that computing the layout of an empty union doesn't ICE. -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] union EmptyUnion {} //~ ERROR: has an unknown layout //~^ ERROR: unions cannot have zero fields // Test the error message of `LayoutError::TooGeneric` // (this error is never emitted to users). -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type TooGeneric = T; //~ ERROR: does not have a fixed layout diff --git a/tests/ui/layout/debug.stderr b/tests/ui/layout/debug.stderr index c92f876fa5a13..e66e13f0ebb7c 100644 --- a/tests/ui/layout/debug.stderr +++ b/tests/ui/layout/debug.stderr @@ -4,21 +4,21 @@ error: unions cannot have zero fields LL | union EmptyUnion {} | ^^^^^^^^^^^^^^^^^^^ -error: `#[rustc_layout]` attribute cannot be used on constants +error: `#[rustc_dump_layout]` attribute cannot be used on constants --> $DIR/debug.rs:71:1 | -LL | #[rustc_layout(debug)] - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_layout(debug)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_layout]` can be applied to data types and type aliases + = help: `#[rustc_dump_layout]` can be applied to data types and type aliases -error: `#[rustc_layout]` attribute cannot be used on associated consts +error: `#[rustc_dump_layout]` attribute cannot be used on associated consts --> $DIR/debug.rs:75:5 | -LL | #[rustc_layout(debug)] - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_layout(debug)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_layout]` can be applied to data types and type aliases + = help: `#[rustc_dump_layout]` can be applied to data types and type aliases error: layout_of(E) = Layout { size: Size(12 bytes), diff --git a/tests/ui/layout/enum-scalar-pair-int-ptr.rs b/tests/ui/layout/enum-scalar-pair-int-ptr.rs index 60cada5e05a8c..184f61fe79653 100644 --- a/tests/ui/layout/enum-scalar-pair-int-ptr.rs +++ b/tests/ui/layout/enum-scalar-pair-int-ptr.rs @@ -8,8 +8,8 @@ #![feature(never_type)] #![crate_type = "lib"] -#[rustc_layout(abi)] -enum ScalarPairPointerWithInt { //~ERROR: abi: ScalarPair +#[rustc_dump_layout(backend_repr)] +enum ScalarPairPointerWithInt { //~ERROR: backend_repr: ScalarPair A(usize), B(Box<()>), } @@ -17,8 +17,8 @@ enum ScalarPairPointerWithInt { //~ERROR: abi: ScalarPair // Negative test--ensure that pointers are not commoned with integers // of a different size. (Assumes that no target has 8 bit pointers, which // feels pretty safe.) -#[rustc_layout(abi)] -enum NotScalarPairPointerWithSmallerInt { //~ERROR: abi: Memory +#[rustc_dump_layout(backend_repr)] +enum NotScalarPairPointerWithSmallerInt { //~ERROR: backend_repr: Memory A(u8), B(Box<()>), } diff --git a/tests/ui/layout/enum-scalar-pair-int-ptr.stderr b/tests/ui/layout/enum-scalar-pair-int-ptr.stderr index 357c8182ebd6f..5d54fd432371e 100644 --- a/tests/ui/layout/enum-scalar-pair-int-ptr.stderr +++ b/tests/ui/layout/enum-scalar-pair-int-ptr.stderr @@ -1,10 +1,10 @@ -error: abi: ScalarPair(Initialized { value: Int(I?, false), valid_range: $VALID_RANGE }, Initialized { value: Pointer(AddressSpace(0)), valid_range: $VALID_RANGE }) +error: backend_repr: ScalarPair(Initialized { value: Int(I?, false), valid_range: $VALID_RANGE }, Initialized { value: Pointer(AddressSpace(0)), valid_range: $VALID_RANGE }) --> $DIR/enum-scalar-pair-int-ptr.rs:12:1 | LL | enum ScalarPairPointerWithInt { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: abi: Memory { sized: true } +error: backend_repr: Memory { sized: true } --> $DIR/enum-scalar-pair-int-ptr.rs:21:1 | LL | enum NotScalarPairPointerWithSmallerInt { diff --git a/tests/ui/layout/enum.rs b/tests/ui/layout/enum.rs index c4eb943a83287..84918f64fe7ed 100644 --- a/tests/ui/layout/enum.rs +++ b/tests/ui/layout/enum.rs @@ -5,20 +5,20 @@ #![feature(never_type)] #![crate_type = "lib"] -#[rustc_layout(align)] -enum UninhabitedVariantAlign { //~ERROR: abi: Align(2 bytes) +#[rustc_dump_layout(align)] +enum UninhabitedVariantAlign { //~ERROR: align: Align(2 bytes) A([u8; 32]), B([u16; 0], !), // make sure alignment in uninhabited fields is respected } -#[rustc_layout(size)] +#[rustc_dump_layout(size)] enum UninhabitedVariantSpace { //~ERROR: size: Size(16 bytes) A, B([u8; 15], !), // make sure there is space being reserved for this field. } -#[rustc_layout(abi)] -enum ScalarPairDifferingSign { //~ERROR: abi: ScalarPair +#[rustc_dump_layout(backend_repr)] +enum ScalarPairDifferingSign { //~ERROR: backend_repr: ScalarPair A(u8), B(i8), } @@ -26,7 +26,7 @@ enum ScalarPairDifferingSign { //~ERROR: abi: ScalarPair enum Never {} // See https://github.com/rust-lang/rust/issues/146984 -#[rustc_layout(size)] +#[rustc_dump_layout(size)] #[repr(u32)] enum DefinedLayoutAllUninhabited { //~ERROR: size: Size(4 bytes) A(Never), diff --git a/tests/ui/layout/enum.stderr b/tests/ui/layout/enum.stderr index dc9a43eed10f5..3b41129456dda 100644 --- a/tests/ui/layout/enum.stderr +++ b/tests/ui/layout/enum.stderr @@ -1,4 +1,4 @@ -error: align: AbiAlign { abi: Align(2 bytes) } +error: align: Align(2 bytes) --> $DIR/enum.rs:9:1 | LL | enum UninhabitedVariantAlign { @@ -10,7 +10,7 @@ error: size: Size(16 bytes) LL | enum UninhabitedVariantSpace { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: abi: ScalarPair(Initialized { value: Int(I8, false), valid_range: 0..=1 }, Initialized { value: Int(I8, false), valid_range: 0..=255 }) +error: backend_repr: ScalarPair(Initialized { value: Int(I8, false), valid_range: 0..=1 }, Initialized { value: Int(I8, false), valid_range: 0..=255 }) --> $DIR/enum.rs:21:1 | LL | enum ScalarPairDifferingSign { diff --git a/tests/ui/layout/gce-rigid-const-in-array-len.rs b/tests/ui/layout/gce-rigid-const-in-array-len.rs index d8cc415ba1c24..74852243f613b 100644 --- a/tests/ui/layout/gce-rigid-const-in-array-len.rs +++ b/tests/ui/layout/gce-rigid-const-in-array-len.rs @@ -21,7 +21,7 @@ trait A { const B: usize; } -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] struct S([u8; ::B]) //~ ERROR: the type `[u8; ::B]` has an unknown layout where u8: A; diff --git a/tests/ui/layout/hexagon-enum.rs b/tests/ui/layout/hexagon-enum.rs index 517c1cb3d5cfc..76f1bd5022118 100644 --- a/tests/ui/layout/hexagon-enum.rs +++ b/tests/ui/layout/hexagon-enum.rs @@ -14,24 +14,24 @@ extern crate minicore; use minicore::*; -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(C)] enum A { Apple } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(C)] enum B { Banana = 255, } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(C)] enum C { Chaenomeles = 256, } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(C)] enum P { Peach = 0x1000_0000isize, } //~ ERROR: layout_of const TANGERINE: usize = 0x8100_0000; // hack to get negative numbers without negation operator! -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(C)] enum T { Tangerine = TANGERINE as isize } //~ ERROR: layout_of diff --git a/tests/ui/layout/homogeneous-aggr-transparent.rs b/tests/ui/layout/homogeneous-aggr-transparent.rs index 9703d2bf294f6..d968d609835f7 100644 --- a/tests/ui/layout/homogeneous-aggr-transparent.rs +++ b/tests/ui/layout/homogeneous-aggr-transparent.rs @@ -21,23 +21,23 @@ union WrapperUnion { something: T, } -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type Test0 = Tuple; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type Test1 = Wrapper1; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type Test2 = Wrapper2; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type Test3 = Wrapper3; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type Test4 = WrapperUnion; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) diff --git a/tests/ui/layout/homogeneous-aggr-zero-sized-c-struct.rs b/tests/ui/layout/homogeneous-aggr-zero-sized-c-struct.rs index 7eecd99dc016a..d2d93e135206d 100644 --- a/tests/ui/layout/homogeneous-aggr-zero-sized-c-struct.rs +++ b/tests/ui/layout/homogeneous-aggr-zero-sized-c-struct.rs @@ -18,7 +18,7 @@ pub struct Middle { pub b: f32, } -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type TestMiddle = Middle; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous @@ -29,7 +29,7 @@ pub struct Final { pub foo: [Foo; 0], } -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type TestFinal = Final; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous diff --git a/tests/ui/layout/homogeneous-aggr-zero-sized-repr-rust.rs b/tests/ui/layout/homogeneous-aggr-zero-sized-repr-rust.rs index a473c5c97c0b2..2712b0ac2dd6f 100644 --- a/tests/ui/layout/homogeneous-aggr-zero-sized-repr-rust.rs +++ b/tests/ui/layout/homogeneous-aggr-zero-sized-repr-rust.rs @@ -49,23 +49,23 @@ pub struct WithEmptyRustEnum { pub _unit: EmptyRustEnum, } -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type Test1 = BaseCase; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type Test2 = WithPhantomData; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type Test3 = WithEmptyRustStruct; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type Test4 = WithTransitivelyEmptyRustStruct; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] pub type Test5 = WithEmptyRustEnum; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) })) diff --git a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs index ab7e0897ce32c..2506728e56d0f 100644 --- a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs +++ b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs @@ -13,7 +13,7 @@ enum HasNiche { // This should result in ScalarPair(Initialized, Union), // since the u8 payload will be uninit for `None`. -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] pub enum MissingPayloadField { //~ ERROR: layout_of Some(u8), None @@ -22,7 +22,7 @@ pub enum MissingPayloadField { //~ ERROR: layout_of // This should result in ScalarPair(Initialized, Initialized), // since the u8 field is present in all variants, // and hence will always be initialized. -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] pub enum CommonPayloadField { //~ ERROR: layout_of A(u8), B(u8), @@ -30,7 +30,7 @@ pub enum CommonPayloadField { //~ ERROR: layout_of // This should result in ScalarPair(Initialized, Union), // since, though a u8-sized field is present in all variants, it might be uninit. -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] pub enum CommonPayloadFieldIsMaybeUninit { //~ ERROR: layout_of A(u8), B(MaybeUninit), @@ -38,7 +38,7 @@ pub enum CommonPayloadFieldIsMaybeUninit { //~ ERROR: layout_of // This should result in ScalarPair(Initialized, Union), // since only the niche field (used for the tag) is guaranteed to be initialized. -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] pub enum NicheFirst { //~ ERROR: layout_of A(HasNiche, u8), B, @@ -47,7 +47,7 @@ pub enum NicheFirst { //~ ERROR: layout_of // This should result in ScalarPair(Union, Initialized), // since only the niche field (used for the tag) is guaranteed to be initialized. -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] pub enum NicheSecond { //~ ERROR: layout_of A(u8, HasNiche), B, diff --git a/tests/ui/layout/issue-96185-overaligned-enum.rs b/tests/ui/layout/issue-96185-overaligned-enum.rs index 19da169105cec..403928d94a93a 100644 --- a/tests/ui/layout/issue-96185-overaligned-enum.rs +++ b/tests/ui/layout/issue-96185-overaligned-enum.rs @@ -4,7 +4,7 @@ #![feature(rustc_attrs)] // This cannot use `Scalar` abi since there is padding. -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(align(8))] pub enum Aligned1 { //~ ERROR: layout_of Zero = 0, @@ -12,7 +12,7 @@ pub enum Aligned1 { //~ ERROR: layout_of } // This should use `Scalar` abi. -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(align(1))] pub enum Aligned2 { //~ ERROR: layout_of Zero = 0, diff --git a/tests/ui/layout/struct.rs b/tests/ui/layout/struct.rs index 5f652b3d570db..fc218d9fecbd0 100644 --- a/tests/ui/layout/struct.rs +++ b/tests/ui/layout/struct.rs @@ -5,8 +5,8 @@ #![feature(never_type)] #![crate_type = "lib"] -#[rustc_layout(abi)] -struct AlignedZstPreventsScalar(i16, [i32; 0]); //~ERROR: abi: Memory +#[rustc_dump_layout(backend_repr)] +struct AlignedZstPreventsScalar(i16, [i32; 0]); //~ERROR: backend_repr: Memory -#[rustc_layout(abi)] -struct AlignedZstButStillScalar(i32, [i16; 0]); //~ERROR: abi: Scalar +#[rustc_dump_layout(backend_repr)] +struct AlignedZstButStillScalar(i32, [i16; 0]); //~ERROR: backend_repr: Scalar diff --git a/tests/ui/layout/struct.stderr b/tests/ui/layout/struct.stderr index 7bc9af61ed48e..3fb18f767ca69 100644 --- a/tests/ui/layout/struct.stderr +++ b/tests/ui/layout/struct.stderr @@ -1,10 +1,10 @@ -error: abi: Memory { sized: true } +error: backend_repr: Memory { sized: true } --> $DIR/struct.rs:9:1 | LL | struct AlignedZstPreventsScalar(i16, [i32; 0]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: abi: Scalar(Initialized { value: Int(I32, true), valid_range: 0..=4294967295 }) +error: backend_repr: Scalar(Initialized { value: Int(I32, true), valid_range: 0..=4294967295 }) --> $DIR/struct.rs:12:1 | LL | struct AlignedZstButStillScalar(i32, [i16; 0]); diff --git a/tests/ui/layout/thumb-enum.rs b/tests/ui/layout/thumb-enum.rs index d65822b4647a5..7d6d98b9edd6b 100644 --- a/tests/ui/layout/thumb-enum.rs +++ b/tests/ui/layout/thumb-enum.rs @@ -14,24 +14,24 @@ extern crate minicore; use minicore::*; -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(C)] enum A { Apple } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(C)] enum B { Banana = 255, } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(C)] enum C { Chaenomeles = 256, } //~ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(C)] enum P { Peach = 0x1000_0000isize, } //~ ERROR: layout_of const TANGERINE: usize = 0x8100_0000; // hack to get negative numbers without negation operator! -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] #[repr(C)] enum T { Tangerine = TANGERINE as isize } //~ ERROR: layout_of diff --git a/tests/ui/layout/trivial-bounds-sized.rs b/tests/ui/layout/trivial-bounds-sized.rs index a32539f80fa4f..00f43d4388999 100644 --- a/tests/ui/layout/trivial-bounds-sized.rs +++ b/tests/ui/layout/trivial-bounds-sized.rs @@ -36,7 +36,7 @@ where } // This forces layout computation via the `variant_size_differences` lint. -// FIXME: This could be made more robust, possibly with a variant of `rustc_layout` +// FIXME: This could be made more robust, possibly with a variant of `rustc_dump_layout` // that doesn't error. enum Check where diff --git a/tests/ui/layout/unconstrained-param-ice-137308.rs b/tests/ui/layout/unconstrained-param-ice-137308.rs index 03b7e7599601a..463d0ef5bd8d9 100644 --- a/tests/ui/layout/unconstrained-param-ice-137308.rs +++ b/tests/ui/layout/unconstrained-param-ice-137308.rs @@ -14,7 +14,7 @@ impl A for u8 { //~ ERROR: the type parameter `C` is not constrained const B: usize = 42; } -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] struct S([u8; ::B]); //~^ ERROR: the type has an unknown layout //~| ERROR: type annotations needed diff --git a/tests/ui/layout/zero-sized-array-enum-niche.rs b/tests/ui/layout/zero-sized-array-enum-niche.rs index d3ff016d8aa23..fe7b8ebc944cb 100644 --- a/tests/ui/layout/zero-sized-array-enum-niche.rs +++ b/tests/ui/layout/zero-sized-array-enum-niche.rs @@ -10,7 +10,7 @@ // `SliceInfo<[SliceInfoElem; 0], Din, Dout>`, where that returns // `Result` ~= `Result`. // This is a close enough approximation: -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type AlignedResult = Result<[u32; 0], bool>; //~ ERROR: layout_of // The bug gave that size 1 with align 4, but the size should also be 4. // It was also using the bool niche for the enum tag, which is fine, but @@ -18,7 +18,7 @@ type AlignedResult = Result<[u32; 0], bool>; //~ ERROR: layout_of // Here's another case with multiple ZST alignments, where we should // get the maximal alignment and matching size. -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] enum MultipleAlignments { //~ ERROR: layout_of Align2([u16; 0]), Align4([u32; 0]), @@ -34,13 +34,13 @@ enum MultipleAlignments { //~ ERROR: layout_of #[repr(packed)] struct Packed(T); -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type NicheLosesToTagged = Result<[u32; 0], Packed>>; //~ ERROR: layout_of // Should get tag_encoding: Direct, size == align == 4. #[repr(u16)] enum U16IsZero { _Zero = 0 } -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type NicheWinsOverTagged = Result<[u32; 0], Packed>; //~ ERROR: layout_of // Should get tag_encoding: Niche, size == align == 4. diff --git a/tests/ui/layout/zero-sized-array-union.rs b/tests/ui/layout/zero-sized-array-union.rs index 1a662ba44677d..5b001c493b630 100644 --- a/tests/ui/layout/zero-sized-array-union.rs +++ b/tests/ui/layout/zero-sized-array-union.rs @@ -55,7 +55,7 @@ struct Baz1 { u: U1, } -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] type TestBaz1 = Baz1; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous @@ -66,7 +66,7 @@ struct Baz2 { u: U2, } -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] type TestBaz2 = Baz2; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous @@ -77,7 +77,7 @@ struct Baz3 { u: U3, } -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] type TestBaz3 = Baz3; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous @@ -88,7 +88,7 @@ struct Baz4 { u: U4, } -#[rustc_layout(homogeneous_aggregate)] +#[rustc_dump_layout(homogeneous_aggregate)] type TestBaz4 = Baz4; //~^ ERROR homogeneous_aggregate: Ok(Homogeneous diff --git a/tests/ui/lowering/expr-in-pat-issue-99380.rs b/tests/ui/lowering/expr-in-pat-issue-99380.rs index 1d4a047f717f7..9d1d369dbd69d 100644 --- a/tests/ui/lowering/expr-in-pat-issue-99380.rs +++ b/tests/ui/lowering/expr-in-pat-issue-99380.rs @@ -6,6 +6,17 @@ macro_rules! foo { }; } +macro_rules! custom_matches { + ($e:expr, $p:expr) => { + match $e { + $p => true, + _ => false, + } + }; +} + fn main() { foo!(Some(3)); //~ ERROR arbitrary expressions aren't allowed in patterns + + let _ = custom_matches!(67, 6 | 7); //~ ERROR arbitrary expressions aren't allowed in patterns } diff --git a/tests/ui/lowering/expr-in-pat-issue-99380.stderr b/tests/ui/lowering/expr-in-pat-issue-99380.stderr index 29438c9b06360..8b48e3b0150a2 100644 --- a/tests/ui/lowering/expr-in-pat-issue-99380.stderr +++ b/tests/ui/lowering/expr-in-pat-issue-99380.stderr @@ -1,10 +1,18 @@ error: arbitrary expressions aren't allowed in patterns - --> $DIR/expr-in-pat-issue-99380.rs:10:10 + --> $DIR/expr-in-pat-issue-99380.rs:19:10 | LL | foo!(Some(3)); | ^^^^^^^ | = note: the `expr` fragment specifier forces the metavariable's content to be an expression -error: aborting due to 1 previous error +error: arbitrary expressions aren't allowed in patterns + --> $DIR/expr-in-pat-issue-99380.rs:21:33 + | +LL | let _ = custom_matches!(67, 6 | 7); + | ^^^^^ + | + = note: the `expr` fragment specifier forces the metavariable's content to be an expression + +error: aborting due to 2 previous errors diff --git a/tests/ui/repr/repr-c-dead-variants.rs b/tests/ui/repr/repr-c-dead-variants.rs index 81f313646c7c2..6f379fbb9e1d1 100644 --- a/tests/ui/repr/repr-c-dead-variants.rs +++ b/tests/ui/repr/repr-c-dead-variants.rs @@ -40,14 +40,14 @@ enum Void {} // Compiler must not remove dead variants of `#[repr(C, int)]` ADTs. #[repr(C)] -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] enum Univariant { //~ ERROR layout_of Variant(Void), } // ADTs with variants that have fields must have space allocated for those fields. #[repr(C)] -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] enum TwoVariants { //~ ERROR layout_of Variant1(Void), Variant2(u8), @@ -59,7 +59,7 @@ struct Align8U64(u64); // This one is 2 x u64: we reserve space for fields in a dead branch. #[repr(C)] -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] enum DeadBranchHasOtherField { //~ ERROR layout_of Variant1(Void, Align8U64), Variant2(u8), diff --git a/tests/ui/repr/repr-c-int-dead-variants.rs b/tests/ui/repr/repr-c-int-dead-variants.rs index 723e573024402..5a9d557c057d2 100644 --- a/tests/ui/repr/repr-c-int-dead-variants.rs +++ b/tests/ui/repr/repr-c-int-dead-variants.rs @@ -11,14 +11,14 @@ enum Void {} // Compiler must not remove dead variants of `#[repr(C, int)]` ADTs. #[repr(C, u8)] -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] enum UnivariantU8 { //~ ERROR layout_of Variant(Void), } // ADTs with variants that have fields must have space allocated for those fields. #[repr(C, u8)] -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] enum TwoVariantsU8 { //~ ERROR layout_of Variant1(Void), Variant2(u8), @@ -30,7 +30,7 @@ struct Align8U64(u64); // This one is 2 x u64: we reserve space for fields in a dead branch. #[repr(C, u8)] -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] enum DeadBranchHasOtherFieldU8 { //~ ERROR layout_of Variant1(Void, Align8U64), Variant2(u8), diff --git a/tests/ui/symbol-names/basic.legacy.stderr b/tests/ui/symbol-names/basic.legacy.stderr index a028f4331725e..8594a62fc9488 100644 --- a/tests/ui/symbol-names/basic.legacy.stderr +++ b/tests/ui/symbol-names/basic.legacy.stderr @@ -1,26 +1,26 @@ error: symbol-name(_ZN5basic4main17h1dddcfd03744167fE) --> $DIR/basic.rs:8:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(basic::main::h1dddcfd03744167f) --> $DIR/basic.rs:8:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(basic::main) --> $DIR/basic.rs:8:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: def-path(main) --> $DIR/basic.rs:15:1 | -LL | #[rustc_def_path] - | ^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_def_path] + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/tests/ui/symbol-names/basic.rs b/tests/ui/symbol-names/basic.rs index 839dda2b3a3be..d4c23f988384a 100644 --- a/tests/ui/symbol-names/basic.rs +++ b/tests/ui/symbol-names/basic.rs @@ -5,14 +5,14 @@ #![feature(rustc_attrs)] -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //[legacy]~^ ERROR symbol-name(_ZN5basic4main //[legacy]~| ERROR demangling(basic::main //[legacy]~| ERROR demangling-alt(basic::main) //[v0]~^^^^ ERROR symbol-name(_RNv //[v0]~| ERROR demangling(basic[ //[v0]~| ERROR demangling-alt(basic::main) -#[rustc_def_path] +#[rustc_dump_def_path] //[legacy]~^ ERROR def-path(main) //[v0]~^^ ERROR def-path(main) fn main() { diff --git a/tests/ui/symbol-names/basic.v0.stderr b/tests/ui/symbol-names/basic.v0.stderr index 17c6d0ce704c4..6a9da17eebe03 100644 --- a/tests/ui/symbol-names/basic.v0.stderr +++ b/tests/ui/symbol-names/basic.v0.stderr @@ -1,26 +1,26 @@ error: symbol-name(_RNvCsCRATE_HASH_5basic4main) --> $DIR/basic.rs:8:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(basic[a90d658f4748b9d1]::main) --> $DIR/basic.rs:8:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(basic::main) --> $DIR/basic.rs:8:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: def-path(main) --> $DIR/basic.rs:15:1 | -LL | #[rustc_def_path] - | ^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_def_path] + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/tests/ui/symbol-names/const-generics-demangling.legacy.stderr b/tests/ui/symbol-names/const-generics-demangling.legacy.stderr index bebbb7aac981c..a2331da13c414 100644 --- a/tests/ui/symbol-names/const-generics-demangling.legacy.stderr +++ b/tests/ui/symbol-names/const-generics-demangling.legacy.stderr @@ -1,74 +1,74 @@ error: symbol-name(_ZN1c21Unsigned$LT$11_u8$GT$1f17h[HASH]E) --> $DIR/const-generics-demangling.rs:13:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(c::Unsigned<11_u8>::f::h[HASH]) --> $DIR/const-generics-demangling.rs:13:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(c::Unsigned<11_u8>::f) --> $DIR/const-generics-demangling.rs:13:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1c22Signed$LT$.152_i16$GT$1f17h[HASH]E) --> $DIR/const-generics-demangling.rs:26:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(c::Signed<.152_i16>::f::h[HASH]) --> $DIR/const-generics-demangling.rs:26:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(c::Signed<.152_i16>::f) --> $DIR/const-generics-demangling.rs:26:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1c13Bool$LT$_$GT$1f17h[HASH]E) --> $DIR/const-generics-demangling.rs:39:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(c::Bool<_>::f::h[HASH]) --> $DIR/const-generics-demangling.rs:39:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(c::Bool<_>::f) --> $DIR/const-generics-demangling.rs:39:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1c13Char$LT$_$GT$1f17h[HASH]E) --> $DIR/const-generics-demangling.rs:52:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(c::Char<_>::f::h[HASH]) --> $DIR/const-generics-demangling.rs:52:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(c::Char<_>::f) --> $DIR/const-generics-demangling.rs:52:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 12 previous errors diff --git a/tests/ui/symbol-names/const-generics-demangling.rs b/tests/ui/symbol-names/const-generics-demangling.rs index 9c078d4192a9a..e32ab180fab28 100644 --- a/tests/ui/symbol-names/const-generics-demangling.rs +++ b/tests/ui/symbol-names/const-generics-demangling.rs @@ -10,7 +10,7 @@ pub struct Unsigned; impl Unsigned<11> { - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[v0]~^ ERROR symbol-name(_RNvMCs //[v0]~| ERROR demangling(>::f) @@ -23,7 +23,7 @@ impl Unsigned<11> { pub struct Signed; impl Signed<-152> { - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[v0]~^ ERROR symbol-name(_RNvMs_Cs //[v0]~| ERROR demangling(>::f) @@ -36,7 +36,7 @@ impl Signed<-152> { pub struct Bool; impl Bool { - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[v0]~^ ERROR symbol-name(_RNvMs0_Cs //[v0]~| ERROR demangling(>::f) @@ -49,7 +49,7 @@ impl Bool { pub struct Char; impl Char<'∂'> { - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[v0]~^ ERROR symbol-name(_RNvMs1_Cs //[v0]~| ERROR demangling(>::f) diff --git a/tests/ui/symbol-names/const-generics-demangling.v0.stderr b/tests/ui/symbol-names/const-generics-demangling.v0.stderr index 7238a849332ad..25fe5873389e7 100644 --- a/tests/ui/symbol-names/const-generics-demangling.v0.stderr +++ b/tests/ui/symbol-names/const-generics-demangling.v0.stderr @@ -1,74 +1,74 @@ error: symbol-name(_RNvMCsCRATE_HASH_1cINtB_8UnsignedKhb_E1f) --> $DIR/const-generics-demangling.rs:13:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>::f) --> $DIR/const-generics-demangling.rs:13:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>::f) --> $DIR/const-generics-demangling.rs:13:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RNvMs_CsCRATE_HASH_1cINtB_6SignedKsn98_E1f) --> $DIR/const-generics-demangling.rs:26:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>::f) --> $DIR/const-generics-demangling.rs:26:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>::f) --> $DIR/const-generics-demangling.rs:26:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RNvMs0_CsCRATE_HASH_1cINtB_4BoolKb1_E1f) --> $DIR/const-generics-demangling.rs:39:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>::f) --> $DIR/const-generics-demangling.rs:39:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>::f) --> $DIR/const-generics-demangling.rs:39:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RNvMs1_CsCRATE_HASH_1cINtB_4CharKc2202_E1f) --> $DIR/const-generics-demangling.rs:52:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>::f) --> $DIR/const-generics-demangling.rs:52:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>::f) --> $DIR/const-generics-demangling.rs:52:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 12 previous errors diff --git a/tests/ui/symbol-names/const-generics-str-demangling.rs b/tests/ui/symbol-names/const-generics-str-demangling.rs index 94c3b4c44488d..90a79fd5bf7d9 100644 --- a/tests/ui/symbol-names/const-generics-str-demangling.rs +++ b/tests/ui/symbol-names/const-generics-str-demangling.rs @@ -6,37 +6,37 @@ pub struct Str; -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) impl Str<"abc"> {} -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) impl Str<"'"> {} -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) impl Str<"\t\n"> {} -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) impl Str<"∂ü"> {} -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) impl Str<"საჭმელად_გემრიელი_სადილი"> {} -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) diff --git a/tests/ui/symbol-names/const-generics-str-demangling.stderr b/tests/ui/symbol-names/const-generics-str-demangling.stderr index 06d3cdda2f833..09c3f7ca743fa 100644 --- a/tests/ui/symbol-names/const-generics-str-demangling.stderr +++ b/tests/ui/symbol-names/const-generics-str-demangling.stderr @@ -1,110 +1,110 @@ error: symbol-name(_RMCsCRATE_HASH_1cINtB_3StrKRe616263_E) --> $DIR/const-generics-str-demangling.rs:9:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/const-generics-str-demangling.rs:9:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/const-generics-str-demangling.rs:9:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs_CsCRATE_HASH_1cINtB_3StrKRe27_E) --> $DIR/const-generics-str-demangling.rs:15:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/const-generics-str-demangling.rs:15:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/const-generics-str-demangling.rs:15:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs0_CsCRATE_HASH_1cINtB_3StrKRe090a_E) --> $DIR/const-generics-str-demangling.rs:21:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/const-generics-str-demangling.rs:21:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/const-generics-str-demangling.rs:21:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs1_CsCRATE_HASH_1cINtB_3StrKRee28882c3bc_E) --> $DIR/const-generics-str-demangling.rs:27:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/const-generics-str-demangling.rs:27:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/const-generics-str-demangling.rs:27:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs2_CsCRATE_HASH_1cINtB_3StrKRee183a1e18390e183ade1839be18394e1839ae18390e183935fe18392e18394e1839be183a0e18398e18394e1839ae183985fe183a1e18390e18393e18398e1839ae18398_E) --> $DIR/const-generics-str-demangling.rs:33:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/const-generics-str-demangling.rs:33:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/const-generics-str-demangling.rs:33:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs3_CsCRATE_HASH_1cINtB_3StrKRef09f908af09fa688f09fa686f09f90ae20c2a720f09f90b6f09f9192e29895f09f94a520c2a720f09fa7a1f09f929bf09f929af09f9299f09f929c_E) --> $DIR/const-generics-str-demangling.rs:39:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/const-generics-str-demangling.rs:39:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/const-generics-str-demangling.rs:39:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 18 previous errors diff --git a/tests/ui/symbol-names/const-generics-structural-demangling.rs b/tests/ui/symbol-names/const-generics-structural-demangling.rs index 0b4af61f99101..a9a11d0ea8a4f 100644 --- a/tests/ui/symbol-names/const-generics-structural-demangling.rs +++ b/tests/ui/symbol-names/const-generics-structural-demangling.rs @@ -10,7 +10,7 @@ use std::marker::ConstParamTy; pub struct RefByte; -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) @@ -20,7 +20,7 @@ impl RefByte<{ &123 }> {} // but that is currently not allowed in const generics. pub struct RefZst; -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) @@ -28,7 +28,7 @@ impl RefZst<{ &[] }> {} pub struct Array3Bytes; -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) @@ -36,7 +36,7 @@ impl Array3Bytes<{ [1, 2, 3] }> {} pub struct TupleByteBool; -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) @@ -52,7 +52,7 @@ pub struct OptionUsize>; // HACK(eddyb) the full mangling is only in `.stderr` because we can normalize // the `core` disambiguator hash away there, but not here. -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(::None}>>) @@ -60,7 +60,7 @@ impl OptionUsize<{ MyOption::None }> {} // HACK(eddyb) the full mangling is only in `.stderr` because we can normalize // the `core` disambiguator hash away there, but not here. -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(::Some(0)}>>) @@ -74,7 +74,7 @@ pub struct Foo { } pub struct Foo_; -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) @@ -90,7 +90,7 @@ macro duplicate_field_name_test($x:ident) { } pub struct Bar_; - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //~^ ERROR symbol-name //~| ERROR demangling //~| ERROR demangling-alt(>) diff --git a/tests/ui/symbol-names/const-generics-structural-demangling.stderr b/tests/ui/symbol-names/const-generics-structural-demangling.stderr index 270c126e3f553..3ec255b3e2359 100644 --- a/tests/ui/symbol-names/const-generics-structural-demangling.stderr +++ b/tests/ui/symbol-names/const-generics-structural-demangling.stderr @@ -1,134 +1,134 @@ error: symbol-name(_RMCsCRATE_HASH_1cINtB_7RefByteKRh7b_E) --> $DIR/const-generics-structural-demangling.rs:13:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/const-generics-structural-demangling.rs:13:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/const-generics-structural-demangling.rs:13:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs_CsCRATE_HASH_1cINtB_6RefZstKRAEE) --> $DIR/const-generics-structural-demangling.rs:23:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/const-generics-structural-demangling.rs:23:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/const-generics-structural-demangling.rs:23:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs0_CsCRATE_HASH_1cINtB_11Array3BytesKAh1_h2_h3_EE) --> $DIR/const-generics-structural-demangling.rs:31:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/const-generics-structural-demangling.rs:31:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/const-generics-structural-demangling.rs:31:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs1_CsCRATE_HASH_1cINtB_13TupleByteBoolKTh1_b0_EE) --> $DIR/const-generics-structural-demangling.rs:39:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/const-generics-structural-demangling.rs:39:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/const-generics-structural-demangling.rs:39:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs2_CsCRATE_HASH_1cINtB_11OptionUsizeKVNtINtB_8MyOptionjE4NoneUE) --> $DIR/const-generics-structural-demangling.rs:55:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(::None}>>) --> $DIR/const-generics-structural-demangling.rs:55:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(::None}>>) --> $DIR/const-generics-structural-demangling.rs:55:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs3_CsCRATE_HASH_1cINtB_11OptionUsizeKVNtINtB_8MyOptionjE4SomeTj0_EE) --> $DIR/const-generics-structural-demangling.rs:63:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(::Some(0usize)}>>) --> $DIR/const-generics-structural-demangling.rs:63:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(::Some(0)}>>) --> $DIR/const-generics-structural-demangling.rs:63:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs4_CsCRATE_HASH_1cINtB_4Foo_KVNtB_3FooS1sRe616263_2chc78_5sliceRAh1_h2_h3_EEE) --> $DIR/const-generics-structural-demangling.rs:77:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/const-generics-structural-demangling.rs:77:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/const-generics-structural-demangling.rs:77:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsd_CsCRATE_HASH_1cINtB_4Bar_KVNtB_3BarS1xh7b_s_1xt1000_EE) --> $DIR/const-generics-structural-demangling.rs:93:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ ... LL | duplicate_field_name_test!(x); | ----------------------------- in this macro invocation @@ -138,8 +138,8 @@ LL | duplicate_field_name_test!(x); error: demangling(>) --> $DIR/const-generics-structural-demangling.rs:93:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ ... LL | duplicate_field_name_test!(x); | ----------------------------- in this macro invocation @@ -149,8 +149,8 @@ LL | duplicate_field_name_test!(x); error: demangling-alt(>) --> $DIR/const-generics-structural-demangling.rs:93:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ ... LL | duplicate_field_name_test!(x); | ----------------------------- in this macro invocation diff --git a/tests/ui/symbol-names/const-in-global-asm.rs b/tests/ui/symbol-names/const-in-global-asm.rs index 16aa15d9a2994..52c345f09bb74 100644 --- a/tests/ui/symbol-names/const-in-global-asm.rs +++ b/tests/ui/symbol-names/const-in-global-asm.rs @@ -7,8 +7,8 @@ // Test that a symbol in a `global_asm` namespace doesn't cause an ICE during v0 symbol mangling // due to a lack of missing namespace character for `global_asm`. // -// FIXME: Can't use `#[rustc_symbol_name]` on the `foo` call to check its symbol, so just checking -// the test compiles. +// FIXME: Can't use `#[rustc_dump_symbol_name]` on the `foo` call to check its symbol, +// so just checking the test compiles. fn foo() {} diff --git a/tests/ui/symbol-names/foreign-types.rs b/tests/ui/symbol-names/foreign-types.rs index b863e8c17594e..b7851a06ed067 100644 --- a/tests/ui/symbol-names/foreign-types.rs +++ b/tests/ui/symbol-names/foreign-types.rs @@ -13,7 +13,7 @@ extern "C" { struct Check(T); -#[rustc_symbol_name] +#[rustc_dump_symbol_name] //~^ ERROR symbol-name(_RMCs //~| ERROR demangling(>) diff --git a/tests/ui/symbol-names/foreign-types.stderr b/tests/ui/symbol-names/foreign-types.stderr index 4640ceae81167..b0af84801795f 100644 --- a/tests/ui/symbol-names/foreign-types.stderr +++ b/tests/ui/symbol-names/foreign-types.stderr @@ -1,20 +1,20 @@ error: symbol-name(_RMCsCRATE_HASH_13foreign_typesINtB_5CheckNtB_11ForeignTypeE) --> $DIR/foreign-types.rs:16:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/foreign-types.rs:16:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/foreign-types.rs:16:1 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/tests/ui/symbol-names/impl1.legacy.stderr b/tests/ui/symbol-names/impl1.legacy.stderr index 3d438df92b85d..87a2837e01920 100644 --- a/tests/ui/symbol-names/impl1.legacy.stderr +++ b/tests/ui/symbol-names/impl1.legacy.stderr @@ -1,74 +1,74 @@ error: symbol-name(_ZN5impl13foo3Foo3bar17) --> $DIR/impl1.rs:14:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(impl1::foo::Foo::bar::) --> $DIR/impl1.rs:14:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(impl1::foo::Foo::bar) --> $DIR/impl1.rs:14:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: def-path(foo::Foo::bar) --> $DIR/impl1.rs:21:9 | -LL | #[rustc_def_path] - | ^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_def_path] + | ^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz17) --> $DIR/impl1.rs:32:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(impl1::bar::::baz::) --> $DIR/impl1.rs:32:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(impl1::bar::::baz) --> $DIR/impl1.rs:32:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: def-path(bar::::baz) --> $DIR/impl1.rs:39:9 | -LL | #[rustc_def_path] - | ^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_def_path] + | ^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN209_$LT$$u5b$$RF$dyn$u20$impl1..Foo$u2b$Assoc$u20$$u3d$$u20$extern$u20$$u22$C$u22$$u20$fn$LP$$RF$u8$C$$u20$...$RP$$u2b$impl1..AutoTrait$u3b$$u20$3$u5d$$u20$as$u20$impl1..main..$u7b$$u7b$closure$u7d$$u7d$..Bar$GT$6method17) --> $DIR/impl1.rs:62:13 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method::) --> $DIR/impl1.rs:62:13 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method) --> $DIR/impl1.rs:62:13 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) --> $DIR/impl1.rs:69:13 | -LL | #[rustc_def_path] - | ^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_def_path] + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 12 previous errors diff --git a/tests/ui/symbol-names/impl1.rs b/tests/ui/symbol-names/impl1.rs index 0fdf564547993..5902df54b486f 100644 --- a/tests/ui/symbol-names/impl1.rs +++ b/tests/ui/symbol-names/impl1.rs @@ -11,14 +11,14 @@ mod foo { pub struct Foo { x: u32 } impl Foo { - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy]~^ ERROR symbol-name(_ZN5impl13foo3Foo3bar //[legacy]~| ERROR demangling(impl1::foo::Foo::bar //[legacy]~| ERROR demangling-alt(impl1::foo::Foo::bar) //[v0]~^^^^ ERROR symbol-name(_RNvMNtCs //[v0]~| ERROR demangling(::bar) - #[rustc_def_path] + #[rustc_dump_def_path] //[legacy]~^ ERROR def-path(foo::Foo::bar) //[v0]~^^ ERROR def-path(foo::Foo::bar) fn bar() { } @@ -29,14 +29,14 @@ mod bar { use crate::foo::Foo; impl Foo { - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy]~^ ERROR symbol-name(_ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz //[legacy]~| ERROR demangling(impl1::bar::::baz //[legacy]~| ERROR demangling-alt(impl1::bar::::baz) //[v0]~^^^^ ERROR symbol-name(_RNvMNtCs //[v0]~| ERROR demangling(::baz) - #[rustc_def_path] + #[rustc_dump_def_path] //[legacy]~^ ERROR def-path(bar::::baz) //[v0]~^^ ERROR def-path(bar::::baz) fn baz() { } @@ -59,14 +59,14 @@ fn main() { // Test type mangling, by putting them in an `impl` header. impl Bar for [&'_ (dyn Foo + AutoTrait); 3] { - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy]~^ ERROR symbol-name(_ZN209_$LT$$u5b$$RF$dyn$u20$impl1..Foo$u2b$Assoc$u20$$u3d$$u20$extern$u20$$u22$C$u22$$u20$fn$LP$$RF$u8$C$$u20$...$RP$$u2b$impl1..AutoTrait$u3b$$u20$3$u5d$$u20$as$u20$impl1..main..$u7b$$u7b$closure$u7d$$u7d$..Bar$GT$6method //[legacy]~| ERROR demangling(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method //[legacy]~| ERROR demangling-alt(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method) //[v0]~^^^^ ERROR symbol-name(_RNvXNCNvCs //[v0]~| ERROR demangling(<[&dyn //[v0]~| ERROR demangling-alt(<[&dyn impl1::Foo extern "C" fn(&'a u8, ...)> + impl1::AutoTrait; 3] as impl1::main::{closure#1}::Bar>::method) - #[rustc_def_path] + #[rustc_dump_def_path] //[legacy]~^ ERROR def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) //[v0]~^^ ERROR def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) fn method(&self) {} diff --git a/tests/ui/symbol-names/impl1.v0.stderr b/tests/ui/symbol-names/impl1.v0.stderr index a7cc5fc8ed211..77319825b1770 100644 --- a/tests/ui/symbol-names/impl1.v0.stderr +++ b/tests/ui/symbol-names/impl1.v0.stderr @@ -1,74 +1,74 @@ error: symbol-name(_RNvMNtCsCRATE_HASH_5impl13fooNtB_3Foo3bar) --> $DIR/impl1.rs:14:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(::bar) --> $DIR/impl1.rs:14:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(::bar) --> $DIR/impl1.rs:14:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: def-path(foo::Foo::bar) --> $DIR/impl1.rs:21:9 | -LL | #[rustc_def_path] - | ^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_def_path] + | ^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RNvMNtCsCRATE_HASH_5impl13barNtNtB_3foo3Foo3baz) --> $DIR/impl1.rs:32:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(::baz) --> $DIR/impl1.rs:32:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(::baz) --> $DIR/impl1.rs:32:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: def-path(bar::::baz) --> $DIR/impl1.rs:39:9 | -LL | #[rustc_def_path] - | ^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_def_path] + | ^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RNvXNCNvCsCRATE_HASH_5impl14mains_0ARDNtB_3Foop5AssocFG_KCRL0_hvEuNtB_9AutoTraitEL_j3_NtB_3Bar6method) --> $DIR/impl1.rs:62:13 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(<[&dyn impl1[d5591eb39db23cbb]::Foo extern "C" fn(&'a u8, ...)> + impl1[d5591eb39db23cbb]::AutoTrait; 3usize] as impl1[d5591eb39db23cbb]::main::{closure#1}::Bar>::method) --> $DIR/impl1.rs:62:13 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(<[&dyn impl1::Foo extern "C" fn(&'a u8, ...)> + impl1::AutoTrait; 3] as impl1::main::{closure#1}::Bar>::method) --> $DIR/impl1.rs:62:13 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) --> $DIR/impl1.rs:69:13 | -LL | #[rustc_def_path] - | ^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_def_path] + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 12 previous errors diff --git a/tests/ui/symbol-names/impl2.rs b/tests/ui/symbol-names/impl2.rs index 8d103fab43ba8..05e212cf5d12d 100644 --- a/tests/ui/symbol-names/impl2.rs +++ b/tests/ui/symbol-names/impl2.rs @@ -8,7 +8,7 @@ trait Foo { } impl Foo for [u8; 1 + 2] { - #[rustc_def_path] //~ ERROR def-path(<[u8; 1 + 2] as Foo>::baz) + #[rustc_dump_def_path] //~ ERROR def-path(<[u8; 1 + 2] as Foo>::baz) fn baz() {} } diff --git a/tests/ui/symbol-names/impl2.stderr b/tests/ui/symbol-names/impl2.stderr index 36f080b608366..69bdc4abb0b56 100644 --- a/tests/ui/symbol-names/impl2.stderr +++ b/tests/ui/symbol-names/impl2.stderr @@ -1,8 +1,8 @@ error: def-path(<[u8; 1 + 2] as Foo>::baz) --> $DIR/impl2.rs:11:5 | -LL | #[rustc_def_path] - | ^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_def_path] + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/symbol-names/issue-60925.legacy.stderr b/tests/ui/symbol-names/issue-60925.legacy.stderr index 14cbd877d9f8a..aebdaf111fc84 100644 --- a/tests/ui/symbol-names/issue-60925.legacy.stderr +++ b/tests/ui/symbol-names/issue-60925.legacy.stderr @@ -1,20 +1,20 @@ error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17h4b3099ec5dc5d306E) --> $DIR/issue-60925.rs:21:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(issue_60925::foo::Foo::foo::h4b3099ec5dc5d306) --> $DIR/issue-60925.rs:21:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(issue_60925::foo::Foo::foo) --> $DIR/issue-60925.rs:21:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/tests/ui/symbol-names/issue-60925.rs b/tests/ui/symbol-names/issue-60925.rs index 24969fc664196..76552d88880e5 100644 --- a/tests/ui/symbol-names/issue-60925.rs +++ b/tests/ui/symbol-names/issue-60925.rs @@ -18,7 +18,7 @@ mod foo { pub(crate) struct Foo(T); impl Foo { - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy]~^ ERROR symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo //[legacy]~| ERROR demangling(issue_60925::foo::Foo::foo //[legacy]~| ERROR demangling-alt(issue_60925::foo::Foo::foo) diff --git a/tests/ui/symbol-names/issue-60925.v0.stderr b/tests/ui/symbol-names/issue-60925.v0.stderr index 77449becc84d2..587ee1090ade3 100644 --- a/tests/ui/symbol-names/issue-60925.v0.stderr +++ b/tests/ui/symbol-names/issue-60925.v0.stderr @@ -1,20 +1,20 @@ error: symbol-name(_RNvMNtCsCRATE_HASH_11issue_609253fooINtB_3FooNtNtB_4llvm3FooE3foo) --> $DIR/issue-60925.rs:21:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>::foo) --> $DIR/issue-60925.rs:21:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>::foo) --> $DIR/issue-60925.rs:21:9 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/tests/ui/symbol-names/issue-75326.legacy.stderr b/tests/ui/symbol-names/issue-75326.legacy.stderr index aadc0cf43a212..c4b248427c7e4 100644 --- a/tests/ui/symbol-names/issue-75326.legacy.stderr +++ b/tests/ui/symbol-names/issue-75326.legacy.stderr @@ -1,20 +1,20 @@ error: symbol-name(_ZN72_$LT$issue_75326..Foo$LT$I$C$E$GT$$u20$as$u20$issue_75326..Iterator2$GT$4next17SYMBOL_HASH) --> $DIR/issue-75326.rs:41:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling( as issue_75326::Iterator2>::next::SYMBOL_HASH) --> $DIR/issue-75326.rs:41:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt( as issue_75326::Iterator2>::next) --> $DIR/issue-75326.rs:41:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/tests/ui/symbol-names/issue-75326.rs b/tests/ui/symbol-names/issue-75326.rs index c60b872b0a236..7810483f5f39f 100644 --- a/tests/ui/symbol-names/issue-75326.rs +++ b/tests/ui/symbol-names/issue-75326.rs @@ -38,7 +38,7 @@ where { type Item = T; - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy]~^ ERROR symbol-name(_ZN72_$LT$issue_75326..Foo$LT$I$C$E$GT$$u20$as$u20$issue_75326..Iterator2$GT$4next //[legacy]~| ERROR demangling( as issue_75326::Iterator2>::next //[legacy]~| ERROR demangling-alt( as issue_75326::Iterator2>::next) diff --git a/tests/ui/symbol-names/issue-75326.v0.stderr b/tests/ui/symbol-names/issue-75326.v0.stderr index fb742f5e44902..d07a85730a2b2 100644 --- a/tests/ui/symbol-names/issue-75326.v0.stderr +++ b/tests/ui/symbol-names/issue-75326.v0.stderr @@ -1,20 +1,20 @@ error: symbol-name(_RNvXINICsCRATE_HASH_11issue_75326s_0pppEINtB_3FooppENtB_9Iterator24nextB_) --> $DIR/issue-75326.rs:41:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling( as issue_75326[189ebc60e18860d7]::Iterator2>::next) --> $DIR/issue-75326.rs:41:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt( as issue_75326::Iterator2>::next) --> $DIR/issue-75326.rs:41:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/tests/ui/symbol-names/trait-objects.rs b/tests/ui/symbol-names/trait-objects.rs index da48190285da1..9f9178c6b0743 100644 --- a/tests/ui/symbol-names/trait-objects.rs +++ b/tests/ui/symbol-names/trait-objects.rs @@ -12,7 +12,7 @@ trait Bar { } impl Bar for &dyn FnMut(&u8) { - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[v0]~^ ERROR symbol-name //[v0]~| ERROR demangling //[v0]~| ERROR demangling-alt @@ -24,7 +24,7 @@ trait Foo { } impl Foo for &(dyn FnMut(&u8) + for<'b> Send) { - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[v0]~^ ERROR symbol-name //[v0]~| ERROR demangling //[v0]~| ERROR demangling-alt @@ -36,7 +36,7 @@ trait Baz { } impl Baz for &(dyn for<'b> Send + FnMut(&u8)) { - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[v0]~^ ERROR symbol-name //[v0]~| ERROR demangling //[v0]~| ERROR demangling-alt diff --git a/tests/ui/symbol-names/trait-objects.v0.stderr b/tests/ui/symbol-names/trait-objects.v0.stderr index 84f2bce66be1a..b0cd9c9e7e3f2 100644 --- a/tests/ui/symbol-names/trait-objects.v0.stderr +++ b/tests/ui/symbol-names/trait-objects.v0.stderr @@ -1,56 +1,56 @@ error: symbol-name(_RNvXCsCRATE_HASH_13trait_objectsRDG_INtNtNtCsCRATE_HASH_4core3ops8function5FnMutTRL0_hEEp6OutputuEL_NtB_3Bar6method) --> $DIR/trait-objects.rs:15:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> as trait_objects[3c073c57f94bedc2]::Bar>::method) --> $DIR/trait-objects.rs:15:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(<&dyn for<'a> core::ops::function::FnMut<(&'a u8,), Output = ()> as trait_objects::Bar>::method) --> $DIR/trait-objects.rs:15:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RNvXs_CsCRATE_HASH_13trait_objectsRDG_INtNtNtCsCRATE_HASH_4core3ops8function5FnMutTRL0_hEEp6OutputuNtNtB_6marker4SendEL_NtB_3Foo6method) --> $DIR/trait-objects.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> + core[HASH]::marker::Send as trait_objects[3c073c57f94bedc2]::Foo>::method) --> $DIR/trait-objects.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(<&dyn for<'a> core::ops::function::FnMut<(&'a u8,), Output = ()> + core::marker::Send as trait_objects::Foo>::method) --> $DIR/trait-objects.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RNvXs0_CsCRATE_HASH_13trait_objectsRDG_INtNtNtCsCRATE_HASH_4core3ops8function5FnMutTRL0_hEEp6OutputuNtNtB_6marker4SendEL_NtB_3Baz6method) --> $DIR/trait-objects.rs:39:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> + core[HASH]::marker::Send as trait_objects[3c073c57f94bedc2]::Baz>::method) --> $DIR/trait-objects.rs:39:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(<&dyn for<'a> core::ops::function::FnMut<(&'a u8,), Output = ()> + core::marker::Send as trait_objects::Baz>::method) --> $DIR/trait-objects.rs:39:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 9 previous errors diff --git a/tests/ui/symbol-names/types.legacy.stderr b/tests/ui/symbol-names/types.legacy.stderr index c368b31860989..53f0c1e576665 100644 --- a/tests/ui/symbol-names/types.legacy.stderr +++ b/tests/ui/symbol-names/types.legacy.stderr @@ -1,524 +1,524 @@ error: symbol-name(_ZN1a1b16Type$LT$bool$GT$17h[HASH]E) --> $DIR/types.rs:18:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:18:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:18:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b16Type$LT$char$GT$17h[HASH]E) --> $DIR/types.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b14Type$LT$i8$GT$17h[HASH]E) --> $DIR/types.rs:36:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:36:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:36:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i16$GT$17h[HASH]E) --> $DIR/types.rs:45:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:45:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:45:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i32$GT$17h[HASH]E) --> $DIR/types.rs:54:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:54:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:54:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i64$GT$17h[HASH]E) --> $DIR/types.rs:63:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:63:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:63:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b14Type$LT$u8$GT$17h[HASH]E) --> $DIR/types.rs:72:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:72:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:72:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u16$GT$17h[HASH]E) --> $DIR/types.rs:81:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:81:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:81:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u32$GT$17h[HASH]E) --> $DIR/types.rs:90:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:90:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:90:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u64$GT$17h[HASH]E) --> $DIR/types.rs:99:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:99:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:99:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f16$GT$17h[HASH]E) --> $DIR/types.rs:108:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:108:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:108:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f32$GT$17h[HASH]E) --> $DIR/types.rs:117:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:117:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:117:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f64$GT$17h[HASH]E) --> $DIR/types.rs:126:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:126:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:126:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b16Type$LT$f128$GT$17h[HASH]E) --> $DIR/types.rs:135:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:135:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:135:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$str$GT$17h[HASH]E) --> $DIR/types.rs:144:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:144:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:144:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b17Type$LT$$u21$$GT$17h[HASH]E) --> $DIR/types.rs:153:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:153:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:153:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b20Type$LT$$LP$$RP$$GT$17h[HASH]E) --> $DIR/types.rs:162:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<()>::h[HASH]) --> $DIR/types.rs:162:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<()>) --> $DIR/types.rs:162:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b25Type$LT$$LP$u8$C$$RP$$GT$17h[HASH]E) --> $DIR/types.rs:171:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,)>::h[HASH]) --> $DIR/types.rs:171:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,)>) --> $DIR/types.rs:171:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b28Type$LT$$LP$u8$C$u16$RP$$GT$17h[HASH]E) --> $DIR/types.rs:180:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,u16)>::h[HASH]) --> $DIR/types.rs:180:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,u16)>) --> $DIR/types.rs:180:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b34Type$LT$$LP$u8$C$u16$C$u32$RP$$GT$17h[HASH]E) --> $DIR/types.rs:189:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,u16,u32)>::h[HASH]) --> $DIR/types.rs:189:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,u16,u32)>) --> $DIR/types.rs:189:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b28Type$LT$$BP$const$u20$u8$GT$17h[HASH]E) --> $DIR/types.rs:198:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<*const u8>::h[HASH]) --> $DIR/types.rs:198:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<*const u8>) --> $DIR/types.rs:198:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b26Type$LT$$BP$mut$u20$u8$GT$17h[HASH]E) --> $DIR/types.rs:207:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<*mut u8>::h[HASH]) --> $DIR/types.rs:207:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<*mut u8>) --> $DIR/types.rs:207:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b19Type$LT$$RF$str$GT$17h[HASH]E) --> $DIR/types.rs:216:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<&str>::h[HASH]) --> $DIR/types.rs:216:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<&str>) --> $DIR/types.rs:216:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b27Type$LT$$RF$mut$u20$str$GT$17h[HASH]E) --> $DIR/types.rs:225:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<&mut str>::h[HASH]) --> $DIR/types.rs:225:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<&mut str>) --> $DIR/types.rs:225:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b35Type$LT$$u5b$u8$u3b$$u20$0$u5d$$GT$17h[HASH]E) --> $DIR/types.rs:234:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[u8; 0]>::h[HASH]) --> $DIR/types.rs:234:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[u8; 0]>) --> $DIR/types.rs:234:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b22Type$LT$fn$LP$$RP$$GT$17h[HASH]E) --> $DIR/types.rs:243:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:243:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:243:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b60Type$LT$unsafe$u20$extern$u20$$u22$C$u22$$u20$fn$LP$$RP$$GT$17h[HASH]E) --> $DIR/types.rs:252:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:252:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:252:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b34Type$LT$$u5b$T$u3b$$u20$N$u5d$$GT$17h[HASH]E) --> $DIR/types.rs:261:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[T; N]>::h[HASH]) --> $DIR/types.rs:261:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[T; N]>) --> $DIR/types.rs:261:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b35Type$LT$$u5b$u8$u3b$$u20$0$u5d$$GT$17h[HASH]E) --> $DIR/types.rs:272:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[u8; 0]>::h[HASH]) --> $DIR/types.rs:272:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[u8; 0]>) --> $DIR/types.rs:272:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 87 previous errors diff --git a/tests/ui/symbol-names/types.rs b/tests/ui/symbol-names/types.rs index a4bbbaa02f278..9dc7cad33cb0d 100644 --- a/tests/ui/symbol-names/types.rs +++ b/tests/ui/symbol-names/types.rs @@ -15,7 +15,7 @@ pub fn b() { struct Type(T); - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b16Type$LT$bool$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -24,7 +24,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b16Type$LT$char$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -33,7 +33,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b14Type$LT$i8$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -42,7 +42,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b15Type$LT$i16$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -51,7 +51,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b15Type$LT$i32$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -60,7 +60,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b15Type$LT$i64$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -69,7 +69,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b14Type$LT$u8$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -78,7 +78,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b15Type$LT$u16$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -87,7 +87,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b15Type$LT$u32$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -96,7 +96,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b15Type$LT$u64$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -105,7 +105,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b15Type$LT$f16$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -114,7 +114,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b15Type$LT$f32$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -123,7 +123,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b15Type$LT$f64$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -132,7 +132,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b16Type$LT$f128$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -141,7 +141,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b15Type$LT$str$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -150,7 +150,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b17Type$LT$$u21$$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -159,7 +159,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b20Type$LT$$LP$$RP$$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type<()>:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type<()>) @@ -168,7 +168,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type<()> {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b25Type$LT$$LP$u8$C$$RP$$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type<(u8,)>:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type<(u8,)>) @@ -177,7 +177,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type<(u8,)> {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b28Type$LT$$LP$u8$C$u16$RP$$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type<(u8,u16)>:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type<(u8,u16)>) @@ -186,7 +186,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type<(u8, u16)> {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b34Type$LT$$LP$u8$C$u16$C$u32$RP$$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type<(u8,u16,u32)>:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type<(u8,u16,u32)>) @@ -195,7 +195,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type<(u8, u16, u32)> {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b28Type$LT$$BP$const$u20$u8$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type<*const u8>:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type<*const u8>) @@ -204,7 +204,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type<*const u8> {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b26Type$LT$$BP$mut$u20$u8$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type<*mut u8>:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type<*mut u8>) @@ -213,7 +213,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type<*mut u8> {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b19Type$LT$$RF$str$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type<&str>:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type<&str>) @@ -222,7 +222,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type<&str> {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b27Type$LT$$RF$mut$u20$str$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type<&mut str>:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type<&mut str>) @@ -231,7 +231,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type<&mut str> {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b35Type$LT$$u5b$u8$u3b$$u20$0$u5d$$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type<[u8; 0]>:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type<[u8; 0]>) @@ -240,7 +240,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type<[u8; 0]> {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b22Type$LT$fn$LP$$RP$$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -249,7 +249,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b60Type$LT$unsafe$u20$extern$u20$$u22$C$u22$$u20$fn$LP$$RP$$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type) @@ -258,7 +258,7 @@ pub fn b() { //[v0]~| ERROR demangling-alt(>) impl Type {} - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b34Type$LT$$u5b$T$u3b$$u20$N$u5d$$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type<[T; N]>:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type<[T; N]>) @@ -269,7 +269,7 @@ pub fn b() { const ZERO: usize = 0; - #[rustc_symbol_name] + #[rustc_dump_symbol_name] //[legacy,verbose-legacy]~^ ERROR symbol-name(_ZN1a1b35Type$LT$$u5b$u8$u3b$$u20$0$u5d$$GT$ //[legacy,verbose-legacy]~| ERROR demangling(a::b::Type<[u8; 0]>:: //[legacy,verbose-legacy]~| ERROR demangling-alt(a::b::Type<[u8; 0]>) diff --git a/tests/ui/symbol-names/types.v0.stderr b/tests/ui/symbol-names/types.v0.stderr index 90012a2dcf72f..36e0306c18b4d 100644 --- a/tests/ui/symbol-names/types.v0.stderr +++ b/tests/ui/symbol-names/types.v0.stderr @@ -1,524 +1,524 @@ error: symbol-name(_RMNvCsCRATE_HASH_1a1bINtB_4TypebE) --> $DIR/types.rs:18:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:18:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:18:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs_NvCsCRATE_HASH_1a1bINtB_4TypecE) --> $DIR/types.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs0_NvCsCRATE_HASH_1a1bINtB_4TypeaE) --> $DIR/types.rs:36:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:36:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:36:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs1_NvCsCRATE_HASH_1a1bINtB_4TypesE) --> $DIR/types.rs:45:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:45:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:45:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs2_NvCsCRATE_HASH_1a1bINtB_4TypelE) --> $DIR/types.rs:54:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:54:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:54:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs3_NvCsCRATE_HASH_1a1bINtB_4TypexE) --> $DIR/types.rs:63:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:63:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:63:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs4_NvCsCRATE_HASH_1a1bINtB_4TypehE) --> $DIR/types.rs:72:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:72:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:72:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs5_NvCsCRATE_HASH_1a1bINtB_4TypetE) --> $DIR/types.rs:81:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:81:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:81:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs6_NvCsCRATE_HASH_1a1bINtB_4TypemE) --> $DIR/types.rs:90:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:90:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:90:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs7_NvCsCRATE_HASH_1a1bINtB_4TypeyE) --> $DIR/types.rs:99:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:99:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:99:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs8_NvCsCRATE_HASH_1a1bINtB_4TypeC3f16E) --> $DIR/types.rs:108:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:108:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:108:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs9_NvCsCRATE_HASH_1a1bINtB_4TypefE) --> $DIR/types.rs:117:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:117:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:117:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsa_NvCsCRATE_HASH_1a1bINtB_4TypedE) --> $DIR/types.rs:126:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:126:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:126:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsb_NvCsCRATE_HASH_1a1bINtB_4TypeC4f128E) --> $DIR/types.rs:135:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:135:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:135:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsc_NvCsCRATE_HASH_1a1bINtB_4TypeeE) --> $DIR/types.rs:144:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:144:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:144:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsd_NvCsCRATE_HASH_1a1bINtB_4TypezE) --> $DIR/types.rs:153:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:153:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:153:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMse_NvCsCRATE_HASH_1a1bINtB_4TypeuE) --> $DIR/types.rs:162:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:162:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:162:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsf_NvCsCRATE_HASH_1a1bINtB_4TypeThEE) --> $DIR/types.rs:171:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:171:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:171:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsg_NvCsCRATE_HASH_1a1bINtB_4TypeThtEE) --> $DIR/types.rs:180:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:180:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:180:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsh_NvCsCRATE_HASH_1a1bINtB_4TypeThtmEE) --> $DIR/types.rs:189:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:189:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:189:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsi_NvCsCRATE_HASH_1a1bINtB_4TypePhE) --> $DIR/types.rs:198:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:198:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:198:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsj_NvCsCRATE_HASH_1a1bINtB_4TypeOhE) --> $DIR/types.rs:207:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:207:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:207:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsk_NvCsCRATE_HASH_1a1bINtB_4TypeReE) --> $DIR/types.rs:216:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:216:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:216:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsl_NvCsCRATE_HASH_1a1bINtB_4TypeQeE) --> $DIR/types.rs:225:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:225:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:225:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsm_NvCsCRATE_HASH_1a1bINtB_4TypeAhj0_E) --> $DIR/types.rs:234:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:234:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:234:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsn_NvCsCRATE_HASH_1a1bINtB_4TypeFEuE) --> $DIR/types.rs:243:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:243:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:243:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMso_NvCsCRATE_HASH_1a1bINtB_4TypeFUKCEuE) --> $DIR/types.rs:252:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:252:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:252:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsp_NvCsCRATE_HASH_1a1bINtB_4TypeAppEB_) --> $DIR/types.rs:261:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:261:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:261:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsq_NvCsCRATE_HASH_1a1bINtB_4TypeAhj0_E) --> $DIR/types.rs:272:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) --> $DIR/types.rs:272:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) --> $DIR/types.rs:272:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 87 previous errors diff --git a/tests/ui/symbol-names/types.verbose-legacy.stderr b/tests/ui/symbol-names/types.verbose-legacy.stderr index c368b31860989..53f0c1e576665 100644 --- a/tests/ui/symbol-names/types.verbose-legacy.stderr +++ b/tests/ui/symbol-names/types.verbose-legacy.stderr @@ -1,524 +1,524 @@ error: symbol-name(_ZN1a1b16Type$LT$bool$GT$17h[HASH]E) --> $DIR/types.rs:18:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:18:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:18:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b16Type$LT$char$GT$17h[HASH]E) --> $DIR/types.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:27:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b14Type$LT$i8$GT$17h[HASH]E) --> $DIR/types.rs:36:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:36:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:36:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i16$GT$17h[HASH]E) --> $DIR/types.rs:45:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:45:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:45:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i32$GT$17h[HASH]E) --> $DIR/types.rs:54:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:54:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:54:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i64$GT$17h[HASH]E) --> $DIR/types.rs:63:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:63:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:63:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b14Type$LT$u8$GT$17h[HASH]E) --> $DIR/types.rs:72:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:72:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:72:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u16$GT$17h[HASH]E) --> $DIR/types.rs:81:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:81:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:81:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u32$GT$17h[HASH]E) --> $DIR/types.rs:90:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:90:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:90:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u64$GT$17h[HASH]E) --> $DIR/types.rs:99:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:99:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:99:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f16$GT$17h[HASH]E) --> $DIR/types.rs:108:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:108:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:108:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f32$GT$17h[HASH]E) --> $DIR/types.rs:117:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:117:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:117:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f64$GT$17h[HASH]E) --> $DIR/types.rs:126:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:126:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:126:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b16Type$LT$f128$GT$17h[HASH]E) --> $DIR/types.rs:135:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:135:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:135:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$str$GT$17h[HASH]E) --> $DIR/types.rs:144:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:144:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:144:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b17Type$LT$$u21$$GT$17h[HASH]E) --> $DIR/types.rs:153:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:153:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:153:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b20Type$LT$$LP$$RP$$GT$17h[HASH]E) --> $DIR/types.rs:162:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<()>::h[HASH]) --> $DIR/types.rs:162:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<()>) --> $DIR/types.rs:162:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b25Type$LT$$LP$u8$C$$RP$$GT$17h[HASH]E) --> $DIR/types.rs:171:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,)>::h[HASH]) --> $DIR/types.rs:171:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,)>) --> $DIR/types.rs:171:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b28Type$LT$$LP$u8$C$u16$RP$$GT$17h[HASH]E) --> $DIR/types.rs:180:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,u16)>::h[HASH]) --> $DIR/types.rs:180:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,u16)>) --> $DIR/types.rs:180:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b34Type$LT$$LP$u8$C$u16$C$u32$RP$$GT$17h[HASH]E) --> $DIR/types.rs:189:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,u16,u32)>::h[HASH]) --> $DIR/types.rs:189:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,u16,u32)>) --> $DIR/types.rs:189:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b28Type$LT$$BP$const$u20$u8$GT$17h[HASH]E) --> $DIR/types.rs:198:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<*const u8>::h[HASH]) --> $DIR/types.rs:198:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<*const u8>) --> $DIR/types.rs:198:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b26Type$LT$$BP$mut$u20$u8$GT$17h[HASH]E) --> $DIR/types.rs:207:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<*mut u8>::h[HASH]) --> $DIR/types.rs:207:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<*mut u8>) --> $DIR/types.rs:207:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b19Type$LT$$RF$str$GT$17h[HASH]E) --> $DIR/types.rs:216:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<&str>::h[HASH]) --> $DIR/types.rs:216:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<&str>) --> $DIR/types.rs:216:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b27Type$LT$$RF$mut$u20$str$GT$17h[HASH]E) --> $DIR/types.rs:225:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<&mut str>::h[HASH]) --> $DIR/types.rs:225:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<&mut str>) --> $DIR/types.rs:225:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b35Type$LT$$u5b$u8$u3b$$u20$0$u5d$$GT$17h[HASH]E) --> $DIR/types.rs:234:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[u8; 0]>::h[HASH]) --> $DIR/types.rs:234:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[u8; 0]>) --> $DIR/types.rs:234:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b22Type$LT$fn$LP$$RP$$GT$17h[HASH]E) --> $DIR/types.rs:243:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:243:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:243:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b60Type$LT$unsafe$u20$extern$u20$$u22$C$u22$$u20$fn$LP$$RP$$GT$17h[HASH]E) --> $DIR/types.rs:252:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) --> $DIR/types.rs:252:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) --> $DIR/types.rs:252:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b34Type$LT$$u5b$T$u3b$$u20$N$u5d$$GT$17h[HASH]E) --> $DIR/types.rs:261:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[T; N]>::h[HASH]) --> $DIR/types.rs:261:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[T; N]>) --> $DIR/types.rs:261:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b35Type$LT$$u5b$u8$u3b$$u20$0$u5d$$GT$17h[HASH]E) --> $DIR/types.rs:272:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[u8; 0]>::h[HASH]) --> $DIR/types.rs:272:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[u8; 0]>) --> $DIR/types.rs:272:5 | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_dump_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 87 previous errors diff --git a/tests/ui/type/pattern_types/non_null.rs b/tests/ui/type/pattern_types/non_null.rs index 7e86b8b684d17..e3c634da48b8e 100644 --- a/tests/ui/type/pattern_types/non_null.rs +++ b/tests/ui/type/pattern_types/non_null.rs @@ -7,13 +7,13 @@ use std::pat::pattern_type; -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type NonNull = pattern_type!(*const T is !null); //~ ERROR layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type Test = Option>; //~ ERROR layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type Wide = pattern_type!(*const [u8] is !null); //~ ERROR layout_of const _: () = assert!(size_of::>() == size_of::>>()); diff --git a/tests/ui/type/pattern_types/or_patterns.rs b/tests/ui/type/pattern_types/or_patterns.rs index 25cb1867047aa..881c3bd1b65d1 100644 --- a/tests/ui/type/pattern_types/or_patterns.rs +++ b/tests/ui/type/pattern_types/or_patterns.rs @@ -13,11 +13,11 @@ use std::pat::pattern_type; -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type NonNullI8 = pattern_type!(i8 is ..0 | 1..); //~^ ERROR: layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type NonNegOneI8 = pattern_type!(i8 is ..-1 | 0..); //~^ ERROR: layout_of diff --git a/tests/ui/type/pattern_types/range_patterns.rs b/tests/ui/type/pattern_types/range_patterns.rs index 86b618a8d243f..2f31c1d852966 100644 --- a/tests/ui/type/pattern_types/range_patterns.rs +++ b/tests/ui/type/pattern_types/range_patterns.rs @@ -7,34 +7,34 @@ use std::pat::pattern_type; -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type X = std::num::NonZeroU32; //~ ERROR layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type Y = pattern_type!(u32 is 1..); //~ ERROR layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type Z = Option; //~ ERROR layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type A = Option; //~ ERROR layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] struct NonZeroU32New(pattern_type!(u32 is 1..)); //~ ERROR layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type EMPTY = pattern_type!(u32 is 1..1); //~ ERROR unknown layout -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type WRAP = pattern_type!(u32 is 1..0); //~ ERROR unknown layout //~^ ERROR: evaluation panicked: exclusive range end at minimum value of type -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type WRAP2 = pattern_type!(u32 is 5..2); //~ ERROR unknown layout -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type SIGN = pattern_type!(i8 is -10..=10); //~ ERROR layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type MIN = pattern_type!(i8 is -128..=0); //~ ERROR layout_of -#[rustc_layout(debug)] +#[rustc_dump_layout(debug)] type SignedWrap = pattern_type!(i8 is 120..=-120); //~ ERROR unknown layout fn main() {