Skip to content

Commit 0d59978

Browse files
committed
Auto merge of rust-lang#140078 - ChrisDenton:rollup-nogircc, r=ChrisDenton
Rollup of 5 pull requests Successful merges: - rust-lang#138870 (Add target-specific NaN payloads for the missing tier 2 targets) - rust-lang#139309 (make abi_unsupported_vector_types a hard error) - rust-lang#140063 (Remove stray newline from post-merge report) - rust-lang#140067 (Remove (now unused) #[rustc_macro_edition_2021] attribute) - rust-lang#140068 (replace broken links armv7-rtems-eabihf.md) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 49e5e4e + 232b0e5 commit 0d59978

File tree

30 files changed

+133
-1001
lines changed

30 files changed

+133
-1001
lines changed

compiler/rustc_attr_data_structures/src/attributes.rs

-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ pub enum AttributeKind {
191191
},
192192
MacroTransparency(Transparency),
193193
Repr(ThinVec<(ReprAttr, Span)>),
194-
RustcMacroEdition2021,
195194
Stability {
196195
stability: Stability,
197196
/// Span of the `#[stable(...)]` or `#[unstable(...)]` attribute

compiler/rustc_attr_parsing/src/attributes/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pub(crate) mod cfg;
2828
pub(crate) mod confusables;
2929
pub(crate) mod deprecation;
3030
pub(crate) mod repr;
31-
pub(crate) mod rustc;
3231
pub(crate) mod stability;
3332
pub(crate) mod transparency;
3433
pub(crate) mod util;

compiler/rustc_attr_parsing/src/attributes/rustc.rs

-19
This file was deleted.

compiler/rustc_attr_parsing/src/context.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use crate::attributes::allow_unstable::{AllowConstFnUnstableParser, AllowInterna
1515
use crate::attributes::confusables::ConfusablesParser;
1616
use crate::attributes::deprecation::DeprecationParser;
1717
use crate::attributes::repr::ReprParser;
18-
use crate::attributes::rustc::RustcMacroEdition2021Parser;
1918
use crate::attributes::stability::{
2019
BodyStabilityParser, ConstStabilityIndirectParser, ConstStabilityParser, StabilityParser,
2120
};
@@ -77,7 +76,6 @@ attribute_groups!(
7776
// tidy-alphabetical-start
7877
Single<ConstStabilityIndirectParser>,
7978
Single<DeprecationParser>,
80-
Single<RustcMacroEdition2021Parser>,
8179
Single<TransparencyParser>,
8280
// tidy-alphabetical-end
8381
];

compiler/rustc_codegen_cranelift/example/std_example.rs

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
unboxed_closures
99
)]
1010
#![allow(internal_features)]
11-
// FIXME once abi_unsupported_vector_types is a hard error disable the foo test when the respective
12-
// target feature is not enabled.
13-
#![allow(abi_unsupported_vector_types)]
1411

1512
#[cfg(target_arch = "x86_64")]
1613
use std::arch::x86_64::*;

compiler/rustc_feature/src/builtin_attrs.rs

-8
Original file line numberDiff line numberDiff line change
@@ -676,14 +676,6 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
676676
"`rustc_never_type_options` is used to experiment with never type fallback and work on \
677677
never type stabilization, and will never be stable"
678678
),
679-
rustc_attr!(
680-
rustc_macro_edition_2021,
681-
Normal,
682-
template!(Word),
683-
ErrorFollowing,
684-
EncodeCrossCrate::No,
685-
"makes spans in this macro edition 2021"
686-
),
687679

688680
// ==========================================================================
689681
// Internal attributes: Runtime related:

compiler/rustc_lint/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,11 @@ fn register_builtins(store: &mut LintStore) {
608608
"converted into hard error, see PR #139001 \
609609
<https://github.com/rust-lang/rust/issues/139001> for more information",
610610
);
611+
store.register_removed(
612+
"abi_unsupported_vector_types",
613+
"converted into hard error, \
614+
see <https://github.com/rust-lang/rust/issues/116558> for more information",
615+
);
611616
}
612617

