Skip to content

Commit 767750b

Browse files
committed
Auto merge of rust-lang#124358 - matthiaskrgr:rollup-gs6cr5x, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - rust-lang#124257 (Rewrite the `no-input-file.stderr` test in Rust and support diff) - rust-lang#124324 (Minor AST cleanups) - rust-lang#124327 (CI: implement job skipping in Python matrix calculation) - rust-lang#124345 (Enable `--check-cfg` by default in UI tests) r? `@ghost` `@rustbot` modify labels: rollup
2 parents cb3752d + 1972d40 commit 767750b

File tree

127 files changed

+546
-400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+546
-400
lines changed

.github/workflows/ci.yml

+2-29
Original file line numberDiff line numberDiff line change
@@ -88,96 +88,70 @@ jobs:
8888
run: "echo \"[CI_PR_NUMBER=$num]\""
8989
env:
9090
num: "${{ github.event.number }}"
91-
if: "success() && !env.SKIP_JOB && github.event_name == 'pull_request'"
91+
if: "success() && github.event_name == 'pull_request'"
9292
- name: add extra environment variables
9393
run: src/ci/scripts/setup-environment.sh
9494
env:
9595
EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
96-
if: success() && !env.SKIP_JOB
97-
- name: decide whether to skip this job
98-
run: src/ci/scripts/should-skip-this.sh
99-
if: success() && !env.SKIP_JOB
10096
- name: ensure the channel matches the target branch
10197
run: src/ci/scripts/verify-channel.sh
102-
if: success() && !env.SKIP_JOB
10398
- name: collect CPU statistics
10499
run: src/ci/scripts/collect-cpu-stats.sh
105-
if: success() && !env.SKIP_JOB
106100
- name: show the current environment
107101
run: src/ci/scripts/dump-environment.sh
108-
if: success() && !env.SKIP_JOB
109102
- name: install awscli
110103
run: src/ci/scripts/install-awscli.sh
111-
if: success() && !env.SKIP_JOB
112104
- name: install sccache
113105
run: src/ci/scripts/install-sccache.sh
114-
if: success() && !env.SKIP_JOB
115106
- name: select Xcode
116107
run: src/ci/scripts/select-xcode.sh
117-
if: success() && !env.SKIP_JOB
118108
- name: install clang
119109
run: src/ci/scripts/install-clang.sh
120-
if: success() && !env.SKIP_JOB
121110
- name: install tidy
122111
run: src/ci/scripts/install-tidy.sh
123-
if: success() && !env.SKIP_JOB
124112
- name: install WIX
125113
run: src/ci/scripts/install-wix.sh
126-
if: success() && !env.SKIP_JOB
127114
- name: disable git crlf conversion
128115
run: src/ci/scripts/disable-git-crlf-conversion.sh
129-
if: success() && !env.SKIP_JOB
130116
- name: checkout submodules
131117
run: src/ci/scripts/checkout-submodules.sh
132-
if: success() && !env.SKIP_JOB
133118
- name: install MSYS2
134119
run: src/ci/scripts/install-msys2.sh
135-
if: success() && !env.SKIP_JOB
136120
- name: install MinGW
137121
run: src/ci/scripts/install-mingw.sh
138-
if: success() && !env.SKIP_JOB
139122
- name: install ninja
140123
run: src/ci/scripts/install-ninja.sh
141-
if: success() && !env.SKIP_JOB
142124
- name: enable ipv6 on Docker
143125
run: src/ci/scripts/enable-docker-ipv6.sh
144-
if: success() && !env.SKIP_JOB
145126
- name: disable git crlf conversion
146127
run: src/ci/scripts/disable-git-crlf-conversion.sh
147-
if: success() && !env.SKIP_JOB
148128
- name: ensure line endings are correct
149129
run: src/ci/scripts/verify-line-endings.sh
150-
if: success() && !env.SKIP_JOB
151130
- name: ensure backported commits are in upstream branches
152131
run: src/ci/scripts/verify-backported-commits.sh
153-
if: success() && !env.SKIP_JOB
154132
- name: ensure the stable version number is correct
155133
run: src/ci/scripts/verify-stable-version-number.sh
156-
if: success() && !env.SKIP_JOB
157134
- name: run the build
158135
run: src/ci/scripts/run-build-from-ci.sh 2>&1
159136
env:
160137
AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
161138
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
162139
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
163-
if: success() && !env.SKIP_JOB
164140
- name: create github artifacts
165141
run: src/ci/scripts/create-doc-artifacts.sh
166-
if: success() && !env.SKIP_JOB
167142
- name: upload artifacts to github
168143
uses: actions/upload-artifact@v4
169144
with:
170145
name: "${{ env.DOC_ARTIFACT_NAME }}"
171146
path: obj/artifacts/doc
172147
if-no-files-found: ignore
173148
retention-days: 5
174-
if: success() && !env.SKIP_JOB
175149
- name: upload artifacts to S3
176150
run: src/ci/scripts/upload-artifacts.sh
177151
env:
178152
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
179153
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
180-
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
154+
if: "success() && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
181155
master:
182156
name: master
183157
runs-on: ubuntu-latest
@@ -202,7 +176,6 @@ jobs:
202176
shell: bash
203177
env:
204178
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
205-
if: success() && !env.SKIP_JOB
206179
try-success:
207180
needs:
208181
- job

