Auto merge of #133568 - GuillaumeGomez:rollup-js22ovb, r=GuillaumeGomez

Rollup of 7 pull requests

Successful merges:

 - #133358 (Don't type error if we fail to coerce `Pin<T>` because it doesnt contain a ref)
 - #133422 (Fix clobber_abi in RV32E and RV64E inline assembly)
 - #133452 (Support predicate registers (clobber-only) in Hexagon inline assembly)
 - #133463 (Fix handling of x18 in AArch64 inline assembly on ohos/trusty or with -Zfixed-x18)
 - #133487 (fix confusing diagnostic for reserved `##`)
 - #133557 (Small doc fixes in `rustc_codegen_ssa`)
 - #133560 (Trim extra space in 'repeated `mut`' diagnostic)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2024-11-28 11:20:29 +00:00
commit 9b4d7c6a40
50 changed files with 438 additions and 186 deletions

View File

@ -82,7 +82,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let mut clobber_abis = FxIndexMap::default();
if let Some(asm_arch) = asm_arch {
for (abi_name, abi_span) in &asm.clobber_abis {
match asm::InlineAsmClobberAbi::parse(asm_arch, &self.tcx.sess.target, *abi_name) {
match asm::InlineAsmClobberAbi::parse(
asm_arch,
&self.tcx.sess.target,
&self.tcx.sess.unstable_target_features,
*abi_name,
) {
Ok(abi) => {
// If the abi was already in the list, emit an error
match clobber_abis.get(&abi) {

View File

@ -476,9 +476,14 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> {
let mut new_slot = |x| new_slot_fn(&mut slot_size, x);
// Allocate stack slots for saving clobbered registers
let abi_clobber = InlineAsmClobberAbi::parse(self.arch, &self.tcx.sess.target, sym::C)
.unwrap()
.clobbered_regs();
let abi_clobber = InlineAsmClobberAbi::parse(
self.arch,
&self.tcx.sess.target,
&self.tcx.sess.unstable_target_features,
sym::C,
)
.unwrap()
.clobbered_regs();
for (i, reg) in self.registers.iter().enumerate().filter_map(|(i, r)| r.map(|r| (i, r))) {
let mut need_save = true;
// If the register overlaps with a register clobbered by function call, then

View File

@ -634,6 +634,9 @@ fn reg_to_gcc(reg: InlineAsmRegOrRegClass) -> ConstraintOrRegister {
InlineAsmRegClass::Bpf(BpfInlineAsmRegClass::reg) => "r",
InlineAsmRegClass::Bpf(BpfInlineAsmRegClass::wreg) => "w",
InlineAsmRegClass::Hexagon(HexagonInlineAsmRegClass::reg) => "r",
InlineAsmRegClass::Hexagon(HexagonInlineAsmRegClass::preg) => {
unreachable!("clobber-only")
}
InlineAsmRegClass::LoongArch(LoongArchInlineAsmRegClass::reg) => "r",
InlineAsmRegClass::LoongArch(LoongArchInlineAsmRegClass::freg) => "f",
InlineAsmRegClass::M68k(M68kInlineAsmRegClass::reg) => "r",
@ -720,6 +723,9 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl
cx.type_vector(cx.type_i64(), 2)
}
InlineAsmRegClass::Hexagon(HexagonInlineAsmRegClass::reg) => cx.type_i32(),
InlineAsmRegClass::Hexagon(HexagonInlineAsmRegClass::preg) => {
unreachable!("clobber-only")
}
InlineAsmRegClass::LoongArch(LoongArchInlineAsmRegClass::reg) => cx.type_i32(),
InlineAsmRegClass::LoongArch(LoongArchInlineAsmRegClass::freg) => cx.type_f32(),
InlineAsmRegClass::Mips(MipsInlineAsmRegClass::reg) => cx.type_i32(),

View File

@ -645,6 +645,7 @@ fn reg_to_llvm(reg: InlineAsmRegOrRegClass, layout: Option<&TyAndLayout<'_>>) ->
| Arm(ArmInlineAsmRegClass::qreg_low4) => "x",
Arm(ArmInlineAsmRegClass::dreg) | Arm(ArmInlineAsmRegClass::qreg) => "w",
Hexagon(HexagonInlineAsmRegClass::reg) => "r",
Hexagon(HexagonInlineAsmRegClass::preg) => unreachable!("clobber-only"),
LoongArch(LoongArchInlineAsmRegClass::reg) => "r",
LoongArch(LoongArchInlineAsmRegClass::freg) => "f",
Mips(MipsInlineAsmRegClass::reg) => "r",
@ -813,6 +814,7 @@ fn dummy_output_type<'ll>(cx: &CodegenCx<'ll, '_>, reg: InlineAsmRegClass) -> &'
| Arm(ArmInlineAsmRegClass::qreg_low8)
| Arm(ArmInlineAsmRegClass::qreg_low4) => cx.type_vector(cx.type_i64(), 2),
Hexagon(HexagonInlineAsmRegClass::reg) => cx.type_i32(),
Hexagon(HexagonInlineAsmRegClass::preg) => unreachable!("clobber-only"),
LoongArch(LoongArchInlineAsmRegClass::reg) => cx.type_i32(),
LoongArch(LoongArchInlineAsmRegClass::freg) => cx.type_f32(),
Mips(MipsInlineAsmRegClass::reg) => cx.type_i32(),

View File

@ -71,11 +71,11 @@ pub trait CodegenBackend {
need_metadata_module: bool,
) -> Box<dyn Any>;
/// This is called on the returned `Box<dyn Any>` from `codegen_backend`
/// This is called on the returned `Box<dyn Any>` from [`codegen_crate`](Self::codegen_crate)
///
/// # Panics
///
/// Panics when the passed `Box<dyn Any>` was not returned by `codegen_backend`.
/// Panics when the passed `Box<dyn Any>` was not returned by [`codegen_crate`](Self::codegen_crate).
fn join_codegen(
&self,
ongoing_codegen: Box<dyn Any>,
@ -83,7 +83,7 @@ pub trait CodegenBackend {
outputs: &OutputFilenames,
) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>);
/// This is called on the returned `CodegenResults` from `join_codegen`
/// This is called on the returned [`CodegenResults`] from [`join_codegen`](Self::join_codegen).
fn link(
&self,
sess: &Session,

View File

@ -215,7 +215,9 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
}
}
// Examine the supertype and consider auto-borrowing.
// Examine the supertype and consider type-specific coercions, such
// as auto-borrowing, coercing pointer mutability, a `dyn*` coercion,
// or pin-ergonomics.
match *b.kind() {
ty::RawPtr(_, b_mutbl) => {
return self.coerce_unsafe_ptr(a, b, b_mutbl);
@ -230,7 +232,10 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
if self.tcx.features().pin_ergonomics()
&& self.tcx.is_lang_item(pin.did(), hir::LangItem::Pin) =>
{
return self.coerce_pin(a, b);
let pin_coerce = self.commit_if_ok(|_| self.coerce_pin_ref(a, b));
if pin_coerce.is_ok() {
return pin_coerce;
}
}
_ => {}
}
@ -797,7 +802,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
/// - `Pin<Box<T>>` as `Pin<&T>`
/// - `Pin<Box<T>>` as `Pin<&mut T>`
#[instrument(skip(self), level = "trace")]
fn coerce_pin(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> CoerceResult<'tcx> {
fn coerce_pin_ref(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> CoerceResult<'tcx> {
// We need to make sure the two types are compatible for coercion.
// Then we will build a ReborrowPin adjustment and return that as an InferOk.

View File

@ -733,6 +733,9 @@ lint_renamed_lint = lint `{$name}` has been renamed to `{$replace}`
lint_requested_level = requested on the command line with `{$level} {$lint_name}`
lint_reserved_multihash = reserved token in Rust 2024
.suggestion = insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
lint_reserved_prefix = prefix `{$prefix}` is unknown
.label = unknown prefix
.suggestion = insert whitespace here to avoid this being parsed as a prefix in Rust 2021

View File

@ -176,8 +176,12 @@ pub(super) fn decorate_lint(sess: &Session, diagnostic: BuiltinLintDiag, diag: &
lints::RawPrefix { label: label_span, suggestion: label_span.shrink_to_hi() }
.decorate_lint(diag);
}
BuiltinLintDiag::ReservedString(suggestion) => {
lints::ReservedString { suggestion }.decorate_lint(diag);
BuiltinLintDiag::ReservedString { is_string, suggestion } => {
if is_string {
lints::ReservedString { suggestion }.decorate_lint(diag);
} else {
lints::ReservedMultihash { suggestion }.decorate_lint(diag);
}
}
BuiltinLintDiag::UnusedBuiltinAttribute { attr_name, macro_name, invoc_span } => {
lints::UnusedBuiltinAttribute { invoc_span, attr_name, macro_name }.decorate_lint(diag);

View File

@ -3059,3 +3059,10 @@ pub(crate) struct ReservedString {
#[suggestion(code = " ", applicability = "machine-applicable")]
pub suggestion: Span,
}
#[derive(LintDiagnostic)]
#[diag(lint_reserved_multihash)]
pub(crate) struct ReservedMultihash {
#[suggestion(code = " ", applicability = "machine-applicable")]
pub suggestion: Span,
}

View File

@ -663,8 +663,11 @@ pub enum BuiltinLintDiag {
ReservedPrefix(Span, String),
/// `'r#` in edition < 2021.
RawPrefix(Span),
/// `##` or `#"` is edition < 2024.
ReservedString(Span),
/// `##` or `#"` in edition < 2024.
ReservedString {
is_string: bool,
suggestion: Span,
},
TrailingMacro(bool, Ident),
BreakWithLabelAndLoop(Span),
UnicodeTextFlow(Span, String),

View File

@ -716,6 +716,10 @@ parse_require_colon_after_labeled_expression = labeled expression must be follow
.label = the label
.suggestion = add `:` after the label
parse_reserved_multihash = reserved multi-hash token is forbidden
.note = sequences of two or more # are reserved for future use since Rust 2024
.suggestion_whitespace = consider inserting whitespace here
parse_reserved_string = invalid string literal
.note = unprefixed guarded string literals are reserved for future use since Rust 2024
.suggestion_whitespace = consider inserting whitespace here

View File

@ -2151,6 +2151,15 @@ pub(crate) enum UnknownPrefixSugg {
},
}
#[derive(Diagnostic)]
#[diag(parse_reserved_multihash)]
#[note]
pub(crate) struct ReservedMultihash {
#[primary_span]
pub span: Span,
#[subdiagnostic]
pub sugg: Option<GuardedStringSugg>,
}
#[derive(Diagnostic)]
#[diag(parse_reserved_string)]
#[note]
@ -2611,8 +2620,9 @@ pub(crate) enum InvalidMutInPattern {
#[diag(parse_repeated_mut_in_pattern)]
pub(crate) struct RepeatedMutInPattern {
#[primary_span]
#[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
pub span: Span,
#[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
pub suggestion: Span,
}
#[derive(Diagnostic)]

View File

@ -816,7 +816,7 @@ impl<'psess, 'src> Lexer<'psess, 'src> {
let mut cursor = Cursor::new(str_before);
let (span, unterminated) = match cursor.guarded_double_quoted_string() {
let (is_string, span, unterminated) = match cursor.guarded_double_quoted_string() {
Some(rustc_lexer::GuardedStr { n_hashes, terminated, token_len }) => {
let end = start + BytePos(token_len);
let span = self.mk_sp(start, end);
@ -829,13 +829,13 @@ impl<'psess, 'src> Lexer<'psess, 'src> {
let unterminated = if terminated { None } else { Some(str_start) };
(span, unterminated)
(true, span, unterminated)
}
_ => {
None => {
// We should only get here in the `##+` case.
debug_assert_eq!(self.str_from_to(start, start + BytePos(2)), "##");
(span, None)
(false, span, None)
}
};
if edition2024 {
@ -857,7 +857,11 @@ impl<'psess, 'src> Lexer<'psess, 'src> {
};
// In Edition 2024 and later, emit a hard error.
let err = self.dcx().emit_err(errors::ReservedString { span, sugg });
let err = if is_string {
self.dcx().emit_err(errors::ReservedString { span, sugg })
} else {
self.dcx().emit_err(errors::ReservedMultihash { span, sugg })
};
token::Literal(token::Lit {
kind: token::Err(err),
@ -870,7 +874,7 @@ impl<'psess, 'src> Lexer<'psess, 'src> {
RUST_2024_GUARDED_STRING_INCOMPATIBLE_SYNTAX,
span,
ast::CRATE_NODE_ID,
BuiltinLintDiag::ReservedString(space_span),
BuiltinLintDiag::ReservedString { is_string, suggestion: space_span },
);
// For backwards compatibility, roll back to after just the first `#`

View File

@ -1089,7 +1089,9 @@ impl<'a> Parser<'a> {
return;
}
self.dcx().emit_err(RepeatedMutInPattern { span: lo.to(self.prev_token.span) });
let span = lo.to(self.prev_token.span);
let suggestion = span.with_hi(self.token.span.lo());
self.dcx().emit_err(RepeatedMutInPattern { span, suggestion });
}
/// Parse macro invocation

View File

@ -1611,6 +1611,7 @@ symbols! {
repr_simd,
repr_transparent,
require,
reserve_x18: "reserve-x18",
residual,
result,
result_ffi_guarantees,

View File

@ -1,7 +1,7 @@
use std::fmt;
use rustc_data_structures::fx::FxIndexSet;
use rustc_span::Symbol;
use rustc_span::{Symbol, sym};
use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use crate::spec::{RelocModel, Target};
@ -71,18 +71,26 @@ impl AArch64InlineAsmRegClass {
}
}
pub(crate) fn target_reserves_x18(target: &Target) -> bool {
target.os == "android" || target.os == "fuchsia" || target.is_like_osx || target.is_like_windows
pub(crate) fn target_reserves_x18(target: &Target, target_features: &FxIndexSet<Symbol>) -> bool {
// See isX18ReservedByDefault in LLVM for targets reserve x18 by default:
// https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/TargetParser/AArch64TargetParser.cpp#L102-L105
// Note that +reserve-x18 is currently not set for the above targets.
target.os == "android"
|| target.os == "fuchsia"
|| target.env == "ohos"
|| target.is_like_osx
|| target.is_like_windows
|| target_features.contains(&sym::reserve_x18)
}
fn reserved_x18(
_arch: InlineAsmArch,
_reloc_model: RelocModel,
_target_features: &FxIndexSet<Symbol>,
target_features: &FxIndexSet<Symbol>,
target: &Target,
_is_clobber: bool,
) -> Result<(), &'static str> {
if target_reserves_x18(target) {
if target_reserves_x18(target, target_features) {
Err("x18 is a reserved register on this target")
} else {
Ok(())

View File

@ -7,6 +7,7 @@ use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
def_reg_class! {
Hexagon HexagonInlineAsmRegClass {
reg,
preg,
}
}
@ -37,6 +38,7 @@ impl HexagonInlineAsmRegClass {
) -> &'static [(InlineAsmType, Option<Symbol>)] {
match self {
Self::reg => types! { _: I8, I16, I32, F32; },
Self::preg => &[],
}
}
}
@ -71,6 +73,10 @@ def_regs! {
r26: reg = ["r26"],
r27: reg = ["r27"],
r28: reg = ["r28"],
p0: preg = ["p0"],
p1: preg = ["p1"],
p2: preg = ["p2"],
p3: preg = ["p3"],
#error = ["r19"] =>
"r19 is used internally by LLVM and cannot be used as an operand for inline asm",
#error = ["r29", "sp"] =>

View File

@ -929,6 +929,7 @@ pub enum InlineAsmClobberAbi {
AArch64NoX18,
Arm64EC,
RiscV,
RiscVE,
LoongArch,
PowerPC,
S390x,
@ -941,6 +942,7 @@ impl InlineAsmClobberAbi {
pub fn parse(
arch: InlineAsmArch,
target: &Target,
target_features: &FxIndexSet<Symbol>,
name: Symbol,
) -> Result<Self, &'static [&'static str]> {
let name = name.as_str();
@ -963,11 +965,13 @@ impl InlineAsmClobberAbi {
_ => Err(&["C", "system", "efiapi", "aapcs"]),
},
InlineAsmArch::AArch64 => match name {
"C" | "system" | "efiapi" => Ok(if aarch64::target_reserves_x18(target) {
InlineAsmClobberAbi::AArch64NoX18
} else {
InlineAsmClobberAbi::AArch64
}),
"C" | "system" | "efiapi" => {
Ok(if aarch64::target_reserves_x18(target, target_features) {
InlineAsmClobberAbi::AArch64NoX18
} else {
InlineAsmClobberAbi::AArch64
})
}
_ => Err(&["C", "system", "efiapi"]),
},
InlineAsmArch::Arm64EC => match name {
@ -975,7 +979,11 @@ impl InlineAsmClobberAbi {
_ => Err(&["C", "system"]),
},
InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => match name {
"C" | "system" | "efiapi" => Ok(InlineAsmClobberAbi::RiscV),
"C" | "system" | "efiapi" => Ok(if riscv::is_e(target_features) {
InlineAsmClobberAbi::RiscVE
} else {
InlineAsmClobberAbi::RiscV
}),
_ => Err(&["C", "system", "efiapi"]),
},
InlineAsmArch::LoongArch64 => match name {
@ -1148,6 +1156,31 @@ impl InlineAsmClobberAbi {
v24, v25, v26, v27, v28, v29, v30, v31,
}
},
InlineAsmClobberAbi::RiscVE => clobbered_regs! {
RiscV RiscVInlineAsmReg {
// Refs:
// - ILP32E https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/draft-20240829-13bfa9f54634cb60d86b9b333e109f077805b4b3/riscv-cc.adoc#ilp32e-calling-convention
// - LP64E https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/299
// ra
x1,
// t0-t2
x5, x6, x7,
// a0-a5
x10, x11, x12, x13, x14, x15,
// ft0-ft7
f0, f1, f2, f3, f4, f5, f6, f7,
// fa0-fa7
f10, f11, f12, f13, f14, f15, f16, f17,
// ft8-ft11
f28, f29, f30, f31,
v0, v1, v2, v3, v4, v5, v6, v7,
v8, v9, v10, v11, v12, v13, v14, v15,
v16, v17, v18, v19, v20, v21, v22, v23,
v24, v25, v26, v27, v28, v29, v30, v31,
}
},
InlineAsmClobberAbi::LoongArch => clobbered_regs! {
LoongArch LoongArchInlineAsmReg {
// ra

View File

@ -54,6 +54,10 @@ impl RiscVInlineAsmRegClass {
}
}
pub(crate) fn is_e(target_features: &FxIndexSet<Symbol>) -> bool {
target_features.contains(&sym::e)
}
fn not_e(
_arch: InlineAsmArch,
_reloc_model: RelocModel,
@ -61,7 +65,7 @@ fn not_e(
_target: &Target,
_is_clobber: bool,
) -> Result<(), &'static str> {
if target_features.contains(&sym::e) {
if is_e(target_features) {
Err("register can't be used with the `e` target feature")
} else {
Ok(())

View File

@ -16,7 +16,6 @@ pub(crate) fn target() -> Target {
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
arch: "aarch64".into(),
options: TargetOptions {
features: "+reserve-x18".into(),
mcount: "\u{1}_mcount".into(),
stack_probes: StackProbeType::Inline,
supported_sanitizers: SanitizerSet::ADDRESS

View File

@ -228,6 +228,12 @@ const AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
("rcpc3", Unstable(sym::aarch64_unstable_target_feature), &["rcpc2"]),
// FEAT_RDM
("rdm", Stable, &["neon"]),
// This is needed for inline assembly, but shouldn't be stabilized as-is
// since it should be enabled globally using -Zfixed-x18, not
// #[target_feature].
// Note that cfg(target_feature = "reserve-x18") is currently not set for
// targets that reserve x18 by default.
("reserve-x18", Unstable(sym::aarch64_unstable_target_feature), &[]),
// FEAT_SB
("sb", Stable, &[]),
// FEAT_SHA1 & FEAT_SHA256

View File

@ -30,6 +30,7 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
| NVPTX | `reg32` | None\* | `r` |
| NVPTX | `reg64` | None\* | `l` |
| Hexagon | `reg` | `r[0-28]` | `r` |
| Hexagon | `preg` | `p[0-3]` | Only clobbers |
| PowerPC | `reg` | `r0`, `r[3-12]`, `r[14-28]` | `r` |
| PowerPC | `reg_nonzero` | `r[3-12]`, `r[14-28]` | `b` |
| PowerPC | `freg` | `f[0-31]` | `f` |
@ -70,6 +71,7 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
| NVPTX | `reg32` | None | `i8`, `i16`, `i32`, `f32` |
| NVPTX | `reg64` | None | `i8`, `i16`, `i32`, `f32`, `i64`, `f64` |
| Hexagon | `reg` | None | `i8`, `i16`, `i32`, `f32` |
| Hexagon | `preg` | N/A | Only clobbers |
| PowerPC | `reg` | None | `i8`, `i16`, `i32`, `i64` (powerpc64 only) |
| PowerPC | `reg_nonzero` | None | `i8`, `i16`, `i32`, `i64` (powerpc64 only) |
| PowerPC | `freg` | None | `f32`, `f64` |

View File

@ -0,0 +1,51 @@
//@ revisions: aarch64 aarch64_fixed_x18 aarch64_no_x18 aarch64_reserve_x18 arm64ec
//@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
//@[aarch64] needs-llvm-components: aarch64
//@[aarch64_fixed_x18] compile-flags: --target aarch64-unknown-linux-gnu -Zfixed-x18
//@[aarch64_fixed_x18] needs-llvm-components: aarch64
//@[aarch64_no_x18] compile-flags: --target aarch64-pc-windows-msvc
//@[aarch64_no_x18] needs-llvm-components: aarch64
// aarch64-unknown-trusty uses aarch64-unknown-unknown-musl which doesn't
// reserve x18 by default as llvm_target, and pass +reserve-x18 in target-spec.
//@[aarch64_reserve_x18] compile-flags: --target aarch64-unknown-trusty
//@[aarch64_reserve_x18] needs-llvm-components: aarch64
//@[arm64ec] compile-flags: --target arm64ec-pc-windows-msvc
//@[arm64ec] needs-llvm-components: aarch64
// ignore-tidy-linelength
#![crate_type = "rlib"]
#![feature(no_core, rustc_attrs, lang_items)]
#![no_core]
#[lang = "sized"]
trait Sized {}
#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
// CHECK-LABEL: @cc_clobber
// CHECK: call void asm sideeffect "", "~{cc}"()
#[no_mangle]
pub unsafe fn cc_clobber() {
asm!("", options(nostack, nomem));
}
// CHECK-LABEL: @no_clobber
// CHECK: call void asm sideeffect "", ""()
#[no_mangle]
pub unsafe fn no_clobber() {
asm!("", options(nostack, nomem, preserves_flags));
}
// CHECK-LABEL: @clobber_abi
// aarch64: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w13},={w14},={w15},={w16},={w17},={w18},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15},={q16},={q17},={q18},={q19},={q20},={q21},={q22},={q23},={q24},={q25},={q26},={q27},={q28},={q29},={q30},={q31},~{p0},~{p1},~{p2},~{p3},~{p4},~{p5},~{p6},~{p7},~{p8},~{p9},~{p10},~{p11},~{p12},~{p13},~{p14},~{p15},~{ffr}"()
// aarch64_fixed_x18: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w13},={w14},={w15},={w16},={w17},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15},={q16},={q17},={q18},={q19},={q20},={q21},={q22},={q23},={q24},={q25},={q26},={q27},={q28},={q29},={q30},={q31},~{p0},~{p1},~{p2},~{p3},~{p4},~{p5},~{p6},~{p7},~{p8},~{p9},~{p10},~{p11},~{p12},~{p13},~{p14},~{p15},~{ffr}"()
// aarch64_no_x18: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w13},={w14},={w15},={w16},={w17},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15},={q16},={q17},={q18},={q19},={q20},={q21},={q22},={q23},={q24},={q25},={q26},={q27},={q28},={q29},={q30},={q31},~{p0},~{p1},~{p2},~{p3},~{p4},~{p5},~{p6},~{p7},~{p8},~{p9},~{p10},~{p11},~{p12},~{p13},~{p14},~{p15},~{ffr}"()
// aarch64_reserve_x18: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w13},={w14},={w15},={w16},={w17},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15},={q16},={q17},={q18},={q19},={q20},={q21},={q22},={q23},={q24},={q25},={q26},={q27},={q28},={q29},={q30},={q31},~{p0},~{p1},~{p2},~{p3},~{p4},~{p5},~{p6},~{p7},~{p8},~{p9},~{p10},~{p11},~{p12},~{p13},~{p14},~{p15},~{ffr}"()
// arm64ec: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w15},={w16},={w17},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15}"()
#[no_mangle]
pub unsafe fn clobber_abi() {
asm!("", clobber_abi("C"), options(nostack, nomem, preserves_flags));
}

View File

@ -1,36 +0,0 @@
//@ assembly-output: emit-asm
//@ compile-flags: --target arm64ec-pc-windows-msvc
//@ needs-llvm-components: aarch64
#![crate_type = "rlib"]
#![feature(no_core, rustc_attrs, lang_items)]
#![no_core]
#[lang = "sized"]
trait Sized {}
#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
// CHECK-LABEL: @cc_clobber
// CHECK: call void asm sideeffect "", "~{cc}"()
#[no_mangle]
pub unsafe fn cc_clobber() {
asm!("", options(nostack, nomem));
}
// CHECK-LABEL: @no_clobber
// CHECK: call void asm sideeffect "", ""()
#[no_mangle]
pub unsafe fn no_clobber() {
asm!("", options(nostack, nomem, preserves_flags));
}
// CHECK-LABEL: @clobber_abi
// CHECK: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w15},={w16},={w17},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15}"()
#[no_mangle]
pub unsafe fn clobber_abi() {
asm!("", clobber_abi("C"), options(nostack, nomem, preserves_flags));
}

View File

@ -0,0 +1,37 @@
//@ revisions: hexagon
//@[hexagon] compile-flags: --target hexagon-unknown-linux-musl
//@[hexagon] needs-llvm-components: hexagon
//@ compile-flags: -Zmerge-functions=disabled
#![crate_type = "rlib"]
#![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)]
#![no_core]
#[lang = "sized"]
trait Sized {}
#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
// CHECK-LABEL: @flags_clobber
// CHECK: call void asm sideeffect "", ""()
#[no_mangle]
pub unsafe fn flags_clobber() {
asm!("", options(nostack, nomem));
}
// CHECK-LABEL: @no_clobber
// CHECK: call void asm sideeffect "", ""()
#[no_mangle]
pub unsafe fn no_clobber() {
asm!("", options(nostack, nomem, preserves_flags));
}
// CHECK-LABEL: @p0_clobber
// CHECK: call void asm sideeffect "", "~{p0}"()
#[no_mangle]
pub unsafe fn p0_clobber() {
asm!("", out("p0") _, options(nostack, nomem, preserves_flags));
}

View File

@ -0,0 +1,44 @@
//@ assembly-output: emit-asm
//@ revisions: rv32i rv64i rv32e
//@[rv32i] compile-flags: --target riscv32i-unknown-none-elf
//@[rv32i] needs-llvm-components: riscv
//@[rv64i] compile-flags: --target riscv64imac-unknown-none-elf
//@[rv64i] needs-llvm-components: riscv
//@[rv32e] compile-flags: --target riscv32e-unknown-none-elf
//@[rv32e] needs-llvm-components: riscv
// ignore-tidy-linelength
#![crate_type = "rlib"]
#![feature(no_core, rustc_attrs, lang_items)]
#![no_core]
#[lang = "sized"]
trait Sized {}
#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
// CHECK-LABEL: @flags_clobber
// CHECK: call void asm sideeffect "", "~{vtype},~{vl},~{vxsat},~{vxrm}"()
#[no_mangle]
pub unsafe fn flags_clobber() {
asm!("", options(nostack, nomem));
}
// CHECK-LABEL: @no_clobber
// CHECK: call void asm sideeffect "", ""()
#[no_mangle]
pub unsafe fn no_clobber() {
asm!("", options(nostack, nomem, preserves_flags));
}
// CHECK-LABEL: @clobber_abi
// rv32i: asm sideeffect "", "={x1},={x5},={x6},={x7},={x10},={x11},={x12},={x13},={x14},={x15},={x16},={x17},={x28},={x29},={x30},={x31},~{f0},~{f1},~{f2},~{f3},~{f4},~{f5},~{f6},~{f7},~{f10},~{f11},~{f12},~{f13},~{f14},~{f15},~{f16},~{f17},~{f28},~{f29},~{f30},~{f31},~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"()
// rv64i: asm sideeffect "", "={x1},={x5},={x6},={x7},={x10},={x11},={x12},={x13},={x14},={x15},={x16},={x17},={x28},={x29},={x30},={x31},~{f0},~{f1},~{f2},~{f3},~{f4},~{f5},~{f6},~{f7},~{f10},~{f11},~{f12},~{f13},~{f14},~{f15},~{f16},~{f17},~{f28},~{f29},~{f30},~{f31},~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"()
// rv32e: asm sideeffect "", "={x1},={x5},={x6},={x7},={x10},={x11},={x12},={x13},={x14},={x15},~{f0},~{f1},~{f2},~{f3},~{f4},~{f5},~{f6},~{f7},~{f10},~{f11},~{f12},~{f13},~{f14},~{f15},~{f16},~{f17},~{f28},~{f29},~{f30},~{f31},~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"()
#[no_mangle]
pub unsafe fn clobber_abi() {
asm!("", clobber_abi("C"), options(nostack, nomem, preserves_flags));
}

View File

@ -0,0 +1,10 @@
//@ check-pass
#![feature(pin_ergonomics)]
//~^ WARN the feature `pin_ergonomics` is incomplete
use std::pin::Pin;
fn main() {
let _: Pin<Box<()>> = Box::pin(());
}

View File

@ -0,0 +1,11 @@
warning: the feature `pin_ergonomics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/coerce-non-pointer-pin.rs:3:12
|
LL | #![feature(pin_ergonomics)]
| ^^^^^^^^^^^^^^
|
= note: see issue #130494 <https://github.com/rust-lang/rust/issues/130494> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/pin-reborrow-const-as-mut.rs:14:9
--> $DIR/reborrow-const-as-mut.rs:14:9
|
LL | foo(x);
| --- ^ types differ in mutability
@ -9,7 +9,7 @@ LL | foo(x);
= note: expected struct `Pin<&mut Foo>`
found struct `Pin<&Foo>`
note: function defined here
--> $DIR/pin-reborrow-const-as-mut.rs:10:4
--> $DIR/reborrow-const-as-mut.rs:10:4
|
LL | fn foo(_: Pin<&mut Foo>) {
| ^^^ ----------------

View File

@ -1,5 +1,5 @@
error[E0499]: cannot borrow `*x.__pointer` as mutable more than once at a time
--> $DIR/pin-reborrow-once.rs:12:14
--> $DIR/reborrow-once.rs:12:14
|
LL | twice(x, x);
| ----- - ^ second mutable borrow occurs here

View File

@ -1,5 +1,5 @@
error: expected one of `!`, `(`, `::`, `;`, `<`, or `=`, found `i32`
--> $DIR/pin-sugar-no-const.rs:7:18
--> $DIR/sugar-no-const.rs:7:18
|
LL | let _x: &pin i32 = todo!();
| - ^^^ expected one of `!`, `(`, `::`, `;`, `<`, or `=`

View File

@ -251,7 +251,7 @@ warning: unexpected `cfg` condition value: `zebra`
LL | cfg!(target_feature = "zebra");
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, and `avx512vpopcntdq` and 251 more
= note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, and `avx512vpopcntdq` and 252 more
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: 27 warnings emitted

View File

@ -174,7 +174,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
LL | target_feature = "_UNEXPECTED_VALUE",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, `avx512vpopcntdq`, `avxifma`, `avxneconvert`, `avxvnni`, `avxvnniint16`, `avxvnniint8`, `backchain`, `bf16`, `bmi1`, `bmi2`, `bti`, `bulk-memory`, `c`, `cache`, `cmpxchg16b`, `crc`, `crt-static`, `cssc`, `d`, `d32`, `dit`, `doloop`, `dotprod`, `dpb`, `dpb2`, `dsp`, `dsp1e2`, `dspe60`, `e`, `e1`, `e2`, `ecv`, `edsp`, `elrw`, `ermsb`, `exception-handling`, `extended-const`, `f`, `f16c`, `f32mm`, `f64mm`, `faminmax`, `fcma`, `fdivdu`, `fhm`, `flagm`, `flagm2`, `float1e2`, `float1e3`, `float3e4`, `float7e60`, `floate1`, `fma`, `fp-armv8`, `fp16`, `fp64`, `fp8`, `fp8dot2`, `fp8dot4`, `fp8fma`, `fpuv2_df`, `fpuv2_sf`, `fpuv3_df`, `fpuv3_hf`, `fpuv3_hi`, `fpuv3_sf`, `frecipe`, `frintts`, `fxsr`, `gfni`, `hard-float`, `hard-float-abi`, `hard-tp`, `hbc`, `high-registers`, `hvx`, `hvx-length128b`, `hwdiv`, `i8mm`, `jsconv`, `lahfsahf`, `lasx`, `lbt`, `leoncasa`, `lor`, `lse`, `lse128`, `lse2`, `lsx`, `lut`, `lvz`, `lzcnt`, `m`, `mclass`, `mops`, `movbe`, `mp`, `mp1e2`, `msa`, `mte`, `multivalue`, `mutable-globals`, `neon`, `nontrapping-fptoint`, `nvic`, `paca`, `pacg`, `pan`, `partword-atomics`, `pauth-lr`, `pclmulqdq`, `pmuv3`, `popcnt`, `power10-vector`, `power8-altivec`, `power8-vector`, `power9-altivec`, `power9-vector`, `prfchw`, `quadword-atomics`, `rand`, `ras`, `rclass`, `rcpc`, `rcpc2`, `rcpc3`, `rdm`, `rdrand`, `rdseed`, `reference-types`, `relax`, `relaxed-simd`, `rtm`, `sb`, `sha`, `sha2`, `sha3`, `sha512`, `sign-ext`, `simd128`, `sm3`, `sm4`, `sme`, `sme-b16b16`, `sme-f16f16`, `sme-f64f64`, `sme-f8f16`, `sme-f8f32`, `sme-fa64`, `sme-i16i64`, `sme-lutv2`, `sme2`, `sme2p1`, `spe`, `ssbs`, `sse`, `sse2`, `sse3`, `sse4.1`, `sse4.2`, `sse4a`, `ssse3`, `ssve-fp8dot2`, `ssve-fp8dot4`, `ssve-fp8fma`, `sve`, `sve-b16b16`, `sve2`, `sve2-aes`, `sve2-bitperm`, `sve2-sha3`, `sve2-sm4`, `sve2p1`, `tail-call`, `tbm`, `thumb-mode`, `thumb2`, `tme`, `trust`, `trustzone`, `ual`, `unaligned-scalar-mem`, `v`, `v5te`, `v6`, `v6k`, `v6t2`, `v7`, `v8`, `v8.1a`, `v8.2a`, `v8.3a`, `v8.4a`, `v8.5a`, `v8.6a`, `v8.7a`, `v8.8a`, `v8.9a`, `v8plus`, `v9`, `v9.1a`, `v9.2a`, `v9.3a`, `v9.4a`, `v9.5a`, `v9a`, `vaes`, `vdsp2e60f`, `vdspv1`, `vdspv2`, `vector`, `vfp2`, `vfp3`, `vfp4`, `vh`, `virt`, `virtualization`, `vpclmulqdq`, `vsx`, `wfxt`, `wide-arithmetic`, `xop`, `xsave`, `xsavec`, `xsaveopt`, `xsaves`, `zaamo`, `zabha`, `zalrsc`, `zba`, `zbb`, `zbc`, `zbkb`, `zbkc`, `zbkx`, `zbs`, `zdinx`, `zfh`, `zfhmin`, `zfinx`, `zhinx`, `zhinxmin`, `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, and `zkt`
= note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, `avx512vpopcntdq`, `avxifma`, `avxneconvert`, `avxvnni`, `avxvnniint16`, `avxvnniint8`, `backchain`, `bf16`, `bmi1`, `bmi2`, `bti`, `bulk-memory`, `c`, `cache`, `cmpxchg16b`, `crc`, `crt-static`, `cssc`, `d`, `d32`, `dit`, `doloop`, `dotprod`, `dpb`, `dpb2`, `dsp`, `dsp1e2`, `dspe60`, `e`, `e1`, `e2`, `ecv`, `edsp`, `elrw`, `ermsb`, `exception-handling`, `extended-const`, `f`, `f16c`, `f32mm`, `f64mm`, `faminmax`, `fcma`, `fdivdu`, `fhm`, `flagm`, `flagm2`, `float1e2`, `float1e3`, `float3e4`, `float7e60`, `floate1`, `fma`, `fp-armv8`, `fp16`, `fp64`, `fp8`, `fp8dot2`, `fp8dot4`, `fp8fma`, `fpuv2_df`, `fpuv2_sf`, `fpuv3_df`, `fpuv3_hf`, `fpuv3_hi`, `fpuv3_sf`, `frecipe`, `frintts`, `fxsr`, `gfni`, `hard-float`, `hard-float-abi`, `hard-tp`, `hbc`, `high-registers`, `hvx`, `hvx-length128b`, `hwdiv`, `i8mm`, `jsconv`, `lahfsahf`, `lasx`, `lbt`, `leoncasa`, `lor`, `lse`, `lse128`, `lse2`, `lsx`, `lut`, `lvz`, `lzcnt`, `m`, `mclass`, `mops`, `movbe`, `mp`, `mp1e2`, `msa`, `mte`, `multivalue`, `mutable-globals`, `neon`, `nontrapping-fptoint`, `nvic`, `paca`, `pacg`, `pan`, `partword-atomics`, `pauth-lr`, `pclmulqdq`, `pmuv3`, `popcnt`, `power10-vector`, `power8-altivec`, `power8-vector`, `power9-altivec`, `power9-vector`, `prfchw`, `quadword-atomics`, `rand`, `ras`, `rclass`, `rcpc`, `rcpc2`, `rcpc3`, `rdm`, `rdrand`, `rdseed`, `reference-types`, `relax`, `relaxed-simd`, `reserve-x18`, `rtm`, `sb`, `sha`, `sha2`, `sha3`, `sha512`, `sign-ext`, `simd128`, `sm3`, `sm4`, `sme`, `sme-b16b16`, `sme-f16f16`, `sme-f64f64`, `sme-f8f16`, `sme-f8f32`, `sme-fa64`, `sme-i16i64`, `sme-lutv2`, `sme2`, `sme2p1`, `spe`, `ssbs`, `sse`, `sse2`, `sse3`, `sse4.1`, `sse4.2`, `sse4a`, `ssse3`, `ssve-fp8dot2`, `ssve-fp8dot4`, `ssve-fp8fma`, `sve`, `sve-b16b16`, `sve2`, `sve2-aes`, `sve2-bitperm`, `sve2-sha3`, `sve2-sm4`, `sve2p1`, `tail-call`, `tbm`, `thumb-mode`, `thumb2`, `tme`, `trust`, `trustzone`, `ual`, `unaligned-scalar-mem`, `v`, `v5te`, `v6`, `v6k`, `v6t2`, `v7`, `v8`, `v8.1a`, `v8.2a`, `v8.3a`, `v8.4a`, `v8.5a`, `v8.6a`, `v8.7a`, `v8.8a`, `v8.9a`, `v8plus`, `v9`, `v9.1a`, `v9.2a`, `v9.3a`, `v9.4a`, `v9.5a`, `v9a`, `vaes`, `vdsp2e60f`, `vdspv1`, `vdspv2`, `vector`, `vfp2`, `vfp3`, `vfp4`, `vh`, `virt`, `virtualization`, `vpclmulqdq`, `vsx`, `wfxt`, `wide-arithmetic`, `xop`, `xsave`, `xsavec`, `xsaveopt`, `xsaves`, `zaamo`, `zabha`, `zalrsc`, `zba`, `zbb`, `zbc`, `zbkb`, `zbkc`, `zbkx`, `zbs`, `zdinx`, `zfh`, `zfhmin`, `zfinx`, `zhinx`, `zhinxmin`, `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, and `zkt`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`

View File

@ -15,6 +15,10 @@ pub fn main() {
//~^ ERROR `mut` on a binding may not be repeated
//~| remove the additional `mut`s
let mut mut mut mut mut x = 0;
//~^ ERROR `mut` on a binding may not be repeated
//~| remove the additional `mut`s
struct Foo { x: isize }
let mut Foo { x: x } = Foo { x: 3 };
//~^ ERROR `mut` must be attached to each individual binding

View File

@ -45,11 +45,23 @@ LL | let mut mut x = 0;
help: remove the additional `mut`s
|
LL - let mut mut x = 0;
LL + let mut x = 0;
LL + let mut x = 0;
|
error: `mut` on a binding may not be repeated
--> $DIR/mut-patterns.rs:18:13
|
LL | let mut mut mut mut mut x = 0;
| ^^^^^^^^^^^^^^^
|
help: remove the additional `mut`s
|
LL - let mut mut mut mut mut x = 0;
LL + let mut x = 0;
|
error: `mut` must be attached to each individual binding
--> $DIR/mut-patterns.rs:19:9
--> $DIR/mut-patterns.rs:23:9
|
LL | let mut Foo { x: x } = Foo { x: 3 };
| ^^^^^^^^^^^^^^^^
@ -61,7 +73,7 @@ LL | let Foo { x: mut x } = Foo { x: 3 };
| ~~~~~~~~~~~~~~~~
error: `mut` must be attached to each individual binding
--> $DIR/mut-patterns.rs:23:9
--> $DIR/mut-patterns.rs:27:9
|
LL | let mut Foo { x } = Foo { x: 3 };
| ^^^^^^^^^^^^^
@ -73,7 +85,7 @@ LL | let Foo { mut x } = Foo { x: 3 };
| ~~~~~~~~~~~~~
error: `mut` on a binding may not be repeated
--> $DIR/mut-patterns.rs:28:13
--> $DIR/mut-patterns.rs:32:13
|
LL | let mut mut yield(become, await) = r#yield(0, 0);
| ^^^
@ -81,11 +93,11 @@ LL | let mut mut yield(become, await) = r#yield(0, 0);
help: remove the additional `mut`s
|
LL - let mut mut yield(become, await) = r#yield(0, 0);
LL + let mut yield(become, await) = r#yield(0, 0);
LL + let mut yield(become, await) = r#yield(0, 0);
|
error: expected identifier, found reserved keyword `yield`
--> $DIR/mut-patterns.rs:28:17
--> $DIR/mut-patterns.rs:32:17
|
LL | let mut mut yield(become, await) = r#yield(0, 0);
| ^^^^^ expected identifier, found reserved keyword
@ -96,7 +108,7 @@ LL | let mut mut r#yield(become, await) = r#yield(0, 0);
| ++
error: expected identifier, found reserved keyword `become`
--> $DIR/mut-patterns.rs:28:23
--> $DIR/mut-patterns.rs:32:23
|
LL | let mut mut yield(become, await) = r#yield(0, 0);
| ^^^^^^ expected identifier, found reserved keyword
@ -107,7 +119,7 @@ LL | let mut mut yield(r#become, await) = r#yield(0, 0);
| ++
error: expected identifier, found keyword `await`
--> $DIR/mut-patterns.rs:28:31
--> $DIR/mut-patterns.rs:32:31
|
LL | let mut mut yield(become, await) = r#yield(0, 0);
| ^^^^^ expected identifier, found keyword
@ -118,7 +130,7 @@ LL | let mut mut yield(become, r#await) = r#yield(0, 0);
| ++
error: `mut` must be followed by a named binding
--> $DIR/mut-patterns.rs:28:9
--> $DIR/mut-patterns.rs:32:9
|
LL | let mut mut yield(become, await) = r#yield(0, 0);
| ^^^^^^^^
@ -131,7 +143,7 @@ LL + let yield(become, await) = r#yield(0, 0);
|
error: `mut` must be attached to each individual binding
--> $DIR/mut-patterns.rs:37:9
--> $DIR/mut-patterns.rs:41:9
|
LL | let mut W(mut a, W(b, W(ref c, W(d, B { box f }))))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -143,7 +155,7 @@ LL | let W(mut a, W(mut b, W(ref c, W(mut d, B { box mut f }))))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: expected identifier, found `x`
--> $DIR/mut-patterns.rs:44:21
--> $DIR/mut-patterns.rs:48:21
|
LL | let mut $p = 0;
| ^^ expected identifier
@ -153,5 +165,5 @@ LL | foo!(x);
|
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 13 previous errors
error: aborting due to 14 previous errors

View File

@ -26,24 +26,24 @@ macro_rules! demo7 {
fn main() {
demo3!(## "foo");
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo4!(### "foo");
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo4!(## "foo"#);
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo7!(### "foo"###);
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo5!(###"foo"#);
@ -56,14 +56,14 @@ fn main() {
demo5!(#"foo"###);
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo4!("foo"###);
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
// Non-ascii identifiers

View File

@ -28,7 +28,7 @@ error: identifiers cannot contain emoji: `🙃`
LL | demo3!(🙃#"");
| ^^
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:28:12
|
LL | demo3!(## "foo");
@ -41,12 +41,12 @@ note: the lint level is defined here
|
LL | #![warn(rust_2024_guarded_string_incompatible_syntax)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo3!(# # "foo");
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:31:12
|
LL | demo4!(### "foo");
@ -54,12 +54,12 @@ LL | demo4!(### "foo");
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo4!(# ## "foo");
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:31:13
|
LL | demo4!(### "foo");
@ -67,12 +67,12 @@ LL | demo4!(### "foo");
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo4!(## # "foo");
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:36:12
|
LL | demo4!(## "foo"#);
@ -80,12 +80,12 @@ LL | demo4!(## "foo"#);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo4!(# # "foo"#);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:39:12
|
LL | demo7!(### "foo"###);
@ -93,12 +93,12 @@ LL | demo7!(### "foo"###);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo7!(# ## "foo"###);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:39:13
|
LL | demo7!(### "foo"###);
@ -106,12 +106,12 @@ LL | demo7!(### "foo"###);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo7!(## # "foo"###);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:39:21
|
LL | demo7!(### "foo"###);
@ -119,12 +119,12 @@ LL | demo7!(### "foo"###);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo7!(### "foo"# ##);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:39:22
|
LL | demo7!(### "foo"###);
@ -132,7 +132,7 @@ LL | demo7!(### "foo"###);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo7!(### "foo"## #);
| +
@ -189,7 +189,7 @@ help: insert whitespace here to avoid this being parsed as a guarded string in R
LL | demo5!(# "foo"###);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:56:18
|
LL | demo5!(#"foo"###);
@ -197,12 +197,12 @@ LL | demo5!(#"foo"###);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo5!(#"foo"# ##);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:56:19
|
LL | demo5!(#"foo"###);
@ -210,12 +210,12 @@ LL | demo5!(#"foo"###);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo5!(#"foo"## #);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:63:17
|
LL | demo4!("foo"###);
@ -223,12 +223,12 @@ LL | demo4!("foo"###);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo4!("foo"# ##);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-lexing.rs:63:18
|
LL | demo4!("foo"###);
@ -236,7 +236,7 @@ LL | demo4!("foo"###);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo4!("foo"## #);
| +

View File

@ -38,28 +38,28 @@ fn main() {
demo2!("foo"#);
demo3!(# # "foo");
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo4!(# # # "foo");
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo4!(# # "foo"#);
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo6!(# # # "foo"# #);
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo4!("foo"# # #);
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo2!(# "");
@ -94,6 +94,6 @@ fn main() {
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
}

View File

@ -38,28 +38,28 @@ fn main() {
demo2!("foo"#);
demo3!(## "foo");
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo4!(### "foo");
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo4!(## "foo"#);
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo6!(### "foo"##);
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo4!("foo"###);
//~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
demo2!(#"");
@ -94,6 +94,6 @@ fn main() {
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
//~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
//~| WARNING hard error in Rust 2024
}

View File

@ -1,4 +1,4 @@
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-migration.rs:40:12
|
LL | demo3!(## "foo");
@ -11,12 +11,12 @@ note: the lint level is defined here
|
LL | #![warn(rust_2024_guarded_string_incompatible_syntax)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo3!(# # "foo");
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-migration.rs:43:12
|
LL | demo4!(### "foo");
@ -24,12 +24,12 @@ LL | demo4!(### "foo");
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo4!(# ## "foo");
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-migration.rs:43:13
|
LL | demo4!(### "foo");
@ -37,12 +37,12 @@ LL | demo4!(### "foo");
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo4!(## # "foo");
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-migration.rs:48:12
|
LL | demo4!(## "foo"#);
@ -50,12 +50,12 @@ LL | demo4!(## "foo"#);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo4!(# # "foo"#);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-migration.rs:51:12
|
LL | demo6!(### "foo"##);
@ -63,12 +63,12 @@ LL | demo6!(### "foo"##);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo6!(# ## "foo"##);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-migration.rs:51:13
|
LL | demo6!(### "foo"##);
@ -76,12 +76,12 @@ LL | demo6!(### "foo"##);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo6!(## # "foo"##);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-migration.rs:51:21
|
LL | demo6!(### "foo"##);
@ -89,12 +89,12 @@ LL | demo6!(### "foo"##);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo6!(### "foo"# #);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-migration.rs:59:17
|
LL | demo4!("foo"###);
@ -102,12 +102,12 @@ LL | demo4!("foo"###);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo4!("foo"# ##);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-migration.rs:59:18
|
LL | demo4!("foo"###);
@ -115,7 +115,7 @@ LL | demo4!("foo"###);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo4!("foo"## #);
| +
@ -276,7 +276,7 @@ help: insert whitespace here to avoid this being parsed as a guarded string in R
LL | demo5!(## "foo"##);
| +
warning: will be parsed as a guarded string in Rust 2024
warning: reserved token in Rust 2024
--> $DIR/reserved-guarded-strings-migration.rs:92:19
|
LL | demo5!(##"foo"##);
@ -284,7 +284,7 @@ LL | demo5!(##"foo"##);
|
= warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
= note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
|
LL | demo5!(##"foo"# #);
| +

View File

@ -46,13 +46,13 @@ fn main() {
//~^ ERROR prefix `blah` is unknown
//~| ERROR invalid string literal
demo2!(## "foo"); //~ ERROR invalid string literal
demo3!("foo"###); //~ ERROR invalid string literal
demo3!(### "foo"); //~ ERROR invalid string literal
demo3!(## "foo"#); //~ ERROR invalid string literal
demo2!(## "foo"); //~ reserved multi-hash token is forbidden
demo3!("foo"###); //~ reserved multi-hash token is forbidden
demo3!(### "foo"); //~ reserved multi-hash token is forbidden
demo3!(## "foo"#); //~ reserved multi-hash token is forbidden
demo5!(### "foo"###);
//~^ ERROR invalid string literal
//~| ERROR invalid string literal
//~^ reserved multi-hash token is forbidden
//~| reserved multi-hash token is forbidden
demo1!(#""); //~ ERROR invalid string literal
demo1!(#""#); //~ ERROR invalid string literal
@ -65,7 +65,7 @@ fn main() {
demo1!(###"foo"###); //~ ERROR invalid string literal
demo2!(#"foo"###);
//~^ ERROR invalid string literal
//~| ERROR invalid string literal
//~| ERROR reserved multi-hash token is forbidden
// More than 255 hashes
demon!(####################################################################################################################################################################################################################################################################"foo");

View File

@ -34,73 +34,73 @@ help: consider inserting whitespace here
LL | demo2!(blah# "xx"#);
| +
error: invalid string literal
error: reserved multi-hash token is forbidden
--> $DIR/reserved-guarded-strings.rs:49:12
|
LL | demo2!(## "foo");
| ^^
|
= note: unprefixed guarded string literals are reserved for future use since Rust 2024
= note: sequences of two or more # are reserved for future use since Rust 2024
help: consider inserting whitespace here
|
LL | demo2!(# # "foo");
| +
error: invalid string literal
error: reserved multi-hash token is forbidden
--> $DIR/reserved-guarded-strings.rs:50:17
|
LL | demo3!("foo"###);
| ^^
|
= note: unprefixed guarded string literals are reserved for future use since Rust 2024
= note: sequences of two or more # are reserved for future use since Rust 2024
help: consider inserting whitespace here
|
LL | demo3!("foo"# ##);
| +
error: invalid string literal
error: reserved multi-hash token is forbidden
--> $DIR/reserved-guarded-strings.rs:51:12
|
LL | demo3!(### "foo");
| ^^
|
= note: unprefixed guarded string literals are reserved for future use since Rust 2024
= note: sequences of two or more # are reserved for future use since Rust 2024
help: consider inserting whitespace here
|
LL | demo3!(# ## "foo");
| +
error: invalid string literal
error: reserved multi-hash token is forbidden
--> $DIR/reserved-guarded-strings.rs:52:12
|
LL | demo3!(## "foo"#);
| ^^
|
= note: unprefixed guarded string literals are reserved for future use since Rust 2024
= note: sequences of two or more # are reserved for future use since Rust 2024
help: consider inserting whitespace here
|
LL | demo3!(# # "foo"#);
| +
error: invalid string literal
error: reserved multi-hash token is forbidden
--> $DIR/reserved-guarded-strings.rs:53:12
|
LL | demo5!(### "foo"###);
| ^^
|
= note: unprefixed guarded string literals are reserved for future use since Rust 2024
= note: sequences of two or more # are reserved for future use since Rust 2024
help: consider inserting whitespace here
|
LL | demo5!(# ## "foo"###);
| +
error: invalid string literal
error: reserved multi-hash token is forbidden
--> $DIR/reserved-guarded-strings.rs:53:21
|
LL | demo5!(### "foo"###);
| ^^
|
= note: unprefixed guarded string literals are reserved for future use since Rust 2024
= note: sequences of two or more # are reserved for future use since Rust 2024
help: consider inserting whitespace here
|
LL | demo5!(### "foo"# ##);
@ -226,13 +226,13 @@ help: consider inserting whitespace here
LL | demo2!(# "foo"###);
| +
error: invalid string literal
error: reserved multi-hash token is forbidden
--> $DIR/reserved-guarded-strings.rs:66:19
|
LL | demo2!(#"foo"###);
| ^^
|
= note: unprefixed guarded string literals are reserved for future use since Rust 2024
= note: sequences of two or more # are reserved for future use since Rust 2024
help: consider inserting whitespace here
|
LL | demo2!(#"foo"## #);