613618
fn register_internals(store: &mut LintStore) {

compiler/rustc_lint_defs/src/builtin.rs

-69
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ declare_lint_pass! {
1616
/// that are used by other parts of the compiler.
1717
HardwiredLints => [
1818
// tidy-alphabetical-start
19-
ABI_UNSUPPORTED_VECTOR_TYPES,
2019
ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE,
2120
AMBIGUOUS_ASSOCIATED_ITEMS,
2221
AMBIGUOUS_GLOB_IMPORTS,
@@ -5027,74 +5026,6 @@ declare_lint! {
50275026
crate_level_only
50285027
}
50295028

5030-
declare_lint! {
5031-
/// The `abi_unsupported_vector_types` lint detects function definitions and calls
5032-
/// whose ABI depends on enabling certain target features, but those features are not enabled.
5033-
///
5034-
/// ### Example
5035-
///
5036-
/// ```rust,ignore (fails on non-x86_64)
5037-
/// extern "C" fn missing_target_feature(_: std::arch::x86_64::__m256) {
5038-
/// todo!()
5039-
/// }
5040-
///
5041-
/// #[target_feature(enable = "avx")]
5042-
/// unsafe extern "C" fn with_target_feature(_: std::arch::x86_64::__m256) {
5043-
/// todo!()
5044-
/// }
5045-
///
5046-
/// fn main() {
5047-
/// let v = unsafe { std::mem::zeroed() };
5048-
/// unsafe { with_target_feature(v); }
5049-
/// }
5050-
/// ```
5051-
///
5052-
/// This will produce:
5053-
///
5054-
/// ```text
5055-
/// warning: ABI error: this function call uses a avx vector type, which is not enabled in the caller
5056-
/// --> lint_example.rs:18:12
5057-
/// |
5058-
/// | unsafe { with_target_feature(v); }
5059-
/// | ^^^^^^^^^^^^^^^^^^^^^^ function called here
5060-
/// |
5061-
/// = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
5062-
/// = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
5063-
/// = help: consider enabling it globally (-C target-feature=+avx) or locally (#[target_feature(enable="avx")])
5064-
/// = note: `#[warn(abi_unsupported_vector_types)]` on by default
5065-
///
5066-
///
5067-
/// warning: ABI error: this function definition uses a avx vector type, which is not enabled
5068-
/// --> lint_example.rs:3:1
5069-
/// |
5070-
/// | pub extern "C" fn with_target_feature(_: std::arch::x86_64::__m256) {
5071-
/// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
5072-
/// |
5073-
/// = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
5074-
/// = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
5075-
/// = help: consider enabling it globally (-C target-feature=+avx) or locally (#[target_feature(enable="avx")])
5076-
/// ```
5077-
///
5078-
///
5079-
///
5080-
/// ### Explanation
5081-
///
5082-
/// The C ABI for `__m256` requires the value to be passed in an AVX register,
5083-
/// which is only possible when the `avx` target feature is enabled.
5084-
/// Therefore, `missing_target_feature` cannot be compiled without that target feature.
5085-
/// A similar (but complementary) message is triggered when `with_target_feature` is called
5086-
/// by a function that does not enable the `avx` target feature.
5087-
///
5088-
/// Note that this lint is very similar to the `-Wpsabi` warning in `gcc`/`clang`.
5089-
pub ABI_UNSUPPORTED_VECTOR_TYPES,
5090-
Warn,
5091-
"this function call or definition uses a vector type which is not enabled",
5092-
@future_incompatible = FutureIncompatibleInfo {
5093-
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
5094-
reference: "issue #116558 <https://github.com/rust-lang/rust/issues/116558>",
5095-
};
5096-
}
5097-
50985029
declare_lint! {
50995030
/// The `wasm_c_abi` lint detects usage of the `extern "C"` ABI of wasm that is affected
51005031
/// by a planned ABI change that has the goal of aligning Rust with the standard C ABI

compiler/rustc_monomorphize/src/errors.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ pub(crate) struct UnknownCguCollectionMode<'a> {
7070
pub mode: &'a str,
7171
}
7272

73-
#[derive(LintDiagnostic)]
73+
#[derive(Diagnostic)]
7474
#[diag(monomorphize_abi_error_disabled_vector_type)]
7575
#[help]
7676
pub(crate) struct AbiErrorDisabledVectorType<'a> {
77+
#[primary_span]
7778
#[label]
7879
pub span: Span,
7980
pub required_feature: &'a str,
@@ -82,9 +83,10 @@ pub(crate) struct AbiErrorDisabledVectorType<'a> {
8283
pub is_call: bool,
8384
}
8485

85-
#[derive(LintDiagnostic)]
86+
#[derive(Diagnostic)]
8687
#[diag(monomorphize_abi_error_unsupported_vector_type)]
8788
pub(crate) struct AbiErrorUnsupportedVectorType<'a> {
89+
#[primary_span]
8890
#[label]
8991
pub span: Span,
9092
pub ty: Ty<'a>,

compiler/rustc_monomorphize/src/mono_checks/abi_check.rs

+12-22
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_hir::{CRATE_HIR_ID, HirId};
55
use rustc_middle::mir::{self, Location, traversal};
66
use rustc_middle::ty::layout::LayoutCx;
77
use rustc_middle::ty::{self, Instance, InstanceKind, Ty, TyCtxt, TypingEnv};
8-
use rustc_session::lint::builtin::{ABI_UNSUPPORTED_VECTOR_TYPES, WASM_C_ABI};
8+
use rustc_session::lint::builtin::WASM_C_ABI;
99
use rustc_span::def_id::DefId;
1010
use rustc_span::{DUMMY_SP, Span, Symbol, sym};
1111
use rustc_target::callconv::{ArgAbi, Conv, FnAbi, PassMode};
@@ -50,34 +50,24 @@ fn do_check_simd_vector_abi<'tcx>(
5050
let feature = match feature_def.iter().find(|(bits, _)| size.bits() <= *bits) {
5151
Some((_, feature)) => feature,
5252
None => {
53-
let (span, hir_id) = loc();
54-
tcx.emit_node_span_lint(
55-
ABI_UNSUPPORTED_VECTOR_TYPES,
56-
hir_id,
53+
let (span, _hir_id) = loc();
54+
tcx.dcx().emit_err(errors::AbiErrorUnsupportedVectorType {
5755
span,
58-
errors::AbiErrorUnsupportedVectorType {
59-
span,
60-
ty: arg_abi.layout.ty,
61-
is_call,
62-
},
63-
);
56+
ty: arg_abi.layout.ty,
57+
is_call,
58+
});
6459
continue;
6560
}
6661
};
6762
if !have_feature(Symbol::intern(feature)) {
6863
// Emit error.
69-
let (span, hir_id) = loc();
70-
tcx.emit_node_span_lint(
71-
ABI_UNSUPPORTED_VECTOR_TYPES,
72-
hir_id,
64+
let (span, _hir_id) = loc();
65+
tcx.dcx().emit_err(errors::AbiErrorDisabledVectorType {
7366
span,
74-
errors::AbiErrorDisabledVectorType {
75-
span,
76-
required_feature: feature,
77-
ty: arg_abi.layout.ty,
78-
is_call,
79-
},
80-
);
67+
required_feature: feature,
68+
ty: arg_abi.layout.ty,
69+
is_call,
70+
});
8171
}
8272
}
8373
}