Cargo.lock

+7
Original file line numberDiff line numberDiff line change
@@ -3343,6 +3343,7 @@ version = "0.0.0"
33433343
dependencies = [
33443344
"object 0.34.0",
33453345
"regex",
3346+
"similar",
33463347
"wasmparser",
33473348
]
33483349

@@ -5138,6 +5139,12 @@ version = "1.3.0"
51385139
source = "registry+https://github.com/rust-lang/crates.io-index"
51395140
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
51405141

5142+
[[package]]
5143+
name = "similar"
5144+
version = "2.5.0"
5145+
source = "registry+https://github.com/rust-lang/crates.io-index"
5146+
checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640"
5147+
51415148
[[package]]
51425149
name = "siphasher"
51435150
version = "0.3.11"

compiler/rustc_ast/src/ast.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2786,6 +2786,7 @@ pub enum AttrKind {
27862786
#[derive(Clone, Encodable, Decodable, Debug)]
27872787
pub struct NormalAttr {
27882788
pub item: AttrItem,
2789+
// Tokens for the full attribute, e.g. `#[foo]`, `#![bar]`.
27892790
pub tokens: Option<LazyAttrTokenStream>,
27902791
}
27912792

@@ -2802,6 +2803,7 @@ impl NormalAttr {
28022803
pub struct AttrItem {
28032804
pub path: Path,
28042805
pub args: AttrArgs,
2806+
// Tokens for the meta item, e.g. just the `foo` within `#[foo]` or `#![foo]`.
28052807
pub tokens: Option<LazyAttrTokenStream>,
28062808
}
28072809

compiler/rustc_ast/src/attr/mod.rs

+7-10
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@ impl MetaItem {
298298
}
299299

300300
pub fn value_str(&self) -> Option<Symbol> {
301-
self.kind.value_str()
301+
match &self.kind {
302+
MetaItemKind::NameValue(v) => v.kind.str(),
303+
_ => None,
304+
}
302305
}
303306

304307
fn from_tokens<'a, I>(tokens: &mut iter::Peekable<I>) -> Option<MetaItem>
@@ -362,13 +365,6 @@ impl MetaItem {
362365
}
363366

364367
impl MetaItemKind {
365-
pub fn value_str(&self) -> Option<Symbol> {
366-
match self {
367-
MetaItemKind::NameValue(v) => v.kind.str(),
368-
_ => None,
369-
}
370-
}
371-
372368
fn list_from_tokens(tokens: TokenStream) -> Option<ThinVec<NestedMetaItem>> {
373369
let mut tokens = tokens.trees().peekable();
374370
let mut result = ThinVec::new();
@@ -468,8 +464,9 @@ impl NestedMetaItem {
468464
self.meta_item().and_then(|meta_item| meta_item.meta_item_list())
469465
}
470466

471-
/// Returns a name and single literal value tuple of the `MetaItem`.
472-
pub fn name_value_literal(&self) -> Option<(Symbol, &MetaItemLit)> {
467+
/// If it's a singleton list of the form `foo(lit)`, returns the `foo` and
468+
/// the `lit`.
469+
pub fn singleton_lit_list(&self) -> Option<(Symbol, &MetaItemLit)> {
473470
self.meta_item().and_then(|meta_item| {
474471
meta_item.meta_item_list().and_then(|meta_item_list| {
475472
if meta_item_list.len() == 1

0 commit comments

Comments
 (0)