diff --git a/compiler/rustc_abi/src/callconv.rs b/compiler/rustc_abi/src/callconv.rs index 400395f99ff01..daa365bf6e1d7 100644 --- a/compiler/rustc_abi/src/callconv.rs +++ b/compiler/rustc_abi/src/callconv.rs @@ -1,73 +1,10 @@ -mod abi { - pub(crate) use crate::Primitive::*; - pub(crate) use crate::Variants; -} - -#[cfg(feature = "nightly")] -use rustc_macros::HashStable_Generic; - -use crate::{Align, HasDataLayout, Size}; #[cfg(feature = "nightly")] use crate::{BackendRepr, FieldsShape, TyAbiInterface, TyAndLayout}; +use crate::{Primitive, Size, Variants}; -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] -#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub enum RegKind { - Integer, - Float, - Vector, -} - -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] -#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -pub struct Reg { - pub kind: RegKind, - pub size: Size, -} - -macro_rules! reg_ctor { - ($name:ident, $kind:ident, $bits:expr) => { - pub fn $name() -> Reg { - Reg { kind: RegKind::$kind, size: Size::from_bits($bits) } - } - }; -} - -impl Reg { - reg_ctor!(i8, Integer, 8); - reg_ctor!(i16, Integer, 16); - reg_ctor!(i32, Integer, 32); - reg_ctor!(i64, Integer, 64); - reg_ctor!(i128, Integer, 128); - - reg_ctor!(f32, Float, 32); - reg_ctor!(f64, Float, 64); -} +mod reg; -impl Reg { - pub fn align(&self, cx: &C) -> Align { - let dl = cx.data_layout(); - match self.kind { - RegKind::Integer => match self.size.bits() { - 1 => dl.i1_align.abi, - 2..=8 => dl.i8_align.abi, - 9..=16 => dl.i16_align.abi, - 17..=32 => dl.i32_align.abi, - 33..=64 => dl.i64_align.abi, - 65..=128 => dl.i128_align.abi, - _ => panic!("unsupported integer: {self:?}"), - }, - RegKind::Float => match self.size.bits() { - 16 => dl.f16_align.abi, - 32 => dl.f32_align.abi, - 64 => dl.f64_align.abi, - 128 => dl.f128_align.abi, - _ => panic!("unsupported float: {self:?}"), - }, - RegKind::Vector => dl.vector_align(self.size).abi, - } - } -} +pub use reg::{Reg, RegKind}; /// Return value from the `homogeneous_aggregate` test function. #[derive(Copy, Clone, Debug)] @@ -134,8 +71,8 @@ impl<'a, Ty> TyAndLayout<'a, Ty> { // The primitive for this algorithm. BackendRepr::Scalar(scalar) => { let kind = match scalar.primitive() { - abi::Int(..) | abi::Pointer(_) => RegKind::Integer, - abi::Float(_) => RegKind::Float, + Primitive::Int(..) | Primitive::Pointer(_) => RegKind::Integer, + Primitive::Float(_) => RegKind::Float, }; Ok(HomogeneousAggregate::Homogeneous(Reg { kind, size: self.size })) } @@ -206,8 +143,8 @@ impl<'a, Ty> TyAndLayout<'a, Ty> { let (mut result, mut total) = from_fields_at(*self, Size::ZERO)?; match &self.variants { - abi::Variants::Single { .. } | abi::Variants::Empty => {} - abi::Variants::Multiple { variants, .. } => { + Variants::Single { .. } | Variants::Empty => {} + Variants::Multiple { variants, .. } => { // Treat enum variants like union members. // HACK(eddyb) pretend the `enum` field (discriminant) // is at the start of every variant (otherwise the gap diff --git a/compiler/rustc_abi/src/callconv/reg.rs b/compiler/rustc_abi/src/callconv/reg.rs new file mode 100644 index 0000000000000..66f47c52c15d1 --- /dev/null +++ b/compiler/rustc_abi/src/callconv/reg.rs @@ -0,0 +1,63 @@ +#[cfg(feature = "nightly")] +use rustc_macros::HashStable_Generic; + +use crate::{Align, HasDataLayout, Size}; + +#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] +pub enum RegKind { + Integer, + Float, + Vector, +} + +#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] +pub struct Reg { + pub kind: RegKind, + pub size: Size, +} + +macro_rules! reg_ctor { + ($name:ident, $kind:ident, $bits:expr) => { + pub fn $name() -> Reg { + Reg { kind: RegKind::$kind, size: Size::from_bits($bits) } + } + }; +} + +impl Reg { + reg_ctor!(i8, Integer, 8); + reg_ctor!(i16, Integer, 16); + reg_ctor!(i32, Integer, 32); + reg_ctor!(i64, Integer, 64); + reg_ctor!(i128, Integer, 128); + + reg_ctor!(f32, Float, 32); + reg_ctor!(f64, Float, 64); +} + +impl Reg { + pub fn align(&self, cx: &C) -> Align { + let dl = cx.data_layout(); + match self.kind { + RegKind::Integer => match self.size.bits() { + 1 => dl.i1_align.abi, + 2..=8 => dl.i8_align.abi, + 9..=16 => dl.i16_align.abi, + 17..=32 => dl.i32_align.abi, + 33..=64 => dl.i64_align.abi, + 65..=128 => dl.i128_align.abi, + _ => panic!("unsupported integer: {self:?}"), + }, + RegKind::Float => match self.size.bits() { + 16 => dl.f16_align.abi, + 32 => dl.f32_align.abi, + 64 => dl.f64_align.abi, + 128 => dl.f128_align.abi, + _ => panic!("unsupported float: {self:?}"), + }, + RegKind::Vector => dl.vector_align(self.size).abi, + } + } +} diff --git a/compiler/rustc_abi/src/extern_abi/mod.rs b/compiler/rustc_abi/src/extern_abi.rs similarity index 100% rename from compiler/rustc_abi/src/extern_abi/mod.rs rename to compiler/rustc_abi/src/extern_abi.rs diff --git a/compiler/rustc_abi/src/layout/ty.rs b/compiler/rustc_abi/src/layout/ty.rs index d188750bfe100..221e990ae863b 100644 --- a/compiler/rustc_abi/src/layout/ty.rs +++ b/compiler/rustc_abi/src/layout/ty.rs @@ -1,13 +1,15 @@ use std::fmt; use std::ops::Deref; -use Float::*; -use Primitive::*; use rustc_data_structures::intern::Interned; use rustc_macros::HashStable_Generic; +use crate::{ + AbiAndPrefAlign, Align, BackendRepr, FieldsShape, Float, HasDataLayout, LayoutData, Niche, + PointeeInfo, Primitive, Scalar, Size, TargetDataLayout, Variants, +}; + // Explicitly import `Float` to avoid ambiguity with `Primitive::Float`. -use crate::{Float, *}; rustc_index::newtype_index! { /// The *source-order* index of a field in a variant. @@ -197,7 +199,9 @@ impl<'a, Ty> TyAndLayout<'a, Ty> { C: HasDataLayout, { match self.backend_repr { - BackendRepr::Scalar(scalar) => matches!(scalar.primitive(), Float(F32 | F64)), + BackendRepr::Scalar(scalar) => { + matches!(scalar.primitive(), Primitive::Float(Float::F32 | Float::F64)) + } BackendRepr::Memory { .. } => { if self.fields.count() == 1 && self.fields.offset(0).bytes() == 0 { self.field(cx, 0).is_single_fp_element(cx) diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 217a7aeb2d7f7..6c4310864142c 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -9,7 +9,7 @@ macro_rules! declare_features { $(#[doc = $doc:tt])* (accepted, $feature:ident, $ver:expr, $issue:expr), )+) => { /// Formerly unstable features that have now been accepted (stabilized). - pub const ACCEPTED_LANG_FEATURES: &[Feature] = &[ + pub static ACCEPTED_LANG_FEATURES: &[Feature] = &[ $(Feature { name: sym::$feature, since: $ver, diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index 67eb96e4d56ad..eb5fac96af270 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -318,7 +318,7 @@ pub struct BuiltinAttribute { /// Attributes that have a special meaning to rustc or rustdoc. #[rustfmt::skip] -pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ +pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // ========================================================================== // Stable attributes: // ========================================================================== diff --git a/compiler/rustc_feature/src/removed.rs b/compiler/rustc_feature/src/removed.rs index 081638715dffa..2fb0c8e43448a 100644 --- a/compiler/rustc_feature/src/removed.rs +++ b/compiler/rustc_feature/src/removed.rs @@ -14,7 +14,7 @@ macro_rules! declare_features { $(#[doc = $doc:tt])* (removed, $feature:ident, $ver:expr, $issue:expr, $reason:expr), )+) => { /// Formerly unstable features that have now been removed. - pub const REMOVED_LANG_FEATURES: &[RemovedFeature] = &[ + pub static REMOVED_LANG_FEATURES: &[RemovedFeature] = &[ $(RemovedFeature { feature: Feature { name: sym::$feature, diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 115b3eabbaa73..094962b265b78 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -104,7 +104,7 @@ macro_rules! declare_features { )+) => { /// Unstable language features that are being implemented or being /// considered for acceptance (stabilization) or removal. - pub const UNSTABLE_LANG_FEATURES: &[Feature] = &[ + pub static UNSTABLE_LANG_FEATURES: &[Feature] = &[ $(Feature { name: sym::$feature, since: $ver, diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index 8efef0c612b0d..fb1df518a8814 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -325,6 +325,10 @@ pub fn expr_to_string(ann: &dyn PpAnn, pat: &hir::Expr<'_>) -> String { to_string(ann, |s| s.print_expr(pat)) } +pub fn item_to_string(ann: &dyn PpAnn, pat: &hir::Item<'_>) -> String { + to_string(ann, |s| s.print_item(pat)) +} + impl<'a> State<'a> { fn bclose_maybe_open(&mut self, span: rustc_span::Span, close_box: bool) { self.maybe_print_comment(span.hi()); diff --git a/compiler/rustc_mir_build/src/check_tail_calls.rs b/compiler/rustc_mir_build/src/check_tail_calls.rs index 921205428dbd4..18db8c1debb14 100644 --- a/compiler/rustc_mir_build/src/check_tail_calls.rs +++ b/compiler/rustc_mir_build/src/check_tail_calls.rs @@ -132,11 +132,24 @@ impl<'tcx> TailCallCkVisitor<'_, 'tcx> { } { + // `#[track_caller]` affects the ABI of a function (by adding a location argument), + // so a `track_caller` can only tail call other `track_caller` functions. + // + // The issue is however that we can't know if a function is `track_caller` or not at + // this point (THIR can be polymorphic, we may have an unresolved trait function). + // We could only allow functions that we *can* resolve and *are* `track_caller`, + // but that would turn changing `track_caller`-ness into a breaking change, + // which is probably undesirable. + // + // Also note that we don't check callee's `track_caller`-ness at all, mostly for the + // reasons above, but also because we can always tailcall the shim we'd generate for + // coercing the function to an `fn()` pointer. (although in that case the tailcall is + // basically useless -- the shim calls the actual function, so tailcalling the shim is + // equivalent to calling the function) let caller_needs_location = self.needs_location(self.caller_ty); - let callee_needs_location = self.needs_location(ty); - if caller_needs_location != callee_needs_location { - self.report_track_caller_mismatch(expr.span, caller_needs_location); + if caller_needs_location { + self.report_track_caller_caller(expr.span); } } @@ -150,7 +163,9 @@ impl<'tcx> TailCallCkVisitor<'_, 'tcx> { } /// Returns true if function of type `ty` needs location argument - /// (i.e. if a function is marked as `#[track_caller]`) + /// (i.e. if a function is marked as `#[track_caller]`). + /// + /// Panics if the function's instance can't be immediately resolved. fn needs_location(&self, ty: Ty<'tcx>) -> bool { if let &ty::FnDef(did, substs) = ty.kind() { let instance = @@ -293,25 +308,15 @@ impl<'tcx> TailCallCkVisitor<'_, 'tcx> { self.found_errors = Err(err); } - fn report_track_caller_mismatch(&mut self, sp: Span, caller_needs_location: bool) { - let err = match caller_needs_location { - true => self - .tcx - .dcx() - .struct_span_err( - sp, - "a function marked with `#[track_caller]` cannot tail-call one that is not", - ) - .emit(), - false => self - .tcx - .dcx() - .struct_span_err( - sp, - "a function mot marked with `#[track_caller]` cannot tail-call one that is", - ) - .emit(), - }; + fn report_track_caller_caller(&mut self, sp: Span) { + let err = self + .tcx + .dcx() + .struct_span_err( + sp, + "a function marked with `#[track_caller]` cannot perform a tail-call", + ) + .emit(); self.found_errors = Err(err); } diff --git a/compiler/rustc_mir_transform/src/validate.rs b/compiler/rustc_mir_transform/src/validate.rs index b7a3770fc6b1d..4ac3a268c9c33 100644 --- a/compiler/rustc_mir_transform/src/validate.rs +++ b/compiler/rustc_mir_transform/src/validate.rs @@ -97,6 +97,12 @@ impl<'tcx> crate::MirPass<'tcx> for Validator { } } +/// This checker covers basic properties of the control-flow graph, (dis)allowed statements and terminators. +/// Everything checked here must be stable under substitution of generic parameters. In other words, +/// this is about the *structure* of the MIR, not the *contents*. +/// +/// Everything that depends on types, or otherwise can be affected by generic parameters, +/// must be checked in `TypeChecker`. struct CfgChecker<'a, 'tcx> { when: &'a str, body: &'a Body<'tcx>, diff --git a/compiler/rustc_next_trait_solver/src/canonicalizer.rs b/compiler/rustc_next_trait_solver/src/canonicalizer.rs index 7eeed721d5a0f..9cae7f27947b4 100644 --- a/compiler/rustc_next_trait_solver/src/canonicalizer.rs +++ b/compiler/rustc_next_trait_solver/src/canonicalizer.rs @@ -1,6 +1,6 @@ use std::cmp::Ordering; -use rustc_type_ir::data_structures::HashMap; +use rustc_type_ir::data_structures::{HashMap, ensure_sufficient_stack}; use rustc_type_ir::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable}; use rustc_type_ir::inherent::*; use rustc_type_ir::solve::{Goal, QueryInput}; @@ -389,7 +389,7 @@ impl<'a, D: SolverDelegate, I: Interner> Canonicalizer<'a, D, I> { | ty::Alias(_, _) | ty::Bound(_, _) | ty::Error(_) => { - return t.super_fold_with(self); + return ensure_sufficient_stack(|| t.super_fold_with(self)); } }; diff --git a/compiler/rustc_parse/src/lexer/unicode_chars.rs b/compiler/rustc_parse/src/lexer/unicode_chars.rs index ef8d0f96b6102..648a352efd9bd 100644 --- a/compiler/rustc_parse/src/lexer/unicode_chars.rs +++ b/compiler/rustc_parse/src/lexer/unicode_chars.rs @@ -8,7 +8,7 @@ use crate::errors::TokenSubstitution; use crate::token::{self, Delimiter}; #[rustfmt::skip] // for line breaks -pub(super) const UNICODE_ARRAY: &[(char, &str, &str)] = &[ +pub(super) static UNICODE_ARRAY: &[(char, &str, &str)] = &[ ('
', "Line Separator", " "), ('
', "Paragraph Separator", " "), (' ', "Ogham Space mark", " "), diff --git a/compiler/rustc_target/src/asm/mod.rs b/compiler/rustc_target/src/asm/mod.rs index f17452b3ba039..0a4ffb152195e 100644 --- a/compiler/rustc_target/src/asm/mod.rs +++ b/compiler/rustc_target/src/asm/mod.rs @@ -1,11 +1,11 @@ use std::fmt; use std::str::FromStr; +use rustc_abi::Size; use rustc_data_structures::fx::{FxHashMap, FxIndexSet}; use rustc_macros::{Decodable, Encodable, HashStable_Generic}; use rustc_span::Symbol; -use crate::abi::Size; use crate::spec::{RelocModel, Target}; pub struct ModifierInfo { diff --git a/compiler/rustc_target/src/callconv/aarch64.rs b/compiler/rustc_target/src/callconv/aarch64.rs index 67345f0d47b71..d712bec9b780e 100644 --- a/compiler/rustc_target/src/callconv/aarch64.rs +++ b/compiler/rustc_target/src/callconv/aarch64.rs @@ -1,9 +1,8 @@ use std::iter; -use rustc_abi::{BackendRepr, Primitive}; +use rustc_abi::{BackendRepr, HasDataLayout, Primitive, TyAbiInterface}; use crate::abi::call::{ArgAbi, FnAbi, Reg, RegKind, Uniform}; -use crate::abi::{HasDataLayout, TyAbiInterface}; use crate::spec::{HasTargetSpec, Target}; /// Indicates the variant of the AArch64 ABI we are compiling for. diff --git a/compiler/rustc_target/src/callconv/amdgpu.rs b/compiler/rustc_target/src/callconv/amdgpu.rs index 3007a729a8b8a..91ac00e025001 100644 --- a/compiler/rustc_target/src/callconv/amdgpu.rs +++ b/compiler/rustc_target/src/callconv/amdgpu.rs @@ -1,5 +1,6 @@ +use rustc_abi::{HasDataLayout, TyAbiInterface}; + use crate::abi::call::{ArgAbi, FnAbi}; -use crate::abi::{HasDataLayout, TyAbiInterface}; fn classify_ret<'a, Ty, C>(_cx: &C, ret: &mut ArgAbi<'a, Ty>) where diff --git a/compiler/rustc_target/src/callconv/arm.rs b/compiler/rustc_target/src/callconv/arm.rs index bd6f781fb8120..75797daba695a 100644 --- a/compiler/rustc_target/src/callconv/arm.rs +++ b/compiler/rustc_target/src/callconv/arm.rs @@ -1,5 +1,6 @@ +use rustc_abi::{HasDataLayout, TyAbiInterface}; + use crate::abi::call::{ArgAbi, Conv, FnAbi, Reg, RegKind, Uniform}; -use crate::abi::{HasDataLayout, TyAbiInterface}; use crate::spec::HasTargetSpec; fn is_homogeneous_aggregate<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>) -> Option diff --git a/compiler/rustc_target/src/callconv/loongarch.rs b/compiler/rustc_target/src/callconv/loongarch.rs index 8bf61cb133766..47566bde6b4a4 100644 --- a/compiler/rustc_target/src/callconv/loongarch.rs +++ b/compiler/rustc_target/src/callconv/loongarch.rs @@ -1,9 +1,10 @@ -use crate::abi::call::{ArgAbi, ArgExtension, CastTarget, FnAbi, PassMode, Reg, RegKind, Uniform}; -use crate::abi::{ - self, BackendRepr, FieldsShape, HasDataLayout, Size, TyAbiInterface, TyAndLayout, +use rustc_abi::{ + BackendRepr, ExternAbi, FieldsShape, HasDataLayout, Primitive, Reg, RegKind, Size, + TyAbiInterface, TyAndLayout, Variants, }; + +use crate::callconv::{ArgAbi, ArgExtension, CastTarget, FnAbi, PassMode, Uniform}; use crate::spec::HasTargetSpec; -use crate::spec::abi::Abi as SpecAbi; #[derive(Copy, Clone)] enum RegPassKind { @@ -42,7 +43,7 @@ where { match arg_layout.backend_repr { BackendRepr::Scalar(scalar) => match scalar.primitive() { - abi::Int(..) | abi::Pointer(_) => { + Primitive::Int(..) | Primitive::Pointer(_) => { if arg_layout.size.bits() > xlen { return Err(CannotUseFpConv); } @@ -62,7 +63,7 @@ where _ => return Err(CannotUseFpConv), } } - abi::Float(_) => { + Primitive::Float(_) => { if arg_layout.size.bits() > flen { return Err(CannotUseFpConv); } @@ -115,8 +116,8 @@ where } FieldsShape::Arbitrary { .. } => { match arg_layout.variants { - abi::Variants::Multiple { .. } => return Err(CannotUseFpConv), - abi::Variants::Single { .. } | abi::Variants::Empty => (), + Variants::Multiple { .. } => return Err(CannotUseFpConv), + Variants::Single { .. } | Variants::Empty => (), } for i in arg_layout.fields.index_by_increasing_offset() { let field = arg_layout.field(cx, i); @@ -314,7 +315,7 @@ fn classify_arg<'a, Ty, C>( fn extend_integer_width(arg: &mut ArgAbi<'_, Ty>, xlen: u64) { if let BackendRepr::Scalar(scalar) = arg.layout.backend_repr { - if let abi::Int(i, _) = scalar.primitive() { + if let Primitive::Int(i, _) = scalar.primitive() { // 32-bit integers are always sign-extended if i.size().bits() == 32 && xlen > 32 { if let PassMode::Direct(ref mut attrs) = arg.mode { @@ -363,12 +364,12 @@ where } } -pub(crate) fn compute_rust_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, abi: SpecAbi) +pub(crate) fn compute_rust_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, abi: ExternAbi) where Ty: TyAbiInterface<'a, C> + Copy, C: HasDataLayout + HasTargetSpec, { - if abi == SpecAbi::RustIntrinsic { + if abi == ExternAbi::RustIntrinsic { return; } diff --git a/compiler/rustc_target/src/callconv/mips.rs b/compiler/rustc_target/src/callconv/mips.rs index 37980a91c7601..f7d688221552b 100644 --- a/compiler/rustc_target/src/callconv/mips.rs +++ b/compiler/rustc_target/src/callconv/mips.rs @@ -1,5 +1,6 @@ +use rustc_abi::{HasDataLayout, Size}; + use crate::abi::call::{ArgAbi, FnAbi, Reg, Uniform}; -use crate::abi::{HasDataLayout, Size}; fn classify_ret(cx: &C, ret: &mut ArgAbi<'_, Ty>, offset: &mut Size) where diff --git a/compiler/rustc_target/src/callconv/mips64.rs b/compiler/rustc_target/src/callconv/mips64.rs index 5bdf4c2ad77f0..89f324bc31308 100644 --- a/compiler/rustc_target/src/callconv/mips64.rs +++ b/compiler/rustc_target/src/callconv/mips64.rs @@ -1,12 +1,15 @@ -use crate::abi::call::{ - ArgAbi, ArgAttribute, ArgAttributes, ArgExtension, CastTarget, FnAbi, PassMode, Reg, Uniform, +use rustc_abi::{ + BackendRepr, FieldsShape, Float, HasDataLayout, Primitive, Reg, Size, TyAbiInterface, +}; + +use crate::callconv::{ + ArgAbi, ArgAttribute, ArgAttributes, ArgExtension, CastTarget, FnAbi, PassMode, Uniform, }; -use crate::abi::{self, HasDataLayout, Size, TyAbiInterface}; fn extend_integer_width_mips(arg: &mut ArgAbi<'_, Ty>, bits: u64) { // Always sign extend u32 values on 64-bit mips - if let abi::BackendRepr::Scalar(scalar) = arg.layout.backend_repr { - if let abi::Int(i, signed) = scalar.primitive() { + if let BackendRepr::Scalar(scalar) = arg.layout.backend_repr { + if let Primitive::Int(i, signed) = scalar.primitive() { if !signed && i.size().bits() == 32 { if let PassMode::Direct(ref mut attrs) = arg.mode { attrs.ext(ArgExtension::Sext); @@ -25,9 +28,9 @@ where C: HasDataLayout, { match ret.layout.field(cx, i).backend_repr { - abi::BackendRepr::Scalar(scalar) => match scalar.primitive() { - abi::Float(abi::F32) => Some(Reg::f32()), - abi::Float(abi::F64) => Some(Reg::f64()), + BackendRepr::Scalar(scalar) => match scalar.primitive() { + Primitive::Float(Float::F32) => Some(Reg::f32()), + Primitive::Float(Float::F64) => Some(Reg::f64()), _ => None, }, _ => None, @@ -51,7 +54,7 @@ where // use of float registers to structures (not unions) containing exactly one or two // float fields. - if let abi::FieldsShape::Arbitrary { .. } = ret.layout.fields { + if let FieldsShape::Arbitrary { .. } = ret.layout.fields { if ret.layout.fields.count() == 1 { if let Some(reg) = float_reg(cx, ret, 0) { ret.cast_to(reg); @@ -90,16 +93,16 @@ where let mut prefix_index = 0; match arg.layout.fields { - abi::FieldsShape::Primitive => unreachable!(), - abi::FieldsShape::Array { .. } => { + FieldsShape::Primitive => unreachable!(), + FieldsShape::Array { .. } => { // Arrays are passed indirectly arg.make_indirect(); return; } - abi::FieldsShape::Union(_) => { + FieldsShape::Union(_) => { // Unions and are always treated as a series of 64-bit integer chunks } - abi::FieldsShape::Arbitrary { .. } => { + FieldsShape::Arbitrary { .. } => { // Structures are split up into a series of 64-bit integer chunks, but any aligned // doubles not part of another aggregate are passed as floats. let mut last_offset = Size::ZERO; @@ -109,8 +112,8 @@ where let offset = arg.layout.fields.offset(i); // We only care about aligned doubles - if let abi::BackendRepr::Scalar(scalar) = field.backend_repr { - if scalar.primitive() == abi::Float(abi::F64) { + if let BackendRepr::Scalar(scalar) = field.backend_repr { + if scalar.primitive() == Primitive::Float(Float::F64) { if offset.is_aligned(dl.f64_align.abi) { // Insert enough integers to cover [last_offset, offset) assert!(last_offset.is_aligned(dl.f64_align.abi)); diff --git a/compiler/rustc_target/src/callconv/mod.rs b/compiler/rustc_target/src/callconv/mod.rs index 41b78d9121d6d..9e651376cd7ce 100644 --- a/compiler/rustc_target/src/callconv/mod.rs +++ b/compiler/rustc_target/src/callconv/mod.rs @@ -1,14 +1,14 @@ use std::str::FromStr; use std::{fmt, iter}; -pub use rustc_abi::{ExternAbi, Reg, RegKind}; +use rustc_abi::{ + AddressSpace, Align, BackendRepr, ExternAbi, HasDataLayout, Scalar, Size, TyAbiInterface, + TyAndLayout, +}; +pub use rustc_abi::{Primitive, Reg, RegKind}; use rustc_macros::HashStable_Generic; use rustc_span::Symbol; -use crate::abi::{ - self, AddressSpace, Align, BackendRepr, HasDataLayout, Pointer, Size, TyAbiInterface, - TyAndLayout, -}; use crate::spec::{HasTargetSpec, HasWasmCAbiOpt, HasX86AbiOpt, WasmCAbi}; mod aarch64; @@ -349,7 +349,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> { pub fn new( cx: &impl HasDataLayout, layout: TyAndLayout<'a, Ty>, - scalar_attrs: impl Fn(&TyAndLayout<'a, Ty>, abi::Scalar, Size) -> ArgAttributes, + scalar_attrs: impl Fn(&TyAndLayout<'a, Ty>, Scalar, Size) -> ArgAttributes, ) -> Self { let mode = match layout.backend_repr { BackendRepr::Uninhabited => PassMode::Ignore, @@ -464,7 +464,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> { pub fn extend_integer_width_to(&mut self, bits: u64) { // Only integers have signedness if let BackendRepr::Scalar(scalar) = self.layout.backend_repr { - if let abi::Int(i, signed) = scalar.primitive() { + if let Primitive::Int(i, signed) = scalar.primitive() { if i.size().bits() < bits { if let PassMode::Direct(ref mut attrs) = self.mode { if signed { @@ -756,7 +756,9 @@ impl<'a, Ty> FnAbi<'a, Ty> { continue; } - if arg_idx.is_none() && arg.layout.size > Pointer(AddressSpace::DATA).size(cx) * 2 { + if arg_idx.is_none() + && arg.layout.size > Primitive::Pointer(AddressSpace::DATA).size(cx) * 2 + { // Return values larger than 2 registers using a return area // pointer. LLVM and Cranelift disagree about how to return // values that don't fit in the registers designated for return @@ -837,7 +839,7 @@ impl<'a, Ty> FnAbi<'a, Ty> { assert!(is_indirect_not_on_stack); let size = arg.layout.size; - if !arg.layout.is_unsized() && size <= Pointer(AddressSpace::DATA).size(cx) { + if !arg.layout.is_unsized() && size <= Primitive::Pointer(AddressSpace::DATA).size(cx) { // We want to pass small aggregates as immediates, but using // an LLVM aggregate type for this leads to bad optimizations, // so we pick an appropriately sized integer type instead. diff --git a/compiler/rustc_target/src/callconv/nvptx64.rs b/compiler/rustc_target/src/callconv/nvptx64.rs index c64164372a11d..c5da185565887 100644 --- a/compiler/rustc_target/src/callconv/nvptx64.rs +++ b/compiler/rustc_target/src/callconv/nvptx64.rs @@ -1,6 +1,7 @@ +use rustc_abi::{HasDataLayout, Reg, Size, TyAbiInterface}; + use super::{ArgAttribute, ArgAttributes, ArgExtension, CastTarget}; -use crate::abi::call::{ArgAbi, FnAbi, Reg, Size, Uniform}; -use crate::abi::{HasDataLayout, TyAbiInterface}; +use crate::abi::call::{ArgAbi, FnAbi, Uniform}; fn classify_ret(ret: &mut ArgAbi<'_, Ty>) { if ret.layout.is_aggregate() && ret.layout.is_sized() { diff --git a/compiler/rustc_target/src/callconv/powerpc64.rs b/compiler/rustc_target/src/callconv/powerpc64.rs index 92c1f6e7148f3..7a66ce8529af0 100644 --- a/compiler/rustc_target/src/callconv/powerpc64.rs +++ b/compiler/rustc_target/src/callconv/powerpc64.rs @@ -2,8 +2,9 @@ // Alignment of 128 bit types is not currently handled, this will // need to be fixed when PowerPC vector support is added. +use rustc_abi::{Endian, HasDataLayout, TyAbiInterface}; + use crate::abi::call::{Align, ArgAbi, FnAbi, Reg, RegKind, Uniform}; -use crate::abi::{Endian, HasDataLayout, TyAbiInterface}; use crate::spec::HasTargetSpec; #[derive(Debug, Clone, Copy, PartialEq)] diff --git a/compiler/rustc_target/src/callconv/riscv.rs b/compiler/rustc_target/src/callconv/riscv.rs index 4d858392c979a..24531b0ef6356 100644 --- a/compiler/rustc_target/src/callconv/riscv.rs +++ b/compiler/rustc_target/src/callconv/riscv.rs @@ -4,12 +4,13 @@ // Reference: Clang RISC-V ELF psABI lowering code // https://github.com/llvm/llvm-project/blob/8e780252a7284be45cf1ba224cabd884847e8e92/clang/lib/CodeGen/TargetInfo.cpp#L9311-L9773 -use rustc_abi::{BackendRepr, FieldsShape, HasDataLayout, Size, TyAbiInterface, TyAndLayout}; +use rustc_abi::{ + BackendRepr, ExternAbi, FieldsShape, HasDataLayout, Primitive, Reg, RegKind, Size, + TyAbiInterface, TyAndLayout, Variants, +}; -use crate::abi; -use crate::abi::call::{ArgAbi, ArgExtension, CastTarget, FnAbi, PassMode, Reg, RegKind, Uniform}; +use crate::abi::call::{ArgAbi, ArgExtension, CastTarget, FnAbi, PassMode, Uniform}; use crate::spec::HasTargetSpec; -use crate::spec::abi::Abi as SpecAbi; #[derive(Copy, Clone)] enum RegPassKind { @@ -48,7 +49,7 @@ where { match arg_layout.backend_repr { BackendRepr::Scalar(scalar) => match scalar.primitive() { - abi::Int(..) | abi::Pointer(_) => { + Primitive::Int(..) | Primitive::Pointer(_) => { if arg_layout.size.bits() > xlen { return Err(CannotUseFpConv); } @@ -68,7 +69,7 @@ where _ => return Err(CannotUseFpConv), } } - abi::Float(_) => { + Primitive::Float(_) => { if arg_layout.size.bits() > flen { return Err(CannotUseFpConv); } @@ -121,8 +122,8 @@ where } FieldsShape::Arbitrary { .. } => { match arg_layout.variants { - abi::Variants::Multiple { .. } => return Err(CannotUseFpConv), - abi::Variants::Single { .. } | abi::Variants::Empty => (), + Variants::Multiple { .. } => return Err(CannotUseFpConv), + Variants::Single { .. } | Variants::Empty => (), } for i in arg_layout.fields.index_by_increasing_offset() { let field = arg_layout.field(cx, i); @@ -320,7 +321,7 @@ fn classify_arg<'a, Ty, C>( fn extend_integer_width(arg: &mut ArgAbi<'_, Ty>, xlen: u64) { if let BackendRepr::Scalar(scalar) = arg.layout.backend_repr { - if let abi::Int(i, _) = scalar.primitive() { + if let Primitive::Int(i, _) = scalar.primitive() { // 32-bit integers are always sign-extended if i.size().bits() == 32 && xlen > 32 { if let PassMode::Direct(ref mut attrs) = arg.mode { @@ -369,12 +370,12 @@ where } } -pub(crate) fn compute_rust_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, abi: SpecAbi) +pub(crate) fn compute_rust_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, abi: ExternAbi) where Ty: TyAbiInterface<'a, C> + Copy, C: HasDataLayout + HasTargetSpec, { - if abi == SpecAbi::RustIntrinsic { + if abi == ExternAbi::RustIntrinsic { return; } diff --git a/compiler/rustc_target/src/callconv/s390x.rs b/compiler/rustc_target/src/callconv/s390x.rs index a73c1a0f46c2b..edf57098d6d92 100644 --- a/compiler/rustc_target/src/callconv/s390x.rs +++ b/compiler/rustc_target/src/callconv/s390x.rs @@ -1,8 +1,9 @@ // Reference: ELF Application Binary Interface s390x Supplement // https://github.com/IBM/s390x-abi +use rustc_abi::{BackendRepr, HasDataLayout, TyAbiInterface}; + use crate::abi::call::{ArgAbi, FnAbi, Reg, RegKind}; -use crate::abi::{BackendRepr, HasDataLayout, TyAbiInterface}; use crate::spec::HasTargetSpec; fn classify_ret(ret: &mut ArgAbi<'_, Ty>) { diff --git a/compiler/rustc_target/src/callconv/sparc.rs b/compiler/rustc_target/src/callconv/sparc.rs index 37980a91c7601..f7d688221552b 100644 --- a/compiler/rustc_target/src/callconv/sparc.rs +++ b/compiler/rustc_target/src/callconv/sparc.rs @@ -1,5 +1,6 @@ +use rustc_abi::{HasDataLayout, Size}; + use crate::abi::call::{ArgAbi, FnAbi, Reg, Uniform}; -use crate::abi::{HasDataLayout, Size}; fn classify_ret(cx: &C, ret: &mut ArgAbi<'_, Ty>, offset: &mut Size) where diff --git a/compiler/rustc_target/src/callconv/sparc64.rs b/compiler/rustc_target/src/callconv/sparc64.rs index 313d8730399b2..392fb5156fce4 100644 --- a/compiler/rustc_target/src/callconv/sparc64.rs +++ b/compiler/rustc_target/src/callconv/sparc64.rs @@ -1,9 +1,13 @@ // FIXME: This needs an audit for correctness and completeness. +use rustc_abi::{ + BackendRepr, FieldsShape, Float, HasDataLayout, Primitive, Reg, Scalar, Size, TyAbiInterface, + TyAndLayout, +}; + use crate::abi::call::{ - ArgAbi, ArgAttribute, ArgAttributes, ArgExtension, CastTarget, FnAbi, Reg, Uniform, + ArgAbi, ArgAttribute, ArgAttributes, ArgExtension, CastTarget, FnAbi, Uniform, }; -use crate::abi::{self, HasDataLayout, Scalar, Size, TyAbiInterface, TyAndLayout}; use crate::spec::HasTargetSpec; #[derive(Clone, Debug)] @@ -21,7 +25,7 @@ where { let dl = cx.data_layout(); - if !matches!(scalar.primitive(), abi::Float(abi::F32 | abi::F64)) { + if !matches!(scalar.primitive(), Primitive::Float(Float::F32 | Float::F64)) { return data; } @@ -57,7 +61,7 @@ where return data; } - if scalar.primitive() == abi::Float(abi::F32) { + if scalar.primitive() == Primitive::Float(Float::F32) { data.arg_attribute = ArgAttribute::InReg; data.prefix[data.prefix_index] = Some(Reg::f32()); data.last_offset = offset + Reg::f32().size; @@ -81,14 +85,16 @@ where { data = arg_scalar(cx, scalar1, offset, data); match (scalar1.primitive(), scalar2.primitive()) { - (abi::Float(abi::F32), _) => offset += Reg::f32().size, - (_, abi::Float(abi::F64)) => offset += Reg::f64().size, - (abi::Int(i, _signed), _) => offset += i.size(), - (abi::Pointer(_), _) => offset += Reg::i64().size, + (Primitive::Float(Float::F32), _) => offset += Reg::f32().size, + (_, Primitive::Float(Float::F64)) => offset += Reg::f64().size, + (Primitive::Int(i, _signed), _) => offset += i.size(), + (Primitive::Pointer(_), _) => offset += Reg::i64().size, _ => {} } - if (offset.bytes() % 4) != 0 && matches!(scalar2.primitive(), abi::Float(abi::F32 | abi::F64)) { + if (offset.bytes() % 4) != 0 + && matches!(scalar2.primitive(), Primitive::Float(Float::F32 | Float::F64)) + { offset += Size::from_bytes(4 - (offset.bytes() % 4)); } data = arg_scalar(cx, scalar2, offset, data); @@ -105,15 +111,15 @@ where Ty: TyAbiInterface<'a, C> + Copy, C: HasDataLayout, { - if let abi::FieldsShape::Union(_) = layout.fields { + if let FieldsShape::Union(_) = layout.fields { return data; } match layout.backend_repr { - abi::BackendRepr::Scalar(scalar) => { + BackendRepr::Scalar(scalar) => { data = arg_scalar(cx, &scalar, offset, data); } - abi::BackendRepr::Memory { .. } => { + BackendRepr::Memory { .. } => { for i in 0..layout.fields.count() { if offset < layout.fields.offset(i) { offset = layout.fields.offset(i); @@ -122,7 +128,7 @@ where } } _ => { - if let abi::BackendRepr::ScalarPair(scalar1, scalar2) = &layout.backend_repr { + if let BackendRepr::ScalarPair(scalar1, scalar2) = &layout.backend_repr { data = arg_scalar_pair(cx, scalar1, scalar2, offset, data); } } @@ -148,16 +154,16 @@ where } match arg.layout.fields { - abi::FieldsShape::Primitive => unreachable!(), - abi::FieldsShape::Array { .. } => { + FieldsShape::Primitive => unreachable!(), + FieldsShape::Array { .. } => { // Arrays are passed indirectly arg.make_indirect(); return; } - abi::FieldsShape::Union(_) => { + FieldsShape::Union(_) => { // Unions and are always treated as a series of 64-bit integer chunks } - abi::FieldsShape::Arbitrary { .. } => { + FieldsShape::Arbitrary { .. } => { // Structures with floating point numbers need special care. let mut data = parse_structure( diff --git a/compiler/rustc_target/src/callconv/wasm.rs b/compiler/rustc_target/src/callconv/wasm.rs index d01b59cbb032b..56cd7a3f93de7 100644 --- a/compiler/rustc_target/src/callconv/wasm.rs +++ b/compiler/rustc_target/src/callconv/wasm.rs @@ -1,7 +1,6 @@ -use rustc_abi::{BackendRepr, Float, Integer, Primitive}; +use rustc_abi::{BackendRepr, Float, HasDataLayout, Integer, Primitive, TyAbiInterface}; use crate::abi::call::{ArgAbi, FnAbi}; -use crate::abi::{HasDataLayout, TyAbiInterface}; fn unwrap_trivial_aggregate<'a, Ty, C>(cx: &C, val: &mut ArgAbi<'a, Ty>) -> bool where diff --git a/compiler/rustc_target/src/callconv/x86.rs b/compiler/rustc_target/src/callconv/x86.rs index cd8465c09ca98..7c88d9b55cfee 100644 --- a/compiler/rustc_target/src/callconv/x86.rs +++ b/compiler/rustc_target/src/callconv/x86.rs @@ -1,9 +1,10 @@ -use crate::abi::call::{ArgAttribute, FnAbi, PassMode, Reg, RegKind}; -use crate::abi::{ - AddressSpace, Align, BackendRepr, Float, HasDataLayout, Pointer, TyAbiInterface, TyAndLayout, +use rustc_abi::{ + AddressSpace, Align, BackendRepr, ExternAbi, HasDataLayout, Primitive, Reg, RegKind, + TyAbiInterface, TyAndLayout, }; + +use crate::abi::call::{ArgAttribute, FnAbi, PassMode}; use crate::spec::HasTargetSpec; -use crate::spec::abi::Abi as SpecAbi; #[derive(PartialEq)] pub(crate) enum Flavor { @@ -214,7 +215,7 @@ pub(crate) fn fill_inregs<'a, Ty, C>( } } -pub(crate) fn compute_rust_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, abi: SpecAbi) +pub(crate) fn compute_rust_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, abi: ExternAbi) where Ty: TyAbiInterface<'a, C> + Copy, C: HasDataLayout + HasTargetSpec, @@ -223,18 +224,19 @@ where // registers will quiet signalling NaNs. Also avoid using SSE registers since they // are not always available (depending on target features). if !fn_abi.ret.is_ignore() - // Intrinsics themselves are not actual "real" functions, so theres no need to change their ABIs. - && abi != SpecAbi::RustIntrinsic + // Intrinsics themselves are not "real" functions, so theres no need to change their ABIs. + && abi != ExternAbi::RustIntrinsic { let has_float = match fn_abi.ret.layout.backend_repr { - BackendRepr::Scalar(s) => matches!(s.primitive(), Float(_)), + BackendRepr::Scalar(s) => matches!(s.primitive(), Primitive::Float(_)), BackendRepr::ScalarPair(s1, s2) => { - matches!(s1.primitive(), Float(_)) || matches!(s2.primitive(), Float(_)) + matches!(s1.primitive(), Primitive::Float(_)) + || matches!(s2.primitive(), Primitive::Float(_)) } _ => false, // anyway not passed via registers on x86 }; if has_float { - if fn_abi.ret.layout.size <= Pointer(AddressSpace::DATA).size(cx) { + if fn_abi.ret.layout.size <= Primitive::Pointer(AddressSpace::DATA).size(cx) { // Same size or smaller than pointer, return in a register. fn_abi.ret.cast_to(Reg { kind: RegKind::Integer, size: fn_abi.ret.layout.size }); } else { diff --git a/compiler/rustc_target/src/callconv/x86_64.rs b/compiler/rustc_target/src/callconv/x86_64.rs index 37aecf323a182..6e9b4690a2cfd 100644 --- a/compiler/rustc_target/src/callconv/x86_64.rs +++ b/compiler/rustc_target/src/callconv/x86_64.rs @@ -1,10 +1,12 @@ // The classification code for the x86_64 ABI is taken from the clay language // https://github.com/jckarter/clay/blob/db0bd2702ab0b6e48965cd85f8859bbd5f60e48e/compiler/externals.cpp -use rustc_abi::{BackendRepr, HasDataLayout, Size, TyAbiInterface, TyAndLayout}; +use rustc_abi::{ + BackendRepr, HasDataLayout, Primitive, Reg, RegKind, Size, TyAbiInterface, TyAndLayout, + Variants, +}; -use crate::abi; -use crate::abi::call::{ArgAbi, CastTarget, FnAbi, Reg, RegKind}; +use crate::abi::call::{ArgAbi, CastTarget, FnAbi}; /// Classification of "eightbyte" components. // N.B., the order of the variants is from general to specific, @@ -52,8 +54,8 @@ where BackendRepr::Uninhabited => return Ok(()), BackendRepr::Scalar(scalar) => match scalar.primitive() { - abi::Int(..) | abi::Pointer(_) => Class::Int, - abi::Float(_) => Class::Sse, + Primitive::Int(..) | Primitive::Pointer(_) => Class::Int, + Primitive::Float(_) => Class::Sse, }, BackendRepr::Vector { .. } => Class::Sse, @@ -65,8 +67,8 @@ where } match &layout.variants { - abi::Variants::Single { .. } | abi::Variants::Empty => {} - abi::Variants::Multiple { variants, .. } => { + Variants::Single { .. } | Variants::Empty => {} + Variants::Multiple { variants, .. } => { // Treat enum variants like union members. for variant_idx in variants.indices() { classify(cx, layout.for_variant(cx, variant_idx), cls, off)?; diff --git a/compiler/rustc_target/src/callconv/xtensa.rs b/compiler/rustc_target/src/callconv/xtensa.rs index 9d313d1650032..2542713bc11b3 100644 --- a/compiler/rustc_target/src/callconv/xtensa.rs +++ b/compiler/rustc_target/src/callconv/xtensa.rs @@ -5,8 +5,9 @@ //! Section 8.1.4 & 8.1.5 of the Xtensa ISA reference manual, as well as snippets from //! Section 2.3 from the Xtensa programmers guide. +use rustc_abi::{BackendRepr, HasDataLayout, Size, TyAbiInterface}; + use crate::abi::call::{ArgAbi, FnAbi, Reg, Uniform}; -use crate::abi::{BackendRepr, HasDataLayout, Size, TyAbiInterface}; use crate::spec::HasTargetSpec; const NUM_ARG_GPRS: u64 = 6; diff --git a/compiler/rustc_target/src/lib.rs b/compiler/rustc_target/src/lib.rs index 50679ab8cc81c..11fc09d26e4f9 100644 --- a/compiler/rustc_target/src/lib.rs +++ b/compiler/rustc_target/src/lib.rs @@ -31,10 +31,7 @@ pub mod target_features; mod tests; pub mod abi { - pub(crate) use Float::*; - pub(crate) use Primitive::*; - // Explicitly import `Float` to avoid ambiguity with `Primitive::Float`. - pub use rustc_abi::{Float, *}; + pub use rustc_abi::*; pub use crate::callconv as call; } diff --git a/compiler/rustc_target/src/spec/base/aix.rs b/compiler/rustc_target/src/spec/base/aix.rs index fe37d313294d2..a92d104f9108e 100644 --- a/compiler/rustc_target/src/spec/base/aix.rs +++ b/compiler/rustc_target/src/spec/base/aix.rs @@ -1,4 +1,5 @@ -use crate::abi::Endian; +use rustc_abi::Endian; + use crate::spec::{Cc, CodeModel, LinkOutputKind, LinkerFlavor, TargetOptions, crt_objects, cvs}; pub(crate) fn opts() -> TargetOptions { diff --git a/compiler/rustc_target/src/spec/base/bpf.rs b/compiler/rustc_target/src/spec/base/bpf.rs index 17d5e75ef6d01..7c0e2e165b649 100644 --- a/compiler/rustc_target/src/spec/base/bpf.rs +++ b/compiler/rustc_target/src/spec/base/bpf.rs @@ -1,4 +1,5 @@ -use crate::abi::Endian; +use rustc_abi::Endian; + use crate::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, TargetOptions}; pub(crate) fn opts(endian: Endian) -> TargetOptions { diff --git a/compiler/rustc_target/src/spec/base/xtensa.rs b/compiler/rustc_target/src/spec/base/xtensa.rs index 280dd16e26453..47a532dfdd48d 100644 --- a/compiler/rustc_target/src/spec/base/xtensa.rs +++ b/compiler/rustc_target/src/spec/base/xtensa.rs @@ -1,4 +1,5 @@ -use crate::abi::Endian; +use rustc_abi::Endian; + use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, TargetOptions}; pub(crate) fn opts() -> TargetOptions { diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 72600225e7a38..e95c4dbd2cffd 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -42,6 +42,7 @@ use std::path::{Path, PathBuf}; use std::str::FromStr; use std::{fmt, io}; +use rustc_abi::{Endian, ExternAbi, Integer, Size, TargetDataLayout, TargetDataLayoutErrors}; use rustc_data_structures::fx::FxHashSet; use rustc_fs_util::try_canonicalize; use rustc_macros::{Decodable, Encodable, HashStable_Generic}; @@ -51,9 +52,7 @@ use serde_json::Value; use tracing::debug; use crate::abi::call::Conv; -use crate::abi::{Endian, Integer, Size, TargetDataLayout, TargetDataLayoutErrors}; use crate::json::{Json, ToJson}; -use crate::spec::abi::Abi; use crate::spec::crt_objects::CrtObjects; pub mod crt_objects; @@ -1651,7 +1650,7 @@ macro_rules! supported_targets { } /// List of supported targets - pub const TARGETS: &[&str] = &[$($tuple),+]; + pub static TARGETS: &[&str] = &[$($tuple),+]; fn load_builtin(target: &str) -> Option { let t = match target { @@ -2845,44 +2844,40 @@ impl DerefMut for Target { impl Target { /// Given a function ABI, turn it into the correct ABI for this target. - pub fn adjust_abi(&self, abi: Abi, c_variadic: bool) -> Abi { + pub fn adjust_abi(&self, abi: ExternAbi, c_variadic: bool) -> ExternAbi { + use ExternAbi::*; match abi { // On Windows, `extern "system"` behaves like msvc's `__stdcall`. // `__stdcall` only applies on x86 and on non-variadic functions: // https://learn.microsoft.com/en-us/cpp/cpp/stdcall?view=msvc-170 - Abi::System { unwind } if self.is_like_windows && self.arch == "x86" && !c_variadic => { - Abi::Stdcall { unwind } + System { unwind } if self.is_like_windows && self.arch == "x86" && !c_variadic => { + Stdcall { unwind } } - Abi::System { unwind } => Abi::C { unwind }, - Abi::EfiApi if self.arch == "arm" => Abi::Aapcs { unwind: false }, - Abi::EfiApi if self.arch == "x86_64" => Abi::Win64 { unwind: false }, - Abi::EfiApi => Abi::C { unwind: false }, - - // See commentary in `is_abi_supported`: we map these ABIs to "C" when they do not make sense. - Abi::Stdcall { .. } | Abi::Thiscall { .. } | Abi::Fastcall { .. } - if self.arch == "x86" => - { - abi - } - Abi::Vectorcall { .. } if ["x86", "x86_64"].contains(&&self.arch[..]) => abi, - Abi::Stdcall { unwind } - | Abi::Thiscall { unwind } - | Abi::Fastcall { unwind } - | Abi::Vectorcall { unwind } => Abi::C { unwind }, + System { unwind } => C { unwind }, + EfiApi if self.arch == "arm" => Aapcs { unwind: false }, + EfiApi if self.arch == "x86_64" => Win64 { unwind: false }, + EfiApi => C { unwind: false }, + + // See commentary in `is_abi_supported`. + Stdcall { .. } | Thiscall { .. } if self.arch == "x86" => abi, + Stdcall { unwind } | Thiscall { unwind } => C { unwind }, + Fastcall { .. } if self.arch == "x86" => abi, + Vectorcall { .. } if ["x86", "x86_64"].contains(&&self.arch[..]) => abi, + Fastcall { unwind } | Vectorcall { unwind } => C { unwind }, // The Windows x64 calling convention we use for `extern "Rust"` // // expects the callee to save `xmm6` through `xmm15`, but `PreserveMost` // (that we use by default for `extern "rust-cold"`) doesn't save any of those. // So to avoid bloating callers, just use the Rust convention here. - Abi::RustCold if self.is_like_windows && self.arch == "x86_64" => Abi::Rust, + RustCold if self.is_like_windows && self.arch == "x86_64" => Rust, abi => abi, } } - pub fn is_abi_supported(&self, abi: Abi) -> bool { - use Abi::*; + pub fn is_abi_supported(&self, abi: ExternAbi) -> bool { + use ExternAbi::*; match abi { Rust | C { .. } diff --git a/compiler/rustc_target/src/target_features.rs b/compiler/rustc_target/src/target_features.rs index eb2417e0a20a3..e423ca71dfcbb 100644 --- a/compiler/rustc_target/src/target_features.rs +++ b/compiler/rustc_target/src/target_features.rs @@ -131,7 +131,7 @@ impl Stability { // Both of these are also applied transitively. type ImpliedFeatures = &'static [&'static str]; -const ARM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ +static ARM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-start ("aclass", Unstable(sym::arm_target_feature), &[]), ("aes", Unstable(sym::arm_target_feature), &["neon"]), @@ -175,7 +175,7 @@ const ARM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-end ]; -const AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ +static AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-start // FEAT_AES & FEAT_PMULL ("aes", Stable, &["neon"]), @@ -371,7 +371,7 @@ const AARCH64_TIED_FEATURES: &[&[&str]] = &[ &["paca", "pacg"], // Together these represent `pauth` in LLVM ]; -const X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ +static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-start ("adx", Stable, &[]), ("aes", Stable, &["sse2"]), @@ -453,7 +453,7 @@ const HEXAGON_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-end ]; -const POWERPC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ +static POWERPC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-start ("altivec", Unstable(sym::powerpc_target_feature), &[]), ("partword-atomics", Unstable(sym::powerpc_target_feature), &[]), @@ -476,7 +476,7 @@ const MIPS_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-end ]; -const RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ +static RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-start ("a", Stable, &["zaamo", "zalrsc"]), ("c", Stable, &[]), @@ -521,7 +521,7 @@ const RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-end ]; -const WASM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ +static WASM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-start ("atomics", Unstable(sym::wasm_target_feature), &[]), ("bulk-memory", Stable, &[]), @@ -542,7 +542,7 @@ const WASM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ const BPF_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[("alu32", Unstable(sym::bpf_target_feature), &[])]; -const CSKY_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ +static CSKY_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-start ("10e60", Unstable(sym::csky_target_feature), &["7e10"]), ("2e3", Unstable(sym::csky_target_feature), &["e2"]), @@ -589,7 +589,7 @@ const CSKY_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-end ]; -const LOONGARCH_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ +static LOONGARCH_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-start ("d", Unstable(sym::loongarch_target_feature), &["f"]), ("f", Unstable(sym::loongarch_target_feature), &[]), @@ -618,7 +618,7 @@ const SPARC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-end ]; -const M68K_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ +static M68K_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ // tidy-alphabetical-start ("isa-68000", Unstable(sym::m68k_target_feature), &[]), ("isa-68010", Unstable(sym::m68k_target_feature), &["isa-68000"]), diff --git a/library/std/src/io/cursor.rs b/library/std/src/io/cursor.rs index b2ffeb0f95d0d..606099c8bc67a 100644 --- a/library/std/src/io/cursor.rs +++ b/library/std/src/io/cursor.rs @@ -153,7 +153,7 @@ impl Cursor { /// let reference = buff.get_mut(); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_mut_cursor", issue = "130801")] + #[rustc_const_stable(feature = "const_mut_cursor", since = "CURRENT_RUSTC_VERSION")] pub const fn get_mut(&mut self) -> &mut T { &mut self.inner } @@ -201,7 +201,7 @@ impl Cursor { /// assert_eq!(buff.position(), 4); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_mut_cursor", issue = "130801")] + #[rustc_const_stable(feature = "const_mut_cursor", since = "CURRENT_RUSTC_VERSION")] pub const fn set_position(&mut self, pos: u64) { self.pos = pos; } diff --git a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile index 6c9071b4191ee..03ec77f507e75 100644 --- a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile @@ -56,9 +56,9 @@ ENV \ CFLAGS_x86_64_fortanix_unknown_sgx="-D__ELF__ -isystem/usr/include/x86_64-linux-gnu -mlvi-hardening -mllvm -x86-experimental-lvi-inline-asm-hardening" \ CXX_x86_64_fortanix_unknown_sgx=clang++-11 \ CXXFLAGS_x86_64_fortanix_unknown_sgx="-D__ELF__ -isystem/usr/include/x86_64-linux-gnu -mlvi-hardening -mllvm -x86-experimental-lvi-inline-asm-hardening" \ - AR_i686_unknown_freebsd=i686-unknown-freebsd13-ar \ - CC_i686_unknown_freebsd=i686-unknown-freebsd13-clang \ - CXX_i686_unknown_freebsd=i686-unknown-freebsd13-clang++ \ + AR_i686_unknown_freebsd=i686-unknown-freebsd12-ar \ + CC_i686_unknown_freebsd=i686-unknown-freebsd12-clang \ + CXX_i686_unknown_freebsd=i686-unknown-freebsd12-clang++ \ CC_aarch64_unknown_uefi=clang-11 \ CXX_aarch64_unknown_uefi=clang++-11 \ CC_i686_unknown_uefi=clang-11 \ diff --git a/src/ci/docker/host-x86_64/dist-x86_64-freebsd/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-freebsd/Dockerfile index fd0f5da8c495a..f42e6f770ebe8 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-freebsd/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-freebsd/Dockerfile @@ -29,9 +29,9 @@ COPY scripts/cmake.sh /scripts/ RUN /scripts/cmake.sh ENV \ - AR_x86_64_unknown_freebsd=x86_64-unknown-freebsd13-ar \ - CC_x86_64_unknown_freebsd=x86_64-unknown-freebsd13-clang \ - CXX_x86_64_unknown_freebsd=x86_64-unknown-freebsd13-clang++ + AR_x86_64_unknown_freebsd=x86_64-unknown-freebsd12-ar \ + CC_x86_64_unknown_freebsd=x86_64-unknown-freebsd12-clang \ + CXX_x86_64_unknown_freebsd=x86_64-unknown-freebsd12-clang++ ENV HOSTS=x86_64-unknown-freebsd diff --git a/src/ci/docker/scripts/freebsd-toolchain.sh b/src/ci/docker/scripts/freebsd-toolchain.sh index b927658b4fdc2..0d02636db9196 100755 --- a/src/ci/docker/scripts/freebsd-toolchain.sh +++ b/src/ci/docker/scripts/freebsd-toolchain.sh @@ -5,8 +5,8 @@ set -eux arch=$1 binutils_version=2.40 -freebsd_version=13.4 -triple=$arch-unknown-freebsd13 +freebsd_version=12.3 +triple=$arch-unknown-freebsd12 sysroot=/usr/local/$triple hide_output() { @@ -59,7 +59,7 @@ done # Originally downloaded from: # URL=https://download.freebsd.org/ftp/releases/${freebsd_arch}/${freebsd_version}-RELEASE/base.txz -URL=https://ci-mirrors.rust-lang.org/rustc/2024-09-13-freebsd-${freebsd_version}-${freebsd_arch}-base.txz +URL=https://ci-mirrors.rust-lang.org/rustc/2022-05-06-freebsd-${freebsd_version}-${freebsd_arch}-base.txz curl "$URL" | tar xJf - -C "$sysroot" --wildcards "${files_to_extract[@]}" # Clang can do cross-builds out of the box, if we give it the right diff --git a/tests/crashes/134336.rs b/tests/crashes/134336.rs deleted file mode 100644 index 14b88e14f04f0..0000000000000 --- a/tests/crashes/134336.rs +++ /dev/null @@ -1,11 +0,0 @@ -//@ known-bug: #134336 -#![expect(incomplete_features)] -#![feature(explicit_tail_calls)] - -trait Tr { - fn f(); -} - -fn g() { - become T::f(); -} diff --git a/tests/ui/associated-consts/issue-93775.rs b/tests/ui/associated-consts/issue-93775.rs index 88e88b559870f..114c55dfce281 100644 --- a/tests/ui/associated-consts/issue-93775.rs +++ b/tests/ui/associated-consts/issue-93775.rs @@ -1,11 +1,9 @@ -//@ ignore-rustc-debug-assertions -// Similar to stress testing, the test case requires a larger call stack, -// so we ignore rustc's debug assertions. +// Regression for #93775, needs build-pass to test it. //@ build-pass -// ignore-tidy-linelength - -// Regression for #93775, needs build-pass to test it. +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver #![recursion_limit = "1001"] @@ -14,7 +12,64 @@ use std::marker::PhantomData; struct Z; struct S(PhantomData); -type Nested = S>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>; +type Nested = S>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>; trait AsNum { const NUM: u32; diff --git a/tests/ui/explicit-tail-calls/become-trait-fn.rs b/tests/ui/explicit-tail-calls/become-trait-fn.rs new file mode 100644 index 0000000000000..03255f15dd04b --- /dev/null +++ b/tests/ui/explicit-tail-calls/become-trait-fn.rs @@ -0,0 +1,19 @@ +// regression test for +// this previously caused an ICE, because we would compare `#[track_caller]` of +// the callee and the caller (in tailcalls specifically), leading to a problem +// since `T::f`'s instance can't be resolved (we do not know if the function is +// or isn't marked with `#[track_caller]`!) +// +//@ check-pass +#![expect(incomplete_features)] +#![feature(explicit_tail_calls)] + +trait Tr { + fn f(); +} + +fn g() { + become T::f(); +} + +fn main() {} diff --git a/tests/ui/explicit-tail-calls/callee_is_track_caller.rs b/tests/ui/explicit-tail-calls/callee_is_track_caller.rs new file mode 100644 index 0000000000000..bcb93fda8c856 --- /dev/null +++ b/tests/ui/explicit-tail-calls/callee_is_track_caller.rs @@ -0,0 +1,15 @@ +//@ check-pass +// FIXME(explicit_tail_calls): make this run-pass, once tail calls are properly implemented +#![expect(incomplete_features)] +#![feature(explicit_tail_calls)] + +fn a(x: u32) -> u32 { + become b(x); +} + +#[track_caller] +fn b(x: u32) -> u32 { x + 42 } + +fn main() { + assert_eq!(a(12), 54); +} diff --git a/tests/ui/explicit-tail-calls/caller_is_track_caller.rs b/tests/ui/explicit-tail-calls/caller_is_track_caller.rs new file mode 100644 index 0000000000000..4e5f3f12f8399 --- /dev/null +++ b/tests/ui/explicit-tail-calls/caller_is_track_caller.rs @@ -0,0 +1,16 @@ +#![expect(incomplete_features)] +#![feature(explicit_tail_calls)] + +#[track_caller] +fn a() { + become b(); //~ error: a function marked with `#[track_caller]` cannot perform a tail-call +} + +fn b() {} + +#[track_caller] +fn c() { + become a(); //~ error: a function marked with `#[track_caller]` cannot perform a tail-call +} + +fn main() {} diff --git a/tests/ui/explicit-tail-calls/caller_is_track_caller.stderr b/tests/ui/explicit-tail-calls/caller_is_track_caller.stderr new file mode 100644 index 0000000000000..79b9b45986c47 --- /dev/null +++ b/tests/ui/explicit-tail-calls/caller_is_track_caller.stderr @@ -0,0 +1,14 @@ +error: a function marked with `#[track_caller]` cannot perform a tail-call + --> $DIR/caller_is_track_caller.rs:6:5 + | +LL | become b(); + | ^^^^^^^^^^ + +error: a function marked with `#[track_caller]` cannot perform a tail-call + --> $DIR/caller_is_track_caller.rs:13:5 + | +LL | become a(); + | ^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/triagebot.toml b/triagebot.toml index 49cf1213987a1..3caf4e9fb1e15 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -236,6 +236,15 @@ trigger_files = [ "src/tools/jsondoclint", ] +[autolabel."A-attributes"] +trigger_files = [ + "compiler/rustc_codegen_ssa/src/codegen_attrs.rs", + "compiler/rustc_passes/src/check_attr.rs", + "compiler/rustc_attr_parsing", + "compiler/rustc_attr_data_structures", + "compiler/rustc_attr_validation", +] + [autolabel."T-compiler"] trigger_files = [ # Source code @@ -1017,6 +1026,17 @@ cc = ["@ehuss"] message = "The rustc-dev-guide subtree was changed. If this PR *only* touches the dev guide consider submitting a PR directly to [rust-lang/rustc-dev-guide](https://github.com/rust-lang/rustc-dev-guide/pulls) otherwise thank you for updating the dev guide with your changes." cc = ["@BoxyUwU", "@jieyouxu", "@kobzol"] +[mentions."compiler/rustc_codegen_ssa/src/codegen_attrs.rs"] +cc = ["@jdonszelmann"] +[mentions."compiler/rustc_passes/src/check_attr.rs"] +cc = ["@jdonszelmann"] +[mentions."compiler/rustc_attr_parsing"] +cc = ["@jdonszelmann"] +[mentions."compiler/rustc_attr_data_structures"] +cc = ["@jdonszelmann"] +[mentions."compiler/rustc_attr_validation"] +cc = ["@jdonszelmann"] + [assign] warn_non_default_branch.enable = true contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html"