compiler/rustc_resolve/src/macros.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::sync::Arc;
88
use rustc_ast::expand::StrippedCfgItem;
99
use rustc_ast::{self as ast, Crate, NodeId, attr};
1010
use rustc_ast_pretty::pprust;
11-
use rustc_attr_parsing::{AttributeKind, StabilityLevel, find_attr};
11+
use rustc_attr_parsing::StabilityLevel;
1212
use rustc_data_structures::intern::Interned;
1313
use rustc_errors::{Applicability, DiagCtxtHandle, StashKey};
1414
use rustc_expand::base::{
@@ -1128,13 +1128,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
11281128
edition,
11291129
);
11301130

1131-
// The #[rustc_macro_edition_2021] attribute is used by the pin!() macro
1132-
// as a temporary workaround for a regression in expressiveness in Rust 2024.
1133-
// See https://github.com/rust-lang/rust/issues/138718.
1134-
if find_attr!(attrs.iter(), AttributeKind::RustcMacroEdition2021) {
1135-
ext.edition = Edition::Edition2021;
1136-
}
1137-
11381131
if let Some(builtin_name) = ext.builtin_name {
11391132
// The macro was marked with `#[rustc_builtin_macro]`.
11401133
if let Some(builtin_ext_kind) = self.builtin_macros.get(&builtin_name) {

compiler/rustc_span/src/symbol.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1824,7 +1824,6 @@ symbols! {
18241824
rustc_lint_opt_ty,
18251825
rustc_lint_query_instability,
18261826
rustc_lint_untracked_query_information,
1827-
rustc_macro_edition_2021,
18281827
rustc_macro_transparency,
18291828
rustc_main,
18301829
rustc_mir,

compiler/rustc_target/src/target_features.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ const RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI: &'static [(u64, &'static str)] = &[
775775
(32768, "zvl32768b"),
776776
(65536, "zvl65536b"),
777777
];
778-
// Always warn on SPARC, as the necessary target features cannot be enabled in Rust at the moment.
778+
// Always error on SPARC, as the necessary target features cannot be enabled in Rust at the moment.
779779
const SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI: &'static [(u64, &'static str)] = &[/*(64, "vis")*/];
780780

