diff --git a/compiler/rustc_codegen_gcc/src/asm.rs b/compiler/rustc_codegen_gcc/src/asm.rs index ddd67a994c942..78e8e32b97299 100644 --- a/compiler/rustc_codegen_gcc/src/asm.rs +++ b/compiler/rustc_codegen_gcc/src/asm.rs @@ -634,6 +634,7 @@ fn reg_to_gcc(reg: InlineAsmRegOrRegClass) -> ConstraintOrRegister { } InlineAsmRegClass::Wasm(WasmInlineAsmRegClass::local) => "r", InlineAsmRegClass::S390x(S390xInlineAsmRegClass::reg) => "r", + InlineAsmRegClass::S390x(S390xInlineAsmRegClass::reg_addr) => "a", InlineAsmRegClass::S390x(S390xInlineAsmRegClass::freg) => "f", InlineAsmRegClass::Err => unreachable!(), } @@ -704,7 +705,9 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl InlineAsmRegClass::SpirV(SpirVInlineAsmRegClass::reg) => { bug!("LLVM backend does not support SPIR-V") }, - InlineAsmRegClass::S390x(S390xInlineAsmRegClass::reg) => cx.type_i32(), + InlineAsmRegClass::S390x( + S390xInlineAsmRegClass::reg | S390xInlineAsmRegClass::reg_addr + ) => cx.type_i32(), InlineAsmRegClass::S390x(S390xInlineAsmRegClass::freg) => cx.type_f64(), InlineAsmRegClass::Err => unreachable!(), } diff --git a/compiler/rustc_codegen_llvm/src/asm.rs b/compiler/rustc_codegen_llvm/src/asm.rs index 1323261ae9240..a413466093bed 100644 --- a/compiler/rustc_codegen_llvm/src/asm.rs +++ b/compiler/rustc_codegen_llvm/src/asm.rs @@ -690,6 +690,7 @@ fn reg_to_llvm(reg: InlineAsmRegOrRegClass, layout: Option<&TyAndLayout<'_>>) -> InlineAsmRegClass::Avr(AvrInlineAsmRegClass::reg_iw) => "w", InlineAsmRegClass::Avr(AvrInlineAsmRegClass::reg_ptr) => "e", InlineAsmRegClass::S390x(S390xInlineAsmRegClass::reg) => "r", + InlineAsmRegClass::S390x(S390xInlineAsmRegClass::reg_addr) => "a", InlineAsmRegClass::S390x(S390xInlineAsmRegClass::freg) => "f", InlineAsmRegClass::Msp430(Msp430InlineAsmRegClass::reg) => "r", InlineAsmRegClass::M68k(M68kInlineAsmRegClass::reg) => "r", @@ -867,7 +868,9 @@ fn dummy_output_type<'ll>(cx: &CodegenCx<'ll, '_>, reg: InlineAsmRegClass) -> &' InlineAsmRegClass::Avr(AvrInlineAsmRegClass::reg_pair) => cx.type_i16(), InlineAsmRegClass::Avr(AvrInlineAsmRegClass::reg_iw) => cx.type_i16(), InlineAsmRegClass::Avr(AvrInlineAsmRegClass::reg_ptr) => cx.type_i16(), - InlineAsmRegClass::S390x(S390xInlineAsmRegClass::reg) => cx.type_i32(), + InlineAsmRegClass::S390x( + S390xInlineAsmRegClass::reg | S390xInlineAsmRegClass::reg_addr, + ) => cx.type_i32(), InlineAsmRegClass::S390x(S390xInlineAsmRegClass::freg) => cx.type_f64(), InlineAsmRegClass::Msp430(Msp430InlineAsmRegClass::reg) => cx.type_i16(), InlineAsmRegClass::M68k(M68kInlineAsmRegClass::reg) => cx.type_i32(), diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index ca6b0afc76a9b..2041ffefe77a1 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -12,6 +12,7 @@ #![feature(lazy_cell)] #![feature(let_chains)] #![feature(panic_update_hook)] +#![feature(result_flattening)] #![recursion_limit = "256"] #![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::diagnostic_outside_of_impl)] @@ -1249,8 +1250,7 @@ pub fn catch_fatal_errors R, R>(f: F) -> Result interface::Result<()>) -> i32 { - let result = catch_fatal_errors(f).and_then(|result| result); - match result { + match catch_fatal_errors(f).flatten() { Ok(()) => EXIT_SUCCESS, Err(_) => EXIT_FAILURE, } diff --git a/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs b/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs index 4ce7f831c8711..e3dea2212df0d 100644 --- a/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs +++ b/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs @@ -61,7 +61,7 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> { @call(mir_drop, args) => { Ok(TerminatorKind::Drop { place: self.parse_place(args[0])?, - target: self.parse_block(args[1])?, + target: self.parse_return_to(args[1])?, unwind: self.parse_unwind_action(args[2])?, replace: false, }) @@ -104,6 +104,14 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> { ) } + fn parse_return_to(&self, expr_id: ExprId) -> PResult { + parse_by_kind!(self, expr_id, _, "return block", + @call(mir_return_to, args) => { + self.parse_block(args[0]) + }, + ) + } + fn parse_match(&self, arms: &[ArmId], span: Span) -> PResult { let Some((otherwise, rest)) = arms.split_last() else { return Err(ParseError { @@ -146,7 +154,7 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> { ExprKind::Assign { lhs, rhs } => (*lhs, *rhs), ); let destination = self.parse_place(destination)?; - let target = self.parse_block(args[1])?; + let target = self.parse_return_to(args[1])?; let unwind = self.parse_unwind_action(args[2])?; parse_by_kind!(self, call, _, "function call", diff --git a/compiler/rustc_parse/messages.ftl b/compiler/rustc_parse/messages.ftl index c6bddbfacd6ec..9a76872a383bd 100644 --- a/compiler/rustc_parse/messages.ftl +++ b/compiler/rustc_parse/messages.ftl @@ -10,6 +10,8 @@ parse_ambiguous_range_pattern = the range pattern here has ambiguous interpretat parse_array_brackets_instead_of_braces = this is a block expression, not an array .suggestion = to make an array, use square brackets instead of curly braces +parse_array_index_offset_of = array indexing not supported in offset_of + parse_assignment_else_not_allowed = ... else {"{"} ... {"}"} is not allowed parse_assoc_lifetime = associated lifetimes are not supported @@ -405,6 +407,8 @@ parse_invalid_logical_operator = `{$incorrect}` is not a logical operator parse_invalid_meta_item = expected unsuffixed literal or identifier, found `{$token}` +parse_invalid_offset_of = offset_of expects dot-separated field and variant names + parse_invalid_unicode_escape = invalid unicode character escape .label = invalid escape .help = unicode escape must {$surrogate -> diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index e276b34ca37af..04d70872d78cb 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -2887,3 +2887,11 @@ pub(crate) struct TransposeDynOrImplSugg<'a> { pub insertion_span: Span, pub kw: &'a str, } + +#[derive(Diagnostic)] +#[diag(parse_array_index_offset_of)] +pub(crate) struct ArrayIndexInOffsetOf(#[primary_span] pub Span); + +#[derive(Diagnostic)] +#[diag(parse_invalid_offset_of)] +pub(crate) struct InvalidOffsetOf(#[primary_span] pub Span); diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index bf6151b64d3f1..0b24e78412635 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1023,7 +1023,7 @@ impl<'a> Parser<'a> { // we should break everything including floats into more basic proc-macro style // tokens in the lexer (probably preferable). // See also `TokenKind::break_two_token_op` which does similar splitting of `>>` into `>`. - fn break_up_float(&mut self, float: Symbol) -> DestructuredFloat { + fn break_up_float(&self, float: Symbol, span: Span) -> DestructuredFloat { #[derive(Debug)] enum FloatComponent { IdentLike(String), @@ -1053,7 +1053,6 @@ impl<'a> Parser<'a> { // With proc macros the span can refer to anything, the source may be too short, // or too long, or non-ASCII. It only makes sense to break our span into components // if its underlying text is identical to our float literal. - let span = self.token.span; let can_take_span_apart = || self.span_to_snippet(span).as_deref() == Ok(float_str).as_deref(); @@ -1115,7 +1114,7 @@ impl<'a> Parser<'a> { float: Symbol, suffix: Option, ) -> P { - match self.break_up_float(float) { + match self.break_up_float(float, self.token.span) { // 1e2 DestructuredFloat::Single(sym, _sp) => { self.parse_expr_tuple_field_access(lo, base, sym, suffix, None) @@ -1143,40 +1142,105 @@ impl<'a> Parser<'a> { } } - fn parse_field_name_maybe_tuple(&mut self) -> PResult<'a, ThinVec> { - let token::Literal(token::Lit { kind: token::Float, symbol, suffix }) = self.token.kind - else { - return Ok(thin_vec![self.parse_field_name()?]); - }; - Ok(match self.break_up_float(symbol) { - // 1e2 - DestructuredFloat::Single(sym, sp) => { - self.bump(); - thin_vec![Ident::new(sym, sp)] - } - // 1. - DestructuredFloat::TrailingDot(sym, sym_span, dot_span) => { - assert!(suffix.is_none()); - // Analogous to `Self::break_and_eat` - self.break_last_token = true; - // This might work, in cases like `1. 2`, and might not, - // in cases like `offset_of!(Ty, 1.)`. It depends on what comes - // after the float-like token, and therefore we have to make - // the other parts of the parser think that there is a dot literal. - self.token = Token::new(token::Ident(sym, false), sym_span); - self.bump_with((Token::new(token::Dot, dot_span), self.token_spacing)); - thin_vec![Ident::new(sym, sym_span)] - } - // 1.2 | 1.2e3 - DestructuredFloat::MiddleDot(symbol1, ident1_span, _dot_span, symbol2, ident2_span) => { - self.bump(); - thin_vec![Ident::new(symbol1, ident1_span), Ident::new(symbol2, ident2_span)] + /// Parse the field access used in offset_of, matched by `$(e:expr)+`. + /// Currently returns a list of idents. However, it should be possible in + /// future to also do array indices, which might be arbitrary expressions. + fn parse_floating_field_access(&mut self) -> PResult<'a, P<[Ident]>> { + let mut fields = Vec::new(); + let mut trailing_dot = None; + + loop { + // This is expected to use a metavariable $(args:expr)+, but the builtin syntax + // could be called directly. Calling `parse_expr` allows this function to only + // consider `Expr`s. + let expr = self.parse_expr()?; + let mut current = &expr; + let start_idx = fields.len(); + loop { + match current.kind { + ExprKind::Field(ref left, right) => { + // Field access is read right-to-left. + fields.insert(start_idx, right); + trailing_dot = None; + current = left; + } + // Parse this both to give helpful error messages and to + // verify it can be done with this parser setup. + ExprKind::Index(ref left, ref _right, span) => { + self.dcx().emit_err(errors::ArrayIndexInOffsetOf(span)); + current = left; + } + ExprKind::Lit(token::Lit { + kind: token::Float | token::Integer, + symbol, + suffix, + }) => { + if let Some(suffix) = suffix { + self.expect_no_tuple_index_suffix(current.span, suffix); + } + match self.break_up_float(symbol, current.span) { + // 1e2 + DestructuredFloat::Single(sym, sp) => { + trailing_dot = None; + fields.insert(start_idx, Ident::new(sym, sp)); + } + // 1. + DestructuredFloat::TrailingDot(sym, sym_span, dot_span) => { + assert!(suffix.is_none()); + trailing_dot = Some(dot_span); + fields.insert(start_idx, Ident::new(sym, sym_span)); + } + // 1.2 | 1.2e3 + DestructuredFloat::MiddleDot( + symbol1, + span1, + _dot_span, + symbol2, + span2, + ) => { + trailing_dot = None; + fields.insert(start_idx, Ident::new(symbol2, span2)); + fields.insert(start_idx, Ident::new(symbol1, span1)); + } + DestructuredFloat::Error => { + trailing_dot = None; + fields.insert(start_idx, Ident::new(symbol, self.prev_token.span)); + } + } + break; + } + ExprKind::Path(None, Path { ref segments, .. }) => { + match &segments[..] { + [PathSegment { ident, args: None, .. }] => { + trailing_dot = None; + fields.insert(start_idx, *ident) + } + _ => { + self.dcx().emit_err(errors::InvalidOffsetOf(current.span)); + break; + } + } + break; + } + _ => { + self.dcx().emit_err(errors::InvalidOffsetOf(current.span)); + break; + } + } } - DestructuredFloat::Error => { - self.bump(); - thin_vec![Ident::new(symbol, self.prev_token.span)] + + if matches!(self.token.kind, token::CloseDelim(..) | token::Comma) { + break; + } else if trailing_dot.is_none() { + // This loop should only repeat if there is a trailing dot. + self.dcx().emit_err(errors::InvalidOffsetOf(self.token.span)); + break; } - }) + } + if let Some(dot) = trailing_dot { + self.dcx().emit_err(errors::InvalidOffsetOf(dot)); + } + Ok(fields.into_iter().collect()) } fn parse_expr_tuple_field_access( @@ -1907,15 +1971,29 @@ impl<'a> Parser<'a> { let container = self.parse_ty()?; self.expect(&TokenKind::Comma)?; - let seq_sep = SeqSep { sep: Some(token::Dot), trailing_sep_allowed: false }; - let (fields, _trailing, _recovered) = self.parse_seq_to_before_end( - &TokenKind::CloseDelim(Delimiter::Parenthesis), - seq_sep, - Parser::parse_field_name_maybe_tuple, - )?; - let fields = fields.into_iter().flatten().collect::>(); + let fields = self.parse_floating_field_access()?; + let trailing_comma = self.eat_noexpect(&TokenKind::Comma); + + if let Err(mut e) = + self.expect_one_of(&[], &[TokenKind::CloseDelim(Delimiter::Parenthesis)]) + { + if trailing_comma { + e.note("unexpected third argument to offset_of"); + } else { + e.note("offset_of expects dot-separated field and variant names"); + } + e.emit(); + } + + // Eat tokens until the macro call ends. + if self.may_recover() { + while !matches!(self.token.kind, token::CloseDelim(..) | token::Eof) { + self.bump(); + } + } + let span = lo.to(self.token.span); - Ok(self.mk_expr(span, ExprKind::OffsetOf(container, fields.into()))) + Ok(self.mk_expr(span, ExprKind::OffsetOf(container, fields))) } /// Returns a string literal if the next token is a string literal. diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index c3026e52430e1..a82f7bdfbf3fd 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -3076,7 +3076,16 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> { } let feed_visibility = |this: &mut Self, def_id| { - let vis = this.r.tcx.visibility(def_id).expect_local(); + let vis = this.r.tcx.visibility(def_id); + let vis = if vis.is_visible_locally() { + vis.expect_local() + } else { + this.r.dcx().span_delayed_bug( + span, + "error should be emitted when an unexpected trait item is used", + ); + rustc_middle::ty::Visibility::Public + }; this.r.feed_visibility(this.r.local_def_id(id), vis); }; diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 0b44071496ea8..9af81e0630318 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1041,6 +1041,7 @@ symbols! { mir_offset, mir_retag, mir_return, + mir_return_to, mir_set_discriminant, mir_static, mir_static_mut, diff --git a/compiler/rustc_target/src/asm/s390x.rs b/compiler/rustc_target/src/asm/s390x.rs index 0a50064f58755..b8afeb824d847 100644 --- a/compiler/rustc_target/src/asm/s390x.rs +++ b/compiler/rustc_target/src/asm/s390x.rs @@ -6,6 +6,7 @@ use std::fmt; def_reg_class! { S390x S390xInlineAsmRegClass { reg, + reg_addr, freg, } } @@ -36,7 +37,7 @@ impl S390xInlineAsmRegClass { arch: InlineAsmArch, ) -> &'static [(InlineAsmType, Option)] { match (self, arch) { - (Self::reg, _) => types! { _: I8, I16, I32, I64; }, + (Self::reg | Self::reg_addr, _) => types! { _: I8, I16, I32, I64; }, (Self::freg, _) => types! { _: F32, F64; }, } } @@ -45,19 +46,19 @@ impl S390xInlineAsmRegClass { def_regs! { S390x S390xInlineAsmReg S390xInlineAsmRegClass { r0: reg = ["r0"], - r1: reg = ["r1"], - r2: reg = ["r2"], - r3: reg = ["r3"], - r4: reg = ["r4"], - r5: reg = ["r5"], - r6: reg = ["r6"], - r7: reg = ["r7"], - r8: reg = ["r8"], - r9: reg = ["r9"], - r10: reg = ["r10"], - r12: reg = ["r12"], - r13: reg = ["r13"], - r14: reg = ["r14"], + r1: reg, reg_addr = ["r1"], + r2: reg, reg_addr = ["r2"], + r3: reg, reg_addr = ["r3"], + r4: reg, reg_addr = ["r4"], + r5: reg, reg_addr = ["r5"], + r6: reg, reg_addr = ["r6"], + r7: reg, reg_addr = ["r7"], + r8: reg, reg_addr = ["r8"], + r9: reg, reg_addr = ["r9"], + r10: reg, reg_addr = ["r10"], + r12: reg, reg_addr = ["r12"], + r13: reg, reg_addr = ["r13"], + r14: reg, reg_addr = ["r14"], f0: freg = ["f0"], f1: freg = ["f1"], f2: freg = ["f2"], diff --git a/config.example.toml b/config.example.toml index f1ea6bac3ca16..a5ef4022d39d5 100644 --- a/config.example.toml +++ b/config.example.toml @@ -339,6 +339,14 @@ # on this runtime, such as `-C profile-generate` or `-C instrument-coverage`). #profiler = false +# Use the optimized LLVM C intrinsics for `compiler_builtins`, rather than Rust intrinsics. +# Requires the LLVM submodule to be managed by bootstrap (i.e. not external) so that `compiler-rt` +# sources are available. +# +# Setting this to `false` generates slower code, but removes the requirement for a C toolchain in +# order to run `x check`. +#optimized-compiler-builtins = if rust.channel == "dev" { false } else { true } + # Indicates whether the native libraries linked into Cargo will be statically # linked or not. #cargo-native-static = false diff --git a/library/core/src/intrinsics/mir.rs b/library/core/src/intrinsics/mir.rs index 34a61e76fcf66..c6401ec1e3333 100644 --- a/library/core/src/intrinsics/mir.rs +++ b/library/core/src/intrinsics/mir.rs @@ -104,21 +104,22 @@ //! } //! //! #[custom_mir(dialect = "runtime", phase = "optimized")] +#![cfg_attr(bootstrap, doc = "#[cfg(any())]")] // disable the following function in doctests when `bootstrap` is set //! fn push_and_pop(v: &mut Vec, value: T) { //! mir!( //! let _unused; //! let popped; //! //! { -//! Call(_unused = Vec::push(v, value), pop, UnwindContinue()) +//! Call(_unused = Vec::push(v, value), ReturnTo(pop), UnwindContinue()) //! } //! //! pop = { -//! Call(popped = Vec::pop(v), drop, UnwindContinue()) +//! Call(popped = Vec::pop(v), ReturnTo(drop), UnwindContinue()) //! } //! //! drop = { -//! Drop(popped, ret, UnwindContinue()) +//! Drop(popped, ReturnTo(ret), UnwindContinue()) //! } //! //! ret = { @@ -242,9 +243,8 @@ //! - `match some_int_operand` becomes a `SwitchInt`. Each arm should be `literal => basic_block` //! - The exception is the last arm, which must be `_ => basic_block` and corresponds to the //! otherwise branch. -//! - [`Call`] has an associated function as well. The third argument of this function is a normal -//! function call expression, for example `my_other_function(a, 5)`. -//! +//! - [`Call`] has an associated function as well, with special syntax: +//! `Call(ret_val = function(arg1, arg2, ...), ReturnTo(next_block), UnwindContinue())`. #![unstable( feature = "custom_mir", @@ -287,35 +287,68 @@ macro_rules! define { } // Unwind actions +pub struct UnwindActionArg; define!( "mir_unwind_continue", /// An unwind action that continues unwinding. - fn UnwindContinue() + fn UnwindContinue() -> UnwindActionArg ); define!( "mir_unwind_unreachable", /// An unwind action that triggers undefined behaviour. - fn UnwindUnreachable() -> BasicBlock + fn UnwindUnreachable() -> UnwindActionArg ); define!( "mir_unwind_terminate", /// An unwind action that terminates the execution. /// /// `UnwindTerminate` can also be used as a terminator. - fn UnwindTerminate(reason: UnwindTerminateReason) + fn UnwindTerminate(reason: UnwindTerminateReason) -> UnwindActionArg ); define!( "mir_unwind_cleanup", /// An unwind action that continues execution in a given basic blok. - fn UnwindCleanup(goto: BasicBlock) + fn UnwindCleanup(goto: BasicBlock) -> UnwindActionArg ); +// Return destination for `Call` +pub struct ReturnToArg; +define!("mir_return_to", fn ReturnTo(goto: BasicBlock) -> ReturnToArg); + // Terminators define!("mir_return", fn Return() -> BasicBlock); define!("mir_goto", fn Goto(destination: BasicBlock) -> BasicBlock); define!("mir_unreachable", fn Unreachable() -> BasicBlock); -define!("mir_drop", fn Drop(place: T, goto: BasicBlock, unwind_action: U)); -define!("mir_call", fn Call(call: (), goto: BasicBlock, unwind_action: U)); +define!("mir_drop", + /// Drop the contents of a place. + /// + /// The first argument must be a place. + /// + /// The second argument must be of the form `ReturnTo(bb)`, where `bb` is the basic block that + /// will be jumped to after the destructor returns. + /// + /// The third argument describes what happens on unwind. It can be one of: + /// - [`UnwindContinue`] + /// - [`UnwindUnreachable`] + /// - [`UnwindTerminate`] + /// - [`UnwindCleanup`] + fn Drop(place: T, goto: ReturnToArg, unwind_action: UnwindActionArg) +); +define!("mir_call", + /// Call a function. + /// + /// The first argument must be of the form `ret_val = fun(arg1, arg2, ...)`. + /// + /// The second argument must be of the form `ReturnTo(bb)`, where `bb` is the basic block that + /// will be jumped to after the function returns. + /// + /// The third argument describes what happens on unwind. It can be one of: + /// - [`UnwindContinue`] + /// - [`UnwindUnreachable`] + /// - [`UnwindTerminate`] + /// - [`UnwindCleanup`] + fn Call(call: (), goto: ReturnToArg, unwind_action: UnwindActionArg) +); define!("mir_unwind_resume", /// A terminator that resumes the unwinding. fn UnwindResume() diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index c1687abb7cb9c..407954001e4ce 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -1395,8 +1395,18 @@ impl SizedTypeProperties for T {} /// /// assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0); /// ``` +#[cfg(not(bootstrap))] #[unstable(feature = "offset_of", issue = "106655")] #[allow_internal_unstable(builtin_syntax, hint_must_use)] +pub macro offset_of($Container:ty, $($fields:expr)+ $(,)?) { + // The `{}` is for better error messages + crate::hint::must_use({builtin # offset_of($Container, $($fields)+)}) +} + +#[cfg(bootstrap)] +#[unstable(feature = "offset_of", issue = "106655")] +#[allow_internal_unstable(builtin_syntax, hint_must_use)] +#[allow(missing_docs)] pub macro offset_of($Container:ty, $($fields:tt).+ $(,)?) { // The `{}` is for better error messages crate::hint::must_use({builtin # offset_of($Container, $($fields).+)}) diff --git a/library/test/Cargo.toml b/library/test/Cargo.toml index 91a1abde059f6..92c535501bf9c 100644 --- a/library/test/Cargo.toml +++ b/library/test/Cargo.toml @@ -3,9 +3,6 @@ name = "test" version = "0.0.0" edition = "2021" -[lib] -crate-type = ["dylib", "rlib"] - [dependencies] getopts = { version = "0.2.21", features = ['rustc-dep-of-std'] } std = { path = "../std" } diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index dbb64583d561c..1769e94473ae6 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -382,9 +382,7 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car // Determine if we're going to compile in optimized C intrinsics to // the `compiler-builtins` crate. These intrinsics live in LLVM's - // `compiler-rt` repository, but our `src/llvm-project` submodule isn't - // always checked out, so we need to conditionally look for this. (e.g. if - // an external LLVM is used we skip the LLVM submodule checkout). + // `compiler-rt` repository. // // Note that this shouldn't affect the correctness of `compiler-builtins`, // but only its speed. Some intrinsics in C haven't been translated to Rust @@ -395,8 +393,21 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car // If `compiler-rt` is available ensure that the `c` feature of the // `compiler-builtins` crate is enabled and it's configured to learn where // `compiler-rt` is located. - let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt"); - let compiler_builtins_c_feature = if compiler_builtins_root.exists() { + let compiler_builtins_c_feature = if builder.config.optimized_compiler_builtins { + // NOTE: this interacts strangely with `llvm-has-rust-patches`. In that case, we enforce `submodules = false`, so this is a no-op. + // But, the user could still decide to manually use an in-tree submodule. + // + // NOTE: if we're using system llvm, we'll end up building a version of `compiler-rt` that doesn't match the LLVM we're linking to. + // That's probably ok? At least, the difference wasn't enforced before. There's a comment in + // the compiler_builtins build script that makes me nervous, though: + // https://github.com/rust-lang/compiler-builtins/blob/31ee4544dbe47903ce771270d6e3bea8654e9e50/build.rs#L575-L579 + builder.update_submodule(&Path::new("src").join("llvm-project")); + let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt"); + if !compiler_builtins_root.exists() { + panic!( + "need LLVM sources available to build `compiler-rt`, but they weren't present; consider enabling `build.submodules = true` or disabling `optimized-compiler-builtins`" + ); + } // Note that `libprofiler_builtins/build.rs` also computes this so if // you're changing something here please also change that. cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root); diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index d87651cb367e6..f50026368dabd 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -2032,23 +2032,24 @@ fn install_llvm_file(builder: &Builder<'_>, source: &Path, destination: &Path) { /// /// Returns whether the files were actually copied. fn maybe_install_llvm(builder: &Builder<'_>, target: TargetSelection, dst_libdir: &Path) -> bool { - if let Some(config) = builder.config.target_config.get(&target) { - if config.llvm_config.is_some() && !builder.config.llvm_from_ci { - // If the LLVM was externally provided, then we don't currently copy - // artifacts into the sysroot. This is not necessarily the right - // choice (in particular, it will require the LLVM dylib to be in - // the linker's load path at runtime), but the common use case for - // external LLVMs is distribution provided LLVMs, and in that case - // they're usually in the standard search path (e.g., /usr/lib) and - // copying them here is going to cause problems as we may end up - // with the wrong files and isn't what distributions want. - // - // This behavior may be revisited in the future though. - // - // If the LLVM is coming from ourselves (just from CI) though, we - // still want to install it, as it otherwise won't be available. - return false; - } + // If the LLVM was externally provided, then we don't currently copy + // artifacts into the sysroot. This is not necessarily the right + // choice (in particular, it will require the LLVM dylib to be in + // the linker's load path at runtime), but the common use case for + // external LLVMs is distribution provided LLVMs, and in that case + // they're usually in the standard search path (e.g., /usr/lib) and + // copying them here is going to cause problems as we may end up + // with the wrong files and isn't what distributions want. + // + // This behavior may be revisited in the future though. + // + // NOTE: this intentionally doesn't use `is_rust_llvm`; whether this is patched or not doesn't matter, + // we only care if the shared object itself is managed by bootstrap. + // + // If the LLVM is coming from ourselves (just from CI) though, we + // still want to install it, as it otherwise won't be available. + if builder.is_system_llvm(target) { + return false; } // On macOS, rustc (and LLVM tools) link to an unversioned libLLVM.dylib diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 92140b00da843..4afcfc9425336 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1845,6 +1845,8 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the llvm_components_passed = true; } if !builder.is_rust_llvm(target) { + // FIXME: missing Rust patches is not the same as being system llvm; we should rename the flag at some point. + // Inspecting the tests with `// no-system-llvm` in src/test *looks* like this is doing the right thing, though. cmd.arg("--system-llvm"); } diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index c6bf71c883785..8716ba539032d 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -178,6 +178,8 @@ pub struct Config { pub patch_binaries_for_nix: Option, pub stage0_metadata: Stage0Metadata, pub android_ndk: Option, + /// Whether to use the `c` feature of the `compiler_builtins` crate. + pub optimized_compiler_builtins: bool, pub stdout_is_tty: bool, pub stderr_is_tty: bool, @@ -848,6 +850,7 @@ define_config! { // NOTE: only parsed by bootstrap.py, `--feature build-metrics` enables metrics unconditionally metrics: Option = "metrics", android_ndk: Option = "android-ndk", + optimized_compiler_builtins: Option = "optimized-compiler-builtins", } } @@ -1396,6 +1399,7 @@ impl Config { // This field is only used by bootstrap.py metrics: _, android_ndk, + optimized_compiler_builtins, } = toml.build.unwrap_or_default(); if let Some(file_build) = build { @@ -1810,7 +1814,14 @@ impl Config { } target.llvm_config = Some(config.src.join(s)); } - target.llvm_has_rust_patches = cfg.llvm_has_rust_patches; + if let Some(patches) = cfg.llvm_has_rust_patches { + assert_eq!( + config.submodules, + Some(false), + "cannot set `llvm-has-rust-patches` for a managed submodule (set `build.submodules = false` if you want to apply patches)" + ); + target.llvm_has_rust_patches = Some(patches); + } if let Some(ref s) = cfg.llvm_filecheck { target.llvm_filecheck = Some(config.src.join(s)); } @@ -1909,6 +1920,8 @@ impl Config { config.rust_debuginfo_level_std = with_defaults(debuginfo_level_std); config.rust_debuginfo_level_tools = with_defaults(debuginfo_level_tools); config.rust_debuginfo_level_tests = debuginfo_level_tests.unwrap_or(DebuginfoLevel::None); + config.optimized_compiler_builtins = + optimized_compiler_builtins.unwrap_or(config.channel != "dev"); let download_rustc = config.download_rustc_commit.is_some(); // See https://github.com/rust-lang/compiler-team/issues/326 diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 871318de5955e..30824f5852283 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -823,18 +823,34 @@ impl Build { INTERNER.intern_path(self.out.join(&*target.triple).join("md-doc")) } - /// Returns `true` if no custom `llvm-config` is set for the specified target. + /// Returns `true` if this is an external version of LLVM not managed by bootstrap. + /// In particular, we expect llvm sources to be available when this is false. /// - /// If no custom `llvm-config` was specified then Rust's llvm will be used. + /// NOTE: this is not the same as `!is_rust_llvm` when `llvm_has_patches` is set. + fn is_system_llvm(&self, target: TargetSelection) -> bool { + match self.config.target_config.get(&target) { + Some(Target { llvm_config: Some(_), .. }) => { + let ci_llvm = self.config.llvm_from_ci && target == self.config.build; + !ci_llvm + } + // We're building from the in-tree src/llvm-project sources. + Some(Target { llvm_config: None, .. }) => false, + None => false, + } + } + + /// Returns `true` if this is our custom, patched, version of LLVM. + /// + /// This does not necessarily imply that we're managing the `llvm-project` submodule. fn is_rust_llvm(&self, target: TargetSelection) -> bool { match self.config.target_config.get(&target) { + // We're using a user-controlled version of LLVM. The user has explicitly told us whether the version has our patches. + // (They might be wrong, but that's not a supported use-case.) + // In particular, this tries to support `submodules = false` and `patches = false`, for using a newer version of LLVM that's not through `rust-lang/llvm-project`. Some(Target { llvm_has_rust_patches: Some(patched), .. }) => *patched, - Some(Target { llvm_config, .. }) => { - // If the user set llvm-config we assume Rust is not patched, - // but first check to see if it was configured by llvm-from-ci. - (self.config.llvm_from_ci && target == self.config.build) || llvm_config.is_none() - } - None => true, + // The user hasn't promised the patches match. + // This only has our patches if it's downloaded from CI or built from source. + _ => !self.is_system_llvm(target), } } diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index 25efa5079c873..327b4674acfdb 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -106,4 +106,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Info, summary: "The dist.missing-tools config option was deprecated, as it was unused. If you are using it, remove it from your config, it will be removed soon.", }, + ChangeInfo { + change_id: 102579, + severity: ChangeSeverity::Warning, + summary: "A new `optimized-compiler-builtins` option has been introduced. Whether to build llvm's `compiler-rt` from source is no longer implicitly controlled by git state. See the PR for more details.", + }, ]; diff --git a/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/Dockerfile b/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/Dockerfile index 5ddd3f1803964..637b5fa22f974 100644 --- a/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/Dockerfile +++ b/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/Dockerfile @@ -47,4 +47,6 @@ ENV RUST_CONFIGURE_ARGS --disable-jemalloc \ --set=$TARGET.cc=x86_64-unknown-haiku-gcc \ --set=$TARGET.cxx=x86_64-unknown-haiku-g++ \ --set=$TARGET.llvm-config=/bin/llvm-config-haiku +ENV EXTERNAL_LLVM 1 + ENV SCRIPT python3 ../x.py dist --host=$HOST --target=$HOST diff --git a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile index 5f1fec74bed54..380e716746b5b 100644 --- a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile @@ -139,4 +139,6 @@ ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --disable-docs \ --set target.wasm32-wasi-preview1-threads.wasi-root=/wasm32-wasi-preview1-threads \ --musl-root-armv7=/musl-armv7 +ENV EXTERNAL_LLVM 1 + ENV SCRIPT python3 ../x.py dist --host='' --target $TARGETS diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile index f1d6b9a4ef26b..fe30a95344104 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile @@ -40,6 +40,7 @@ RUN sh /scripts/sccache.sh # We are disabling CI LLVM since this builder is intentionally using a host # LLVM, rather than the typical src/llvm-project LLVM. ENV NO_DOWNLOAD_CI_LLVM 1 +ENV EXTERNAL_LLVM 1 # Using llvm-link-shared due to libffi issues -- see #34486 ENV RUST_CONFIGURE_ARGS \ diff --git a/src/ci/run.sh b/src/ci/run.sh index dc0d5e02cb1bc..420545172e6d5 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -85,6 +85,15 @@ fi # space required for CI artifacts. RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --dist-compression-formats=xz" +# Enable the `c` feature for compiler_builtins, but only when the `compiler-rt` source is available +# (to avoid spending a lot of time cloning llvm) +if [ "$EXTERNAL_LLVM" = "" ]; then + RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.optimized-compiler-builtins" +elif [ "$DEPLOY$DEPLOY_ALT" = "1" ]; then + echo "error: dist builds should always use optimized compiler-rt!" >&2 + exit 1 +fi + if [ "$DIST_SRC" = "" ]; then RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-dist-src" fi diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md index 09070168b67b9..0d8213f048d94 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -161,7 +161,9 @@ target | std | notes [`nvptx64-nvidia-cuda`](platform-support/nvptx64-nvidia-cuda.md) | * | --emit=asm generates PTX code that [runs on NVIDIA GPUs] [`riscv32imac-unknown-none-elf`](platform-support/riscv32imac-unknown-none-elf.md) | * | Bare RISC-V (RV32IMAC ISA) [`riscv32i-unknown-none-elf`](platform-support/riscv32imac-unknown-none-elf.md) | * | Bare RISC-V (RV32I ISA) +[`riscv32im-unknown-none-elf`](platform-support/riscv32imac-unknown-none-elf.md) | * | | Bare RISC-V (RV32IM ISA) [`riscv32imc-unknown-none-elf`](platform-support/riscv32imac-unknown-none-elf.md) | * | Bare RISC-V (RV32IMC ISA) +[`riscv32imafc-unknown-none-elf`](platform-support/riscv32imac-unknown-none-elf.md) | * | Bare RISC-V (RV32IMAFC ISA) `riscv64gc-unknown-none-elf` | * | Bare RISC-V (RV64IMAFDC ISA) `riscv64imac-unknown-none-elf` | * | Bare RISC-V (RV64IMAC ISA) `sparc64-unknown-linux-gnu` | ✓ | SPARC Linux (kernel 4.4, glibc 2.23) @@ -318,8 +320,6 @@ target | std | host | notes [`powerpc64-ibm-aix`](platform-support/aix.md) | ? | | 64-bit AIX (7.2 and newer) `riscv32gc-unknown-linux-gnu` | | | RISC-V Linux (kernel 5.4, glibc 2.33) `riscv32gc-unknown-linux-musl` | | | RISC-V Linux (kernel 5.4, musl + RISCV32 support patches) -[`riscv32imafc-unknown-none-elf`](platform-support/riscv32imac-unknown-none-elf.md) | * | Bare RISC-V (RV32IMAFC ISA) -[`riscv32im-unknown-none-elf`](platform-support/riscv32imac-unknown-none-elf.md) | * | | Bare RISC-V (RV32IM ISA) [`riscv32imac-unknown-xous-elf`](platform-support/riscv32imac-unknown-xous-elf.md) | ? | | RISC-V Xous (RV32IMAC ISA) [`riscv32imc-esp-espidf`](platform-support/esp-idf.md) | ✓ | | RISC-V ESP-IDF [`riscv32imac-esp-espidf`](platform-support/esp-idf.md) | ✓ | | RISC-V ESP-IDF diff --git a/src/doc/rustc/src/platform-support/riscv32imac-unknown-none-elf.md b/src/doc/rustc/src/platform-support/riscv32imac-unknown-none-elf.md index a069f3d3aa9c3..739b12bad8b47 100644 --- a/src/doc/rustc/src/platform-support/riscv32imac-unknown-none-elf.md +++ b/src/doc/rustc/src/platform-support/riscv32imac-unknown-none-elf.md @@ -1,6 +1,6 @@ # `riscv32{i,im,imc,imac,imafc}-unknown-none-elf` -**Tier: 2/3** +**Tier: 2** Bare-metal target for RISC-V CPUs with the RV32I, RV32IM, RV32IMC, RV32IMAFC and RV32IMAC ISAs. @@ -24,11 +24,11 @@ This target is included in Rust and can be installed via `rustup`. ## Testing -This is a cross-compiled no-std target, which must be run either in a simulator +This is a cross-compiled `no-std` target, which must be run either in a simulator or by programming them onto suitable hardware. It is not possible to run the -Rust testsuite on this target. +Rust test-suite on this target. ## Cross-compilation toolchains and C code This target supports C code. If interlinking with C or C++, you may need to use -riscv64-unknown-elf-gcc as a linker instead of rust-lld. +`riscv64-unknown-elf-gcc` as a linker instead of `rust-lld`. diff --git a/src/doc/unstable-book/src/language-features/asm-experimental-arch.md b/src/doc/unstable-book/src/language-features/asm-experimental-arch.md index 968c9bb4ebb86..59acbc73db461 100644 --- a/src/doc/unstable-book/src/language-features/asm-experimental-arch.md +++ b/src/doc/unstable-book/src/language-features/asm-experimental-arch.md @@ -84,7 +84,7 @@ This feature tracks `asm!` and `global_asm!` support for the following architect | M68k | `reg_data` | None | `i8`, `i16`, `i32` | | CSKY | `reg` | None | `i8`, `i16`, `i32` | | CSKY | `freg` | None | `f32`, | -| s390x | `reg` | None | `i8`, `i16`, `i32`, `i64` | +| s390x | `reg`, `reg_addr` | None | `i8`, `i16`, `i32`, `i64` | | s390x | `freg` | None | `f32`, `f64` | ## Register aliases @@ -158,9 +158,10 @@ This feature tracks `asm!` and `global_asm!` support for the following architect | NVPTX | `reg64` | None | `rd0` | None | | Hexagon | `reg` | None | `r0` | None | | PowerPC | `reg` | None | `0` | None | -| PowerPC | `reg_nonzero` | None | `3` | `b` | +| PowerPC | `reg_nonzero` | None | `3` | None | | PowerPC | `freg` | None | `0` | None | | s390x | `reg` | None | `%r0` | None | +| s390x | `reg_addr` | None | `%r1` | None | | s390x | `freg` | None | `%f0` | None | | CSKY | `reg` | None | `r0` | None | | CSKY | `freg` | None | `f0` | None | diff --git a/src/tools/compiletest/src/errors.rs b/src/tools/compiletest/src/errors.rs index c33e66e02ac41..e0ec76aa027b7 100644 --- a/src/tools/compiletest/src/errors.rs +++ b/src/tools/compiletest/src/errors.rs @@ -11,7 +11,7 @@ use once_cell::sync::Lazy; use regex::Regex; use tracing::*; -#[derive(Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq)] pub enum ErrorKind { Help, Error, diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index ca80328f3ac03..1f5f77839de41 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -3977,23 +3977,29 @@ impl<'test> TestCx<'test> { proc_res.status, self.props.error_patterns ); - if !explicit && self.config.compare_mode.is_none() { - let check_patterns = should_run == WillExecute::No - && (!self.props.error_patterns.is_empty() - || !self.props.regex_error_patterns.is_empty()); + let check_patterns = should_run == WillExecute::No + && (!self.props.error_patterns.is_empty() + || !self.props.regex_error_patterns.is_empty()); + if !explicit && self.config.compare_mode.is_none() { let check_annotations = !check_patterns || !expected_errors.is_empty(); - if check_patterns { - // "// error-pattern" comments - let output_to_check = self.get_output(&proc_res); - self.check_all_error_patterns(&output_to_check, &proc_res, pm); - } - if check_annotations { // "//~ERROR comments" self.check_expected_errors(expected_errors, &proc_res); } + } else if explicit && !expected_errors.is_empty() { + let msg = format!( + "line {}: cannot combine `--error-format` with {} annotations; use `error-pattern` instead", + expected_errors[0].line_num, + expected_errors[0].kind.unwrap_or(ErrorKind::Error), + ); + self.fatal(&msg); + } + if check_patterns { + // "// error-pattern" comments + let output_to_check = self.get_output(&proc_res); + self.check_all_error_patterns(&output_to_check, &proc_res, pm); } if self.props.run_rustfix && self.config.compare_mode.is_none() { diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.rs b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.rs index e79bd70e915e5..8a5c10913b48a 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.rs +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.rs @@ -14,7 +14,7 @@ fn main() { let ptr = std::ptr::addr_of_mut!(non_copy); // Inside `callee`, the first argument and `*ptr` are basically // aliasing places! - Call(_unit = callee(Move(*ptr), ptr), after_call, UnwindContinue()) + Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) } after_call = { Return() diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr index 1756123c84ebc..422dc24343612 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr @@ -27,8 +27,8 @@ LL | unsafe { ptr.write(S(0)) }; note: inside `main` --> $DIR/arg_inplace_mutate.rs:LL:CC | -LL | Call(_unit = callee(Move(*ptr), ptr), after_call, UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr index 76f7ee189e3d4..4fe9b7b4728da 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr @@ -35,8 +35,8 @@ LL | unsafe { ptr.write(S(0)) }; note: inside `main` --> $DIR/arg_inplace_mutate.rs:LL:CC | -LL | Call(_unit = callee(Move(*ptr), ptr), after_call, UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.rs b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.rs index e4c00fdd84561..18daf9497a15b 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.rs +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.rs @@ -11,7 +11,7 @@ fn main() { { let non_copy = S(42); // This could change `non_copy` in-place - Call(_unit = change_arg(Move(non_copy)), after_call, UnwindContinue()) + Call(_unit = change_arg(Move(non_copy)), ReturnTo(after_call), UnwindContinue()) } after_call = { // So now we must not be allowed to observe non-copy again. diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr index 723ca75daef89..1c73577f5cd5d 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr @@ -11,8 +11,8 @@ LL | unsafe { ptr.read() }; note: inside `main` --> $DIR/arg_inplace_observe_during.rs:LL:CC | -LL | Call(_unit = change_arg(Move(*ptr), ptr), after_call, UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.rs b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.rs index 517abd733a9ce..2201bf17bfc78 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.rs +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.rs @@ -14,7 +14,7 @@ fn main() { let non_copy = S(42); let ptr = std::ptr::addr_of_mut!(non_copy); // This could change `non_copy` in-place - Call(_unit = change_arg(Move(*ptr), ptr), after_call, UnwindContinue()) + Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) } after_call = { Return() diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr index 401e8c6d5a8a6..09c9a777eca46 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr @@ -27,8 +27,8 @@ LL | x.0 = 0; note: inside `main` --> $DIR/arg_inplace_observe_during.rs:LL:CC | -LL | Call(_unit = change_arg(Move(*ptr), ptr), after_call, UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr index 3529ddd3c53cb..67906f24bbd03 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr @@ -35,8 +35,8 @@ LL | x.0 = 0; note: inside `main` --> $DIR/arg_inplace_observe_during.rs:LL:CC | -LL | Call(_unit = change_arg(Move(*ptr), ptr), after_call, UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.none.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.none.stderr index 48db898a250fc..eb215a2d2e805 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.none.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.none.stderr @@ -11,8 +11,8 @@ LL | unsafe { ptr.read() }; note: inside `main` --> $DIR/return_pointer_aliasing.rs:LL:CC | -LL | Call(*ptr = myfun(ptr), after_call, UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.rs b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.rs index 23b1e38b99f72..c8e0782eff2ff 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.rs +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.rs @@ -15,7 +15,7 @@ pub fn main() { let ptr = &raw mut x; // We arrange for `myfun` to have a pointer that aliases // its return place. Even just reading from that pointer is UB. - Call(*ptr = myfun(ptr), after_call, UnwindContinue()) + Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue()) } after_call = { diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.stack.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.stack.stderr index 85dcd29ba5513..01357f430fc71 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.stack.stderr @@ -27,8 +27,8 @@ LL | unsafe { ptr.read() }; note: inside `main` --> $DIR/return_pointer_aliasing.rs:LL:CC | -LL | Call(*ptr = myfun(ptr), after_call, UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.tree.stderr index ea1867b1a7153..6b3f5fbedee9c 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.tree.stderr @@ -35,8 +35,8 @@ LL | unsafe { ptr.read() }; note: inside `main` --> $DIR/return_pointer_aliasing.rs:LL:CC | -LL | Call(*ptr = myfun(ptr), after_call, UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.rs b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.rs index 56706cdb63bad..7db641538ce55 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.rs +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.rs @@ -15,7 +15,7 @@ pub fn main() { let ptr = &raw mut _x; // We arrange for `myfun` to have a pointer that aliases // its return place. Even just reading from that pointer is UB. - Call(_x = myfun(ptr), after_call, UnwindContinue()) + Call(_x = myfun(ptr), ReturnTo(after_call), UnwindContinue()) } after_call = { diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.stack.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.stack.stderr index 12a99fbf2931f..04040827b0f97 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.stack.stderr @@ -30,8 +30,8 @@ LL | unsafe { ptr.write(0) }; note: inside `main` --> $DIR/return_pointer_aliasing2.rs:LL:CC | -LL | Call(_x = myfun(ptr), after_call, UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_x = myfun(ptr), ReturnTo(after_call), UnwindContinue()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.tree.stderr index 926303bb48948..37c98eabbec83 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.tree.stderr @@ -35,8 +35,8 @@ LL | unsafe { ptr.write(0) }; note: inside `main` --> $DIR/return_pointer_aliasing2.rs:LL:CC | -LL | Call(_x = myfun(ptr), after_call, UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_x = myfun(ptr), ReturnTo(after_call), UnwindContinue()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs index 923c59e74299a..244acd8f2be5e 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs @@ -14,7 +14,7 @@ struct S(i32, [u8; 128]); fn docall(out: &mut S) { mir! { { - Call(*out = callee(), after_call, UnwindContinue()) + Call(*out = callee(), ReturnTo(after_call), UnwindContinue()) } after_call = { @@ -37,7 +37,7 @@ fn callee() -> S { // become visible to the outside. In codegen we can see them // but Miri should detect this as UB! RET.0 = 42; - Call(_unit = startpanic(), after_call, UnwindContinue()) + Call(_unit = startpanic(), ReturnTo(after_call), UnwindContinue()) } after_call = { diff --git a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs index 9357b37250508..3a87bb786776e 100644 --- a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs +++ b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs @@ -20,7 +20,7 @@ fn call(f: fn(NonZeroU32)) { let tmp = ptr::addr_of!(c); let ptr = tmp as *const NonZeroU32; // The call site now is a NonZeroU32-to-u32 transmute. - Call(_res = f(*ptr), retblock, UnwindContinue()) //~ERROR: expected something greater or equal to 1 + Call(_res = f(*ptr), ReturnTo(retblock), UnwindContinue()) //~ERROR: expected something greater or equal to 1 } retblock = { Return() diff --git a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr index 9e9ea710f0e47..b1a2bd2c79a40 100644 --- a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr +++ b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr @@ -1,8 +1,8 @@ error: Undefined Behavior: constructing invalid value: encountered 0, but expected something greater or equal to 1 --> $DIR/cast_fn_ptr_invalid_caller_arg.rs:LL:CC | -LL | Call(_res = f(*ptr), retblock, UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 +LL | Call(_res = f(*ptr), ReturnTo(retblock), UnwindContinue()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs b/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs index 89ee689fabe1f..a5cbe2a0d1d9e 100644 --- a/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs +++ b/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs @@ -11,7 +11,7 @@ pub fn main() { { let x = 0; let ptr = &raw mut x; - Call(*ptr = myfun(), after_call, UnwindContinue()) + Call(*ptr = myfun(), ReturnTo(after_call), UnwindContinue()) } after_call = { diff --git a/tests/assembly/asm/s390x-types.rs b/tests/assembly/asm/s390x-types.rs index 2fb404dd9b280..c39a82c3b1c48 100644 --- a/tests/assembly/asm/s390x-types.rs +++ b/tests/assembly/asm/s390x-types.rs @@ -112,6 +112,30 @@ check!(reg_i32, i32, reg, "lgr"); // CHECK: #NO_APP check!(reg_i64, i64, reg, "lgr"); +// CHECK-LABEL: reg_i8_addr: +// CHECK: #APP +// CHECK: lgr %r{{[0-9]+}}, %r{{[0-9]+}} +// CHECK: #NO_APP +check!(reg_i8_addr, i8, reg_addr, "lgr"); + +// CHECK-LABEL: reg_i16_addr: +// CHECK: #APP +// CHECK: lgr %r{{[0-9]+}}, %r{{[0-9]+}} +// CHECK: #NO_APP +check!(reg_i16_addr, i16, reg_addr, "lgr"); + +// CHECK-LABEL: reg_i32_addr: +// CHECK: #APP +// CHECK: lgr %r{{[0-9]+}}, %r{{[0-9]+}} +// CHECK: #NO_APP +check!(reg_i32_addr, i32, reg_addr, "lgr"); + +// CHECK-LABEL: reg_i64_addr: +// CHECK: #APP +// CHECK: lgr %r{{[0-9]+}}, %r{{[0-9]+}} +// CHECK: #NO_APP +check!(reg_i64_addr, i64, reg_addr, "lgr"); + // CHECK-LABEL: reg_f32: // CHECK: #APP // CHECK: ler %f{{[0-9]+}}, %f{{[0-9]+}} diff --git a/tests/mir-opt/building/custom/terminators.rs b/tests/mir-opt/building/custom/terminators.rs index a83a6c07461f4..01c132cf3e77a 100644 --- a/tests/mir-opt/building/custom/terminators.rs +++ b/tests/mir-opt/building/custom/terminators.rs @@ -13,7 +13,7 @@ fn ident(t: T) -> T { fn direct_call(x: i32) -> i32 { mir!( { - Call(RET = ident(x), retblock, UnwindContinue()) + Call(RET = ident(x), ReturnTo(retblock), UnwindContinue()) } retblock = { @@ -27,7 +27,7 @@ fn direct_call(x: i32) -> i32 { fn indirect_call(x: i32, f: fn(i32) -> i32) -> i32 { mir!( { - Call(RET = f(x), retblock, UnwindContinue()) + Call(RET = f(x), ReturnTo(retblock), UnwindContinue()) } retblock = { @@ -49,7 +49,7 @@ impl<'a> Drop for WriteOnDrop<'a> { fn drop_first<'a>(a: WriteOnDrop<'a>, b: WriteOnDrop<'a>) { mir!( { - Drop(a, retblock, UnwindContinue()) + Drop(a, ReturnTo(retblock), UnwindContinue()) } retblock = { @@ -64,7 +64,7 @@ fn drop_first<'a>(a: WriteOnDrop<'a>, b: WriteOnDrop<'a>) { fn drop_second<'a>(a: WriteOnDrop<'a>, b: WriteOnDrop<'a>) { mir!( { - Drop(b, retblock, UnwindContinue()) + Drop(b, ReturnTo(retblock), UnwindContinue()) } retblock = { diff --git a/tests/mir-opt/building/custom/unwind_action.rs b/tests/mir-opt/building/custom/unwind_action.rs index e3c4ffac358ad..0dfbf780f676a 100644 --- a/tests/mir-opt/building/custom/unwind_action.rs +++ b/tests/mir-opt/building/custom/unwind_action.rs @@ -11,7 +11,7 @@ use core::intrinsics::mir::*; pub fn a() { mir!( { - Call(RET = a(), bb1, UnwindUnreachable()) + Call(RET = a(), ReturnTo(bb1), UnwindUnreachable()) } bb1 = { Return() @@ -26,7 +26,7 @@ pub fn a() { pub fn b() { mir!( { - Call(RET = b(), bb1, UnwindContinue()) + Call(RET = b(), ReturnTo(bb1), UnwindContinue()) } bb1 = { Return() @@ -41,7 +41,7 @@ pub fn b() { pub fn c() { mir!( { - Call(RET = c(), bb1, UnwindTerminate(ReasonAbi)) + Call(RET = c(), ReturnTo(bb1), UnwindTerminate(ReasonAbi)) } bb1 = { Return() @@ -56,7 +56,7 @@ pub fn c() { pub fn d() { mir!( { - Call(RET = d(), bb1, UnwindCleanup(bb2)) + Call(RET = d(), ReturnTo(bb1), UnwindCleanup(bb2)) } bb1 = { Return() diff --git a/tests/mir-opt/copy-prop/borrowed_local.rs b/tests/mir-opt/copy-prop/borrowed_local.rs index a44e65164af01..af40f5bce8b23 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.rs +++ b/tests/mir-opt/copy-prop/borrowed_local.rs @@ -22,11 +22,11 @@ fn f() -> bool { let b = a; // We cannot propagate the place `a`. let r2 = &b; - Call(RET = cmp_ref(r1, r2), next, UnwindContinue()) + Call(RET = cmp_ref(r1, r2), ReturnTo(next), UnwindContinue()) } next = { // But we can propagate the value `a`. - Call(RET = opaque(b), ret, UnwindContinue()) + Call(RET = opaque(b), ReturnTo(ret), UnwindContinue()) } ret = { Return() diff --git a/tests/mir-opt/copy-prop/calls.rs b/tests/mir-opt/copy-prop/calls.rs index bc6760707ccca..a6b5d511805c4 100644 --- a/tests/mir-opt/copy-prop/calls.rs +++ b/tests/mir-opt/copy-prop/calls.rs @@ -26,7 +26,7 @@ fn multiple_edges(t: bool) -> u8 { match t { true => bbt, _ => ret } } bbt = { - Call(x = dummy(13), ret, UnwindContinue()) + Call(x = dummy(13), ReturnTo(ret), UnwindContinue()) } ret = { // `x` is not assigned on the `bb0 -> ret` edge, diff --git a/tests/mir-opt/copy-prop/custom_move_arg.rs b/tests/mir-opt/copy-prop/custom_move_arg.rs index 8593d9fa9aba2..45913626a8fe5 100644 --- a/tests/mir-opt/copy-prop/custom_move_arg.rs +++ b/tests/mir-opt/copy-prop/custom_move_arg.rs @@ -14,11 +14,11 @@ struct NotCopy(bool); fn f(_1: NotCopy) { mir!({ let _2 = _1; - Call(RET = opaque(Move(_1)), bb1, UnwindContinue()) + Call(RET = opaque(Move(_1)), ReturnTo(bb1), UnwindContinue()) } bb1 = { let _3 = Move(_2); - Call(RET = opaque(_3), bb2, UnwindContinue()) + Call(RET = opaque(_3), ReturnTo(bb2), UnwindContinue()) } bb2 = { Return() diff --git a/tests/mir-opt/copy-prop/move_projection.rs b/tests/mir-opt/copy-prop/move_projection.rs index 438a90dddd0cb..f02867814ac0a 100644 --- a/tests/mir-opt/copy-prop/move_projection.rs +++ b/tests/mir-opt/copy-prop/move_projection.rs @@ -18,10 +18,10 @@ fn f(a: Foo) -> bool { let b = a; // This is a move out of a copy, so must become a copy of `a.0`. let c = Move(b.0); - Call(RET = opaque(Move(a)), bb1, UnwindContinue()) + Call(RET = opaque(Move(a)), ReturnTo(bb1), UnwindContinue()) } bb1 = { - Call(RET = opaque(Move(c)), ret, UnwindContinue()) + Call(RET = opaque(Move(c)), ReturnTo(ret), UnwindContinue()) } ret = { Return() diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.rs b/tests/mir-opt/dead-store-elimination/call_arg_copy.rs index b2eb64756f9ac..490a4aa502c38 100644 --- a/tests/mir-opt/dead-store-elimination/call_arg_copy.rs +++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.rs @@ -28,7 +28,7 @@ struct Packed { fn move_packed(packed: Packed) { mir!( { - Call(RET = use_both(0, packed.y), ret, UnwindContinue()) + Call(RET = use_both(0, packed.y), ReturnTo(ret), UnwindContinue()) } ret = { Return() diff --git a/tests/mir-opt/dead-store-elimination/cycle.rs b/tests/mir-opt/dead-store-elimination/cycle.rs index c9ad06a9da266..13e5411275da8 100644 --- a/tests/mir-opt/dead-store-elimination/cycle.rs +++ b/tests/mir-opt/dead-store-elimination/cycle.rs @@ -20,7 +20,7 @@ fn cycle(mut x: i32, mut y: i32, mut z: i32) { mir!( let condition: bool; { - Call(condition = cond(), bb1, UnwindContinue()) + Call(condition = cond(), ReturnTo(bb1), UnwindContinue()) } bb1 = { match condition { true => bb2, _ => ret } @@ -30,7 +30,7 @@ fn cycle(mut x: i32, mut y: i32, mut z: i32) { z = y; y = x; x = temp; - Call(condition = cond(), bb1, UnwindContinue()) + Call(condition = cond(), ReturnTo(bb1), UnwindContinue()) } ret = { Return() diff --git a/tests/mir-opt/gvn.rs b/tests/mir-opt/gvn.rs index db131f7f97d8b..23e33a0fa49ea 100644 --- a/tests/mir-opt/gvn.rs +++ b/tests/mir-opt/gvn.rs @@ -529,31 +529,31 @@ fn duplicate_slice() -> (bool, bool) { // CHECK: [[a:_.*]] = (const "a",); // CHECK: [[au:_.*]] = ([[a]].0: &str) as u128 (Transmute); let a = ("a",); - Call(au = transmute::<_, u128>(a.0), bb1, UnwindContinue()) + Call(au = transmute::<_, u128>(a.0), ReturnTo(bb1), UnwindContinue()) } bb1 = { // CHECK: [[c:_.*]] = identity::<&str>(([[a]].0: &str)) - Call(c = identity(a.0), bb2, UnwindContinue()) + Call(c = identity(a.0), ReturnTo(bb2), UnwindContinue()) } bb2 = { // CHECK: [[cu:_.*]] = [[c]] as u128 (Transmute); - Call(cu = transmute::<_, u128>(c), bb3, UnwindContinue()) + Call(cu = transmute::<_, u128>(c), ReturnTo(bb3), UnwindContinue()) } bb3 = { // This slice is different from `a.0`. Hence `bu` is not `au`. // CHECK: [[b:_.*]] = const "a"; // CHECK: [[bu:_.*]] = [[b]] as u128 (Transmute); let b = "a"; - Call(bu = transmute::<_, u128>(b), bb4, UnwindContinue()) + Call(bu = transmute::<_, u128>(b), ReturnTo(bb4), UnwindContinue()) } bb4 = { // This returns a copy of `b`, which is not `a`. // CHECK: [[d:_.*]] = identity::<&str>([[b]]) - Call(d = identity(b), bb5, UnwindContinue()) + Call(d = identity(b), ReturnTo(bb5), UnwindContinue()) } bb5 = { // CHECK: [[du:_.*]] = [[d]] as u128 (Transmute); - Call(du = transmute::<_, u128>(d), bb6, UnwindContinue()) + Call(du = transmute::<_, u128>(d), ReturnTo(bb6), UnwindContinue()) } bb6 = { // `direct` must not fold to `true`, as `indirect` will not. diff --git a/tests/mir-opt/inline/indirect_destination.rs b/tests/mir-opt/inline/indirect_destination.rs index 2842e23366e00..82143d85c258a 100644 --- a/tests/mir-opt/inline/indirect_destination.rs +++ b/tests/mir-opt/inline/indirect_destination.rs @@ -25,7 +25,7 @@ pub fn f(a: *mut u8) { Goto(bb1) } bb1 = { - Call(*a = g(), bb1, UnwindUnreachable()) + Call(*a = g(), ReturnTo(bb1), UnwindUnreachable()) } } } diff --git a/tests/mir-opt/reference_prop.rs b/tests/mir-opt/reference_prop.rs index 8adfbb4535b9a..b71ad90abb19d 100644 --- a/tests/mir-opt/reference_prop.rs +++ b/tests/mir-opt/reference_prop.rs @@ -696,7 +696,7 @@ fn multiple_storage() { // As there are multiple `StorageLive` statements for `x`, we cannot know if this `z`'s // pointer address is the address of `x`, so do nothing. let y = *z; - Call(RET = opaque(y), retblock, UnwindContinue()) + Call(RET = opaque(y), ReturnTo(retblock), UnwindContinue()) } retblock = { @@ -724,7 +724,7 @@ fn dominate_storage() { } bb1 = { let c = *r; - Call(RET = opaque(c), bb2, UnwindContinue()) + Call(RET = opaque(c), ReturnTo(bb2), UnwindContinue()) } bb2 = { StorageDead(x); @@ -760,18 +760,18 @@ fn maybe_dead(m: bool) { bb1 = { StorageDead(x); StorageDead(y); - Call(RET = opaque(u), bb2, UnwindContinue()) + Call(RET = opaque(u), ReturnTo(bb2), UnwindContinue()) } bb2 = { // As `x` may be `StorageDead`, `a` may be dangling, so we do nothing. let z = *a; - Call(RET = opaque(z), bb3, UnwindContinue()) + Call(RET = opaque(z), ReturnTo(bb3), UnwindContinue()) } bb3 = { // As `y` may be `StorageDead`, `b` may be dangling, so we do nothing. // This implies that we also do not substitute `b` in `bb0`. let t = *b; - Call(RET = opaque(t), retblock, UnwindContinue()) + Call(RET = opaque(t), ReturnTo(retblock), UnwindContinue()) } retblock = { Return() diff --git a/tests/rustdoc-ui/issues/issue-81662-shortness.rs b/tests/rustdoc-ui/issues/issue-81662-shortness.rs index 0240d217bee52..79fb65dec48a0 100644 --- a/tests/rustdoc-ui/issues/issue-81662-shortness.rs +++ b/tests/rustdoc-ui/issues/issue-81662-shortness.rs @@ -1,4 +1,6 @@ // compile-flags:--test --error-format=short +// check-stdout +// error-pattern:cannot find function `foo` in this scope // normalize-stdout-test: "tests/rustdoc-ui/issues" -> "$$DIR" // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" // failure-status: 101 @@ -6,7 +8,6 @@ /// ```rust /// foo(); /// ``` -//~^^ ERROR cannot find function `foo` in this scope fn foo() { println!("Hello, world!"); } diff --git a/tests/rustdoc-ui/issues/issue-81662-shortness.stdout b/tests/rustdoc-ui/issues/issue-81662-shortness.stdout index 6313dde32c57d..f32f51e12f2c3 100644 --- a/tests/rustdoc-ui/issues/issue-81662-shortness.stdout +++ b/tests/rustdoc-ui/issues/issue-81662-shortness.stdout @@ -1,16 +1,16 @@ running 1 test -test $DIR/issue-81662-shortness.rs - foo (line 6) ... FAILED +test $DIR/issue-81662-shortness.rs - foo (line 8) ... FAILED failures: ----- $DIR/issue-81662-shortness.rs - foo (line 6) stdout ---- -$DIR/issue-81662-shortness.rs:7:1: error[E0425]: cannot find function `foo` in this scope +---- $DIR/issue-81662-shortness.rs - foo (line 8) stdout ---- +$DIR/issue-81662-shortness.rs:9:1: error[E0425]: cannot find function `foo` in this scope error: aborting due to 1 previous error Couldn't compile the test. failures: - $DIR/issue-81662-shortness.rs - foo (line 6) + $DIR/issue-81662-shortness.rs - foo (line 8) test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/tests/ui/annotate-snippet/missing-type.rs b/tests/ui/annotate-snippet/missing-type.rs index b0d8b5fbaf224..f5facc16b3180 100644 --- a/tests/ui/annotate-snippet/missing-type.rs +++ b/tests/ui/annotate-snippet/missing-type.rs @@ -1,5 +1,6 @@ // compile-flags: --error-format human-annotate-rs -Z unstable-options +// error-pattern:cannot find type `Iter` in this scope pub fn main() { - let x: Iter; //~ ERROR cannot find type `Iter` in this scope + let x: Iter; } diff --git a/tests/ui/annotate-snippet/missing-type.stderr b/tests/ui/annotate-snippet/missing-type.stderr index c16f022a77fa3..89ce19c182f52 100644 --- a/tests/ui/annotate-snippet/missing-type.stderr +++ b/tests/ui/annotate-snippet/missing-type.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `Iter` in this scope - --> $DIR/missing-type.rs:4:12 + --> $DIR/missing-type.rs:5:12 | LL | let x: Iter; | ^^^^ not found in this scope diff --git a/tests/ui/annotate-snippet/multispan.rs b/tests/ui/annotate-snippet/multispan.rs index 69d7e1a9d116a..d7241b8036492 100644 --- a/tests/ui/annotate-snippet/multispan.rs +++ b/tests/ui/annotate-snippet/multispan.rs @@ -1,4 +1,5 @@ // aux-build:multispan.rs +// error-pattern:hello to you, too! // compile-flags: --error-format human-annotate-rs -Z unstable-options #![feature(proc_macro_hygiene)] @@ -12,17 +13,17 @@ fn main() { hello!(); // Exactly one 'hi'. - hello!(hi); //~ ERROR hello to you, too! + hello!(hi); // Now two, back to back. - hello!(hi hi); //~ ERROR hello to you, too! + hello!(hi hi); // Now three, back to back. - hello!(hi hi hi); //~ ERROR hello to you, too! + hello!(hi hi hi); // Now several, with spacing. - hello!(hi hey hi yo hi beep beep hi hi); //~ ERROR hello to you, too! - hello!(hi there, hi how are you? hi... hi.); //~ ERROR hello to you, too! - hello!(whoah. hi di hi di ho); //~ ERROR hello to you, too! - hello!(hi good hi and good bye); //~ ERROR hello to you, too! + hello!(hi hey hi yo hi beep beep hi hi); + hello!(hi there, hi how are you? hi... hi.); + hello!(whoah. hi di hi di ho); + hello!(hi good hi and good bye); } diff --git a/tests/ui/annotate-snippet/multispan.stderr b/tests/ui/annotate-snippet/multispan.stderr index baed54c59a4e9..833b67730325e 100644 --- a/tests/ui/annotate-snippet/multispan.stderr +++ b/tests/ui/annotate-snippet/multispan.stderr @@ -1,41 +1,41 @@ error: hello to you, too! - --> $DIR/multispan.rs:15:5 + --> $DIR/multispan.rs:16:5 | LL | hello!(hi); | ^^^^^^^^^^ | error: hello to you, too! - --> $DIR/multispan.rs:18:5 + --> $DIR/multispan.rs:19:5 | LL | hello!(hi hi); | ^^^^^^^^^^^^^ | error: hello to you, too! - --> $DIR/multispan.rs:21:5 + --> $DIR/multispan.rs:22:5 | LL | hello!(hi hi hi); | ^^^^^^^^^^^^^^^^ | error: hello to you, too! - --> $DIR/multispan.rs:24:5 + --> $DIR/multispan.rs:25:5 | LL | hello!(hi hey hi yo hi beep beep hi hi); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | error: hello to you, too! - --> $DIR/multispan.rs:25:5 + --> $DIR/multispan.rs:26:5 | LL | hello!(hi there, hi how are you? hi... hi.); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | error: hello to you, too! - --> $DIR/multispan.rs:26:5 + --> $DIR/multispan.rs:27:5 | LL | hello!(whoah. hi di hi di ho); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | error: hello to you, too! - --> $DIR/multispan.rs:27:5 + --> $DIR/multispan.rs:28:5 | LL | hello!(hi good hi and good bye); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/diagnostic-width/flag-json.rs b/tests/ui/diagnostic-width/flag-json.rs index 51a1fb447c7d2..820f1a049e1f7 100644 --- a/tests/ui/diagnostic-width/flag-json.rs +++ b/tests/ui/diagnostic-width/flag-json.rs @@ -1,9 +1,9 @@ // compile-flags: --diagnostic-width=20 --error-format=json +// error-pattern:expected `()`, found integer // This test checks that `-Z output-width` effects the JSON error output by restricting it to an // arbitrarily low value so that the effect is visible. fn main() { let _: () = 42; - //~^ ERROR arguments to this function are incorrect } diff --git a/tests/ui/diagnostic-width/flag-json.stderr b/tests/ui/diagnostic-width/flag-json.stderr index f3bf4f97942c8..0a4b54ebc8565 100644 --- a/tests/ui/diagnostic-width/flag-json.stderr +++ b/tests/ui/diagnostic-width/flag-json.stderr @@ -24,8 +24,8 @@ This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. -"},"level":"error","spans":[{"file_name":"$DIR/flag-json.rs","byte_start":243,"byte_end":245,"line_start":7,"line_end":7,"column_start":17,"column_end":19,"is_primary":true,"text":[{"text":" let _: () = 42;","highlight_start":17,"highlight_end":19}],"label":"expected `()`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/flag-json.rs","byte_start":238,"byte_end":240,"line_start":7,"line_end":7,"column_start":12,"column_end":14,"is_primary":false,"text":[{"text":" let _: () = 42;","highlight_start":12,"highlight_end":14}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0308]: mismatched types - --> $DIR/flag-json.rs:7:17 +"},"level":"error","spans":[{"file_name":"$DIR/flag-json.rs","byte_start":289,"byte_end":291,"line_start":8,"line_end":8,"column_start":17,"column_end":19,"is_primary":true,"text":[{"text":" let _: () = 42;","highlight_start":17,"highlight_end":19}],"label":"expected `()`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/flag-json.rs","byte_start":284,"byte_end":286,"line_start":8,"line_end":8,"column_start":12,"column_end":14,"is_primary":false,"text":[{"text":" let _: () = 42;","highlight_start":12,"highlight_end":14}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0308]: mismatched types + --> $DIR/flag-json.rs:8:17 | LL | ..._: () = 42; | -- ^^ expected `()`, found integer diff --git a/tests/ui/lint/unused_parens_json_suggestion.fixed b/tests/ui/lint/unused_parens_json_suggestion.fixed index c400454046748..b73197ef1bd0b 100644 --- a/tests/ui/lint/unused_parens_json_suggestion.fixed +++ b/tests/ui/lint/unused_parens_json_suggestion.fixed @@ -1,4 +1,5 @@ // compile-flags: --error-format json +// error-pattern:unnecessary parentheses // run-rustfix // The output for humans should just highlight the whole span without showing @@ -13,7 +14,7 @@ fn main() { // We want to suggest the properly-balanced expression `1 / (2 + 3)`, not // the malformed `1 / (2 + 3` - let _a = 1 / (2 + 3); //~ERROR unnecessary parentheses + let _a = 1 / (2 + 3); f(); } diff --git a/tests/ui/lint/unused_parens_json_suggestion.rs b/tests/ui/lint/unused_parens_json_suggestion.rs index 962c8bdd7d789..4339655cf9d51 100644 --- a/tests/ui/lint/unused_parens_json_suggestion.rs +++ b/tests/ui/lint/unused_parens_json_suggestion.rs @@ -1,4 +1,5 @@ // compile-flags: --error-format json +// error-pattern:unnecessary parentheses // run-rustfix // The output for humans should just highlight the whole span without showing @@ -13,7 +14,7 @@ fn main() { // We want to suggest the properly-balanced expression `1 / (2 + 3)`, not // the malformed `1 / (2 + 3` - let _a = (1 / (2 + 3)); //~ERROR unnecessary parentheses + let _a = (1 / (2 + 3)); f(); } diff --git a/tests/ui/lint/unused_parens_json_suggestion.stderr b/tests/ui/lint/unused_parens_json_suggestion.stderr index 4bdfee9159b2d..88f6be4236b2b 100644 --- a/tests/ui/lint/unused_parens_json_suggestion.stderr +++ b/tests/ui/lint/unused_parens_json_suggestion.stderr @@ -1,11 +1,11 @@ -{"$message_type":"diagnostic","message":"unnecessary parentheses around assigned value","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":577,"byte_end":578,"line_start":16,"line_end":16,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3)); - --> $DIR/unused_parens_json_suggestion.rs:16:14 +{"$message_type":"diagnostic","message":"unnecessary parentheses around assigned value","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":618,"byte_end":619,"line_start":17,"line_end":17,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":630,"byte_end":631,"line_start":17,"line_end":17,"column_start":26,"column_end":27,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":26,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the lint level is defined here","code":null,"level":"note","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":436,"byte_end":449,"line_start":11,"line_end":11,"column_start":9,"column_end":22,"is_primary":true,"text":[{"text":"#![deny(unused_parens)]","highlight_start":9,"highlight_end":22}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":618,"byte_end":619,"line_start":17,"line_end":17,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":630,"byte_end":631,"line_start":17,"line_end":17,"column_start":26,"column_end":27,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":26,"highlight_end":27}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around assigned value + --> $DIR/unused_parens_json_suggestion.rs:17:14 | LL | let _a = (1 / (2 + 3)); | ^ ^ | note: the lint level is defined here - --> $DIR/unused_parens_json_suggestion.rs:10:9 + --> $DIR/unused_parens_json_suggestion.rs:11:9 | LL | #![deny(unused_parens)] | ^^^^^^^^^^^^^ diff --git a/tests/ui/lint/unused_parens_remove_json_suggestion.fixed b/tests/ui/lint/unused_parens_remove_json_suggestion.fixed index 8a57cd57385f3..39d7a1127b642 100644 --- a/tests/ui/lint/unused_parens_remove_json_suggestion.fixed +++ b/tests/ui/lint/unused_parens_remove_json_suggestion.fixed @@ -1,4 +1,5 @@ // compile-flags: --error-format json +// error-pattern:unnecessary parentheses // run-rustfix // The output for humans should just highlight the whole span without showing @@ -14,7 +15,7 @@ fn main() { let _b = false; - if _b { //~ ERROR unnecessary parentheses + if _b { println!("hello"); } @@ -25,29 +26,29 @@ fn main() { fn f() -> bool { let c = false; - if c { //~ ERROR unnecessary parentheses + if c { println!("next"); } - if c { //~ ERROR unnecessary parentheses + if c { println!("prev"); } while false && true { - if c { //~ ERROR unnecessary parentheses + if c { println!("norm"); } } - while true && false { //~ ERROR unnecessary parentheses - for _ in 0 .. 3 { //~ ERROR unnecessary parentheses + while true && false { + for _ in 0 .. 3 { println!("e~") } } - for _ in 0 .. 3 { //~ ERROR unnecessary parentheses - while true && false { //~ ERROR unnecessary parentheses + for _ in 0 .. 3 { + while true && false { println!("e~") } } diff --git a/tests/ui/lint/unused_parens_remove_json_suggestion.rs b/tests/ui/lint/unused_parens_remove_json_suggestion.rs index 952332d54e9c1..2748bd3f73df6 100644 --- a/tests/ui/lint/unused_parens_remove_json_suggestion.rs +++ b/tests/ui/lint/unused_parens_remove_json_suggestion.rs @@ -1,4 +1,5 @@ // compile-flags: --error-format json +// error-pattern:unnecessary parentheses // run-rustfix // The output for humans should just highlight the whole span without showing @@ -14,7 +15,7 @@ fn main() { let _b = false; - if (_b) { //~ ERROR unnecessary parentheses + if (_b) { println!("hello"); } @@ -25,29 +26,29 @@ fn main() { fn f() -> bool { let c = false; - if(c) { //~ ERROR unnecessary parentheses + if(c) { println!("next"); } - if (c){ //~ ERROR unnecessary parentheses + if (c){ println!("prev"); } while (false && true){ - if (c) { //~ ERROR unnecessary parentheses + if (c) { println!("norm"); } } - while(true && false) { //~ ERROR unnecessary parentheses - for _ in (0 .. 3){ //~ ERROR unnecessary parentheses + while(true && false) { + for _ in (0 .. 3){ println!("e~") } } - for _ in (0 .. 3) { //~ ERROR unnecessary parentheses - while (true && false) { //~ ERROR unnecessary parentheses + for _ in (0 .. 3) { + while (true && false) { println!("e~") } } diff --git a/tests/ui/lint/unused_parens_remove_json_suggestion.stderr b/tests/ui/lint/unused_parens_remove_json_suggestion.stderr index 7521d41cc939d..80371c1594f71 100644 --- a/tests/ui/lint/unused_parens_remove_json_suggestion.stderr +++ b/tests/ui/lint/unused_parens_remove_json_suggestion.stderr @@ -1,11 +1,11 @@ -{"$message_type":"diagnostic","message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":481,"byte_end":482,"line_start":17,"line_end":17,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":" if (_b) { - --> $DIR/unused_parens_remove_json_suggestion.rs:17:8 +{"$message_type":"diagnostic","message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":522,"byte_end":523,"line_start":18,"line_end":18,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":" if (_b) {","highlight_start":8,"highlight_end":9}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":525,"byte_end":526,"line_start":18,"line_end":18,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":" if (_b) {","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the lint level is defined here","code":null,"level":"note","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":436,"byte_end":449,"line_start":11,"line_end":11,"column_start":9,"column_end":22,"is_primary":true,"text":[{"text":"#![deny(unused_parens)]","highlight_start":9,"highlight_end":22}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":522,"byte_end":523,"line_start":18,"line_end":18,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":" if (_b) {","highlight_start":8,"highlight_end":9}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":525,"byte_end":526,"line_start":18,"line_end":18,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":" if (_b) {","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `if` condition + --> $DIR/unused_parens_remove_json_suggestion.rs:18:8 | LL | if (_b) { | ^ ^ | note: the lint level is defined here - --> $DIR/unused_parens_remove_json_suggestion.rs:10:9 + --> $DIR/unused_parens_remove_json_suggestion.rs:11:9 | LL | #![deny(unused_parens)] | ^^^^^^^^^^^^^ @@ -16,8 +16,8 @@ LL + if _b { | "} -{"$message_type":"diagnostic","message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":612,"byte_end":613,"line_start":28,"line_end":28,"column_start":7,"column_end":8,"is_primary":true,"text":[{"text":" if(c) { - --> $DIR/unused_parens_remove_json_suggestion.rs:28:7 +{"$message_type":"diagnostic","message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":619,"byte_end":620,"line_start":29,"line_end":29,"column_start":7,"column_end":8,"is_primary":true,"text":[{"text":" if(c) {","highlight_start":7,"highlight_end":8}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":621,"byte_end":622,"line_start":29,"line_end":29,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" if(c) {","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":619,"byte_end":620,"line_start":29,"line_end":29,"column_start":7,"column_end":8,"is_primary":true,"text":[{"text":" if(c) {","highlight_start":7,"highlight_end":8}],"label":null,"suggested_replacement":" ","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":621,"byte_end":622,"line_start":29,"line_end":29,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" if(c) {","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `if` condition + --> $DIR/unused_parens_remove_json_suggestion.rs:29:7 | LL | if(c) { | ^ ^ @@ -29,8 +29,8 @@ LL + if c { | "} -{"$message_type":"diagnostic","message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":692,"byte_end":693,"line_start":32,"line_end":32,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":" if (c){ - --> $DIR/unused_parens_remove_json_suggestion.rs:32:8 +{"$message_type":"diagnostic","message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":665,"byte_end":666,"line_start":33,"line_end":33,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":" if (c){","highlight_start":8,"highlight_end":9}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":667,"byte_end":668,"line_start":33,"line_end":33,"column_start":10,"column_end":11,"is_primary":true,"text":[{"text":" if (c){","highlight_start":10,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":665,"byte_end":666,"line_start":33,"line_end":33,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":" if (c){","highlight_start":8,"highlight_end":9}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":667,"byte_end":668,"line_start":33,"line_end":33,"column_start":10,"column_end":11,"is_primary":true,"text":[{"text":" if (c){","highlight_start":10,"highlight_end":11}],"label":null,"suggested_replacement":" ","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `if` condition + --> $DIR/unused_parens_remove_json_suggestion.rs:33:8 | LL | if (c){ | ^ ^ @@ -42,8 +42,8 @@ LL + if c { | "} -{"$message_type":"diagnostic","message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":774,"byte_end":775,"line_start":36,"line_end":36,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":788,"byte_end":789,"line_start":36,"line_end":36,"column_start":25,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":25,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":774,"byte_end":775,"line_start":36,"line_end":36,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":788,"byte_end":789,"line_start":36,"line_end":36,"column_start":25,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":25,"highlight_end":26}],"label":null,"suggested_replacement":" ","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `while` condition - --> $DIR/unused_parens_remove_json_suggestion.rs:36:11 +{"$message_type":"diagnostic","message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":713,"byte_end":714,"line_start":37,"line_end":37,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":727,"byte_end":728,"line_start":37,"line_end":37,"column_start":25,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":25,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":713,"byte_end":714,"line_start":37,"line_end":37,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":11,"highlight_end":12}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":727,"byte_end":728,"line_start":37,"line_end":37,"column_start":25,"column_end":26,"is_primary":true,"text":[{"text":" while (false && true){","highlight_start":25,"highlight_end":26}],"label":null,"suggested_replacement":" ","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `while` condition + --> $DIR/unused_parens_remove_json_suggestion.rs:37:11 | LL | while (false && true){ | ^ ^ @@ -55,8 +55,8 @@ LL + while false && true { | "} -{"$message_type":"diagnostic","message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":802,"byte_end":803,"line_start":37,"line_end":37,"column_start":12,"column_end":13,"is_primary":true,"text":[{"text":" if (c) { - --> $DIR/unused_parens_remove_json_suggestion.rs:37:12 +{"$message_type":"diagnostic","message":"unnecessary parentheses around `if` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":741,"byte_end":742,"line_start":38,"line_end":38,"column_start":12,"column_end":13,"is_primary":true,"text":[{"text":" if (c) {","highlight_start":12,"highlight_end":13}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":743,"byte_end":744,"line_start":38,"line_end":38,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" if (c) {","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":741,"byte_end":742,"line_start":38,"line_end":38,"column_start":12,"column_end":13,"is_primary":true,"text":[{"text":" if (c) {","highlight_start":12,"highlight_end":13}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":743,"byte_end":744,"line_start":38,"line_end":38,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" if (c) {","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `if` condition + --> $DIR/unused_parens_remove_json_suggestion.rs:38:12 | LL | if (c) { | ^ ^ @@ -68,8 +68,8 @@ LL + if c { | "} -{"$message_type":"diagnostic","message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":899,"byte_end":900,"line_start":43,"line_end":43,"column_start":10,"column_end":11,"is_primary":true,"text":[{"text":" while(true && false) { - --> $DIR/unused_parens_remove_json_suggestion.rs:43:10 +{"$message_type":"diagnostic","message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":804,"byte_end":805,"line_start":44,"line_end":44,"column_start":10,"column_end":11,"is_primary":true,"text":[{"text":" while(true && false) {","highlight_start":10,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":818,"byte_end":819,"line_start":44,"line_end":44,"column_start":24,"column_end":25,"is_primary":true,"text":[{"text":" while(true && false) {","highlight_start":24,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":804,"byte_end":805,"line_start":44,"line_end":44,"column_start":10,"column_end":11,"is_primary":true,"text":[{"text":" while(true && false) {","highlight_start":10,"highlight_end":11}],"label":null,"suggested_replacement":" ","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":818,"byte_end":819,"line_start":44,"line_end":44,"column_start":24,"column_end":25,"is_primary":true,"text":[{"text":" while(true && false) {","highlight_start":24,"highlight_end":25}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `while` condition + --> $DIR/unused_parens_remove_json_suggestion.rs:44:10 | LL | while(true && false) { | ^ ^ @@ -81,8 +81,8 @@ LL + while true && false { | "} -{"$message_type":"diagnostic","message":"unnecessary parentheses around `for` iterator expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":968,"byte_end":969,"line_start":44,"line_end":44,"column_start":18,"column_end":19,"is_primary":true,"text":[{"text":" for _ in (0 .. 3){ - --> $DIR/unused_parens_remove_json_suggestion.rs:44:18 +{"$message_type":"diagnostic","message":"unnecessary parentheses around `for` iterator expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":839,"byte_end":840,"line_start":45,"line_end":45,"column_start":18,"column_end":19,"is_primary":true,"text":[{"text":" for _ in (0 .. 3){","highlight_start":18,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":846,"byte_end":847,"line_start":45,"line_end":45,"column_start":25,"column_end":26,"is_primary":true,"text":[{"text":" for _ in (0 .. 3){","highlight_start":25,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":839,"byte_end":840,"line_start":45,"line_end":45,"column_start":18,"column_end":19,"is_primary":true,"text":[{"text":" for _ in (0 .. 3){","highlight_start":18,"highlight_end":19}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":846,"byte_end":847,"line_start":45,"line_end":45,"column_start":25,"column_end":26,"is_primary":true,"text":[{"text":" for _ in (0 .. 3){","highlight_start":25,"highlight_end":26}],"label":null,"suggested_replacement":" ","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `for` iterator expression + --> $DIR/unused_parens_remove_json_suggestion.rs:45:18 | LL | for _ in (0 .. 3){ | ^ ^ @@ -94,8 +94,8 @@ LL + for _ in 0 .. 3 { | "} -{"$message_type":"diagnostic","message":"unnecessary parentheses around `for` iterator expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":1069,"byte_end":1070,"line_start":49,"line_end":49,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" for _ in (0 .. 3) { - --> $DIR/unused_parens_remove_json_suggestion.rs:49:14 +{"$message_type":"diagnostic","message":"unnecessary parentheses around `for` iterator expression","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":906,"byte_end":907,"line_start":50,"line_end":50,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" for _ in (0 .. 3) {","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":913,"byte_end":914,"line_start":50,"line_end":50,"column_start":21,"column_end":22,"is_primary":true,"text":[{"text":" for _ in (0 .. 3) {","highlight_start":21,"highlight_end":22}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":906,"byte_end":907,"line_start":50,"line_end":50,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":" for _ in (0 .. 3) {","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":913,"byte_end":914,"line_start":50,"line_end":50,"column_start":21,"column_end":22,"is_primary":true,"text":[{"text":" for _ in (0 .. 3) {","highlight_start":21,"highlight_end":22}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `for` iterator expression + --> $DIR/unused_parens_remove_json_suggestion.rs:50:14 | LL | for _ in (0 .. 3) { | ^ ^ @@ -107,8 +107,8 @@ LL + for _ in 0 .. 3 { | "} -{"$message_type":"diagnostic","message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":1128,"byte_end":1129,"line_start":50,"line_end":50,"column_start":15,"column_end":16,"is_primary":true,"text":[{"text":" while (true && false) { - --> $DIR/unused_parens_remove_json_suggestion.rs:50:15 +{"$message_type":"diagnostic","message":"unnecessary parentheses around `while` condition","code":{"code":"unused_parens","explanation":null},"level":"error","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":931,"byte_end":932,"line_start":51,"line_end":51,"column_start":15,"column_end":16,"is_primary":true,"text":[{"text":" while (true && false) {","highlight_start":15,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":945,"byte_end":946,"line_start":51,"line_end":51,"column_start":29,"column_end":30,"is_primary":true,"text":[{"text":" while (true && false) {","highlight_start":29,"highlight_end":30}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":931,"byte_end":932,"line_start":51,"line_end":51,"column_start":15,"column_end":16,"is_primary":true,"text":[{"text":" while (true && false) {","highlight_start":15,"highlight_end":16}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null},{"file_name":"$DIR/unused_parens_remove_json_suggestion.rs","byte_start":945,"byte_end":946,"line_start":51,"line_end":51,"column_start":29,"column_end":30,"is_primary":true,"text":[{"text":" while (true && false) {","highlight_start":29,"highlight_end":30}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: unnecessary parentheses around `while` condition + --> $DIR/unused_parens_remove_json_suggestion.rs:51:15 | LL | while (true && false) { | ^ ^ diff --git a/tests/ui/mir/ssa_call_ret.rs b/tests/ui/mir/ssa_call_ret.rs index 6132a6691dea3..f8a83249225c2 100644 --- a/tests/ui/mir/ssa_call_ret.rs +++ b/tests/ui/mir/ssa_call_ret.rs @@ -13,7 +13,7 @@ pub fn f() -> u32 { mir!( let a: u32; { - Call(a = g(), bb1, UnwindCleanup(bb2)) + Call(a = g(), ReturnTo(bb1), UnwindCleanup(bb2)) } bb1 = { RET = a; diff --git a/tests/ui/mir/validate/critical-edge.rs b/tests/ui/mir/validate/critical-edge.rs index 9ef655cd1bb4a..3bb732ad3f776 100644 --- a/tests/ui/mir/validate/critical-edge.rs +++ b/tests/ui/mir/validate/critical-edge.rs @@ -20,7 +20,7 @@ pub fn f(a: u32) -> u32 { } } bb1 = { - Call(RET = f(1), bb2, UnwindTerminate(ReasonAbi)) + Call(RET = f(1), ReturnTo(bb2), UnwindTerminate(ReasonAbi)) } bb2 = { diff --git a/tests/ui/mir/validate/noncleanup-cleanup.rs b/tests/ui/mir/validate/noncleanup-cleanup.rs index 0a1c4528aa6d9..a14ab44257fa1 100644 --- a/tests/ui/mir/validate/noncleanup-cleanup.rs +++ b/tests/ui/mir/validate/noncleanup-cleanup.rs @@ -11,7 +11,7 @@ use core::intrinsics::mir::*; pub fn main() { mir!( { - Call(RET = main(), block, UnwindCleanup(block)) + Call(RET = main(), ReturnTo(block), UnwindCleanup(block)) } block = { Return() diff --git a/tests/ui/offset-of/offset-of-arg-count.rs b/tests/ui/offset-of/offset-of-arg-count.rs index 31de45bc7567f..7b92698c25e8a 100644 --- a/tests/ui/offset-of/offset-of-arg-count.rs +++ b/tests/ui/offset-of/offset-of-arg-count.rs @@ -8,10 +8,10 @@ fn main() { offset_of!(Container, field, too many arguments); //~ ERROR no rules expected the token `too` offset_of!(S, f); // compiles fine offset_of!(S, f,); // also compiles fine - offset_of!(S, f.); //~ ERROR unexpected end of macro invocation - offset_of!(S, f.,); //~ ERROR expected identifier - offset_of!(S, f..); //~ ERROR no rules expected the token - offset_of!(S, f..,); //~ ERROR no rules expected the token + offset_of!(S, f.); //~ ERROR unexpected token: `)` + offset_of!(S, f.,); //~ ERROR unexpected token: `,` + offset_of!(S, f..); //~ ERROR offset_of expects dot-separated field and variant names + offset_of!(S, f..,); //~ ERROR offset_of expects dot-separated field and variant names offset_of!(Lt<'static>, bar); // issue #111657 offset_of!(Lt<'_>, bar); // issue #111678 } diff --git a/tests/ui/offset-of/offset-of-arg-count.stderr b/tests/ui/offset-of/offset-of-arg-count.stderr index 4275a89545f50..af0d42de30d60 100644 --- a/tests/ui/offset-of/offset-of-arg-count.stderr +++ b/tests/ui/offset-of/offset-of-arg-count.stderr @@ -13,7 +13,7 @@ error: unexpected end of macro invocation LL | offset_of!(NotEnoughArgumentsWithAComma, ); | ^ missing tokens in macro arguments | -note: while trying to match meta-variable `$fields:tt` +note: while trying to match meta-variable `$fields:expr` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL error: no rules expected the token `too` @@ -24,36 +24,29 @@ LL | offset_of!(Container, field, too many arguments); | = note: while trying to match sequence end -error: unexpected end of macro invocation +error: unexpected token: `)` --> $DIR/offset-of-arg-count.rs:11:21 | LL | offset_of!(S, f.); - | ^ missing tokens in macro arguments - | -note: while trying to match meta-variable `$fields:tt` - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | ^ -error: expected identifier, found `,` +error: unexpected token: `,` --> $DIR/offset-of-arg-count.rs:12:21 | LL | offset_of!(S, f.,); - | ^ expected identifier + | ^ -error: no rules expected the token `..` - --> $DIR/offset-of-arg-count.rs:13:20 +error: offset_of expects dot-separated field and variant names + --> $DIR/offset-of-arg-count.rs:13:19 | LL | offset_of!(S, f..); - | ^^ no rules expected this token in macro call - | - = note: while trying to match sequence start + | ^^^ -error: no rules expected the token `..` - --> $DIR/offset-of-arg-count.rs:14:20 +error: offset_of expects dot-separated field and variant names + --> $DIR/offset-of-arg-count.rs:14:19 | LL | offset_of!(S, f..,); - | ^^ no rules expected this token in macro call - | - = note: while trying to match sequence start + | ^^^ error: aborting due to 7 previous errors diff --git a/tests/ui/offset-of/offset-of-builtin.rs b/tests/ui/offset-of/offset-of-builtin.rs index 1be9899887b4a..6664c10f905ef 100644 --- a/tests/ui/offset-of/offset-of-builtin.rs +++ b/tests/ui/offset-of/offset-of-builtin.rs @@ -8,37 +8,25 @@ fn main() { builtin # offset_of(NotEnoughArguments); //~ ERROR expected one of } fn t1() { - // Already errored upon at the macro level. Yielding an error would require - // extra effort. - builtin # offset_of(NotEnoughArgumentsWithAComma, ); + builtin # offset_of(NotEnoughArgumentsWithAComma, ); //~ ERROR expected expression } fn t2() { - builtin # offset_of(Container, field, too many arguments); //~ ERROR expected identifier, found - //~| ERROR found `,` - //~| ERROR found `many` - //~| ERROR found `arguments` + builtin # offset_of(S, f, too many arguments); //~ ERROR expected `)`, found `too` } fn t3() { builtin # offset_of(S, f); // compiles fine } fn t4() { - // Already errored upon at the macro level. Yielding an error would require - // extra effort. - builtin # offset_of(S, f); + builtin # offset_of(S, f.); //~ ERROR unexpected token } fn t5() { - builtin # offset_of(S, f.); //~ ERROR expected identifier + builtin # offset_of(S, f.,); //~ ERROR unexpected token } fn t6() { - builtin # offset_of(S, f.,); //~ ERROR expected identifier + builtin # offset_of(S, f..); //~ ERROR offset_of expects dot-separated field and variant names } fn t7() { - builtin # offset_of(S, f..); //~ ERROR expected one of -} -fn t8() { - // Already errored upon at the macro level. Yielding an error would require - // extra effort. - builtin # offset_of(S, f..,); + builtin # offset_of(S, f..,); //~ ERROR offset_of expects dot-separated field and variant names } struct S { f: u8, } diff --git a/tests/ui/offset-of/offset-of-builtin.stderr b/tests/ui/offset-of/offset-of-builtin.stderr index 1a1f33cc613a7..5917ee2936361 100644 --- a/tests/ui/offset-of/offset-of-builtin.stderr +++ b/tests/ui/offset-of/offset-of-builtin.stderr @@ -4,62 +4,43 @@ error: expected one of `!`, `(`, `+`, `,`, `::`, or `<`, found `)` LL | builtin # offset_of(NotEnoughArguments); | ^ expected one of `!`, `(`, `+`, `,`, `::`, or `<` -error: expected identifier, found `,` - --> $DIR/offset-of-builtin.rs:16:41 +error: expected expression, found `)` + --> $DIR/offset-of-builtin.rs:11:55 | -LL | builtin # offset_of(Container, field, too many arguments); - | ^ - | | - | expected identifier - | help: remove this comma +LL | builtin # offset_of(NotEnoughArgumentsWithAComma, ); + | ^ expected expression -error: expected one of `)` or `.`, found `,` - --> $DIR/offset-of-builtin.rs:16:41 +error: expected `)`, found `too` + --> $DIR/offset-of-builtin.rs:14:31 | -LL | builtin # offset_of(Container, field, too many arguments); - | ^ - | | - | expected one of `)` or `.` - | help: missing `.` - -error: expected one of `)` or `.`, found `many` - --> $DIR/offset-of-builtin.rs:16:47 - | -LL | builtin # offset_of(Container, field, too many arguments); - | -^^^^ expected one of `)` or `.` - | | - | help: missing `.` - -error: expected one of `)` or `.`, found `arguments` - --> $DIR/offset-of-builtin.rs:16:52 +LL | builtin # offset_of(S, f, too many arguments); + | ^^^ expected `)` | -LL | builtin # offset_of(Container, field, too many arguments); - | -^^^^^^^^^ expected one of `)` or `.` - | | - | help: missing `.` + = note: unexpected third argument to offset_of -error: expected identifier, found `)` - --> $DIR/offset-of-builtin.rs:30:30 +error: unexpected token: `)` + --> $DIR/offset-of-builtin.rs:20:30 | LL | builtin # offset_of(S, f.); - | ^ expected identifier + | ^ -error: expected identifier, found `,` - --> $DIR/offset-of-builtin.rs:33:30 +error: unexpected token: `,` + --> $DIR/offset-of-builtin.rs:23:30 | LL | builtin # offset_of(S, f.,); - | ^ expected identifier + | ^ -error: expected one of `)` or `.`, found `..` - --> $DIR/offset-of-builtin.rs:36:29 +error: offset_of expects dot-separated field and variant names + --> $DIR/offset-of-builtin.rs:26:28 | LL | builtin # offset_of(S, f..); - | ^^ expected one of `)` or `.` - | -help: if you meant to bind the contents of the rest of the array pattern into `f`, use `@` + | ^^^ + +error: offset_of expects dot-separated field and variant names + --> $DIR/offset-of-builtin.rs:29:28 | -LL | builtin # offset_of(S, f @ ..); - | + +LL | builtin # offset_of(S, f..,); + | ^^^ -error: aborting due to 8 previous errors +error: aborting due to 7 previous errors diff --git a/tests/ui/offset-of/offset-of-self.rs b/tests/ui/offset-of/offset-of-self.rs index dbeef0e74dc37..04dcaf7c0a6b6 100644 --- a/tests/ui/offset-of/offset-of-self.rs +++ b/tests/ui/offset-of/offset-of-self.rs @@ -17,9 +17,8 @@ impl S { offset_of!(Self, v) } fn v_offs_wrong_syntax() { - offset_of!(Self, Self::v); //~ ERROR no rules expected the token `::` - offset_of!(S, Self); //~ ERROR expected identifier, found keyword `Self` - //~| no field `Self` on type `S` + offset_of!(Self, Self::v); //~ offset_of expects dot-separated field and variant names + offset_of!(S, Self); //~ no field `Self` on type `S` } fn offs_in_c() -> usize { offset_of!(C, w) @@ -51,8 +50,6 @@ fn main() { offset_of!(self::S, v); offset_of!(Self, v); //~ ERROR cannot find type `Self` in this scope - offset_of!(S, self); //~ ERROR expected identifier, found keyword `self` - //~| no field `self` on type `S` - offset_of!(S, v.self); //~ ERROR expected identifier, found keyword `self` - //~| no field `self` on type `u8` + offset_of!(S, self); //~ no field `self` on type `S` + offset_of!(S, v.self); //~ no field `self` on type `u8` } diff --git a/tests/ui/offset-of/offset-of-self.stderr b/tests/ui/offset-of/offset-of-self.stderr index 2dc17189a702e..7c7576e066b6f 100644 --- a/tests/ui/offset-of/offset-of-self.stderr +++ b/tests/ui/offset-of/offset-of-self.stderr @@ -1,31 +1,11 @@ -error: no rules expected the token `::` - --> $DIR/offset-of-self.rs:20:30 +error: offset_of expects dot-separated field and variant names + --> $DIR/offset-of-self.rs:20:26 | LL | offset_of!(Self, Self::v); - | ^^ no rules expected this token in macro call - | - = note: while trying to match sequence start - -error: expected identifier, found keyword `Self` - --> $DIR/offset-of-self.rs:21:23 - | -LL | offset_of!(S, Self); - | ^^^^ expected identifier, found keyword - -error: expected identifier, found keyword `self` - --> $DIR/offset-of-self.rs:54:19 - | -LL | offset_of!(S, self); - | ^^^^ expected identifier, found keyword - -error: expected identifier, found keyword `self` - --> $DIR/offset-of-self.rs:56:21 - | -LL | offset_of!(S, v.self); - | ^^^^ expected identifier, found keyword + | ^^^^^^^ error[E0412]: cannot find type `S` in module `self` - --> $DIR/offset-of-self.rs:35:26 + --> $DIR/offset-of-self.rs:34:26 | LL | offset_of!(self::S, v); | ^ not found in `self` @@ -41,7 +21,7 @@ LL + offset_of!(S, v); | error[E0411]: cannot find type `Self` in this scope - --> $DIR/offset-of-self.rs:52:16 + --> $DIR/offset-of-self.rs:51:16 | LL | fn main() { | ---- `Self` not allowed in a function @@ -58,13 +38,13 @@ LL | offset_of!(S, Self); = note: available fields are: `v`, `w` error[E0616]: field `v` of struct `T` is private - --> $DIR/offset-of-self.rs:41:30 + --> $DIR/offset-of-self.rs:40:30 | LL | offset_of!(Self, v) | ^ private field error[E0609]: no field `self` on type `S` - --> $DIR/offset-of-self.rs:54:19 + --> $DIR/offset-of-self.rs:53:19 | LL | offset_of!(S, self); | ^^^^ @@ -72,12 +52,12 @@ LL | offset_of!(S, self); = note: available fields are: `v`, `w` error[E0609]: no field `self` on type `u8` - --> $DIR/offset-of-self.rs:56:21 + --> $DIR/offset-of-self.rs:54:21 | LL | offset_of!(S, v.self); | ^^^^ -error: aborting due to 10 previous errors +error: aborting due to 7 previous errors Some errors have detailed explanations: E0411, E0412, E0609, E0616. For more information about an error, try `rustc --explain E0411`. diff --git a/tests/ui/offset-of/offset-of-tuple-nested.rs b/tests/ui/offset-of/offset-of-tuple-nested.rs index 00fbb6bf8f407..59b02e3c5c433 100644 --- a/tests/ui/offset-of/offset-of-tuple-nested.rs +++ b/tests/ui/offset-of/offset-of-tuple-nested.rs @@ -3,7 +3,6 @@ // similar to why `offset-of-unsized.rs` is also build-pass #![feature(offset_of)] -#![feature(builtin_syntax)] use std::mem::offset_of; @@ -17,13 +16,13 @@ fn main() { // Complex case: do all combinations of spacings because the spacing determines what gets // sent to the lexer. println!("{}", offset_of!(ComplexTup, 0.1.1.1)); - println!("{}", builtin # offset_of(ComplexTup, 0. 1.1.1)); + println!("{}", offset_of!(ComplexTup, 0. 1.1.1)); println!("{}", offset_of!(ComplexTup, 0 . 1.1.1)); println!("{}", offset_of!(ComplexTup, 0 .1.1.1)); println!("{}", offset_of!(ComplexTup, 0.1 .1.1)); println!("{}", offset_of!(ComplexTup, 0.1 . 1.1)); println!("{}", offset_of!(ComplexTup, 0.1. 1.1)); - println!("{}", builtin # offset_of(ComplexTup, 0.1.1. 1)); + println!("{}", offset_of!(ComplexTup, 0.1.1. 1)); println!("{}", offset_of!(ComplexTup, 0.1.1 . 1)); println!("{}", offset_of!(ComplexTup, 0.1.1 .1)); diff --git a/tests/ui/offset-of/offset-of-tuple.rs b/tests/ui/offset-of/offset-of-tuple.rs index e31b037ee3e01..b6fc1e32229a1 100644 --- a/tests/ui/offset-of/offset-of-tuple.rs +++ b/tests/ui/offset-of/offset-of-tuple.rs @@ -10,9 +10,9 @@ fn main() { offset_of!((u8, u8), 1_u8); //~ ERROR no field `1_` //~| ERROR suffixes on a tuple index offset_of!((u8, u8), +1); //~ ERROR no rules expected - offset_of!((u8, u8), -1); //~ ERROR no rules expected - offset_of!((u8, u8), 1.); //~ ERROR expected identifier, found `)` - offset_of!((u8, u8), 1 .); //~ ERROR unexpected end of macro + offset_of!((u8, u8), -1); //~ ERROR offset_of expects dot-separated field and variant names + offset_of!((u8, u8), 1.); //~ ERROR offset_of expects dot-separated field and variant names + offset_of!((u8, u8), 1 .); //~ unexpected token: `)` builtin # offset_of((u8, u8), 1e2); //~ ERROR no field `1e2` builtin # offset_of((u8, u8), _0); //~ ERROR no field `_0` builtin # offset_of((u8, u8), 01); //~ ERROR no field `01` @@ -20,12 +20,12 @@ fn main() { //~| ERROR suffixes on a tuple index // We need to put these into curly braces, otherwise only one of the // errors will be emitted and the others suppressed. - { builtin # offset_of((u8, u8), +1) }; //~ ERROR expected identifier, found `+` - { builtin # offset_of((u8, u8), 1.) }; //~ ERROR expected identifier, found `)` - { builtin # offset_of((u8, u8), 1 .) }; //~ ERROR expected identifier, found `)` + { builtin # offset_of((u8, u8), +1) }; //~ ERROR leading `+` is not supported + { builtin # offset_of((u8, u8), 1.) }; //~ ERROR offset_of expects dot-separated field and variant names + { builtin # offset_of((u8, u8), 1 .) }; //~ ERROR unexpected token: `)` } -type ComplexTup = ((u8, (u8, u8)), u8); +type ComplexTup = (((u8, u8), u8), u8); fn nested() { offset_of!(((u8, u16), (u32, u16, u8)), 0.2); //~ ERROR no field `2` @@ -33,22 +33,22 @@ fn nested() { offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0); //~ ERROR no field `0` // All combinations of spaces (this sends different tokens to the parser) - offset_of!(ComplexTup, 0.0.1.); //~ ERROR expected identifier - offset_of!(ComplexTup, 0 .0.1.); //~ ERROR unexpected end of macro - offset_of!(ComplexTup, 0 . 0.1.); //~ ERROR unexpected end of macro - offset_of!(ComplexTup, 0. 0.1.); //~ ERROR no rules expected - offset_of!(ComplexTup, 0.0 .1.); //~ ERROR expected identifier, found `)` - offset_of!(ComplexTup, 0.0 . 1.); //~ ERROR expected identifier, found `)` - offset_of!(ComplexTup, 0.0. 1.); //~ ERROR expected identifier, found `)` + offset_of!(ComplexTup, 0.0.1.); //~ ERROR unexpected token: `)` + offset_of!(ComplexTup, 0 .0.1.); //~ ERROR unexpected token: `)` + offset_of!(ComplexTup, 0 . 0.1.); //~ ERROR unexpected token: `)` + offset_of!(ComplexTup, 0. 0.1.); //~ ERROR unexpected token: `)` + offset_of!(ComplexTup, 0.0 .1.); //~ ERROR unexpected token: `)` + offset_of!(ComplexTup, 0.0 . 1.); //~ ERROR unexpected token: `)` + offset_of!(ComplexTup, 0.0. 1.); //~ ERROR unexpected token: `)` // Test for builtin too to ensure that the builtin syntax can also handle these cases // We need to put these into curly braces, otherwise only one of the // errors will be emitted and the others suppressed. - { builtin # offset_of(ComplexTup, 0.0.1.) }; //~ ERROR expected identifier, found `)` - { builtin # offset_of(ComplexTup, 0 .0.1.) }; //~ ERROR expected identifier, found `)` - { builtin # offset_of(ComplexTup, 0 . 0.1.) }; //~ ERROR expected identifier, found `)` - { builtin # offset_of(ComplexTup, 0. 0.1.) }; //~ ERROR expected identifier, found `)` - { builtin # offset_of(ComplexTup, 0.0 .1.) }; //~ ERROR expected identifier, found `)` - { builtin # offset_of(ComplexTup, 0.0 . 1.) }; //~ ERROR expected identifier, found `)` - { builtin # offset_of(ComplexTup, 0.0. 1.) }; //~ ERROR expected identifier, found `)` + { builtin # offset_of(ComplexTup, 0.0.1.) }; //~ ERROR unexpected token: `)` + { builtin # offset_of(ComplexTup, 0 .0.1.) }; //~ ERROR unexpected token: `)` + { builtin # offset_of(ComplexTup, 0 . 0.1.) }; //~ ERROR unexpected token: `)` + { builtin # offset_of(ComplexTup, 0. 0.1.) }; //~ ERROR unexpected token: `)` + { builtin # offset_of(ComplexTup, 0.0 .1.) }; //~ ERROR unexpected token: `)` + { builtin # offset_of(ComplexTup, 0.0 . 1.) }; //~ ERROR unexpected token: `)` + { builtin # offset_of(ComplexTup, 0.0. 1.) }; //~ ERROR unexpected token: `)` } diff --git a/tests/ui/offset-of/offset-of-tuple.stderr b/tests/ui/offset-of/offset-of-tuple.stderr index ed9523458063d..e9aa495becdfa 100644 --- a/tests/ui/offset-of/offset-of-tuple.stderr +++ b/tests/ui/offset-of/offset-of-tuple.stderr @@ -4,65 +4,71 @@ error: suffixes on a tuple index are invalid LL | builtin # offset_of((u8, u8), 1_u8); | ^^^^ invalid suffix `u8` -error: expected identifier, found `+` +error: leading `+` is not supported --> $DIR/offset-of-tuple.rs:23:37 | LL | { builtin # offset_of((u8, u8), +1) }; - | ^ expected identifier + | ^ unexpected `+` + | +help: try removing the `+` + | +LL - { builtin # offset_of((u8, u8), +1) }; +LL + { builtin # offset_of((u8, u8), 1) }; + | -error: expected identifier, found `)` - --> $DIR/offset-of-tuple.rs:24:39 +error: offset_of expects dot-separated field and variant names + --> $DIR/offset-of-tuple.rs:24:38 | LL | { builtin # offset_of((u8, u8), 1.) }; - | ^ expected identifier + | ^ -error: expected identifier, found `)` +error: unexpected token: `)` --> $DIR/offset-of-tuple.rs:25:40 | LL | { builtin # offset_of((u8, u8), 1 .) }; - | ^ expected identifier + | ^ -error: expected identifier, found `)` +error: unexpected token: `)` --> $DIR/offset-of-tuple.rs:47:45 | LL | { builtin # offset_of(ComplexTup, 0.0.1.) }; - | ^ expected identifier + | ^ -error: expected identifier, found `)` +error: unexpected token: `)` --> $DIR/offset-of-tuple.rs:48:46 | LL | { builtin # offset_of(ComplexTup, 0 .0.1.) }; - | ^ expected identifier + | ^ -error: expected identifier, found `)` +error: unexpected token: `)` --> $DIR/offset-of-tuple.rs:49:47 | LL | { builtin # offset_of(ComplexTup, 0 . 0.1.) }; - | ^ expected identifier + | ^ -error: expected identifier, found `)` +error: unexpected token: `)` --> $DIR/offset-of-tuple.rs:50:46 | LL | { builtin # offset_of(ComplexTup, 0. 0.1.) }; - | ^ expected identifier + | ^ -error: expected identifier, found `)` +error: unexpected token: `)` --> $DIR/offset-of-tuple.rs:51:46 | LL | { builtin # offset_of(ComplexTup, 0.0 .1.) }; - | ^ expected identifier + | ^ -error: expected identifier, found `)` +error: unexpected token: `)` --> $DIR/offset-of-tuple.rs:52:47 | LL | { builtin # offset_of(ComplexTup, 0.0 . 1.) }; - | ^ expected identifier + | ^ -error: expected identifier, found `)` +error: unexpected token: `)` --> $DIR/offset-of-tuple.rs:53:46 | LL | { builtin # offset_of(ComplexTup, 0.0. 1.) }; - | ^ expected identifier + | ^ error: suffixes on a tuple index are invalid --> $DIR/offset-of-tuple.rs:10:26 @@ -70,96 +76,74 @@ error: suffixes on a tuple index are invalid LL | offset_of!((u8, u8), 1_u8); | ^^^^ invalid suffix `u8` -error: no rules expected the token `1` - --> $DIR/offset-of-tuple.rs:12:27 +error: no rules expected the token `+` + --> $DIR/offset-of-tuple.rs:12:26 | LL | offset_of!((u8, u8), +1); - | ^ no rules expected this token in macro call + | ^ no rules expected this token in macro call | - = note: while trying to match sequence start +note: while trying to match meta-variable `$fields:expr` + --> $SRC_DIR/core/src/mem/mod.rs:LL:COL -error: no rules expected the token `1` - --> $DIR/offset-of-tuple.rs:13:27 +error: offset_of expects dot-separated field and variant names + --> $DIR/offset-of-tuple.rs:13:26 | LL | offset_of!((u8, u8), -1); - | ^ no rules expected this token in macro call - | - = note: while trying to match sequence start + | ^^ -error: expected identifier, found `)` - --> $DIR/offset-of-tuple.rs:14:5 +error: offset_of expects dot-separated field and variant names + --> $DIR/offset-of-tuple.rs:14:27 | LL | offset_of!((u8, u8), 1.); - | ^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier - | - = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info) + | ^ -error: unexpected end of macro invocation +error: unexpected token: `)` --> $DIR/offset-of-tuple.rs:15:29 | LL | offset_of!((u8, u8), 1 .); - | ^ missing tokens in macro arguments - | -note: while trying to match meta-variable `$fields:tt` - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | ^ -error: expected identifier, found `)` - --> $DIR/offset-of-tuple.rs:36:5 +error: unexpected token: `)` + --> $DIR/offset-of-tuple.rs:36:34 | LL | offset_of!(ComplexTup, 0.0.1.); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier - | - = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info) + | ^ -error: unexpected end of macro invocation +error: unexpected token: `)` --> $DIR/offset-of-tuple.rs:37:35 | LL | offset_of!(ComplexTup, 0 .0.1.); - | ^ missing tokens in macro arguments - | -note: while trying to match meta-variable `$fields:tt` - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | ^ -error: unexpected end of macro invocation +error: unexpected token: `)` --> $DIR/offset-of-tuple.rs:38:36 | LL | offset_of!(ComplexTup, 0 . 0.1.); - | ^ missing tokens in macro arguments - | -note: while trying to match meta-variable `$fields:tt` - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | ^ -error: no rules expected the token `0.1` - --> $DIR/offset-of-tuple.rs:39:31 +error: unexpected token: `)` + --> $DIR/offset-of-tuple.rs:39:35 | LL | offset_of!(ComplexTup, 0. 0.1.); - | ^^^ no rules expected this token in macro call - | - = note: while trying to match sequence start + | ^ -error: expected identifier, found `)` - --> $DIR/offset-of-tuple.rs:40:5 +error: unexpected token: `)` + --> $DIR/offset-of-tuple.rs:40:35 | LL | offset_of!(ComplexTup, 0.0 .1.); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier - | - = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info) + | ^ -error: expected identifier, found `)` - --> $DIR/offset-of-tuple.rs:41:5 +error: unexpected token: `)` + --> $DIR/offset-of-tuple.rs:41:36 | LL | offset_of!(ComplexTup, 0.0 . 1.); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier - | - = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info) + | ^ -error: expected identifier, found `)` - --> $DIR/offset-of-tuple.rs:42:5 +error: unexpected token: `)` + --> $DIR/offset-of-tuple.rs:42:35 | LL | offset_of!(ComplexTup, 0.0. 1.); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier - | - = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info) + | ^ error[E0609]: no field `_0` on type `(u8, u8)` --> $DIR/offset-of-tuple.rs:7:26 @@ -212,8 +196,16 @@ LL | builtin # offset_of((u8, u8), 1_u8); error[E0609]: no field `2` on type `(u8, u16)` --> $DIR/offset-of-tuple.rs:31:47 | -LL | offset_of!(((u8, u16), (u32, u16, u8)), 0.2); - | ^ +LL | offset_of!(((u8, u16), (u32, u16, u8)), 0.2); + | _____------------------------------------------^- + | | | + | | in this macro invocation +LL | | offset_of!(((u8, u16), (u32, u16, u8)), 1.2); +LL | | offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0); +LL | | +... | + | + = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0609]: no field `0` on type `u8` --> $DIR/offset-of-tuple.rs:33:49 diff --git a/tests/ui/pattern/issue-117626.rs b/tests/ui/pattern/issue-117626.rs new file mode 100644 index 0000000000000..f87147a5d88ec --- /dev/null +++ b/tests/ui/pattern/issue-117626.rs @@ -0,0 +1,21 @@ +// check-pass + +#[derive(PartialEq)] +struct NonMatchable; + +impl Eq for NonMatchable {} + +#[derive(PartialEq, Eq)] +enum Foo { + A(NonMatchable), + B(*const u8), +} + +const CONST: Foo = Foo::B(std::ptr::null()); + +fn main() { + match CONST { + CONST => 0, + _ => 1, + }; +} diff --git a/tests/ui/privacy/auxiliary/issue-119463-extern.rs b/tests/ui/privacy/auxiliary/issue-119463-extern.rs new file mode 100644 index 0000000000000..e703a1fb2c2df --- /dev/null +++ b/tests/ui/privacy/auxiliary/issue-119463-extern.rs @@ -0,0 +1,3 @@ +trait PrivateTrait { + const FOO: usize; +} diff --git a/tests/ui/privacy/issue-119463.rs b/tests/ui/privacy/issue-119463.rs new file mode 100644 index 0000000000000..e010bc9f536b0 --- /dev/null +++ b/tests/ui/privacy/issue-119463.rs @@ -0,0 +1,15 @@ +// aux-build:issue-119463-extern.rs + +extern crate issue_119463_extern; + +struct S; + +impl issue_119463_extern::PrivateTrait for S { + //~^ ERROR: trait `PrivateTrait` is private + const FOO: usize = 1; + + fn nonexistent() {} + //~^ ERROR: method `nonexistent` is not a member of trait +} + +fn main() {} diff --git a/tests/ui/privacy/issue-119463.stderr b/tests/ui/privacy/issue-119463.stderr new file mode 100644 index 0000000000000..4a0684de613ca --- /dev/null +++ b/tests/ui/privacy/issue-119463.stderr @@ -0,0 +1,22 @@ +error[E0407]: method `nonexistent` is not a member of trait `issue_119463_extern::PrivateTrait` + --> $DIR/issue-119463.rs:11:5 + | +LL | fn nonexistent() {} + | ^^^^^^^^^^^^^^^^^^^ not a member of trait `issue_119463_extern::PrivateTrait` + +error[E0603]: trait `PrivateTrait` is private + --> $DIR/issue-119463.rs:7:27 + | +LL | impl issue_119463_extern::PrivateTrait for S { + | ^^^^^^^^^^^^ private trait + | +note: the trait `PrivateTrait` is defined here + --> $DIR/auxiliary/issue-119463-extern.rs:1:1 + | +LL | trait PrivateTrait { + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0407, E0603. +For more information about an error, try `rustc --explain E0407`. diff --git a/tests/ui/proc-macro/inner-attrs.rs b/tests/ui/proc-macro/inner-attrs.rs index 1000c9c755ffc..c448294e0f64e 100644 --- a/tests/ui/proc-macro/inner-attrs.rs +++ b/tests/ui/proc-macro/inner-attrs.rs @@ -1,5 +1,6 @@ // gate-test-custom_inner_attributes // compile-flags: -Z span-debug --error-format human +// error-pattern:expected non-macro inner attribute // aux-build:test-macros.rs // edition:2018 @@ -61,19 +62,19 @@ fn bar() { ); for _ in &[true] { - #![print_attr] //~ ERROR expected non-macro inner attribute + #![print_attr] } let _ = { - #![print_attr] //~ ERROR expected non-macro inner attribute + #![print_attr] }; let _ = async { - #![print_attr] //~ ERROR expected non-macro inner attribute + #![print_attr] }; { - #![print_attr] //~ ERROR expected non-macro inner attribute + #![print_attr] }; } diff --git a/tests/ui/proc-macro/inner-attrs.stderr b/tests/ui/proc-macro/inner-attrs.stderr index a332e143a79f1..ee8732c650dc9 100644 --- a/tests/ui/proc-macro/inner-attrs.stderr +++ b/tests/ui/proc-macro/inner-attrs.stderr @@ -1,23 +1,23 @@ error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:64:12 + --> $DIR/inner-attrs.rs:65:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:68:12 + --> $DIR/inner-attrs.rs:69:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:72:12 + --> $DIR/inner-attrs.rs:73:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:76:12 + --> $DIR/inner-attrs.rs:77:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute diff --git a/tests/ui/proc-macro/inner-attrs.stdout b/tests/ui/proc-macro/inner-attrs.stdout index 037ec044e426e..39ec6834f0658 100644 --- a/tests/ui/proc-macro/inner-attrs.stdout +++ b/tests/ui/proc-macro/inner-attrs.stdout @@ -2,7 +2,7 @@ PRINT-ATTR_ARGS INPUT (DISPLAY): first PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "first", - span: $DIR/inner-attrs.rs:17:25: 17:30 (#0), + span: $DIR/inner-attrs.rs:18:25: 18:30 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(second)] fn foo() @@ -13,40 +13,40 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/inner-attrs.rs:18:1: 18:2 (#0), + span: $DIR/inner-attrs.rs:19:1: 19:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:18:3: 18:24 (#0), + span: $DIR/inner-attrs.rs:19:3: 19:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "second", - span: $DIR/inner-attrs.rs:18:25: 18:31 (#0), + span: $DIR/inner-attrs.rs:19:25: 19:31 (#0), }, ], - span: $DIR/inner-attrs.rs:18:24: 18:32 (#0), + span: $DIR/inner-attrs.rs:19:24: 19:32 (#0), }, ], - span: $DIR/inner-attrs.rs:18:2: 18:33 (#0), + span: $DIR/inner-attrs.rs:19:2: 19:33 (#0), }, Ident { ident: "fn", - span: $DIR/inner-attrs.rs:19:1: 19:3 (#0), + span: $DIR/inner-attrs.rs:20:1: 20:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:19:4: 19:7 (#0), + span: $DIR/inner-attrs.rs:20:4: 20:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:19:7: 19:9 (#0), + span: $DIR/inner-attrs.rs:20:7: 20:9 (#0), }, Group { delimiter: Brace, @@ -54,72 +54,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:20:5: 20:6 (#0), + span: $DIR/inner-attrs.rs:21:5: 21:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:20:6: 20:7 (#0), + span: $DIR/inner-attrs.rs:21:6: 21:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:20:8: 20:29 (#0), + span: $DIR/inner-attrs.rs:21:8: 21:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:20:30: 20:35 (#0), + span: $DIR/inner-attrs.rs:21:30: 21:35 (#0), }, ], - span: $DIR/inner-attrs.rs:20:29: 20:36 (#0), + span: $DIR/inner-attrs.rs:21:29: 21:36 (#0), }, ], - span: $DIR/inner-attrs.rs:20:7: 20:37 (#0), + span: $DIR/inner-attrs.rs:21:7: 21:37 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:21:5: 21:6 (#0), + span: $DIR/inner-attrs.rs:22:5: 22:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:21:6: 21:7 (#0), + span: $DIR/inner-attrs.rs:22:6: 22:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:21:8: 21:29 (#0), + span: $DIR/inner-attrs.rs:22:8: 22:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:21:30: 21:36 (#0), + span: $DIR/inner-attrs.rs:22:30: 22:36 (#0), }, ], - span: $DIR/inner-attrs.rs:21:29: 21:37 (#0), + span: $DIR/inner-attrs.rs:22:29: 22:37 (#0), }, ], - span: $DIR/inner-attrs.rs:21:7: 21:38 (#0), + span: $DIR/inner-attrs.rs:22:7: 22:38 (#0), }, ], - span: $DIR/inner-attrs.rs:19:10: 22:2 (#0), + span: $DIR/inner-attrs.rs:20:10: 23:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): second PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "second", - span: $DIR/inner-attrs.rs:18:25: 18:31 (#0), + span: $DIR/inner-attrs.rs:19:25: 19:31 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn foo() @@ -129,16 +129,16 @@ PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): fn foo() PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:19:1: 19:3 (#0), + span: $DIR/inner-attrs.rs:20:1: 20:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:19:4: 19:7 (#0), + span: $DIR/inner-attrs.rs:20:4: 20:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:19:7: 19:9 (#0), + span: $DIR/inner-attrs.rs:20:7: 20:9 (#0), }, Group { delimiter: Brace, @@ -146,72 +146,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:20:5: 20:6 (#0), + span: $DIR/inner-attrs.rs:21:5: 21:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:20:6: 20:7 (#0), + span: $DIR/inner-attrs.rs:21:6: 21:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:20:8: 20:29 (#0), + span: $DIR/inner-attrs.rs:21:8: 21:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:20:30: 20:35 (#0), + span: $DIR/inner-attrs.rs:21:30: 21:35 (#0), }, ], - span: $DIR/inner-attrs.rs:20:29: 20:36 (#0), + span: $DIR/inner-attrs.rs:21:29: 21:36 (#0), }, ], - span: $DIR/inner-attrs.rs:20:7: 20:37 (#0), + span: $DIR/inner-attrs.rs:21:7: 21:37 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:21:5: 21:6 (#0), + span: $DIR/inner-attrs.rs:22:5: 22:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:21:6: 21:7 (#0), + span: $DIR/inner-attrs.rs:22:6: 22:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:21:8: 21:29 (#0), + span: $DIR/inner-attrs.rs:22:8: 22:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:21:30: 21:36 (#0), + span: $DIR/inner-attrs.rs:22:30: 22:36 (#0), }, ], - span: $DIR/inner-attrs.rs:21:29: 21:37 (#0), + span: $DIR/inner-attrs.rs:22:29: 22:37 (#0), }, ], - span: $DIR/inner-attrs.rs:21:7: 21:38 (#0), + span: $DIR/inner-attrs.rs:22:7: 22:38 (#0), }, ], - span: $DIR/inner-attrs.rs:19:10: 22:2 (#0), + span: $DIR/inner-attrs.rs:20:10: 23:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): third PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:20:30: 20:35 (#0), + span: $DIR/inner-attrs.rs:21:30: 21:35 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn foo() { #![print_target_and_args(fourth)] } @@ -219,16 +219,16 @@ PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): fn foo() { #! [print_target_and_args(fou PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:19:1: 19:3 (#0), + span: $DIR/inner-attrs.rs:20:1: 20:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:19:4: 19:7 (#0), + span: $DIR/inner-attrs.rs:20:4: 20:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:19:7: 19:9 (#0), + span: $DIR/inner-attrs.rs:20:7: 20:9 (#0), }, Group { delimiter: Brace, @@ -236,70 +236,70 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:21:5: 21:6 (#0), + span: $DIR/inner-attrs.rs:22:5: 22:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:21:6: 21:7 (#0), + span: $DIR/inner-attrs.rs:22:6: 22:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:21:8: 21:29 (#0), + span: $DIR/inner-attrs.rs:22:8: 22:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:21:30: 21:36 (#0), + span: $DIR/inner-attrs.rs:22:30: 22:36 (#0), }, ], - span: $DIR/inner-attrs.rs:21:29: 21:37 (#0), + span: $DIR/inner-attrs.rs:22:29: 22:37 (#0), }, ], - span: $DIR/inner-attrs.rs:21:7: 21:38 (#0), + span: $DIR/inner-attrs.rs:22:7: 22:38 (#0), }, ], - span: $DIR/inner-attrs.rs:19:10: 22:2 (#0), + span: $DIR/inner-attrs.rs:20:10: 23:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): fourth PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:21:30: 21:36 (#0), + span: $DIR/inner-attrs.rs:22:30: 22:36 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn foo() {} PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:19:1: 19:3 (#0), + span: $DIR/inner-attrs.rs:20:1: 20:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:19:4: 19:7 (#0), + span: $DIR/inner-attrs.rs:20:4: 20:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:19:7: 19:9 (#0), + span: $DIR/inner-attrs.rs:20:7: 20:9 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/inner-attrs.rs:19:10: 22:2 (#0), + span: $DIR/inner-attrs.rs:20:10: 23:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_first PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_first", - span: $DIR/inner-attrs.rs:24:25: 24:34 (#0), + span: $DIR/inner-attrs.rs:25:25: 25:34 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(mod_second)] mod inline_mod @@ -313,35 +313,35 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/inner-attrs.rs:25:1: 25:2 (#0), + span: $DIR/inner-attrs.rs:26:1: 26:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:25:3: 25:24 (#0), + span: $DIR/inner-attrs.rs:26:3: 26:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_second", - span: $DIR/inner-attrs.rs:25:25: 25:35 (#0), + span: $DIR/inner-attrs.rs:26:25: 26:35 (#0), }, ], - span: $DIR/inner-attrs.rs:25:24: 25:36 (#0), + span: $DIR/inner-attrs.rs:26:24: 26:36 (#0), }, ], - span: $DIR/inner-attrs.rs:25:2: 25:37 (#0), + span: $DIR/inner-attrs.rs:26:2: 26:37 (#0), }, Ident { ident: "mod", - span: $DIR/inner-attrs.rs:26:1: 26:4 (#0), + span: $DIR/inner-attrs.rs:27:1: 27:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:26:5: 26:15 (#0), + span: $DIR/inner-attrs.rs:27:5: 27:15 (#0), }, Group { delimiter: Brace, @@ -349,72 +349,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:27:5: 27:6 (#0), + span: $DIR/inner-attrs.rs:28:5: 28:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:27:6: 27:7 (#0), + span: $DIR/inner-attrs.rs:28:6: 28:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:27:8: 27:29 (#0), + span: $DIR/inner-attrs.rs:28:8: 28:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_third", - span: $DIR/inner-attrs.rs:27:30: 27:39 (#0), + span: $DIR/inner-attrs.rs:28:30: 28:39 (#0), }, ], - span: $DIR/inner-attrs.rs:27:29: 27:40 (#0), + span: $DIR/inner-attrs.rs:28:29: 28:40 (#0), }, ], - span: $DIR/inner-attrs.rs:27:7: 27:41 (#0), + span: $DIR/inner-attrs.rs:28:7: 28:41 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:28:5: 28:6 (#0), + span: $DIR/inner-attrs.rs:29:5: 29:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:28:6: 28:7 (#0), + span: $DIR/inner-attrs.rs:29:6: 29:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:28:8: 28:29 (#0), + span: $DIR/inner-attrs.rs:29:8: 29:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:28:30: 28:40 (#0), + span: $DIR/inner-attrs.rs:29:30: 29:40 (#0), }, ], - span: $DIR/inner-attrs.rs:28:29: 28:41 (#0), + span: $DIR/inner-attrs.rs:29:29: 29:41 (#0), }, ], - span: $DIR/inner-attrs.rs:28:7: 28:42 (#0), + span: $DIR/inner-attrs.rs:29:7: 29:42 (#0), }, ], - span: $DIR/inner-attrs.rs:26:16: 29:2 (#0), + span: $DIR/inner-attrs.rs:27:16: 30:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_second PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_second", - span: $DIR/inner-attrs.rs:25:25: 25:35 (#0), + span: $DIR/inner-attrs.rs:26:25: 26:35 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): mod inline_mod @@ -427,11 +427,11 @@ PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): mod inline_mod PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "mod", - span: $DIR/inner-attrs.rs:26:1: 26:4 (#0), + span: $DIR/inner-attrs.rs:27:1: 27:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:26:5: 26:15 (#0), + span: $DIR/inner-attrs.rs:27:5: 27:15 (#0), }, Group { delimiter: Brace, @@ -439,72 +439,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:27:5: 27:6 (#0), + span: $DIR/inner-attrs.rs:28:5: 28:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:27:6: 27:7 (#0), + span: $DIR/inner-attrs.rs:28:6: 28:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:27:8: 27:29 (#0), + span: $DIR/inner-attrs.rs:28:8: 28:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_third", - span: $DIR/inner-attrs.rs:27:30: 27:39 (#0), + span: $DIR/inner-attrs.rs:28:30: 28:39 (#0), }, ], - span: $DIR/inner-attrs.rs:27:29: 27:40 (#0), + span: $DIR/inner-attrs.rs:28:29: 28:40 (#0), }, ], - span: $DIR/inner-attrs.rs:27:7: 27:41 (#0), + span: $DIR/inner-attrs.rs:28:7: 28:41 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:28:5: 28:6 (#0), + span: $DIR/inner-attrs.rs:29:5: 29:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:28:6: 28:7 (#0), + span: $DIR/inner-attrs.rs:29:6: 29:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:28:8: 28:29 (#0), + span: $DIR/inner-attrs.rs:29:8: 29:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:28:30: 28:40 (#0), + span: $DIR/inner-attrs.rs:29:30: 29:40 (#0), }, ], - span: $DIR/inner-attrs.rs:28:29: 28:41 (#0), + span: $DIR/inner-attrs.rs:29:29: 29:41 (#0), }, ], - span: $DIR/inner-attrs.rs:28:7: 28:42 (#0), + span: $DIR/inner-attrs.rs:29:7: 29:42 (#0), }, ], - span: $DIR/inner-attrs.rs:26:16: 29:2 (#0), + span: $DIR/inner-attrs.rs:27:16: 30:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_third PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_third", - span: $DIR/inner-attrs.rs:27:30: 27:39 (#0), + span: $DIR/inner-attrs.rs:28:30: 28:39 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): mod inline_mod { #![print_target_and_args(mod_fourth)] } @@ -512,11 +512,11 @@ PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): mod inline_mod { #! [print_target_and_ar PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "mod", - span: $DIR/inner-attrs.rs:26:1: 26:4 (#0), + span: $DIR/inner-attrs.rs:27:1: 27:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:26:5: 26:15 (#0), + span: $DIR/inner-attrs.rs:27:5: 27:15 (#0), }, Group { delimiter: Brace, @@ -524,58 +524,58 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:28:5: 28:6 (#0), + span: $DIR/inner-attrs.rs:29:5: 29:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:28:6: 28:7 (#0), + span: $DIR/inner-attrs.rs:29:6: 29:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:28:8: 28:29 (#0), + span: $DIR/inner-attrs.rs:29:8: 29:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:28:30: 28:40 (#0), + span: $DIR/inner-attrs.rs:29:30: 29:40 (#0), }, ], - span: $DIR/inner-attrs.rs:28:29: 28:41 (#0), + span: $DIR/inner-attrs.rs:29:29: 29:41 (#0), }, ], - span: $DIR/inner-attrs.rs:28:7: 28:42 (#0), + span: $DIR/inner-attrs.rs:29:7: 29:42 (#0), }, ], - span: $DIR/inner-attrs.rs:26:16: 29:2 (#0), + span: $DIR/inner-attrs.rs:27:16: 30:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_fourth PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:28:30: 28:40 (#0), + span: $DIR/inner-attrs.rs:29:30: 29:40 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): mod inline_mod {} PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "mod", - span: $DIR/inner-attrs.rs:26:1: 26:4 (#0), + span: $DIR/inner-attrs.rs:27:1: 27:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:26:5: 26:15 (#0), + span: $DIR/inner-attrs.rs:27:5: 27:15 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/inner-attrs.rs:26:16: 29:2 (#0), + span: $DIR/inner-attrs.rs:27:16: 30:2 (#0), }, ] PRINT-DERIVE INPUT (DISPLAY): struct MyDerivePrint @@ -588,63 +588,63 @@ PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): struct MyDerivePrint PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: $DIR/inner-attrs.rs:36:1: 36:7 (#0), + span: $DIR/inner-attrs.rs:37:1: 37:7 (#0), }, Ident { ident: "MyDerivePrint", - span: $DIR/inner-attrs.rs:36:8: 36:21 (#0), + span: $DIR/inner-attrs.rs:37:8: 37:21 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "field", - span: $DIR/inner-attrs.rs:37:5: 37:10 (#0), + span: $DIR/inner-attrs.rs:38:5: 38:10 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/inner-attrs.rs:37:10: 37:11 (#0), + span: $DIR/inner-attrs.rs:38:10: 38:11 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "u8", - span: $DIR/inner-attrs.rs:37:13: 37:15 (#0), + span: $DIR/inner-attrs.rs:38:13: 38:15 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:37:15: 37:16 (#0), + span: $DIR/inner-attrs.rs:38:15: 38:16 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "match", - span: $DIR/inner-attrs.rs:38:9: 38:14 (#0), + span: $DIR/inner-attrs.rs:39:9: 39:14 (#0), }, Ident { ident: "true", - span: $DIR/inner-attrs.rs:38:15: 38:19 (#0), + span: $DIR/inner-attrs.rs:39:15: 39:19 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "_", - span: $DIR/inner-attrs.rs:39:13: 39:14 (#0), + span: $DIR/inner-attrs.rs:40:13: 40:14 (#0), }, Punct { ch: '=', spacing: Joint, - span: $DIR/inner-attrs.rs:39:15: 39:16 (#0), + span: $DIR/inner-attrs.rs:40:15: 40:16 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/inner-attrs.rs:39:16: 39:17 (#0), + span: $DIR/inner-attrs.rs:40:16: 40:17 (#0), }, Group { delimiter: Brace, @@ -652,69 +652,69 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:40:17: 40:18 (#0), + span: $DIR/inner-attrs.rs:41:17: 41:18 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:40:18: 40:19 (#0), + span: $DIR/inner-attrs.rs:41:18: 41:19 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:40:41: 40:52 (#0), + span: $DIR/inner-attrs.rs:41:41: 41:52 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:40:53: 40:58 (#0), + span: $DIR/inner-attrs.rs:41:53: 41:58 (#0), }, ], - span: $DIR/inner-attrs.rs:40:52: 40:59 (#0), + span: $DIR/inner-attrs.rs:41:52: 41:59 (#0), }, ], - span: $DIR/inner-attrs.rs:40:17: 40:18 (#0), + span: $DIR/inner-attrs.rs:41:17: 41:18 (#0), }, Ident { ident: "true", - span: $DIR/inner-attrs.rs:41:17: 41:21 (#0), + span: $DIR/inner-attrs.rs:42:17: 42:21 (#0), }, ], - span: $DIR/inner-attrs.rs:39:18: 42:14 (#0), + span: $DIR/inner-attrs.rs:40:18: 43:14 (#0), }, ], - span: $DIR/inner-attrs.rs:38:20: 43:10 (#0), + span: $DIR/inner-attrs.rs:39:20: 44:10 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:43:10: 43:11 (#0), + span: $DIR/inner-attrs.rs:44:10: 44:11 (#0), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: $DIR/inner-attrs.rs:44:9: 44:10 (#0), + span: $DIR/inner-attrs.rs:45:9: 45:10 (#0), }, ], - span: $DIR/inner-attrs.rs:37:17: 45:6 (#0), + span: $DIR/inner-attrs.rs:38:17: 46:6 (#0), }, ], - span: $DIR/inner-attrs.rs:37:12: 45:7 (#0), + span: $DIR/inner-attrs.rs:38:12: 46:7 (#0), }, ], - span: $DIR/inner-attrs.rs:36:22: 46:2 (#0), + span: $DIR/inner-attrs.rs:37:22: 47:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): tuple_attrs PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "tuple_attrs", - span: $DIR/inner-attrs.rs:49:29: 49:40 (#0), + span: $DIR/inner-attrs.rs:50:29: 50:40 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }); @@ -728,23 +728,23 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "3", suffix: None, - span: $DIR/inner-attrs.rs:50:9: 50:10 (#0), + span: $DIR/inner-attrs.rs:51:9: 51:10 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:50:10: 50:11 (#0), + span: $DIR/inner-attrs.rs:51:10: 51:11 (#0), }, Literal { kind: Integer, symbol: "4", suffix: None, - span: $DIR/inner-attrs.rs:50:12: 50:13 (#0), + span: $DIR/inner-attrs.rs:51:12: 51:13 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:50:13: 50:14 (#0), + span: $DIR/inner-attrs.rs:51:13: 51:14 (#0), }, Group { delimiter: Brace, @@ -752,85 +752,85 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:51:13: 51:14 (#0), + span: $DIR/inner-attrs.rs:52:13: 52:14 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:51:14: 51:15 (#0), + span: $DIR/inner-attrs.rs:52:14: 52:15 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg_attr", - span: $DIR/inner-attrs.rs:51:16: 51:24 (#0), + span: $DIR/inner-attrs.rs:52:16: 52:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/inner-attrs.rs:51:25: 51:28 (#0), + span: $DIR/inner-attrs.rs:52:25: 52:28 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/inner-attrs.rs:51:29: 51:34 (#0), + span: $DIR/inner-attrs.rs:52:29: 52:34 (#0), }, ], - span: $DIR/inner-attrs.rs:51:28: 51:35 (#0), + span: $DIR/inner-attrs.rs:52:28: 52:35 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:51:35: 51:36 (#0), + span: $DIR/inner-attrs.rs:52:35: 52:36 (#0), }, Ident { ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:51:37: 51:48 (#0), + span: $DIR/inner-attrs.rs:52:37: 52:48 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "innermost", - span: $DIR/inner-attrs.rs:51:49: 51:58 (#0), + span: $DIR/inner-attrs.rs:52:49: 52:58 (#0), }, ], - span: $DIR/inner-attrs.rs:51:48: 51:59 (#0), + span: $DIR/inner-attrs.rs:52:48: 52:59 (#0), }, ], - span: $DIR/inner-attrs.rs:51:24: 51:60 (#0), + span: $DIR/inner-attrs.rs:52:24: 52:60 (#0), }, ], - span: $DIR/inner-attrs.rs:51:15: 51:61 (#0), + span: $DIR/inner-attrs.rs:52:15: 52:61 (#0), }, Literal { kind: Integer, symbol: "5", suffix: None, - span: $DIR/inner-attrs.rs:52:13: 52:14 (#0), + span: $DIR/inner-attrs.rs:53:13: 53:14 (#0), }, ], - span: $DIR/inner-attrs.rs:50:15: 53:10 (#0), + span: $DIR/inner-attrs.rs:51:15: 54:10 (#0), }, ], - span: $DIR/inner-attrs.rs:49:43: 54:6 (#0), + span: $DIR/inner-attrs.rs:50:43: 55:6 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:54:6: 54:7 (#0), + span: $DIR/inner-attrs.rs:55:6: 55:7 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): tuple_attrs PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "tuple_attrs", - span: $DIR/inner-attrs.rs:56:29: 56:40 (#0), + span: $DIR/inner-attrs.rs:57:29: 57:40 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }); @@ -844,23 +844,23 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "3", suffix: None, - span: $DIR/inner-attrs.rs:57:9: 57:10 (#0), + span: $DIR/inner-attrs.rs:58:9: 58:10 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:57:10: 57:11 (#0), + span: $DIR/inner-attrs.rs:58:10: 58:11 (#0), }, Literal { kind: Integer, symbol: "4", suffix: None, - span: $DIR/inner-attrs.rs:57:12: 57:13 (#0), + span: $DIR/inner-attrs.rs:58:12: 58:13 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:57:13: 57:14 (#0), + span: $DIR/inner-attrs.rs:58:13: 58:14 (#0), }, Group { delimiter: Brace, @@ -868,105 +868,105 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:58:13: 58:14 (#0), + span: $DIR/inner-attrs.rs:59:13: 59:14 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:58:14: 58:15 (#0), + span: $DIR/inner-attrs.rs:59:14: 59:15 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg_attr", - span: $DIR/inner-attrs.rs:58:16: 58:24 (#0), + span: $DIR/inner-attrs.rs:59:16: 59:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/inner-attrs.rs:58:25: 58:28 (#0), + span: $DIR/inner-attrs.rs:59:25: 59:28 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/inner-attrs.rs:58:29: 58:34 (#0), + span: $DIR/inner-attrs.rs:59:29: 59:34 (#0), }, ], - span: $DIR/inner-attrs.rs:58:28: 58:35 (#0), + span: $DIR/inner-attrs.rs:59:28: 59:35 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:58:35: 58:36 (#0), + span: $DIR/inner-attrs.rs:59:35: 59:36 (#0), }, Ident { ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:58:37: 58:48 (#0), + span: $DIR/inner-attrs.rs:59:37: 59:48 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "innermost", - span: $DIR/inner-attrs.rs:58:49: 58:58 (#0), + span: $DIR/inner-attrs.rs:59:49: 59:58 (#0), }, ], - span: $DIR/inner-attrs.rs:58:48: 58:59 (#0), + span: $DIR/inner-attrs.rs:59:48: 59:59 (#0), }, ], - span: $DIR/inner-attrs.rs:58:24: 58:60 (#0), + span: $DIR/inner-attrs.rs:59:24: 59:60 (#0), }, ], - span: $DIR/inner-attrs.rs:58:15: 58:61 (#0), + span: $DIR/inner-attrs.rs:59:15: 59:61 (#0), }, Literal { kind: Integer, symbol: "5", suffix: None, - span: $DIR/inner-attrs.rs:59:13: 59:14 (#0), + span: $DIR/inner-attrs.rs:60:13: 60:14 (#0), }, ], - span: $DIR/inner-attrs.rs:57:15: 60:10 (#0), + span: $DIR/inner-attrs.rs:58:15: 61:10 (#0), }, ], - span: $DIR/inner-attrs.rs:56:43: 61:6 (#0), + span: $DIR/inner-attrs.rs:57:43: 62:6 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:61:6: 61:7 (#0), + span: $DIR/inner-attrs.rs:62:6: 62:7 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): tenth PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "tenth", - span: $DIR/inner-attrs.rs:83:42: 83:47 (#0), + span: $DIR/inner-attrs.rs:84:42: 84:47 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn weird_extern() {} PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:82:5: 82:7 (#0), + span: $DIR/inner-attrs.rs:83:5: 83:7 (#0), }, Ident { ident: "weird_extern", - span: $DIR/inner-attrs.rs:82:8: 82:20 (#0), + span: $DIR/inner-attrs.rs:83:8: 83:20 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:82:20: 82:22 (#0), + span: $DIR/inner-attrs.rs:83:20: 83:22 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/inner-attrs.rs:82:23: 84:6 (#0), + span: $DIR/inner-attrs.rs:83:23: 85:6 (#0), }, ] diff --git a/tests/ui/proc-macro/issue-75930-derive-cfg.rs b/tests/ui/proc-macro/issue-75930-derive-cfg.rs index e0213527c5005..1e37b40c9540f 100644 --- a/tests/ui/proc-macro/issue-75930-derive-cfg.rs +++ b/tests/ui/proc-macro/issue-75930-derive-cfg.rs @@ -1,13 +1,10 @@ // check-pass -// compile-flags: -Z span-debug --error-format human +// compile-flags: -Z span-debug // aux-build:test-macros.rs // Regression test for issue #75930 // Tests that we cfg-strip all targets before invoking // a derive macro -// We need '--error-format human' to stop compiletest from -// trying to interpret proc-macro output as JSON messages -// (a pretty-printed struct may cause a line to start with '{' ) // FIXME: We currently lose spans here (see issue #43081) #![no_std] // Don't load unnecessary hygiene information from std @@ -47,6 +44,8 @@ extern crate test_macros; // that kind of correction caused the problem seen in #76399, so maybe not. #[print_helper(a)] //~ WARN derive helper attribute is used before it is introduced + //~| WARN derive helper attribute is used before it is introduced + //~| WARN this was previously accepted //~| WARN this was previously accepted #[cfg_attr(not(FALSE), allow(dead_code))] #[print_attr] diff --git a/tests/ui/proc-macro/issue-75930-derive-cfg.stderr b/tests/ui/proc-macro/issue-75930-derive-cfg.stderr index 1017745de6f2b..df1e36d739080 100644 --- a/tests/ui/proc-macro/issue-75930-derive-cfg.stderr +++ b/tests/ui/proc-macro/issue-75930-derive-cfg.stderr @@ -1,5 +1,5 @@ warning: derive helper attribute is used before it is introduced - --> $DIR/issue-75930-derive-cfg.rs:49:3 + --> $DIR/issue-75930-derive-cfg.rs:46:3 | LL | #[print_helper(a)] | ^^^^^^^^^^^^ @@ -12,7 +12,7 @@ LL | #[derive(Print)] = note: `#[warn(legacy_derive_helpers)]` on by default warning: derive helper attribute is used before it is introduced - --> $DIR/issue-75930-derive-cfg.rs:49:3 + --> $DIR/issue-75930-derive-cfg.rs:46:3 | LL | #[print_helper(a)] | ^^^^^^^^^^^^ diff --git a/tests/ui/proc-macro/issue-75930-derive-cfg.stdout b/tests/ui/proc-macro/issue-75930-derive-cfg.stdout index 47f26451d1c53..093e37f8a8d0e 100644 --- a/tests/ui/proc-macro/issue-75930-derive-cfg.stdout +++ b/tests/ui/proc-macro/issue-75930-derive-cfg.stdout @@ -74,158 +74,158 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:49:1: 49:2 (#0), + span: $DIR/issue-75930-derive-cfg.rs:46:1: 46:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_helper", - span: $DIR/issue-75930-derive-cfg.rs:49:3: 49:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:46:3: 46:15 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "a", - span: $DIR/issue-75930-derive-cfg.rs:49:16: 49:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:46:16: 46:17 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:49:15: 49:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:46:15: 46:18 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:49:2: 49:19 (#0), + span: $DIR/issue-75930-derive-cfg.rs:46:2: 46:19 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:51:1: 51:2 (#0), + span: $DIR/issue-75930-derive-cfg.rs:50:1: 50:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "allow", - span: $DIR/issue-75930-derive-cfg.rs:51:24: 51:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:50:24: 50:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "dead_code", - span: $DIR/issue-75930-derive-cfg.rs:51:30: 51:39 (#0), + span: $DIR/issue-75930-derive-cfg.rs:50:30: 50:39 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:51:29: 51:40 (#0), + span: $DIR/issue-75930-derive-cfg.rs:50:29: 50:40 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:51:1: 51:2 (#0), + span: $DIR/issue-75930-derive-cfg.rs:50:1: 50:2 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:53:1: 53:2 (#0), + span: $DIR/issue-75930-derive-cfg.rs:52:1: 52:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "derive", - span: $DIR/issue-75930-derive-cfg.rs:53:3: 53:9 (#0), + span: $DIR/issue-75930-derive-cfg.rs:52:3: 52:9 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "Print", - span: $DIR/issue-75930-derive-cfg.rs:53:10: 53:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:52:10: 52:15 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:53:9: 53:16 (#0), + span: $DIR/issue-75930-derive-cfg.rs:52:9: 52:16 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:53:2: 53:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:52:2: 52:17 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:54:1: 54:2 (#0), + span: $DIR/issue-75930-derive-cfg.rs:53:1: 53:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_helper", - span: $DIR/issue-75930-derive-cfg.rs:54:3: 54:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:53:3: 53:15 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "b", - span: $DIR/issue-75930-derive-cfg.rs:54:16: 54:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:53:16: 53:17 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:54:15: 54:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:53:15: 53:18 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:54:2: 54:19 (#0), + span: $DIR/issue-75930-derive-cfg.rs:53:2: 53:19 (#0), }, Ident { ident: "struct", - span: $DIR/issue-75930-derive-cfg.rs:55:1: 55:7 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:1: 54:7 (#0), }, Ident { ident: "Foo", - span: $DIR/issue-75930-derive-cfg.rs:55:8: 55:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:8: 54:11 (#0), }, Punct { ch: '<', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:55:11: 55:12 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:11: 54:12 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:55:12: 55:13 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:12: 54:13 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:55:14: 55:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:14: 54:17 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:55:18: 55:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:18: 54:23 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:55:17: 55:24 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:17: 54:24 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:55:13: 55:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:13: 54:25 (#0), }, Ident { ident: "A", - span: $DIR/issue-75930-derive-cfg.rs:55:26: 55:27 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:26: 54:27 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:55:27: 55:28 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:27: 54:28 (#0), }, Ident { ident: "B", - span: $DIR/issue-75930-derive-cfg.rs:55:29: 55:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:29: 54:30 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:55:30: 55:31 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:30: 54:31 (#0), }, Group { delimiter: Brace, @@ -233,128 +233,128 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:56:5: 56:6 (#0), + span: $DIR/issue-75930-derive-cfg.rs:55:5: 55:6 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:56:7: 56:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:55:7: 55:10 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:56:11: 56:16 (#0), + span: $DIR/issue-75930-derive-cfg.rs:55:11: 55:16 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:56:10: 56:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:55:10: 55:17 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:56:6: 56:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:55:6: 55:18 (#0), }, Ident { ident: "first", - span: $DIR/issue-75930-derive-cfg.rs:56:19: 56:24 (#0), + span: $DIR/issue-75930-derive-cfg.rs:55:19: 55:24 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:56:24: 56:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:55:24: 55:25 (#0), }, Ident { ident: "String", - span: $DIR/issue-75930-derive-cfg.rs:56:26: 56:32 (#0), + span: $DIR/issue-75930-derive-cfg.rs:55:26: 55:32 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:56:32: 56:33 (#0), + span: $DIR/issue-75930-derive-cfg.rs:55:32: 55:33 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:57:5: 57:6 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:5: 56:6 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg_attr", - span: $DIR/issue-75930-derive-cfg.rs:57:7: 57:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:7: 56:15 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:57:16: 57:21 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:16: 56:21 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:57:21: 57:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:21: 56:22 (#0), }, Ident { ident: "deny", - span: $DIR/issue-75930-derive-cfg.rs:57:23: 57:27 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:23: 56:27 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "warnings", - span: $DIR/issue-75930-derive-cfg.rs:57:28: 57:36 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:28: 56:36 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:57:27: 57:37 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:27: 56:37 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:57:15: 57:38 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:15: 56:38 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:57:6: 57:39 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:6: 56:39 (#0), }, Ident { ident: "second", - span: $DIR/issue-75930-derive-cfg.rs:57:40: 57:46 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:40: 56:46 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:57:46: 57:47 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:46: 56:47 (#0), }, Ident { ident: "bool", - span: $DIR/issue-75930-derive-cfg.rs:57:48: 57:52 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:48: 56:52 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:57:52: 57:53 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:52: 56:53 (#0), }, Ident { ident: "third", - span: $DIR/issue-75930-derive-cfg.rs:58:5: 58:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:5: 57:10 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:58:10: 58:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:10: 57:11 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "u8", - span: $DIR/issue-75930-derive-cfg.rs:58:13: 58:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:13: 57:15 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:58:15: 58:16 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:15: 57:16 (#0), }, Group { delimiter: Brace, @@ -362,145 +362,145 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:59:9: 59:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:58:9: 58:10 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:59:11: 59:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:58:11: 58:14 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:59:15: 59:20 (#0), + span: $DIR/issue-75930-derive-cfg.rs:58:15: 58:20 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:59:14: 59:21 (#0), + span: $DIR/issue-75930-derive-cfg.rs:58:14: 58:21 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:59:10: 59:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:58:10: 58:22 (#0), }, Ident { ident: "struct", - span: $DIR/issue-75930-derive-cfg.rs:59:23: 59:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:58:23: 58:29 (#0), }, Ident { ident: "Bar", - span: $DIR/issue-75930-derive-cfg.rs:59:30: 59:33 (#0), + span: $DIR/issue-75930-derive-cfg.rs:58:30: 58:33 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:59:33: 59:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:58:33: 58:34 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:60:9: 60:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:9: 59:10 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:60:11: 60:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:11: 59:14 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:60:15: 60:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:15: 59:18 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:60:19: 60:24 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:19: 59:24 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:60:18: 60:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:18: 59:25 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:60:14: 60:26 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:14: 59:26 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:60:10: 60:27 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:10: 59:27 (#0), }, Ident { ident: "struct", - span: $DIR/issue-75930-derive-cfg.rs:60:28: 60:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:28: 59:34 (#0), }, Ident { ident: "Inner", - span: $DIR/issue-75930-derive-cfg.rs:60:35: 60:40 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:35: 59:40 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:60:40: 60:41 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:40: 59:41 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:61:9: 61:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:60:9: 60:10 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:61:11: 61:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:60:11: 60:14 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:61:15: 61:20 (#0), + span: $DIR/issue-75930-derive-cfg.rs:60:15: 60:20 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:61:14: 61:21 (#0), + span: $DIR/issue-75930-derive-cfg.rs:60:14: 60:21 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:61:10: 61:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:60:10: 60:22 (#0), }, Ident { ident: "let", - span: $DIR/issue-75930-derive-cfg.rs:61:23: 61:26 (#0), + span: $DIR/issue-75930-derive-cfg.rs:60:23: 60:26 (#0), }, Ident { ident: "a", - span: $DIR/issue-75930-derive-cfg.rs:61:27: 61:28 (#0), + span: $DIR/issue-75930-derive-cfg.rs:60:27: 60:28 (#0), }, Punct { ch: '=', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:61:29: 61:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:60:29: 60:30 (#0), }, Literal { kind: Integer, symbol: "25", suffix: None, - span: $DIR/issue-75930-derive-cfg.rs:61:31: 61:33 (#0), + span: $DIR/issue-75930-derive-cfg.rs:60:31: 60:33 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:61:33: 61:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:60:33: 60:34 (#0), }, Ident { ident: "match", - span: $DIR/issue-75930-derive-cfg.rs:62:9: 62:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:61:9: 61:14 (#0), }, Ident { ident: "true", - span: $DIR/issue-75930-derive-cfg.rs:62:15: 62:19 (#0), + span: $DIR/issue-75930-derive-cfg.rs:61:15: 61:19 (#0), }, Group { delimiter: Brace, @@ -508,194 +508,194 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:63:13: 63:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:62:13: 62:14 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:63:15: 63:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:62:15: 62:18 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:63:19: 63:24 (#0), + span: $DIR/issue-75930-derive-cfg.rs:62:19: 62:24 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:63:18: 63:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:62:18: 62:25 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:63:14: 63:26 (#0), + span: $DIR/issue-75930-derive-cfg.rs:62:14: 62:26 (#0), }, Ident { ident: "true", - span: $DIR/issue-75930-derive-cfg.rs:63:27: 63:31 (#0), + span: $DIR/issue-75930-derive-cfg.rs:62:27: 62:31 (#0), }, Punct { ch: '=', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:63:32: 63:33 (#0), + span: $DIR/issue-75930-derive-cfg.rs:62:32: 62:33 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:63:33: 63:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:62:33: 62:34 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/issue-75930-derive-cfg.rs:63:35: 63:37 (#0), + span: $DIR/issue-75930-derive-cfg.rs:62:35: 62:37 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:63:37: 63:38 (#0), + span: $DIR/issue-75930-derive-cfg.rs:62:37: 62:38 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:64:13: 64:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:13: 63:14 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg_attr", - span: $DIR/issue-75930-derive-cfg.rs:64:15: 64:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:15: 63:23 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:64:24: 64:27 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:24: 63:27 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:64:28: 64:33 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:28: 63:33 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:64:27: 64:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:27: 63:34 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:64:34: 64:35 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:34: 63:35 (#0), }, Ident { ident: "allow", - span: $DIR/issue-75930-derive-cfg.rs:64:36: 64:41 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:36: 63:41 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "warnings", - span: $DIR/issue-75930-derive-cfg.rs:64:42: 64:50 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:42: 63:50 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:64:41: 64:51 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:41: 63:51 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:64:23: 64:52 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:23: 63:52 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:64:14: 64:53 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:14: 63:53 (#0), }, Ident { ident: "false", - span: $DIR/issue-75930-derive-cfg.rs:64:54: 64:59 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:54: 63:59 (#0), }, Punct { ch: '=', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:64:60: 64:61 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:60: 63:61 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:64:61: 64:62 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:61: 63:62 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/issue-75930-derive-cfg.rs:64:63: 64:65 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:63: 63:65 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:64:65: 64:66 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:65: 63:66 (#0), }, Ident { ident: "_", - span: $DIR/issue-75930-derive-cfg.rs:65:13: 65:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:64:13: 64:14 (#0), }, Punct { ch: '=', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:65:15: 65:16 (#0), + span: $DIR/issue-75930-derive-cfg.rs:64:15: 64:16 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:65:16: 65:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:64:16: 64:17 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/issue-75930-derive-cfg.rs:65:18: 65:20 (#0), + span: $DIR/issue-75930-derive-cfg.rs:64:18: 64:20 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:62:20: 66:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:61:20: 65:10 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:66:10: 66:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:65:10: 65:11 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:68:9: 68:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:67:9: 67:10 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_helper", - span: $DIR/issue-75930-derive-cfg.rs:68:11: 68:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:67:11: 67:23 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "should_be_removed", - span: $DIR/issue-75930-derive-cfg.rs:68:24: 68:41 (#0), + span: $DIR/issue-75930-derive-cfg.rs:67:24: 67:41 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:68:23: 68:42 (#0), + span: $DIR/issue-75930-derive-cfg.rs:67:23: 67:42 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:68:10: 68:43 (#0), + span: $DIR/issue-75930-derive-cfg.rs:67:10: 67:43 (#0), }, Ident { ident: "fn", - span: $DIR/issue-75930-derive-cfg.rs:69:9: 69:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:68:9: 68:11 (#0), }, Ident { ident: "removed_fn", - span: $DIR/issue-75930-derive-cfg.rs:69:12: 69:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:68:12: 68:22 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/issue-75930-derive-cfg.rs:69:22: 69:24 (#0), + span: $DIR/issue-75930-derive-cfg.rs:68:22: 68:24 (#0), }, Group { delimiter: Brace, @@ -703,108 +703,108 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:70:13: 70:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:69:13: 69:14 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:70:14: 70:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:69:14: 69:15 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:70:16: 70:19 (#0), + span: $DIR/issue-75930-derive-cfg.rs:69:16: 69:19 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:70:20: 70:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:69:20: 69:25 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:70:19: 70:26 (#0), + span: $DIR/issue-75930-derive-cfg.rs:69:19: 69:26 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:70:15: 70:27 (#0), + span: $DIR/issue-75930-derive-cfg.rs:69:15: 69:27 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:69:25: 71:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:68:25: 70:10 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:73:9: 73:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:9: 72:10 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_helper", - span: $DIR/issue-75930-derive-cfg.rs:73:11: 73:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:11: 72:23 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "c", - span: $DIR/issue-75930-derive-cfg.rs:73:24: 73:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:24: 72:25 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:23: 73:26 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:23: 72:26 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:10: 73:27 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:10: 72:27 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:73:28: 73:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:28: 72:29 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:73:30: 73:33 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:30: 72:33 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:73:34: 73:37 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:34: 72:37 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:73:38: 73:43 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:38: 72:43 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:37: 73:44 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:37: 72:44 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:33: 73:45 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:33: 72:45 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:29: 73:46 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:29: 72:46 (#0), }, Ident { ident: "fn", - span: $DIR/issue-75930-derive-cfg.rs:73:47: 73:49 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:47: 72:49 (#0), }, Ident { ident: "kept_fn", - span: $DIR/issue-75930-derive-cfg.rs:73:50: 73:57 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:50: 72:57 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/issue-75930-derive-cfg.rs:73:57: 73:59 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:57: 72:59 (#0), }, Group { delimiter: Brace, @@ -812,82 +812,82 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:74:13: 74:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:13: 73:14 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:74:14: 74:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:14: 73:15 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:74:16: 74:19 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:16: 73:19 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:74:20: 74:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:20: 73:23 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:74:24: 74:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:24: 73:29 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:74:23: 74:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:23: 73:30 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:74:19: 74:31 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:19: 73:31 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:74:15: 74:32 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:15: 73:32 (#0), }, Ident { ident: "let", - span: $DIR/issue-75930-derive-cfg.rs:75:13: 75:16 (#0), + span: $DIR/issue-75930-derive-cfg.rs:74:13: 74:16 (#0), }, Ident { ident: "my_val", - span: $DIR/issue-75930-derive-cfg.rs:75:17: 75:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:74:17: 74:23 (#0), }, Punct { ch: '=', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:75:24: 75:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:74:24: 74:25 (#0), }, Ident { ident: "true", - span: $DIR/issue-75930-derive-cfg.rs:75:26: 75:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:74:26: 74:30 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:75:30: 75:31 (#0), + span: $DIR/issue-75930-derive-cfg.rs:74:30: 74:31 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:60: 76:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:60: 75:10 (#0), }, Ident { ident: "enum", - span: $DIR/issue-75930-derive-cfg.rs:78:9: 78:13 (#0), + span: $DIR/issue-75930-derive-cfg.rs:77:9: 77:13 (#0), }, Ident { ident: "TupleEnum", - span: $DIR/issue-75930-derive-cfg.rs:78:14: 78:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:77:14: 77:23 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "Foo", - span: $DIR/issue-75930-derive-cfg.rs:79:13: 79:16 (#0), + span: $DIR/issue-75930-derive-cfg.rs:78:13: 78:16 (#0), }, Group { delimiter: Parenthesis, @@ -895,166 +895,166 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:80:17: 80:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:79:17: 79:18 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:80:19: 80:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:79:19: 79:22 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:80:23: 80:28 (#0), + span: $DIR/issue-75930-derive-cfg.rs:79:23: 79:28 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:80:22: 80:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:79:22: 79:29 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:80:18: 80:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:79:18: 79:30 (#0), }, Ident { ident: "u8", - span: $DIR/issue-75930-derive-cfg.rs:80:31: 80:33 (#0), + span: $DIR/issue-75930-derive-cfg.rs:79:31: 79:33 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:80:33: 80:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:79:33: 79:34 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:81:17: 81:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:80:17: 80:18 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:81:19: 81:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:80:19: 80:22 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:81:23: 81:28 (#0), + span: $DIR/issue-75930-derive-cfg.rs:80:23: 80:28 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:81:22: 81:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:80:22: 80:29 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:81:18: 81:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:80:18: 80:30 (#0), }, Ident { ident: "bool", - span: $DIR/issue-75930-derive-cfg.rs:81:31: 81:35 (#0), + span: $DIR/issue-75930-derive-cfg.rs:80:31: 80:35 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:81:35: 81:36 (#0), + span: $DIR/issue-75930-derive-cfg.rs:80:35: 80:36 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:82:17: 82:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:17: 81:18 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:82:19: 82:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:19: 81:22 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:82:23: 82:26 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:23: 81:26 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:82:27: 82:32 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:27: 81:32 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:82:26: 82:33 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:26: 81:33 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:82:22: 82:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:22: 81:34 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:82:18: 82:35 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:18: 81:35 (#0), }, Ident { ident: "i32", - span: $DIR/issue-75930-derive-cfg.rs:82:36: 82:39 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:36: 81:39 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:82:39: 82:40 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:39: 81:40 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:83:17: 83:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:82:17: 82:18 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:83:19: 83:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:82:19: 82:22 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:83:23: 83:28 (#0), + span: $DIR/issue-75930-derive-cfg.rs:82:23: 82:28 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:83:22: 83:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:82:22: 82:29 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:83:18: 83:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:82:18: 82:30 (#0), }, Ident { ident: "String", - span: $DIR/issue-75930-derive-cfg.rs:83:31: 83:37 (#0), + span: $DIR/issue-75930-derive-cfg.rs:82:31: 82:37 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:83:37: 83:38 (#0), + span: $DIR/issue-75930-derive-cfg.rs:82:37: 82:38 (#0), }, Ident { ident: "u8", - span: $DIR/issue-75930-derive-cfg.rs:83:39: 83:41 (#0), + span: $DIR/issue-75930-derive-cfg.rs:82:39: 82:41 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:79:16: 84:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:78:16: 83:14 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:78:24: 85:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:77:24: 84:10 (#0), }, Ident { ident: "struct", - span: $DIR/issue-75930-derive-cfg.rs:87:9: 87:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:86:9: 86:15 (#0), }, Ident { ident: "TupleStruct", - span: $DIR/issue-75930-derive-cfg.rs:87:16: 87:27 (#0), + span: $DIR/issue-75930-derive-cfg.rs:86:16: 86:27 (#0), }, Group { delimiter: Parenthesis, @@ -1062,139 +1062,139 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:88:13: 88:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:87:13: 87:14 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:88:15: 88:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:87:15: 87:18 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:88:19: 88:24 (#0), + span: $DIR/issue-75930-derive-cfg.rs:87:19: 87:24 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:88:18: 88:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:87:18: 87:25 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:88:14: 88:26 (#0), + span: $DIR/issue-75930-derive-cfg.rs:87:14: 87:26 (#0), }, Ident { ident: "String", - span: $DIR/issue-75930-derive-cfg.rs:88:27: 88:33 (#0), + span: $DIR/issue-75930-derive-cfg.rs:87:27: 87:33 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:88:33: 88:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:87:33: 87:34 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:89:13: 89:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:13: 88:14 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:89:15: 89:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:15: 88:18 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:89:19: 89:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:19: 88:22 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:89:23: 89:28 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:23: 88:28 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:89:22: 89:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:22: 88:29 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:89:18: 89:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:18: 88:30 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:89:14: 89:31 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:14: 88:31 (#0), }, Ident { ident: "i32", - span: $DIR/issue-75930-derive-cfg.rs:89:32: 89:35 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:32: 88:35 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:89:35: 89:36 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:35: 88:36 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:90:13: 90:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:89:13: 89:14 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:90:15: 90:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:89:15: 89:18 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:90:19: 90:24 (#0), + span: $DIR/issue-75930-derive-cfg.rs:89:19: 89:24 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:90:18: 90:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:89:18: 89:25 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:90:14: 90:26 (#0), + span: $DIR/issue-75930-derive-cfg.rs:89:14: 89:26 (#0), }, Ident { ident: "bool", - span: $DIR/issue-75930-derive-cfg.rs:90:27: 90:31 (#0), + span: $DIR/issue-75930-derive-cfg.rs:89:27: 89:31 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:90:31: 90:32 (#0), + span: $DIR/issue-75930-derive-cfg.rs:89:31: 89:32 (#0), }, Ident { ident: "u8", - span: $DIR/issue-75930-derive-cfg.rs:91:13: 91:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:90:13: 90:15 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:87:27: 92:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:86:27: 91:10 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:92:10: 92:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:91:10: 91:11 (#0), }, Ident { ident: "fn", - span: $DIR/issue-75930-derive-cfg.rs:94:9: 94:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:93:9: 93:11 (#0), }, Ident { ident: "plain_removed_fn", - span: $DIR/issue-75930-derive-cfg.rs:94:12: 94:28 (#0), + span: $DIR/issue-75930-derive-cfg.rs:93:12: 93:28 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/issue-75930-derive-cfg.rs:94:28: 94:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:93:28: 93:30 (#0), }, Group { delimiter: Brace, @@ -1202,122 +1202,122 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:95:13: 95:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:13: 94:14 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:95:14: 95:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:14: 94:15 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg_attr", - span: $DIR/issue-75930-derive-cfg.rs:95:16: 95:24 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:16: 94:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:95:25: 95:28 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:25: 94:28 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:95:29: 95:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:29: 94:34 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:95:28: 95:35 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:28: 94:35 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:95:35: 95:36 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:35: 94:36 (#0), }, Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:95:37: 95:40 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:37: 94:40 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:95:41: 95:46 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:41: 94:46 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:95:40: 95:47 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:40: 94:47 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:95:24: 95:48 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:24: 94:48 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:95:15: 95:49 (#0), + span: $DIR/issue-75930-derive-cfg.rs:94:15: 94:49 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:94:31: 96:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:93:31: 95:10 (#0), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: $DIR/issue-75930-derive-cfg.rs:98:9: 98:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:97:9: 97:10 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:58:17: 99:6 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:17: 98:6 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:58:12: 99:7 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:12: 98:7 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:99:7: 99:8 (#0), + span: $DIR/issue-75930-derive-cfg.rs:98:7: 98:8 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:100:5: 100:6 (#0), + span: $DIR/issue-75930-derive-cfg.rs:99:5: 99:6 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_helper", - span: $DIR/issue-75930-derive-cfg.rs:100:7: 100:19 (#0), + span: $DIR/issue-75930-derive-cfg.rs:99:7: 99:19 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "d", - span: $DIR/issue-75930-derive-cfg.rs:100:20: 100:21 (#0), + span: $DIR/issue-75930-derive-cfg.rs:99:20: 99:21 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:100:19: 100:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:99:19: 99:22 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:100:6: 100:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:99:6: 99:23 (#0), }, Ident { ident: "fourth", - span: $DIR/issue-75930-derive-cfg.rs:101:5: 101:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:100:5: 100:11 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:101:11: 101:12 (#0), + span: $DIR/issue-75930-derive-cfg.rs:100:11: 100:12 (#0), }, Ident { ident: "B", - span: $DIR/issue-75930-derive-cfg.rs:101:13: 101:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:100:13: 100:14 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:55:32: 102:2 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:32: 101:2 (#0), }, ] PRINT-DERIVE INPUT (DISPLAY): #[print_helper(a)] #[allow(dead_code)] #[print_helper(b)] struct Foo @@ -1350,141 +1350,141 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:49:1: 49:2 (#0), + span: $DIR/issue-75930-derive-cfg.rs:46:1: 46:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_helper", - span: $DIR/issue-75930-derive-cfg.rs:49:3: 49:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:46:3: 46:15 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "a", - span: $DIR/issue-75930-derive-cfg.rs:49:16: 49:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:46:16: 46:17 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:49:15: 49:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:46:15: 46:18 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:49:2: 49:19 (#0), + span: $DIR/issue-75930-derive-cfg.rs:46:2: 46:19 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:51:1: 51:2 (#0), + span: $DIR/issue-75930-derive-cfg.rs:50:1: 50:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "allow", - span: $DIR/issue-75930-derive-cfg.rs:51:24: 51:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:50:24: 50:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "dead_code", - span: $DIR/issue-75930-derive-cfg.rs:51:30: 51:39 (#0), + span: $DIR/issue-75930-derive-cfg.rs:50:30: 50:39 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:51:29: 51:40 (#0), + span: $DIR/issue-75930-derive-cfg.rs:50:29: 50:40 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:51:1: 51:2 (#0), + span: $DIR/issue-75930-derive-cfg.rs:50:1: 50:2 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:54:1: 54:2 (#0), + span: $DIR/issue-75930-derive-cfg.rs:53:1: 53:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_helper", - span: $DIR/issue-75930-derive-cfg.rs:54:3: 54:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:53:3: 53:15 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "b", - span: $DIR/issue-75930-derive-cfg.rs:54:16: 54:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:53:16: 53:17 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:54:15: 54:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:53:15: 53:18 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:54:2: 54:19 (#0), + span: $DIR/issue-75930-derive-cfg.rs:53:2: 53:19 (#0), }, Ident { ident: "struct", - span: $DIR/issue-75930-derive-cfg.rs:55:1: 55:7 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:1: 54:7 (#0), }, Ident { ident: "Foo", - span: $DIR/issue-75930-derive-cfg.rs:55:8: 55:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:8: 54:11 (#0), }, Punct { ch: '<', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:55:11: 55:12 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:11: 54:12 (#0), }, Ident { ident: "B", - span: $DIR/issue-75930-derive-cfg.rs:55:29: 55:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:29: 54:30 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:55:30: 55:31 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:30: 54:31 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "second", - span: $DIR/issue-75930-derive-cfg.rs:57:40: 57:46 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:40: 56:46 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:57:46: 57:47 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:46: 56:47 (#0), }, Ident { ident: "bool", - span: $DIR/issue-75930-derive-cfg.rs:57:48: 57:52 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:48: 56:52 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:57:52: 57:53 (#0), + span: $DIR/issue-75930-derive-cfg.rs:56:52: 56:53 (#0), }, Ident { ident: "third", - span: $DIR/issue-75930-derive-cfg.rs:58:5: 58:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:5: 57:10 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:58:10: 58:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:10: 57:11 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "u8", - span: $DIR/issue-75930-derive-cfg.rs:58:13: 58:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:13: 57:15 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:58:15: 58:16 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:15: 57:16 (#0), }, Group { delimiter: Brace, @@ -1492,58 +1492,58 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:60:9: 60:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:9: 59:10 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:60:11: 60:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:11: 59:14 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:60:15: 60:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:15: 59:18 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:60:19: 60:24 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:19: 59:24 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:60:18: 60:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:18: 59:25 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:60:14: 60:26 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:14: 59:26 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:60:10: 60:27 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:10: 59:27 (#0), }, Ident { ident: "struct", - span: $DIR/issue-75930-derive-cfg.rs:60:28: 60:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:28: 59:34 (#0), }, Ident { ident: "Inner", - span: $DIR/issue-75930-derive-cfg.rs:60:35: 60:40 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:35: 59:40 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:60:40: 60:41 (#0), + span: $DIR/issue-75930-derive-cfg.rs:59:40: 59:41 (#0), }, Ident { ident: "match", - span: $DIR/issue-75930-derive-cfg.rs:62:9: 62:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:61:9: 61:14 (#0), }, Ident { ident: "true", - span: $DIR/issue-75930-derive-cfg.rs:62:15: 62:19 (#0), + span: $DIR/issue-75930-derive-cfg.rs:61:15: 61:19 (#0), }, Group { delimiter: Brace, @@ -1551,151 +1551,151 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:64:13: 64:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:13: 63:14 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "allow", - span: $DIR/issue-75930-derive-cfg.rs:64:36: 64:41 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:36: 63:41 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "warnings", - span: $DIR/issue-75930-derive-cfg.rs:64:42: 64:50 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:42: 63:50 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:64:41: 64:51 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:41: 63:51 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:64:13: 64:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:13: 63:14 (#0), }, Ident { ident: "false", - span: $DIR/issue-75930-derive-cfg.rs:64:54: 64:59 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:54: 63:59 (#0), }, Punct { ch: '=', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:64:60: 64:61 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:60: 63:61 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:64:61: 64:62 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:61: 63:62 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/issue-75930-derive-cfg.rs:64:63: 64:65 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:63: 63:65 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:64:65: 64:66 (#0), + span: $DIR/issue-75930-derive-cfg.rs:63:65: 63:66 (#0), }, Ident { ident: "_", - span: $DIR/issue-75930-derive-cfg.rs:65:13: 65:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:64:13: 64:14 (#0), }, Punct { ch: '=', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:65:15: 65:16 (#0), + span: $DIR/issue-75930-derive-cfg.rs:64:15: 64:16 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:65:16: 65:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:64:16: 64:17 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/issue-75930-derive-cfg.rs:65:18: 65:20 (#0), + span: $DIR/issue-75930-derive-cfg.rs:64:18: 64:20 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:62:20: 66:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:61:20: 65:10 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:66:10: 66:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:65:10: 65:11 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:73:9: 73:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:9: 72:10 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_helper", - span: $DIR/issue-75930-derive-cfg.rs:73:11: 73:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:11: 72:23 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "c", - span: $DIR/issue-75930-derive-cfg.rs:73:24: 73:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:24: 72:25 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:23: 73:26 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:23: 72:26 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:10: 73:27 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:10: 72:27 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:73:28: 73:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:28: 72:29 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:73:30: 73:33 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:30: 72:33 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:73:34: 73:37 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:34: 72:37 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:73:38: 73:43 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:38: 72:43 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:37: 73:44 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:37: 72:44 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:33: 73:45 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:33: 72:45 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:29: 73:46 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:29: 72:46 (#0), }, Ident { ident: "fn", - span: $DIR/issue-75930-derive-cfg.rs:73:47: 73:49 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:47: 72:49 (#0), }, Ident { ident: "kept_fn", - span: $DIR/issue-75930-derive-cfg.rs:73:50: 73:57 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:50: 72:57 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/issue-75930-derive-cfg.rs:73:57: 73:59 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:57: 72:59 (#0), }, Group { delimiter: Brace, @@ -1703,82 +1703,82 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:74:13: 74:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:13: 73:14 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:74:14: 74:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:14: 73:15 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:74:16: 74:19 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:16: 73:19 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:74:20: 74:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:20: 73:23 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:74:24: 74:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:24: 73:29 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:74:23: 74:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:23: 73:30 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:74:19: 74:31 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:19: 73:31 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:74:15: 74:32 (#0), + span: $DIR/issue-75930-derive-cfg.rs:73:15: 73:32 (#0), }, Ident { ident: "let", - span: $DIR/issue-75930-derive-cfg.rs:75:13: 75:16 (#0), + span: $DIR/issue-75930-derive-cfg.rs:74:13: 74:16 (#0), }, Ident { ident: "my_val", - span: $DIR/issue-75930-derive-cfg.rs:75:17: 75:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:74:17: 74:23 (#0), }, Punct { ch: '=', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:75:24: 75:25 (#0), + span: $DIR/issue-75930-derive-cfg.rs:74:24: 74:25 (#0), }, Ident { ident: "true", - span: $DIR/issue-75930-derive-cfg.rs:75:26: 75:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:74:26: 74:30 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:75:30: 75:31 (#0), + span: $DIR/issue-75930-derive-cfg.rs:74:30: 74:31 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:73:60: 76:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:72:60: 75:10 (#0), }, Ident { ident: "enum", - span: $DIR/issue-75930-derive-cfg.rs:78:9: 78:13 (#0), + span: $DIR/issue-75930-derive-cfg.rs:77:9: 77:13 (#0), }, Ident { ident: "TupleEnum", - span: $DIR/issue-75930-derive-cfg.rs:78:14: 78:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:77:14: 77:23 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "Foo", - span: $DIR/issue-75930-derive-cfg.rs:79:13: 79:16 (#0), + span: $DIR/issue-75930-derive-cfg.rs:78:13: 78:16 (#0), }, Group { delimiter: Parenthesis, @@ -1786,64 +1786,64 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:82:17: 82:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:17: 81:18 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:82:19: 82:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:19: 81:22 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:82:23: 82:26 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:23: 81:26 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:82:27: 82:32 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:27: 81:32 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:82:26: 82:33 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:26: 81:33 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:82:22: 82:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:22: 81:34 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:82:18: 82:35 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:18: 81:35 (#0), }, Ident { ident: "i32", - span: $DIR/issue-75930-derive-cfg.rs:82:36: 82:39 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:36: 81:39 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:82:39: 82:40 (#0), + span: $DIR/issue-75930-derive-cfg.rs:81:39: 81:40 (#0), }, Ident { ident: "u8", - span: $DIR/issue-75930-derive-cfg.rs:83:39: 83:41 (#0), + span: $DIR/issue-75930-derive-cfg.rs:82:39: 82:41 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:79:16: 84:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:78:16: 83:14 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:78:24: 85:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:77:24: 84:10 (#0), }, Ident { ident: "struct", - span: $DIR/issue-75930-derive-cfg.rs:87:9: 87:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:86:9: 86:15 (#0), }, Ident { ident: "TupleStruct", - span: $DIR/issue-75930-derive-cfg.rs:87:16: 87:27 (#0), + span: $DIR/issue-75930-derive-cfg.rs:86:16: 86:27 (#0), }, Group { delimiter: Parenthesis, @@ -1851,115 +1851,115 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:89:13: 89:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:13: 88:14 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg", - span: $DIR/issue-75930-derive-cfg.rs:89:15: 89:18 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:15: 88:18 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/issue-75930-derive-cfg.rs:89:19: 89:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:19: 88:22 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/issue-75930-derive-cfg.rs:89:23: 89:28 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:23: 88:28 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:89:22: 89:29 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:22: 88:29 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:89:18: 89:30 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:18: 88:30 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:89:14: 89:31 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:14: 88:31 (#0), }, Ident { ident: "i32", - span: $DIR/issue-75930-derive-cfg.rs:89:32: 89:35 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:32: 88:35 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:89:35: 89:36 (#0), + span: $DIR/issue-75930-derive-cfg.rs:88:35: 88:36 (#0), }, Ident { ident: "u8", - span: $DIR/issue-75930-derive-cfg.rs:91:13: 91:15 (#0), + span: $DIR/issue-75930-derive-cfg.rs:90:13: 90:15 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:87:27: 92:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:86:27: 91:10 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:92:10: 92:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:91:10: 91:11 (#0), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: $DIR/issue-75930-derive-cfg.rs:98:9: 98:10 (#0), + span: $DIR/issue-75930-derive-cfg.rs:97:9: 97:10 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:58:17: 99:6 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:17: 98:6 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:58:12: 99:7 (#0), + span: $DIR/issue-75930-derive-cfg.rs:57:12: 98:7 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:99:7: 99:8 (#0), + span: $DIR/issue-75930-derive-cfg.rs:98:7: 98:8 (#0), }, Punct { ch: '#', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:100:5: 100:6 (#0), + span: $DIR/issue-75930-derive-cfg.rs:99:5: 99:6 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_helper", - span: $DIR/issue-75930-derive-cfg.rs:100:7: 100:19 (#0), + span: $DIR/issue-75930-derive-cfg.rs:99:7: 99:19 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "d", - span: $DIR/issue-75930-derive-cfg.rs:100:20: 100:21 (#0), + span: $DIR/issue-75930-derive-cfg.rs:99:20: 99:21 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:100:19: 100:22 (#0), + span: $DIR/issue-75930-derive-cfg.rs:99:19: 99:22 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:100:6: 100:23 (#0), + span: $DIR/issue-75930-derive-cfg.rs:99:6: 99:23 (#0), }, Ident { ident: "fourth", - span: $DIR/issue-75930-derive-cfg.rs:101:5: 101:11 (#0), + span: $DIR/issue-75930-derive-cfg.rs:100:5: 100:11 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:101:11: 101:12 (#0), + span: $DIR/issue-75930-derive-cfg.rs:100:11: 100:12 (#0), }, Ident { ident: "B", - span: $DIR/issue-75930-derive-cfg.rs:101:13: 101:14 (#0), + span: $DIR/issue-75930-derive-cfg.rs:100:13: 100:14 (#0), }, ], - span: $DIR/issue-75930-derive-cfg.rs:55:32: 102:2 (#0), + span: $DIR/issue-75930-derive-cfg.rs:54:32: 101:2 (#0), }, ]