Skip to content

Commit 1162ebd

Browse files
committed
Auto merge of #158015 - JonathanBrouwer:rollup-4hzy2nc, r=JonathanBrouwer
Rollup of 3 pull requests Successful merges: - #157931 (Improve `declare_features!` macro error) - #157992 (tidy: revisions inherit global directives) - #158010 (renovate: Pin GitHub Action digests to SemVer)
2 parents 98594f4 + dad46eb commit 1162ebd

4 files changed

Lines changed: 26 additions & 7 deletions

File tree

.github/renovate.json5

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
// Pin GitHub Actions to their commit SHA digests
5-
"helpers:pinGitHubActionDigests"
4+
// Pin GitHub Actions to their commit SHA digests, resolving floating tags
5+
// (e.g. `v4`) to the full SemVer version (e.g. `v4.1.2`)
6+
"helpers:pinGitHubActionDigestsToSemver"
67
],
78
// Let Renovatebot keep an opened issue that tracks our dependencies
89
"dependencyDashboard": true,

compiler/rustc_feature/src/unstable.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ macro_rules! declare_features {
173173
pub fn incomplete(&self, feature: Symbol) -> bool {
174174
match feature {
175175
$(
176-
sym::$feature => status_to_enum!($status) == FeatureStatus::Incomplete,
176+
// Match guard to avoid duplicating `cannot find $feature in module sym` error.
177+
f if f == sym::$feature => status_to_enum!($status) == FeatureStatus::Incomplete,
177178
)*
178179
_ if self.enabled_features.contains(&feature) => {
179180
// Accepted/removed features and library features aren't in this file but
@@ -189,7 +190,8 @@ macro_rules! declare_features {
189190
pub fn internal(&self, feature: Symbol) -> bool {
190191
match feature {
191192
$(
192-
sym::$feature => status_to_enum!($status) == FeatureStatus::Internal,
193+
// Match guard to avoid duplicating `cannot find $feature in module sym` error.
194+
f if f == sym::$feature => status_to_enum!($status) == FeatureStatus::Internal,
193195
)*
194196
_ if self.enabled_features.contains(&feature) => {
195197
// This could be accepted/removed, or a libs feature.

src/tools/tidy/src/target_specific_tests.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const COMPILE_FLAGS_HEADER: &str = "compile-flags:";
1313

1414
#[derive(Default, Debug)]
1515
struct RevisionInfo<'a> {
16+
/// Target architecture specified with `--target=`
1617
target_arch: Option<Option<&'a str>>,
18+
/// LLVM components configured with `//@ needs-llvm-components: ...`
1719
llvm_components: Option<Vec<&'a str>>,
1820
}
1921

@@ -61,6 +63,22 @@ pub fn check(tests_path: &Path, tidy_ctx: TidyCtx) {
6163
return;
6264
}
6365

66+
// Directives without an explicit revision. These are inherited by all revisions.
67+
let global = header_map.remove(&None).unwrap_or_default();
68+
69+
if header_map.is_empty() {
70+
// `//@ revisions` is not used.
71+
header_map.insert(None, global);
72+
} else {
73+
// Make all revisions inherit global directives.
74+
for info in header_map.values_mut() {
75+
info.target_arch = info.target_arch.or(global.target_arch);
76+
if let Some(components) = &global.llvm_components {
77+
info.llvm_components.get_or_insert_with(Vec::new).extend(components);
78+
}
79+
}
80+
}
81+
6482
for (rev, RevisionInfo { target_arch, llvm_components }) in &header_map {
6583
let rev = rev.unwrap_or("[unspecified]");
6684
match (target_arch, llvm_components) {

tests/assembly-llvm/c-variadic/mips.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
//@ assembly-output: emit-asm
33
//
44
//@ revisions: MIPS MIPS64 MIPS64EL
5+
//@ needs-llvm-components: mips
56
//@ [MIPS] compile-flags: -Copt-level=3 --target mips-unknown-linux-gnu
6-
//@ [MIPS] needs-llvm-components: mips
77
//@ [MIPS64] compile-flags: -Copt-level=3 --target mipsisa64r6-unknown-linux-gnuabi64
8-
//@ [MIPS64] needs-llvm-components: mips
98
//@ [MIPS64EL] compile-flags: -Copt-level=3 --target mips64el-unknown-linux-gnuabi64
10-
//@ [MIPS64EL] needs-llvm-components: mips
119
#![feature(c_variadic, no_core, lang_items, intrinsics, rustc_attrs, asm_experimental_arch)]
1210
#![no_core]
1311
#![crate_type = "lib"]

0 commit comments

Comments
 (0)