781781
const HEXAGON_FEATURES_FOR_CORRECT_VECTOR_ABI: &'static [(u64, &'static str)] =

library/core/src/primitive_docs.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1307,10 +1307,12 @@ mod prim_f16 {}
13071307
// FIXME: Is there a better place to put this?
13081308
///
13091309
/// | `target_arch` | Extra payloads possible on this platform |
1310-
/// |---------------|---------|
1311-
/// | `x86`, `x86_64`, `arm`, `aarch64`, `riscv32`, `riscv64` | None |
1310+
/// |---------------|------------------------------------------|
1311+
// Sorted alphabetically
1312+
/// | `aarch64`, `arm`, `arm64ec`, `loongarch64`, `powerpc` (except when `target_abi = "spe"`), `powerpc64`, `riscv32`, `riscv64`, `s390x`, `x86`, `x86_64` | None |
1313+
/// | `nvptx64` | All payloads |
13121314
/// | `sparc`, `sparc64` | The all-one payload |
1313-
/// | `wasm32`, `wasm64` | If all input NaNs are quiet with all-zero payload: None.<br> Otherwise: all possible payloads. |
1315+
/// | `wasm32`, `wasm64` | If all input NaNs are quiet with all-zero payload: None.<br> Otherwise: all payloads. |
13141316
///
13151317
/// For targets not in this table, all payloads are possible.
13161318
///

src/ci/citool/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ fn post_merge_report(db: JobDatabase, current: String, parent: String) -> anyhow
191191

