From ede41cba87f247d7c32fce5780f0e8d95985bb6d Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Wed, 19 Aug 2026 13:45:05 +0200 Subject: [PATCH 01/19] macro_metavar_expr_concat: support concatenating into string literals --- compiler/rustc_expand/src/mbe/metavar_expr.rs | 20 ++++-- compiler/rustc_expand/src/mbe/quoted.rs | 21 +++++-- compiler/rustc_expand/src/mbe/transcribe.rs | 62 ++++++++++++++----- compiler/rustc_span/src/symbol.rs | 1 + .../feature-gate-macro-metavar-expr-concat.rs | 3 +- ...ture-gate-macro-metavar-expr-concat.stderr | 14 ++++- .../concat-allowed-operations.rs | 51 ++++++++++++++- .../metavar-expressions/concat-str-horror.rs | 13 ++++ .../macros/metavar-expressions/concat-str.rs | 20 ++++++ .../metavar-expressions/concat-str.stderr | 34 ++++++++++ 10 files changed, 207 insertions(+), 32 deletions(-) create mode 100644 tests/ui/macros/metavar-expressions/concat-str-horror.rs create mode 100644 tests/ui/macros/metavar-expressions/concat-str.rs create mode 100644 tests/ui/macros/metavar-expressions/concat-str.stderr diff --git a/compiler/rustc_expand/src/mbe/metavar_expr.rs b/compiler/rustc_expand/src/mbe/metavar_expr.rs index a02b84204cb39..a4ac039cb09aa 100644 --- a/compiler/rustc_expand/src/mbe/metavar_expr.rs +++ b/compiler/rustc_expand/src/mbe/metavar_expr.rs @@ -15,8 +15,11 @@ pub(crate) const UNSUPPORTED_CONCAT_ELEM_ERR: &str = "expected identifier or str /// A meta-variable expression, for expansions based on properties of meta-variables. #[derive(Debug, PartialEq, Encodable, Decodable)] pub(crate) enum MetaVarExpr { - /// Unification of two or more identifiers. - Concat(Box<[MetaVarExprConcatElem]>), + /// Unification of two or more identifiers/literals/metavariables into an identifier. + ConcatIdent(Box<[MetaVarExprConcatElem]>), + + /// Unification of two or more identifiers/literals/metavariables into a string literal. + ConcatStr(Box<[MetaVarExprConcatElem]>), /// The number of repetitions of an identifier. Count(Ident, usize), @@ -73,7 +76,12 @@ impl MetaVarExpr { let mut iter = args.iter(); let rslt = match ident.name { - sym::concat => parse_concat(&mut iter, psess, outer_span, ident.span)?, + sym::concat => { + MetaVarExpr::ConcatIdent(parse_concat(&mut iter, psess, outer_span, ident.span)?) + } + sym::concat_str => { + MetaVarExpr::ConcatStr(parse_concat(&mut iter, psess, outer_span, ident.span)?) + } sym::count => parse_count(&mut iter, psess, ident.span)?, sym::ignore => { eat_dollar(&mut iter, psess, ident.span)?; @@ -95,7 +103,7 @@ impl MetaVarExpr { pub(crate) fn for_each_metavar(&self, mut aux: A, mut cb: impl FnMut(A, &Ident) -> A) -> A { match self { - MetaVarExpr::Concat(elems) => { + MetaVarExpr::ConcatIdent(elems) | MetaVarExpr::ConcatStr(elems) => { for elem in elems { if let MetaVarExprConcatElem::Var(ident) = elem { aux = cb(aux, ident) @@ -175,7 +183,7 @@ fn parse_concat<'psess>( psess: &'psess ParseSess, outer_span: Span, expr_ident_span: Span, -) -> PResult<'psess, MetaVarExpr> { +) -> PResult<'psess, Box<[MetaVarExprConcatElem]>> { let mut result = Vec::new(); loop { let is_var = try_eat_dollar(iter); @@ -210,7 +218,7 @@ fn parse_concat<'psess>( .dcx() .struct_span_err(expr_ident_span, "`concat` must have at least two elements")); } - Ok(MetaVarExpr::Concat(result.into())) + Ok(result.into()) } /// Parse a meta-variable `count` expression: `count(ident[, depth])` diff --git a/compiler/rustc_expand/src/mbe/quoted.rs b/compiler/rustc_expand/src/mbe/quoted.rs index 2779291abf361..2ba92297981ba 100644 --- a/compiler/rustc_expand/src/mbe/quoted.rs +++ b/compiler/rustc_expand/src/mbe/quoted.rs @@ -7,7 +7,7 @@ use rustc_feature::Features; use rustc_session::Session; use rustc_session::diagnostics::feature_err; use rustc_span::edition::Edition; -use rustc_span::{Ident, Span, kw, sym}; +use rustc_span::{Ident, Span, Symbol, kw, sym}; use crate::diagnostics; use crate::mbe::macro_parser::count_metavar_decls; @@ -204,9 +204,14 @@ fn maybe_emit_macro_metavar_expr_feature(features: &Features, sess: &Session, sp } } -fn maybe_emit_macro_metavar_expr_concat_feature(features: &Features, sess: &Session, span: Span) { +fn maybe_emit_macro_metavar_expr_concat_feature( + features: &Features, + sess: &Session, + span: Span, + what: Symbol, +) { if !features.macro_metavar_expr_concat() { - let msg = "the `concat` meta-variable expression is unstable"; + let msg = format!("the `{what}` meta-variable expression is unstable"); feature_err(sess, sym::macro_metavar_expr_concat, span, msg).emit(); } } @@ -278,11 +283,19 @@ fn parse_tree<'a>( return TokenTree::token(token::Dollar, dollar_span); } Ok(elem) => { - if let MetaVarExpr::Concat(_) = elem { + if matches!(elem, MetaVarExpr::ConcatIdent(_)) { + maybe_emit_macro_metavar_expr_concat_feature( + features, + sess, + delim_span.entire(), + sym::concat, + ); + } else if matches!(elem, MetaVarExpr::ConcatStr(_)) { maybe_emit_macro_metavar_expr_concat_feature( features, sess, delim_span.entire(), + sym::concat_str, ); } else { maybe_emit_macro_metavar_expr_feature( diff --git a/compiler/rustc_expand/src/mbe/transcribe.rs b/compiler/rustc_expand/src/mbe/transcribe.rs index eabec05cd66c6..030192a0c1538 100644 --- a/compiler/rustc_expand/src/mbe/transcribe.rs +++ b/compiler/rustc_expand/src/mbe/transcribe.rs @@ -588,7 +588,8 @@ fn transcribe_metavar_expr<'tx>( ) -> PResult<'tx, ()> { let dcx = tscx.psess.dcx(); let tt = match *expr { - MetaVarExpr::Concat(ref elements) => metavar_expr_concat(tscx, dspan, elements)?, + MetaVarExpr::ConcatIdent(ref elements) => metavar_expr_concat_ident(tscx, dspan, elements)?, + MetaVarExpr::ConcatStr(ref elements) => metavar_expr_concat_str(tscx, dspan, elements)?, MetaVarExpr::Count(original_ident, depth) => { let matched = matched_from_ident(dcx, original_ident, tscx.interp)?; let count = count_repetitions(dcx, depth, matched, &tscx.repeats, &dspan)?; @@ -626,11 +627,52 @@ fn transcribe_metavar_expr<'tx>( } /// Handle the `${concat(...)}` metavariable expression. -fn metavar_expr_concat<'tx>( +fn metavar_expr_concat_ident<'tx>( + tscx: &mut TranscrCtx<'tx, '_>, + dspan: DelimSpan, + elements: &[MetaVarExprConcatElem], +) -> PResult<'tx, TokenTree> { + let (symbol, concatenated_span) = metavar_expr_concat(tscx, dspan, elements)?; + if !rustc_lexer::is_ident(symbol.as_str()) { + return Err(tscx.psess.dcx().create_err(ConcatInvalidIdent { + span: concatenated_span, + reason: InvalidIdentReason::new(symbol), + })); + } + tscx.psess.symbol_gallery.insert(symbol, concatenated_span); + + // The current implementation marks the span as coming from the macro regardless of + // contexts of the concatenated identifiers but this behavior may change in the + // future. + Ok(TokenTree::Token( + Token::from_ast_ident(Ident::new(symbol, concatenated_span)), + Spacing::Alone, + )) +} + +/// Handle the `${concat_str(...)}` metavariable expression. +fn metavar_expr_concat_str<'tx>( tscx: &mut TranscrCtx<'tx, '_>, dspan: DelimSpan, elements: &[MetaVarExprConcatElem], ) -> PResult<'tx, TokenTree> { + let (symbol, concatenated_span) = metavar_expr_concat(tscx, dspan, elements)?; + + // The current implementation marks the span as coming from the macro regardless of + // contexts of the concatenated identifiers but this behavior may change in the + // future. + Ok(TokenTree::Token( + Token::new(TokenKind::lit(LitKind::Str, symbol, None), concatenated_span), + Spacing::Alone, + )) +} + +/// Shared logic for concat/concat_str metavariable expressions +fn metavar_expr_concat<'tx>( + tscx: &mut TranscrCtx<'tx, '_>, + dspan: DelimSpan, + elements: &[MetaVarExprConcatElem], +) -> PResult<'tx, (Symbol, Span)> { let dcx = tscx.psess.dcx(); let mut concatenated = String::new(); for element in elements { @@ -659,21 +701,7 @@ fn metavar_expr_concat<'tx>( } let symbol = nfc_normalize(&concatenated); let concatenated_span = tscx.visited_dspan(dspan); - if !rustc_lexer::is_ident(symbol.as_str()) { - return Err(dcx.create_err(ConcatInvalidIdent { - span: concatenated_span, - reason: InvalidIdentReason::new(symbol), - })); - } - tscx.psess.symbol_gallery.insert(symbol, concatenated_span); - - // The current implementation marks the span as coming from the macro regardless of - // contexts of the concatenated identifiers but this behavior may change in the - // future. - Ok(TokenTree::Token( - Token::from_ast_ident(Ident::new(symbol, concatenated_span)), - Spacing::Alone, - )) + Ok((symbol, concatenated_span)) } /// Store the metavariable span for this original span into a side table. diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 3fcb59ea2d701..d460d5d158194 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -658,6 +658,7 @@ symbols! { complex, concat, concat_bytes, + concat_str, conservative_impl_trait, console, const_allocate, diff --git a/tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.rs b/tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.rs index e700999ae4bd8..898bc28974c88 100644 --- a/tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.rs +++ b/tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.rs @@ -1,7 +1,8 @@ macro_rules! join { ($lhs:ident, $rhs:ident) => { - let ${concat($lhs, $rhs)}: () = (); + let ${concat($lhs, $rhs)}: &'static str = ${concat_str($lhs, $rhs)}; //~^ ERROR the `concat` meta-variable expression is unstable + //~| ERROR the `concat_str` meta-variable expression is unstable }; } diff --git a/tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.stderr b/tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.stderr index 5b2589d8c89be..47c09a119298d 100644 --- a/tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.stderr +++ b/tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.stderr @@ -1,13 +1,23 @@ error[E0658]: the `concat` meta-variable expression is unstable --> $DIR/feature-gate-macro-metavar-expr-concat.rs:3:14 | -LL | let ${concat($lhs, $rhs)}: () = (); +LL | let ${concat($lhs, $rhs)}: &'static str = ${concat_str($lhs, $rhs)}; | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #124225 for more information = help: add `#![feature(macro_metavar_expr_concat)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: aborting due to 1 previous error +error[E0658]: the `concat_str` meta-variable expression is unstable + --> $DIR/feature-gate-macro-metavar-expr-concat.rs:3:52 + | +LL | let ${concat($lhs, $rhs)}: &'static str = ${concat_str($lhs, $rhs)}; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #124225 for more information + = help: add `#![feature(macro_metavar_expr_concat)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/macros/metavar-expressions/concat-allowed-operations.rs b/tests/ui/macros/metavar-expressions/concat-allowed-operations.rs index 5ac50c943d030..cd0c23da1dd4f 100644 --- a/tests/ui/macros/metavar-expressions/concat-allowed-operations.rs +++ b/tests/ui/macros/metavar-expressions/concat-allowed-operations.rs @@ -5,7 +5,7 @@ macro_rules! create_things { ($lhs:ident) => { - struct ${concat($lhs, _separated_idents_in_a_struct)} { + struct ${concat($lhs, _separated_idents_in_a_struct)} { foo: i32, ${concat($lhs, _separated_idents_in_a_field)}: i32, } @@ -20,19 +20,23 @@ macro_rules! create_things { macro_rules! many_idents { ($a:ident, $c:ident) => { + #[allow(dead_code, reason = ${concat_str($a, B, $c, D)})] const ${concat($a, B, $c, D)}: i32 = 1; }; } macro_rules! valid_tts { ($_0:tt, $_1:tt) => { + #[allow(dead_code, reason = ${concat_str($_0, $_1)})] const ${concat($_0, $_1)}: i32 = 1; } } macro_rules! without_dollar_sign_is_an_ident { ($ident:ident) => { + #[allow(dead_code, reason = ${concat_str(VAR, ident)})] const ${concat(VAR, ident)}: i32 = 1; + #[allow(dead_code, reason = ${concat_str(VAR, $ident)})] const ${concat(VAR, $ident)}: i32 = 2; }; } @@ -40,60 +44,103 @@ macro_rules! without_dollar_sign_is_an_ident { macro_rules! combinations { ($ident:ident, $literal:literal, $tt_ident:tt, $tt_literal:tt) => {{ // tt ident + #[allow(dead_code, reason = ${concat_str($tt_ident, b)})] let ${concat($tt_ident, b)} = (); + #[allow(dead_code, reason = ${concat_str($tt_ident, _b)})] let ${concat($tt_ident, _b)} = (); + #[allow(dead_code, reason = ${concat_str($tt_ident, "b")})] let ${concat($tt_ident, "b")} = (); + #[allow(dead_code, reason = ${concat_str($tt_ident, $tt_ident)})] let ${concat($tt_ident, $tt_ident)} = (); + #[allow(dead_code, reason = ${concat_str($tt_ident, $tt_literal)})] let ${concat($tt_ident, $tt_literal)} = (); + #[allow(dead_code, reason = ${concat_str($tt_ident, $ident)})] + let ${concat($tt_ident, $ident)} = (); + #[allow(dead_code, reason = ${concat_str($tt_ident, $ident)})] let ${concat($tt_ident, $ident)} = (); - let ${concat($tt_ident, $literal)} = (); // tt literal + #[allow(dead_code, reason = ${concat_str($tt_literal, b)})] let ${concat($tt_literal, b)} = (); + #[allow(dead_code, reason = ${concat_str($tt_literal, _b)})] let ${concat($tt_literal, _b)} = (); + #[allow(dead_code, reason = ${concat_str($tt_literal, "b")})] let ${concat($tt_literal, "b")} = (); + #[allow(dead_code, reason = ${concat_str($tt_literal, $tt_ident)})] let ${concat($tt_literal, $tt_ident)} = (); + #[allow(dead_code, reason = ${concat_str($tt_literal, $tt_literal)})] let ${concat($tt_literal, $tt_literal)} = (); + #[allow(dead_code, reason = ${concat_str($tt_literal, $ident)})] let ${concat($tt_literal, $ident)} = (); + #[allow(dead_code, reason = ${concat_str($tt_literal, $literal)})] let ${concat($tt_literal, $literal)} = (); // ident (adhoc) + #[allow(dead_code, reason = ${concat_str(_b, b)})] let ${concat(_b, b)} = (); + #[allow(dead_code, reason = ${concat_str(_b, _b)})] let ${concat(_b, _b)} = (); + #[allow(dead_code, reason = ${concat_str(_b, "b")})] let ${concat(_b, "b")} = (); + #[allow(dead_code, reason = ${concat_str(_b, $tt_ident)})] let ${concat(_b, $tt_ident)} = (); + #[allow(dead_code, reason = ${concat_str(_b, $tt_literal)})] let ${concat(_b, $tt_literal)} = (); + #[allow(dead_code, reason = ${concat_str(_b, $ident)})] let ${concat(_b, $ident)} = (); + #[allow(dead_code, reason = ${concat_str(_b, $literal)})] let ${concat(_b, $literal)} = (); // ident (param) + #[allow(dead_code, reason = ${concat_str($ident, b)})] let ${concat($ident, b)} = (); + #[allow(dead_code, reason = ${concat_str($ident, _b)})] let ${concat($ident, _b)} = (); + #[allow(dead_code, reason = ${concat_str($ident, "b")})] let ${concat($ident, "b")} = (); + #[allow(dead_code, reason = ${concat_str($ident, $tt_ident)})] let ${concat($ident, $tt_ident)} = (); + #[allow(dead_code, reason = ${concat_str($ident, $tt_literal)})] let ${concat($ident, $tt_literal)} = (); + #[allow(dead_code, reason = ${concat_str($ident, $ident)})] let ${concat($ident, $ident)} = (); + #[allow(dead_code, reason = ${concat_str($ident, $literal)})] let ${concat($ident, $literal)} = (); // literal (adhoc) + #[allow(dead_code, reason = ${concat_str("a", b)})] let ${concat("a", b)} = (); + #[allow(dead_code, reason = ${concat_str("a", _b)})] let ${concat("a", _b)} = (); + #[allow(dead_code, reason = ${concat_str("a", "b")})] let ${concat("a", "b")} = (); + #[allow(dead_code, reason = ${concat_str("a", $tt_ident)})] let ${concat("a", $tt_ident)} = (); + #[allow(dead_code, reason = ${concat_str("a", $tt_literal)})] let ${concat("a", $tt_literal)} = (); + #[allow(dead_code, reason = ${concat_str("a", $ident)})] let ${concat("a", $ident)} = (); + #[allow(dead_code, reason = ${concat_str("a", $literal)})] let ${concat("a", $literal)} = (); // literal (param) + #[allow(dead_code, reason = ${concat_str($literal, b)})] let ${concat($literal, b)} = (); + #[allow(dead_code, reason = ${concat_str($literal, _b)})] let ${concat($literal, _b)} = (); + #[allow(dead_code, reason = ${concat_str($literal, "b")})] let ${concat($literal, "b")} = (); + #[allow(dead_code, reason = ${concat_str($literal, $tt_ident)})] let ${concat($literal, $tt_ident)} = (); + #[allow(dead_code, reason = ${concat_str($literal, $tt_literal)})] let ${concat($literal, $tt_literal)} = (); + #[allow(dead_code, reason = ${concat_str($literal, $ident)})] let ${concat($literal, $ident)} = (); + #[allow(dead_code, reason = ${concat_str($literal, $literal)})] let ${concat($literal, $literal)} = (); }}; } macro_rules! int_struct { ($n: literal) => { + #[allow(dead_code, reason = ${concat_str(E, $n)})] struct ${concat(E, $n)}; } } diff --git a/tests/ui/macros/metavar-expressions/concat-str-horror.rs b/tests/ui/macros/metavar-expressions/concat-str-horror.rs new file mode 100644 index 0000000000000..558e55539e870 --- /dev/null +++ b/tests/ui/macros/metavar-expressions/concat-str-horror.rs @@ -0,0 +1,13 @@ +//@ run-pass +#![feature(macro_metavar_expr_concat)] + +macro_rules! format_horror{ + ($arg1:ident, $arg2:expr, $arg3:expr) => { + format!(${concat_str("horror ", $arg1, " horror {} horror {}")}, $arg2, $arg3) + } +} + +fn main(){ + let x = format_horror!(a, "b", "c"); + assert_eq!(x, "horror a horror b horror c"); +} diff --git a/tests/ui/macros/metavar-expressions/concat-str.rs b/tests/ui/macros/metavar-expressions/concat-str.rs new file mode 100644 index 0000000000000..f04e620d6826e --- /dev/null +++ b/tests/ui/macros/metavar-expressions/concat-str.rs @@ -0,0 +1,20 @@ +#![feature(macro_metavar_expr_concat)] +#![crate_type = "lib"] + +macro_rules! make_stuff { + ($prefix:literal, $name:ident) => { + #[deprecated(since = "1.0.0", note = ${concat_str($prefix, " ", $name, " trait")})] + #[diagnostic::on_unimplemented(message = ${concat_str("please do not the ", $name)})] + pub trait ${concat(New, $name)} {} + } +} + +make_stuff!("blah blah blah", AAAAAA); + +pub fn foo(x: impl NewAAAAAA) {} +//~^ WARN use of deprecated trait `NewAAAAAA`: blah blah blah AAAAAA trait [deprecated] + +fn bar(){ + foo(()); + //~^ ERROR please do not the AAAAAA [E0277] +} diff --git a/tests/ui/macros/metavar-expressions/concat-str.stderr b/tests/ui/macros/metavar-expressions/concat-str.stderr new file mode 100644 index 0000000000000..0f4b7283e80bc --- /dev/null +++ b/tests/ui/macros/metavar-expressions/concat-str.stderr @@ -0,0 +1,34 @@ +warning: use of deprecated trait `NewAAAAAA`: blah blah blah AAAAAA trait + --> $DIR/concat-str.rs:14:20 + | +LL | pub fn foo(x: impl NewAAAAAA) {} + | ^^^^^^^^^ + | + = note: `#[warn(deprecated)]` on by default + +error[E0277]: please do not the AAAAAA + --> $DIR/concat-str.rs:18:9 + | +LL | foo(()); + | --- ^^ the trait `NewAAAAAA` is not implemented for `()` + | | + | required by a bound introduced by this call + | +help: this trait has no implementations, consider adding one + --> $DIR/concat-str.rs:8:9 + | +LL | pub trait ${concat(New, $name)} {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | make_stuff!("blah blah blah", AAAAAA); + | ------------------------------------- in this macro invocation +note: required by a bound in `foo` + --> $DIR/concat-str.rs:14:20 + | +LL | pub fn foo(x: impl NewAAAAAA) {} + | ^^^^^^^^^ required by this bound in `foo` + = note: this error originates in the macro `make_stuff` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 1 previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0277`. From 8e54ab529f3df315811f6dbcc14e961794d698c9 Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Fri, 4 Sep 2026 00:19:59 +0200 Subject: [PATCH 02/19] add escaped literals test --- .../metavar-expressions/concat-str-escape.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/ui/macros/metavar-expressions/concat-str-escape.rs diff --git a/tests/ui/macros/metavar-expressions/concat-str-escape.rs b/tests/ui/macros/metavar-expressions/concat-str-escape.rs new file mode 100644 index 0000000000000..612c957b831eb --- /dev/null +++ b/tests/ui/macros/metavar-expressions/concat-str-escape.rs @@ -0,0 +1,20 @@ +//@ run-pass + +#![feature(macro_metavar_expr_concat)] + +macro_rules! escape_literal { + ($literal:literal, $concatted:literal) => { + let lit = ${concat_str("_", "\"foo", $literal)}; + assert_eq!(lit, concat!("_", "\"foo", $literal)); + assert_eq!(lit, $concatted); + + } +} + +fn main(){ + escape_literal!("\u{00BD}", "_\"foo\u{00BD}"); + escape_literal!("\x41", "_\"foo\x41"); + escape_literal!("🤷", "_\"foo🤷"); + escape_literal!("\u{1F980}", "_\"foo🦀"); + escape_literal!("aaa \"bbb\" ccc", "_\"fooaaa \"bbb\" ccc"); +} From abc01171f0c11e0152105627f22820c9f6481dbc Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Sat, 5 Sep 2026 01:04:39 +0000 Subject: [PATCH 03/19] Move auto trait leakage of opaques into its own candidate fn --- .../src/solve/assembly/structural_traits.rs | 12 +----- .../src/solve/trait_goals.rs | 40 ++++++++++++++----- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs index 17172c5333502..6d93634d616ee 100644 --- a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs +++ b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs @@ -60,7 +60,8 @@ where | ty::Placeholder(..) | ty::Alias(ty::IsRigid::No, _) | ty::Bound(..) - | ty::Infer(_) => { + | ty::Infer(_) + | ty::Alias(ty::IsRigid::Yes, ty::AliasTy { kind: ty::Opaque { .. }, .. }) => { panic!("unexpected type `{ty:?}`") } @@ -106,15 +107,6 @@ where .map(Unnormalized::skip_norm_wip) .collect(), )), - - ty::Alias(ty::IsRigid::Yes, ty::AliasTy { kind: ty::Opaque { def_id }, args, .. }) => { - // We can resolve the `impl Trait` to its concrete type, - // which enforces a DAG between the functions requiring - // the auto trait bounds in question. - Ok(ty::Binder::dummy(vec![ - cx.type_of(def_id.into()).instantiate(cx, args).skip_norm_wip(), - ])) - } } } diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs index 51ec0bcbf5ec2..4eabea8ee221a 100644 --- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs @@ -236,19 +236,11 @@ where // when merging candidates anyways. // // See tests/ui/impl-trait/auto-trait-leakage/avoid-query-cycle-via-item-bound.rs. - if let ty::Alias(is_rigid, ty::AliasTy { kind: ty::Opaque { def_id }, .. }) = + if let ty::Alias(is_rigid, ty::AliasTy { kind: ty::Opaque { def_id }, args, .. }) = goal.predicate.self_ty().kind() { debug_assert!(is_rigid == ty::IsRigid::Yes); - - for item_bound in cx.item_self_bounds(def_id.into()).skip_binder() { - if item_bound - .as_trait_clause() - .is_some_and(|b| b.def_id() == goal.predicate.def_id()) - { - return Err(NoSolution.into()); - } - } + return ecx.consider_auto_trait_candidate_for_opaque_ty(goal, def_id, args); } // We need to make sure to stall any coroutines we are inferring to avoid query cycles. @@ -1286,6 +1278,34 @@ where .enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)) } + fn consider_auto_trait_candidate_for_opaque_ty( + &mut self, + goal: Goal>, + def_id: I::OpaqueTyId, + args: I::GenericArgs, + ) -> Result, NoSolutionOrRerunNonErased> { + let cx = self.cx(); + let source = CandidateSource::BuiltinImpl(BuiltinImplSource::Misc); + if self.opaque_accesses.might_rerun() { + match self.opaque_accesses.rerun_always(RerunReason::AutoTraitLeakage)? {} + } + + for item_bound in cx.item_self_bounds(def_id.into()).skip_binder() { + if item_bound.as_trait_clause().is_some_and(|b| b.def_id() == goal.predicate.def_id()) { + return Err(NoSolution.into()); + } + } + + self.probe_trait_candidate(source).enter(|ecx| { + let hidden_ty = cx.type_of(def_id.into()).instantiate(cx, args).skip_norm_wip(); + ecx.add_goal( + GoalSource::ImplWhereBound, + goal.with(cx, goal.predicate.with_replaced_self_ty(cx, hidden_ty)), + )?; + ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes) + }) + } + // Return `Some` if there is an impl (built-in or user provided) that may // hold for the self type of the goal, which for coherence and soundness // purposes must disqualify the built-in auto impl assembled by considering From 4d6260257392d961cbbb1495dabb9b947a127b7e Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Sat, 5 Sep 2026 01:04:39 +0000 Subject: [PATCH 04/19] Don't constrain inference vars via auto trait leakage of opaques --- .../rustc_next_trait_solver/src/solve/trait_goals.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs index 4eabea8ee221a..bad038022b1fb 100644 --- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs @@ -1296,14 +1296,20 @@ where } } - self.probe_trait_candidate(source).enter(|ecx| { + let candidate = self.probe_trait_candidate(source).enter(|ecx| { let hidden_ty = cx.type_of(def_id.into()).instantiate(cx, args).skip_norm_wip(); ecx.add_goal( GoalSource::ImplWhereBound, goal.with(cx, goal.predicate.with_replaced_self_ty(cx, hidden_ty)), )?; ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes) - }) + }); + + match candidate { + Ok(candidate) if has_only_region_constraints(candidate.result) => Ok(candidate), + Ok(_) => self.forced_ambiguity(MaybeInfo::AMBIGUOUS), + Err(err) => Err(err), + } } // Return `Some` if there is an impl (built-in or user provided) that may From 43ba58a79a834440c9604ce423e43085f60f2217 Mon Sep 17 00:00:00 2001 From: malezjaa Date: Mon, 14 Sep 2026 23:54:00 +0200 Subject: [PATCH 05/19] regression test for GCE inherent projection ICE --- .../wf-const-arg-inherent-projection-ice.rs | 19 ++++++++++++++ ...f-const-arg-inherent-projection-ice.stderr | 25 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/ui/const-generics/generic_const_exprs/wf-const-arg-inherent-projection-ice.rs create mode 100644 tests/ui/const-generics/generic_const_exprs/wf-const-arg-inherent-projection-ice.stderr diff --git a/tests/ui/const-generics/generic_const_exprs/wf-const-arg-inherent-projection-ice.rs b/tests/ui/const-generics/generic_const_exprs/wf-const-arg-inherent-projection-ice.rs new file mode 100644 index 0000000000000..8f6ec1e97a040 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/wf-const-arg-inherent-projection-ice.rs @@ -0,0 +1,19 @@ +//! Regression test for . + +#![feature(generic_const_exprs)] + +fn new() +where + [(); N * 1]:, +{ +} + +fn test() +where + [(); N - usize::MAX * 1]:, +{ + new + //~^ ERROR mismatched types +} + +fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/wf-const-arg-inherent-projection-ice.stderr b/tests/ui/const-generics/generic_const_exprs/wf-const-arg-inherent-projection-ice.stderr new file mode 100644 index 0000000000000..3757a462a4173 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/wf-const-arg-inherent-projection-ice.stderr @@ -0,0 +1,25 @@ +error[E0308]: mismatched types + --> $DIR/wf-const-arg-inherent-projection-ice.rs:15:5 + | +LL | / fn new() +LL | | where +LL | | [(); N * 1]:, + | |_________________- function `new` defined here +... +LL | new + | ^^^ expected `()`, found fn item + | + = note: expected unit type `()` + found fn item `fn() {new::::MAX>}` +help: try adding a return type + | +LL | fn test() -> fn() + | +++++++ +help: use parentheses to call this function + | +LL | new() + | ++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. From 8a2e879b5da50b5f99e48652ee19844d29d5acd9 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 20 Sep 2026 12:52:15 +0200 Subject: [PATCH 06/19] windows Dir::rename: remove incorrect is_dir query --- library/std/src/fs/tests.rs | 10 ++++++++++ library/std/src/sys/fs/windows/dir.rs | 26 +++++++++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index 148f1c32b08b9..0cef72b624dbb 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -2783,6 +2783,16 @@ fn test_dir_remove_dir() { assert!(!matches!(exists(tmpdir.join("foo")), Ok(true))); } +#[test] +fn test_dir_rename_dir() { + let tmpdir = tmpdir(); + check!(fs::create_dir(tmpdir.join("foo"))); + let dir = check!(Dir::open(tmpdir.path())); + check!(dir.rename("foo", &dir, "baz")); + let m = check!(tmpdir.join("baz").metadata()); + assert!(m.is_dir()); +} + #[test] fn test_dir_create_dir() { let tmpdir = tmpdir(); diff --git a/library/std/src/sys/fs/windows/dir.rs b/library/std/src/sys/fs/windows/dir.rs index 70bade84f58fd..57468bd74edb0 100644 --- a/library/std/src/sys/fs/windows/dir.rs +++ b/library/std/src/sys/fs/windows/dir.rs @@ -78,19 +78,18 @@ impl Dir { return File::open(path, opts); } let path = to_u16s_without_nul(path)?; - self.open_file_native(&path, opts, false).map(|handle| File { handle }) + self.open_file_native(&path, opts, c::FILE_NON_DIRECTORY_FILE).map(|handle| File { handle }) } pub fn remove_file(&self, path: &Path) -> io::Result<()> { let path = to_u16s_without_nul(path)?; - self.remove_native(&path, false) + self.remove_native(&path, /* dir */ false) } pub fn rename(&self, from: &Path, to_dir: &Self, to: &Path) -> io::Result<()> { - let is_dir = from.is_dir(); let from = to_u16s_without_nul(from)?; let to = to_u16s_without_nul(to)?; - self.rename_native(&from, to_dir, &to, is_dir) + self.rename_native(&from, to_dir, &to) } pub fn create_dir(&self, path: &Path) -> io::Result<()> { @@ -103,12 +102,12 @@ impl Dir { pub fn open_dir(&self, path: &Path, opts: &OpenOptions) -> io::Result { let path = to_u16s_without_nul(&path)?; - self.open_file_native(&path, &opts, true).map(|handle| Self { handle }) + self.open_file_native(&path, &opts, c::FILE_DIRECTORY_FILE).map(|handle| Self { handle }) } pub fn remove_dir(&self, path: &Path) -> io::Result<()> { let path = to_u16s_without_nul(&path)?; - self.remove_native(&path, true) + self.remove_native(&path, /* dir */ true) } fn open_with_native(path: &WCStr, opts: &OpenOptions) -> io::Result { @@ -136,29 +135,34 @@ impl Dir { } } - fn open_file_native(&self, path: &[u16], opts: &OpenOptions, dir: bool) -> io::Result { + fn open_file_native( + &self, + path: &[u16], + opts: &OpenOptions, + create_opt: u32, + ) -> io::Result { let name = UnicodeStrRef::from_slice(path); let object_attributes = c::OBJECT_ATTRIBUTES { RootDirectory: self.handle.as_raw_handle(), ObjectName: name.as_ptr().cast_mut(), ..c::OBJECT_ATTRIBUTES::with_length() }; - let create_opt = if dir { c::FILE_DIRECTORY_FILE } else { c::FILE_NON_DIRECTORY_FILE }; unsafe { nt_create_file(opts, &object_attributes, create_opt) } } fn remove_native(&self, path: &[u16], dir: bool) -> io::Result<()> { let mut opts = OpenOptions::new(); opts.access_mode(c::DELETE); - let handle = self.open_file_native(path, &opts, dir)?; + let create_opt = if dir { c::FILE_DIRECTORY_FILE } else { c::FILE_NON_DIRECTORY_FILE }; + let handle = self.open_file_native(path, &opts, create_opt)?; File::from_inner(handle).delete().io_result() } - fn rename_native(&self, from: &[u16], to_dir: &Self, to: &[u16], dir: bool) -> io::Result<()> { + fn rename_native(&self, from: &[u16], to_dir: &Self, to: &[u16]) -> io::Result<()> { let mut opts = OpenOptions::new(); opts.access_mode(c::DELETE); opts.custom_flags(c::FILE_FLAG_OPEN_REPARSE_POINT | c::FILE_FLAG_BACKUP_SEMANTICS); - let handle = self.open_file_native(from, &opts, dir)?; + let handle = self.open_file_native(from, &opts, /* create_opt */ 0)?; // Calculate the layout of the `FILE_RENAME_INFORMATION` we pass to `NtSetInformationFile` // This is a dynamically sized struct so we need to get the position of the last field to calculate the actual size. const too_long_err: io::Error = From 22e16a4eae94e692334c601247a9f696b002a768 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 5 Sep 2026 12:14:36 +0200 Subject: [PATCH 07/19] powerpc64-ibm-aix: fix cfg(target_abi) value --- compiler/rustc_target/src/asm/powerpc.rs | 4 + compiler/rustc_target/src/spec/base/aix.rs | 7 +- tests/ui/asm/powerpc/bad-reg.aix64.stderr | 500 ++++++++++++++---- tests/ui/asm/powerpc/bad-reg.powerpc.stderr | 224 ++++---- tests/ui/asm/powerpc/bad-reg.powerpc64.stderr | 224 ++++---- .../ui/asm/powerpc/bad-reg.powerpc64le.stderr | 210 ++++---- .../ui/asm/powerpc/bad-reg.powerpcspe.stderr | 222 ++++---- tests/ui/asm/powerpc/bad-reg.rs | 52 +- tests/ui/check-cfg/well-known-values.stderr | 2 +- 9 files changed, 895 insertions(+), 550 deletions(-) diff --git a/compiler/rustc_target/src/asm/powerpc.rs b/compiler/rustc_target/src/asm/powerpc.rs index ab85fade8a8eb..36a8657c5d4e1 100644 --- a/compiler/rustc_target/src/asm/powerpc.rs +++ b/compiler/rustc_target/src/asm/powerpc.rs @@ -107,6 +107,10 @@ fn reserved_v20to31( _is_clobber: bool, ) -> Result<(), &'static str> { if target.is_like_aix { + // FIXME: using `cfg_abi` here is wrong -- that's not a source of truth, it's just + // what we display to the user. Instead we need to check the knob that controls + // whether the ABI is actually used. Currently there is no such knob, a Rust target + // can therefore never actually use `vec-extabi`. match &target.options.cfg_abi { CfgAbi::VecDefault => Err("v20-v31 (vs52-vs63) are reserved on vec-default ABI"), CfgAbi::VecExtAbi => Ok(()), diff --git a/compiler/rustc_target/src/spec/base/aix.rs b/compiler/rustc_target/src/spec/base/aix.rs index 41cf3e001fdfc..5d172cc8b0fcf 100644 --- a/compiler/rustc_target/src/spec/base/aix.rs +++ b/compiler/rustc_target/src/spec/base/aix.rs @@ -7,7 +7,12 @@ use crate::spec::{ pub(crate) fn opts() -> TargetOptions { TargetOptions { - cfg_abi: CfgAbi::VecExtAbi, + // It makes no sense to set "vec-extabi" here without also actually configuring LLVM to use + // that ABI. This needs a new target spec knob to control the relevant LLVM flag. If you are + // adding such a knob, make sure to also: + // - adjust the logic in `asm/powerpc.rs` to check that knob instead of checking `cfg_abi`. + // - adjust the logic in `spec/consistency.rs` to correlate that knob with `cfg_abi`. + cfg_abi: CfgAbi::VecDefault, code_model: Some(CodeModel::Large), cpu: "pwr7".into(), os: Os::Aix, diff --git a/tests/ui/asm/powerpc/bad-reg.aix64.stderr b/tests/ui/asm/powerpc/bad-reg.aix64.stderr index 7631f8a4c9b6d..9017f8c01e806 100644 --- a/tests/ui/asm/powerpc/bad-reg.aix64.stderr +++ b/tests/ui/asm/powerpc/bad-reg.aix64.stderr @@ -29,103 +29,103 @@ LL | asm!("", out("vrsave") _); | ^^^^^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:131:18 + --> $DIR/bad-reg.rs:155:18 | LL | asm!("", in("cr") x); | ^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:134:18 + --> $DIR/bad-reg.rs:158:18 | LL | asm!("", out("cr") x); | ^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:137:26 + --> $DIR/bad-reg.rs:161:26 | LL | asm!("/* {} */", in(cr) x); | ^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:140:26 + --> $DIR/bad-reg.rs:164:26 | LL | asm!("/* {} */", out(cr) _); | ^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:144:18 + --> $DIR/bad-reg.rs:168:18 | LL | asm!("", in("ctr") x); | ^^^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:147:18 + --> $DIR/bad-reg.rs:171:18 | LL | asm!("", out("ctr") x); | ^^^^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:150:26 + --> $DIR/bad-reg.rs:174:26 | LL | asm!("/* {} */", in(ctr) x); | ^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:153:26 + --> $DIR/bad-reg.rs:177:26 | LL | asm!("/* {} */", out(ctr) _); | ^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:157:18 + --> $DIR/bad-reg.rs:181:18 | LL | asm!("", in("lr") x); | ^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:160:18 + --> $DIR/bad-reg.rs:184:18 | LL | asm!("", out("lr") x); | ^^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:163:26 + --> $DIR/bad-reg.rs:187:26 | LL | asm!("/* {} */", in(lr) x); | ^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:166:26 + --> $DIR/bad-reg.rs:190:26 | LL | asm!("/* {} */", out(lr) _); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:170:18 + --> $DIR/bad-reg.rs:194:18 | LL | asm!("", in("xer") x); | ^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:173:18 + --> $DIR/bad-reg.rs:197:18 | LL | asm!("", out("xer") x); | ^^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:176:26 + --> $DIR/bad-reg.rs:200:26 | LL | asm!("/* {} */", in(xer) x); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:179:26 + --> $DIR/bad-reg.rs:203:26 | LL | asm!("/* {} */", out(xer) _); | ^^^^^^^^^^ error: register `cr0` conflicts with register `cr` - --> $DIR/bad-reg.rs:183:31 + --> $DIR/bad-reg.rs:207:31 | LL | asm!("", out("cr") _, out("cr0") _); | ----------- ^^^^^^^^^^^^ register `cr0` @@ -133,7 +133,7 @@ LL | asm!("", out("cr") _, out("cr0") _); | register `cr` error: register `cr1` conflicts with register `cr` - --> $DIR/bad-reg.rs:185:31 + --> $DIR/bad-reg.rs:209:31 | LL | asm!("", out("cr") _, out("cr1") _); | ----------- ^^^^^^^^^^^^ register `cr1` @@ -141,7 +141,7 @@ LL | asm!("", out("cr") _, out("cr1") _); | register `cr` error: register `cr2` conflicts with register `cr` - --> $DIR/bad-reg.rs:187:31 + --> $DIR/bad-reg.rs:211:31 | LL | asm!("", out("cr") _, out("cr2") _); | ----------- ^^^^^^^^^^^^ register `cr2` @@ -149,7 +149,7 @@ LL | asm!("", out("cr") _, out("cr2") _); | register `cr` error: register `cr3` conflicts with register `cr` - --> $DIR/bad-reg.rs:189:31 + --> $DIR/bad-reg.rs:213:31 | LL | asm!("", out("cr") _, out("cr3") _); | ----------- ^^^^^^^^^^^^ register `cr3` @@ -157,7 +157,7 @@ LL | asm!("", out("cr") _, out("cr3") _); | register `cr` error: register `cr4` conflicts with register `cr` - --> $DIR/bad-reg.rs:191:31 + --> $DIR/bad-reg.rs:215:31 | LL | asm!("", out("cr") _, out("cr4") _); | ----------- ^^^^^^^^^^^^ register `cr4` @@ -165,7 +165,7 @@ LL | asm!("", out("cr") _, out("cr4") _); | register `cr` error: register `cr5` conflicts with register `cr` - --> $DIR/bad-reg.rs:193:31 + --> $DIR/bad-reg.rs:217:31 | LL | asm!("", out("cr") _, out("cr5") _); | ----------- ^^^^^^^^^^^^ register `cr5` @@ -173,7 +173,7 @@ LL | asm!("", out("cr") _, out("cr5") _); | register `cr` error: register `cr6` conflicts with register `cr` - --> $DIR/bad-reg.rs:195:31 + --> $DIR/bad-reg.rs:219:31 | LL | asm!("", out("cr") _, out("cr6") _); | ----------- ^^^^^^^^^^^^ register `cr6` @@ -181,7 +181,7 @@ LL | asm!("", out("cr") _, out("cr6") _); | register `cr` error: register `cr7` conflicts with register `cr` - --> $DIR/bad-reg.rs:197:31 + --> $DIR/bad-reg.rs:221:31 | LL | asm!("", out("cr") _, out("cr7") _); | ----------- ^^^^^^^^^^^^ register `cr7` @@ -189,7 +189,7 @@ LL | asm!("", out("cr") _, out("cr7") _); | register `cr` error: register `vs0` conflicts with register `f0` - --> $DIR/bad-reg.rs:200:31 + --> $DIR/bad-reg.rs:224:31 | LL | asm!("", out("f0") _, out("vs0") _); | ----------- ^^^^^^^^^^^^ register `vs0` @@ -197,7 +197,7 @@ LL | asm!("", out("f0") _, out("vs0") _); | register `f0` error: register `vs1` conflicts with register `f1` - --> $DIR/bad-reg.rs:202:31 + --> $DIR/bad-reg.rs:226:31 | LL | asm!("", out("f1") _, out("vs1") _); | ----------- ^^^^^^^^^^^^ register `vs1` @@ -205,7 +205,7 @@ LL | asm!("", out("f1") _, out("vs1") _); | register `f1` error: register `vs2` conflicts with register `f2` - --> $DIR/bad-reg.rs:204:31 + --> $DIR/bad-reg.rs:228:31 | LL | asm!("", out("f2") _, out("vs2") _); | ----------- ^^^^^^^^^^^^ register `vs2` @@ -213,7 +213,7 @@ LL | asm!("", out("f2") _, out("vs2") _); | register `f2` error: register `vs3` conflicts with register `f3` - --> $DIR/bad-reg.rs:206:31 + --> $DIR/bad-reg.rs:230:31 | LL | asm!("", out("f3") _, out("vs3") _); | ----------- ^^^^^^^^^^^^ register `vs3` @@ -221,7 +221,7 @@ LL | asm!("", out("f3") _, out("vs3") _); | register `f3` error: register `vs4` conflicts with register `f4` - --> $DIR/bad-reg.rs:208:31 + --> $DIR/bad-reg.rs:232:31 | LL | asm!("", out("f4") _, out("vs4") _); | ----------- ^^^^^^^^^^^^ register `vs4` @@ -229,7 +229,7 @@ LL | asm!("", out("f4") _, out("vs4") _); | register `f4` error: register `vs5` conflicts with register `f5` - --> $DIR/bad-reg.rs:210:31 + --> $DIR/bad-reg.rs:234:31 | LL | asm!("", out("f5") _, out("vs5") _); | ----------- ^^^^^^^^^^^^ register `vs5` @@ -237,7 +237,7 @@ LL | asm!("", out("f5") _, out("vs5") _); | register `f5` error: register `vs6` conflicts with register `f6` - --> $DIR/bad-reg.rs:212:31 + --> $DIR/bad-reg.rs:236:31 | LL | asm!("", out("f6") _, out("vs6") _); | ----------- ^^^^^^^^^^^^ register `vs6` @@ -245,7 +245,7 @@ LL | asm!("", out("f6") _, out("vs6") _); | register `f6` error: register `vs7` conflicts with register `f7` - --> $DIR/bad-reg.rs:214:31 + --> $DIR/bad-reg.rs:238:31 | LL | asm!("", out("f7") _, out("vs7") _); | ----------- ^^^^^^^^^^^^ register `vs7` @@ -253,7 +253,7 @@ LL | asm!("", out("f7") _, out("vs7") _); | register `f7` error: register `vs8` conflicts with register `f8` - --> $DIR/bad-reg.rs:216:31 + --> $DIR/bad-reg.rs:240:31 | LL | asm!("", out("f8") _, out("vs8") _); | ----------- ^^^^^^^^^^^^ register `vs8` @@ -261,7 +261,7 @@ LL | asm!("", out("f8") _, out("vs8") _); | register `f8` error: register `vs9` conflicts with register `f9` - --> $DIR/bad-reg.rs:218:31 + --> $DIR/bad-reg.rs:242:31 | LL | asm!("", out("f9") _, out("vs9") _); | ----------- ^^^^^^^^^^^^ register `vs9` @@ -269,7 +269,7 @@ LL | asm!("", out("f9") _, out("vs9") _); | register `f9` error: register `vs10` conflicts with register `f10` - --> $DIR/bad-reg.rs:220:32 + --> $DIR/bad-reg.rs:244:32 | LL | asm!("", out("f10") _, out("vs10") _); | ------------ ^^^^^^^^^^^^^ register `vs10` @@ -277,7 +277,7 @@ LL | asm!("", out("f10") _, out("vs10") _); | register `f10` error: register `vs11` conflicts with register `f11` - --> $DIR/bad-reg.rs:222:32 + --> $DIR/bad-reg.rs:246:32 | LL | asm!("", out("f11") _, out("vs11") _); | ------------ ^^^^^^^^^^^^^ register `vs11` @@ -285,7 +285,7 @@ LL | asm!("", out("f11") _, out("vs11") _); | register `f11` error: register `vs12` conflicts with register `f12` - --> $DIR/bad-reg.rs:224:32 + --> $DIR/bad-reg.rs:248:32 | LL | asm!("", out("f12") _, out("vs12") _); | ------------ ^^^^^^^^^^^^^ register `vs12` @@ -293,7 +293,7 @@ LL | asm!("", out("f12") _, out("vs12") _); | register `f12` error: register `vs13` conflicts with register `f13` - --> $DIR/bad-reg.rs:226:32 + --> $DIR/bad-reg.rs:250:32 | LL | asm!("", out("f13") _, out("vs13") _); | ------------ ^^^^^^^^^^^^^ register `vs13` @@ -301,7 +301,7 @@ LL | asm!("", out("f13") _, out("vs13") _); | register `f13` error: register `vs14` conflicts with register `f14` - --> $DIR/bad-reg.rs:228:32 + --> $DIR/bad-reg.rs:252:32 | LL | asm!("", out("f14") _, out("vs14") _); | ------------ ^^^^^^^^^^^^^ register `vs14` @@ -309,7 +309,7 @@ LL | asm!("", out("f14") _, out("vs14") _); | register `f14` error: register `vs15` conflicts with register `f15` - --> $DIR/bad-reg.rs:230:32 + --> $DIR/bad-reg.rs:254:32 | LL | asm!("", out("f15") _, out("vs15") _); | ------------ ^^^^^^^^^^^^^ register `vs15` @@ -317,7 +317,7 @@ LL | asm!("", out("f15") _, out("vs15") _); | register `f15` error: register `vs16` conflicts with register `f16` - --> $DIR/bad-reg.rs:232:32 + --> $DIR/bad-reg.rs:256:32 | LL | asm!("", out("f16") _, out("vs16") _); | ------------ ^^^^^^^^^^^^^ register `vs16` @@ -325,7 +325,7 @@ LL | asm!("", out("f16") _, out("vs16") _); | register `f16` error: register `vs17` conflicts with register `f17` - --> $DIR/bad-reg.rs:234:32 + --> $DIR/bad-reg.rs:258:32 | LL | asm!("", out("f17") _, out("vs17") _); | ------------ ^^^^^^^^^^^^^ register `vs17` @@ -333,7 +333,7 @@ LL | asm!("", out("f17") _, out("vs17") _); | register `f17` error: register `vs18` conflicts with register `f18` - --> $DIR/bad-reg.rs:236:32 + --> $DIR/bad-reg.rs:260:32 | LL | asm!("", out("f18") _, out("vs18") _); | ------------ ^^^^^^^^^^^^^ register `vs18` @@ -341,7 +341,7 @@ LL | asm!("", out("f18") _, out("vs18") _); | register `f18` error: register `vs19` conflicts with register `f19` - --> $DIR/bad-reg.rs:238:32 + --> $DIR/bad-reg.rs:262:32 | LL | asm!("", out("f19") _, out("vs19") _); | ------------ ^^^^^^^^^^^^^ register `vs19` @@ -349,7 +349,7 @@ LL | asm!("", out("f19") _, out("vs19") _); | register `f19` error: register `vs20` conflicts with register `f20` - --> $DIR/bad-reg.rs:240:32 + --> $DIR/bad-reg.rs:264:32 | LL | asm!("", out("f20") _, out("vs20") _); | ------------ ^^^^^^^^^^^^^ register `vs20` @@ -357,7 +357,7 @@ LL | asm!("", out("f20") _, out("vs20") _); | register `f20` error: register `vs21` conflicts with register `f21` - --> $DIR/bad-reg.rs:242:32 + --> $DIR/bad-reg.rs:266:32 | LL | asm!("", out("f21") _, out("vs21") _); | ------------ ^^^^^^^^^^^^^ register `vs21` @@ -365,7 +365,7 @@ LL | asm!("", out("f21") _, out("vs21") _); | register `f21` error: register `vs22` conflicts with register `f22` - --> $DIR/bad-reg.rs:244:32 + --> $DIR/bad-reg.rs:268:32 | LL | asm!("", out("f22") _, out("vs22") _); | ------------ ^^^^^^^^^^^^^ register `vs22` @@ -373,7 +373,7 @@ LL | asm!("", out("f22") _, out("vs22") _); | register `f22` error: register `vs23` conflicts with register `f23` - --> $DIR/bad-reg.rs:246:32 + --> $DIR/bad-reg.rs:270:32 | LL | asm!("", out("f23") _, out("vs23") _); | ------------ ^^^^^^^^^^^^^ register `vs23` @@ -381,7 +381,7 @@ LL | asm!("", out("f23") _, out("vs23") _); | register `f23` error: register `vs24` conflicts with register `f24` - --> $DIR/bad-reg.rs:248:32 + --> $DIR/bad-reg.rs:272:32 | LL | asm!("", out("f24") _, out("vs24") _); | ------------ ^^^^^^^^^^^^^ register `vs24` @@ -389,7 +389,7 @@ LL | asm!("", out("f24") _, out("vs24") _); | register `f24` error: register `vs25` conflicts with register `f25` - --> $DIR/bad-reg.rs:250:32 + --> $DIR/bad-reg.rs:274:32 | LL | asm!("", out("f25") _, out("vs25") _); | ------------ ^^^^^^^^^^^^^ register `vs25` @@ -397,7 +397,7 @@ LL | asm!("", out("f25") _, out("vs25") _); | register `f25` error: register `vs26` conflicts with register `f26` - --> $DIR/bad-reg.rs:252:32 + --> $DIR/bad-reg.rs:276:32 | LL | asm!("", out("f26") _, out("vs26") _); | ------------ ^^^^^^^^^^^^^ register `vs26` @@ -405,7 +405,7 @@ LL | asm!("", out("f26") _, out("vs26") _); | register `f26` error: register `vs27` conflicts with register `f27` - --> $DIR/bad-reg.rs:254:32 + --> $DIR/bad-reg.rs:278:32 | LL | asm!("", out("f27") _, out("vs27") _); | ------------ ^^^^^^^^^^^^^ register `vs27` @@ -413,7 +413,7 @@ LL | asm!("", out("f27") _, out("vs27") _); | register `f27` error: register `vs28` conflicts with register `f28` - --> $DIR/bad-reg.rs:256:32 + --> $DIR/bad-reg.rs:280:32 | LL | asm!("", out("f28") _, out("vs28") _); | ------------ ^^^^^^^^^^^^^ register `vs28` @@ -421,7 +421,7 @@ LL | asm!("", out("f28") _, out("vs28") _); | register `f28` error: register `vs29` conflicts with register `f29` - --> $DIR/bad-reg.rs:258:32 + --> $DIR/bad-reg.rs:282:32 | LL | asm!("", out("f29") _, out("vs29") _); | ------------ ^^^^^^^^^^^^^ register `vs29` @@ -429,7 +429,7 @@ LL | asm!("", out("f29") _, out("vs29") _); | register `f29` error: register `vs30` conflicts with register `f30` - --> $DIR/bad-reg.rs:260:32 + --> $DIR/bad-reg.rs:284:32 | LL | asm!("", out("f30") _, out("vs30") _); | ------------ ^^^^^^^^^^^^^ register `vs30` @@ -437,7 +437,7 @@ LL | asm!("", out("f30") _, out("vs30") _); | register `f30` error: register `vs31` conflicts with register `f31` - --> $DIR/bad-reg.rs:262:32 + --> $DIR/bad-reg.rs:286:32 | LL | asm!("", out("f31") _, out("vs31") _); | ------------ ^^^^^^^^^^^^^ register `vs31` @@ -445,7 +445,7 @@ LL | asm!("", out("f31") _, out("vs31") _); | register `f31` error: register `v0` conflicts with register `vs32` - --> $DIR/bad-reg.rs:264:33 + --> $DIR/bad-reg.rs:288:33 | LL | asm!("", out("vs32") _, out("v0") _); | ------------- ^^^^^^^^^^^ register `v0` @@ -453,7 +453,7 @@ LL | asm!("", out("vs32") _, out("v0") _); | register `vs32` error: register `v1` conflicts with register `vs33` - --> $DIR/bad-reg.rs:266:33 + --> $DIR/bad-reg.rs:290:33 | LL | asm!("", out("vs33") _, out("v1") _); | ------------- ^^^^^^^^^^^ register `v1` @@ -461,7 +461,7 @@ LL | asm!("", out("vs33") _, out("v1") _); | register `vs33` error: register `v2` conflicts with register `vs34` - --> $DIR/bad-reg.rs:268:33 + --> $DIR/bad-reg.rs:292:33 | LL | asm!("", out("vs34") _, out("v2") _); | ------------- ^^^^^^^^^^^ register `v2` @@ -469,7 +469,7 @@ LL | asm!("", out("vs34") _, out("v2") _); | register `vs34` error: register `v3` conflicts with register `vs35` - --> $DIR/bad-reg.rs:270:33 + --> $DIR/bad-reg.rs:294:33 | LL | asm!("", out("vs35") _, out("v3") _); | ------------- ^^^^^^^^^^^ register `v3` @@ -477,7 +477,7 @@ LL | asm!("", out("vs35") _, out("v3") _); | register `vs35` error: register `v4` conflicts with register `vs36` - --> $DIR/bad-reg.rs:272:33 + --> $DIR/bad-reg.rs:296:33 | LL | asm!("", out("vs36") _, out("v4") _); | ------------- ^^^^^^^^^^^ register `v4` @@ -485,7 +485,7 @@ LL | asm!("", out("vs36") _, out("v4") _); | register `vs36` error: register `v5` conflicts with register `vs37` - --> $DIR/bad-reg.rs:274:33 + --> $DIR/bad-reg.rs:298:33 | LL | asm!("", out("vs37") _, out("v5") _); | ------------- ^^^^^^^^^^^ register `v5` @@ -493,7 +493,7 @@ LL | asm!("", out("vs37") _, out("v5") _); | register `vs37` error: register `v6` conflicts with register `vs38` - --> $DIR/bad-reg.rs:276:33 + --> $DIR/bad-reg.rs:300:33 | LL | asm!("", out("vs38") _, out("v6") _); | ------------- ^^^^^^^^^^^ register `v6` @@ -501,7 +501,7 @@ LL | asm!("", out("vs38") _, out("v6") _); | register `vs38` error: register `v7` conflicts with register `vs39` - --> $DIR/bad-reg.rs:278:33 + --> $DIR/bad-reg.rs:302:33 | LL | asm!("", out("vs39") _, out("v7") _); | ------------- ^^^^^^^^^^^ register `v7` @@ -509,7 +509,7 @@ LL | asm!("", out("vs39") _, out("v7") _); | register `vs39` error: register `v8` conflicts with register `vs40` - --> $DIR/bad-reg.rs:280:33 + --> $DIR/bad-reg.rs:304:33 | LL | asm!("", out("vs40") _, out("v8") _); | ------------- ^^^^^^^^^^^ register `v8` @@ -517,7 +517,7 @@ LL | asm!("", out("vs40") _, out("v8") _); | register `vs40` error: register `v9` conflicts with register `vs41` - --> $DIR/bad-reg.rs:282:33 + --> $DIR/bad-reg.rs:306:33 | LL | asm!("", out("vs41") _, out("v9") _); | ------------- ^^^^^^^^^^^ register `v9` @@ -525,7 +525,7 @@ LL | asm!("", out("vs41") _, out("v9") _); | register `vs41` error: register `v10` conflicts with register `vs42` - --> $DIR/bad-reg.rs:284:33 + --> $DIR/bad-reg.rs:308:33 | LL | asm!("", out("vs42") _, out("v10") _); | ------------- ^^^^^^^^^^^^ register `v10` @@ -533,7 +533,7 @@ LL | asm!("", out("vs42") _, out("v10") _); | register `vs42` error: register `v11` conflicts with register `vs43` - --> $DIR/bad-reg.rs:286:33 + --> $DIR/bad-reg.rs:310:33 | LL | asm!("", out("vs43") _, out("v11") _); | ------------- ^^^^^^^^^^^^ register `v11` @@ -541,7 +541,7 @@ LL | asm!("", out("vs43") _, out("v11") _); | register `vs43` error: register `v12` conflicts with register `vs44` - --> $DIR/bad-reg.rs:288:33 + --> $DIR/bad-reg.rs:312:33 | LL | asm!("", out("vs44") _, out("v12") _); | ------------- ^^^^^^^^^^^^ register `v12` @@ -549,7 +549,7 @@ LL | asm!("", out("vs44") _, out("v12") _); | register `vs44` error: register `v13` conflicts with register `vs45` - --> $DIR/bad-reg.rs:290:33 + --> $DIR/bad-reg.rs:314:33 | LL | asm!("", out("vs45") _, out("v13") _); | ------------- ^^^^^^^^^^^^ register `v13` @@ -557,7 +557,7 @@ LL | asm!("", out("vs45") _, out("v13") _); | register `vs45` error: register `v14` conflicts with register `vs46` - --> $DIR/bad-reg.rs:292:33 + --> $DIR/bad-reg.rs:316:33 | LL | asm!("", out("vs46") _, out("v14") _); | ------------- ^^^^^^^^^^^^ register `v14` @@ -565,7 +565,7 @@ LL | asm!("", out("vs46") _, out("v14") _); | register `vs46` error: register `v15` conflicts with register `vs47` - --> $DIR/bad-reg.rs:294:33 + --> $DIR/bad-reg.rs:318:33 | LL | asm!("", out("vs47") _, out("v15") _); | ------------- ^^^^^^^^^^^^ register `v15` @@ -573,7 +573,7 @@ LL | asm!("", out("vs47") _, out("v15") _); | register `vs47` error: register `v16` conflicts with register `vs48` - --> $DIR/bad-reg.rs:296:33 + --> $DIR/bad-reg.rs:320:33 | LL | asm!("", out("vs48") _, out("v16") _); | ------------- ^^^^^^^^^^^^ register `v16` @@ -581,7 +581,7 @@ LL | asm!("", out("vs48") _, out("v16") _); | register `vs48` error: register `v17` conflicts with register `vs49` - --> $DIR/bad-reg.rs:298:33 + --> $DIR/bad-reg.rs:322:33 | LL | asm!("", out("vs49") _, out("v17") _); | ------------- ^^^^^^^^^^^^ register `v17` @@ -589,7 +589,7 @@ LL | asm!("", out("vs49") _, out("v17") _); | register `vs49` error: register `v18` conflicts with register `vs50` - --> $DIR/bad-reg.rs:300:33 + --> $DIR/bad-reg.rs:324:33 | LL | asm!("", out("vs50") _, out("v18") _); | ------------- ^^^^^^^^^^^^ register `v18` @@ -597,7 +597,7 @@ LL | asm!("", out("vs50") _, out("v18") _); | register `vs50` error: register `v19` conflicts with register `vs51` - --> $DIR/bad-reg.rs:302:33 + --> $DIR/bad-reg.rs:326:33 | LL | asm!("", out("vs51") _, out("v19") _); | ------------- ^^^^^^^^^^^^ register `v19` @@ -605,7 +605,7 @@ LL | asm!("", out("vs51") _, out("v19") _); | register `vs51` error: register `v20` conflicts with register `vs52` - --> $DIR/bad-reg.rs:304:33 + --> $DIR/bad-reg.rs:328:33 | LL | asm!("", out("vs52") _, out("v20") _); | ------------- ^^^^^^^^^^^^ register `v20` @@ -613,7 +613,7 @@ LL | asm!("", out("vs52") _, out("v20") _); | register `vs52` error: register `v21` conflicts with register `vs53` - --> $DIR/bad-reg.rs:306:33 + --> $DIR/bad-reg.rs:332:33 | LL | asm!("", out("vs53") _, out("v21") _); | ------------- ^^^^^^^^^^^^ register `v21` @@ -621,7 +621,7 @@ LL | asm!("", out("vs53") _, out("v21") _); | register `vs53` error: register `v22` conflicts with register `vs54` - --> $DIR/bad-reg.rs:308:33 + --> $DIR/bad-reg.rs:336:33 | LL | asm!("", out("vs54") _, out("v22") _); | ------------- ^^^^^^^^^^^^ register `v22` @@ -629,7 +629,7 @@ LL | asm!("", out("vs54") _, out("v22") _); | register `vs54` error: register `v23` conflicts with register `vs55` - --> $DIR/bad-reg.rs:310:33 + --> $DIR/bad-reg.rs:340:33 | LL | asm!("", out("vs55") _, out("v23") _); | ------------- ^^^^^^^^^^^^ register `v23` @@ -637,7 +637,7 @@ LL | asm!("", out("vs55") _, out("v23") _); | register `vs55` error: register `v24` conflicts with register `vs56` - --> $DIR/bad-reg.rs:312:33 + --> $DIR/bad-reg.rs:344:33 | LL | asm!("", out("vs56") _, out("v24") _); | ------------- ^^^^^^^^^^^^ register `v24` @@ -645,7 +645,7 @@ LL | asm!("", out("vs56") _, out("v24") _); | register `vs56` error: register `v25` conflicts with register `vs57` - --> $DIR/bad-reg.rs:314:33 + --> $DIR/bad-reg.rs:348:33 | LL | asm!("", out("vs57") _, out("v25") _); | ------------- ^^^^^^^^^^^^ register `v25` @@ -653,7 +653,7 @@ LL | asm!("", out("vs57") _, out("v25") _); | register `vs57` error: register `v26` conflicts with register `vs58` - --> $DIR/bad-reg.rs:316:33 + --> $DIR/bad-reg.rs:352:33 | LL | asm!("", out("vs58") _, out("v26") _); | ------------- ^^^^^^^^^^^^ register `v26` @@ -661,7 +661,7 @@ LL | asm!("", out("vs58") _, out("v26") _); | register `vs58` error: register `v27` conflicts with register `vs59` - --> $DIR/bad-reg.rs:318:33 + --> $DIR/bad-reg.rs:356:33 | LL | asm!("", out("vs59") _, out("v27") _); | ------------- ^^^^^^^^^^^^ register `v27` @@ -669,7 +669,7 @@ LL | asm!("", out("vs59") _, out("v27") _); | register `vs59` error: register `v28` conflicts with register `vs60` - --> $DIR/bad-reg.rs:320:33 + --> $DIR/bad-reg.rs:360:33 | LL | asm!("", out("vs60") _, out("v28") _); | ------------- ^^^^^^^^^^^^ register `v28` @@ -677,7 +677,7 @@ LL | asm!("", out("vs60") _, out("v28") _); | register `vs60` error: register `v29` conflicts with register `vs61` - --> $DIR/bad-reg.rs:322:33 + --> $DIR/bad-reg.rs:364:33 | LL | asm!("", out("vs61") _, out("v29") _); | ------------- ^^^^^^^^^^^^ register `v29` @@ -685,7 +685,7 @@ LL | asm!("", out("vs61") _, out("v29") _); | register `vs61` error: register `v30` conflicts with register `vs62` - --> $DIR/bad-reg.rs:324:33 + --> $DIR/bad-reg.rs:368:33 | LL | asm!("", out("vs62") _, out("v30") _); | ------------- ^^^^^^^^^^^^ register `v30` @@ -693,7 +693,7 @@ LL | asm!("", out("vs62") _, out("v30") _); | register `vs62` error: register `v31` conflicts with register `vs63` - --> $DIR/bad-reg.rs:326:33 + --> $DIR/bad-reg.rs:372:33 | LL | asm!("", out("vs63") _, out("v31") _); | ------------- ^^^^^^^^^^^^ register `v31` @@ -701,7 +701,7 @@ LL | asm!("", out("vs63") _, out("v31") _); | register `vs63` error: register class `spe_acc` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:332:26 + --> $DIR/bad-reg.rs:380:26 | LL | asm!("/* {} */", out(spe_acc) _); | ^^^^^^^^^^^^^^ @@ -736,8 +736,80 @@ LL | asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is avai | = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f16, f32, f64, f128, i64x2, f16x8, f64x2 +error: cannot use register `v20`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:75:18 + | +LL | asm!("", out("v20") _); + | ^^^^^^^^^^^^ + +error: cannot use register `v21`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:77:18 + | +LL | asm!("", out("v21") _); + | ^^^^^^^^^^^^ + +error: cannot use register `v22`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:79:18 + | +LL | asm!("", out("v22") _); + | ^^^^^^^^^^^^ + +error: cannot use register `v23`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:81:18 + | +LL | asm!("", out("v23") _); + | ^^^^^^^^^^^^ + +error: cannot use register `v24`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:83:18 + | +LL | asm!("", out("v24") _); + | ^^^^^^^^^^^^ + +error: cannot use register `v25`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:85:18 + | +LL | asm!("", out("v25") _); + | ^^^^^^^^^^^^ + +error: cannot use register `v26`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:87:18 + | +LL | asm!("", out("v26") _); + | ^^^^^^^^^^^^ + +error: cannot use register `v27`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:89:18 + | +LL | asm!("", out("v27") _); + | ^^^^^^^^^^^^ + +error: cannot use register `v28`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:91:18 + | +LL | asm!("", out("v28") _); + | ^^^^^^^^^^^^ + +error: cannot use register `v29`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:93:18 + | +LL | asm!("", out("v29") _); + | ^^^^^^^^^^^^ + +error: cannot use register `v30`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:95:18 + | +LL | asm!("", out("v30") _); + | ^^^^^^^^^^^^ + +error: cannot use register `v31`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:97:18 + | +LL | asm!("", out("v31") _); + | ^^^^^^^^^^^^ + error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:98:28 + --> $DIR/bad-reg.rs:110:28 | LL | asm!("", in("vs0") x); // FIXME: should be ok if vsx is available | ^ @@ -745,7 +817,7 @@ LL | asm!("", in("vs0") x); // FIXME: should be ok if vsx is available = note: register class `vsreg` supports these types: f16, f32, f64, f128, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2 error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:101:29 + --> $DIR/bad-reg.rs:113:29 | LL | asm!("", out("vs0") x); // FIXME: should be ok if vsx is available | ^ @@ -753,15 +825,87 @@ LL | asm!("", out("vs0") x); // FIXME: should be ok if vsx is available = note: register class `vsreg` supports these types: f16, f32, f64, f128, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2 error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:108:36 + --> $DIR/bad-reg.rs:120:36 | LL | asm!("/* {} */", in(vsreg) x); // FIXME: should be ok if vsx is available | ^ | = note: register class `vsreg` supports these types: f16, f32, f64, f128, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2 +error: cannot use register `vs52`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:127:18 + | +LL | asm!("", out("vs52") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `vs53`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:129:18 + | +LL | asm!("", out("vs53") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `vs54`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:131:18 + | +LL | asm!("", out("vs54") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `vs55`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:133:18 + | +LL | asm!("", out("vs55") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `vs56`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:135:18 + | +LL | asm!("", out("vs56") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `vs57`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:137:18 + | +LL | asm!("", out("vs57") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `vs58`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:139:18 + | +LL | asm!("", out("vs58") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `vs59`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:141:18 + | +LL | asm!("", out("vs59") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `vs60`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:143:18 + | +LL | asm!("", out("vs60") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `vs61`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:145:18 + | +LL | asm!("", out("vs61") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `vs62`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:147:18 + | +LL | asm!("", out("vs62") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `vs63`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:149:18 + | +LL | asm!("", out("vs63") _); + | ^^^^^^^^^^^^^ + error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:131:27 + --> $DIR/bad-reg.rs:155:27 | LL | asm!("", in("cr") x); | ^ @@ -769,7 +913,7 @@ LL | asm!("", in("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:134:28 + --> $DIR/bad-reg.rs:158:28 | LL | asm!("", out("cr") x); | ^ @@ -777,7 +921,7 @@ LL | asm!("", out("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:137:33 + --> $DIR/bad-reg.rs:161:33 | LL | asm!("/* {} */", in(cr) x); | ^ @@ -785,7 +929,7 @@ LL | asm!("/* {} */", in(cr) x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:144:28 + --> $DIR/bad-reg.rs:168:28 | LL | asm!("", in("ctr") x); | ^ @@ -793,7 +937,7 @@ LL | asm!("", in("ctr") x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:147:29 + --> $DIR/bad-reg.rs:171:29 | LL | asm!("", out("ctr") x); | ^ @@ -801,7 +945,7 @@ LL | asm!("", out("ctr") x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:150:34 + --> $DIR/bad-reg.rs:174:34 | LL | asm!("/* {} */", in(ctr) x); | ^ @@ -809,7 +953,7 @@ LL | asm!("/* {} */", in(ctr) x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:157:27 + --> $DIR/bad-reg.rs:181:27 | LL | asm!("", in("lr") x); | ^ @@ -817,7 +961,7 @@ LL | asm!("", in("lr") x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:160:28 + --> $DIR/bad-reg.rs:184:28 | LL | asm!("", out("lr") x); | ^ @@ -825,7 +969,7 @@ LL | asm!("", out("lr") x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:163:33 + --> $DIR/bad-reg.rs:187:33 | LL | asm!("/* {} */", in(lr) x); | ^ @@ -833,7 +977,7 @@ LL | asm!("/* {} */", in(lr) x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:170:28 + --> $DIR/bad-reg.rs:194:28 | LL | asm!("", in("xer") x); | ^ @@ -841,7 +985,7 @@ LL | asm!("", in("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:173:29 + --> $DIR/bad-reg.rs:197:29 | LL | asm!("", out("xer") x); | ^ @@ -849,18 +993,162 @@ LL | asm!("", out("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:176:34 + --> $DIR/bad-reg.rs:200:34 | LL | asm!("/* {} */", in(xer) x); | ^ | = note: register class `xer` supports these types: +error: cannot use register `vs52`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:328:18 + | +LL | asm!("", out("vs52") _, out("v20") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v20`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:328:33 + | +LL | asm!("", out("vs52") _, out("v20") _); + | ^^^^^^^^^^^^ + +error: cannot use register `vs53`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:332:18 + | +LL | asm!("", out("vs53") _, out("v21") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v21`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:332:33 + | +LL | asm!("", out("vs53") _, out("v21") _); + | ^^^^^^^^^^^^ + +error: cannot use register `vs54`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:336:18 + | +LL | asm!("", out("vs54") _, out("v22") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v22`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:336:33 + | +LL | asm!("", out("vs54") _, out("v22") _); + | ^^^^^^^^^^^^ + +error: cannot use register `vs55`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:340:18 + | +LL | asm!("", out("vs55") _, out("v23") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v23`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:340:33 + | +LL | asm!("", out("vs55") _, out("v23") _); + | ^^^^^^^^^^^^ + +error: cannot use register `vs56`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:344:18 + | +LL | asm!("", out("vs56") _, out("v24") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v24`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:344:33 + | +LL | asm!("", out("vs56") _, out("v24") _); + | ^^^^^^^^^^^^ + +error: cannot use register `vs57`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:348:18 + | +LL | asm!("", out("vs57") _, out("v25") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v25`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:348:33 + | +LL | asm!("", out("vs57") _, out("v25") _); + | ^^^^^^^^^^^^ + +error: cannot use register `vs58`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:352:18 + | +LL | asm!("", out("vs58") _, out("v26") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v26`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:352:33 + | +LL | asm!("", out("vs58") _, out("v26") _); + | ^^^^^^^^^^^^ + +error: cannot use register `vs59`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:356:18 + | +LL | asm!("", out("vs59") _, out("v27") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v27`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:356:33 + | +LL | asm!("", out("vs59") _, out("v27") _); + | ^^^^^^^^^^^^ + +error: cannot use register `vs60`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:360:18 + | +LL | asm!("", out("vs60") _, out("v28") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v28`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:360:33 + | +LL | asm!("", out("vs60") _, out("v28") _); + | ^^^^^^^^^^^^ + +error: cannot use register `vs61`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:364:18 + | +LL | asm!("", out("vs61") _, out("v29") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v29`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:364:33 + | +LL | asm!("", out("vs61") _, out("v29") _); + | ^^^^^^^^^^^^ + +error: cannot use register `vs62`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:368:18 + | +LL | asm!("", out("vs62") _, out("v30") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v30`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:368:33 + | +LL | asm!("", out("vs62") _, out("v30") _); + | ^^^^^^^^^^^^ + +error: cannot use register `vs63`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:372:18 + | +LL | asm!("", out("vs63") _, out("v31") _); + | ^^^^^^^^^^^^^ + +error: cannot use register `v31`: v20-v31 (vs52-vs63) are reserved on vec-default ABI + --> $DIR/bad-reg.rs:372:33 + | +LL | asm!("", out("vs63") _, out("v31") _); + | ^^^^^^^^^^^^ + error: cannot use register `spe_acc`: spe_acc is only available on spe targets - --> $DIR/bad-reg.rs:330:18 + --> $DIR/bad-reg.rs:378:18 | LL | asm!("", out("spe_acc") _); | ^^^^^^^^^^^^^^^^ -error: aborting due to 114 previous errors +error: aborting due to 162 previous errors diff --git a/tests/ui/asm/powerpc/bad-reg.powerpc.stderr b/tests/ui/asm/powerpc/bad-reg.powerpc.stderr index 88a8cecf40550..1c81299a968fa 100644 --- a/tests/ui/asm/powerpc/bad-reg.powerpc.stderr +++ b/tests/ui/asm/powerpc/bad-reg.powerpc.stderr @@ -29,103 +29,103 @@ LL | asm!("", out("vrsave") _); | ^^^^^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:131:18 + --> $DIR/bad-reg.rs:155:18 | LL | asm!("", in("cr") x); | ^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:134:18 + --> $DIR/bad-reg.rs:158:18 | LL | asm!("", out("cr") x); | ^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:137:26 + --> $DIR/bad-reg.rs:161:26 | LL | asm!("/* {} */", in(cr) x); | ^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:140:26 + --> $DIR/bad-reg.rs:164:26 | LL | asm!("/* {} */", out(cr) _); | ^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:144:18 + --> $DIR/bad-reg.rs:168:18 | LL | asm!("", in("ctr") x); | ^^^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:147:18 + --> $DIR/bad-reg.rs:171:18 | LL | asm!("", out("ctr") x); | ^^^^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:150:26 + --> $DIR/bad-reg.rs:174:26 | LL | asm!("/* {} */", in(ctr) x); | ^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:153:26 + --> $DIR/bad-reg.rs:177:26 | LL | asm!("/* {} */", out(ctr) _); | ^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:157:18 + --> $DIR/bad-reg.rs:181:18 | LL | asm!("", in("lr") x); | ^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:160:18 + --> $DIR/bad-reg.rs:184:18 | LL | asm!("", out("lr") x); | ^^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:163:26 + --> $DIR/bad-reg.rs:187:26 | LL | asm!("/* {} */", in(lr) x); | ^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:166:26 + --> $DIR/bad-reg.rs:190:26 | LL | asm!("/* {} */", out(lr) _); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:170:18 + --> $DIR/bad-reg.rs:194:18 | LL | asm!("", in("xer") x); | ^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:173:18 + --> $DIR/bad-reg.rs:197:18 | LL | asm!("", out("xer") x); | ^^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:176:26 + --> $DIR/bad-reg.rs:200:26 | LL | asm!("/* {} */", in(xer) x); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:179:26 + --> $DIR/bad-reg.rs:203:26 | LL | asm!("/* {} */", out(xer) _); | ^^^^^^^^^^ error: register `cr0` conflicts with register `cr` - --> $DIR/bad-reg.rs:183:31 + --> $DIR/bad-reg.rs:207:31 | LL | asm!("", out("cr") _, out("cr0") _); | ----------- ^^^^^^^^^^^^ register `cr0` @@ -133,7 +133,7 @@ LL | asm!("", out("cr") _, out("cr0") _); | register `cr` error: register `cr1` conflicts with register `cr` - --> $DIR/bad-reg.rs:185:31 + --> $DIR/bad-reg.rs:209:31 | LL | asm!("", out("cr") _, out("cr1") _); | ----------- ^^^^^^^^^^^^ register `cr1` @@ -141,7 +141,7 @@ LL | asm!("", out("cr") _, out("cr1") _); | register `cr` error: register `cr2` conflicts with register `cr` - --> $DIR/bad-reg.rs:187:31 + --> $DIR/bad-reg.rs:211:31 | LL | asm!("", out("cr") _, out("cr2") _); | ----------- ^^^^^^^^^^^^ register `cr2` @@ -149,7 +149,7 @@ LL | asm!("", out("cr") _, out("cr2") _); | register `cr` error: register `cr3` conflicts with register `cr` - --> $DIR/bad-reg.rs:189:31 + --> $DIR/bad-reg.rs:213:31 | LL | asm!("", out("cr") _, out("cr3") _); | ----------- ^^^^^^^^^^^^ register `cr3` @@ -157,7 +157,7 @@ LL | asm!("", out("cr") _, out("cr3") _); | register `cr` error: register `cr4` conflicts with register `cr` - --> $DIR/bad-reg.rs:191:31 + --> $DIR/bad-reg.rs:215:31 | LL | asm!("", out("cr") _, out("cr4") _); | ----------- ^^^^^^^^^^^^ register `cr4` @@ -165,7 +165,7 @@ LL | asm!("", out("cr") _, out("cr4") _); | register `cr` error: register `cr5` conflicts with register `cr` - --> $DIR/bad-reg.rs:193:31 + --> $DIR/bad-reg.rs:217:31 | LL | asm!("", out("cr") _, out("cr5") _); | ----------- ^^^^^^^^^^^^ register `cr5` @@ -173,7 +173,7 @@ LL | asm!("", out("cr") _, out("cr5") _); | register `cr` error: register `cr6` conflicts with register `cr` - --> $DIR/bad-reg.rs:195:31 + --> $DIR/bad-reg.rs:219:31 | LL | asm!("", out("cr") _, out("cr6") _); | ----------- ^^^^^^^^^^^^ register `cr6` @@ -181,7 +181,7 @@ LL | asm!("", out("cr") _, out("cr6") _); | register `cr` error: register `cr7` conflicts with register `cr` - --> $DIR/bad-reg.rs:197:31 + --> $DIR/bad-reg.rs:221:31 | LL | asm!("", out("cr") _, out("cr7") _); | ----------- ^^^^^^^^^^^^ register `cr7` @@ -189,7 +189,7 @@ LL | asm!("", out("cr") _, out("cr7") _); | register `cr` error: register `vs0` conflicts with register `f0` - --> $DIR/bad-reg.rs:200:31 + --> $DIR/bad-reg.rs:224:31 | LL | asm!("", out("f0") _, out("vs0") _); | ----------- ^^^^^^^^^^^^ register `vs0` @@ -197,7 +197,7 @@ LL | asm!("", out("f0") _, out("vs0") _); | register `f0` error: register `vs1` conflicts with register `f1` - --> $DIR/bad-reg.rs:202:31 + --> $DIR/bad-reg.rs:226:31 | LL | asm!("", out("f1") _, out("vs1") _); | ----------- ^^^^^^^^^^^^ register `vs1` @@ -205,7 +205,7 @@ LL | asm!("", out("f1") _, out("vs1") _); | register `f1` error: register `vs2` conflicts with register `f2` - --> $DIR/bad-reg.rs:204:31 + --> $DIR/bad-reg.rs:228:31 | LL | asm!("", out("f2") _, out("vs2") _); | ----------- ^^^^^^^^^^^^ register `vs2` @@ -213,7 +213,7 @@ LL | asm!("", out("f2") _, out("vs2") _); | register `f2` error: register `vs3` conflicts with register `f3` - --> $DIR/bad-reg.rs:206:31 + --> $DIR/bad-reg.rs:230:31 | LL | asm!("", out("f3") _, out("vs3") _); | ----------- ^^^^^^^^^^^^ register `vs3` @@ -221,7 +221,7 @@ LL | asm!("", out("f3") _, out("vs3") _); | register `f3` error: register `vs4` conflicts with register `f4` - --> $DIR/bad-reg.rs:208:31 + --> $DIR/bad-reg.rs:232:31 | LL | asm!("", out("f4") _, out("vs4") _); | ----------- ^^^^^^^^^^^^ register `vs4` @@ -229,7 +229,7 @@ LL | asm!("", out("f4") _, out("vs4") _); | register `f4` error: register `vs5` conflicts with register `f5` - --> $DIR/bad-reg.rs:210:31 + --> $DIR/bad-reg.rs:234:31 | LL | asm!("", out("f5") _, out("vs5") _); | ----------- ^^^^^^^^^^^^ register `vs5` @@ -237,7 +237,7 @@ LL | asm!("", out("f5") _, out("vs5") _); | register `f5` error: register `vs6` conflicts with register `f6` - --> $DIR/bad-reg.rs:212:31 + --> $DIR/bad-reg.rs:236:31 | LL | asm!("", out("f6") _, out("vs6") _); | ----------- ^^^^^^^^^^^^ register `vs6` @@ -245,7 +245,7 @@ LL | asm!("", out("f6") _, out("vs6") _); | register `f6` error: register `vs7` conflicts with register `f7` - --> $DIR/bad-reg.rs:214:31 + --> $DIR/bad-reg.rs:238:31 | LL | asm!("", out("f7") _, out("vs7") _); | ----------- ^^^^^^^^^^^^ register `vs7` @@ -253,7 +253,7 @@ LL | asm!("", out("f7") _, out("vs7") _); | register `f7` error: register `vs8` conflicts with register `f8` - --> $DIR/bad-reg.rs:216:31 + --> $DIR/bad-reg.rs:240:31 | LL | asm!("", out("f8") _, out("vs8") _); | ----------- ^^^^^^^^^^^^ register `vs8` @@ -261,7 +261,7 @@ LL | asm!("", out("f8") _, out("vs8") _); | register `f8` error: register `vs9` conflicts with register `f9` - --> $DIR/bad-reg.rs:218:31 + --> $DIR/bad-reg.rs:242:31 | LL | asm!("", out("f9") _, out("vs9") _); | ----------- ^^^^^^^^^^^^ register `vs9` @@ -269,7 +269,7 @@ LL | asm!("", out("f9") _, out("vs9") _); | register `f9` error: register `vs10` conflicts with register `f10` - --> $DIR/bad-reg.rs:220:32 + --> $DIR/bad-reg.rs:244:32 | LL | asm!("", out("f10") _, out("vs10") _); | ------------ ^^^^^^^^^^^^^ register `vs10` @@ -277,7 +277,7 @@ LL | asm!("", out("f10") _, out("vs10") _); | register `f10` error: register `vs11` conflicts with register `f11` - --> $DIR/bad-reg.rs:222:32 + --> $DIR/bad-reg.rs:246:32 | LL | asm!("", out("f11") _, out("vs11") _); | ------------ ^^^^^^^^^^^^^ register `vs11` @@ -285,7 +285,7 @@ LL | asm!("", out("f11") _, out("vs11") _); | register `f11` error: register `vs12` conflicts with register `f12` - --> $DIR/bad-reg.rs:224:32 + --> $DIR/bad-reg.rs:248:32 | LL | asm!("", out("f12") _, out("vs12") _); | ------------ ^^^^^^^^^^^^^ register `vs12` @@ -293,7 +293,7 @@ LL | asm!("", out("f12") _, out("vs12") _); | register `f12` error: register `vs13` conflicts with register `f13` - --> $DIR/bad-reg.rs:226:32 + --> $DIR/bad-reg.rs:250:32 | LL | asm!("", out("f13") _, out("vs13") _); | ------------ ^^^^^^^^^^^^^ register `vs13` @@ -301,7 +301,7 @@ LL | asm!("", out("f13") _, out("vs13") _); | register `f13` error: register `vs14` conflicts with register `f14` - --> $DIR/bad-reg.rs:228:32 + --> $DIR/bad-reg.rs:252:32 | LL | asm!("", out("f14") _, out("vs14") _); | ------------ ^^^^^^^^^^^^^ register `vs14` @@ -309,7 +309,7 @@ LL | asm!("", out("f14") _, out("vs14") _); | register `f14` error: register `vs15` conflicts with register `f15` - --> $DIR/bad-reg.rs:230:32 + --> $DIR/bad-reg.rs:254:32 | LL | asm!("", out("f15") _, out("vs15") _); | ------------ ^^^^^^^^^^^^^ register `vs15` @@ -317,7 +317,7 @@ LL | asm!("", out("f15") _, out("vs15") _); | register `f15` error: register `vs16` conflicts with register `f16` - --> $DIR/bad-reg.rs:232:32 + --> $DIR/bad-reg.rs:256:32 | LL | asm!("", out("f16") _, out("vs16") _); | ------------ ^^^^^^^^^^^^^ register `vs16` @@ -325,7 +325,7 @@ LL | asm!("", out("f16") _, out("vs16") _); | register `f16` error: register `vs17` conflicts with register `f17` - --> $DIR/bad-reg.rs:234:32 + --> $DIR/bad-reg.rs:258:32 | LL | asm!("", out("f17") _, out("vs17") _); | ------------ ^^^^^^^^^^^^^ register `vs17` @@ -333,7 +333,7 @@ LL | asm!("", out("f17") _, out("vs17") _); | register `f17` error: register `vs18` conflicts with register `f18` - --> $DIR/bad-reg.rs:236:32 + --> $DIR/bad-reg.rs:260:32 | LL | asm!("", out("f18") _, out("vs18") _); | ------------ ^^^^^^^^^^^^^ register `vs18` @@ -341,7 +341,7 @@ LL | asm!("", out("f18") _, out("vs18") _); | register `f18` error: register `vs19` conflicts with register `f19` - --> $DIR/bad-reg.rs:238:32 + --> $DIR/bad-reg.rs:262:32 | LL | asm!("", out("f19") _, out("vs19") _); | ------------ ^^^^^^^^^^^^^ register `vs19` @@ -349,7 +349,7 @@ LL | asm!("", out("f19") _, out("vs19") _); | register `f19` error: register `vs20` conflicts with register `f20` - --> $DIR/bad-reg.rs:240:32 + --> $DIR/bad-reg.rs:264:32 | LL | asm!("", out("f20") _, out("vs20") _); | ------------ ^^^^^^^^^^^^^ register `vs20` @@ -357,7 +357,7 @@ LL | asm!("", out("f20") _, out("vs20") _); | register `f20` error: register `vs21` conflicts with register `f21` - --> $DIR/bad-reg.rs:242:32 + --> $DIR/bad-reg.rs:266:32 | LL | asm!("", out("f21") _, out("vs21") _); | ------------ ^^^^^^^^^^^^^ register `vs21` @@ -365,7 +365,7 @@ LL | asm!("", out("f21") _, out("vs21") _); | register `f21` error: register `vs22` conflicts with register `f22` - --> $DIR/bad-reg.rs:244:32 + --> $DIR/bad-reg.rs:268:32 | LL | asm!("", out("f22") _, out("vs22") _); | ------------ ^^^^^^^^^^^^^ register `vs22` @@ -373,7 +373,7 @@ LL | asm!("", out("f22") _, out("vs22") _); | register `f22` error: register `vs23` conflicts with register `f23` - --> $DIR/bad-reg.rs:246:32 + --> $DIR/bad-reg.rs:270:32 | LL | asm!("", out("f23") _, out("vs23") _); | ------------ ^^^^^^^^^^^^^ register `vs23` @@ -381,7 +381,7 @@ LL | asm!("", out("f23") _, out("vs23") _); | register `f23` error: register `vs24` conflicts with register `f24` - --> $DIR/bad-reg.rs:248:32 + --> $DIR/bad-reg.rs:272:32 | LL | asm!("", out("f24") _, out("vs24") _); | ------------ ^^^^^^^^^^^^^ register `vs24` @@ -389,7 +389,7 @@ LL | asm!("", out("f24") _, out("vs24") _); | register `f24` error: register `vs25` conflicts with register `f25` - --> $DIR/bad-reg.rs:250:32 + --> $DIR/bad-reg.rs:274:32 | LL | asm!("", out("f25") _, out("vs25") _); | ------------ ^^^^^^^^^^^^^ register `vs25` @@ -397,7 +397,7 @@ LL | asm!("", out("f25") _, out("vs25") _); | register `f25` error: register `vs26` conflicts with register `f26` - --> $DIR/bad-reg.rs:252:32 + --> $DIR/bad-reg.rs:276:32 | LL | asm!("", out("f26") _, out("vs26") _); | ------------ ^^^^^^^^^^^^^ register `vs26` @@ -405,7 +405,7 @@ LL | asm!("", out("f26") _, out("vs26") _); | register `f26` error: register `vs27` conflicts with register `f27` - --> $DIR/bad-reg.rs:254:32 + --> $DIR/bad-reg.rs:278:32 | LL | asm!("", out("f27") _, out("vs27") _); | ------------ ^^^^^^^^^^^^^ register `vs27` @@ -413,7 +413,7 @@ LL | asm!("", out("f27") _, out("vs27") _); | register `f27` error: register `vs28` conflicts with register `f28` - --> $DIR/bad-reg.rs:256:32 + --> $DIR/bad-reg.rs:280:32 | LL | asm!("", out("f28") _, out("vs28") _); | ------------ ^^^^^^^^^^^^^ register `vs28` @@ -421,7 +421,7 @@ LL | asm!("", out("f28") _, out("vs28") _); | register `f28` error: register `vs29` conflicts with register `f29` - --> $DIR/bad-reg.rs:258:32 + --> $DIR/bad-reg.rs:282:32 | LL | asm!("", out("f29") _, out("vs29") _); | ------------ ^^^^^^^^^^^^^ register `vs29` @@ -429,7 +429,7 @@ LL | asm!("", out("f29") _, out("vs29") _); | register `f29` error: register `vs30` conflicts with register `f30` - --> $DIR/bad-reg.rs:260:32 + --> $DIR/bad-reg.rs:284:32 | LL | asm!("", out("f30") _, out("vs30") _); | ------------ ^^^^^^^^^^^^^ register `vs30` @@ -437,7 +437,7 @@ LL | asm!("", out("f30") _, out("vs30") _); | register `f30` error: register `vs31` conflicts with register `f31` - --> $DIR/bad-reg.rs:262:32 + --> $DIR/bad-reg.rs:286:32 | LL | asm!("", out("f31") _, out("vs31") _); | ------------ ^^^^^^^^^^^^^ register `vs31` @@ -445,7 +445,7 @@ LL | asm!("", out("f31") _, out("vs31") _); | register `f31` error: register `v0` conflicts with register `vs32` - --> $DIR/bad-reg.rs:264:33 + --> $DIR/bad-reg.rs:288:33 | LL | asm!("", out("vs32") _, out("v0") _); | ------------- ^^^^^^^^^^^ register `v0` @@ -453,7 +453,7 @@ LL | asm!("", out("vs32") _, out("v0") _); | register `vs32` error: register `v1` conflicts with register `vs33` - --> $DIR/bad-reg.rs:266:33 + --> $DIR/bad-reg.rs:290:33 | LL | asm!("", out("vs33") _, out("v1") _); | ------------- ^^^^^^^^^^^ register `v1` @@ -461,7 +461,7 @@ LL | asm!("", out("vs33") _, out("v1") _); | register `vs33` error: register `v2` conflicts with register `vs34` - --> $DIR/bad-reg.rs:268:33 + --> $DIR/bad-reg.rs:292:33 | LL | asm!("", out("vs34") _, out("v2") _); | ------------- ^^^^^^^^^^^ register `v2` @@ -469,7 +469,7 @@ LL | asm!("", out("vs34") _, out("v2") _); | register `vs34` error: register `v3` conflicts with register `vs35` - --> $DIR/bad-reg.rs:270:33 + --> $DIR/bad-reg.rs:294:33 | LL | asm!("", out("vs35") _, out("v3") _); | ------------- ^^^^^^^^^^^ register `v3` @@ -477,7 +477,7 @@ LL | asm!("", out("vs35") _, out("v3") _); | register `vs35` error: register `v4` conflicts with register `vs36` - --> $DIR/bad-reg.rs:272:33 + --> $DIR/bad-reg.rs:296:33 | LL | asm!("", out("vs36") _, out("v4") _); | ------------- ^^^^^^^^^^^ register `v4` @@ -485,7 +485,7 @@ LL | asm!("", out("vs36") _, out("v4") _); | register `vs36` error: register `v5` conflicts with register `vs37` - --> $DIR/bad-reg.rs:274:33 + --> $DIR/bad-reg.rs:298:33 | LL | asm!("", out("vs37") _, out("v5") _); | ------------- ^^^^^^^^^^^ register `v5` @@ -493,7 +493,7 @@ LL | asm!("", out("vs37") _, out("v5") _); | register `vs37` error: register `v6` conflicts with register `vs38` - --> $DIR/bad-reg.rs:276:33 + --> $DIR/bad-reg.rs:300:33 | LL | asm!("", out("vs38") _, out("v6") _); | ------------- ^^^^^^^^^^^ register `v6` @@ -501,7 +501,7 @@ LL | asm!("", out("vs38") _, out("v6") _); | register `vs38` error: register `v7` conflicts with register `vs39` - --> $DIR/bad-reg.rs:278:33 + --> $DIR/bad-reg.rs:302:33 | LL | asm!("", out("vs39") _, out("v7") _); | ------------- ^^^^^^^^^^^ register `v7` @@ -509,7 +509,7 @@ LL | asm!("", out("vs39") _, out("v7") _); | register `vs39` error: register `v8` conflicts with register `vs40` - --> $DIR/bad-reg.rs:280:33 + --> $DIR/bad-reg.rs:304:33 | LL | asm!("", out("vs40") _, out("v8") _); | ------------- ^^^^^^^^^^^ register `v8` @@ -517,7 +517,7 @@ LL | asm!("", out("vs40") _, out("v8") _); | register `vs40` error: register `v9` conflicts with register `vs41` - --> $DIR/bad-reg.rs:282:33 + --> $DIR/bad-reg.rs:306:33 | LL | asm!("", out("vs41") _, out("v9") _); | ------------- ^^^^^^^^^^^ register `v9` @@ -525,7 +525,7 @@ LL | asm!("", out("vs41") _, out("v9") _); | register `vs41` error: register `v10` conflicts with register `vs42` - --> $DIR/bad-reg.rs:284:33 + --> $DIR/bad-reg.rs:308:33 | LL | asm!("", out("vs42") _, out("v10") _); | ------------- ^^^^^^^^^^^^ register `v10` @@ -533,7 +533,7 @@ LL | asm!("", out("vs42") _, out("v10") _); | register `vs42` error: register `v11` conflicts with register `vs43` - --> $DIR/bad-reg.rs:286:33 + --> $DIR/bad-reg.rs:310:33 | LL | asm!("", out("vs43") _, out("v11") _); | ------------- ^^^^^^^^^^^^ register `v11` @@ -541,7 +541,7 @@ LL | asm!("", out("vs43") _, out("v11") _); | register `vs43` error: register `v12` conflicts with register `vs44` - --> $DIR/bad-reg.rs:288:33 + --> $DIR/bad-reg.rs:312:33 | LL | asm!("", out("vs44") _, out("v12") _); | ------------- ^^^^^^^^^^^^ register `v12` @@ -549,7 +549,7 @@ LL | asm!("", out("vs44") _, out("v12") _); | register `vs44` error: register `v13` conflicts with register `vs45` - --> $DIR/bad-reg.rs:290:33 + --> $DIR/bad-reg.rs:314:33 | LL | asm!("", out("vs45") _, out("v13") _); | ------------- ^^^^^^^^^^^^ register `v13` @@ -557,7 +557,7 @@ LL | asm!("", out("vs45") _, out("v13") _); | register `vs45` error: register `v14` conflicts with register `vs46` - --> $DIR/bad-reg.rs:292:33 + --> $DIR/bad-reg.rs:316:33 | LL | asm!("", out("vs46") _, out("v14") _); | ------------- ^^^^^^^^^^^^ register `v14` @@ -565,7 +565,7 @@ LL | asm!("", out("vs46") _, out("v14") _); | register `vs46` error: register `v15` conflicts with register `vs47` - --> $DIR/bad-reg.rs:294:33 + --> $DIR/bad-reg.rs:318:33 | LL | asm!("", out("vs47") _, out("v15") _); | ------------- ^^^^^^^^^^^^ register `v15` @@ -573,7 +573,7 @@ LL | asm!("", out("vs47") _, out("v15") _); | register `vs47` error: register `v16` conflicts with register `vs48` - --> $DIR/bad-reg.rs:296:33 + --> $DIR/bad-reg.rs:320:33 | LL | asm!("", out("vs48") _, out("v16") _); | ------------- ^^^^^^^^^^^^ register `v16` @@ -581,7 +581,7 @@ LL | asm!("", out("vs48") _, out("v16") _); | register `vs48` error: register `v17` conflicts with register `vs49` - --> $DIR/bad-reg.rs:298:33 + --> $DIR/bad-reg.rs:322:33 | LL | asm!("", out("vs49") _, out("v17") _); | ------------- ^^^^^^^^^^^^ register `v17` @@ -589,7 +589,7 @@ LL | asm!("", out("vs49") _, out("v17") _); | register `vs49` error: register `v18` conflicts with register `vs50` - --> $DIR/bad-reg.rs:300:33 + --> $DIR/bad-reg.rs:324:33 | LL | asm!("", out("vs50") _, out("v18") _); | ------------- ^^^^^^^^^^^^ register `v18` @@ -597,7 +597,7 @@ LL | asm!("", out("vs50") _, out("v18") _); | register `vs50` error: register `v19` conflicts with register `vs51` - --> $DIR/bad-reg.rs:302:33 + --> $DIR/bad-reg.rs:326:33 | LL | asm!("", out("vs51") _, out("v19") _); | ------------- ^^^^^^^^^^^^ register `v19` @@ -605,7 +605,7 @@ LL | asm!("", out("vs51") _, out("v19") _); | register `vs51` error: register `v20` conflicts with register `vs52` - --> $DIR/bad-reg.rs:304:33 + --> $DIR/bad-reg.rs:328:33 | LL | asm!("", out("vs52") _, out("v20") _); | ------------- ^^^^^^^^^^^^ register `v20` @@ -613,7 +613,7 @@ LL | asm!("", out("vs52") _, out("v20") _); | register `vs52` error: register `v21` conflicts with register `vs53` - --> $DIR/bad-reg.rs:306:33 + --> $DIR/bad-reg.rs:332:33 | LL | asm!("", out("vs53") _, out("v21") _); | ------------- ^^^^^^^^^^^^ register `v21` @@ -621,7 +621,7 @@ LL | asm!("", out("vs53") _, out("v21") _); | register `vs53` error: register `v22` conflicts with register `vs54` - --> $DIR/bad-reg.rs:308:33 + --> $DIR/bad-reg.rs:336:33 | LL | asm!("", out("vs54") _, out("v22") _); | ------------- ^^^^^^^^^^^^ register `v22` @@ -629,7 +629,7 @@ LL | asm!("", out("vs54") _, out("v22") _); | register `vs54` error: register `v23` conflicts with register `vs55` - --> $DIR/bad-reg.rs:310:33 + --> $DIR/bad-reg.rs:340:33 | LL | asm!("", out("vs55") _, out("v23") _); | ------------- ^^^^^^^^^^^^ register `v23` @@ -637,7 +637,7 @@ LL | asm!("", out("vs55") _, out("v23") _); | register `vs55` error: register `v24` conflicts with register `vs56` - --> $DIR/bad-reg.rs:312:33 + --> $DIR/bad-reg.rs:344:33 | LL | asm!("", out("vs56") _, out("v24") _); | ------------- ^^^^^^^^^^^^ register `v24` @@ -645,7 +645,7 @@ LL | asm!("", out("vs56") _, out("v24") _); | register `vs56` error: register `v25` conflicts with register `vs57` - --> $DIR/bad-reg.rs:314:33 + --> $DIR/bad-reg.rs:348:33 | LL | asm!("", out("vs57") _, out("v25") _); | ------------- ^^^^^^^^^^^^ register `v25` @@ -653,7 +653,7 @@ LL | asm!("", out("vs57") _, out("v25") _); | register `vs57` error: register `v26` conflicts with register `vs58` - --> $DIR/bad-reg.rs:316:33 + --> $DIR/bad-reg.rs:352:33 | LL | asm!("", out("vs58") _, out("v26") _); | ------------- ^^^^^^^^^^^^ register `v26` @@ -661,7 +661,7 @@ LL | asm!("", out("vs58") _, out("v26") _); | register `vs58` error: register `v27` conflicts with register `vs59` - --> $DIR/bad-reg.rs:318:33 + --> $DIR/bad-reg.rs:356:33 | LL | asm!("", out("vs59") _, out("v27") _); | ------------- ^^^^^^^^^^^^ register `v27` @@ -669,7 +669,7 @@ LL | asm!("", out("vs59") _, out("v27") _); | register `vs59` error: register `v28` conflicts with register `vs60` - --> $DIR/bad-reg.rs:320:33 + --> $DIR/bad-reg.rs:360:33 | LL | asm!("", out("vs60") _, out("v28") _); | ------------- ^^^^^^^^^^^^ register `v28` @@ -677,7 +677,7 @@ LL | asm!("", out("vs60") _, out("v28") _); | register `vs60` error: register `v29` conflicts with register `vs61` - --> $DIR/bad-reg.rs:322:33 + --> $DIR/bad-reg.rs:364:33 | LL | asm!("", out("vs61") _, out("v29") _); | ------------- ^^^^^^^^^^^^ register `v29` @@ -685,7 +685,7 @@ LL | asm!("", out("vs61") _, out("v29") _); | register `vs61` error: register `v30` conflicts with register `vs62` - --> $DIR/bad-reg.rs:324:33 + --> $DIR/bad-reg.rs:368:33 | LL | asm!("", out("vs62") _, out("v30") _); | ------------- ^^^^^^^^^^^^ register `v30` @@ -693,7 +693,7 @@ LL | asm!("", out("vs62") _, out("v30") _); | register `vs62` error: register `v31` conflicts with register `vs63` - --> $DIR/bad-reg.rs:326:33 + --> $DIR/bad-reg.rs:372:33 | LL | asm!("", out("vs63") _, out("v31") _); | ------------- ^^^^^^^^^^^^ register `v31` @@ -701,7 +701,7 @@ LL | asm!("", out("vs63") _, out("v31") _); | register `vs63` error: register class `spe_acc` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:332:26 + --> $DIR/bad-reg.rs:380:26 | LL | asm!("/* {} */", out(spe_acc) _); | ^^^^^^^^^^^^^^ @@ -779,67 +779,67 @@ LL | asm!("/* {} */", out(vreg) _); // requires altivec | ^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:90:18 + --> $DIR/bad-reg.rs:102:18 | LL | asm!("", in("vs0") v32x4); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:92:18 + --> $DIR/bad-reg.rs:104:18 | LL | asm!("", out("vs0") v32x4); // requires vsx | ^^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:94:18 + --> $DIR/bad-reg.rs:106:18 | LL | asm!("", in("vs0") v64x2); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:96:18 + --> $DIR/bad-reg.rs:108:18 | LL | asm!("", out("vs0") v64x2); // requires vsx | ^^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:98:18 + --> $DIR/bad-reg.rs:110:18 | LL | asm!("", in("vs0") x); // FIXME: should be ok if vsx is available | ^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:101:18 + --> $DIR/bad-reg.rs:113:18 | LL | asm!("", out("vs0") x); // FIXME: should be ok if vsx is available | ^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:104:26 + --> $DIR/bad-reg.rs:116:26 | LL | asm!("/* {} */", in(vsreg) v32x4); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:106:26 + --> $DIR/bad-reg.rs:118:26 | LL | asm!("/* {} */", in(vsreg) v64x2); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:108:26 + --> $DIR/bad-reg.rs:120:26 | LL | asm!("/* {} */", in(vsreg) x); // FIXME: should be ok if vsx is available | ^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:111:26 + --> $DIR/bad-reg.rs:123:26 | LL | asm!("/* {} */", out(vsreg) _); // requires vsx | ^^^^^^^^^^^^ error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:131:27 + --> $DIR/bad-reg.rs:155:27 | LL | asm!("", in("cr") x); | ^ @@ -847,7 +847,7 @@ LL | asm!("", in("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:134:28 + --> $DIR/bad-reg.rs:158:28 | LL | asm!("", out("cr") x); | ^ @@ -855,7 +855,7 @@ LL | asm!("", out("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:137:33 + --> $DIR/bad-reg.rs:161:33 | LL | asm!("/* {} */", in(cr) x); | ^ @@ -863,7 +863,7 @@ LL | asm!("/* {} */", in(cr) x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:144:28 + --> $DIR/bad-reg.rs:168:28 | LL | asm!("", in("ctr") x); | ^ @@ -871,7 +871,7 @@ LL | asm!("", in("ctr") x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:147:29 + --> $DIR/bad-reg.rs:171:29 | LL | asm!("", out("ctr") x); | ^ @@ -879,7 +879,7 @@ LL | asm!("", out("ctr") x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:150:34 + --> $DIR/bad-reg.rs:174:34 | LL | asm!("/* {} */", in(ctr) x); | ^ @@ -887,7 +887,7 @@ LL | asm!("/* {} */", in(ctr) x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:157:27 + --> $DIR/bad-reg.rs:181:27 | LL | asm!("", in("lr") x); | ^ @@ -895,7 +895,7 @@ LL | asm!("", in("lr") x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:160:28 + --> $DIR/bad-reg.rs:184:28 | LL | asm!("", out("lr") x); | ^ @@ -903,7 +903,7 @@ LL | asm!("", out("lr") x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:163:33 + --> $DIR/bad-reg.rs:187:33 | LL | asm!("/* {} */", in(lr) x); | ^ @@ -911,7 +911,7 @@ LL | asm!("/* {} */", in(lr) x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:170:28 + --> $DIR/bad-reg.rs:194:28 | LL | asm!("", in("xer") x); | ^ @@ -919,7 +919,7 @@ LL | asm!("", in("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:173:29 + --> $DIR/bad-reg.rs:197:29 | LL | asm!("", out("xer") x); | ^ @@ -927,7 +927,7 @@ LL | asm!("", out("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:176:34 + --> $DIR/bad-reg.rs:200:34 | LL | asm!("/* {} */", in(xer) x); | ^ @@ -935,7 +935,7 @@ LL | asm!("/* {} */", in(xer) x); = note: register class `xer` supports these types: error: cannot use register `spe_acc`: spe_acc is only available on spe targets - --> $DIR/bad-reg.rs:330:18 + --> $DIR/bad-reg.rs:378:18 | LL | asm!("", out("spe_acc") _); | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr b/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr index 48306cf45ac94..505bef77f8990 100644 --- a/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr +++ b/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr @@ -29,103 +29,103 @@ LL | asm!("", out("vrsave") _); | ^^^^^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:131:18 + --> $DIR/bad-reg.rs:155:18 | LL | asm!("", in("cr") x); | ^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:134:18 + --> $DIR/bad-reg.rs:158:18 | LL | asm!("", out("cr") x); | ^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:137:26 + --> $DIR/bad-reg.rs:161:26 | LL | asm!("/* {} */", in(cr) x); | ^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:140:26 + --> $DIR/bad-reg.rs:164:26 | LL | asm!("/* {} */", out(cr) _); | ^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:144:18 + --> $DIR/bad-reg.rs:168:18 | LL | asm!("", in("ctr") x); | ^^^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:147:18 + --> $DIR/bad-reg.rs:171:18 | LL | asm!("", out("ctr") x); | ^^^^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:150:26 + --> $DIR/bad-reg.rs:174:26 | LL | asm!("/* {} */", in(ctr) x); | ^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:153:26 + --> $DIR/bad-reg.rs:177:26 | LL | asm!("/* {} */", out(ctr) _); | ^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:157:18 + --> $DIR/bad-reg.rs:181:18 | LL | asm!("", in("lr") x); | ^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:160:18 + --> $DIR/bad-reg.rs:184:18 | LL | asm!("", out("lr") x); | ^^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:163:26 + --> $DIR/bad-reg.rs:187:26 | LL | asm!("/* {} */", in(lr) x); | ^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:166:26 + --> $DIR/bad-reg.rs:190:26 | LL | asm!("/* {} */", out(lr) _); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:170:18 + --> $DIR/bad-reg.rs:194:18 | LL | asm!("", in("xer") x); | ^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:173:18 + --> $DIR/bad-reg.rs:197:18 | LL | asm!("", out("xer") x); | ^^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:176:26 + --> $DIR/bad-reg.rs:200:26 | LL | asm!("/* {} */", in(xer) x); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:179:26 + --> $DIR/bad-reg.rs:203:26 | LL | asm!("/* {} */", out(xer) _); | ^^^^^^^^^^ error: register `cr0` conflicts with register `cr` - --> $DIR/bad-reg.rs:183:31 + --> $DIR/bad-reg.rs:207:31 | LL | asm!("", out("cr") _, out("cr0") _); | ----------- ^^^^^^^^^^^^ register `cr0` @@ -133,7 +133,7 @@ LL | asm!("", out("cr") _, out("cr0") _); | register `cr` error: register `cr1` conflicts with register `cr` - --> $DIR/bad-reg.rs:185:31 + --> $DIR/bad-reg.rs:209:31 | LL | asm!("", out("cr") _, out("cr1") _); | ----------- ^^^^^^^^^^^^ register `cr1` @@ -141,7 +141,7 @@ LL | asm!("", out("cr") _, out("cr1") _); | register `cr` error: register `cr2` conflicts with register `cr` - --> $DIR/bad-reg.rs:187:31 + --> $DIR/bad-reg.rs:211:31 | LL | asm!("", out("cr") _, out("cr2") _); | ----------- ^^^^^^^^^^^^ register `cr2` @@ -149,7 +149,7 @@ LL | asm!("", out("cr") _, out("cr2") _); | register `cr` error: register `cr3` conflicts with register `cr` - --> $DIR/bad-reg.rs:189:31 + --> $DIR/bad-reg.rs:213:31 | LL | asm!("", out("cr") _, out("cr3") _); | ----------- ^^^^^^^^^^^^ register `cr3` @@ -157,7 +157,7 @@ LL | asm!("", out("cr") _, out("cr3") _); | register `cr` error: register `cr4` conflicts with register `cr` - --> $DIR/bad-reg.rs:191:31 + --> $DIR/bad-reg.rs:215:31 | LL | asm!("", out("cr") _, out("cr4") _); | ----------- ^^^^^^^^^^^^ register `cr4` @@ -165,7 +165,7 @@ LL | asm!("", out("cr") _, out("cr4") _); | register `cr` error: register `cr5` conflicts with register `cr` - --> $DIR/bad-reg.rs:193:31 + --> $DIR/bad-reg.rs:217:31 | LL | asm!("", out("cr") _, out("cr5") _); | ----------- ^^^^^^^^^^^^ register `cr5` @@ -173,7 +173,7 @@ LL | asm!("", out("cr") _, out("cr5") _); | register `cr` error: register `cr6` conflicts with register `cr` - --> $DIR/bad-reg.rs:195:31 + --> $DIR/bad-reg.rs:219:31 | LL | asm!("", out("cr") _, out("cr6") _); | ----------- ^^^^^^^^^^^^ register `cr6` @@ -181,7 +181,7 @@ LL | asm!("", out("cr") _, out("cr6") _); | register `cr` error: register `cr7` conflicts with register `cr` - --> $DIR/bad-reg.rs:197:31 + --> $DIR/bad-reg.rs:221:31 | LL | asm!("", out("cr") _, out("cr7") _); | ----------- ^^^^^^^^^^^^ register `cr7` @@ -189,7 +189,7 @@ LL | asm!("", out("cr") _, out("cr7") _); | register `cr` error: register `vs0` conflicts with register `f0` - --> $DIR/bad-reg.rs:200:31 + --> $DIR/bad-reg.rs:224:31 | LL | asm!("", out("f0") _, out("vs0") _); | ----------- ^^^^^^^^^^^^ register `vs0` @@ -197,7 +197,7 @@ LL | asm!("", out("f0") _, out("vs0") _); | register `f0` error: register `vs1` conflicts with register `f1` - --> $DIR/bad-reg.rs:202:31 + --> $DIR/bad-reg.rs:226:31 | LL | asm!("", out("f1") _, out("vs1") _); | ----------- ^^^^^^^^^^^^ register `vs1` @@ -205,7 +205,7 @@ LL | asm!("", out("f1") _, out("vs1") _); | register `f1` error: register `vs2` conflicts with register `f2` - --> $DIR/bad-reg.rs:204:31 + --> $DIR/bad-reg.rs:228:31 | LL | asm!("", out("f2") _, out("vs2") _); | ----------- ^^^^^^^^^^^^ register `vs2` @@ -213,7 +213,7 @@ LL | asm!("", out("f2") _, out("vs2") _); | register `f2` error: register `vs3` conflicts with register `f3` - --> $DIR/bad-reg.rs:206:31 + --> $DIR/bad-reg.rs:230:31 | LL | asm!("", out("f3") _, out("vs3") _); | ----------- ^^^^^^^^^^^^ register `vs3` @@ -221,7 +221,7 @@ LL | asm!("", out("f3") _, out("vs3") _); | register `f3` error: register `vs4` conflicts with register `f4` - --> $DIR/bad-reg.rs:208:31 + --> $DIR/bad-reg.rs:232:31 | LL | asm!("", out("f4") _, out("vs4") _); | ----------- ^^^^^^^^^^^^ register `vs4` @@ -229,7 +229,7 @@ LL | asm!("", out("f4") _, out("vs4") _); | register `f4` error: register `vs5` conflicts with register `f5` - --> $DIR/bad-reg.rs:210:31 + --> $DIR/bad-reg.rs:234:31 | LL | asm!("", out("f5") _, out("vs5") _); | ----------- ^^^^^^^^^^^^ register `vs5` @@ -237,7 +237,7 @@ LL | asm!("", out("f5") _, out("vs5") _); | register `f5` error: register `vs6` conflicts with register `f6` - --> $DIR/bad-reg.rs:212:31 + --> $DIR/bad-reg.rs:236:31 | LL | asm!("", out("f6") _, out("vs6") _); | ----------- ^^^^^^^^^^^^ register `vs6` @@ -245,7 +245,7 @@ LL | asm!("", out("f6") _, out("vs6") _); | register `f6` error: register `vs7` conflicts with register `f7` - --> $DIR/bad-reg.rs:214:31 + --> $DIR/bad-reg.rs:238:31 | LL | asm!("", out("f7") _, out("vs7") _); | ----------- ^^^^^^^^^^^^ register `vs7` @@ -253,7 +253,7 @@ LL | asm!("", out("f7") _, out("vs7") _); | register `f7` error: register `vs8` conflicts with register `f8` - --> $DIR/bad-reg.rs:216:31 + --> $DIR/bad-reg.rs:240:31 | LL | asm!("", out("f8") _, out("vs8") _); | ----------- ^^^^^^^^^^^^ register `vs8` @@ -261,7 +261,7 @@ LL | asm!("", out("f8") _, out("vs8") _); | register `f8` error: register `vs9` conflicts with register `f9` - --> $DIR/bad-reg.rs:218:31 + --> $DIR/bad-reg.rs:242:31 | LL | asm!("", out("f9") _, out("vs9") _); | ----------- ^^^^^^^^^^^^ register `vs9` @@ -269,7 +269,7 @@ LL | asm!("", out("f9") _, out("vs9") _); | register `f9` error: register `vs10` conflicts with register `f10` - --> $DIR/bad-reg.rs:220:32 + --> $DIR/bad-reg.rs:244:32 | LL | asm!("", out("f10") _, out("vs10") _); | ------------ ^^^^^^^^^^^^^ register `vs10` @@ -277,7 +277,7 @@ LL | asm!("", out("f10") _, out("vs10") _); | register `f10` error: register `vs11` conflicts with register `f11` - --> $DIR/bad-reg.rs:222:32 + --> $DIR/bad-reg.rs:246:32 | LL | asm!("", out("f11") _, out("vs11") _); | ------------ ^^^^^^^^^^^^^ register `vs11` @@ -285,7 +285,7 @@ LL | asm!("", out("f11") _, out("vs11") _); | register `f11` error: register `vs12` conflicts with register `f12` - --> $DIR/bad-reg.rs:224:32 + --> $DIR/bad-reg.rs:248:32 | LL | asm!("", out("f12") _, out("vs12") _); | ------------ ^^^^^^^^^^^^^ register `vs12` @@ -293,7 +293,7 @@ LL | asm!("", out("f12") _, out("vs12") _); | register `f12` error: register `vs13` conflicts with register `f13` - --> $DIR/bad-reg.rs:226:32 + --> $DIR/bad-reg.rs:250:32 | LL | asm!("", out("f13") _, out("vs13") _); | ------------ ^^^^^^^^^^^^^ register `vs13` @@ -301,7 +301,7 @@ LL | asm!("", out("f13") _, out("vs13") _); | register `f13` error: register `vs14` conflicts with register `f14` - --> $DIR/bad-reg.rs:228:32 + --> $DIR/bad-reg.rs:252:32 | LL | asm!("", out("f14") _, out("vs14") _); | ------------ ^^^^^^^^^^^^^ register `vs14` @@ -309,7 +309,7 @@ LL | asm!("", out("f14") _, out("vs14") _); | register `f14` error: register `vs15` conflicts with register `f15` - --> $DIR/bad-reg.rs:230:32 + --> $DIR/bad-reg.rs:254:32 | LL | asm!("", out("f15") _, out("vs15") _); | ------------ ^^^^^^^^^^^^^ register `vs15` @@ -317,7 +317,7 @@ LL | asm!("", out("f15") _, out("vs15") _); | register `f15` error: register `vs16` conflicts with register `f16` - --> $DIR/bad-reg.rs:232:32 + --> $DIR/bad-reg.rs:256:32 | LL | asm!("", out("f16") _, out("vs16") _); | ------------ ^^^^^^^^^^^^^ register `vs16` @@ -325,7 +325,7 @@ LL | asm!("", out("f16") _, out("vs16") _); | register `f16` error: register `vs17` conflicts with register `f17` - --> $DIR/bad-reg.rs:234:32 + --> $DIR/bad-reg.rs:258:32 | LL | asm!("", out("f17") _, out("vs17") _); | ------------ ^^^^^^^^^^^^^ register `vs17` @@ -333,7 +333,7 @@ LL | asm!("", out("f17") _, out("vs17") _); | register `f17` error: register `vs18` conflicts with register `f18` - --> $DIR/bad-reg.rs:236:32 + --> $DIR/bad-reg.rs:260:32 | LL | asm!("", out("f18") _, out("vs18") _); | ------------ ^^^^^^^^^^^^^ register `vs18` @@ -341,7 +341,7 @@ LL | asm!("", out("f18") _, out("vs18") _); | register `f18` error: register `vs19` conflicts with register `f19` - --> $DIR/bad-reg.rs:238:32 + --> $DIR/bad-reg.rs:262:32 | LL | asm!("", out("f19") _, out("vs19") _); | ------------ ^^^^^^^^^^^^^ register `vs19` @@ -349,7 +349,7 @@ LL | asm!("", out("f19") _, out("vs19") _); | register `f19` error: register `vs20` conflicts with register `f20` - --> $DIR/bad-reg.rs:240:32 + --> $DIR/bad-reg.rs:264:32 | LL | asm!("", out("f20") _, out("vs20") _); | ------------ ^^^^^^^^^^^^^ register `vs20` @@ -357,7 +357,7 @@ LL | asm!("", out("f20") _, out("vs20") _); | register `f20` error: register `vs21` conflicts with register `f21` - --> $DIR/bad-reg.rs:242:32 + --> $DIR/bad-reg.rs:266:32 | LL | asm!("", out("f21") _, out("vs21") _); | ------------ ^^^^^^^^^^^^^ register `vs21` @@ -365,7 +365,7 @@ LL | asm!("", out("f21") _, out("vs21") _); | register `f21` error: register `vs22` conflicts with register `f22` - --> $DIR/bad-reg.rs:244:32 + --> $DIR/bad-reg.rs:268:32 | LL | asm!("", out("f22") _, out("vs22") _); | ------------ ^^^^^^^^^^^^^ register `vs22` @@ -373,7 +373,7 @@ LL | asm!("", out("f22") _, out("vs22") _); | register `f22` error: register `vs23` conflicts with register `f23` - --> $DIR/bad-reg.rs:246:32 + --> $DIR/bad-reg.rs:270:32 | LL | asm!("", out("f23") _, out("vs23") _); | ------------ ^^^^^^^^^^^^^ register `vs23` @@ -381,7 +381,7 @@ LL | asm!("", out("f23") _, out("vs23") _); | register `f23` error: register `vs24` conflicts with register `f24` - --> $DIR/bad-reg.rs:248:32 + --> $DIR/bad-reg.rs:272:32 | LL | asm!("", out("f24") _, out("vs24") _); | ------------ ^^^^^^^^^^^^^ register `vs24` @@ -389,7 +389,7 @@ LL | asm!("", out("f24") _, out("vs24") _); | register `f24` error: register `vs25` conflicts with register `f25` - --> $DIR/bad-reg.rs:250:32 + --> $DIR/bad-reg.rs:274:32 | LL | asm!("", out("f25") _, out("vs25") _); | ------------ ^^^^^^^^^^^^^ register `vs25` @@ -397,7 +397,7 @@ LL | asm!("", out("f25") _, out("vs25") _); | register `f25` error: register `vs26` conflicts with register `f26` - --> $DIR/bad-reg.rs:252:32 + --> $DIR/bad-reg.rs:276:32 | LL | asm!("", out("f26") _, out("vs26") _); | ------------ ^^^^^^^^^^^^^ register `vs26` @@ -405,7 +405,7 @@ LL | asm!("", out("f26") _, out("vs26") _); | register `f26` error: register `vs27` conflicts with register `f27` - --> $DIR/bad-reg.rs:254:32 + --> $DIR/bad-reg.rs:278:32 | LL | asm!("", out("f27") _, out("vs27") _); | ------------ ^^^^^^^^^^^^^ register `vs27` @@ -413,7 +413,7 @@ LL | asm!("", out("f27") _, out("vs27") _); | register `f27` error: register `vs28` conflicts with register `f28` - --> $DIR/bad-reg.rs:256:32 + --> $DIR/bad-reg.rs:280:32 | LL | asm!("", out("f28") _, out("vs28") _); | ------------ ^^^^^^^^^^^^^ register `vs28` @@ -421,7 +421,7 @@ LL | asm!("", out("f28") _, out("vs28") _); | register `f28` error: register `vs29` conflicts with register `f29` - --> $DIR/bad-reg.rs:258:32 + --> $DIR/bad-reg.rs:282:32 | LL | asm!("", out("f29") _, out("vs29") _); | ------------ ^^^^^^^^^^^^^ register `vs29` @@ -429,7 +429,7 @@ LL | asm!("", out("f29") _, out("vs29") _); | register `f29` error: register `vs30` conflicts with register `f30` - --> $DIR/bad-reg.rs:260:32 + --> $DIR/bad-reg.rs:284:32 | LL | asm!("", out("f30") _, out("vs30") _); | ------------ ^^^^^^^^^^^^^ register `vs30` @@ -437,7 +437,7 @@ LL | asm!("", out("f30") _, out("vs30") _); | register `f30` error: register `vs31` conflicts with register `f31` - --> $DIR/bad-reg.rs:262:32 + --> $DIR/bad-reg.rs:286:32 | LL | asm!("", out("f31") _, out("vs31") _); | ------------ ^^^^^^^^^^^^^ register `vs31` @@ -445,7 +445,7 @@ LL | asm!("", out("f31") _, out("vs31") _); | register `f31` error: register `v0` conflicts with register `vs32` - --> $DIR/bad-reg.rs:264:33 + --> $DIR/bad-reg.rs:288:33 | LL | asm!("", out("vs32") _, out("v0") _); | ------------- ^^^^^^^^^^^ register `v0` @@ -453,7 +453,7 @@ LL | asm!("", out("vs32") _, out("v0") _); | register `vs32` error: register `v1` conflicts with register `vs33` - --> $DIR/bad-reg.rs:266:33 + --> $DIR/bad-reg.rs:290:33 | LL | asm!("", out("vs33") _, out("v1") _); | ------------- ^^^^^^^^^^^ register `v1` @@ -461,7 +461,7 @@ LL | asm!("", out("vs33") _, out("v1") _); | register `vs33` error: register `v2` conflicts with register `vs34` - --> $DIR/bad-reg.rs:268:33 + --> $DIR/bad-reg.rs:292:33 | LL | asm!("", out("vs34") _, out("v2") _); | ------------- ^^^^^^^^^^^ register `v2` @@ -469,7 +469,7 @@ LL | asm!("", out("vs34") _, out("v2") _); | register `vs34` error: register `v3` conflicts with register `vs35` - --> $DIR/bad-reg.rs:270:33 + --> $DIR/bad-reg.rs:294:33 | LL | asm!("", out("vs35") _, out("v3") _); | ------------- ^^^^^^^^^^^ register `v3` @@ -477,7 +477,7 @@ LL | asm!("", out("vs35") _, out("v3") _); | register `vs35` error: register `v4` conflicts with register `vs36` - --> $DIR/bad-reg.rs:272:33 + --> $DIR/bad-reg.rs:296:33 | LL | asm!("", out("vs36") _, out("v4") _); | ------------- ^^^^^^^^^^^ register `v4` @@ -485,7 +485,7 @@ LL | asm!("", out("vs36") _, out("v4") _); | register `vs36` error: register `v5` conflicts with register `vs37` - --> $DIR/bad-reg.rs:274:33 + --> $DIR/bad-reg.rs:298:33 | LL | asm!("", out("vs37") _, out("v5") _); | ------------- ^^^^^^^^^^^ register `v5` @@ -493,7 +493,7 @@ LL | asm!("", out("vs37") _, out("v5") _); | register `vs37` error: register `v6` conflicts with register `vs38` - --> $DIR/bad-reg.rs:276:33 + --> $DIR/bad-reg.rs:300:33 | LL | asm!("", out("vs38") _, out("v6") _); | ------------- ^^^^^^^^^^^ register `v6` @@ -501,7 +501,7 @@ LL | asm!("", out("vs38") _, out("v6") _); | register `vs38` error: register `v7` conflicts with register `vs39` - --> $DIR/bad-reg.rs:278:33 + --> $DIR/bad-reg.rs:302:33 | LL | asm!("", out("vs39") _, out("v7") _); | ------------- ^^^^^^^^^^^ register `v7` @@ -509,7 +509,7 @@ LL | asm!("", out("vs39") _, out("v7") _); | register `vs39` error: register `v8` conflicts with register `vs40` - --> $DIR/bad-reg.rs:280:33 + --> $DIR/bad-reg.rs:304:33 | LL | asm!("", out("vs40") _, out("v8") _); | ------------- ^^^^^^^^^^^ register `v8` @@ -517,7 +517,7 @@ LL | asm!("", out("vs40") _, out("v8") _); | register `vs40` error: register `v9` conflicts with register `vs41` - --> $DIR/bad-reg.rs:282:33 + --> $DIR/bad-reg.rs:306:33 | LL | asm!("", out("vs41") _, out("v9") _); | ------------- ^^^^^^^^^^^ register `v9` @@ -525,7 +525,7 @@ LL | asm!("", out("vs41") _, out("v9") _); | register `vs41` error: register `v10` conflicts with register `vs42` - --> $DIR/bad-reg.rs:284:33 + --> $DIR/bad-reg.rs:308:33 | LL | asm!("", out("vs42") _, out("v10") _); | ------------- ^^^^^^^^^^^^ register `v10` @@ -533,7 +533,7 @@ LL | asm!("", out("vs42") _, out("v10") _); | register `vs42` error: register `v11` conflicts with register `vs43` - --> $DIR/bad-reg.rs:286:33 + --> $DIR/bad-reg.rs:310:33 | LL | asm!("", out("vs43") _, out("v11") _); | ------------- ^^^^^^^^^^^^ register `v11` @@ -541,7 +541,7 @@ LL | asm!("", out("vs43") _, out("v11") _); | register `vs43` error: register `v12` conflicts with register `vs44` - --> $DIR/bad-reg.rs:288:33 + --> $DIR/bad-reg.rs:312:33 | LL | asm!("", out("vs44") _, out("v12") _); | ------------- ^^^^^^^^^^^^ register `v12` @@ -549,7 +549,7 @@ LL | asm!("", out("vs44") _, out("v12") _); | register `vs44` error: register `v13` conflicts with register `vs45` - --> $DIR/bad-reg.rs:290:33 + --> $DIR/bad-reg.rs:314:33 | LL | asm!("", out("vs45") _, out("v13") _); | ------------- ^^^^^^^^^^^^ register `v13` @@ -557,7 +557,7 @@ LL | asm!("", out("vs45") _, out("v13") _); | register `vs45` error: register `v14` conflicts with register `vs46` - --> $DIR/bad-reg.rs:292:33 + --> $DIR/bad-reg.rs:316:33 | LL | asm!("", out("vs46") _, out("v14") _); | ------------- ^^^^^^^^^^^^ register `v14` @@ -565,7 +565,7 @@ LL | asm!("", out("vs46") _, out("v14") _); | register `vs46` error: register `v15` conflicts with register `vs47` - --> $DIR/bad-reg.rs:294:33 + --> $DIR/bad-reg.rs:318:33 | LL | asm!("", out("vs47") _, out("v15") _); | ------------- ^^^^^^^^^^^^ register `v15` @@ -573,7 +573,7 @@ LL | asm!("", out("vs47") _, out("v15") _); | register `vs47` error: register `v16` conflicts with register `vs48` - --> $DIR/bad-reg.rs:296:33 + --> $DIR/bad-reg.rs:320:33 | LL | asm!("", out("vs48") _, out("v16") _); | ------------- ^^^^^^^^^^^^ register `v16` @@ -581,7 +581,7 @@ LL | asm!("", out("vs48") _, out("v16") _); | register `vs48` error: register `v17` conflicts with register `vs49` - --> $DIR/bad-reg.rs:298:33 + --> $DIR/bad-reg.rs:322:33 | LL | asm!("", out("vs49") _, out("v17") _); | ------------- ^^^^^^^^^^^^ register `v17` @@ -589,7 +589,7 @@ LL | asm!("", out("vs49") _, out("v17") _); | register `vs49` error: register `v18` conflicts with register `vs50` - --> $DIR/bad-reg.rs:300:33 + --> $DIR/bad-reg.rs:324:33 | LL | asm!("", out("vs50") _, out("v18") _); | ------------- ^^^^^^^^^^^^ register `v18` @@ -597,7 +597,7 @@ LL | asm!("", out("vs50") _, out("v18") _); | register `vs50` error: register `v19` conflicts with register `vs51` - --> $DIR/bad-reg.rs:302:33 + --> $DIR/bad-reg.rs:326:33 | LL | asm!("", out("vs51") _, out("v19") _); | ------------- ^^^^^^^^^^^^ register `v19` @@ -605,7 +605,7 @@ LL | asm!("", out("vs51") _, out("v19") _); | register `vs51` error: register `v20` conflicts with register `vs52` - --> $DIR/bad-reg.rs:304:33 + --> $DIR/bad-reg.rs:328:33 | LL | asm!("", out("vs52") _, out("v20") _); | ------------- ^^^^^^^^^^^^ register `v20` @@ -613,7 +613,7 @@ LL | asm!("", out("vs52") _, out("v20") _); | register `vs52` error: register `v21` conflicts with register `vs53` - --> $DIR/bad-reg.rs:306:33 + --> $DIR/bad-reg.rs:332:33 | LL | asm!("", out("vs53") _, out("v21") _); | ------------- ^^^^^^^^^^^^ register `v21` @@ -621,7 +621,7 @@ LL | asm!("", out("vs53") _, out("v21") _); | register `vs53` error: register `v22` conflicts with register `vs54` - --> $DIR/bad-reg.rs:308:33 + --> $DIR/bad-reg.rs:336:33 | LL | asm!("", out("vs54") _, out("v22") _); | ------------- ^^^^^^^^^^^^ register `v22` @@ -629,7 +629,7 @@ LL | asm!("", out("vs54") _, out("v22") _); | register `vs54` error: register `v23` conflicts with register `vs55` - --> $DIR/bad-reg.rs:310:33 + --> $DIR/bad-reg.rs:340:33 | LL | asm!("", out("vs55") _, out("v23") _); | ------------- ^^^^^^^^^^^^ register `v23` @@ -637,7 +637,7 @@ LL | asm!("", out("vs55") _, out("v23") _); | register `vs55` error: register `v24` conflicts with register `vs56` - --> $DIR/bad-reg.rs:312:33 + --> $DIR/bad-reg.rs:344:33 | LL | asm!("", out("vs56") _, out("v24") _); | ------------- ^^^^^^^^^^^^ register `v24` @@ -645,7 +645,7 @@ LL | asm!("", out("vs56") _, out("v24") _); | register `vs56` error: register `v25` conflicts with register `vs57` - --> $DIR/bad-reg.rs:314:33 + --> $DIR/bad-reg.rs:348:33 | LL | asm!("", out("vs57") _, out("v25") _); | ------------- ^^^^^^^^^^^^ register `v25` @@ -653,7 +653,7 @@ LL | asm!("", out("vs57") _, out("v25") _); | register `vs57` error: register `v26` conflicts with register `vs58` - --> $DIR/bad-reg.rs:316:33 + --> $DIR/bad-reg.rs:352:33 | LL | asm!("", out("vs58") _, out("v26") _); | ------------- ^^^^^^^^^^^^ register `v26` @@ -661,7 +661,7 @@ LL | asm!("", out("vs58") _, out("v26") _); | register `vs58` error: register `v27` conflicts with register `vs59` - --> $DIR/bad-reg.rs:318:33 + --> $DIR/bad-reg.rs:356:33 | LL | asm!("", out("vs59") _, out("v27") _); | ------------- ^^^^^^^^^^^^ register `v27` @@ -669,7 +669,7 @@ LL | asm!("", out("vs59") _, out("v27") _); | register `vs59` error: register `v28` conflicts with register `vs60` - --> $DIR/bad-reg.rs:320:33 + --> $DIR/bad-reg.rs:360:33 | LL | asm!("", out("vs60") _, out("v28") _); | ------------- ^^^^^^^^^^^^ register `v28` @@ -677,7 +677,7 @@ LL | asm!("", out("vs60") _, out("v28") _); | register `vs60` error: register `v29` conflicts with register `vs61` - --> $DIR/bad-reg.rs:322:33 + --> $DIR/bad-reg.rs:364:33 | LL | asm!("", out("vs61") _, out("v29") _); | ------------- ^^^^^^^^^^^^ register `v29` @@ -685,7 +685,7 @@ LL | asm!("", out("vs61") _, out("v29") _); | register `vs61` error: register `v30` conflicts with register `vs62` - --> $DIR/bad-reg.rs:324:33 + --> $DIR/bad-reg.rs:368:33 | LL | asm!("", out("vs62") _, out("v30") _); | ------------- ^^^^^^^^^^^^ register `v30` @@ -693,7 +693,7 @@ LL | asm!("", out("vs62") _, out("v30") _); | register `vs62` error: register `v31` conflicts with register `vs63` - --> $DIR/bad-reg.rs:326:33 + --> $DIR/bad-reg.rs:372:33 | LL | asm!("", out("vs63") _, out("v31") _); | ------------- ^^^^^^^^^^^^ register `v31` @@ -701,7 +701,7 @@ LL | asm!("", out("vs63") _, out("v31") _); | register `vs63` error: register class `spe_acc` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:332:26 + --> $DIR/bad-reg.rs:380:26 | LL | asm!("/* {} */", out(spe_acc) _); | ^^^^^^^^^^^^^^ @@ -761,67 +761,67 @@ LL | asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is avai = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f16, f32, f64, f128, i64x2, f16x8, f64x2 error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:90:18 + --> $DIR/bad-reg.rs:102:18 | LL | asm!("", in("vs0") v32x4); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:92:18 + --> $DIR/bad-reg.rs:104:18 | LL | asm!("", out("vs0") v32x4); // requires vsx | ^^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:94:18 + --> $DIR/bad-reg.rs:106:18 | LL | asm!("", in("vs0") v64x2); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:96:18 + --> $DIR/bad-reg.rs:108:18 | LL | asm!("", out("vs0") v64x2); // requires vsx | ^^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:98:18 + --> $DIR/bad-reg.rs:110:18 | LL | asm!("", in("vs0") x); // FIXME: should be ok if vsx is available | ^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:101:18 + --> $DIR/bad-reg.rs:113:18 | LL | asm!("", out("vs0") x); // FIXME: should be ok if vsx is available | ^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:104:26 + --> $DIR/bad-reg.rs:116:26 | LL | asm!("/* {} */", in(vsreg) v32x4); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:106:26 + --> $DIR/bad-reg.rs:118:26 | LL | asm!("/* {} */", in(vsreg) v64x2); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:108:26 + --> $DIR/bad-reg.rs:120:26 | LL | asm!("/* {} */", in(vsreg) x); // FIXME: should be ok if vsx is available | ^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:111:26 + --> $DIR/bad-reg.rs:123:26 | LL | asm!("/* {} */", out(vsreg) _); // requires vsx | ^^^^^^^^^^^^ error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:131:27 + --> $DIR/bad-reg.rs:155:27 | LL | asm!("", in("cr") x); | ^ @@ -829,7 +829,7 @@ LL | asm!("", in("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:134:28 + --> $DIR/bad-reg.rs:158:28 | LL | asm!("", out("cr") x); | ^ @@ -837,7 +837,7 @@ LL | asm!("", out("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:137:33 + --> $DIR/bad-reg.rs:161:33 | LL | asm!("/* {} */", in(cr) x); | ^ @@ -845,7 +845,7 @@ LL | asm!("/* {} */", in(cr) x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:144:28 + --> $DIR/bad-reg.rs:168:28 | LL | asm!("", in("ctr") x); | ^ @@ -853,7 +853,7 @@ LL | asm!("", in("ctr") x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:147:29 + --> $DIR/bad-reg.rs:171:29 | LL | asm!("", out("ctr") x); | ^ @@ -861,7 +861,7 @@ LL | asm!("", out("ctr") x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:150:34 + --> $DIR/bad-reg.rs:174:34 | LL | asm!("/* {} */", in(ctr) x); | ^ @@ -869,7 +869,7 @@ LL | asm!("/* {} */", in(ctr) x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:157:27 + --> $DIR/bad-reg.rs:181:27 | LL | asm!("", in("lr") x); | ^ @@ -877,7 +877,7 @@ LL | asm!("", in("lr") x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:160:28 + --> $DIR/bad-reg.rs:184:28 | LL | asm!("", out("lr") x); | ^ @@ -885,7 +885,7 @@ LL | asm!("", out("lr") x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:163:33 + --> $DIR/bad-reg.rs:187:33 | LL | asm!("/* {} */", in(lr) x); | ^ @@ -893,7 +893,7 @@ LL | asm!("/* {} */", in(lr) x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:170:28 + --> $DIR/bad-reg.rs:194:28 | LL | asm!("", in("xer") x); | ^ @@ -901,7 +901,7 @@ LL | asm!("", in("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:173:29 + --> $DIR/bad-reg.rs:197:29 | LL | asm!("", out("xer") x); | ^ @@ -909,7 +909,7 @@ LL | asm!("", out("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:176:34 + --> $DIR/bad-reg.rs:200:34 | LL | asm!("/* {} */", in(xer) x); | ^ @@ -917,7 +917,7 @@ LL | asm!("/* {} */", in(xer) x); = note: register class `xer` supports these types: error: cannot use register `spe_acc`: spe_acc is only available on spe targets - --> $DIR/bad-reg.rs:330:18 + --> $DIR/bad-reg.rs:378:18 | LL | asm!("", out("spe_acc") _); | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr b/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr index 7631f8a4c9b6d..b43a39a6997fb 100644 --- a/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr +++ b/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr @@ -29,103 +29,103 @@ LL | asm!("", out("vrsave") _); | ^^^^^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:131:18 + --> $DIR/bad-reg.rs:155:18 | LL | asm!("", in("cr") x); | ^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:134:18 + --> $DIR/bad-reg.rs:158:18 | LL | asm!("", out("cr") x); | ^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:137:26 + --> $DIR/bad-reg.rs:161:26 | LL | asm!("/* {} */", in(cr) x); | ^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:140:26 + --> $DIR/bad-reg.rs:164:26 | LL | asm!("/* {} */", out(cr) _); | ^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:144:18 + --> $DIR/bad-reg.rs:168:18 | LL | asm!("", in("ctr") x); | ^^^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:147:18 + --> $DIR/bad-reg.rs:171:18 | LL | asm!("", out("ctr") x); | ^^^^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:150:26 + --> $DIR/bad-reg.rs:174:26 | LL | asm!("/* {} */", in(ctr) x); | ^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:153:26 + --> $DIR/bad-reg.rs:177:26 | LL | asm!("/* {} */", out(ctr) _); | ^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:157:18 + --> $DIR/bad-reg.rs:181:18 | LL | asm!("", in("lr") x); | ^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:160:18 + --> $DIR/bad-reg.rs:184:18 | LL | asm!("", out("lr") x); | ^^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:163:26 + --> $DIR/bad-reg.rs:187:26 | LL | asm!("/* {} */", in(lr) x); | ^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:166:26 + --> $DIR/bad-reg.rs:190:26 | LL | asm!("/* {} */", out(lr) _); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:170:18 + --> $DIR/bad-reg.rs:194:18 | LL | asm!("", in("xer") x); | ^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:173:18 + --> $DIR/bad-reg.rs:197:18 | LL | asm!("", out("xer") x); | ^^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:176:26 + --> $DIR/bad-reg.rs:200:26 | LL | asm!("/* {} */", in(xer) x); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:179:26 + --> $DIR/bad-reg.rs:203:26 | LL | asm!("/* {} */", out(xer) _); | ^^^^^^^^^^ error: register `cr0` conflicts with register `cr` - --> $DIR/bad-reg.rs:183:31 + --> $DIR/bad-reg.rs:207:31 | LL | asm!("", out("cr") _, out("cr0") _); | ----------- ^^^^^^^^^^^^ register `cr0` @@ -133,7 +133,7 @@ LL | asm!("", out("cr") _, out("cr0") _); | register `cr` error: register `cr1` conflicts with register `cr` - --> $DIR/bad-reg.rs:185:31 + --> $DIR/bad-reg.rs:209:31 | LL | asm!("", out("cr") _, out("cr1") _); | ----------- ^^^^^^^^^^^^ register `cr1` @@ -141,7 +141,7 @@ LL | asm!("", out("cr") _, out("cr1") _); | register `cr` error: register `cr2` conflicts with register `cr` - --> $DIR/bad-reg.rs:187:31 + --> $DIR/bad-reg.rs:211:31 | LL | asm!("", out("cr") _, out("cr2") _); | ----------- ^^^^^^^^^^^^ register `cr2` @@ -149,7 +149,7 @@ LL | asm!("", out("cr") _, out("cr2") _); | register `cr` error: register `cr3` conflicts with register `cr` - --> $DIR/bad-reg.rs:189:31 + --> $DIR/bad-reg.rs:213:31 | LL | asm!("", out("cr") _, out("cr3") _); | ----------- ^^^^^^^^^^^^ register `cr3` @@ -157,7 +157,7 @@ LL | asm!("", out("cr") _, out("cr3") _); | register `cr` error: register `cr4` conflicts with register `cr` - --> $DIR/bad-reg.rs:191:31 + --> $DIR/bad-reg.rs:215:31 | LL | asm!("", out("cr") _, out("cr4") _); | ----------- ^^^^^^^^^^^^ register `cr4` @@ -165,7 +165,7 @@ LL | asm!("", out("cr") _, out("cr4") _); | register `cr` error: register `cr5` conflicts with register `cr` - --> $DIR/bad-reg.rs:193:31 + --> $DIR/bad-reg.rs:217:31 | LL | asm!("", out("cr") _, out("cr5") _); | ----------- ^^^^^^^^^^^^ register `cr5` @@ -173,7 +173,7 @@ LL | asm!("", out("cr") _, out("cr5") _); | register `cr` error: register `cr6` conflicts with register `cr` - --> $DIR/bad-reg.rs:195:31 + --> $DIR/bad-reg.rs:219:31 | LL | asm!("", out("cr") _, out("cr6") _); | ----------- ^^^^^^^^^^^^ register `cr6` @@ -181,7 +181,7 @@ LL | asm!("", out("cr") _, out("cr6") _); | register `cr` error: register `cr7` conflicts with register `cr` - --> $DIR/bad-reg.rs:197:31 + --> $DIR/bad-reg.rs:221:31 | LL | asm!("", out("cr") _, out("cr7") _); | ----------- ^^^^^^^^^^^^ register `cr7` @@ -189,7 +189,7 @@ LL | asm!("", out("cr") _, out("cr7") _); | register `cr` error: register `vs0` conflicts with register `f0` - --> $DIR/bad-reg.rs:200:31 + --> $DIR/bad-reg.rs:224:31 | LL | asm!("", out("f0") _, out("vs0") _); | ----------- ^^^^^^^^^^^^ register `vs0` @@ -197,7 +197,7 @@ LL | asm!("", out("f0") _, out("vs0") _); | register `f0` error: register `vs1` conflicts with register `f1` - --> $DIR/bad-reg.rs:202:31 + --> $DIR/bad-reg.rs:226:31 | LL | asm!("", out("f1") _, out("vs1") _); | ----------- ^^^^^^^^^^^^ register `vs1` @@ -205,7 +205,7 @@ LL | asm!("", out("f1") _, out("vs1") _); | register `f1` error: register `vs2` conflicts with register `f2` - --> $DIR/bad-reg.rs:204:31 + --> $DIR/bad-reg.rs:228:31 | LL | asm!("", out("f2") _, out("vs2") _); | ----------- ^^^^^^^^^^^^ register `vs2` @@ -213,7 +213,7 @@ LL | asm!("", out("f2") _, out("vs2") _); | register `f2` error: register `vs3` conflicts with register `f3` - --> $DIR/bad-reg.rs:206:31 + --> $DIR/bad-reg.rs:230:31 | LL | asm!("", out("f3") _, out("vs3") _); | ----------- ^^^^^^^^^^^^ register `vs3` @@ -221,7 +221,7 @@ LL | asm!("", out("f3") _, out("vs3") _); | register `f3` error: register `vs4` conflicts with register `f4` - --> $DIR/bad-reg.rs:208:31 + --> $DIR/bad-reg.rs:232:31 | LL | asm!("", out("f4") _, out("vs4") _); | ----------- ^^^^^^^^^^^^ register `vs4` @@ -229,7 +229,7 @@ LL | asm!("", out("f4") _, out("vs4") _); | register `f4` error: register `vs5` conflicts with register `f5` - --> $DIR/bad-reg.rs:210:31 + --> $DIR/bad-reg.rs:234:31 | LL | asm!("", out("f5") _, out("vs5") _); | ----------- ^^^^^^^^^^^^ register `vs5` @@ -237,7 +237,7 @@ LL | asm!("", out("f5") _, out("vs5") _); | register `f5` error: register `vs6` conflicts with register `f6` - --> $DIR/bad-reg.rs:212:31 + --> $DIR/bad-reg.rs:236:31 | LL | asm!("", out("f6") _, out("vs6") _); | ----------- ^^^^^^^^^^^^ register `vs6` @@ -245,7 +245,7 @@ LL | asm!("", out("f6") _, out("vs6") _); | register `f6` error: register `vs7` conflicts with register `f7` - --> $DIR/bad-reg.rs:214:31 + --> $DIR/bad-reg.rs:238:31 | LL | asm!("", out("f7") _, out("vs7") _); | ----------- ^^^^^^^^^^^^ register `vs7` @@ -253,7 +253,7 @@ LL | asm!("", out("f7") _, out("vs7") _); | register `f7` error: register `vs8` conflicts with register `f8` - --> $DIR/bad-reg.rs:216:31 + --> $DIR/bad-reg.rs:240:31 | LL | asm!("", out("f8") _, out("vs8") _); | ----------- ^^^^^^^^^^^^ register `vs8` @@ -261,7 +261,7 @@ LL | asm!("", out("f8") _, out("vs8") _); | register `f8` error: register `vs9` conflicts with register `f9` - --> $DIR/bad-reg.rs:218:31 + --> $DIR/bad-reg.rs:242:31 | LL | asm!("", out("f9") _, out("vs9") _); | ----------- ^^^^^^^^^^^^ register `vs9` @@ -269,7 +269,7 @@ LL | asm!("", out("f9") _, out("vs9") _); | register `f9` error: register `vs10` conflicts with register `f10` - --> $DIR/bad-reg.rs:220:32 + --> $DIR/bad-reg.rs:244:32 | LL | asm!("", out("f10") _, out("vs10") _); | ------------ ^^^^^^^^^^^^^ register `vs10` @@ -277,7 +277,7 @@ LL | asm!("", out("f10") _, out("vs10") _); | register `f10` error: register `vs11` conflicts with register `f11` - --> $DIR/bad-reg.rs:222:32 + --> $DIR/bad-reg.rs:246:32 | LL | asm!("", out("f11") _, out("vs11") _); | ------------ ^^^^^^^^^^^^^ register `vs11` @@ -285,7 +285,7 @@ LL | asm!("", out("f11") _, out("vs11") _); | register `f11` error: register `vs12` conflicts with register `f12` - --> $DIR/bad-reg.rs:224:32 + --> $DIR/bad-reg.rs:248:32 | LL | asm!("", out("f12") _, out("vs12") _); | ------------ ^^^^^^^^^^^^^ register `vs12` @@ -293,7 +293,7 @@ LL | asm!("", out("f12") _, out("vs12") _); | register `f12` error: register `vs13` conflicts with register `f13` - --> $DIR/bad-reg.rs:226:32 + --> $DIR/bad-reg.rs:250:32 | LL | asm!("", out("f13") _, out("vs13") _); | ------------ ^^^^^^^^^^^^^ register `vs13` @@ -301,7 +301,7 @@ LL | asm!("", out("f13") _, out("vs13") _); | register `f13` error: register `vs14` conflicts with register `f14` - --> $DIR/bad-reg.rs:228:32 + --> $DIR/bad-reg.rs:252:32 | LL | asm!("", out("f14") _, out("vs14") _); | ------------ ^^^^^^^^^^^^^ register `vs14` @@ -309,7 +309,7 @@ LL | asm!("", out("f14") _, out("vs14") _); | register `f14` error: register `vs15` conflicts with register `f15` - --> $DIR/bad-reg.rs:230:32 + --> $DIR/bad-reg.rs:254:32 | LL | asm!("", out("f15") _, out("vs15") _); | ------------ ^^^^^^^^^^^^^ register `vs15` @@ -317,7 +317,7 @@ LL | asm!("", out("f15") _, out("vs15") _); | register `f15` error: register `vs16` conflicts with register `f16` - --> $DIR/bad-reg.rs:232:32 + --> $DIR/bad-reg.rs:256:32 | LL | asm!("", out("f16") _, out("vs16") _); | ------------ ^^^^^^^^^^^^^ register `vs16` @@ -325,7 +325,7 @@ LL | asm!("", out("f16") _, out("vs16") _); | register `f16` error: register `vs17` conflicts with register `f17` - --> $DIR/bad-reg.rs:234:32 + --> $DIR/bad-reg.rs:258:32 | LL | asm!("", out("f17") _, out("vs17") _); | ------------ ^^^^^^^^^^^^^ register `vs17` @@ -333,7 +333,7 @@ LL | asm!("", out("f17") _, out("vs17") _); | register `f17` error: register `vs18` conflicts with register `f18` - --> $DIR/bad-reg.rs:236:32 + --> $DIR/bad-reg.rs:260:32 | LL | asm!("", out("f18") _, out("vs18") _); | ------------ ^^^^^^^^^^^^^ register `vs18` @@ -341,7 +341,7 @@ LL | asm!("", out("f18") _, out("vs18") _); | register `f18` error: register `vs19` conflicts with register `f19` - --> $DIR/bad-reg.rs:238:32 + --> $DIR/bad-reg.rs:262:32 | LL | asm!("", out("f19") _, out("vs19") _); | ------------ ^^^^^^^^^^^^^ register `vs19` @@ -349,7 +349,7 @@ LL | asm!("", out("f19") _, out("vs19") _); | register `f19` error: register `vs20` conflicts with register `f20` - --> $DIR/bad-reg.rs:240:32 + --> $DIR/bad-reg.rs:264:32 | LL | asm!("", out("f20") _, out("vs20") _); | ------------ ^^^^^^^^^^^^^ register `vs20` @@ -357,7 +357,7 @@ LL | asm!("", out("f20") _, out("vs20") _); | register `f20` error: register `vs21` conflicts with register `f21` - --> $DIR/bad-reg.rs:242:32 + --> $DIR/bad-reg.rs:266:32 | LL | asm!("", out("f21") _, out("vs21") _); | ------------ ^^^^^^^^^^^^^ register `vs21` @@ -365,7 +365,7 @@ LL | asm!("", out("f21") _, out("vs21") _); | register `f21` error: register `vs22` conflicts with register `f22` - --> $DIR/bad-reg.rs:244:32 + --> $DIR/bad-reg.rs:268:32 | LL | asm!("", out("f22") _, out("vs22") _); | ------------ ^^^^^^^^^^^^^ register `vs22` @@ -373,7 +373,7 @@ LL | asm!("", out("f22") _, out("vs22") _); | register `f22` error: register `vs23` conflicts with register `f23` - --> $DIR/bad-reg.rs:246:32 + --> $DIR/bad-reg.rs:270:32 | LL | asm!("", out("f23") _, out("vs23") _); | ------------ ^^^^^^^^^^^^^ register `vs23` @@ -381,7 +381,7 @@ LL | asm!("", out("f23") _, out("vs23") _); | register `f23` error: register `vs24` conflicts with register `f24` - --> $DIR/bad-reg.rs:248:32 + --> $DIR/bad-reg.rs:272:32 | LL | asm!("", out("f24") _, out("vs24") _); | ------------ ^^^^^^^^^^^^^ register `vs24` @@ -389,7 +389,7 @@ LL | asm!("", out("f24") _, out("vs24") _); | register `f24` error: register `vs25` conflicts with register `f25` - --> $DIR/bad-reg.rs:250:32 + --> $DIR/bad-reg.rs:274:32 | LL | asm!("", out("f25") _, out("vs25") _); | ------------ ^^^^^^^^^^^^^ register `vs25` @@ -397,7 +397,7 @@ LL | asm!("", out("f25") _, out("vs25") _); | register `f25` error: register `vs26` conflicts with register `f26` - --> $DIR/bad-reg.rs:252:32 + --> $DIR/bad-reg.rs:276:32 | LL | asm!("", out("f26") _, out("vs26") _); | ------------ ^^^^^^^^^^^^^ register `vs26` @@ -405,7 +405,7 @@ LL | asm!("", out("f26") _, out("vs26") _); | register `f26` error: register `vs27` conflicts with register `f27` - --> $DIR/bad-reg.rs:254:32 + --> $DIR/bad-reg.rs:278:32 | LL | asm!("", out("f27") _, out("vs27") _); | ------------ ^^^^^^^^^^^^^ register `vs27` @@ -413,7 +413,7 @@ LL | asm!("", out("f27") _, out("vs27") _); | register `f27` error: register `vs28` conflicts with register `f28` - --> $DIR/bad-reg.rs:256:32 + --> $DIR/bad-reg.rs:280:32 | LL | asm!("", out("f28") _, out("vs28") _); | ------------ ^^^^^^^^^^^^^ register `vs28` @@ -421,7 +421,7 @@ LL | asm!("", out("f28") _, out("vs28") _); | register `f28` error: register `vs29` conflicts with register `f29` - --> $DIR/bad-reg.rs:258:32 + --> $DIR/bad-reg.rs:282:32 | LL | asm!("", out("f29") _, out("vs29") _); | ------------ ^^^^^^^^^^^^^ register `vs29` @@ -429,7 +429,7 @@ LL | asm!("", out("f29") _, out("vs29") _); | register `f29` error: register `vs30` conflicts with register `f30` - --> $DIR/bad-reg.rs:260:32 + --> $DIR/bad-reg.rs:284:32 | LL | asm!("", out("f30") _, out("vs30") _); | ------------ ^^^^^^^^^^^^^ register `vs30` @@ -437,7 +437,7 @@ LL | asm!("", out("f30") _, out("vs30") _); | register `f30` error: register `vs31` conflicts with register `f31` - --> $DIR/bad-reg.rs:262:32 + --> $DIR/bad-reg.rs:286:32 | LL | asm!("", out("f31") _, out("vs31") _); | ------------ ^^^^^^^^^^^^^ register `vs31` @@ -445,7 +445,7 @@ LL | asm!("", out("f31") _, out("vs31") _); | register `f31` error: register `v0` conflicts with register `vs32` - --> $DIR/bad-reg.rs:264:33 + --> $DIR/bad-reg.rs:288:33 | LL | asm!("", out("vs32") _, out("v0") _); | ------------- ^^^^^^^^^^^ register `v0` @@ -453,7 +453,7 @@ LL | asm!("", out("vs32") _, out("v0") _); | register `vs32` error: register `v1` conflicts with register `vs33` - --> $DIR/bad-reg.rs:266:33 + --> $DIR/bad-reg.rs:290:33 | LL | asm!("", out("vs33") _, out("v1") _); | ------------- ^^^^^^^^^^^ register `v1` @@ -461,7 +461,7 @@ LL | asm!("", out("vs33") _, out("v1") _); | register `vs33` error: register `v2` conflicts with register `vs34` - --> $DIR/bad-reg.rs:268:33 + --> $DIR/bad-reg.rs:292:33 | LL | asm!("", out("vs34") _, out("v2") _); | ------------- ^^^^^^^^^^^ register `v2` @@ -469,7 +469,7 @@ LL | asm!("", out("vs34") _, out("v2") _); | register `vs34` error: register `v3` conflicts with register `vs35` - --> $DIR/bad-reg.rs:270:33 + --> $DIR/bad-reg.rs:294:33 | LL | asm!("", out("vs35") _, out("v3") _); | ------------- ^^^^^^^^^^^ register `v3` @@ -477,7 +477,7 @@ LL | asm!("", out("vs35") _, out("v3") _); | register `vs35` error: register `v4` conflicts with register `vs36` - --> $DIR/bad-reg.rs:272:33 + --> $DIR/bad-reg.rs:296:33 | LL | asm!("", out("vs36") _, out("v4") _); | ------------- ^^^^^^^^^^^ register `v4` @@ -485,7 +485,7 @@ LL | asm!("", out("vs36") _, out("v4") _); | register `vs36` error: register `v5` conflicts with register `vs37` - --> $DIR/bad-reg.rs:274:33 + --> $DIR/bad-reg.rs:298:33 | LL | asm!("", out("vs37") _, out("v5") _); | ------------- ^^^^^^^^^^^ register `v5` @@ -493,7 +493,7 @@ LL | asm!("", out("vs37") _, out("v5") _); | register `vs37` error: register `v6` conflicts with register `vs38` - --> $DIR/bad-reg.rs:276:33 + --> $DIR/bad-reg.rs:300:33 | LL | asm!("", out("vs38") _, out("v6") _); | ------------- ^^^^^^^^^^^ register `v6` @@ -501,7 +501,7 @@ LL | asm!("", out("vs38") _, out("v6") _); | register `vs38` error: register `v7` conflicts with register `vs39` - --> $DIR/bad-reg.rs:278:33 + --> $DIR/bad-reg.rs:302:33 | LL | asm!("", out("vs39") _, out("v7") _); | ------------- ^^^^^^^^^^^ register `v7` @@ -509,7 +509,7 @@ LL | asm!("", out("vs39") _, out("v7") _); | register `vs39` error: register `v8` conflicts with register `vs40` - --> $DIR/bad-reg.rs:280:33 + --> $DIR/bad-reg.rs:304:33 | LL | asm!("", out("vs40") _, out("v8") _); | ------------- ^^^^^^^^^^^ register `v8` @@ -517,7 +517,7 @@ LL | asm!("", out("vs40") _, out("v8") _); | register `vs40` error: register `v9` conflicts with register `vs41` - --> $DIR/bad-reg.rs:282:33 + --> $DIR/bad-reg.rs:306:33 | LL | asm!("", out("vs41") _, out("v9") _); | ------------- ^^^^^^^^^^^ register `v9` @@ -525,7 +525,7 @@ LL | asm!("", out("vs41") _, out("v9") _); | register `vs41` error: register `v10` conflicts with register `vs42` - --> $DIR/bad-reg.rs:284:33 + --> $DIR/bad-reg.rs:308:33 | LL | asm!("", out("vs42") _, out("v10") _); | ------------- ^^^^^^^^^^^^ register `v10` @@ -533,7 +533,7 @@ LL | asm!("", out("vs42") _, out("v10") _); | register `vs42` error: register `v11` conflicts with register `vs43` - --> $DIR/bad-reg.rs:286:33 + --> $DIR/bad-reg.rs:310:33 | LL | asm!("", out("vs43") _, out("v11") _); | ------------- ^^^^^^^^^^^^ register `v11` @@ -541,7 +541,7 @@ LL | asm!("", out("vs43") _, out("v11") _); | register `vs43` error: register `v12` conflicts with register `vs44` - --> $DIR/bad-reg.rs:288:33 + --> $DIR/bad-reg.rs:312:33 | LL | asm!("", out("vs44") _, out("v12") _); | ------------- ^^^^^^^^^^^^ register `v12` @@ -549,7 +549,7 @@ LL | asm!("", out("vs44") _, out("v12") _); | register `vs44` error: register `v13` conflicts with register `vs45` - --> $DIR/bad-reg.rs:290:33 + --> $DIR/bad-reg.rs:314:33 | LL | asm!("", out("vs45") _, out("v13") _); | ------------- ^^^^^^^^^^^^ register `v13` @@ -557,7 +557,7 @@ LL | asm!("", out("vs45") _, out("v13") _); | register `vs45` error: register `v14` conflicts with register `vs46` - --> $DIR/bad-reg.rs:292:33 + --> $DIR/bad-reg.rs:316:33 | LL | asm!("", out("vs46") _, out("v14") _); | ------------- ^^^^^^^^^^^^ register `v14` @@ -565,7 +565,7 @@ LL | asm!("", out("vs46") _, out("v14") _); | register `vs46` error: register `v15` conflicts with register `vs47` - --> $DIR/bad-reg.rs:294:33 + --> $DIR/bad-reg.rs:318:33 | LL | asm!("", out("vs47") _, out("v15") _); | ------------- ^^^^^^^^^^^^ register `v15` @@ -573,7 +573,7 @@ LL | asm!("", out("vs47") _, out("v15") _); | register `vs47` error: register `v16` conflicts with register `vs48` - --> $DIR/bad-reg.rs:296:33 + --> $DIR/bad-reg.rs:320:33 | LL | asm!("", out("vs48") _, out("v16") _); | ------------- ^^^^^^^^^^^^ register `v16` @@ -581,7 +581,7 @@ LL | asm!("", out("vs48") _, out("v16") _); | register `vs48` error: register `v17` conflicts with register `vs49` - --> $DIR/bad-reg.rs:298:33 + --> $DIR/bad-reg.rs:322:33 | LL | asm!("", out("vs49") _, out("v17") _); | ------------- ^^^^^^^^^^^^ register `v17` @@ -589,7 +589,7 @@ LL | asm!("", out("vs49") _, out("v17") _); | register `vs49` error: register `v18` conflicts with register `vs50` - --> $DIR/bad-reg.rs:300:33 + --> $DIR/bad-reg.rs:324:33 | LL | asm!("", out("vs50") _, out("v18") _); | ------------- ^^^^^^^^^^^^ register `v18` @@ -597,7 +597,7 @@ LL | asm!("", out("vs50") _, out("v18") _); | register `vs50` error: register `v19` conflicts with register `vs51` - --> $DIR/bad-reg.rs:302:33 + --> $DIR/bad-reg.rs:326:33 | LL | asm!("", out("vs51") _, out("v19") _); | ------------- ^^^^^^^^^^^^ register `v19` @@ -605,7 +605,7 @@ LL | asm!("", out("vs51") _, out("v19") _); | register `vs51` error: register `v20` conflicts with register `vs52` - --> $DIR/bad-reg.rs:304:33 + --> $DIR/bad-reg.rs:328:33 | LL | asm!("", out("vs52") _, out("v20") _); | ------------- ^^^^^^^^^^^^ register `v20` @@ -613,7 +613,7 @@ LL | asm!("", out("vs52") _, out("v20") _); | register `vs52` error: register `v21` conflicts with register `vs53` - --> $DIR/bad-reg.rs:306:33 + --> $DIR/bad-reg.rs:332:33 | LL | asm!("", out("vs53") _, out("v21") _); | ------------- ^^^^^^^^^^^^ register `v21` @@ -621,7 +621,7 @@ LL | asm!("", out("vs53") _, out("v21") _); | register `vs53` error: register `v22` conflicts with register `vs54` - --> $DIR/bad-reg.rs:308:33 + --> $DIR/bad-reg.rs:336:33 | LL | asm!("", out("vs54") _, out("v22") _); | ------------- ^^^^^^^^^^^^ register `v22` @@ -629,7 +629,7 @@ LL | asm!("", out("vs54") _, out("v22") _); | register `vs54` error: register `v23` conflicts with register `vs55` - --> $DIR/bad-reg.rs:310:33 + --> $DIR/bad-reg.rs:340:33 | LL | asm!("", out("vs55") _, out("v23") _); | ------------- ^^^^^^^^^^^^ register `v23` @@ -637,7 +637,7 @@ LL | asm!("", out("vs55") _, out("v23") _); | register `vs55` error: register `v24` conflicts with register `vs56` - --> $DIR/bad-reg.rs:312:33 + --> $DIR/bad-reg.rs:344:33 | LL | asm!("", out("vs56") _, out("v24") _); | ------------- ^^^^^^^^^^^^ register `v24` @@ -645,7 +645,7 @@ LL | asm!("", out("vs56") _, out("v24") _); | register `vs56` error: register `v25` conflicts with register `vs57` - --> $DIR/bad-reg.rs:314:33 + --> $DIR/bad-reg.rs:348:33 | LL | asm!("", out("vs57") _, out("v25") _); | ------------- ^^^^^^^^^^^^ register `v25` @@ -653,7 +653,7 @@ LL | asm!("", out("vs57") _, out("v25") _); | register `vs57` error: register `v26` conflicts with register `vs58` - --> $DIR/bad-reg.rs:316:33 + --> $DIR/bad-reg.rs:352:33 | LL | asm!("", out("vs58") _, out("v26") _); | ------------- ^^^^^^^^^^^^ register `v26` @@ -661,7 +661,7 @@ LL | asm!("", out("vs58") _, out("v26") _); | register `vs58` error: register `v27` conflicts with register `vs59` - --> $DIR/bad-reg.rs:318:33 + --> $DIR/bad-reg.rs:356:33 | LL | asm!("", out("vs59") _, out("v27") _); | ------------- ^^^^^^^^^^^^ register `v27` @@ -669,7 +669,7 @@ LL | asm!("", out("vs59") _, out("v27") _); | register `vs59` error: register `v28` conflicts with register `vs60` - --> $DIR/bad-reg.rs:320:33 + --> $DIR/bad-reg.rs:360:33 | LL | asm!("", out("vs60") _, out("v28") _); | ------------- ^^^^^^^^^^^^ register `v28` @@ -677,7 +677,7 @@ LL | asm!("", out("vs60") _, out("v28") _); | register `vs60` error: register `v29` conflicts with register `vs61` - --> $DIR/bad-reg.rs:322:33 + --> $DIR/bad-reg.rs:364:33 | LL | asm!("", out("vs61") _, out("v29") _); | ------------- ^^^^^^^^^^^^ register `v29` @@ -685,7 +685,7 @@ LL | asm!("", out("vs61") _, out("v29") _); | register `vs61` error: register `v30` conflicts with register `vs62` - --> $DIR/bad-reg.rs:324:33 + --> $DIR/bad-reg.rs:368:33 | LL | asm!("", out("vs62") _, out("v30") _); | ------------- ^^^^^^^^^^^^ register `v30` @@ -693,7 +693,7 @@ LL | asm!("", out("vs62") _, out("v30") _); | register `vs62` error: register `v31` conflicts with register `vs63` - --> $DIR/bad-reg.rs:326:33 + --> $DIR/bad-reg.rs:372:33 | LL | asm!("", out("vs63") _, out("v31") _); | ------------- ^^^^^^^^^^^^ register `v31` @@ -701,7 +701,7 @@ LL | asm!("", out("vs63") _, out("v31") _); | register `vs63` error: register class `spe_acc` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:332:26 + --> $DIR/bad-reg.rs:380:26 | LL | asm!("/* {} */", out(spe_acc) _); | ^^^^^^^^^^^^^^ @@ -737,7 +737,7 @@ LL | asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is avai = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f16, f32, f64, f128, i64x2, f16x8, f64x2 error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:98:28 + --> $DIR/bad-reg.rs:110:28 | LL | asm!("", in("vs0") x); // FIXME: should be ok if vsx is available | ^ @@ -745,7 +745,7 @@ LL | asm!("", in("vs0") x); // FIXME: should be ok if vsx is available = note: register class `vsreg` supports these types: f16, f32, f64, f128, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2 error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:101:29 + --> $DIR/bad-reg.rs:113:29 | LL | asm!("", out("vs0") x); // FIXME: should be ok if vsx is available | ^ @@ -753,7 +753,7 @@ LL | asm!("", out("vs0") x); // FIXME: should be ok if vsx is available = note: register class `vsreg` supports these types: f16, f32, f64, f128, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2 error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:108:36 + --> $DIR/bad-reg.rs:120:36 | LL | asm!("/* {} */", in(vsreg) x); // FIXME: should be ok if vsx is available | ^ @@ -761,7 +761,7 @@ LL | asm!("/* {} */", in(vsreg) x); // FIXME: should be ok if vsx is ava = note: register class `vsreg` supports these types: f16, f32, f64, f128, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2 error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:131:27 + --> $DIR/bad-reg.rs:155:27 | LL | asm!("", in("cr") x); | ^ @@ -769,7 +769,7 @@ LL | asm!("", in("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:134:28 + --> $DIR/bad-reg.rs:158:28 | LL | asm!("", out("cr") x); | ^ @@ -777,7 +777,7 @@ LL | asm!("", out("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:137:33 + --> $DIR/bad-reg.rs:161:33 | LL | asm!("/* {} */", in(cr) x); | ^ @@ -785,7 +785,7 @@ LL | asm!("/* {} */", in(cr) x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:144:28 + --> $DIR/bad-reg.rs:168:28 | LL | asm!("", in("ctr") x); | ^ @@ -793,7 +793,7 @@ LL | asm!("", in("ctr") x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:147:29 + --> $DIR/bad-reg.rs:171:29 | LL | asm!("", out("ctr") x); | ^ @@ -801,7 +801,7 @@ LL | asm!("", out("ctr") x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:150:34 + --> $DIR/bad-reg.rs:174:34 | LL | asm!("/* {} */", in(ctr) x); | ^ @@ -809,7 +809,7 @@ LL | asm!("/* {} */", in(ctr) x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:157:27 + --> $DIR/bad-reg.rs:181:27 | LL | asm!("", in("lr") x); | ^ @@ -817,7 +817,7 @@ LL | asm!("", in("lr") x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:160:28 + --> $DIR/bad-reg.rs:184:28 | LL | asm!("", out("lr") x); | ^ @@ -825,7 +825,7 @@ LL | asm!("", out("lr") x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:163:33 + --> $DIR/bad-reg.rs:187:33 | LL | asm!("/* {} */", in(lr) x); | ^ @@ -833,7 +833,7 @@ LL | asm!("/* {} */", in(lr) x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:170:28 + --> $DIR/bad-reg.rs:194:28 | LL | asm!("", in("xer") x); | ^ @@ -841,7 +841,7 @@ LL | asm!("", in("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:173:29 + --> $DIR/bad-reg.rs:197:29 | LL | asm!("", out("xer") x); | ^ @@ -849,7 +849,7 @@ LL | asm!("", out("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:176:34 + --> $DIR/bad-reg.rs:200:34 | LL | asm!("/* {} */", in(xer) x); | ^ @@ -857,7 +857,7 @@ LL | asm!("/* {} */", in(xer) x); = note: register class `xer` supports these types: error: cannot use register `spe_acc`: spe_acc is only available on spe targets - --> $DIR/bad-reg.rs:330:18 + --> $DIR/bad-reg.rs:378:18 | LL | asm!("", out("spe_acc") _); | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/asm/powerpc/bad-reg.powerpcspe.stderr b/tests/ui/asm/powerpc/bad-reg.powerpcspe.stderr index 86ea5eed9385d..8670ff6180ce2 100644 --- a/tests/ui/asm/powerpc/bad-reg.powerpcspe.stderr +++ b/tests/ui/asm/powerpc/bad-reg.powerpcspe.stderr @@ -29,103 +29,103 @@ LL | asm!("", out("vrsave") _); | ^^^^^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:131:18 + --> $DIR/bad-reg.rs:155:18 | LL | asm!("", in("cr") x); | ^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:134:18 + --> $DIR/bad-reg.rs:158:18 | LL | asm!("", out("cr") x); | ^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:137:26 + --> $DIR/bad-reg.rs:161:26 | LL | asm!("/* {} */", in(cr) x); | ^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:140:26 + --> $DIR/bad-reg.rs:164:26 | LL | asm!("/* {} */", out(cr) _); | ^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:144:18 + --> $DIR/bad-reg.rs:168:18 | LL | asm!("", in("ctr") x); | ^^^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:147:18 + --> $DIR/bad-reg.rs:171:18 | LL | asm!("", out("ctr") x); | ^^^^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:150:26 + --> $DIR/bad-reg.rs:174:26 | LL | asm!("/* {} */", in(ctr) x); | ^^^^^^^^^ error: register class `ctr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:153:26 + --> $DIR/bad-reg.rs:177:26 | LL | asm!("/* {} */", out(ctr) _); | ^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:157:18 + --> $DIR/bad-reg.rs:181:18 | LL | asm!("", in("lr") x); | ^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:160:18 + --> $DIR/bad-reg.rs:184:18 | LL | asm!("", out("lr") x); | ^^^^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:163:26 + --> $DIR/bad-reg.rs:187:26 | LL | asm!("/* {} */", in(lr) x); | ^^^^^^^^ error: register class `lr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:166:26 + --> $DIR/bad-reg.rs:190:26 | LL | asm!("/* {} */", out(lr) _); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:170:18 + --> $DIR/bad-reg.rs:194:18 | LL | asm!("", in("xer") x); | ^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:173:18 + --> $DIR/bad-reg.rs:197:18 | LL | asm!("", out("xer") x); | ^^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:176:26 + --> $DIR/bad-reg.rs:200:26 | LL | asm!("/* {} */", in(xer) x); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:179:26 + --> $DIR/bad-reg.rs:203:26 | LL | asm!("/* {} */", out(xer) _); | ^^^^^^^^^^ error: register `cr0` conflicts with register `cr` - --> $DIR/bad-reg.rs:183:31 + --> $DIR/bad-reg.rs:207:31 | LL | asm!("", out("cr") _, out("cr0") _); | ----------- ^^^^^^^^^^^^ register `cr0` @@ -133,7 +133,7 @@ LL | asm!("", out("cr") _, out("cr0") _); | register `cr` error: register `cr1` conflicts with register `cr` - --> $DIR/bad-reg.rs:185:31 + --> $DIR/bad-reg.rs:209:31 | LL | asm!("", out("cr") _, out("cr1") _); | ----------- ^^^^^^^^^^^^ register `cr1` @@ -141,7 +141,7 @@ LL | asm!("", out("cr") _, out("cr1") _); | register `cr` error: register `cr2` conflicts with register `cr` - --> $DIR/bad-reg.rs:187:31 + --> $DIR/bad-reg.rs:211:31 | LL | asm!("", out("cr") _, out("cr2") _); | ----------- ^^^^^^^^^^^^ register `cr2` @@ -149,7 +149,7 @@ LL | asm!("", out("cr") _, out("cr2") _); | register `cr` error: register `cr3` conflicts with register `cr` - --> $DIR/bad-reg.rs:189:31 + --> $DIR/bad-reg.rs:213:31 | LL | asm!("", out("cr") _, out("cr3") _); | ----------- ^^^^^^^^^^^^ register `cr3` @@ -157,7 +157,7 @@ LL | asm!("", out("cr") _, out("cr3") _); | register `cr` error: register `cr4` conflicts with register `cr` - --> $DIR/bad-reg.rs:191:31 + --> $DIR/bad-reg.rs:215:31 | LL | asm!("", out("cr") _, out("cr4") _); | ----------- ^^^^^^^^^^^^ register `cr4` @@ -165,7 +165,7 @@ LL | asm!("", out("cr") _, out("cr4") _); | register `cr` error: register `cr5` conflicts with register `cr` - --> $DIR/bad-reg.rs:193:31 + --> $DIR/bad-reg.rs:217:31 | LL | asm!("", out("cr") _, out("cr5") _); | ----------- ^^^^^^^^^^^^ register `cr5` @@ -173,7 +173,7 @@ LL | asm!("", out("cr") _, out("cr5") _); | register `cr` error: register `cr6` conflicts with register `cr` - --> $DIR/bad-reg.rs:195:31 + --> $DIR/bad-reg.rs:219:31 | LL | asm!("", out("cr") _, out("cr6") _); | ----------- ^^^^^^^^^^^^ register `cr6` @@ -181,7 +181,7 @@ LL | asm!("", out("cr") _, out("cr6") _); | register `cr` error: register `cr7` conflicts with register `cr` - --> $DIR/bad-reg.rs:197:31 + --> $DIR/bad-reg.rs:221:31 | LL | asm!("", out("cr") _, out("cr7") _); | ----------- ^^^^^^^^^^^^ register `cr7` @@ -189,7 +189,7 @@ LL | asm!("", out("cr") _, out("cr7") _); | register `cr` error: register `vs0` conflicts with register `f0` - --> $DIR/bad-reg.rs:200:31 + --> $DIR/bad-reg.rs:224:31 | LL | asm!("", out("f0") _, out("vs0") _); | ----------- ^^^^^^^^^^^^ register `vs0` @@ -197,7 +197,7 @@ LL | asm!("", out("f0") _, out("vs0") _); | register `f0` error: register `vs1` conflicts with register `f1` - --> $DIR/bad-reg.rs:202:31 + --> $DIR/bad-reg.rs:226:31 | LL | asm!("", out("f1") _, out("vs1") _); | ----------- ^^^^^^^^^^^^ register `vs1` @@ -205,7 +205,7 @@ LL | asm!("", out("f1") _, out("vs1") _); | register `f1` error: register `vs2` conflicts with register `f2` - --> $DIR/bad-reg.rs:204:31 + --> $DIR/bad-reg.rs:228:31 | LL | asm!("", out("f2") _, out("vs2") _); | ----------- ^^^^^^^^^^^^ register `vs2` @@ -213,7 +213,7 @@ LL | asm!("", out("f2") _, out("vs2") _); | register `f2` error: register `vs3` conflicts with register `f3` - --> $DIR/bad-reg.rs:206:31 + --> $DIR/bad-reg.rs:230:31 | LL | asm!("", out("f3") _, out("vs3") _); | ----------- ^^^^^^^^^^^^ register `vs3` @@ -221,7 +221,7 @@ LL | asm!("", out("f3") _, out("vs3") _); | register `f3` error: register `vs4` conflicts with register `f4` - --> $DIR/bad-reg.rs:208:31 + --> $DIR/bad-reg.rs:232:31 | LL | asm!("", out("f4") _, out("vs4") _); | ----------- ^^^^^^^^^^^^ register `vs4` @@ -229,7 +229,7 @@ LL | asm!("", out("f4") _, out("vs4") _); | register `f4` error: register `vs5` conflicts with register `f5` - --> $DIR/bad-reg.rs:210:31 + --> $DIR/bad-reg.rs:234:31 | LL | asm!("", out("f5") _, out("vs5") _); | ----------- ^^^^^^^^^^^^ register `vs5` @@ -237,7 +237,7 @@ LL | asm!("", out("f5") _, out("vs5") _); | register `f5` error: register `vs6` conflicts with register `f6` - --> $DIR/bad-reg.rs:212:31 + --> $DIR/bad-reg.rs:236:31 | LL | asm!("", out("f6") _, out("vs6") _); | ----------- ^^^^^^^^^^^^ register `vs6` @@ -245,7 +245,7 @@ LL | asm!("", out("f6") _, out("vs6") _); | register `f6` error: register `vs7` conflicts with register `f7` - --> $DIR/bad-reg.rs:214:31 + --> $DIR/bad-reg.rs:238:31 | LL | asm!("", out("f7") _, out("vs7") _); | ----------- ^^^^^^^^^^^^ register `vs7` @@ -253,7 +253,7 @@ LL | asm!("", out("f7") _, out("vs7") _); | register `f7` error: register `vs8` conflicts with register `f8` - --> $DIR/bad-reg.rs:216:31 + --> $DIR/bad-reg.rs:240:31 | LL | asm!("", out("f8") _, out("vs8") _); | ----------- ^^^^^^^^^^^^ register `vs8` @@ -261,7 +261,7 @@ LL | asm!("", out("f8") _, out("vs8") _); | register `f8` error: register `vs9` conflicts with register `f9` - --> $DIR/bad-reg.rs:218:31 + --> $DIR/bad-reg.rs:242:31 | LL | asm!("", out("f9") _, out("vs9") _); | ----------- ^^^^^^^^^^^^ register `vs9` @@ -269,7 +269,7 @@ LL | asm!("", out("f9") _, out("vs9") _); | register `f9` error: register `vs10` conflicts with register `f10` - --> $DIR/bad-reg.rs:220:32 + --> $DIR/bad-reg.rs:244:32 | LL | asm!("", out("f10") _, out("vs10") _); | ------------ ^^^^^^^^^^^^^ register `vs10` @@ -277,7 +277,7 @@ LL | asm!("", out("f10") _, out("vs10") _); | register `f10` error: register `vs11` conflicts with register `f11` - --> $DIR/bad-reg.rs:222:32 + --> $DIR/bad-reg.rs:246:32 | LL | asm!("", out("f11") _, out("vs11") _); | ------------ ^^^^^^^^^^^^^ register `vs11` @@ -285,7 +285,7 @@ LL | asm!("", out("f11") _, out("vs11") _); | register `f11` error: register `vs12` conflicts with register `f12` - --> $DIR/bad-reg.rs:224:32 + --> $DIR/bad-reg.rs:248:32 | LL | asm!("", out("f12") _, out("vs12") _); | ------------ ^^^^^^^^^^^^^ register `vs12` @@ -293,7 +293,7 @@ LL | asm!("", out("f12") _, out("vs12") _); | register `f12` error: register `vs13` conflicts with register `f13` - --> $DIR/bad-reg.rs:226:32 + --> $DIR/bad-reg.rs:250:32 | LL | asm!("", out("f13") _, out("vs13") _); | ------------ ^^^^^^^^^^^^^ register `vs13` @@ -301,7 +301,7 @@ LL | asm!("", out("f13") _, out("vs13") _); | register `f13` error: register `vs14` conflicts with register `f14` - --> $DIR/bad-reg.rs:228:32 + --> $DIR/bad-reg.rs:252:32 | LL | asm!("", out("f14") _, out("vs14") _); | ------------ ^^^^^^^^^^^^^ register `vs14` @@ -309,7 +309,7 @@ LL | asm!("", out("f14") _, out("vs14") _); | register `f14` error: register `vs15` conflicts with register `f15` - --> $DIR/bad-reg.rs:230:32 + --> $DIR/bad-reg.rs:254:32 | LL | asm!("", out("f15") _, out("vs15") _); | ------------ ^^^^^^^^^^^^^ register `vs15` @@ -317,7 +317,7 @@ LL | asm!("", out("f15") _, out("vs15") _); | register `f15` error: register `vs16` conflicts with register `f16` - --> $DIR/bad-reg.rs:232:32 + --> $DIR/bad-reg.rs:256:32 | LL | asm!("", out("f16") _, out("vs16") _); | ------------ ^^^^^^^^^^^^^ register `vs16` @@ -325,7 +325,7 @@ LL | asm!("", out("f16") _, out("vs16") _); | register `f16` error: register `vs17` conflicts with register `f17` - --> $DIR/bad-reg.rs:234:32 + --> $DIR/bad-reg.rs:258:32 | LL | asm!("", out("f17") _, out("vs17") _); | ------------ ^^^^^^^^^^^^^ register `vs17` @@ -333,7 +333,7 @@ LL | asm!("", out("f17") _, out("vs17") _); | register `f17` error: register `vs18` conflicts with register `f18` - --> $DIR/bad-reg.rs:236:32 + --> $DIR/bad-reg.rs:260:32 | LL | asm!("", out("f18") _, out("vs18") _); | ------------ ^^^^^^^^^^^^^ register `vs18` @@ -341,7 +341,7 @@ LL | asm!("", out("f18") _, out("vs18") _); | register `f18` error: register `vs19` conflicts with register `f19` - --> $DIR/bad-reg.rs:238:32 + --> $DIR/bad-reg.rs:262:32 | LL | asm!("", out("f19") _, out("vs19") _); | ------------ ^^^^^^^^^^^^^ register `vs19` @@ -349,7 +349,7 @@ LL | asm!("", out("f19") _, out("vs19") _); | register `f19` error: register `vs20` conflicts with register `f20` - --> $DIR/bad-reg.rs:240:32 + --> $DIR/bad-reg.rs:264:32 | LL | asm!("", out("f20") _, out("vs20") _); | ------------ ^^^^^^^^^^^^^ register `vs20` @@ -357,7 +357,7 @@ LL | asm!("", out("f20") _, out("vs20") _); | register `f20` error: register `vs21` conflicts with register `f21` - --> $DIR/bad-reg.rs:242:32 + --> $DIR/bad-reg.rs:266:32 | LL | asm!("", out("f21") _, out("vs21") _); | ------------ ^^^^^^^^^^^^^ register `vs21` @@ -365,7 +365,7 @@ LL | asm!("", out("f21") _, out("vs21") _); | register `f21` error: register `vs22` conflicts with register `f22` - --> $DIR/bad-reg.rs:244:32 + --> $DIR/bad-reg.rs:268:32 | LL | asm!("", out("f22") _, out("vs22") _); | ------------ ^^^^^^^^^^^^^ register `vs22` @@ -373,7 +373,7 @@ LL | asm!("", out("f22") _, out("vs22") _); | register `f22` error: register `vs23` conflicts with register `f23` - --> $DIR/bad-reg.rs:246:32 + --> $DIR/bad-reg.rs:270:32 | LL | asm!("", out("f23") _, out("vs23") _); | ------------ ^^^^^^^^^^^^^ register `vs23` @@ -381,7 +381,7 @@ LL | asm!("", out("f23") _, out("vs23") _); | register `f23` error: register `vs24` conflicts with register `f24` - --> $DIR/bad-reg.rs:248:32 + --> $DIR/bad-reg.rs:272:32 | LL | asm!("", out("f24") _, out("vs24") _); | ------------ ^^^^^^^^^^^^^ register `vs24` @@ -389,7 +389,7 @@ LL | asm!("", out("f24") _, out("vs24") _); | register `f24` error: register `vs25` conflicts with register `f25` - --> $DIR/bad-reg.rs:250:32 + --> $DIR/bad-reg.rs:274:32 | LL | asm!("", out("f25") _, out("vs25") _); | ------------ ^^^^^^^^^^^^^ register `vs25` @@ -397,7 +397,7 @@ LL | asm!("", out("f25") _, out("vs25") _); | register `f25` error: register `vs26` conflicts with register `f26` - --> $DIR/bad-reg.rs:252:32 + --> $DIR/bad-reg.rs:276:32 | LL | asm!("", out("f26") _, out("vs26") _); | ------------ ^^^^^^^^^^^^^ register `vs26` @@ -405,7 +405,7 @@ LL | asm!("", out("f26") _, out("vs26") _); | register `f26` error: register `vs27` conflicts with register `f27` - --> $DIR/bad-reg.rs:254:32 + --> $DIR/bad-reg.rs:278:32 | LL | asm!("", out("f27") _, out("vs27") _); | ------------ ^^^^^^^^^^^^^ register `vs27` @@ -413,7 +413,7 @@ LL | asm!("", out("f27") _, out("vs27") _); | register `f27` error: register `vs28` conflicts with register `f28` - --> $DIR/bad-reg.rs:256:32 + --> $DIR/bad-reg.rs:280:32 | LL | asm!("", out("f28") _, out("vs28") _); | ------------ ^^^^^^^^^^^^^ register `vs28` @@ -421,7 +421,7 @@ LL | asm!("", out("f28") _, out("vs28") _); | register `f28` error: register `vs29` conflicts with register `f29` - --> $DIR/bad-reg.rs:258:32 + --> $DIR/bad-reg.rs:282:32 | LL | asm!("", out("f29") _, out("vs29") _); | ------------ ^^^^^^^^^^^^^ register `vs29` @@ -429,7 +429,7 @@ LL | asm!("", out("f29") _, out("vs29") _); | register `f29` error: register `vs30` conflicts with register `f30` - --> $DIR/bad-reg.rs:260:32 + --> $DIR/bad-reg.rs:284:32 | LL | asm!("", out("f30") _, out("vs30") _); | ------------ ^^^^^^^^^^^^^ register `vs30` @@ -437,7 +437,7 @@ LL | asm!("", out("f30") _, out("vs30") _); | register `f30` error: register `vs31` conflicts with register `f31` - --> $DIR/bad-reg.rs:262:32 + --> $DIR/bad-reg.rs:286:32 | LL | asm!("", out("f31") _, out("vs31") _); | ------------ ^^^^^^^^^^^^^ register `vs31` @@ -445,7 +445,7 @@ LL | asm!("", out("f31") _, out("vs31") _); | register `f31` error: register `v0` conflicts with register `vs32` - --> $DIR/bad-reg.rs:264:33 + --> $DIR/bad-reg.rs:288:33 | LL | asm!("", out("vs32") _, out("v0") _); | ------------- ^^^^^^^^^^^ register `v0` @@ -453,7 +453,7 @@ LL | asm!("", out("vs32") _, out("v0") _); | register `vs32` error: register `v1` conflicts with register `vs33` - --> $DIR/bad-reg.rs:266:33 + --> $DIR/bad-reg.rs:290:33 | LL | asm!("", out("vs33") _, out("v1") _); | ------------- ^^^^^^^^^^^ register `v1` @@ -461,7 +461,7 @@ LL | asm!("", out("vs33") _, out("v1") _); | register `vs33` error: register `v2` conflicts with register `vs34` - --> $DIR/bad-reg.rs:268:33 + --> $DIR/bad-reg.rs:292:33 | LL | asm!("", out("vs34") _, out("v2") _); | ------------- ^^^^^^^^^^^ register `v2` @@ -469,7 +469,7 @@ LL | asm!("", out("vs34") _, out("v2") _); | register `vs34` error: register `v3` conflicts with register `vs35` - --> $DIR/bad-reg.rs:270:33 + --> $DIR/bad-reg.rs:294:33 | LL | asm!("", out("vs35") _, out("v3") _); | ------------- ^^^^^^^^^^^ register `v3` @@ -477,7 +477,7 @@ LL | asm!("", out("vs35") _, out("v3") _); | register `vs35` error: register `v4` conflicts with register `vs36` - --> $DIR/bad-reg.rs:272:33 + --> $DIR/bad-reg.rs:296:33 | LL | asm!("", out("vs36") _, out("v4") _); | ------------- ^^^^^^^^^^^ register `v4` @@ -485,7 +485,7 @@ LL | asm!("", out("vs36") _, out("v4") _); | register `vs36` error: register `v5` conflicts with register `vs37` - --> $DIR/bad-reg.rs:274:33 + --> $DIR/bad-reg.rs:298:33 | LL | asm!("", out("vs37") _, out("v5") _); | ------------- ^^^^^^^^^^^ register `v5` @@ -493,7 +493,7 @@ LL | asm!("", out("vs37") _, out("v5") _); | register `vs37` error: register `v6` conflicts with register `vs38` - --> $DIR/bad-reg.rs:276:33 + --> $DIR/bad-reg.rs:300:33 | LL | asm!("", out("vs38") _, out("v6") _); | ------------- ^^^^^^^^^^^ register `v6` @@ -501,7 +501,7 @@ LL | asm!("", out("vs38") _, out("v6") _); | register `vs38` error: register `v7` conflicts with register `vs39` - --> $DIR/bad-reg.rs:278:33 + --> $DIR/bad-reg.rs:302:33 | LL | asm!("", out("vs39") _, out("v7") _); | ------------- ^^^^^^^^^^^ register `v7` @@ -509,7 +509,7 @@ LL | asm!("", out("vs39") _, out("v7") _); | register `vs39` error: register `v8` conflicts with register `vs40` - --> $DIR/bad-reg.rs:280:33 + --> $DIR/bad-reg.rs:304:33 | LL | asm!("", out("vs40") _, out("v8") _); | ------------- ^^^^^^^^^^^ register `v8` @@ -517,7 +517,7 @@ LL | asm!("", out("vs40") _, out("v8") _); | register `vs40` error: register `v9` conflicts with register `vs41` - --> $DIR/bad-reg.rs:282:33 + --> $DIR/bad-reg.rs:306:33 | LL | asm!("", out("vs41") _, out("v9") _); | ------------- ^^^^^^^^^^^ register `v9` @@ -525,7 +525,7 @@ LL | asm!("", out("vs41") _, out("v9") _); | register `vs41` error: register `v10` conflicts with register `vs42` - --> $DIR/bad-reg.rs:284:33 + --> $DIR/bad-reg.rs:308:33 | LL | asm!("", out("vs42") _, out("v10") _); | ------------- ^^^^^^^^^^^^ register `v10` @@ -533,7 +533,7 @@ LL | asm!("", out("vs42") _, out("v10") _); | register `vs42` error: register `v11` conflicts with register `vs43` - --> $DIR/bad-reg.rs:286:33 + --> $DIR/bad-reg.rs:310:33 | LL | asm!("", out("vs43") _, out("v11") _); | ------------- ^^^^^^^^^^^^ register `v11` @@ -541,7 +541,7 @@ LL | asm!("", out("vs43") _, out("v11") _); | register `vs43` error: register `v12` conflicts with register `vs44` - --> $DIR/bad-reg.rs:288:33 + --> $DIR/bad-reg.rs:312:33 | LL | asm!("", out("vs44") _, out("v12") _); | ------------- ^^^^^^^^^^^^ register `v12` @@ -549,7 +549,7 @@ LL | asm!("", out("vs44") _, out("v12") _); | register `vs44` error: register `v13` conflicts with register `vs45` - --> $DIR/bad-reg.rs:290:33 + --> $DIR/bad-reg.rs:314:33 | LL | asm!("", out("vs45") _, out("v13") _); | ------------- ^^^^^^^^^^^^ register `v13` @@ -557,7 +557,7 @@ LL | asm!("", out("vs45") _, out("v13") _); | register `vs45` error: register `v14` conflicts with register `vs46` - --> $DIR/bad-reg.rs:292:33 + --> $DIR/bad-reg.rs:316:33 | LL | asm!("", out("vs46") _, out("v14") _); | ------------- ^^^^^^^^^^^^ register `v14` @@ -565,7 +565,7 @@ LL | asm!("", out("vs46") _, out("v14") _); | register `vs46` error: register `v15` conflicts with register `vs47` - --> $DIR/bad-reg.rs:294:33 + --> $DIR/bad-reg.rs:318:33 | LL | asm!("", out("vs47") _, out("v15") _); | ------------- ^^^^^^^^^^^^ register `v15` @@ -573,7 +573,7 @@ LL | asm!("", out("vs47") _, out("v15") _); | register `vs47` error: register `v16` conflicts with register `vs48` - --> $DIR/bad-reg.rs:296:33 + --> $DIR/bad-reg.rs:320:33 | LL | asm!("", out("vs48") _, out("v16") _); | ------------- ^^^^^^^^^^^^ register `v16` @@ -581,7 +581,7 @@ LL | asm!("", out("vs48") _, out("v16") _); | register `vs48` error: register `v17` conflicts with register `vs49` - --> $DIR/bad-reg.rs:298:33 + --> $DIR/bad-reg.rs:322:33 | LL | asm!("", out("vs49") _, out("v17") _); | ------------- ^^^^^^^^^^^^ register `v17` @@ -589,7 +589,7 @@ LL | asm!("", out("vs49") _, out("v17") _); | register `vs49` error: register `v18` conflicts with register `vs50` - --> $DIR/bad-reg.rs:300:33 + --> $DIR/bad-reg.rs:324:33 | LL | asm!("", out("vs50") _, out("v18") _); | ------------- ^^^^^^^^^^^^ register `v18` @@ -597,7 +597,7 @@ LL | asm!("", out("vs50") _, out("v18") _); | register `vs50` error: register `v19` conflicts with register `vs51` - --> $DIR/bad-reg.rs:302:33 + --> $DIR/bad-reg.rs:326:33 | LL | asm!("", out("vs51") _, out("v19") _); | ------------- ^^^^^^^^^^^^ register `v19` @@ -605,7 +605,7 @@ LL | asm!("", out("vs51") _, out("v19") _); | register `vs51` error: register `v20` conflicts with register `vs52` - --> $DIR/bad-reg.rs:304:33 + --> $DIR/bad-reg.rs:328:33 | LL | asm!("", out("vs52") _, out("v20") _); | ------------- ^^^^^^^^^^^^ register `v20` @@ -613,7 +613,7 @@ LL | asm!("", out("vs52") _, out("v20") _); | register `vs52` error: register `v21` conflicts with register `vs53` - --> $DIR/bad-reg.rs:306:33 + --> $DIR/bad-reg.rs:332:33 | LL | asm!("", out("vs53") _, out("v21") _); | ------------- ^^^^^^^^^^^^ register `v21` @@ -621,7 +621,7 @@ LL | asm!("", out("vs53") _, out("v21") _); | register `vs53` error: register `v22` conflicts with register `vs54` - --> $DIR/bad-reg.rs:308:33 + --> $DIR/bad-reg.rs:336:33 | LL | asm!("", out("vs54") _, out("v22") _); | ------------- ^^^^^^^^^^^^ register `v22` @@ -629,7 +629,7 @@ LL | asm!("", out("vs54") _, out("v22") _); | register `vs54` error: register `v23` conflicts with register `vs55` - --> $DIR/bad-reg.rs:310:33 + --> $DIR/bad-reg.rs:340:33 | LL | asm!("", out("vs55") _, out("v23") _); | ------------- ^^^^^^^^^^^^ register `v23` @@ -637,7 +637,7 @@ LL | asm!("", out("vs55") _, out("v23") _); | register `vs55` error: register `v24` conflicts with register `vs56` - --> $DIR/bad-reg.rs:312:33 + --> $DIR/bad-reg.rs:344:33 | LL | asm!("", out("vs56") _, out("v24") _); | ------------- ^^^^^^^^^^^^ register `v24` @@ -645,7 +645,7 @@ LL | asm!("", out("vs56") _, out("v24") _); | register `vs56` error: register `v25` conflicts with register `vs57` - --> $DIR/bad-reg.rs:314:33 + --> $DIR/bad-reg.rs:348:33 | LL | asm!("", out("vs57") _, out("v25") _); | ------------- ^^^^^^^^^^^^ register `v25` @@ -653,7 +653,7 @@ LL | asm!("", out("vs57") _, out("v25") _); | register `vs57` error: register `v26` conflicts with register `vs58` - --> $DIR/bad-reg.rs:316:33 + --> $DIR/bad-reg.rs:352:33 | LL | asm!("", out("vs58") _, out("v26") _); | ------------- ^^^^^^^^^^^^ register `v26` @@ -661,7 +661,7 @@ LL | asm!("", out("vs58") _, out("v26") _); | register `vs58` error: register `v27` conflicts with register `vs59` - --> $DIR/bad-reg.rs:318:33 + --> $DIR/bad-reg.rs:356:33 | LL | asm!("", out("vs59") _, out("v27") _); | ------------- ^^^^^^^^^^^^ register `v27` @@ -669,7 +669,7 @@ LL | asm!("", out("vs59") _, out("v27") _); | register `vs59` error: register `v28` conflicts with register `vs60` - --> $DIR/bad-reg.rs:320:33 + --> $DIR/bad-reg.rs:360:33 | LL | asm!("", out("vs60") _, out("v28") _); | ------------- ^^^^^^^^^^^^ register `v28` @@ -677,7 +677,7 @@ LL | asm!("", out("vs60") _, out("v28") _); | register `vs60` error: register `v29` conflicts with register `vs61` - --> $DIR/bad-reg.rs:322:33 + --> $DIR/bad-reg.rs:364:33 | LL | asm!("", out("vs61") _, out("v29") _); | ------------- ^^^^^^^^^^^^ register `v29` @@ -685,7 +685,7 @@ LL | asm!("", out("vs61") _, out("v29") _); | register `vs61` error: register `v30` conflicts with register `vs62` - --> $DIR/bad-reg.rs:324:33 + --> $DIR/bad-reg.rs:368:33 | LL | asm!("", out("vs62") _, out("v30") _); | ------------- ^^^^^^^^^^^^ register `v30` @@ -693,7 +693,7 @@ LL | asm!("", out("vs62") _, out("v30") _); | register `vs62` error: register `v31` conflicts with register `vs63` - --> $DIR/bad-reg.rs:326:33 + --> $DIR/bad-reg.rs:372:33 | LL | asm!("", out("vs63") _, out("v31") _); | ------------- ^^^^^^^^^^^^ register `v31` @@ -701,7 +701,7 @@ LL | asm!("", out("vs63") _, out("v31") _); | register `vs63` error: register class `spe_acc` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:332:26 + --> $DIR/bad-reg.rs:380:26 | LL | asm!("/* {} */", out(spe_acc) _); | ^^^^^^^^^^^^^^ @@ -779,67 +779,67 @@ LL | asm!("/* {} */", out(vreg) _); // requires altivec | ^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:90:18 + --> $DIR/bad-reg.rs:102:18 | LL | asm!("", in("vs0") v32x4); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:92:18 + --> $DIR/bad-reg.rs:104:18 | LL | asm!("", out("vs0") v32x4); // requires vsx | ^^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:94:18 + --> $DIR/bad-reg.rs:106:18 | LL | asm!("", in("vs0") v64x2); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:96:18 + --> $DIR/bad-reg.rs:108:18 | LL | asm!("", out("vs0") v64x2); // requires vsx | ^^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:98:18 + --> $DIR/bad-reg.rs:110:18 | LL | asm!("", in("vs0") x); // FIXME: should be ok if vsx is available | ^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:101:18 + --> $DIR/bad-reg.rs:113:18 | LL | asm!("", out("vs0") x); // FIXME: should be ok if vsx is available | ^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:104:26 + --> $DIR/bad-reg.rs:116:26 | LL | asm!("/* {} */", in(vsreg) v32x4); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:106:26 + --> $DIR/bad-reg.rs:118:26 | LL | asm!("/* {} */", in(vsreg) v64x2); // requires vsx | ^^^^^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:108:26 + --> $DIR/bad-reg.rs:120:26 | LL | asm!("/* {} */", in(vsreg) x); // FIXME: should be ok if vsx is available | ^^^^^^^^^^^ error: register class `vsreg` requires the `vsx` target feature - --> $DIR/bad-reg.rs:111:26 + --> $DIR/bad-reg.rs:123:26 | LL | asm!("/* {} */", out(vsreg) _); // requires vsx | ^^^^^^^^^^^^ error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:131:27 + --> $DIR/bad-reg.rs:155:27 | LL | asm!("", in("cr") x); | ^ @@ -847,7 +847,7 @@ LL | asm!("", in("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:134:28 + --> $DIR/bad-reg.rs:158:28 | LL | asm!("", out("cr") x); | ^ @@ -855,7 +855,7 @@ LL | asm!("", out("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:137:33 + --> $DIR/bad-reg.rs:161:33 | LL | asm!("/* {} */", in(cr) x); | ^ @@ -863,7 +863,7 @@ LL | asm!("/* {} */", in(cr) x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:144:28 + --> $DIR/bad-reg.rs:168:28 | LL | asm!("", in("ctr") x); | ^ @@ -871,7 +871,7 @@ LL | asm!("", in("ctr") x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:147:29 + --> $DIR/bad-reg.rs:171:29 | LL | asm!("", out("ctr") x); | ^ @@ -879,7 +879,7 @@ LL | asm!("", out("ctr") x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:150:34 + --> $DIR/bad-reg.rs:174:34 | LL | asm!("/* {} */", in(ctr) x); | ^ @@ -887,7 +887,7 @@ LL | asm!("/* {} */", in(ctr) x); = note: register class `ctr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:157:27 + --> $DIR/bad-reg.rs:181:27 | LL | asm!("", in("lr") x); | ^ @@ -895,7 +895,7 @@ LL | asm!("", in("lr") x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:160:28 + --> $DIR/bad-reg.rs:184:28 | LL | asm!("", out("lr") x); | ^ @@ -903,7 +903,7 @@ LL | asm!("", out("lr") x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:163:33 + --> $DIR/bad-reg.rs:187:33 | LL | asm!("/* {} */", in(lr) x); | ^ @@ -911,7 +911,7 @@ LL | asm!("/* {} */", in(lr) x); = note: register class `lr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:170:28 + --> $DIR/bad-reg.rs:194:28 | LL | asm!("", in("xer") x); | ^ @@ -919,7 +919,7 @@ LL | asm!("", in("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:173:29 + --> $DIR/bad-reg.rs:197:29 | LL | asm!("", out("xer") x); | ^ @@ -927,7 +927,7 @@ LL | asm!("", out("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:176:34 + --> $DIR/bad-reg.rs:200:34 | LL | asm!("/* {} */", in(xer) x); | ^ diff --git a/tests/ui/asm/powerpc/bad-reg.rs b/tests/ui/asm/powerpc/bad-reg.rs index 88c78859e8326..4e45a5b61a8df 100644 --- a/tests/ui/asm/powerpc/bad-reg.rs +++ b/tests/ui/asm/powerpc/bad-reg.rs @@ -71,19 +71,31 @@ fn f() { //[powerpc64,powerpc64le,aix64]~^^ ERROR type `i32` cannot be used with this register class asm!("/* {} */", out(vreg) _); // requires altivec //[powerpc,powerpcspe]~^ ERROR register class `vreg` requires at least one of the following target features: altivec, vsx - // v20-v31 (vs52-vs63) are reserved on AIX with vec-default ABI (this ABI is not currently used in Rust's builtin AIX targets). + // v20-v31 (vs52-vs63) are reserved on AIX with vec-default ABI, the ABI we currently use for our AIX target. asm!("", out("v20") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("v21") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("v22") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("v23") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("v24") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("v25") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("v26") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("v27") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("v28") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("v29") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("v30") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("v31") _); + //[aix64]~^ ERROR are reserved on vec-default ABI // vsreg asm!("", out("vs0") _); // always ok @@ -111,19 +123,31 @@ fn f() { asm!("/* {} */", out(vsreg) _); // requires vsx //[powerpc,powerpcspe,powerpc64]~^ ERROR register class `vsreg` requires the `vsx` target feature - // v20-v31 (vs52-vs63) are reserved on AIX with vec-default ABI (this ABI is not currently used in Rust's builtin AIX targets). + // v20-v31 (vs52-vs63) are reserved on AIX with vec-default ABI, the ABI we currently use for our AIX target. asm!("", out("vs52") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("vs53") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("vs54") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("vs55") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("vs56") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("vs57") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("vs58") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("vs59") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("vs60") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("vs61") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("vs62") _); + //[aix64]~^ ERROR are reserved on vec-default ABI asm!("", out("vs63") _); + //[aix64]~^ ERROR are reserved on vec-default ABI // Clobber-only registers // cr @@ -303,28 +327,52 @@ fn f() { //~^ ERROR register `v19` conflicts with register `vs51` asm!("", out("vs52") _, out("v20") _); //~^ ERROR register `v20` conflicts with register `vs52` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI asm!("", out("vs53") _, out("v21") _); //~^ ERROR register `v21` conflicts with register `vs53` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI asm!("", out("vs54") _, out("v22") _); //~^ ERROR register `v22` conflicts with register `vs54` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI asm!("", out("vs55") _, out("v23") _); //~^ ERROR register `v23` conflicts with register `vs55` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI asm!("", out("vs56") _, out("v24") _); //~^ ERROR register `v24` conflicts with register `vs56` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI asm!("", out("vs57") _, out("v25") _); //~^ ERROR register `v25` conflicts with register `vs57` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI asm!("", out("vs58") _, out("v26") _); //~^ ERROR register `v26` conflicts with register `vs58` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI asm!("", out("vs59") _, out("v27") _); //~^ ERROR register `v27` conflicts with register `vs59` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI asm!("", out("vs60") _, out("v28") _); //~^ ERROR register `v28` conflicts with register `vs60` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI asm!("", out("vs61") _, out("v29") _); //~^ ERROR register `v29` conflicts with register `vs61` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI asm!("", out("vs62") _, out("v30") _); //~^ ERROR register `v30` conflicts with register `vs62` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI asm!("", out("vs63") _, out("v31") _); //~^ ERROR register `v31` conflicts with register `vs63` + //[aix64]~| ERROR are reserved on vec-default ABI + //[aix64]~| ERROR are reserved on vec-default ABI // powerpc-*spe target specific tests asm!("", out("spe_acc") _); diff --git a/tests/ui/check-cfg/well-known-values.stderr b/tests/ui/check-cfg/well-known-values.stderr index 98404cd495dcf..5ccaf1e9aa698 100644 --- a/tests/ui/check-cfg/well-known-values.stderr +++ b/tests/ui/check-cfg/well-known-values.stderr @@ -140,7 +140,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` LL | target_abi = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: expected values for `target_abi` are: ``, `abi64`, `abiv2`, `abiv2hf`, `eabi`, `eabihf`, `elfv1`, `elfv2`, `fortanix`, `ilp32`, `ilp32e`, `llvm`, `macabi`, `pauthtest`, `sim`, `softfloat`, `spe`, `uwp`, `v8plus`, `vec-extabi`, and `x32` + = note: expected values for `target_abi` are: ``, `abi64`, `abiv2`, `abiv2hf`, `eabi`, `eabihf`, `elfv1`, `elfv2`, `fortanix`, `ilp32`, `ilp32e`, `llvm`, `macabi`, `pauthtest`, `sim`, `softfloat`, `spe`, `uwp`, `v8plus`, `vec-default`, and `x32` = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` From 99ad5253410791aed55a6587057c29f4e4d115cd Mon Sep 17 00:00:00 2001 From: Shun Sakai Date: Tue, 22 Sep 2026 08:34:00 +0900 Subject: [PATCH 08/19] feat(time): add `Duration::{WEEK, DAY, HOUR, MINUTE}` --- library/core/src/time.rs | 80 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/library/core/src/time.rs b/library/core/src/time.rs index c123c66ee3bc0..6f33fdd36e53b 100644 --- a/library/core/src/time.rs +++ b/library/core/src/time.rs @@ -136,6 +136,86 @@ impl Duration { #[unstable(feature = "duration_constants", issue = "57391")] pub const NANOSECOND: Duration = Duration::from_nanos(1); + /// The duration of one week. + /// + /// For this constant, one week is defined as 7 days, or 604,800 seconds. + /// + /// # Examples + /// + /// ``` + /// #![feature(duration_constants)] + /// #![feature(duration_constructors)] + /// use std::time::Duration; + /// + /// let week = Duration::WEEK; + /// + /// assert_eq!(week, Duration::from_weeks(1)); + /// assert_eq!(week.as_secs(), 604_800); + /// assert_eq!(week.subsec_nanos(), 0); + /// ``` + #[unstable(feature = "duration_constants", issue = "57391")] + // Also, #[unstable(feature = "duration_constructors", issue = "120301")] + pub const WEEK: Duration = Duration::from_weeks(1); + + /// The duration of one day. + /// + /// For this constant, one day is defined as 24 hours, or 86,400 seconds. + /// + /// # Examples + /// + /// ``` + /// #![feature(duration_constants)] + /// #![feature(duration_constructors)] + /// use std::time::Duration; + /// + /// let day = Duration::DAY; + /// + /// assert_eq!(day, Duration::from_days(1)); + /// assert_eq!(day.as_secs(), 86400); + /// assert_eq!(day.subsec_nanos(), 0); + /// ``` + #[unstable(feature = "duration_constants", issue = "57391")] + // Also, #[unstable(feature = "duration_constructors", issue = "120301")] + pub const DAY: Duration = Duration::from_days(1); + + /// The duration of one hour. + /// + /// For this constant, one hour is defined as 60 minutes, or 3,600 seconds. + /// + /// # Examples + /// + /// ``` + /// #![feature(duration_constants)] + /// use std::time::Duration; + /// + /// let hour = Duration::HOUR; + /// + /// assert_eq!(hour, Duration::from_hours(1)); + /// assert_eq!(hour.as_secs(), 3600); + /// assert_eq!(hour.subsec_nanos(), 0); + /// ``` + #[unstable(feature = "duration_constants", issue = "57391")] + pub const HOUR: Duration = Duration::from_hours(1); + + /// The duration of one minute. + /// + /// For this constant, one minute is defined as 60 seconds. + /// + /// # Examples + /// + /// ``` + /// #![feature(duration_constants)] + /// use std::time::Duration; + /// + /// let minute = Duration::MINUTE; + /// + /// assert_eq!(minute, Duration::from_mins(1)); + /// assert_eq!(minute.as_secs(), 60); + /// assert_eq!(minute.subsec_nanos(), 0); + /// ``` + #[unstable(feature = "duration_constants", issue = "57391")] + pub const MINUTE: Duration = Duration::from_mins(1); + /// A duration of zero time. /// /// # Examples From 9c18639026876e93b4bb739fad7925d013c6f32f Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Sat, 5 Sep 2026 01:04:39 +0000 Subject: [PATCH 09/19] Add regression test for auto trait leakage of foreign hidden types --- .../auxiliary/opaque-auto-trait-leakage.rs | 15 ++++++++ .../opaque-hidden-ty-inference.rs | 38 +++++++++++++++++++ .../opaque-hidden-ty-inference.stderr | 30 +++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 tests/ui/impl-trait/auto-trait-leakage/auxiliary/opaque-auto-trait-leakage.rs create mode 100644 tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.rs create mode 100644 tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.stderr diff --git a/tests/ui/impl-trait/auto-trait-leakage/auxiliary/opaque-auto-trait-leakage.rs b/tests/ui/impl-trait/auto-trait-leakage/auxiliary/opaque-auto-trait-leakage.rs new file mode 100644 index 0000000000000..d7a2c4a8642eb --- /dev/null +++ b/tests/ui/impl-trait/auto-trait-leakage/auxiliary/opaque-auto-trait-leakage.rs @@ -0,0 +1,15 @@ +pub struct WaddupGamers(Option, U); + +impl, U> Unpin for WaddupGamers {} + +pub trait Leak { + type Assoc; +} + +impl Leak for T { + type Assoc = T; +} + +pub fn define() -> impl Sized { + WaddupGamers(None::, || ()) +} diff --git a/tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.rs b/tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.rs new file mode 100644 index 0000000000000..d1b4e54ff3bb2 --- /dev/null +++ b/tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.rs @@ -0,0 +1,38 @@ +//@ ignore-compare-mode-next-solver +//@ compile-flags: -Znext-solver +//@ aux-build:opaque-auto-trait-leakage.rs + +//! Regression test for https://github.com/rust-lang/rust/issues/134578. +//! Leaking the auto traits of a foreign opaque must not constrain inference +//! variables in the caller, as that would leak the hidden type itself. Here +//! that would constrain `NameMe` to a closure from the auxiliary crate and +//! ICE in typeck. The hidden type may still show up in the diagnostic. + +#![feature(type_alias_impl_trait)] +#![allow(unused)] + +extern crate opaque_auto_trait_leakage as dep; + +use dep::*; + +fn require_auto(x: T) -> T { + x +} + +type NameMe = impl Sized; + +#[define_opaque(NameMe)] +fn leak() -> NameMe +where + T: Leak>, +{ + // Proving `impl Sized: Unpin` must not constrain `NameMe` + // to the foreign closure hidden inside `define`. + let opaque = require_auto(define::()); + //~^ ERROR type mismatch resolving `::Assoc == {closure@define::{closure#0}}` + let closure; + loop {} + return closure; +} + +fn main() {} diff --git a/tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.stderr b/tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.stderr new file mode 100644 index 0000000000000..b70fde561cd43 --- /dev/null +++ b/tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.stderr @@ -0,0 +1,30 @@ +error[E0271]: type mismatch resolving `::Assoc == {closure@define::{closure#0}}` + --> $DIR/opaque-hidden-ty-inference.rs:31:31 + | +LL | let opaque = require_auto(define::()); + | ------------ ^^^^^^^^^^^^^ expected closure, found `!` + | | + | required by a bound introduced by this call + | + ::: $DIR/auxiliary/opaque-auto-trait-leakage.rs:14:29 + | +LL | WaddupGamers(None::, || ()) + | -- the expected closure + | + = note: expected closure `{closure@dep::define::{closure#0}}` + found type `!` + = note: required for `WaddupGamers::{closure#0}}>` to implement `Unpin` +note: required because it appears within the type `impl Sized` + --> $DIR/auxiliary/opaque-auto-trait-leakage.rs:13:23 + | +LL | pub fn define() -> impl Sized { + | ^^^^^^^^^^ +note: required by a bound in `require_auto` + --> $DIR/opaque-hidden-ty-inference.rs:18:20 + | +LL | fn require_auto(x: T) -> T { + | ^^^^^ required by this bound in `require_auto` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0271`. From b3d3ab1cae40e53a66fb3894c02b9581e6a61c7d Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Sat, 5 Sep 2026 03:27:03 +0000 Subject: [PATCH 10/19] Add opaque mayleak to bail out PostTypeckUntilBorrowck from opaque constraint --- .../rustc_next_trait_solver/src/solve/trait_goals.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs index bad038022b1fb..f2c85509b9d42 100644 --- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs @@ -1305,8 +1305,20 @@ where ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes) }); + let opaque_types_may_leak = match self.typing_mode() { + TypingMode::PostTypeckUntilBorrowck { .. } => false, + TypingMode::Coherence + | TypingMode::Typeck { .. } + | TypingMode::PostBorrowck { .. } + | TypingMode::Reflection + | TypingMode::PostAnalysis + | TypingMode::Codegen + | TypingMode::ErasedNotCoherence(MayBeErased) => true, + }; + match candidate { Ok(candidate) if has_only_region_constraints(candidate.result) => Ok(candidate), + Ok(candidate) if !opaque_types_may_leak => Ok(candidate), Ok(_) => self.forced_ambiguity(MaybeInfo::AMBIGUOUS), Err(err) => Err(err), } From d86652ace45f8373fc6ae2b1122458b85162dadf Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 11 Sep 2026 15:16:36 +0000 Subject: [PATCH 11/19] Contraint the var_values to not contain type and const inference variable during PostTypeckUntilBorrowck for auto trait opaque ty --- .../src/solve/trait_goals.rs | 61 +++++++++++++------ .../auxiliary/opaque-auto-trait-leakage.rs | 6 ++ .../opaque-hidden-ty-inference.stderr | 4 +- 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs index f2c85509b9d42..649ce4d2dd76f 100644 --- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs @@ -5,7 +5,7 @@ use rustc_type_ir::fast_reject::DeepRejectCtxt; use rustc_type_ir::inherent::*; use rustc_type_ir::lang_items::SolverTraitLangItem; use rustc_type_ir::solve::{ - AliasBoundKind, CandidatePreferenceMode, CanonicalResponse, MaybeInfo, + AliasBoundKind, CandidatePreferenceMode, CanonicalResponse, ExternalConstraintsData, MaybeInfo, NoSolutionOrRerunNonErased, OpaqueTypesJank, QueryResultOrRerunNonErased, RerunNonErased, RerunReason, RerunResultExt, SizedTraitKind, }; @@ -1286,9 +1286,6 @@ where ) -> Result, NoSolutionOrRerunNonErased> { let cx = self.cx(); let source = CandidateSource::BuiltinImpl(BuiltinImplSource::Misc); - if self.opaque_accesses.might_rerun() { - match self.opaque_accesses.rerun_always(RerunReason::AutoTraitLeakage)? {} - } for item_bound in cx.item_self_bounds(def_id.into()).skip_binder() { if item_bound.as_trait_clause().is_some_and(|b| b.def_id() == goal.predicate.def_id()) { @@ -1303,25 +1300,49 @@ where goal.with(cx, goal.predicate.with_replaced_self_ty(cx, hidden_ty)), )?; ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes) - }); + })?; - let opaque_types_may_leak = match self.typing_mode() { - TypingMode::PostTypeckUntilBorrowck { .. } => false, - TypingMode::Coherence - | TypingMode::Typeck { .. } - | TypingMode::PostBorrowck { .. } - | TypingMode::Reflection - | TypingMode::PostAnalysis - | TypingMode::Codegen - | TypingMode::ErasedNotCoherence(MayBeErased) => true, - }; + // Proving an auto trait for the hidden type must not constrain inference + // variables, as that would leak the hidden type itself. + if !candidate.result.value.var_values.is_identity_modulo_regions() { + return self.forced_ambiguity(MaybeInfo::AMBIGUOUS); + } - match candidate { - Ok(candidate) if has_only_region_constraints(candidate.result) => Ok(candidate), - Ok(candidate) if !opaque_types_may_leak => Ok(candidate), - Ok(_) => self.forced_ambiguity(MaybeInfo::AMBIGUOUS), - Err(err) => Err(err), + let ExternalConstraintsData { + region_constraints: _, + ref opaque_types, + ref normalization_nested_goals, + } = *candidate.result.value.external_constraints; + debug_assert!(normalization_nested_goals.is_empty()); + + // New defining uses may leak an opaque's hidden type into the caller's + // inference state. This is safe after typeck, where hidden types are already + // fixed and only regions are inferred, but not during typeck while hidden + // types may still contain inference variables. + if !opaque_types.is_empty() { + match self.typing_mode() { + // We're inferring regions of opaque types, but + // the type itself is already fully known, no way + // to leak the hidden type. + TypingMode::PostTypeckUntilBorrowck { .. } => {} + // We're inferring the hidden type of opaques, could + // leak types through it. + TypingMode::Typeck { .. } => { + return self.forced_ambiguity(MaybeInfo::AMBIGUOUS); + } + // we never add new uses to the opaque type storage + TypingMode::Coherence + | TypingMode::PostBorrowck { .. } + | TypingMode::Reflection + | TypingMode::PostAnalysis + | TypingMode::Codegen + | TypingMode::ErasedNotCoherence(MayBeErased) => { + return self.forced_ambiguity(MaybeInfo::AMBIGUOUS); + } + } } + + Ok(candidate) } // Return `Some` if there is an impl (built-in or user provided) that may diff --git a/tests/ui/impl-trait/auto-trait-leakage/auxiliary/opaque-auto-trait-leakage.rs b/tests/ui/impl-trait/auto-trait-leakage/auxiliary/opaque-auto-trait-leakage.rs index d7a2c4a8642eb..c32f4ae09dcf1 100644 --- a/tests/ui/impl-trait/auto-trait-leakage/auxiliary/opaque-auto-trait-leakage.rs +++ b/tests/ui/impl-trait/auto-trait-leakage/auxiliary/opaque-auto-trait-leakage.rs @@ -1,3 +1,9 @@ +// External crate for `opaque-hidden-ty-inference.rs`. +// +// `define` returns `WaddupGamers`. Its `Unpin` impl only holds if +// `::Assoc` is that closure. The test's caller says `Assoc` is its +// own opaque type instead, so checking `Unpin` would try to set that opaque +// type to this closure. pub struct WaddupGamers(Option, U); impl, U> Unpin for WaddupGamers {} diff --git a/tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.stderr b/tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.stderr index b70fde561cd43..cd750cf3261a7 100644 --- a/tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.stderr +++ b/tests/ui/impl-trait/auto-trait-leakage/opaque-hidden-ty-inference.stderr @@ -6,7 +6,7 @@ LL | let opaque = require_auto(define::()); | | | required by a bound introduced by this call | - ::: $DIR/auxiliary/opaque-auto-trait-leakage.rs:14:29 + ::: $DIR/auxiliary/opaque-auto-trait-leakage.rs:20:29 | LL | WaddupGamers(None::, || ()) | -- the expected closure @@ -15,7 +15,7 @@ LL | WaddupGamers(None::, || ()) found type `!` = note: required for `WaddupGamers::{closure#0}}>` to implement `Unpin` note: required because it appears within the type `impl Sized` - --> $DIR/auxiliary/opaque-auto-trait-leakage.rs:13:23 + --> $DIR/auxiliary/opaque-auto-trait-leakage.rs:19:23 | LL | pub fn define() -> impl Sized { | ^^^^^^^^^^ From 7dc9aeebf8cfb84a25fe896fecf5ff34d5a22e71 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 21 Sep 2026 18:35:35 +0200 Subject: [PATCH 12/19] remove incorrect cfg_abi check from asm/powerpc; that makes CfgAbi::VecExtAbi basically unused so remove it --- compiler/rustc_target/src/asm/powerpc.rs | 13 +++---------- compiler/rustc_target/src/spec/base/aix.rs | 9 +++++---- compiler/rustc_target/src/spec/consistency.rs | 2 +- compiler/rustc_target/src/spec/mod.rs | 1 - 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/compiler/rustc_target/src/asm/powerpc.rs b/compiler/rustc_target/src/asm/powerpc.rs index 36a8657c5d4e1..54a93935afa37 100644 --- a/compiler/rustc_target/src/asm/powerpc.rs +++ b/compiler/rustc_target/src/asm/powerpc.rs @@ -4,7 +4,7 @@ use rustc_data_structures::fx::FxIndexSet; use rustc_span::Symbol; use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; -use crate::spec::{CfgAbi, RelocModel, RustcAbi, Target}; +use crate::spec::{RelocModel, RustcAbi, Target}; def_reg_class! { PowerPC PowerPCInlineAsmRegClass { @@ -107,15 +107,8 @@ fn reserved_v20to31( _is_clobber: bool, ) -> Result<(), &'static str> { if target.is_like_aix { - // FIXME: using `cfg_abi` here is wrong -- that's not a source of truth, it's just - // what we display to the user. Instead we need to check the knob that controls - // whether the ABI is actually used. Currently there is no such knob, a Rust target - // can therefore never actually use `vec-extabi`. - match &target.options.cfg_abi { - CfgAbi::VecDefault => Err("v20-v31 (vs52-vs63) are reserved on vec-default ABI"), - CfgAbi::VecExtAbi => Ok(()), - abi => unreachable!("unrecognized AIX ABI: {abi}"), - } + // We do not support the vec-extabi at the moment. + Err("v20-v31 (vs52-vs63) are reserved on vec-default ABI") } else { Ok(()) } diff --git a/compiler/rustc_target/src/spec/base/aix.rs b/compiler/rustc_target/src/spec/base/aix.rs index 5d172cc8b0fcf..1f581a01b1642 100644 --- a/compiler/rustc_target/src/spec/base/aix.rs +++ b/compiler/rustc_target/src/spec/base/aix.rs @@ -8,10 +8,11 @@ use crate::spec::{ pub(crate) fn opts() -> TargetOptions { TargetOptions { // It makes no sense to set "vec-extabi" here without also actually configuring LLVM to use - // that ABI. This needs a new target spec knob to control the relevant LLVM flag. If you are - // adding such a knob, make sure to also: - // - adjust the logic in `asm/powerpc.rs` to check that knob instead of checking `cfg_abi`. - // - adjust the logic in `spec/consistency.rs` to correlate that knob with `cfg_abi`. + // that ABI. Since https://github.com/llvm/llvm-project/pull/221670 this probably just needs + // `llvm_abiname` to be set properly. If you are doing that, make sure to also: + // - adjust the logic in `reserved_v20to31` in `asm/powerpc.rs` to allow the extra registers + // to be used depending on `llvm_abiname`. + // - adjust the logic in `spec/consistency.rs` to correlate `llvm_abiname` with `cfg_abi`. cfg_abi: CfgAbi::VecDefault, code_model: Some(CodeModel::Large), cpu: "pwr7".into(), diff --git a/compiler/rustc_target/src/spec/consistency.rs b/compiler/rustc_target/src/spec/consistency.rs index cdfbd6c2acbfc..5f88c352d3340 100644 --- a/compiler/rustc_target/src/spec/consistency.rs +++ b/compiler/rustc_target/src/spec/consistency.rs @@ -484,7 +484,7 @@ impl Target { // (vec-default vs vec-ext). check_matches!( (&self.llvm_abiname, &self.cfg_abi), - (LlvmAbi::Unspecified, CfgAbi::VecDefault | CfgAbi::VecExtAbi), + (LlvmAbi::Unspecified, CfgAbi::VecDefault), "invalid PowerPC64 AIX ABI name and `cfg(target_abi)` combination:\n\ ABI name: {}\n\ cfg(target_abi): {}", diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 9f97a33bfdc75..42d817c7daa31 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1950,7 +1950,6 @@ crate::target_spec_enum! { Spe = "spe", Uwp = "uwp", VecDefault = "vec-default", - VecExtAbi = "vec-extabi", X32 = "x32", V8Plus = "v8plus", Unspecified = "", From e83bfcabca99e7d18ce0a57a6ac8f57345596d65 Mon Sep 17 00:00:00 2001 From: James Barford-Evans Date: Thu, 17 Sep 2026 09:36:39 +0100 Subject: [PATCH 13/19] Move `Const` from `rustc_middle` to `rustc_type_ir` --- compiler/rustc_middle/src/ty/codec.rs | 13 - compiler/rustc_middle/src/ty/consts.rs | 246 ++---------------- compiler/rustc_middle/src/ty/context.rs | 26 +- .../src/ty/context/impl_interner.rs | 14 +- compiler/rustc_middle/src/ty/mod.rs | 3 +- compiler/rustc_middle/src/ty/print/pretty.rs | 4 +- compiler/rustc_middle/src/ty/relate.rs | 10 - .../rustc_middle/src/ty/structural_impls.rs | 88 +------ compiler/rustc_type_ir/src/inherent.rs | 70 ++--- compiler/rustc_type_ir/src/intern/mod.rs | 4 +- compiler/rustc_type_ir/src/interner.rs | 20 +- compiler/rustc_type_ir/src/ir_print.rs | 13 +- compiler/rustc_type_ir/src/serialize.rs | 20 +- compiler/rustc_type_ir/src/sty/consts.rs | 243 +++++++++++++++++ compiler/rustc_type_ir/src/sty/mod.rs | 3 + compiler/rustc_type_ir/src/ty_info.rs | 2 +- 16 files changed, 365 insertions(+), 414 deletions(-) create mode 100644 compiler/rustc_type_ir/src/sty/consts.rs diff --git a/compiler/rustc_middle/src/ty/codec.rs b/compiler/rustc_middle/src/ty/codec.rs index 9d4899d6fd450..81462e214b20f 100644 --- a/compiler/rustc_middle/src/ty/codec.rs +++ b/compiler/rustc_middle/src/ty/codec.rs @@ -142,12 +142,6 @@ impl<'tcx, E: TyEncoder<'tcx>> Encodable for ty::Clause<'tcx> { } } -impl<'tcx, E: TyEncoder<'tcx>> Encodable for ty::Const<'tcx> { - fn encode(&self, e: &mut E) { - self.0.0.encode(e); - } -} - impl<'tcx, E: TyEncoder<'tcx>> Encodable for ty::Pattern<'tcx> { fn encode(&self, e: &mut E) { self.0.0.encode(e); @@ -292,13 +286,6 @@ impl<'tcx, D: TyDecoder<'tcx>> Decodable for ty::ParamEnv<'tcx> { } } -impl<'tcx, D: TyDecoder<'tcx>> Decodable for ty::Const<'tcx> { - fn decode(decoder: &mut D) -> Self { - let kind: ty::ConstKind<'tcx> = Decodable::decode(decoder); - decoder.interner().mk_ct_from_kind(kind) - } -} - impl<'tcx, D: TyDecoder<'tcx>> Decodable for ty::Pattern<'tcx> { fn decode(decoder: &mut D) -> Self { decoder.interner().mk_pat(Decodable::decode(decoder)) diff --git a/compiler/rustc_middle/src/ty/consts.rs b/compiler/rustc_middle/src/ty/consts.rs index 9e9f8d5df45de..cbe7b6d732c0f 100644 --- a/compiler/rustc_middle/src/ty/consts.rs +++ b/compiler/rustc_middle/src/ty/consts.rs @@ -1,10 +1,7 @@ -use std::borrow::Cow; - -use rustc_data_structures::intern::Interned; -use rustc_macros::StableHash; -use rustc_span::{Span, bug}; +use rustc_macros::extension; +use rustc_span::bug; use rustc_type_ir::walk::TypeWalker; -use rustc_type_ir::{self as ir, TypeFlags, WithCachedTypeInfo}; +use rustc_type_ir::{self as ir}; use crate::mir::interpret::Scalar; use crate::ty::{self, Ty, TyCtxt}; @@ -17,204 +14,21 @@ mod valtree; pub use int::*; pub use kind::*; pub use lit::*; -use rustc_span::{DUMMY_SP, ErrorGuaranteed}; pub use valtree::*; pub type ConstKind<'tcx> = ir::ConstKind>; pub type AliasConst<'tcx> = ir::AliasConst>; pub type AliasConstKind<'tcx> = ir::AliasConstKind>; +pub type Const<'tcx> = ir::Const>; #[cfg(target_pointer_width = "64")] rustc_data_structures::static_assert_size!(ConstKind<'_>, 32); -#[derive(Copy, Clone, PartialEq, Eq, Hash, StableHash)] -#[rustc_pass_by_value] -pub struct Const<'tcx>(pub(super) Interned<'tcx, WithCachedTypeInfo>>); - -impl<'tcx> rustc_type_ir::inherent::IntoKind for Const<'tcx> { - type Kind = ConstKind<'tcx>; - - fn kind(self) -> ConstKind<'tcx> { - self.kind() - } -} - -impl<'tcx> rustc_type_ir::Flags for Const<'tcx> { - fn flags(&self) -> TypeFlags { - self.0.flags - } - - fn outer_exclusive_binder(&self) -> rustc_type_ir::DebruijnIndex { - self.0.outer_exclusive_binder - } -} - -impl<'tcx> Const<'tcx> { - #[inline] - pub fn kind(self) -> ConstKind<'tcx> { - let a: &ConstKind<'tcx> = self.0.0; - *a - } - - #[inline] - pub fn new(tcx: TyCtxt<'tcx>, kind: ty::ConstKind<'tcx>) -> Const<'tcx> { - tcx.mk_ct_from_kind(kind) - } - - #[inline] - pub fn new_param(tcx: TyCtxt<'tcx>, param: ty::ParamConst) -> Const<'tcx> { - Const::new(tcx, ty::ConstKind::Param(param)) - } - - #[inline] - pub fn new_var(tcx: TyCtxt<'tcx>, infer: ty::ConstVid) -> Const<'tcx> { - Const::new(tcx, ty::ConstKind::Infer(ty::InferConst::Var(infer))) - } - - #[inline] - pub fn new_fresh(tcx: TyCtxt<'tcx>, fresh: u32) -> Const<'tcx> { - Const::new(tcx, ty::ConstKind::Infer(ty::InferConst::Fresh(fresh))) - } - - #[inline] - pub fn new_infer(tcx: TyCtxt<'tcx>, infer: ty::InferConst) -> Const<'tcx> { - Const::new(tcx, ty::ConstKind::Infer(infer)) - } - - #[inline] - pub fn new_bound( - tcx: TyCtxt<'tcx>, - debruijn: ty::DebruijnIndex, - bound_const: ty::BoundConst<'tcx>, - ) -> Const<'tcx> { - Const::new(tcx, ty::ConstKind::Bound(ty::BoundVarIndexKind::Bound(debruijn), bound_const)) - } - - #[inline] - pub fn new_canonical_bound(tcx: TyCtxt<'tcx>, var: ty::BoundVar) -> Const<'tcx> { - Const::new( - tcx, - ty::ConstKind::Bound(ty::BoundVarIndexKind::Canonical, ty::BoundConst::new(var)), - ) - } - - #[inline] - pub fn new_placeholder( - tcx: TyCtxt<'tcx>, - placeholder: ty::PlaceholderConst<'tcx>, - ) -> Const<'tcx> { - Const::new(tcx, ty::ConstKind::Placeholder(placeholder)) - } - - #[inline] - pub fn new_alias( - tcx: TyCtxt<'tcx>, - is_rigid: ty::IsRigid, - alias_const: ty::AliasConst<'tcx>, - ) -> Const<'tcx> { - Const::new(tcx, ty::ConstKind::Alias(is_rigid, alias_const)) - } - - #[inline] - pub fn new_value(tcx: TyCtxt<'tcx>, valtree: ty::ValTree<'tcx>, ty: Ty<'tcx>) -> Const<'tcx> { - Const::new(tcx, ty::ConstKind::Value(ty::Value { ty, valtree })) - } - - #[inline] - pub fn new_expr(tcx: TyCtxt<'tcx>, expr: ty::Expr<'tcx>) -> Const<'tcx> { - Const::new(tcx, ty::ConstKind::Expr(expr)) - } - - #[inline] - pub fn new_error(tcx: TyCtxt<'tcx>, e: ty::ErrorGuaranteed) -> Const<'tcx> { - Const::new(tcx, ty::ConstKind::Error(e)) - } - - /// Like [Ty::new_error] but for constants. - #[track_caller] - pub fn new_misc_error(tcx: TyCtxt<'tcx>) -> Const<'tcx> { - Const::new_error_with_message( - tcx, - DUMMY_SP, - "ty::ConstKind::Error constructed but no error reported", - ) - } - - /// Like [Ty::new_error_with_message] but for constants. - #[track_caller] - pub fn new_error_with_message( - tcx: TyCtxt<'tcx>, - span: Span, - msg: impl Into>, - ) -> Const<'tcx> { - let reported = tcx.dcx().span_delayed_bug(span, msg); - Const::new_error(tcx, reported) - } - - pub fn is_trivially_wf(self) -> bool { - match self.kind() { - ty::ConstKind::Param(_) | ty::ConstKind::Placeholder(_) | ty::ConstKind::Bound(..) => { - true - } - ty::ConstKind::Infer(_) - | ty::ConstKind::Alias(..) - | ty::ConstKind::Value(_) - | ty::ConstKind::Error(_) - | ty::ConstKind::Expr(_) => false, - } - } -} - -impl<'tcx> rustc_type_ir::inherent::Const> for Const<'tcx> { - fn new_infer(tcx: TyCtxt<'tcx>, infer: ty::InferConst) -> Self { - Const::new_infer(tcx, infer) - } - - fn new_var(tcx: TyCtxt<'tcx>, vid: ty::ConstVid) -> Self { - Const::new_var(tcx, vid) - } - - fn new_bound( - interner: TyCtxt<'tcx>, - debruijn: ty::DebruijnIndex, - bound_const: ty::BoundConst<'tcx>, - ) -> Self { - Const::new_bound(interner, debruijn, bound_const) - } - - fn new_anon_bound(tcx: TyCtxt<'tcx>, debruijn: ty::DebruijnIndex, var: ty::BoundVar) -> Self { - Const::new_bound(tcx, debruijn, ty::BoundConst::new(var)) - } - - fn new_canonical_bound(tcx: TyCtxt<'tcx>, var: rustc_type_ir::BoundVar) -> Self { - Const::new_canonical_bound(tcx, var) - } - - fn new_placeholder(tcx: TyCtxt<'tcx>, placeholder: ty::PlaceholderConst<'tcx>) -> Self { - Const::new_placeholder(tcx, placeholder) - } - - fn new_alias( - interner: TyCtxt<'tcx>, - is_rigid: ty::IsRigid, - alias_const: ty::AliasConst<'tcx>, - ) -> Self { - Const::new_alias(interner, is_rigid, alias_const) - } - - fn new_expr(interner: TyCtxt<'tcx>, expr: ty::Expr<'tcx>) -> Self { - Const::new_expr(interner, expr) - } - - fn new_error(interner: TyCtxt<'tcx>, guar: ErrorGuaranteed) -> Self { - Const::new_error(interner, guar) - } -} - +#[extension(pub trait ConstExt<'tcx>)] impl<'tcx> Const<'tcx> { /// Creates a constant with the given integer value and interns it. #[inline] - pub fn from_bits( + fn from_bits( tcx: TyCtxt<'tcx>, bits: u128, typing_env: ty::TypingEnv<'tcx>, @@ -224,33 +38,36 @@ impl<'tcx> Const<'tcx> { .layout_of(typing_env.as_query_input(ty)) .unwrap_or_else(|e| panic!("could not compute layout for {ty:?}: {e:?}")) .size; - ty::Const::new_value( - tcx, - ty::ValTree::from_scalar_int(tcx, ScalarInt::try_from_uint(bits, size).unwrap()), - ty, - ) + let valtree = + ty::ValTree::from_scalar_int(tcx, ScalarInt::try_from_uint(bits, size).unwrap()); + ty::Const::new_value(tcx, valtree, ty) } #[inline] /// Creates an interned zst constant. - pub fn zero_sized(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Self { + fn zero_sized(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Self { ty::Const::new_value(tcx, ty::ValTree::zst(tcx), ty) } + #[inline] + fn new_value(tcx: TyCtxt<'tcx>, valtree: ty::ValTree<'tcx>, ty: Ty<'tcx>) -> Const<'tcx> { + Const::new(tcx, ty::ConstKind::Value(ty::Value { ty, valtree })) + } + #[inline] /// Creates an interned bool constant. - pub fn from_bool(tcx: TyCtxt<'tcx>, v: bool) -> Self { + fn from_bool(tcx: TyCtxt<'tcx>, v: bool) -> Self { Self::from_bits(tcx, v as u128, ty::TypingEnv::fully_monomorphized(), tcx.types.bool) } #[inline] /// Creates an interned usize constant. - pub fn from_target_usize(tcx: TyCtxt<'tcx>, n: u64) -> Self { + fn from_target_usize(tcx: TyCtxt<'tcx>, n: u64) -> Self { Self::from_bits(tcx, n as u128, ty::TypingEnv::fully_monomorphized(), tcx.types.usize) } /// Panics if `self.kind != ty::ConstKind::Value`. - pub fn to_value(self) -> ty::Value<'tcx> { + fn to_value(self) -> ty::Value<'tcx> { match self.kind() { ty::ConstKind::Value(cv) => cv, _ => bug!("expected ConstKind::Value, got {:?}", self.kind()), @@ -260,7 +77,7 @@ impl<'tcx> Const<'tcx> { /// Attempts to convert to a value. /// /// Note that this does not normalize the constant. - pub fn try_to_value(self) -> Option> { + fn try_to_value(self) -> Option> { match self.kind() { ty::ConstKind::Value(cv) => Some(cv), _ => None, @@ -272,7 +89,7 @@ impl<'tcx> Const<'tcx> { /// /// Note that this does not normalize the constant. #[inline] - pub fn to_leaf(self) -> ScalarInt { + fn to_leaf(self) -> ScalarInt { self.to_value().to_leaf() } @@ -281,28 +98,28 @@ impl<'tcx> Const<'tcx> { /// /// Note that this does not normalize the constant. #[inline] - pub fn to_branch(self) -> &'tcx [ty::Const<'tcx>] { + fn to_branch(self) -> &'tcx [ty::Const<'tcx>] { self.to_value().to_branch() } /// Attempts to convert to a `ValTreeKind::Leaf` value. /// /// Note that this does not normalize the constant. - pub fn try_to_leaf(self) -> Option { + fn try_to_leaf(self) -> Option { self.try_to_value()?.try_to_leaf() } /// Attempts to convert to a `ValTreeKind::Leaf` value. /// /// Note that this does not normalize the constant. - pub fn try_to_scalar(self) -> Option { + fn try_to_scalar(self) -> Option { self.try_to_leaf().map(Scalar::Int) } /// Attempts to convert to a `ValTreeKind::Branch` value. /// /// Note that this does not normalize the constant. - pub fn try_to_branch(self) -> Option<&'tcx [ty::Const<'tcx>]> { + fn try_to_branch(self) -> Option<&'tcx [ty::Const<'tcx>]> { self.try_to_value()?.try_to_branch() } @@ -311,21 +128,10 @@ impl<'tcx> Const<'tcx> { /// /// Note that this does not evaluate the constant. #[inline] - pub fn try_to_target_usize(self, tcx: TyCtxt<'tcx>) -> Option { + fn try_to_target_usize(self, tcx: TyCtxt<'tcx>) -> Option { self.try_to_value()?.try_to_target_usize(tcx) } - pub fn is_ct_infer(self) -> bool { - matches!(self.kind(), ty::ConstKind::Infer(_)) - } - - pub fn ct_vid(self) -> Option { - match self.kind() { - ConstKind::Infer(ty::InferConst::Var(vid)) => Some(vid), - _ => None, - } - } - /// Iterator that walks `self` and any types reachable from /// `self`, in depth-first order. Note that just walks the types /// that appear in `self`, it does not descend into the fields of @@ -336,7 +142,7 @@ impl<'tcx> Const<'tcx> { /// Foo> => { Foo>, Bar, isize } /// [isize] => { [isize], isize } /// ``` - pub fn walk(self) -> TypeWalker> { + fn walk(self) -> TypeWalker> { TypeWalker::new(self.into()) } } diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index bd9a5e80b1855..8b8ec7c98182f 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -69,11 +69,11 @@ use crate::traits::solve::{ }; use crate::ty::predicate::ExistentialPredicateStableCmpExt as _; use crate::ty::{ - self, AdtDef, AdtDefData, AdtKind, Binder, Clause, ClausePolarity, Clauses, Const, FnSigKind, - GenericArg, GenericArgs, GenericArgsRef, GenericParamDefKind, List, ListWithCachedTypeInfo, - ParamConst, Pattern, PatternKind, PolyExistentialPredicate, PolyFnSig, Predicate, - PredicateKind, Region, RegionKind, ReprOptions, TraitObjectVisitor, Ty, TyKind, TyVid, ValTree, - ValTreeKind, Visibility, + self, AdtDef, AdtDefData, AdtKind, Binder, Clause, ClausePolarity, Clauses, Const, ConstKind, + FnSigKind, GenericArg, GenericArgs, GenericArgsRef, GenericParamDefKind, List, + ListWithCachedTypeInfo, ParamConst, Pattern, PatternKind, PolyExistentialPredicate, PolyFnSig, + Predicate, PredicateKind, Region, RegionKind, ReprOptions, TraitObjectVisitor, Ty, TyKind, + TyVid, ValTree, ValTreeKind, Visibility, }; impl<'tcx> rustc_type_ir::inherent::DefId> for DefId { @@ -1711,7 +1711,6 @@ macro_rules! nop_list_lift { } nop_lift! { type_; Ty<'a> => Ty<'tcx> } -nop_lift! { const_; Const<'a> => Const<'tcx> } nop_lift! { pat; Pattern<'a> => Pattern<'tcx> } nop_lift! { const_allocation; ConstAllocation<'a> => ConstAllocation<'tcx> } nop_lift! { predicate; Predicate<'a> => Predicate<'tcx> } @@ -1731,6 +1730,21 @@ impl<'a, 'tcx> Lift> for Interned<'a, RegionKind<'a>> { } } +// `rustc_type_ir::Const` is only the generic wrapper; lifting it delegates +// to `I::InternedConstKind`, so the concrete interned const representation +// must itself implement `Lift`. +impl<'a, 'tcx> Lift> for Interned<'a, WithCachedTypeInfo>> { + type Lifted = Interned<'tcx, WithCachedTypeInfo>>; + + #[track_caller] + fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Self::Lifted { + assert!(tcx.interners.const_.contains_pointer_to(&InternedInSet(&*self.0))); + // SAFETY: we just checked that `self` is interned in this `TyCtxt`, so + // its pointee is valid for the entire lifetime of the target `TyCtxt`. + unsafe { mem::transmute(self) } + } +} + nop_list_lift! { type_lists; Ty<'a> => Ty<'tcx> } nop_list_lift! { clauses: ListWithCachedTypeInfo; Clause<'a> => Clause<'tcx> } nop_list_lift! { diff --git a/compiler/rustc_middle/src/ty/context/impl_interner.rs b/compiler/rustc_middle/src/ty/context/impl_interner.rs index 6e838c4454c4c..f13797b48fcbf 100644 --- a/compiler/rustc_middle/src/ty/context/impl_interner.rs +++ b/compiler/rustc_middle/src/ty/context/impl_interner.rs @@ -13,7 +13,7 @@ use rustc_type_ir::lang_items::{SolverAdtLangItem, SolverProjectionLangItem, Sol use rustc_type_ir::solve::CanonicalInputData; use rustc_type_ir::{ BoundVar, CollectAndApply, DebruijnIndex, Interner, RegionVid, TypeFoldable, Unnormalized, - VisitorResult, search_graph, try_visit, + VisitorResult, WithCachedTypeInfo, search_graph, try_visit, }; use crate::dep_graph::{DepKind, DepNodeIndex}; @@ -109,8 +109,7 @@ impl<'tcx> Interner for TyCtxt<'tcx> { type Pat = Pattern<'tcx>; type PatList = &'tcx List>; type Safety = hir::Safety; - type Const = ty::Const<'tcx>; - type Consts = &'tcx List; + type Consts = &'tcx List>; type ParamConst = ty::ParamConst; type ValueConst = ty::Value<'tcx>; @@ -118,6 +117,7 @@ impl<'tcx> Interner for TyCtxt<'tcx> { type ValTree = ty::ValTree<'tcx>; type ScalarInt = ty::ScalarInt; type InternedRegionKind = Interned<'tcx, ty::RegionKind<'tcx>>; + type InternedConstKind = Interned<'tcx, WithCachedTypeInfo>>; type EarlyParamRegion = ty::EarlyParamRegion; type LateParamRegionKind = ty::LateParamRegionKind; @@ -292,6 +292,10 @@ impl<'tcx> Interner for TyCtxt<'tcx> { self.mk_type_list_from_iter(args) } + fn mk_ct_from_kind(self, kind: ty::ConstKind<'tcx>) -> ty::Const<'tcx> { + self.mk_ct_from_kind(kind) + } + fn projection_parent(self, def_id: Self::TraitAssocTermId) -> Self::TraitId { self.parent(def_id) } @@ -733,9 +737,7 @@ impl<'tcx> Interner for TyCtxt<'tcx> { } } -impl<'tcx, T: std::fmt::Debug + Clone + Copy> rustc_type_ir::intern::Interned> - for Interned<'tcx, T> -{ +impl<'tcx, T: Clone + Copy> rustc_type_ir::intern::Interned> for Interned<'tcx, T> { type Value = T; fn get(self) -> T { *self.0 diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 94345380a544e..c7de3afb7cd3c 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -124,6 +124,8 @@ pub mod abstract_const; pub mod adjustment; pub mod cast; pub mod codec; +// FIXME(#159654): This should get deleted soon +pub mod consts; pub mod error; pub mod fast_reject; pub mod inhabitedness; @@ -143,7 +145,6 @@ pub mod vtable; mod adt; mod assoc; mod closure; -mod consts; mod context; mod diagnostics; mod elaborate_impl; diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index ba4a59daad01d..3ba7ea6d43794 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -24,6 +24,7 @@ use smallvec::SmallVec; use super::*; use crate::mir::interpret::{AllocRange, GlobalAlloc, Pointer, Provenance, Scalar}; use crate::query::{IntoQueryKey, Providers}; +use crate::ty::consts::ConstExt; use crate::ty::{ ConstInt, Expr, GenericArgKind, ParamConst, ScalarInt, Term, TermKind, TraitClause, TypeFoldable, TypeSuperFoldable, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, @@ -3140,8 +3141,7 @@ macro_rules! define_print_and_forward_display { forward_display_to_print! { Ty<'tcx>, - &'tcx ty::List>, - ty::Const<'tcx> + &'tcx ty::List> } define_print! { diff --git a/compiler/rustc_middle/src/ty/relate.rs b/compiler/rustc_middle/src/ty/relate.rs index abbfd0f279a93..477e5133cc358 100644 --- a/compiler/rustc_middle/src/ty/relate.rs +++ b/compiler/rustc_middle/src/ty/relate.rs @@ -98,16 +98,6 @@ impl<'tcx> Relate> for ty::GenericArgsRef<'tcx> { } } -impl<'tcx> Relate> for ty::Const<'tcx> { - fn relate>>( - relation: &mut R, - a: ty::Const<'tcx>, - b: ty::Const<'tcx>, - ) -> RelateResult<'tcx, ty::Const<'tcx>> { - relation.consts(a, b) - } -} - impl<'tcx> Relate> for ty::Expr<'tcx> { fn relate>>( relation: &mut R, diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs index 0ea7e403ee111..02107fee370cb 100644 --- a/compiler/rustc_middle/src/ty/structural_impls.rs +++ b/compiler/rustc_middle/src/ty/structural_impls.rs @@ -9,7 +9,7 @@ use rustc_abi::TyAndLayout; use rustc_hir::def::Namespace; use rustc_hir::def_id::LocalDefId; use rustc_span::Spanned; -use rustc_type_ir::{ConstKind, PredicateProxy, TypeFolder, Upcast, VisitorResult, try_visit}; +use rustc_type_ir::{PredicateProxy, TypeFolder, Upcast, VisitorResult, try_visit}; use super::{GenericArg, GenericArgKind, Pattern}; use crate::mir::PlaceElem; @@ -141,18 +141,6 @@ impl<'tcx> fmt::Debug for ty::consts::Expr<'tcx> { } } -impl<'tcx> fmt::Debug for ty::Const<'tcx> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - // If this is a value, we spend some effort to make it look nice. - if let ConstKind::Value(cv) = self.kind() { - write!(f, "{}", cv) - } else { - // Fall back to something verbose. - write!(f, "{:?}", self.kind()) - } - } -} - impl<'tcx> fmt::Debug for GenericArg<'tcx> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.kind() { @@ -651,80 +639,6 @@ impl<'tcx> TypeSuperFoldable> for ty::Clauses<'tcx> { } } -impl<'tcx> TypeFoldable> for ty::Const<'tcx> { - fn try_fold_with>>( - self, - folder: &mut F, - ) -> Result { - folder.try_fold_const(self) - } - - fn fold_with>>(self, folder: &mut F) -> Self { - folder.fold_const(self) - } -} - -impl<'tcx> TypeVisitable> for ty::Const<'tcx> { - fn visit_with>>(&self, visitor: &mut V) -> V::Result { - visitor.visit_const(*self) - } -} - -impl<'tcx> TypeSuperFoldable> for ty::Const<'tcx> { - fn try_super_fold_with>>( - self, - folder: &mut F, - ) -> Result { - let kind = match self.kind() { - ConstKind::Alias(is_rigid, alias_const) => { - ConstKind::Alias(is_rigid, alias_const.try_fold_with(folder)?) - } - ConstKind::Value(v) => ConstKind::Value(v.try_fold_with(folder)?), - ConstKind::Expr(e) => ConstKind::Expr(e.try_fold_with(folder)?), - - ConstKind::Param(_) - | ConstKind::Infer(_) - | ConstKind::Bound(..) - | ConstKind::Placeholder(_) - | ConstKind::Error(_) => return Ok(self), - }; - if kind != self.kind() { Ok(folder.cx().mk_ct_from_kind(kind)) } else { Ok(self) } - } - - fn super_fold_with>>(self, folder: &mut F) -> Self { - let kind = match self.kind() { - ConstKind::Alias(is_rigid, alias_const) => { - ConstKind::Alias(is_rigid, alias_const.fold_with(folder)) - } - ConstKind::Value(v) => ConstKind::Value(v.fold_with(folder)), - ConstKind::Expr(e) => ConstKind::Expr(e.fold_with(folder)), - - ConstKind::Param(_) - | ConstKind::Infer(_) - | ConstKind::Bound(..) - | ConstKind::Placeholder(_) - | ConstKind::Error(_) => return self, - }; - if kind != self.kind() { folder.cx().mk_ct_from_kind(kind) } else { self } - } -} - -impl<'tcx> TypeSuperVisitable> for ty::Const<'tcx> { - fn super_visit_with>>(&self, visitor: &mut V) -> V::Result { - match self.kind() { - ConstKind::Alias(_, alias_const) => alias_const.visit_with(visitor), - ConstKind::Value(v) => v.visit_with(visitor), - ConstKind::Expr(e) => e.visit_with(visitor), - ConstKind::Error(e) => e.visit_with(visitor), - - ConstKind::Param(_) - | ConstKind::Infer(_) - | ConstKind::Bound(..) - | ConstKind::Placeholder(_) => V::Result::output(), - } - } -} - impl<'tcx> TypeVisitable> for ty::ValTree<'tcx> { fn visit_with>>(&self, visitor: &mut V) -> V::Result { let inner: &ty::ValTreeKind> = &*self; diff --git a/compiler/rustc_type_ir/src/inherent.rs b/compiler/rustc_type_ir/src/inherent.rs index bf90ef707c051..26d094817ba09 100644 --- a/compiler/rustc_type_ir/src/inherent.rs +++ b/compiler/rustc_type_ir/src/inherent.rs @@ -14,7 +14,8 @@ use crate::relate::Relate; use crate::solve::{AdtDestructorKind, SizedTraitKind}; use crate::visit::{Flags, TypeSuperVisitable, TypeVisitable}; use crate::{ - self as ty, ClauseKind, CollectAndApply, FieldInfo, Interner, PredicateKind, Region, UpcastFrom, + self as ty, ClauseKind, CollectAndApply, Const, FieldInfo, Interner, PredicateKind, Region, + UpcastFrom, }; #[rust_analyzer::prefer_underscore_import] @@ -111,7 +112,7 @@ pub trait Ty>: fn new_ref(interner: I, region: Region, ty: Self, mutbl: Mutability) -> Self; - fn new_array_with_const_len(interner: I, ty: Self, len: I::Const) -> Self; + fn new_array_with_const_len(interner: I, ty: Self, len: Const) -> Self; fn new_slice(interner: I, ty: Self) -> Self; @@ -228,50 +229,6 @@ pub trait Safety>: Copy + Debug + Hash + Eq { fn prefix_str(self) -> &'static str; } -pub trait Const>: - Copy - + Debug - + Hash - + Eq - + Into - + Into - + IntoKind> - + TypeSuperVisitable - + TypeSuperFoldable - + Relate - + Flags -{ - fn new_infer(interner: I, var: ty::InferConst) -> Self; - - fn new_var(interner: I, var: ty::ConstVid) -> Self; - - fn new_bound(interner: I, debruijn: ty::DebruijnIndex, bound_const: ty::BoundConst) -> Self; - - fn new_anon_bound(interner: I, debruijn: ty::DebruijnIndex, var: ty::BoundVar) -> Self; - - fn new_canonical_bound(interner: I, var: ty::BoundVar) -> Self; - - fn new_placeholder(interner: I, param: ty::PlaceholderConst) -> Self; - - fn new_alias(interner: I, is_rigid: ty::IsRigid, alias_const: ty::AliasConst) -> Self; - - fn new_expr(interner: I, expr: I::ExprConst) -> Self; - - fn new_error(interner: I, guar: I::ErrorGuaranteed) -> Self; - - fn new_error_with_message(interner: I, msg: impl ToString) -> Self { - Self::new_error(interner, interner.delay_bug(msg)) - } - - fn is_ct_var(self) -> bool { - matches!(self.kind(), ty::ConstKind::Infer(ty::InferConst::Var(_))) - } - - fn is_ct_error(self) -> bool { - matches!(self.kind(), ty::ConstKind::Error(_)) - } -} - #[rust_analyzer::prefer_underscore_import] pub trait ValueConst>: Copy + Debug + Hash + Eq { fn ty(self) -> I::Ty; @@ -300,7 +257,7 @@ pub trait GenericArg>: + Relate + From + From> - + From + + From> + From { fn as_term(&self) -> Option { @@ -319,11 +276,11 @@ pub trait GenericArg>: self.as_type().expect("expected a type") } - fn as_const(&self) -> Option { + fn as_const(&self) -> Option> { if let ty::GenericArgKind::Const(c) = self.kind() { Some(c) } else { None } } - fn expect_const(&self) -> I::Const { + fn expect_const(&self) -> Const { self.as_const().expect("expected a const") } @@ -346,7 +303,14 @@ pub trait GenericArg>: #[rust_analyzer::prefer_underscore_import] pub trait Term>: - Copy + Debug + Hash + Eq + IntoKind> + TypeFoldable + Relate + Copy + + Debug + + Hash + + Eq + + IntoKind> + + TypeFoldable + + Relate + + From> { fn as_type(&self) -> Option { if let ty::TermKind::Ty(ty) = self.kind() { Some(ty) } else { None } @@ -356,11 +320,11 @@ pub trait Term>: self.as_type().expect("expected a type, but found a const") } - fn as_const(&self) -> Option { + fn as_const(&self) -> Option> { if let ty::TermKind::Const(c) = self.kind() { Some(c) } else { None } } - fn expect_const(&self) -> I::Const { + fn expect_const(&self) -> Const { self.as_const().expect("expected a const, but found a type") } @@ -420,7 +384,7 @@ pub trait GenericArgs>: fn region_at(self, i: usize) -> Region; - fn const_at(self, i: usize) -> I::Const; + fn const_at(self, i: usize) -> Const; fn identity_for_item(interner: I, def_id: I::DefId) -> I::GenericArgs; diff --git a/compiler/rustc_type_ir/src/intern/mod.rs b/compiler/rustc_type_ir/src/intern/mod.rs index a4cdd85fe175b..88634b3829fe2 100644 --- a/compiler/rustc_type_ir/src/intern/mod.rs +++ b/compiler/rustc_type_ir/src/intern/mod.rs @@ -1,8 +1,6 @@ use std::hash::Hash; -use crate::fmt::Debug; - -pub trait Interned: Copy + Debug + Hash + Eq + PartialEq { +pub trait Interned: Copy + Hash + Eq + PartialEq { type Value; fn get(self) -> Self::Value; } diff --git a/compiler/rustc_type_ir/src/interner.rs b/compiler/rustc_type_ir/src/interner.rs index 0a11a82c99e76..474a4689997d7 100644 --- a/compiler/rustc_type_ir/src/interner.rs +++ b/compiler/rustc_type_ir/src/interner.rs @@ -1,5 +1,5 @@ use std::borrow::Borrow; -use std::fmt::Debug; +use std::fmt::{Debug, Display}; use std::hash::Hash; use std::ops::Deref; @@ -21,8 +21,8 @@ use crate::solve::{ }; use crate::visit::{Flags, TypeVisitable}; use crate::{ - self as ty, AliasTermKind, BoundRegion, BoundVar, CanonicalParamEnvCache, DebruijnIndex, - Region, RegionKind, RegionVid, TraitRef, search_graph, + self as ty, AliasTermKind, BoundRegion, BoundVar, CanonicalParamEnvCache, Const, ConstKind, + DebruijnIndex, Region, RegionKind, RegionVid, TraitRef, WithCachedTypeInfo, search_graph, }; /// The central trait in the shared abstraction layer, specifying all implementation-specific @@ -177,7 +177,7 @@ pub trait Interner: type Symbol: Symbol; // Things stored inside of tys - type ErrorGuaranteed: Copy + Debug + Hash + Eq; + type ErrorGuaranteed: Copy + Debug + Hash + Eq + TypeVisitable; type BoundExistentialPredicates: BoundExistentialPredicates; type AllocId: Copy + Debug + Hash + Eq; type Pat: Copy @@ -198,10 +198,9 @@ pub trait Interner: type Safety: Safety; // Kinds of consts - type Const: Const; - type Consts: Copy + Debug + Hash + Eq + SliceLike + Default; + type Consts: Copy + Debug + Hash + Eq + SliceLike> + Default; type ParamConst: Copy + Debug + Hash + Eq + ParamLike; - type ValueConst: ValueConst; + type ValueConst: ValueConst + TypeFoldable + Display; type ExprConst: ExprConst; type ValTree: Copy + Debug + Hash + Eq + IntoKind>; type ScalarInt: Copy + Debug + Hash + Eq; @@ -238,6 +237,7 @@ pub trait Interner: + RegionName; type InternedRegionKind: Interned>; + type InternedConstKind: Interned>>; type RegionAssumptions: Copy + Debug @@ -285,7 +285,7 @@ pub trait Interner: fn const_of_item( self, alias: ty::AliasConstKind, - ) -> Option>; + ) -> Option>>; fn anon_const_kind(self, def_id: Self::DefId) -> ty::AnonConstKind; fn def_span(self, def_id: Self::DefId) -> Self::Span; @@ -328,6 +328,8 @@ pub trait Interner: I: Iterator, T: CollectAndApply; + fn mk_ct_from_kind(self, kind: ConstKind) -> Const; + fn projection_parent(self, def_id: Self::TraitAssocTermId) -> Self::TraitId; /// This can be an impl, or a trait if this is a defaulted term. @@ -575,7 +577,6 @@ macro_rules! declare_lift_into { declare_lift_into! { BoundVarKinds, - Const, DefId, EarlyParamRegion, ErrorGuaranteed, @@ -585,6 +586,7 @@ declare_lift_into! { GenericArgs, InherentAssocConstId, InherentAssocTyId, + InternedConstKind, InternedRegionKind, OpaqueTyId, ParamEnv, diff --git a/compiler/rustc_type_ir/src/ir_print.rs b/compiler/rustc_type_ir/src/ir_print.rs index 8133862e1bf1a..1f588a64bd80d 100644 --- a/compiler/rustc_type_ir/src/ir_print.rs +++ b/compiler/rustc_type_ir/src/ir_print.rs @@ -3,8 +3,8 @@ use std::fmt; #[cfg(feature = "nightly")] use crate::{AliasConst, ClosureKind}; use crate::{ - AliasTerm, AliasTy, Binder, CoercePredicate, ExistentialProjection, ExistentialTraitRef, FnSig, - HostEffectClause, Interner, NormalizesTo, OutlivesClause, PatternKind, Placeholder, + AliasTerm, AliasTy, Binder, CoercePredicate, Const, ExistentialProjection, ExistentialTraitRef, + FnSig, HostEffectClause, Interner, NormalizesTo, OutlivesClause, PatternKind, Placeholder, ProjectionClause, Region, SubtypePredicate, TraitClause, TraitRef, }; @@ -64,6 +64,15 @@ where } } +impl fmt::Display for Const +where + I: IrPrint>, +{ + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + >>::print(self, fmt) + } +} + impl fmt::Display for OutlivesClause where I: IrPrint>, diff --git a/compiler/rustc_type_ir/src/serialize.rs b/compiler/rustc_type_ir/src/serialize.rs index 835383b101136..eae1d05b7e8e7 100644 --- a/compiler/rustc_type_ir/src/serialize.rs +++ b/compiler/rustc_type_ir/src/serialize.rs @@ -2,7 +2,7 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use crate::inherent::*; use crate::visit::TypeVisitable; -use crate::{self as ty, Interner, Region, RegionKind, UnsafeBinderInner}; +use crate::{self as ty, Const, ConstKind, Interner, Region, RegionKind, UnsafeBinderInner}; /// A decoder that can reconstruct interned type IR values by supplying the /// interner that owns the decoded data. @@ -117,3 +117,21 @@ where decoder.interner().intern_region(Decodable::decode(decoder)) } } + +impl Encodable for Const +where + ConstKind: Encodable, +{ + fn encode(&self, e: &mut E) { + self.kind().encode(e); + } +} + +impl> Decodable for Const +where + ConstKind: Decodable, +{ + fn decode(decoder: &mut D) -> Self { + Const::new(decoder.interner(), Decodable::decode(decoder)) + } +} diff --git a/compiler/rustc_type_ir/src/sty/consts.rs b/compiler/rustc_type_ir/src/sty/consts.rs new file mode 100644 index 0000000000000..da2256078efa7 --- /dev/null +++ b/compiler/rustc_type_ir/src/sty/consts.rs @@ -0,0 +1,243 @@ +use std::fmt; + +use derive_where::derive_where; +use rustc_ast_ir::visit::VisitorResult; +#[cfg(feature = "nightly")] +use rustc_macros::StableHash_NoContext; +use rustc_type_ir_macros::{GenericTypeVisitable, Lift_Generic}; + +use crate::inherent::*; +use crate::intern::Interned; +use crate::relate::{Relate, RelateResult, TypeRelation}; +use crate::{ + AliasConst, BoundConst, BoundVar, BoundVarIndexKind, ConstKind, ConstVid, DebruijnIndex, + FallibleTypeFolder, Flags, InferConst, Interner, IsRigid, PlaceholderConst, TypeFlags, + TypeFoldable, TypeFolder, TypeSuperFoldable, TypeSuperVisitable, TypeVisitable, TypeVisitor, +}; + +#[derive_where(Clone, Copy, PartialEq, Eq, Hash; I: Interner)] +#[cfg_attr(feature = "nightly", derive(StableHash_NoContext))] +#[cfg_attr(feature = "nightly", rustc_pass_by_value)] +#[derive(GenericTypeVisitable, Lift_Generic)] +pub struct Const(pub I::InternedConstKind); + +impl fmt::Debug for Const { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + // If this is a value, we spend some effort to make it look nice. + if let ConstKind::Value(cv) = self.kind() { + write!(f, "{}", cv) + } else { + // Fall back to something verbose. + write!(f, "{:?}", self.kind()) + } + } +} + +impl Const { + #[inline] + pub fn kind(self) -> ConstKind { + *self.0.get() + } + + #[inline] + pub fn new(interner: I, kind: ConstKind) -> Self { + interner.mk_ct_from_kind(kind) + } + + #[inline] + pub fn new_var(interner: I, infer: ConstVid) -> Self { + Self::new(interner, ConstKind::Infer(InferConst::Var(infer))) + } + + #[inline] + pub fn new_infer(interner: I, infer: InferConst) -> Self { + Self::new(interner, ConstKind::Infer(infer)) + } + + #[inline] + pub fn new_bound(interner: I, debruijn: DebruijnIndex, bound_const: BoundConst) -> Self { + Self::new(interner, ConstKind::Bound(BoundVarIndexKind::Bound(debruijn), bound_const)) + } + + #[inline] + pub fn new_anon_bound(interner: I, debruijn: DebruijnIndex, var: BoundVar) -> Self { + Self::new_bound(interner, debruijn, BoundConst::new(var)) + } + + #[inline] + pub fn new_canonical_bound(interner: I, var: BoundVar) -> Self { + Self::new(interner, ConstKind::Bound(BoundVarIndexKind::Canonical, BoundConst::new(var))) + } + + #[inline] + pub fn new_placeholder(interner: I, placeholder: PlaceholderConst) -> Self { + Self::new(interner, ConstKind::Placeholder(placeholder)) + } + + #[inline] + pub fn new_alias(interner: I, is_rigid: IsRigid, alias_const: AliasConst) -> Self { + Self::new(interner, ConstKind::Alias(is_rigid, alias_const)) + } + + #[inline] + pub fn new_expr(interner: I, expr: I::ExprConst) -> Self { + Const::new(interner, ConstKind::Expr(expr)) + } + + #[inline] + pub fn new_error(interner: I, e: I::ErrorGuaranteed) -> Self { + Const::new(interner, ConstKind::Error(e)) + } + + #[inline] + pub fn is_ct_var(self) -> bool { + matches!(self.kind(), ConstKind::Infer(InferConst::Var(_))) + } + + #[inline] + pub fn is_ct_error(self) -> bool { + matches!(self.kind(), ConstKind::Error(_)) + } + + #[inline] + pub fn new_param(interner: I, param: I::ParamConst) -> Self { + Self::new(interner, ConstKind::Param(param)) + } + + #[inline] + pub fn new_fresh(interner: I, fresh: u32) -> Self { + Self::new(interner, ConstKind::Infer(InferConst::Fresh(fresh))) + } + + #[track_caller] + pub fn new_misc_error(interner: I) -> Self { + Self::new_error_with_message( + interner, + I::Span::dummy(), + "ty::ConstKind::Error constructed but no error reported", + ) + } + + #[track_caller] + pub fn new_error_with_message(interner: I, span: I::Span, msg: impl ToString) -> Self { + let reported = interner.span_delayed_bug(span, msg); + Self::new_error(interner, reported) + } + + pub fn is_trivially_wf(self) -> bool { + match self.kind() { + ConstKind::Param(_) | ConstKind::Placeholder(_) | ConstKind::Bound(..) => true, + ConstKind::Infer(_) + | ConstKind::Alias(..) + | ConstKind::Value(_) + | ConstKind::Error(_) + | ConstKind::Expr(_) => false, + } + } + + pub fn is_ct_infer(self) -> bool { + matches!(self.kind(), ConstKind::Infer(_)) + } + + pub fn ct_vid(self) -> Option { + match self.kind() { + ConstKind::Infer(InferConst::Var(vid)) => Some(vid), + _ => None, + } + } +} + +impl Flags for Const { + fn flags(&self) -> TypeFlags { + self.0.get().flags + } + + fn outer_exclusive_binder(&self) -> DebruijnIndex { + self.0.get().outer_exclusive_binder + } +} + +impl IntoKind for Const { + type Kind = ConstKind; + + fn kind(self) -> Self::Kind { + *self.0.get() + } +} + +impl TypeFoldable for Const { + fn try_fold_with>(self, folder: &mut F) -> Result { + folder.try_fold_const(self) + } + + fn fold_with>(self, folder: &mut F) -> Self { + folder.fold_const(self) + } +} + +impl TypeVisitable for Const { + fn visit_with>(&self, visitor: &mut V) -> V::Result { + visitor.visit_const(*self) + } +} + +impl TypeSuperFoldable for Const { + fn try_super_fold_with>( + self, + folder: &mut F, + ) -> Result { + let kind = match self.kind() { + ConstKind::Alias(is_rigid, alias_const) => { + ConstKind::Alias(is_rigid, alias_const.try_fold_with(folder)?) + } + ConstKind::Value(v) => ConstKind::Value(v.try_fold_with(folder)?), + ConstKind::Expr(e) => ConstKind::Expr(e.try_fold_with(folder)?), + + ConstKind::Param(_) + | ConstKind::Infer(_) + | ConstKind::Bound(..) + | ConstKind::Placeholder(_) + | ConstKind::Error(_) => return Ok(self), + }; + if kind != self.kind() { Ok(Self::new(folder.cx(), kind)) } else { Ok(self) } + } + + fn super_fold_with>(self, folder: &mut F) -> Self { + let kind = match self.kind() { + ConstKind::Alias(is_rigid, alias_const) => { + ConstKind::Alias(is_rigid, alias_const.fold_with(folder)) + } + ConstKind::Value(v) => ConstKind::Value(v.fold_with(folder)), + ConstKind::Expr(e) => ConstKind::Expr(e.fold_with(folder)), + + ConstKind::Param(_) + | ConstKind::Infer(_) + | ConstKind::Bound(..) + | ConstKind::Placeholder(_) + | ConstKind::Error(_) => return self, + }; + if kind != self.kind() { Self::new(folder.cx(), kind) } else { self } + } +} + +impl TypeSuperVisitable for Const { + fn super_visit_with>(&self, visitor: &mut V) -> V::Result { + match self.kind() { + ConstKind::Alias(_, alias_const) => alias_const.visit_with(visitor), + ConstKind::Value(v) => v.visit_with(visitor), + ConstKind::Expr(e) => e.visit_with(visitor), + ConstKind::Error(e) => e.visit_with(visitor), + + ConstKind::Param(_) + | ConstKind::Infer(_) + | ConstKind::Bound(..) + | ConstKind::Placeholder(_) => V::Result::output(), + } + } +} + +impl Relate for Const { + fn relate>(relation: &mut R, a: Self, b: Self) -> RelateResult { + relation.consts(a, b) + } +} diff --git a/compiler/rustc_type_ir/src/sty/mod.rs b/compiler/rustc_type_ir/src/sty/mod.rs index 0dfdda6af16cc..d513dd88faae6 100644 --- a/compiler/rustc_type_ir/src/sty/mod.rs +++ b/compiler/rustc_type_ir/src/sty/mod.rs @@ -1,3 +1,6 @@ +pub use consts::*; +mod consts; + use std::fmt; use derive_where::derive_where; diff --git a/compiler/rustc_type_ir/src/ty_info.rs b/compiler/rustc_type_ir/src/ty_info.rs index 7aa34183a7a38..1a0975c657e9b 100644 --- a/compiler/rustc_type_ir/src/ty_info.rs +++ b/compiler/rustc_type_ir/src/ty_info.rs @@ -11,7 +11,7 @@ use crate::{DebruijnIndex, TypeFlags}; /// A helper type that you can wrap round your own type in order to automatically /// cache the type flags and debruijn index on creation and not recompute it /// whenever the information is needed. -#[derive(Copy, Clone, GenericTypeVisitable)] +#[derive(Copy, Clone, Debug, GenericTypeVisitable)] pub struct WithCachedTypeInfo { pub internee: T, From 51e2875c331053b6764a59c4710d454a1b134a72 Mon Sep 17 00:00:00 2001 From: James Barford-Evans Date: Thu, 17 Sep 2026 09:36:40 +0100 Subject: [PATCH 14/19] Remap `I::Const` -> `Const` --- .../src/canonical/canonicalizer.rs | 6 +++--- .../src/canonical/mod.rs | 6 +++--- .../rustc_next_trait_solver/src/coherence.rs | 4 ++-- .../rustc_next_trait_solver/src/delegate.rs | 6 +++--- .../rustc_next_trait_solver/src/normalize.rs | 6 +++--- .../src/placeholder.rs | 9 +++++---- .../src/solve/assembly/mod.rs | 4 ++-- .../src/solve/eval_ctxt/mod.rs | 12 +++++------ .../eval_ctxt/solver_region_constraints.rs | 6 +++--- .../rustc_next_trait_solver/src/solve/mod.rs | 10 +++++----- .../src/solve/normalizes_to.rs | 3 ++- compiler/rustc_type_ir/src/binder.rs | 12 +++++------ compiler/rustc_type_ir/src/canonical.rs | 2 +- compiler/rustc_type_ir/src/error.rs | 8 ++++---- compiler/rustc_type_ir/src/fast_reject.rs | 4 ++-- compiler/rustc_type_ir/src/flags.rs | 4 ++-- compiler/rustc_type_ir/src/fold.rs | 20 +++++++++---------- compiler/rustc_type_ir/src/generic_arg.rs | 4 ++-- compiler/rustc_type_ir/src/infer_ctxt.rs | 17 +++++++--------- compiler/rustc_type_ir/src/pattern.rs | 4 ++-- compiler/rustc_type_ir/src/predicate_kind.rs | 8 ++++---- .../rustc_type_ir/src/region_constraint.rs | 4 +++- compiler/rustc_type_ir/src/relate.rs | 10 +++++----- compiler/rustc_type_ir/src/relate/combine.rs | 8 ++++---- .../src/relate/solver_relating.rs | 4 ++-- compiler/rustc_type_ir/src/solve/mod.rs | 6 +++--- compiler/rustc_type_ir/src/term_kind.rs | 6 +++--- compiler/rustc_type_ir/src/ty_kind.rs | 4 ++-- compiler/rustc_type_ir/src/universe.rs | 4 ++-- compiler/rustc_type_ir/src/visit.rs | 8 ++++---- 30 files changed, 105 insertions(+), 104 deletions(-) diff --git a/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs b/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs index f0f0ebaf2b3bb..75c7513758cd0 100644 --- a/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs +++ b/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs @@ -5,8 +5,8 @@ use rustc_type_ir::inherent::*; use rustc_type_ir::solve::{Goal, QueryInput}; use rustc_type_ir::{ self as ty, Canonical, CanonicalParamEnvCacheEntry, CanonicalVarKind, CanonicalizerState, - Flags, InferCtxtLike, Interner, PlaceholderConst, PlaceholderType, PredicateProxy, Region, - TypeFlags, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt, + Const, Flags, InferCtxtLike, Interner, PlaceholderConst, PlaceholderType, PredicateProxy, + Region, TypeFlags, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt, }; use thin_vec::ThinVec; @@ -525,7 +525,7 @@ impl, I: Interner> TypeFolder for Canonicaliz } } - fn fold_const(&mut self, c: I::Const) -> I::Const { + fn fold_const(&mut self, c: Const) -> Const { if !c.flags().intersects(NEEDS_CANONICAL) { return c; } diff --git a/compiler/rustc_next_trait_solver/src/canonical/mod.rs b/compiler/rustc_next_trait_solver/src/canonical/mod.rs index fc9024333bf44..45ae4cadf519c 100644 --- a/compiler/rustc_next_trait_solver/src/canonical/mod.rs +++ b/compiler/rustc_next_trait_solver/src/canonical/mod.rs @@ -18,8 +18,8 @@ use rustc_type_ir::relate::{ self, Relate, RelateResult, TypeRelation, VarianceDiagInfo, relate_args_invariantly, }; use rustc_type_ir::{ - self as ty, Canonical, CanonicalVarKind, CanonicalVarValues, InferCtxtLike, Interner, Region, - TypeFoldable, TypingMode, TypingModeEqWrapper, + self as ty, Canonical, CanonicalVarKind, CanonicalVarValues, Const, InferCtxtLike, Interner, + Region, TypeFoldable, TypingMode, TypingModeEqWrapper, }; use thin_vec::ThinVec; use tracing::instrument; @@ -421,7 +421,7 @@ where } #[instrument(skip(self), level = "trace")] - fn consts(&mut self, a: I::Const, b: I::Const) -> RelateResult { + fn consts(&mut self, a: Const, b: Const) -> RelateResult> { if a == b { return Ok(a); } diff --git a/compiler/rustc_next_trait_solver/src/coherence.rs b/compiler/rustc_next_trait_solver/src/coherence.rs index e37e69a617bbd..ad6fc98601f69 100644 --- a/compiler/rustc_next_trait_solver/src/coherence.rs +++ b/compiler/rustc_next_trait_solver/src/coherence.rs @@ -5,7 +5,7 @@ use derive_where::derive_where; use rustc_type_ir::inherent::*; use rustc_type_ir::lang_items::SolverAdtLangItem; use rustc_type_ir::{ - self as ty, InferCtxtLike, Interner, Region, TrivialTypeTraversalImpls, TypeVisitable, + self as ty, Const, InferCtxtLike, Interner, Region, TrivialTypeTraversalImpls, TypeVisitable, TypeVisitableExt, TypeVisitor, }; use tracing::instrument; @@ -469,7 +469,7 @@ where /// As these should be quite rare as const arguments and especially rare as impl /// parameters, allowing uncovered const parameters in impls seems more useful /// than allowing `impl Trait for i32` to compile. - fn visit_const(&mut self, _c: I::Const) -> Self::Result { + fn visit_const(&mut self, _c: Const) -> Self::Result { ControlFlow::Continue(()) } } diff --git a/compiler/rustc_next_trait_solver/src/delegate.rs b/compiler/rustc_next_trait_solver/src/delegate.rs index 0a307f766ebb2..24e321fc68c67 100644 --- a/compiler/rustc_next_trait_solver/src/delegate.rs +++ b/compiler/rustc_next_trait_solver/src/delegate.rs @@ -5,7 +5,7 @@ use rustc_type_ir::solve::{ Certainty, ComputeGoalFastPathOutcome, FetchEligibleAssocItemResponse, Goal, NoSolution, VisibleForLeakCheck, }; -use rustc_type_ir::{self as ty, CanonicalizerState, InferCtxtLike, Interner, TypeFoldable}; +use rustc_type_ir::{self as ty, CanonicalizerState, Const, InferCtxtLike, Interner, TypeFoldable}; /// `SolverDelegate` is one of the two traits in the `rustc_type_ir` shared abstraction layer /// between rustc and rust-analyzer abstracting over the [InferCtxt][inferctxt-doc], which had to be @@ -63,7 +63,7 @@ pub trait SolverDelegate: Deref + Sized { normalize_ty: impl FnOnce( ty::Unnormalized::Ty>, ) -> Result<::Ty, E>, - ) -> Result::Const>, E>; + ) -> Result>, E>; // FIXME: This only is here because `wf::obligations` is in `rustc_trait_selection`! fn well_formed_goals( @@ -112,7 +112,7 @@ pub trait SolverDelegate: Deref + Sized { &self, src: ::Ty, dst: ::Ty, - assume: ::Const, + assume: Const, ) -> Result; /// Obtain canonicalizer state, either by allocating it afresh (the default) or by reusing diff --git a/compiler/rustc_next_trait_solver/src/normalize.rs b/compiler/rustc_next_trait_solver/src/normalize.rs index ab3a92da4ba54..c7d8d2919089b 100644 --- a/compiler/rustc_next_trait_solver/src/normalize.rs +++ b/compiler/rustc_next_trait_solver/src/normalize.rs @@ -2,8 +2,8 @@ use std::fmt::Debug; use rustc_type_ir::inherent::*; use rustc_type_ir::{ - self as ty, AliasTerm, Binder, FallibleTypeFolder, InferCtxtLike, Interner, PredicateProxy, - TypeFoldable, TypeSuperFoldable, TypeVisitableExt, UniverseIndex, + self as ty, AliasTerm, Binder, Const, FallibleTypeFolder, InferCtxtLike, Interner, + PredicateProxy, TypeFoldable, TypeSuperFoldable, TypeVisitableExt, UniverseIndex, }; use tracing::instrument; @@ -147,7 +147,7 @@ where } #[instrument(level = "trace", skip(self), ret)] - fn try_fold_const(&mut self, ct: I::Const) -> Result { + fn try_fold_const(&mut self, ct: Const) -> Result, Self::Error> { let infcx = self.infcx; let original = ct; diff --git a/compiler/rustc_next_trait_solver/src/placeholder.rs b/compiler/rustc_next_trait_solver/src/placeholder.rs index 84811a101fb11..c96aa90a10792 100644 --- a/compiler/rustc_next_trait_solver/src/placeholder.rs +++ b/compiler/rustc_next_trait_solver/src/placeholder.rs @@ -3,8 +3,9 @@ use core::panic; use rustc_type_ir::data_structures::IndexMap; use rustc_type_ir::inherent::*; use rustc_type_ir::{ - self as ty, InferCtxtLike, Interner, PlaceholderConst, PlaceholderRegion, PlaceholderType, - PredicateProxy, Region, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt, + self as ty, Const, InferCtxtLike, Interner, PlaceholderConst, PlaceholderRegion, + PlaceholderType, PredicateProxy, Region, TypeFoldable, TypeFolder, TypeSuperFoldable, + TypeVisitableExt, }; use tracing::debug; @@ -160,7 +161,7 @@ where } } - fn fold_const(&mut self, ct: I::Const) -> I::Const { + fn fold_const(&mut self, ct: Const) -> Const { match ct.kind() { ty::ConstKind::Bound(ty::BoundVarIndexKind::Bound(debruijn), _) if debruijn.as_usize() + 1 @@ -310,7 +311,7 @@ where } } - fn fold_const(&mut self, ct: I::Const) -> I::Const { + fn fold_const(&mut self, ct: Const) -> Const { let ct = self.infcx.shallow_resolve_const(ct); if let ty::ConstKind::Placeholder(p) = ct.kind() { let replace_var = self.mapped_consts.get(&p); diff --git a/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs b/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs index 485568850bee0..32e38ad88c856 100644 --- a/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs @@ -14,7 +14,7 @@ use rustc_type_ir::solve::{ RerunNonErased, RerunReason, RerunResultExt, SizedTraitKind, StalledOnCoroutines, }; use rustc_type_ir::{ - self as ty, AliasTy, Interner, MayBeErased, Region, TypeFlags, TypeFoldable, TypeFolder, + self as ty, AliasTy, Const, Interner, MayBeErased, Region, TypeFlags, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, TypingMode, Unnormalized, Upcast, elaborate, }; @@ -1466,7 +1466,7 @@ where } } - fn visit_const(&mut self, ct: I::Const) -> Self::Result { + fn visit_const(&mut self, ct: Const) -> Self::Result { let ct = self.ecx.replace_bound_vars(ct, &mut self.universes); let Ok(ct) = self.ecx.structurally_normalize_const(self.param_env, ct) else { return ControlFlow::Break(Err(NoSolution)); diff --git a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs index 3a4875c1d0951..52eaa445d68a6 100644 --- a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs @@ -17,7 +17,7 @@ use rustc_type_ir::solve::{ RerunNonErased, RerunReason, RerunResultExt, SmallCopySet, TyOrConstInferVar, }; use rustc_type_ir::{ - self as ty, CanonicalVarValues, ClauseKind, InferCtxtLike, Interner, MayBeErased, + self as ty, CanonicalVarValues, ClauseKind, Const, InferCtxtLike, Interner, MayBeErased, OpaqueTypeKey, PredicateKind, PredicateProxy, Region, RegionVid, TypeFoldable, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, TypingMode, max_universe, }; @@ -1057,7 +1057,7 @@ where ty } - pub(super) fn next_const_infer(&mut self) -> I::Const { + pub(super) fn next_const_infer(&mut self) -> Const { let ct = self.delegate.next_const_infer(); self.inspect.add_var_value(ct); ct @@ -1154,7 +1154,7 @@ where ControlFlow::Continue(()) } - fn visit_const(&mut self, c: I::Const) -> Self::Result { + fn visit_const(&mut self, c: Const) -> Self::Result { match c.kind() { ty::ConstKind::Infer(ty::InferConst::Var(vid)) => { if let ty::TermKind::Const(term) = self.term.kind() @@ -1409,7 +1409,7 @@ where &mut self, param_env: I::ParamEnv, alias_const: ty::AliasConst, - ) -> Result, NoSolutionOrRerunNonErased> { + ) -> Result>, NoSolutionOrRerunNonErased> { if self.typing_mode().is_erased_not_coherence() { match self.opaque_accesses.rerun_always(RerunReason::EvaluateConst)? {} } @@ -1470,7 +1470,7 @@ where &mut self, src: I::Ty, dst: I::Ty, - assume: I::Const, + assume: Const, ) -> Result { self.delegate.is_transmutable(dst, src, assume) } @@ -1760,7 +1760,7 @@ fn filter_irrelevant_region_constraints( } t.super_visit_with(self); } - fn visit_const(&mut self, c: I::Const) { + fn visit_const(&mut self, c: Const) { // The same goes for consts. if !c.has_infer_regions() { return; diff --git a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/solver_region_constraints.rs b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/solver_region_constraints.rs index 5ecc06b30f33b..10dd8585b09c4 100644 --- a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/solver_region_constraints.rs +++ b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/solver_region_constraints.rs @@ -11,8 +11,8 @@ use rustc_type_ir::region_constraint::{ propagate_ambiguity, }; use rustc_type_ir::{ - AliasTy, Binder, ClauseKind, InferCtxtLike, Interner, Region, TypeVisitable, TypeVisitableExt, - TypeVisitor, UniverseIndex, + AliasTy, Binder, ClauseKind, Const, InferCtxtLike, Interner, Region, TypeVisitable, + TypeVisitableExt, TypeVisitor, UniverseIndex, }; use tracing::{debug, instrument}; @@ -63,7 +63,7 @@ where ); } - fn visit_const(&mut self, c: I::Const) { + fn visit_const(&mut self, c: Const) { self.out.extend( self.ecx .well_formed_goals(self.param_env, c.into()) diff --git a/compiler/rustc_next_trait_solver/src/solve/mod.rs b/compiler/rustc_next_trait_solver/src/solve/mod.rs index 10ee038005d8e..1d7d2dd75c316 100644 --- a/compiler/rustc_next_trait_solver/src/solve/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/mod.rs @@ -23,7 +23,7 @@ mod trait_goals; use derive_where::derive_where; use rustc_type_ir::inherent::*; pub use rustc_type_ir::solve::*; -use rustc_type_ir::{self as ty, Interner, Region, TypeVisitableExt}; +use rustc_type_ir::{self as ty, Const, Interner, Region, TypeVisitableExt}; use tracing::instrument; pub use self::eval_ctxt::{ @@ -205,7 +205,7 @@ where #[instrument(level = "trace", skip(self))] fn compute_const_evaluatable_goal( &mut self, - Goal { param_env, predicate: ct }: Goal, + Goal { param_env, predicate: ct }: Goal>, ) -> QueryResultOrRerunNonErased { match ct.kind() { ty::ConstKind::Alias(ty::IsRigid::Yes, _) @@ -248,7 +248,7 @@ where #[instrument(level = "trace", skip(self), ret)] fn compute_const_arg_has_type_goal( &mut self, - goal: Goal, + goal: Goal, I::Ty)>, ) -> QueryResultOrRerunNonErased { let (ct, ty) = goal.predicate; let ct = self.structurally_normalize_const(goal.param_env, ct)?; @@ -375,8 +375,8 @@ where fn structurally_normalize_const( &mut self, param_env: I::ParamEnv, - ct: I::Const, - ) -> Result { + ct: Const, + ) -> Result, NoSolutionOrRerunNonErased> { self.structurally_normalize_term(param_env, ct.into()).map(|term| term.expect_const()) } diff --git a/compiler/rustc_next_trait_solver/src/solve/normalizes_to.rs b/compiler/rustc_next_trait_solver/src/solve/normalizes_to.rs index cb878f2c54878..388b334ccf618 100644 --- a/compiler/rustc_next_trait_solver/src/solve/normalizes_to.rs +++ b/compiler/rustc_next_trait_solver/src/solve/normalizes_to.rs @@ -8,7 +8,8 @@ use rustc_type_ir::solve::{ RerunNonErased, RerunReason, RerunResultExt, }; use rustc_type_ir::{ - self as ty, FieldInfo, Interner, NormalizesTo, PredicateKind, Region, Unnormalized, Upcast as _, + self as ty, Const, FieldInfo, Interner, NormalizesTo, PredicateKind, Region, Unnormalized, + Upcast as _, }; use tracing::instrument; diff --git a/compiler/rustc_type_ir/src/binder.rs b/compiler/rustc_type_ir/src/binder.rs index a16610a520406..6722adfe24d5d 100644 --- a/compiler/rustc_type_ir/src/binder.rs +++ b/compiler/rustc_type_ir/src/binder.rs @@ -16,7 +16,7 @@ use crate::fold::{FallibleTypeFolder, TypeFoldable, TypeFolder, TypeSuperFoldabl use crate::inherent::*; use crate::visit::{Flags, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor}; use crate::{ - self as ty, DebruijnIndex, Interner, PredicateProxy, Region, UniverseIndex, Unnormalized, + self as ty, Const, DebruijnIndex, Interner, PredicateProxy, Region, UniverseIndex, Unnormalized, }; /// `Binder` is a binder for higher-ranked lifetimes or types. It is part of the @@ -262,7 +262,7 @@ impl TypeVisitor for ValidateBoundVars { t.super_visit_with(self) } - fn visit_const(&mut self, c: I::Const) -> Self::Result { + fn visit_const(&mut self, c: Const) -> Self::Result { if c.outer_exclusive_binder() < self.binder_index { return ControlFlow::Break(()); } @@ -741,7 +741,7 @@ impl<'a, I: Interner> TypeFolder for ArgFolder<'a, I> { } } - fn fold_const(&mut self, c: I::Const) -> I::Const { + fn fold_const(&mut self, c: Const) -> Const { if let ty::ConstKind::Param(p) = c.kind() { self.const_for_param(p, c) } else { @@ -796,7 +796,7 @@ impl<'a, I: Interner> ArgFolder<'a, I> { ) } - fn const_for_param(&self, p: I::ParamConst, source_ct: I::Const) -> I::Const { + fn const_for_param(&self, p: I::ParamConst, source_ct: Const) -> Const { // Look up the const in the args. It really should be in there. let opt_ct = self.args.get(p.index() as usize).map(|arg| arg.kind()); let ct = match opt_ct { @@ -813,7 +813,7 @@ impl<'a, I: Interner> ArgFolder<'a, I> { fn const_param_expected( &self, p: I::ParamConst, - ct: I::Const, + ct: Const, kind: ty::GenericArgKind, ) -> ! { panic!( @@ -828,7 +828,7 @@ impl<'a, I: Interner> ArgFolder<'a, I> { #[cold] #[inline(never)] - fn const_param_out_of_range(&self, p: I::ParamConst, ct: I::Const) -> ! { + fn const_param_out_of_range(&self, p: I::ParamConst, ct: Const) -> ! { panic!( "const parameter `{:?}` ({:?}/{}) out of range when instantiating args={:?}", p, diff --git a/compiler/rustc_type_ir/src/canonical.rs b/compiler/rustc_type_ir/src/canonical.rs index bba271ba13033..66ee34693c118 100644 --- a/compiler/rustc_type_ir/src/canonical.rs +++ b/compiler/rustc_type_ir/src/canonical.rs @@ -12,7 +12,7 @@ use thin_vec::ThinVec; use crate::data_structures::{DelayedMap, HashMap}; use crate::inherent::*; -use crate::{self as ty, Interner, Region, TypingModeEqWrapper, UniverseIndex}; +use crate::{self as ty, Const, Interner, Region, TypingModeEqWrapper, UniverseIndex}; #[derive_where(Clone, Hash, PartialEq, Debug; I: Interner, V)] #[derive_where(Copy; I: Interner, V: Copy)] diff --git a/compiler/rustc_type_ir/src/error.rs b/compiler/rustc_type_ir/src/error.rs index 59ceb4bd1e327..76b86d21b6ae4 100644 --- a/compiler/rustc_type_ir/src/error.rs +++ b/compiler/rustc_type_ir/src/error.rs @@ -3,7 +3,7 @@ use rustc_abi::ExternAbi; use rustc_type_ir_macros::{GenericTypeVisitable, TypeFoldable_Generic, TypeVisitable_Generic}; use crate::solve::{NoSolution, NoSolutionOrRerunNonErased}; -use crate::{self as ty, Interner, Region}; +use crate::{self as ty, Const, Interner, Region}; #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[derive(TypeFoldable_Generic, TypeVisitable_Generic, GenericTypeVisitable)] @@ -30,7 +30,7 @@ pub enum TypeError { Mutability, ArgumentMutability(usize), TupleSize(ExpectedFound), - ArraySize(ExpectedFound), + ArraySize(ExpectedFound>), ArgCount, RegionsDoesNotOutlive(Region, Region), @@ -47,10 +47,10 @@ pub enum TypeError { /// created a cycle (because it appears somewhere within that /// type). CyclicTy(I::Ty), - CyclicConst(I::Const), + CyclicConst(Const), ProjectionMismatched(ExpectedFound>), ExistentialMismatch(ExpectedFound), - ConstMismatch(ExpectedFound), + ConstMismatch(ExpectedFound>), IntrinsicCast, /// `#[rustc_force_inline]` functions must be inlined and must not be codegened independently, diff --git a/compiler/rustc_type_ir/src/fast_reject.rs b/compiler/rustc_type_ir/src/fast_reject.rs index e9339338a6ef1..398fddcd4a141 100644 --- a/compiler/rustc_type_ir/src/fast_reject.rs +++ b/compiler/rustc_type_ir/src/fast_reject.rs @@ -9,7 +9,7 @@ use rustc_macros::{Decodable_NoContext, Encodable_NoContext, StableHash}; use crate::inherent::*; use crate::visit::TypeVisitableExt as _; -use crate::{self as ty, Interner}; +use crate::{self as ty, Const, Interner}; /// See `simplify_type`. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] @@ -486,7 +486,7 @@ impl bool { + fn consts_may_unify_inner(self, lhs: Const, rhs: Const) -> bool { match rhs.kind() { ty::ConstKind::Param(_) => { if INSTANTIATE_RHS_WITH_INFER { diff --git a/compiler/rustc_type_ir/src/flags.rs b/compiler/rustc_type_ir/src/flags.rs index 7b0a098ad1948..4af4f1479ec82 100644 --- a/compiler/rustc_type_ir/src/flags.rs +++ b/compiler/rustc_type_ir/src/flags.rs @@ -1,6 +1,6 @@ use crate::inherent::*; use crate::visit::Flags; -use crate::{self as ty, Interner, Region}; +use crate::{self as ty, Const, Interner, Region}; bitflags::bitflags! { /// Flags that we track on types. These flags are propagated upwards @@ -463,7 +463,7 @@ impl FlagComputation { } } - fn add_const(&mut self, c: I::Const) { + fn add_const(&mut self, c: Const) { self.add_flags(c.flags()); self.add_exclusive_binder(c.outer_exclusive_binder()); } diff --git a/compiler/rustc_type_ir/src/fold.rs b/compiler/rustc_type_ir/src/fold.rs index 2b25de4132e62..388796732c2cb 100644 --- a/compiler/rustc_type_ir/src/fold.rs +++ b/compiler/rustc_type_ir/src/fold.rs @@ -56,8 +56,8 @@ use tracing::{debug, instrument}; use crate::inherent::*; use crate::visit::{TypeVisitable, TypeVisitableExt as _}; use crate::{ - self as ty, Binder, BoundVarIndexKind, ClauseKind, Flags, Interner, ProjectionClause, Region, - TypeSuperVisitable, + self as ty, Binder, BoundVarIndexKind, ClauseKind, Const, Flags, Interner, ProjectionClause, + Region, TypeSuperVisitable, }; /// This trait is implemented for every type that can be folded, @@ -144,7 +144,7 @@ pub trait TypeFolder: Sized { r } - fn fold_const(&mut self, c: I::Const) -> I::Const { + fn fold_const(&mut self, c: Const) -> Const { c.super_fold_with(self) } @@ -213,7 +213,7 @@ pub trait FallibleTypeFolder: Sized { Ok(r) } - fn try_fold_const(&mut self, c: I::Const) -> Result { + fn try_fold_const(&mut self, c: Const) -> Result, Self::Error> { c.try_super_fold_with(self) } @@ -448,7 +448,7 @@ impl TypeFolder for Shifter { } } - fn fold_const(&mut self, ct: I::Const) -> I::Const { + fn fold_const(&mut self, ct: Const) -> Const { match ct.kind() { ty::ConstKind::Bound(ty::BoundVarIndexKind::Bound(debruijn), bound_ct) if debruijn >= self.current_index => @@ -572,7 +572,7 @@ where if t.has_regions() { t.super_fold_with(self) } else { t } } - fn fold_const(&mut self, ct: I::Const) -> I::Const { + fn fold_const(&mut self, ct: Const) -> Const { if ct.has_regions() { ct.super_fold_with(self) } else { ct } } @@ -698,7 +698,7 @@ impl TypeFolder for RigidnessFolder { } } - fn fold_const(&mut self, c: I::Const) -> I::Const { + fn fold_const(&mut self, c: Const) -> Const { if !self.mode.needs_change(&c) { return c; } @@ -708,13 +708,13 @@ impl TypeFolder for RigidnessFolder { let alias_const = alias_const.fold_with(self); match self.mode { RigidnessFoldMode::AllToRigid => { - I::Const::new_alias(self.cx, ty::IsRigid::Yes, alias_const) + Const::new_alias(self.cx, ty::IsRigid::Yes, alias_const) } RigidnessFoldMode::AllToNonRigid => { - I::Const::new_alias(self.cx(), ty::IsRigid::No, alias_const) + Const::new_alias(self.cx(), ty::IsRigid::No, alias_const) } RigidnessFoldMode::OpaqueToNonRigid | RigidnessFoldMode::TypeToRigid => { - I::Const::new_alias(self.cx(), is_rigid, alias_const) + Const::new_alias(self.cx(), is_rigid, alias_const) } } } diff --git a/compiler/rustc_type_ir/src/generic_arg.rs b/compiler/rustc_type_ir/src/generic_arg.rs index b42a3c3159a07..31c87f7b1684e 100644 --- a/compiler/rustc_type_ir/src/generic_arg.rs +++ b/compiler/rustc_type_ir/src/generic_arg.rs @@ -3,7 +3,7 @@ use derive_where::derive_where; use rustc_macros::{Decodable_NoContext, Encodable_NoContext, StableHash_NoContext}; use rustc_type_ir_macros::GenericTypeVisitable; -use crate::{Interner, Region}; +use crate::{Const, Interner, Region}; #[derive_where(Clone, Copy, PartialEq, Debug; I: Interner)] #[derive(GenericTypeVisitable)] @@ -14,7 +14,7 @@ use crate::{Interner, Region}; pub enum GenericArgKind { Lifetime(Region), Type(I::Ty), - Const(I::Const), + Const(Const), } impl Eq for GenericArgKind {} diff --git a/compiler/rustc_type_ir/src/infer_ctxt.rs b/compiler/rustc_type_ir/src/infer_ctxt.rs index a86a07edb902f..22ebedd9f7e3c 100644 --- a/compiler/rustc_type_ir/src/infer_ctxt.rs +++ b/compiler/rustc_type_ir/src/infer_ctxt.rs @@ -11,7 +11,7 @@ use crate::relate::RelateResult; use crate::relate::combine::PredicateEmittingRelation; use crate::solve::{TyOrConstInferVar, VisibleForLeakCheck}; use crate::{ - self as ty, Interner, PredicateProxy, Region, TyVid, TypeFoldable, TypeFolder, + self as ty, Const, Interner, PredicateProxy, Region, TyVid, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt, }; @@ -434,14 +434,14 @@ pub trait InferCtxtLike: Sized { fn shallow_resolve_ty_var(&self, vid: ty::TyVid) -> ::Ty; fn shallow_resolve_int_var(&self, vid: ty::IntVid) -> ::Ty; fn shallow_resolve_float_var(&self, vid: ty::FloatVid) -> ::Ty; - fn shallow_resolve_const_var(&self, vid: ty::ConstVid) -> ::Const; + fn shallow_resolve_const_var(&self, vid: ty::ConstVid) -> Const; fn shallow_resolve_region_var(&self, vid: ty::RegionVid) -> Region; fn ty_or_const_infer_var_changed(&self, var: TyOrConstInferVar) -> bool; fn next_region_infer(&self) -> Region; fn next_ty_infer(&self) -> ::Ty; - fn next_const_infer(&self) -> ::Const; + fn next_const_infer(&self) -> Const; fn fresh_args_for_item( &self, def_id: ::DefId, @@ -478,7 +478,7 @@ pub trait InferCtxtLike: Sized { fn instantiate_ty_var_raw(&self, vid: ty::TyVid, ty: ::Ty); /// Use `instantiate_const_var` instead unless you have reasons to skip /// generalization. - fn instantiate_const_var_raw(&self, vid: ty::ConstVid, ct: ::Const); + fn instantiate_const_var_raw(&self, vid: ty::ConstVid, ct: Const); fn instantiate_ty_var>( &self, relation: &mut R, @@ -494,7 +494,7 @@ pub trait InferCtxtLike: Sized { relation: &mut R, target_is_expected: bool, target_vid: ty::ConstVid, - source_ct: ::Const, + source_ct: Const, ) -> RelateResult; fn set_tainted_by_errors(&self, e: ::ErrorGuaranteed); @@ -503,10 +503,7 @@ pub trait InferCtxtLike: Sized { &self, ty: ::Ty, ) -> ::Ty; - fn shallow_resolve_const( - &self, - ty: ::Const, - ) -> ::Const; + fn shallow_resolve_const(&self, ty: Const) -> Const; fn deeply_resolve_ignoring_regions(&self, value: T) -> T where @@ -694,7 +691,7 @@ impl, I: Interner> TypeFolder } } - fn fold_const(&mut self, c: I::Const) -> I::Const { + fn fold_const(&mut self, c: Const) -> Const { match c.kind() { ty::ConstKind::Infer(ty::InferConst::Var(vid)) => { let resolved = self.delegate.shallow_resolve_const_var(vid); diff --git a/compiler/rustc_type_ir/src/pattern.rs b/compiler/rustc_type_ir/src/pattern.rs index 69b2c414695bc..dbd4ea4ad9867 100644 --- a/compiler/rustc_type_ir/src/pattern.rs +++ b/compiler/rustc_type_ir/src/pattern.rs @@ -5,7 +5,7 @@ use rustc_type_ir_macros::{ GenericTypeVisitable, Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic, }; -use crate::Interner; +use crate::{Const, Interner}; #[derive_where(Clone, Copy, Hash, PartialEq; I: Interner)] #[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)] @@ -14,7 +14,7 @@ use crate::Interner; derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext) )] pub enum PatternKind { - Range { start: I::Const, end: I::Const }, + Range { start: Const, end: Const }, Or(I::PatList), NotNull, } diff --git a/compiler/rustc_type_ir/src/predicate_kind.rs b/compiler/rustc_type_ir/src/predicate_kind.rs index d6276ea0062bd..946fff0d3a649 100644 --- a/compiler/rustc_type_ir/src/predicate_kind.rs +++ b/compiler/rustc_type_ir/src/predicate_kind.rs @@ -5,7 +5,7 @@ use derive_where::derive_where; use rustc_macros::{Decodable_NoContext, Encodable_NoContext, StableHash_NoContext}; use rustc_type_ir_macros::{GenericTypeVisitable, TypeFoldable_Generic, TypeVisitable_Generic}; -use crate::{self as ty, Interner, Region}; +use crate::{self as ty, Const, Interner, Region}; /// A clause is something that can appear in where bounds or be inferred /// by implied bounds. @@ -33,13 +33,13 @@ pub enum ClauseKind { /// Ensures that a const generic argument to a parameter `const N: u8` /// is of type `u8`. - ConstArgHasType(I::Const, I::Ty), + ConstArgHasType(Const, I::Ty), /// No syntax: `T` well-formed. WellFormed(I::Term), /// Constant initializer must evaluate successfully. - ConstEvaluatable(I::Const), + ConstEvaluatable(Const), /// Enforces the constness of the clause we're calling. Like a projection /// goal from a where clause, it's always going to be paired with a @@ -88,7 +88,7 @@ pub enum PredicateKind { Coerce(ty::CoercePredicate), /// Constants must be equal. The first component is the const that is expected. - ConstEquate(I::Const, I::Const), + ConstEquate(Const, Const), /// A marker predicate that is always ambiguous. /// Used for coherence to mark opaque types as possibly equal to each other but ambiguous. diff --git a/compiler/rustc_type_ir/src/region_constraint.rs b/compiler/rustc_type_ir/src/region_constraint.rs index 0dd79d8d0449e..58763593f9b7e 100644 --- a/compiler/rustc_type_ir/src/region_constraint.rs +++ b/compiler/rustc_type_ir/src/region_constraint.rs @@ -9,6 +9,8 @@ use rustc_macros::StableHash_NoContext; use rustc_type_ir_macros::{GenericTypeVisitable, TypeFoldable_Generic, TypeVisitable_Generic}; use tracing::{debug, instrument}; +use crate::Const; + // Workaround for TransitiveRelation being in rustc_data_structures which isn't accessible on stable #[cfg(not(feature = "nightly"))] #[derive(Default, Clone, Debug)] @@ -1227,7 +1229,7 @@ impl<'a, Infcx: InferCtxtLike, I: Interner> TypeRelation Ok(a) } - fn consts(&mut self, a: I::Const, b: I::Const) -> RelateResult { + fn consts(&mut self, a: Const, b: Const) -> RelateResult> { rustc_type_ir::relate::structurally_relate_consts(self, a, b) } diff --git a/compiler/rustc_type_ir/src/relate.rs b/compiler/rustc_type_ir/src/relate.rs index 49fcb38968abe..e87b584ebcb6b 100644 --- a/compiler/rustc_type_ir/src/relate.rs +++ b/compiler/rustc_type_ir/src/relate.rs @@ -7,7 +7,7 @@ use tracing::{instrument, trace}; use crate::error::{ExpectedFound, TypeError}; use crate::fold::TypeFoldable; use crate::inherent::*; -use crate::{self as ty, Interner, Region}; +use crate::{self as ty, Const, Interner, Region}; pub mod combine; pub mod solver_relating; @@ -90,7 +90,7 @@ pub trait TypeRelation: Sized { fn regions(&mut self, a: Region, b: Region) -> RelateResult>; - fn consts(&mut self, a: I::Const, b: I::Const) -> RelateResult; + fn consts(&mut self, a: Const, b: Const) -> RelateResult>; fn binders( &mut self, @@ -551,9 +551,9 @@ pub fn structurally_relate_tys>( /// See the HACKs below. pub fn structurally_relate_consts>( relation: &mut R, - mut a: I::Const, - mut b: I::Const, -) -> RelateResult { + mut a: Const, + mut b: Const, +) -> RelateResult> { trace!( "structurally_relate_consts::<{}>(a = {:?}, b = {:?})", std::any::type_name::(), diff --git a/compiler/rustc_type_ir/src/relate/combine.rs b/compiler/rustc_type_ir/src/relate/combine.rs index 7b747141889fe..054dff869e650 100644 --- a/compiler/rustc_type_ir/src/relate/combine.rs +++ b/compiler/rustc_type_ir/src/relate/combine.rs @@ -10,7 +10,7 @@ use crate::inherent::*; use crate::relate::VarianceDiagInfo; use crate::solve::Goal; use crate::visit::TypeVisitableExt as _; -use crate::{self as ty, InferCtxtLike, Interner, TypingMode, Upcast}; +use crate::{self as ty, Const, InferCtxtLike, Interner, TypingMode, Upcast}; pub trait PredicateEmittingRelation::Interner>: TypeRelation @@ -143,9 +143,9 @@ where pub fn super_combine_consts( infcx: &Infcx, relation: &mut R, - a: I::Const, - b: I::Const, -) -> RelateResult + a: Const, + b: Const, +) -> RelateResult> where Infcx: InferCtxtLike, I: Interner, diff --git a/compiler/rustc_type_ir/src/relate/solver_relating.rs b/compiler/rustc_type_ir/src/relate/solver_relating.rs index 96a792edd2f9d..3a7056234553b 100644 --- a/compiler/rustc_type_ir/src/relate/solver_relating.rs +++ b/compiler/rustc_type_ir/src/relate/solver_relating.rs @@ -5,7 +5,7 @@ use crate::data_structures::DelayedSet; use crate::relate::combine::combine_ty_args; pub use crate::relate::*; use crate::solve::{Goal, VisibleForLeakCheck}; -use crate::{self as ty, InferCtxtLike, Interner, Region}; +use crate::{self as ty, Const, InferCtxtLike, Interner, Region}; pub trait RelateExt: InferCtxtLike { fn relate>( @@ -254,7 +254,7 @@ where } #[instrument(skip(self), level = "trace")] - fn consts(&mut self, a: I::Const, b: I::Const) -> RelateResult { + fn consts(&mut self, a: Const, b: Const) -> RelateResult> { super_combine_consts(self.infcx, self, a, b) } diff --git a/compiler/rustc_type_ir/src/solve/mod.rs b/compiler/rustc_type_ir/src/solve/mod.rs index 88d2184ed95b2..c6d88bb6603de 100644 --- a/compiler/rustc_type_ir/src/solve/mod.rs +++ b/compiler/rustc_type_ir/src/solve/mod.rs @@ -18,8 +18,8 @@ use crate::lang_items::SolverTraitLangItem; use crate::region_constraint::RegionConstraint; use crate::search_graph::PathKind; use crate::{ - self as ty, Canonical, CanonicalVarValues, CantBeErased, ConstVid, FloatVid, GenericArgKind, - InferConst, IntVid, Interner, TermKind, TyVid, TypingMode, Upcast, + self as ty, Canonical, CanonicalVarValues, CantBeErased, Const, ConstVid, FloatVid, + GenericArgKind, InferConst, IntVid, Interner, TermKind, TyVid, TypingMode, Upcast, }; pub type CanonicalInputData = @@ -1090,7 +1090,7 @@ impl TyOrConstInferVar { /// Tries to extract an inference variable from a constant, returns `None` /// for constants other than `ty::ConstKind::Infer(_)` (or `InferConst::Fresh`). - fn maybe_from_const(ct: I::Const) -> Option { + fn maybe_from_const(ct: Const) -> Option { match ct.kind() { ty::ConstKind::Infer(InferConst::Var(v)) => Some(TyOrConstInferVar::Const(v)), _ => None, diff --git a/compiler/rustc_type_ir/src/term_kind.rs b/compiler/rustc_type_ir/src/term_kind.rs index 6a4b1f023dde2..0c151e678a614 100644 --- a/compiler/rustc_type_ir/src/term_kind.rs +++ b/compiler/rustc_type_ir/src/term_kind.rs @@ -8,7 +8,7 @@ use rustc_type_ir_macros::{ }; use crate::inherent::*; -use crate::{self as ty, AliasTerm, Interner}; +use crate::{self as ty, AliasTerm, Const, Interner}; #[derive_where(Clone, Copy, PartialEq, Debug; I: Interner)] #[derive(GenericTypeVisitable)] @@ -18,7 +18,7 @@ use crate::{self as ty, AliasTerm, Interner}; )] pub enum TermKind { Ty(I::Ty), - Const(I::Const), + Const(Const), } impl Eq for TermKind {} @@ -213,7 +213,7 @@ impl AliasTerm { .into() }; let alias_const = |kind| { - I::Const::new_alias(interner, is_rigid, ty::AliasConst::new(interner, kind, self.args)) + Const::new_alias(interner, is_rigid, ty::AliasConst::new(interner, kind, self.args)) .into() }; match self.kind { diff --git a/compiler/rustc_type_ir/src/ty_kind.rs b/compiler/rustc_type_ir/src/ty_kind.rs index 248ba00348749..68a1b479830e2 100644 --- a/compiler/rustc_type_ir/src/ty_kind.rs +++ b/compiler/rustc_type_ir/src/ty_kind.rs @@ -19,7 +19,7 @@ pub use self::closure::*; use crate::inherent::*; use crate::ty::AliasTy; use crate::{ - self as ty, BoundVarIndexKind, FloatTy, FreeAliasTy, InherentAliasTy, IntTy, Interner, + self as ty, BoundVarIndexKind, Const, FloatTy, FreeAliasTy, InherentAliasTy, IntTy, Interner, OpaqueAliasTy, ProjectionAliasTy, Region, UintTy, Unnormalized, }; @@ -187,7 +187,7 @@ pub enum TyKind { Str, /// An array with the given length. Written as `[T; N]`. - Array(I::Ty, I::Const), + Array(I::Ty, Const), /// A pattern newtype. /// diff --git a/compiler/rustc_type_ir/src/universe.rs b/compiler/rustc_type_ir/src/universe.rs index 1f38edd78023d..34210a0251fb8 100644 --- a/compiler/rustc_type_ir/src/universe.rs +++ b/compiler/rustc_type_ir/src/universe.rs @@ -4,7 +4,7 @@ use crate::data_structures::HashSet; use crate::inherent::*; use crate::visit::TypeVisitableExt; use crate::{ - ConstKind, InferCtxtLike, InferTy, Interner, Region, RegionKind, TyKind, TypeFoldable, + Const, ConstKind, InferCtxtLike, InferTy, Interner, Region, RegionKind, TyKind, TypeFoldable, TypeSuperVisitable, TypeVisitable, TypeVisitor, UniverseIndex, }; @@ -130,7 +130,7 @@ impl< assert!(self.cache.insert(t), "we shouldn't visit {t:?} twice"); } - fn visit_const(&mut self, c: I::Const) { + fn visit_const(&mut self, c: Const) { if !Self::needs_visit(&c) { return; } diff --git a/compiler/rustc_type_ir/src/visit.rs b/compiler/rustc_type_ir/src/visit.rs index 1138d8cf9edad..008b6aeb239ee 100644 --- a/compiler/rustc_type_ir/src/visit.rs +++ b/compiler/rustc_type_ir/src/visit.rs @@ -52,7 +52,7 @@ use smallvec::SmallVec; use thin_vec::ThinVec; use crate::inherent::*; -use crate::{self as ty, Interner, PredicateProxy, Region, TypeFlags}; +use crate::{self as ty, Const, Interner, PredicateProxy, Region, TypeFlags}; /// This trait is implemented for every type that can be visited, /// providing the skeleton of the traversal. @@ -112,7 +112,7 @@ pub trait TypeVisitor: Sized { } } - fn visit_const(&mut self, c: I::Const) -> Self::Result { + fn visit_const(&mut self, c: Const) -> Self::Result { c.super_visit_with(self) } @@ -475,7 +475,7 @@ impl TypeVisitor for HasTypeFlagsVisitor { } #[inline] - fn visit_const(&mut self, c: I::Const) -> Self::Result { + fn visit_const(&mut self, c: Const) -> Self::Result { // Note: no `super_visit_with` call. if c.flags().intersects(self.flags) { ControlFlow::Break(FoundFlags) @@ -583,7 +583,7 @@ impl TypeVisitor for HasEscapingVarsVisitor { } } - fn visit_const(&mut self, ct: I::Const) -> Self::Result { + fn visit_const(&mut self, ct: Const) -> Self::Result { // If the outer-exclusive-binder is *strictly greater* than // `outer_index`, that means that `ct` contains some content // bound at `outer_index` or above (because From af2f1f375c6f8aebfaf91c40883ae148c294f756 Mon Sep 17 00:00:00 2001 From: James Barford-Evans Date: Thu, 17 Sep 2026 09:36:40 +0100 Subject: [PATCH 15/19] `use ConstExt` for methods that do not yet exist in `rustc_type_ir` --- compiler/rustc_borrowck/src/type_check/mod.rs | 1 + compiler/rustc_codegen_cranelift/src/base.rs | 1 + compiler/rustc_codegen_cranelift/src/debuginfo/types.rs | 1 + compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs | 1 + compiler/rustc_codegen_cranelift/src/unsize.rs | 1 + compiler/rustc_codegen_gcc/src/intrinsic/simd.rs | 1 + compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 1 + compiler/rustc_codegen_llvm/src/intrinsic.rs | 1 + compiler/rustc_codegen_ssa/src/base.rs | 1 + compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs | 1 + compiler/rustc_codegen_ssa/src/mir/constant.rs | 1 + compiler/rustc_codegen_ssa/src/mir/intrinsic.rs | 1 + compiler/rustc_codegen_ssa/src/mir/operand.rs | 1 + compiler/rustc_codegen_ssa/src/mir/rvalue.rs | 1 + compiler/rustc_const_eval/src/const_eval/machine.rs | 1 + compiler/rustc_const_eval/src/const_eval/mod.rs | 1 + compiler/rustc_const_eval/src/const_eval/valtrees.rs | 1 + compiler/rustc_const_eval/src/interpret/cast.rs | 1 + compiler/rustc_const_eval/src/interpret/intrinsics/atomic.rs | 1 + compiler/rustc_const_eval/src/interpret/intrinsics/simd.rs | 1 + compiler/rustc_hir_analysis/src/check/check.rs | 1 + compiler/rustc_hir_analysis/src/check/intrinsic.rs | 1 + compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs | 1 + compiler/rustc_hir_typeck/src/expr.rs | 1 + compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs | 1 + compiler/rustc_hir_typeck/src/inline_asm.rs | 1 + compiler/rustc_hir_typeck/src/pat.rs | 1 + compiler/rustc_lint/src/builtin.rs | 1 + compiler/rustc_lint/src/types.rs | 1 + compiler/rustc_lint/src/unused/must_use.rs | 1 + compiler/rustc_middle/src/mir/consts.rs | 1 + compiler/rustc_middle/src/mir/pretty.rs | 1 + compiler/rustc_middle/src/mir/statement.rs | 1 + compiler/rustc_middle/src/ty/consts/valtree.rs | 1 + .../rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs | 1 + compiler/rustc_middle/src/ty/inhabitedness/mod.rs | 1 + compiler/rustc_middle/src/ty/layout.rs | 1 + compiler/rustc_middle/src/ty/pattern.rs | 1 + compiler/rustc_middle/src/ty/sty.rs | 1 + compiler/rustc_middle/src/ty/typetree.rs | 1 + compiler/rustc_middle/src/ty/util.rs | 1 + compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs | 1 + compiler/rustc_mir_build/src/builder/matches/match_pair.rs | 1 + compiler/rustc_mir_build/src/builder/matches/mod.rs | 1 + compiler/rustc_mir_build/src/builder/scope.rs | 1 + compiler/rustc_mir_build/src/thir/constant.rs | 1 + compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs | 1 + compiler/rustc_mir_build/src/thir/pattern/mod.rs | 1 + compiler/rustc_mir_dataflow/src/move_paths/builder.rs | 1 + compiler/rustc_mir_transform/src/coroutine/layout.rs | 1 + compiler/rustc_mir_transform/src/elaborate_drop.rs | 1 + compiler/rustc_mir_transform/src/gvn.rs | 1 + compiler/rustc_mir_transform/src/instsimplify.rs | 1 + compiler/rustc_mir_transform/src/known_panics_lint.rs | 1 + compiler/rustc_mir_transform/src/promote_consts.rs | 1 + compiler/rustc_mir_transform/src/remove_zsts.rs | 1 + compiler/rustc_pattern_analysis/src/rustc.rs | 1 + compiler/rustc_public_bridge/src/context/impls.rs | 1 + .../rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs | 1 + compiler/rustc_symbol_mangling/src/legacy.rs | 1 + compiler/rustc_symbol_mangling/src/v0.rs | 1 + compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs | 1 + .../src/error_reporting/traits/ambiguity.rs | 1 + .../src/error_reporting/traits/fulfillment_errors.rs | 1 + .../src/error_reporting/traits/on_unimplemented.rs | 1 + .../src/error_reporting/traits/suggestions.rs | 1 + compiler/rustc_trait_selection/src/traits/fulfill.rs | 1 + compiler/rustc_trait_selection/src/traits/mod.rs | 1 + .../rustc_trait_selection/src/traits/query/dropck_outlives.rs | 1 + compiler/rustc_transmute/src/lib.rs | 1 + compiler/rustc_ty_utils/src/consts.rs | 1 + 71 files changed, 71 insertions(+) diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 4c5acd58638fb..e5bbab89bf1ac 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -24,6 +24,7 @@ use rustc_middle::mir::*; use rustc_middle::traits::query::NoSolution; use rustc_middle::ty::adjustment::PointerCoercion; use rustc_middle::ty::cast::CastTy; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{ self, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, GenericArgsRef, Ty, TyCtxt, TypeVisitableExt, UserArgs, UserTypeAnnotationIndex, fold_regions, diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs index 506037c151148..638463b5cb438 100644 --- a/compiler/rustc_codegen_cranelift/src/base.rs +++ b/compiler/rustc_codegen_cranelift/src/base.rs @@ -12,6 +12,7 @@ use rustc_hir::attrs::lang_items::LangItem; use rustc_index::IndexVec; use rustc_middle::ty::TypeVisitableExt; use rustc_middle::ty::adjustment::PointerCoercion; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{FnAbiOf, HasTypingEnv as _}; use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_session::config::OutputFilenames; diff --git a/compiler/rustc_codegen_cranelift/src/debuginfo/types.rs b/compiler/rustc_codegen_cranelift/src/debuginfo/types.rs index 18a0632a0939d..2eb4725fc5b20 100644 --- a/compiler/rustc_codegen_cranelift/src/debuginfo/types.rs +++ b/compiler/rustc_codegen_cranelift/src/debuginfo/types.rs @@ -3,6 +3,7 @@ use gimli::write::{AttributeValue, UnitEntryId}; use rustc_codegen_ssa::debuginfo::type_names; use rustc_data_structures::fx::FxHashMap; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::{self, Ty, TyCtxt}; diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs index 270ea4e88a999..f04c32a70390a 100644 --- a/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs +++ b/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs @@ -3,6 +3,7 @@ use cranelift_codegen::ir::immediates::Offset32; use rustc_abi::Endian; use rustc_middle::ty::SimdAlign; +use rustc_middle::ty::consts::ConstExt; use super::*; use crate::prelude::*; diff --git a/compiler/rustc_codegen_cranelift/src/unsize.rs b/compiler/rustc_codegen_cranelift/src/unsize.rs index 48fb0f6c7d4a8..efc89075cdeb2 100644 --- a/compiler/rustc_codegen_cranelift/src/unsize.rs +++ b/compiler/rustc_codegen_cranelift/src/unsize.rs @@ -3,6 +3,7 @@ //! [`PointerCoercion::Unsize`]: `rustc_middle::ty::adjustment::PointerCoercion::Unsize` use rustc_codegen_ssa::base::validate_trivial_unsize; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::HasTypingEnv; use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths}; diff --git a/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs b/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs index bb32a85f193ea..54013b6be6173 100644 --- a/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs +++ b/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs @@ -15,6 +15,7 @@ use rustc_codegen_ssa::traits::{BaseTypeCodegenMethods, BuilderMethods, LayoutTy #[cfg(feature = "master")] use rustc_hir as hir; use rustc_middle::mir::BinOp; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf}; use rustc_middle::ty::{self, Ty}; use rustc_span::{ErrorGuaranteed, Span, Symbol, span_bug, sym}; diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index 735dd0fbaba10..a3bcce34566cb 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -10,6 +10,7 @@ use rustc_codegen_ssa::debuginfo::type_names::{VTableNameKind, cpp_like_debuginf use rustc_codegen_ssa::traits::*; use rustc_hir::def::{CtorKind, DefKind}; use rustc_hir::def_id::{DefId, LOCAL_CRATE}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{ HasTypingEnv, LayoutOf, TyAndLayout, WIDE_PTR_ADDR, WIDE_PTR_EXTRA, }; diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs index 2e01ebca05c26..454347a5e041e 100644 --- a/compiler/rustc_codegen_llvm/src/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs @@ -19,6 +19,7 @@ use rustc_hir::def_id::LOCAL_CRATE; use rustc_hir::find_attr; use rustc_lint_defs::builtin::DEPRECATED_LLVM_INTRINSIC; use rustc_middle::mir::BinOp; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, HasTypingEnv, LayoutOf}; use rustc_middle::ty::offload_meta::OffloadMetadata; use rustc_middle::ty::{self, GenericArgsRef, Instance, SimdAlign, Ty, TyCtxt, TypingEnv}; diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs index de921a9cb0d1e..e054394ccade0 100644 --- a/compiler/rustc_codegen_ssa/src/base.rs +++ b/compiler/rustc_codegen_ssa/src/base.rs @@ -26,6 +26,7 @@ use rustc_middle::mir::interpret::{CTFE_ALLOC_SALT, ErrorHandled, Scalar}; use rustc_middle::mir::{BinOp, ConstValue}; use rustc_middle::mono::{CodegenUnit, CodegenUnitNameBuilder, MonoItem, MonoItemPartitions}; use rustc_middle::query::Providers; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv, LayoutOf, TyAndLayout}; use rustc_middle::ty::{self, Instance, PatternKind, Ty, TyCtxt, UintTy, Unnormalized}; use rustc_session::config::{self, EntryFnType}; diff --git a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs index 810253956b186..9cf68c6e3909c 100644 --- a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs +++ b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs @@ -20,6 +20,7 @@ use rustc_hashes::Hash64; use rustc_hir::def_id::DefId; use rustc_hir::definitions::{DefPathData, DefPathDataName, DisambiguatedDefPathData}; use rustc_hir::{CoroutineDesugaring, CoroutineKind, CoroutineSource, Mutability}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{IntegerExt, TyAndLayout}; use rustc_middle::ty::{ self, ExistentialProjection, GenericArgKind, GenericArgsRef, Ty, TyCtxt, Unnormalized, diff --git a/compiler/rustc_codegen_ssa/src/mir/constant.rs b/compiler/rustc_codegen_ssa/src/mir/constant.rs index 625e1dd8491db..b6f16f72b021e 100644 --- a/compiler/rustc_codegen_ssa/src/mir/constant.rs +++ b/compiler/rustc_codegen_ssa/src/mir/constant.rs @@ -1,6 +1,7 @@ use rustc_abi::BackendRepr; use rustc_middle::mir; use rustc_middle::mir::interpret::ErrorHandled; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv}; use rustc_middle::ty::{self, Ty}; use rustc_span::{bug, span_bug}; diff --git a/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs b/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs index 22ab228e15b5f..e6b70ce2ca77b 100644 --- a/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs +++ b/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs @@ -1,5 +1,6 @@ use rustc_abi::{Align, FieldIdx, WrappingRange}; use rustc_middle::mir::SourceInfo; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_session::config::OptLevel; use rustc_span::{ErrorGuaranteed, bug, span_bug, sym}; diff --git a/compiler/rustc_codegen_ssa/src/mir/operand.rs b/compiler/rustc_codegen_ssa/src/mir/operand.rs index 5b07eb84f40d7..d11ba53e58c89 100644 --- a/compiler/rustc_codegen_ssa/src/mir/operand.rs +++ b/compiler/rustc_codegen_ssa/src/mir/operand.rs @@ -8,6 +8,7 @@ use rustc_abi::{ use rustc_hir::attrs::lang_items::LangItem; use rustc_middle::mir::interpret::{Pointer, Scalar, alloc_range}; use rustc_middle::mir::{self, ConstValue}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; use rustc_middle::ty::{self, Ty}; use rustc_session::config::{AnnotateMoves, DebugInfo, OptLevel}; diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index 130958f3705c9..3b33cf5a17602 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -5,6 +5,7 @@ use rustc_abi::{self as abi, BackendRepr, FIRST_VARIANT}; use rustc_index::IndexVec; use rustc_middle::mir; use rustc_middle::ty::adjustment::PointerCoercion; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv, LayoutOf, TyAndLayout}; use rustc_middle::ty::{self, Instance, Mutability, Ty, TyCtxt}; use rustc_session::config::OptLevel; diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index d176ee1628cb5..c0617c19263e7 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -13,6 +13,7 @@ use rustc_middle::mir; use rustc_middle::mir::AssertMessage; use rustc_middle::mir::interpret::ReportedErrorInfo; use rustc_middle::query::TyCtxtAt; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv, TyAndLayout, ValidityRequirement}; use rustc_middle::ty::{self, FieldInfo, ScalarInt, Ty, TyCtxt}; use rustc_span::{Span, Symbol, bug, span_bug, sym}; diff --git a/compiler/rustc_const_eval/src/const_eval/mod.rs b/compiler/rustc_const_eval/src/const_eval/mod.rs index 58b8418707eff..1a08c166770cf 100644 --- a/compiler/rustc_const_eval/src/const_eval/mod.rs +++ b/compiler/rustc_const_eval/src/const_eval/mod.rs @@ -2,6 +2,7 @@ use rustc_abi::{FieldIdx, VariantIdx}; use rustc_middle::mir; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_span::{DUMMY_SP, bug}; use tracing::instrument; diff --git a/compiler/rustc_const_eval/src/const_eval/valtrees.rs b/compiler/rustc_const_eval/src/const_eval/valtrees.rs index de8dd989c6a00..6cb327f1efca6 100644 --- a/compiler/rustc_const_eval/src/const_eval/valtrees.rs +++ b/compiler/rustc_const_eval/src/const_eval/valtrees.rs @@ -3,6 +3,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_middle::mir; use rustc_middle::mir::interpret::{EvalToValTreeResult, GlobalId, ValTreeCreationError}; use rustc_middle::traits::ObligationCause; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{LayoutCx, TyAndLayout}; use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_span::{DUMMY_SP, bug}; diff --git a/compiler/rustc_const_eval/src/interpret/cast.rs b/compiler/rustc_const_eval/src/interpret/cast.rs index 79a3887d5123d..1f16aab095843 100644 --- a/compiler/rustc_const_eval/src/interpret/cast.rs +++ b/compiler/rustc_const_eval/src/interpret/cast.rs @@ -6,6 +6,7 @@ use rustc_apfloat::{Float, FloatConvert}; use rustc_middle::mir::CastKind; use rustc_middle::mir::interpret::{InterpResult, PointerArithmetic, Scalar}; use rustc_middle::ty::adjustment::PointerCoercion; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{IntegerExt, TyAndLayout}; use rustc_middle::ty::{self, FloatTy, Ty}; use rustc_span::{bug, span_bug}; diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics/atomic.rs b/compiler/rustc_const_eval/src/interpret/intrinsics/atomic.rs index 48218703c8ec1..3c45550016851 100644 --- a/compiler/rustc_const_eval/src/interpret/intrinsics/atomic.rs +++ b/compiler/rustc_const_eval/src/interpret/intrinsics/atomic.rs @@ -1,4 +1,5 @@ use rustc_middle::mir::BinOp; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::{mir, ty}; use rustc_span::{Symbol, span_bug, sym}; use tracing::trace; diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics/simd.rs b/compiler/rustc_const_eval/src/interpret/intrinsics/simd.rs index 476ba405f19ca..ad191e9b4d763 100644 --- a/compiler/rustc_const_eval/src/interpret/intrinsics/simd.rs +++ b/compiler/rustc_const_eval/src/interpret/intrinsics/simd.rs @@ -3,6 +3,7 @@ use rustc_abi::{BackendRepr, Endian}; use rustc_apfloat::ieee::{Double, Half, Quad, Single}; use rustc_apfloat::{Float, Round}; use rustc_middle::mir::interpret::{InterpErrorKind, Pointer, UndefinedBehaviorInfo}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{FloatTy, ScalarInt, SimdAlign}; use rustc_middle::{err_ub_format, mir, throw_unsup_format, ty}; use rustc_span::{Symbol, bug, span_bug, sym}; diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs index 788b063bd0ecf..924041c399ef1 100644 --- a/compiler/rustc_hir_analysis/src/check/check.rs +++ b/compiler/rustc_hir_analysis/src/check/check.rs @@ -19,6 +19,7 @@ use rustc_macros::Diagnostic; use rustc_middle::hir::nested_filter; use rustc_middle::middle::resolve_bound_vars::ResolvedArg; use rustc_middle::middle::stability::EvalResult; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::error::TypeErrorToStringExt; use rustc_middle::ty::layout::LayoutError; use rustc_middle::ty::util::Discr; diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs index cca93e8aef0ec..b566f6b04bf41 100644 --- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs +++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs @@ -4,6 +4,7 @@ use rustc_errors::DiagMessage; use rustc_hir as hir; use rustc_hir::attrs::lang_items::LangItem; use rustc_middle::traits::{ObligationCause, ObligationCauseCode}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Const, Ty, TyCtxt}; use rustc_span::def_id::LocalDefId; use rustc_span::{Span, Symbol, sym}; diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs index 6bb1c4d04e065..e7ecde09ce27b 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs @@ -42,6 +42,7 @@ use rustc_infer::traits::DynCompatibilityViolation; use rustc_lint_defs::builtin::AMBIGUOUS_ASSOCIATED_ITEMS; use rustc_macros::{TypeFoldable, TypeVisitable}; use rustc_middle::middle::stability::AllowUnstable; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{ self, Const, FnSigKind, GenericArgKind, GenericArgsRef, GenericParamDefKind, LitToConstInput, Ty, TyCtxt, TypeSuperFoldable, TypeVisitableExt, TypingMode, Unnormalized, Upcast, diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index d191fdbdc1ec0..04e55dd0fdd95 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -26,6 +26,7 @@ use rustc_hir_analysis::hir_ty_lowering::HirTyLowerer as _; use rustc_infer::infer::{self, DefineOpaqueTypes, InferOk, RegionVariableOrigin}; use rustc_infer::traits::query::NoSolution; use rustc_middle::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::error::{ExpectedFound, TypeError}; use rustc_middle::ty::{self, AdtKind, GenericArgsRef, Ty, TypeVisitableExt, Unnormalized}; use rustc_session::diagnostics::feature_err; diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs index 8895faef0890f..7f8edae4f17c3 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs @@ -18,6 +18,7 @@ use rustc_hir::{ use rustc_hir_analysis::hir_ty_lowering::HirTyLowerer; use rustc_hir_analysis::suggest_impl_trait; use rustc_middle::middle::stability::EvalResult; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::print::{with_no_trimmed_paths, with_types_for_suggestion}; use rustc_middle::ty::{ self, Article, Binder, IsSuggestable, Ty, TyCtxt, TypeVisitableExt, Unnormalized, Upcast, diff --git a/compiler/rustc_hir_typeck/src/inline_asm.rs b/compiler/rustc_hir_typeck/src/inline_asm.rs index 6470e45b3bb3a..52f3957d6f512 100644 --- a/compiler/rustc_hir_typeck/src/inline_asm.rs +++ b/compiler/rustc_hir_typeck/src/inline_asm.rs @@ -6,6 +6,7 @@ use rustc_hir as hir; use rustc_hir::attrs::lang_items::LangItem; use rustc_hir::def_id::DefId; use rustc_lint_defs::builtin::ASM_SUB_REGISTER; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{ self, Article, FloatTy, IntTy, Ty, TyCtxt, TypeVisitableExt, UintTy, Unnormalized, }; diff --git a/compiler/rustc_hir_typeck/src/pat.rs b/compiler/rustc_hir_typeck/src/pat.rs index 6852ea635e924..298ea7da5d0e3 100644 --- a/compiler/rustc_hir_typeck/src/pat.rs +++ b/compiler/rustc_hir_typeck/src/pat.rs @@ -21,6 +21,7 @@ use rustc_hir_analysis::autoderef::report_autoderef_recursion_limit_error; use rustc_infer::infer::RegionVariableOrigin; use rustc_lint_defs::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS; use rustc_middle::traits::PatternOriginExpr; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Pinnedness, Ty, TypeVisitableExt, Unnormalized}; use rustc_session::diagnostics::feature_err; use rustc_span::edit_distance::find_best_match_for_name; diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index bb5f535f51466..b714940e4c331 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -33,6 +33,7 @@ use rustc_hir::{self as hir, Body, FnDecl, ImplItemImplKind, PatKind, PredicateO // Lints from rustc_lint_defs pub use rustc_lint_defs::builtin::*; use rustc_lint_defs::{declare_lint, declare_lint_pass, fcw, impl_lint_pass}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_middle::ty::{ diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs index 4d741e06198b5..d62fca02cf4cf 100644 --- a/compiler/rustc_lint/src/types.rs +++ b/compiler/rustc_lint/src/types.rs @@ -6,6 +6,7 @@ use rustc_hir as hir; use rustc_hir::attrs::lang_items::LangItem; use rustc_hir::{Expr, ExprKind, HirId, find_attr}; use rustc_lint_defs::{declare_lint, declare_lint_pass, impl_lint_pass}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{LayoutOf, SizeSkeleton}; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt, Unnormalized}; use rustc_span::{DUMMY_SP, Span, Symbol, bug, sym}; diff --git a/compiler/rustc_lint/src/unused/must_use.rs b/compiler/rustc_lint/src/unused/must_use.rs index 981d9df9c0f29..a637e8cf3b0f4 100644 --- a/compiler/rustc_lint/src/unused/must_use.rs +++ b/compiler/rustc_lint/src/unused/must_use.rs @@ -7,6 +7,7 @@ use rustc_hir::def_id::DefId; use rustc_hir::{self as hir, find_attr}; use rustc_infer::traits::util::elaborate; use rustc_lint_defs::{declare_lint, declare_lint_pass}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Ty, Unnormalized}; use rustc_span::{Span, Symbol, sym}; use tracing::instrument; diff --git a/compiler/rustc_middle/src/mir/consts.rs b/compiler/rustc_middle/src/mir/consts.rs index 83f62ee65025c..0acfe437493c0 100644 --- a/compiler/rustc_middle/src/mir/consts.rs +++ b/compiler/rustc_middle/src/mir/consts.rs @@ -10,6 +10,7 @@ use rustc_type_ir::TypeVisitableExt; use super::interpret::ReportedErrorInfo; use crate::mir::interpret::{AllocId, AllocRange, ErrorHandled, GlobalAlloc, Scalar, alloc_range}; use crate::mir::{Promoted, pretty_print_const_value}; +use crate::ty::consts::ConstExt; use crate::ty::print::{pretty_print_const, with_no_trimmed_paths}; use crate::ty::{self, ConstKind, GenericArgsRef, ScalarInt, Ty, TyCtxt}; diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs index 870819d7a2b93..159a0f9883db3 100644 --- a/compiler/rustc_middle/src/mir/pretty.rs +++ b/compiler/rustc_middle/src/mir/pretty.rs @@ -18,6 +18,7 @@ use crate::mir::interpret::{ use crate::mir::visit::Visitor; use crate::mir::*; use crate::ty::CoroutineArgsExt; +use crate::ty::consts::ConstExt; const INDENT: &str = " "; /// Alignment for lining up comments following MIR statements diff --git a/compiler/rustc_middle/src/mir/statement.rs b/compiler/rustc_middle/src/mir/statement.rs index 22366f70fbe4e..b6542fb328aac 100644 --- a/compiler/rustc_middle/src/mir/statement.rs +++ b/compiler/rustc_middle/src/mir/statement.rs @@ -10,6 +10,7 @@ use tracing::instrument; use super::interpret::GlobalAlloc; use super::*; +use crate::ty::consts::ConstExt; use crate::ty::{CoroutineArgsExt, Unnormalized}; /////////////////////////////////////////////////////////////////////////// diff --git a/compiler/rustc_middle/src/ty/consts/valtree.rs b/compiler/rustc_middle/src/ty/consts/valtree.rs index 9c4700b41d1ff..28e32a4a82d0d 100644 --- a/compiler/rustc_middle/src/ty/consts/valtree.rs +++ b/compiler/rustc_middle/src/ty/consts/valtree.rs @@ -11,6 +11,7 @@ use rustc_span::bug; use super::ScalarInt; use crate::mir::interpret::{ErrorHandled, Scalar}; +use crate::ty::consts::ConstExt; use crate::ty::print::{FmtPrinter, PrettyPrinter}; use crate::ty::{self, Ty, TyCtxt, ValTreeKind}; diff --git a/compiler/rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs b/compiler/rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs index 6b0234c971830..61e3a40e363d9 100644 --- a/compiler/rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs +++ b/compiler/rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs @@ -4,6 +4,7 @@ use rustc_span::def_id::{LocalModId, ModId}; use smallvec::SmallVec; use tracing::instrument; +use crate::ty::consts::ConstExt; use crate::ty::{self, OpaqueTypeKey, Ty, TyCtxt, TypingEnv, Unnormalized}; /// Represents whether some type is inhabited in a given context. diff --git a/compiler/rustc_middle/src/ty/inhabitedness/mod.rs b/compiler/rustc_middle/src/ty/inhabitedness/mod.rs index 60ea2bf49a046..078a171491520 100644 --- a/compiler/rustc_middle/src/ty/inhabitedness/mod.rs +++ b/compiler/rustc_middle/src/ty/inhabitedness/mod.rs @@ -53,6 +53,7 @@ use rustc_type_ir::TyKind::*; use tracing::instrument; use crate::query::Providers; +use crate::ty::consts::ConstExt; use crate::ty::{ self, AdtDef, DefId, Ty, TyCtxt, TypeVisitableExt, TypingEnv, VariantDef, Visibility, }; diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index f717f8270daf3..1e4e96ceed576 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -21,6 +21,7 @@ use tracing::debug; use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags; use crate::query::TyCtxtAt; use crate::traits::ObligationCause; +use crate::ty::consts::ConstExt; use crate::ty::normalize_erasing_regions::NormalizationError; use crate::ty::{self, CoroutineArgsExt, Ty, TyCtxt, TypeVisitableExt, Unnormalized}; diff --git a/compiler/rustc_middle/src/ty/pattern.rs b/compiler/rustc_middle/src/ty/pattern.rs index 2d73124265fc2..71d3bf0853f04 100644 --- a/compiler/rustc_middle/src/ty/pattern.rs +++ b/compiler/rustc_middle/src/ty/pattern.rs @@ -7,6 +7,7 @@ use rustc_type_ir::{self as ir, FlagComputation, Flags}; use super::TyCtxt; use crate::ty; +use crate::ty::consts::ConstExt; pub type PatternKind<'tcx> = ir::PatternKind>; diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index f4b1f0ce0881d..fe569bf282d36 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -27,6 +27,7 @@ use super::{AdtFlags, GenericParamDefKind}; use crate::infer::canonical::Canonical; use crate::traits::ObligationCause; use crate::ty::InferTy::*; +use crate::ty::consts::ConstExt; use crate::ty::{ self, AdtDef, Const, Discr, GenericArg, GenericArgs, GenericArgsRef, List, ParamEnv, Region, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor, UintTy, ValTree, diff --git a/compiler/rustc_middle/src/ty/typetree.rs b/compiler/rustc_middle/src/ty/typetree.rs index c2479e0c62bca..54cbc591c5fb3 100644 --- a/compiler/rustc_middle/src/ty/typetree.rs +++ b/compiler/rustc_middle/src/ty/typetree.rs @@ -2,6 +2,7 @@ use rustc_ast::expand::typetree::{FncTree, Kind, Type, TypeTree}; use rustc_span::bug; use tracing::trace; +use crate::ty::consts::ConstExt; use crate::ty::context::TyCtxt; use crate::ty::{self, Ty}; diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs index db983038e1af9..a66d15299f16c 100644 --- a/compiler/rustc_middle/src/ty/util.rs +++ b/compiler/rustc_middle/src/ty/util.rs @@ -25,6 +25,7 @@ use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags; use crate::mir; use crate::query::Providers; use crate::traits::ObligationCause; +use crate::ty::consts::ConstExt; use crate::ty::layout::{FloatExt, IntegerExt}; use crate::ty::{ self, Asyncness, FallibleTypeFolder, GenericArgKind, GenericArgsRef, Ty, TyCtxt, TypeFoldable, diff --git a/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs index 695684452fc56..09c76d6beb4a1 100644 --- a/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs +++ b/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs @@ -8,6 +8,7 @@ use rustc_middle::mir::*; use rustc_middle::thir::*; use rustc_middle::ty::adjustment::PointerCoercion; use rustc_middle::ty::cast::{CastTy, mir_cast_kind}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::util::IntTypeExt; use rustc_middle::ty::{self, Ty, UpvarArgs}; use rustc_span::{DUMMY_SP, Span, Spanned, bug}; diff --git a/compiler/rustc_mir_build/src/builder/matches/match_pair.rs b/compiler/rustc_mir_build/src/builder/matches/match_pair.rs index 392712619a3f2..57ffee758b325 100644 --- a/compiler/rustc_mir_build/src/builder/matches/match_pair.rs +++ b/compiler/rustc_mir_build/src/builder/matches/match_pair.rs @@ -3,6 +3,7 @@ use std::sync::Arc; use rustc_abi::FieldIdx; use rustc_middle::mir::{Pinnedness, Place, PlaceElem, ProjectionElem}; use rustc_middle::thir::{Ascription, DerefPatBorrowMode, FieldPat, Pat, PatKind}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Ty, TypeVisitableExt}; use rustc_span::{Span, span_bug}; diff --git a/compiler/rustc_mir_build/src/builder/matches/mod.rs b/compiler/rustc_mir_build/src/builder/matches/mod.rs index 6034d657a005e..f9c399797a400 100644 --- a/compiler/rustc_mir_build/src/builder/matches/mod.rs +++ b/compiler/rustc_mir_build/src/builder/matches/mod.rs @@ -17,6 +17,7 @@ use rustc_hir::{BindingMode, ByRef, LetStmt, LocalSource, Node}; use rustc_middle::middle::region::{self, TempLifetime}; use rustc_middle::mir::*; use rustc_middle::thir::{self, *}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, CanonicalUserTypeAnnotation, Ty, ValTree, ValTreeKind}; use rustc_pattern_analysis::constructor::RangeEnd; use rustc_pattern_analysis::rustc::{DeconstructedPat, RustcPatCtxt}; diff --git a/compiler/rustc_mir_build/src/builder/scope.rs b/compiler/rustc_mir_build/src/builder/scope.rs index 872ffec45f30a..4b3c224a84357 100644 --- a/compiler/rustc_mir_build/src/builder/scope.rs +++ b/compiler/rustc_mir_build/src/builder/scope.rs @@ -91,6 +91,7 @@ use rustc_lint_defs::Level; use rustc_middle::middle::region; use rustc_middle::mir::{self, *}; use rustc_middle::thir::{AdtExpr, AdtExprBase, ArmId, ExprId, ExprKind}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt, ValTree}; use rustc_pattern_analysis::rustc::RustcPatCtxt; use rustc_span::{DUMMY_SP, Span, Spanned, bug, span_bug}; diff --git a/compiler/rustc_mir_build/src/thir/constant.rs b/compiler/rustc_mir_build/src/thir/constant.rs index 667eff50a0d32..fa2b149f71926 100644 --- a/compiler/rustc_mir_build/src/thir/constant.rs +++ b/compiler/rustc_mir_build/src/thir/constant.rs @@ -1,6 +1,7 @@ use rustc_abi::Size; use rustc_ast::{self as ast, UintTy}; use rustc_hir::attrs::lang_items::LangItem; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, LitToConstInput, ScalarInt, Ty, TyCtxt, TypeVisitableExt as _}; use rustc_span::bug; use tracing::trace; diff --git a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs index df39350bd5c8c..3aec71f400de3 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs @@ -12,6 +12,7 @@ use rustc_infer::infer::TyCtxtInferExt; use rustc_infer::traits::Obligation; use rustc_middle::mir::interpret::ErrorHandled; use rustc_middle::thir::{FieldPat, Pat, PatKind}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{ self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitableExt, TypeVisitor, Unnormalized, }; diff --git a/compiler/rustc_mir_build/src/thir/pattern/mod.rs b/compiler/rustc_mir_build/src/thir/pattern/mod.rs index 5b7a4d626aae3..f5e44d768faa1 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/mod.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/mod.rs @@ -19,6 +19,7 @@ use rustc_middle::thir::{ Ascription, FieldPat, LocalVarId, Pat, PatKind, PatRange, PatRangeBoundary, }; use rustc_middle::ty::adjustment::{PatAdjust, PatAdjustment}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::IntegerExt; use rustc_middle::ty::{ self, CanonicalUserTypeAnnotation, LitToConstInput, Ty, TyCtxt, const_lit_matches_ty, diff --git a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs index f22ce4079e58c..3c1c631285f96 100644 --- a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs +++ b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs @@ -2,6 +2,7 @@ use std::mem; use rustc_index::IndexVec; use rustc_middle::mir::*; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; use rustc_span::{bug, span_bug}; use smallvec::{SmallVec, smallvec}; diff --git a/compiler/rustc_mir_transform/src/coroutine/layout.rs b/compiler/rustc_mir_transform/src/coroutine/layout.rs index a06ae343123d1..0ae39b1507b6a 100644 --- a/compiler/rustc_mir_transform/src/coroutine/layout.rs +++ b/compiler/rustc_mir_transform/src/coroutine/layout.rs @@ -33,6 +33,7 @@ use rustc_index::{Idx, IndexVec}; use rustc_infer::traits::TraitErrors; use rustc_lint_defs::builtin::MUST_NOT_SUSPEND; use rustc_middle::mir::*; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, CoroutineArgs, CoroutineArgsExt, Ty, TyCtxt, TypingMode}; use rustc_mir_dataflow::impls::{ MaybeBorrowedLocals, MaybeLiveLocals, MaybeRequiresStorage, MaybeStorageLive, diff --git a/compiler/rustc_mir_transform/src/elaborate_drop.rs b/compiler/rustc_mir_transform/src/elaborate_drop.rs index d9d9914d02bd4..0786d0cf42ba4 100644 --- a/compiler/rustc_mir_transform/src/elaborate_drop.rs +++ b/compiler/rustc_mir_transform/src/elaborate_drop.rs @@ -8,6 +8,7 @@ use rustc_hir::{CoroutineDesugaring, CoroutineKind}; use rustc_index::Idx; use rustc_middle::mir::*; use rustc_middle::ty::adjustment::PointerCoercion; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::util::{Discr, IntTypeExt}; use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt}; use rustc_mir_dataflow::DropFlagState; diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs index 78881d37a093b..81a41be1c62da 100644 --- a/compiler/rustc_mir_transform/src/gvn.rs +++ b/compiler/rustc_mir_transform/src/gvn.rs @@ -114,6 +114,7 @@ use rustc_index::{IndexVec, newtype_index}; use rustc_middle::mir::interpret::{AllocRange, GlobalAlloc}; use rustc_middle::mir::visit::*; use rustc_middle::mir::*; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::HasTypingEnv; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt, Unnormalized}; use rustc_mir_dataflow::{Analysis, ResultsCursor}; diff --git a/compiler/rustc_mir_transform/src/instsimplify.rs b/compiler/rustc_mir_transform/src/instsimplify.rs index b3b3dd1241a71..9a39bd8d75d24 100644 --- a/compiler/rustc_mir_transform/src/instsimplify.rs +++ b/compiler/rustc_mir_transform/src/instsimplify.rs @@ -6,6 +6,7 @@ use rustc_hir::find_attr; use rustc_index::IndexVec; use rustc_middle::mir::visit::MutVisitor; use rustc_middle::mir::*; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{IntegerExt, ValidityRequirement}; use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt, layout}; use rustc_span::{Symbol, bug, sym}; diff --git a/compiler/rustc_mir_transform/src/known_panics_lint.rs b/compiler/rustc_mir_transform/src/known_panics_lint.rs index fc210ecebfa48..1c598af1af98e 100644 --- a/compiler/rustc_mir_transform/src/known_panics_lint.rs +++ b/compiler/rustc_mir_transform/src/known_panics_lint.rs @@ -15,6 +15,7 @@ use rustc_index::bit_set::DenseBitSet; use rustc_lint_defs::builtin::UNCONDITIONAL_PANIC; use rustc_middle::mir::visit::{MutatingUseContext, NonMutatingUseContext, PlaceContext, Visitor}; use rustc_middle::mir::*; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{LayoutError, LayoutOf, LayoutOfHelpers, TyAndLayout}; use rustc_middle::ty::{ self, ConstInt, GenericArgKind, GenericParamDefKind, ScalarInt, Ty, TyCtxt, TypeVisitableExt, diff --git a/compiler/rustc_mir_transform/src/promote_consts.rs b/compiler/rustc_mir_transform/src/promote_consts.rs index b749d6d36cf84..43d058c7eef0c 100644 --- a/compiler/rustc_mir_transform/src/promote_consts.rs +++ b/compiler/rustc_mir_transform/src/promote_consts.rs @@ -23,6 +23,7 @@ use rustc_index::{IndexSlice, IndexVec}; use rustc_middle::mir; use rustc_middle::mir::visit::{MutVisitor, MutatingUseContext, PlaceContext, Visitor}; use rustc_middle::mir::*; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, GenericArgs, List, Ty, TyCtxt, TypeVisitableExt}; use rustc_span::{Span, Spanned, bug, span_bug}; use tracing::{debug, instrument}; diff --git a/compiler/rustc_mir_transform/src/remove_zsts.rs b/compiler/rustc_mir_transform/src/remove_zsts.rs index 09379fc252072..98f4009c15665 100644 --- a/compiler/rustc_mir_transform/src/remove_zsts.rs +++ b/compiler/rustc_mir_transform/src/remove_zsts.rs @@ -2,6 +2,7 @@ use rustc_middle::mir::visit::*; use rustc_middle::mir::*; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Ty, TyCtxt}; use crate::PassPolicy; diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index 5e6b682626210..581f1061bb80c 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -9,6 +9,7 @@ use rustc_index::{Idx, IndexVec}; use rustc_lint_defs::builtin::{NON_CONTIGUOUS_RANGE_ENDPOINTS, OVERLAPPING_RANGE_ENDPOINTS}; use rustc_middle::middle::stability::EvalResult; use rustc_middle::thir::{self, Pat, PatKind, PatRange, PatRangeBoundary}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::IntegerExt; use rustc_middle::ty::{ self, FieldDef, OpaqueTypeKey, ScalarInt, Ty, TyCtxt, TypeVisitableExt, VariantDef, diff --git a/compiler/rustc_public_bridge/src/context/impls.rs b/compiler/rustc_public_bridge/src/context/impls.rs index 70e2498ac350b..c653aac541c2a 100644 --- a/compiler/rustc_public_bridge/src/context/impls.rs +++ b/compiler/rustc_public_bridge/src/context/impls.rs @@ -11,6 +11,7 @@ use rustc_hir::attrs::lang_items::LangItem; use rustc_hir::def::DefKind; use rustc_middle::mir::interpret::{AllocId, ConstAllocation, ErrorHandled, GlobalAlloc, Scalar}; use rustc_middle::mir::{BinOp, Body, Const as MirConst, ConstValue, UnOp}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::{FnAbiOf, LayoutOf}; use rustc_middle::ty::print::{ with_forced_trimmed_paths, with_no_trimmed_paths, with_resolve_crate_name, diff --git a/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs b/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs index c487914bc362f..0b3beb329e0f8 100644 --- a/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs +++ b/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs @@ -12,6 +12,7 @@ use rustc_data_structures::base_n::{ALPHANUMERIC_ONLY, CASE_INSENSITIVE, ToBaseN use rustc_data_structures::fx::FxHashMap; use rustc_hir as hir; use rustc_hir::find_attr; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::IntegerExt; use rustc_middle::ty::{ self, Const, ExistentialPredicate, FloatTy, FnSig, GenericArg, GenericArgKind, GenericArgsRef, diff --git a/compiler/rustc_symbol_mangling/src/legacy.rs b/compiler/rustc_symbol_mangling/src/legacy.rs index e2be87e6b271f..bebfd746e1f6b 100644 --- a/compiler/rustc_symbol_mangling/src/legacy.rs +++ b/compiler/rustc_symbol_mangling/src/legacy.rs @@ -5,6 +5,7 @@ use rustc_data_structures::stable_hash::{StableHash, StableHasher}; use rustc_hashes::Hash64; use rustc_hir::def_id::{CrateNum, DefId}; use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::print::{PrettyPrinter, Print, PrintError, Printer}; use rustc_middle::ty::{ self, GenericArg, GenericArgKind, Instance, ReifyReason, Ty, TyCtxt, TypeVisitableExt, diff --git a/compiler/rustc_symbol_mangling/src/v0.rs b/compiler/rustc_symbol_mangling/src/v0.rs index e0d9d6976bd14..fb9f242f60085 100644 --- a/compiler/rustc_symbol_mangling/src/v0.rs +++ b/compiler/rustc_symbol_mangling/src/v0.rs @@ -14,6 +14,7 @@ use rustc_hir as hir; use rustc_hir::def::CtorKind; use rustc_hir::def_id::{CrateNum, DefId}; use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::layout::IntegerExt; use rustc_middle::ty::print::{Print, PrintError, Printer}; use rustc_middle::ty::{ diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs index 76edf906bca94..f554620c57208 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs @@ -60,6 +60,7 @@ use rustc_hir::{self as hir, find_attr}; use rustc_infer::infer::DefineOpaqueTypes; use rustc_macros::extension; use rustc_middle::traits::PatternOriginExpr; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::error::{ExpectedFound, TypeError, TypeErrorToStringExt}; use rustc_middle::ty::print::{PrintTraitRefExt as _, WrapBinderMode, with_forced_trimmed_paths}; use rustc_middle::ty::{ diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/ambiguity.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/ambiguity.rs index 62ac12a8edd24..261dc5594bd24 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/ambiguity.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/ambiguity.rs @@ -11,6 +11,7 @@ use rustc_infer::traits::util::elaborate; use rustc_infer::traits::{ Obligation, ObligationCause, ObligationCauseCode, PolyTraitObligation, PredicateObligation, }; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::print::PrintPolyTraitClauseExt; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitable as _, TypeVisitableExt as _, Unnormalized}; use rustc_session::diagnostics::feature_err_unstable_feature_bound; diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs index 5090e36af9d8a..bc5bf38ec9266 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs @@ -24,6 +24,7 @@ use rustc_infer::traits::{ImplSource, TraitErrors}; use rustc_middle::traits::SignatureMismatchData; use rustc_middle::traits::select::OverflowError; use rustc_middle::ty::abstract_const::NotConstEvaluatable; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::error::{ExpectedFound, TypeError}; use rustc_middle::ty::print::{ PrintPolyTraitClauseExt, PrintPolyTraitRefExt as _, PrintTraitClauseExt as _, diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs index ed22d4f4ef246..2967dfb64e710 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs @@ -4,6 +4,7 @@ use rustc_hir as hir; use rustc_hir::attrs::diagnostic::{CustomDiagnostic, FilterOptions, FormatArgs}; use rustc_hir::def_id::LocalDefId; use rustc_hir::find_attr; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::print::PrintTraitRefExt; use rustc_middle::ty::{self, GenericParamDef, GenericParamDefKind}; use rustc_span::Symbol; diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs index 5e9288fc7a592..47652c22a7ebc 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs @@ -24,6 +24,7 @@ use rustc_infer::traits::ImplSource; use rustc_middle::middle::privacy::Level; use rustc_middle::traits::IsConstable; use rustc_middle::ty::adjustment::{Adjust, DerefAdjustKind}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::error::TypeError; use rustc_middle::ty::print::{ PrintPolyTraitClauseExt as _, PrintPolyTraitRefExt, PrintTraitClauseExt as _, diff --git a/compiler/rustc_trait_selection/src/traits/fulfill.rs b/compiler/rustc_trait_selection/src/traits/fulfill.rs index f5a4ec9ae0494..aae323ae1671f 100644 --- a/compiler/rustc_trait_selection/src/traits/fulfill.rs +++ b/compiler/rustc_trait_selection/src/traits/fulfill.rs @@ -11,6 +11,7 @@ use rustc_infer::traits::{ TraitEngine, TraitErrors, }; use rustc_middle::ty::abstract_const::NotConstEvaluatable; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::error::{ExpectedFound, TypeError}; use rustc_middle::ty::{ self, Binder, Const, DelayedSet, GenericArgsRef, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs index aa676dab91bbc..8ad7fd4ac3a69 100644 --- a/compiler/rustc_trait_selection/src/traits/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/mod.rs @@ -30,6 +30,7 @@ use rustc_errors::ErrorGuaranteed; pub use rustc_infer::traits::*; use rustc_macros::TypeVisitable; use rustc_middle::query::Providers; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::error::{ExpectedFound, TypeError}; use rustc_middle::ty::{ self, BottomUpFolder, Clause, GenericArgs, GenericArgsRef, Ty, TyCtxt, TypeFoldable, diff --git a/compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs b/compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs index e9e1cea48ba20..31d2e8620af90 100644 --- a/compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs +++ b/compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs @@ -2,6 +2,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_infer::traits::TraitErrors; use rustc_infer::traits::query::type_op::DropckOutlives; use rustc_middle::traits::query::{DropckConstraint, DropckOutlivesResult}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, EarlyBinder, ParamEnvAnd, Ty, TyCtxt, Unnormalized}; use rustc_span::Span; use thin_vec::ThinVec; diff --git a/compiler/rustc_transmute/src/lib.rs b/compiler/rustc_transmute/src/lib.rs index e2e1b0a08e15a..53287dbe331ee 100644 --- a/compiler/rustc_transmute/src/lib.rs +++ b/compiler/rustc_transmute/src/lib.rs @@ -104,6 +104,7 @@ pub enum Reason { #[cfg(feature = "rustc")] mod rustc { use rustc_hir::attrs::lang_items::LangItem; + use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{Const, Region, Ty, TyCtxt}; use super::*; diff --git a/compiler/rustc_ty_utils/src/consts.rs b/compiler/rustc_ty_utils/src/consts.rs index 0507265ded631..79369e5715d21 100644 --- a/compiler/rustc_ty_utils/src/consts.rs +++ b/compiler/rustc_ty_utils/src/consts.rs @@ -5,6 +5,7 @@ use rustc_middle::query::Providers; use rustc_middle::thir::visit; use rustc_middle::thir::visit::Visitor; use rustc_middle::ty::abstract_const::CastKind; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Expr, LitToConstInput, TyCtxt, TypeVisitableExt}; use rustc_middle::{mir, thir}; use rustc_span::{Span, bug}; From c58247047226f8d8bff9b92afbcdea50a68466aa Mon Sep 17 00:00:00 2001 From: James Barford-Evans Date: Thu, 17 Sep 2026 09:36:40 +0100 Subject: [PATCH 16/19] Use `ConstExt` in clippy --- src/tools/clippy/clippy_lints/src/indexing_slicing.rs | 1 + src/tools/clippy/clippy_lints/src/large_const_arrays.rs | 1 + src/tools/clippy/clippy_lints/src/large_stack_arrays.rs | 1 + src/tools/clippy/clippy_lints/src/loops/explicit_iter_loop.rs | 1 + src/tools/clippy/clippy_lints/src/loops/manual_memcpy.rs | 1 + src/tools/clippy/clippy_lints/src/loops/needless_range_loop.rs | 1 + src/tools/clippy/clippy_lints/src/matches/single_match.rs | 1 + src/tools/clippy/clippy_lints/src/methods/iter_out_of_bounds.rs | 1 + src/tools/clippy/clippy_lints/src/methods/utils.rs | 1 + src/tools/clippy/clippy_lints/src/trailing_empty_array.rs | 1 + src/tools/clippy/clippy_lints/src/tuple_array_conversions.rs | 1 + src/tools/clippy/clippy_utils/src/consts.rs | 1 + src/tools/clippy/clippy_utils/src/ty/mod.rs | 1 + 13 files changed, 13 insertions(+) diff --git a/src/tools/clippy/clippy_lints/src/indexing_slicing.rs b/src/tools/clippy/clippy_lints/src/indexing_slicing.rs index 107ab36741b2b..cd71a1e712c22 100644 --- a/src/tools/clippy/clippy_lints/src/indexing_slicing.rs +++ b/src/tools/clippy/clippy_lints/src/indexing_slicing.rs @@ -6,6 +6,7 @@ use clippy_utils::{higher, is_from_proc_macro, is_in_test, sym}; use rustc_ast::ast::RangeLimits; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass, impl_lint_pass}; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Ty}; declare_clippy_lint! { diff --git a/src/tools/clippy/clippy_lints/src/large_const_arrays.rs b/src/tools/clippy/clippy_lints/src/large_const_arrays.rs index 4d8ef09d17da3..d395d7b53c607 100644 --- a/src/tools/clippy/clippy_lints/src/large_const_arrays.rs +++ b/src/tools/clippy/clippy_lints/src/large_const_arrays.rs @@ -5,6 +5,7 @@ use rustc_hir::{Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass, impl_lint_pass}; use rustc_middle::ty::layout::LayoutOf as _; use rustc_middle::ty::{self, Ty, Unnormalized}; +use rustc_middle::ty::consts::ConstExt; use rustc_span::{BytePos, Pos as _, Span}; declare_clippy_lint! { diff --git a/src/tools/clippy/clippy_lints/src/large_stack_arrays.rs b/src/tools/clippy/clippy_lints/src/large_stack_arrays.rs index 49d4fe478cdf4..6762083fd324e 100644 --- a/src/tools/clippy/clippy_lints/src/large_stack_arrays.rs +++ b/src/tools/clippy/clippy_lints/src/large_stack_arrays.rs @@ -10,6 +10,7 @@ use rustc_lint::{LateContext, LateLintPass, impl_lint_pass}; use rustc_middle::ty; use rustc_middle::ty::layout::LayoutOf as _; use rustc_span::Span; +use rustc_middle::ty::consts::ConstExt; declare_clippy_lint! { /// ### What it does diff --git a/src/tools/clippy/clippy_lints/src/loops/explicit_iter_loop.rs b/src/tools/clippy/clippy_lints/src/loops/explicit_iter_loop.rs index ba2a418104a47..a9caa42a8b3dd 100644 --- a/src/tools/clippy/clippy_lints/src/loops/explicit_iter_loop.rs +++ b/src/tools/clippy/clippy_lints/src/loops/explicit_iter_loop.rs @@ -14,6 +14,7 @@ use rustc_hir::{Expr, Mutability}; use rustc_lint::LateContext; use rustc_middle::ty::adjustment::{Adjust, Adjustment, AutoBorrow, AutoBorrowMutability}; use rustc_middle::ty::{self, EarlyBinder, Ty}; +use rustc_middle::ty::consts::ConstExt; pub(super) fn check( cx: &LateContext<'_>, diff --git a/src/tools/clippy/clippy_lints/src/loops/manual_memcpy.rs b/src/tools/clippy/clippy_lints/src/loops/manual_memcpy.rs index ec0c4fb23390b..b0ddec9513722 100644 --- a/src/tools/clippy/clippy_lints/src/loops/manual_memcpy.rs +++ b/src/tools/clippy/clippy_lints/src/loops/manual_memcpy.rs @@ -13,6 +13,7 @@ use rustc_hir::{BinOpKind, Block, Expr, ExprKind, HirId, Pat, PatKind, StmtKind} use rustc_lint::LateContext; use rustc_middle::ty::{self, Ty}; use rustc_span::symbol::sym; +use rustc_middle::ty::consts::ConstExt; use std::fmt::Display; /// Checks for `for` loops that sequentially copy items from one slice-like diff --git a/src/tools/clippy/clippy_lints/src/loops/needless_range_loop.rs b/src/tools/clippy/clippy_lints/src/loops/needless_range_loop.rs index e72842d72f5cb..71676c5007407 100644 --- a/src/tools/clippy/clippy_lints/src/loops/needless_range_loop.rs +++ b/src/tools/clippy/clippy_lints/src/loops/needless_range_loop.rs @@ -15,6 +15,7 @@ use rustc_hir::intravisit::{Visitor, walk_expr}; use rustc_hir::{BinOpKind, BorrowKind, Closure, Expr, ExprKind, HirId, Mutability, Pat, PatKind, QPath}; use rustc_lint::LateContext; use rustc_middle::middle::region; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::{self, Ty}; use rustc_span::symbol::{Symbol, sym}; use rustc_span::{Span, SyntaxContext}; diff --git a/src/tools/clippy/clippy_lints/src/matches/single_match.rs b/src/tools/clippy/clippy_lints/src/matches/single_match.rs index 3d9a634f2008f..24d644625d685 100644 --- a/src/tools/clippy/clippy_lints/src/matches/single_match.rs +++ b/src/tools/clippy/clippy_lints/src/matches/single_match.rs @@ -12,6 +12,7 @@ use rustc_hir::intravisit::{Visitor, walk_pat}; use rustc_hir::{Arm, Expr, ExprKind, HirId, Node, Pat, PatExpr, PatExprKind, PatKind, QPath, StmtKind}; use rustc_lint::LateContext; use rustc_middle::ty::{self, AdtDef, TyCtxt, TypeckResults, VariantDef}; +use rustc_middle::ty::consts::ConstExt; use rustc_span::Span; use super::{MATCH_BOOL, SINGLE_MATCH, SINGLE_MATCH_ELSE}; diff --git a/src/tools/clippy/clippy_lints/src/methods/iter_out_of_bounds.rs b/src/tools/clippy/clippy_lints/src/methods/iter_out_of_bounds.rs index 7ec9021af11d8..54b29b06b35c1 100644 --- a/src/tools/clippy/clippy_lints/src/methods/iter_out_of_bounds.rs +++ b/src/tools/clippy/clippy_lints/src/methods/iter_out_of_bounds.rs @@ -5,6 +5,7 @@ use clippy_utils::{expr_or_init, sym}; use rustc_ast::LitKind; use rustc_hir::{Expr, ExprKind}; use rustc_lint::LateContext; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty; use super::ITER_OUT_OF_BOUNDS; diff --git a/src/tools/clippy/clippy_lints/src/methods/utils.rs b/src/tools/clippy/clippy_lints/src/methods/utils.rs index 9e7764fa19c80..6860b920fa82f 100644 --- a/src/tools/clippy/clippy_lints/src/methods/utils.rs +++ b/src/tools/clippy/clippy_lints/src/methods/utils.rs @@ -5,6 +5,7 @@ use rustc_hir::{BorrowKind, Expr, ExprKind, HirId, Mutability, Pat, QPath, Stmt, use rustc_lint::LateContext; use rustc_middle::hir::nested_filter; use rustc_middle::ty::{self, Ty}; +use rustc_middle::ty::consts::ConstExt; use rustc_span::Span; use rustc_span::symbol::sym; diff --git a/src/tools/clippy/clippy_lints/src/trailing_empty_array.rs b/src/tools/clippy/clippy_lints/src/trailing_empty_array.rs index 9fa66fc86c305..22f2ed3b3e518 100644 --- a/src/tools/clippy/clippy_lints/src/trailing_empty_array.rs +++ b/src/tools/clippy/clippy_lints/src/trailing_empty_array.rs @@ -1,3 +1,4 @@ +use rustc_middle::ty::consts::ConstExt; use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::{has_repr_attr, is_in_test}; use rustc_hir::{Item, ItemKind}; diff --git a/src/tools/clippy/clippy_lints/src/tuple_array_conversions.rs b/src/tools/clippy/clippy_lints/src/tuple_array_conversions.rs index c339affc3e8ba..1f0f678668b17 100644 --- a/src/tools/clippy/clippy_lints/src/tuple_array_conversions.rs +++ b/src/tools/clippy/clippy_lints/src/tuple_array_conversions.rs @@ -8,6 +8,7 @@ use clippy_utils::{SpanlessEq, is_from_proc_macro}; use core::ops::ControlFlow::{Break, Continue}; use core::{iter, mem}; use rustc_ast::LitKind; +use rustc_middle::ty::consts::ConstExt; use rustc_ast::visit::{VisitorResult, try_visit, visit_opt, walk_list}; use rustc_data_structures::packed::Pu128; use rustc_hir::intravisit::Visitor; diff --git a/src/tools/clippy/clippy_utils/src/consts.rs b/src/tools/clippy/clippy_utils/src/consts.rs index 192ce4df77c2a..890fc7cb4e947 100644 --- a/src/tools/clippy/clippy_utils/src/consts.rs +++ b/src/tools/clippy/clippy_utils/src/consts.rs @@ -17,6 +17,7 @@ use rustc_hir::{ BinOpKind, Block, ConstArgKind, ConstBlock, ConstItemRhs, Expr, ExprKind, HirId, PatExpr, PatExprKind, QPath, TyKind, UnOp, }; +use rustc_middle::ty::consts::ConstExt; use rustc_lexer::{FrontmatterAllowed, tokenize}; use rustc_lint::LateContext; use rustc_middle::mir::interpret::{Scalar, alloc_range}; diff --git a/src/tools/clippy/clippy_utils/src/ty/mod.rs b/src/tools/clippy/clippy_utils/src/ty/mod.rs index a244767cf3c3f..89174b281b773 100644 --- a/src/tools/clippy/clippy_utils/src/ty/mod.rs +++ b/src/tools/clippy/clippy_utils/src/ty/mod.rs @@ -20,6 +20,7 @@ use rustc_lint::unused::must_use::{IsTyMustUse, MustUsePath, is_ty_must_use}; use rustc_middle::mir::ConstValue; use rustc_middle::mir::interpret::Scalar; use rustc_middle::traits::EvaluationResult; +use rustc_middle::ty::consts::ConstExt; use rustc_middle::ty::adjustment::{Adjust, Adjustment, DerefAdjustKind}; use rustc_middle::ty::layout::{LayoutError, LayoutOf as _, TyAndLayout}; use rustc_middle::ty::{ From 5e56705e41153b18e2ced91daf527f83bf909ad7 Mon Sep 17 00:00:00 2001 From: James Barford-Evans Date: Thu, 17 Sep 2026 14:42:03 +0100 Subject: [PATCH 17/19] Add better code comments for peculiarities --- compiler/rustc_middle/src/ty/context.rs | 4 +--- compiler/rustc_type_ir/src/interner.rs | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 8b8ec7c98182f..4009191430afb 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1730,9 +1730,7 @@ impl<'a, 'tcx> Lift> for Interned<'a, RegionKind<'a>> { } } -// `rustc_type_ir::Const` is only the generic wrapper; lifting it delegates -// to `I::InternedConstKind`, so the concrete interned const representation -// must itself implement `Lift`. +// FIXME: unclear why exactly the macro doesn't work. impl<'a, 'tcx> Lift> for Interned<'a, WithCachedTypeInfo>> { type Lifted = Interned<'tcx, WithCachedTypeInfo>>; diff --git a/compiler/rustc_type_ir/src/interner.rs b/compiler/rustc_type_ir/src/interner.rs index 474a4689997d7..85a69af53539a 100644 --- a/compiler/rustc_type_ir/src/interner.rs +++ b/compiler/rustc_type_ir/src/interner.rs @@ -177,6 +177,10 @@ pub trait Interner: type Symbol: Symbol; // Things stored inside of tys + + // `TypeVisitable` is required to prevent a problem where the flags + // on `Const` indicated that an error was present, as the visitor could no + // longer reach the corresponding ErrorGuaranteed type ErrorGuaranteed: Copy + Debug + Hash + Eq + TypeVisitable; type BoundExistentialPredicates: BoundExistentialPredicates; type AllocId: Copy + Debug + Hash + Eq; From bae45db91d526101fdba2f316491bfdde891c209 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Tue, 22 Sep 2026 13:00:32 +0000 Subject: [PATCH 18/19] Add unreachable for modes which never adds opaque types --- compiler/rustc_next_trait_solver/src/solve/trait_goals.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs index 649ce4d2dd76f..8e2baed38a2e2 100644 --- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs @@ -1320,7 +1320,9 @@ where // fixed and only regions are inferred, but not during typeck while hidden // types may still contain inference variables. if !opaque_types.is_empty() { - match self.typing_mode() { + let typing_mode = self.typing_mode(); + + match typing_mode { // We're inferring regions of opaque types, but // the type itself is already fully known, no way // to leak the hidden type. @@ -1337,7 +1339,9 @@ where | TypingMode::PostAnalysis | TypingMode::Codegen | TypingMode::ErasedNotCoherence(MayBeErased) => { - return self.forced_ambiguity(MaybeInfo::AMBIGUOUS); + unreachable!( + "we never add new uses to opaque types in typing mode {typing_mode:?}" + ); } } } From a35e5a6272ab3ea18f16d7cd5dc61fedad788682 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 22 Sep 2026 15:03:57 +0200 Subject: [PATCH 19/19] Remove unused `make3.sh` CI script --- src/ci/docker/scripts/make3.sh | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 src/ci/docker/scripts/make3.sh diff --git a/src/ci/docker/scripts/make3.sh b/src/ci/docker/scripts/make3.sh deleted file mode 100644 index 283700d06f6cc..0000000000000 --- a/src/ci/docker/scripts/make3.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -set -ex - -curl -f https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf - -cd make-3.81 -./configure --prefix=/usr -make -make install -cd .. -rm -rf make-3.81