192192
output_details("Test dashboard", || {
193193
println!(
194-
r#"\nRun
194+
r#"Run
195195
196196
```bash
197197
cargo run --manifest-path src/ci/citool/Cargo.toml -- \

src/doc/rustc/src/platform-support/armv7-rtems-eabihf.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ARM targets for the [RTEMS realtime operating system](https://www.rtems.org) us
1212

1313
The target does not support host tools. Only cross-compilation is possible.
1414
The cross-compiler toolchain can be obtained by following the installation instructions
15-
of the [RTEMS Documentation](https://docs.rtems.org/branches/master/user/index.html). Additionally to the cross-compiler also a compiled BSP
15+
of the [RTEMS Documentation](https://docs.rtems.org/docs/main/user/index.html). Additionally to the cross-compiler also a compiled BSP
1616
for a board fitting the architecture needs to be available on the host.
1717
Currently tested has been the BSP `xilinx_zynq_a9_qemu` of RTEMS 6.
1818

@@ -49,4 +49,4 @@ While basic execution of the unit test harness seems to work. However, running t
4949
## Cross-compilation toolchains and C code
5050

5151
Compatible C-code can be built with the RTEMS cross-compiler toolchain `arm-rtems6-gcc`.
52-
For more information how to build the toolchain, RTEMS itself and RTEMS applications please have a look at the [RTEMS Documentation](https://docs.rtems.org/branches/master/user/index.html).
52+
For more information how to build the toolchain, RTEMS itself and RTEMS applications please have a look at the [RTEMS Documentation](https://docs.rtems.org/docs/main/user/index.html).

tests/assembly/simd-bitmask.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ pub unsafe extern "C" fn bitmask_m8x16(mask: m8x16) -> u16 {
6565
simd_bitmask(mask)
6666
}
6767

68-
// CHECK-LABEL: bitmask_m8x64
68+
// x86-avx512-LABEL: bitmask_m8x64
6969
#[no_mangle]
70+
#[cfg(x86_avx512)]
7071
pub unsafe extern "C" fn bitmask_m8x64(mask: m8x64) -> u64 {
7172
// The simd_bitmask intrinsic already uses the most significant bit, so no shift is necessary.
7273
// Note that x86 has no byte shift, llvm uses a word shift to move the least significant bit
@@ -128,8 +129,10 @@ pub unsafe extern "C" fn bitmask_m64x2(mask: m64x2) -> u8 {
128129
simd_bitmask(mask)
129130
}
130131

131-
// CHECK-LABEL: bitmask_m64x4
132+
// x86-avx2-LABEL: bitmask_m64x4
133+
// x86-avx512-LABEL: bitmask_m64x4
132134
#[no_mangle]
135+
#[cfg(any(x86_avx2, x86_avx512))]
133136
pub unsafe extern "C" fn bitmask_m64x4(mask: m64x4) -> u8 {
134137
// The simd_bitmask intrinsic already uses the most significant bit, so no shift is necessary.
135138
//

tests/assembly/simd-intrinsic-select.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ pub unsafe extern "C" fn select_f64x2(mask: m64x2, a: f64x2, b: f64x2) -> f64x2
9999
simd_select(mask, a, b)
100100
}
101101

102-
// CHECK-LABEL: select_f64x4
102+
// x86-avx2-LABEL: select_f64x4
103+
// x86-avx512-LABEL: select_f64x4
103104
#[no_mangle]
105+
#[cfg(any(x86_avx2, x86_avx512))]
104106
pub unsafe extern "C" fn select_f64x4(mask: m64x4, a: f64x4, b: f64x4) -> f64x4 {
105107
// The parameter is a 256 bit vector which in the C abi is only valid for avx targets.
106108
//
@@ -113,8 +115,9 @@ pub unsafe extern "C" fn select_f64x4(mask: m64x4, a: f64x4, b: f64x4) -> f64x4
113115
simd_select(mask, a, b)
114116
}
115117

116-
// CHECK-LABEL: select_f64x8
118+
// x86-avx512-LABEL: select_f64x8
117119
#[no_mangle]
120+
#[cfg(x86_avx512)]
118121
pub unsafe extern "C" fn select_f64x8(mask: m64x8, a: f64x8, b: f64x8) -> f64x8 {
119122
// The parameter is a 256 bit vector which in the C abi is only valid for avx512 targets.
120123
//

tests/codegen/regparm-inreg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// x86 only.
44

55
//@ add-core-stubs
6-
//@ compile-flags: --target i686-unknown-linux-gnu -Cno-prepopulate-passes -Copt-level=3
6+
//@ compile-flags: --target i686-unknown-linux-gnu -Cno-prepopulate-passes -Copt-level=3 -Ctarget-feature=+avx
77
//@ needs-llvm-components: x86
88

99
//@ revisions:regparm0 regparm1 regparm2 regparm3

0 commit comments

Comments
 (0)