Skip to content

Commit ecade53

Browse files
committed
Auto merge of rust-lang#138506 - fmease:rollup-ve4h2eq, r=fmease
Rollup of 9 pull requests Successful merges: - rust-lang#134720 (Display valid crate types in error message for --crate-type flag) - rust-lang#137619 (Provide helpful diagnostics for shebang lookalikes) - rust-lang#138353 (remove must_use from <*const T>::expose_provenance) - rust-lang#138452 (Remove `RUN_CHECK_WITH_PARALLEL_QUERIES`) - rust-lang#138469 (remove comment regarding a removed test directive) - rust-lang#138477 (Deny impls for `BikeshedGuaranteedNoDrop`) - rust-lang#138485 (Rustc dev guide subtree update) - rust-lang#138487 (Pass `CI_JOB_DOC_URL` to Docker) - rust-lang#138495 (Take a break from reviews) r? `@ghost` `@rustbot` modify labels: rollup
2 parents cb50d4d + 401b325 commit ecade53

31 files changed

+264
-134
lines changed

compiler/rustc_parse/src/parser/attr.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,29 @@ impl<'a> Parser<'a> {
127127
let lo = self.token.span;
128128
// Attributes can't have attributes of their own [Editor's note: not with that attitude]
129129
self.collect_tokens_no_attrs(|this| {
130+
let pound_hi = this.token.span.hi();
130131
assert!(this.eat(exp!(Pound)), "parse_attribute called in non-attribute position");
131132

133+
let not_lo = this.token.span.lo();
132134
let style =
133135
if this.eat(exp!(Bang)) { ast::AttrStyle::Inner } else { ast::AttrStyle::Outer };
134136

135-
this.expect(exp!(OpenBracket))?;
137+
let mut bracket_res = this.expect(exp!(OpenBracket));
138+
// If `#!` is not followed by `[`
139+
if let Err(err) = &mut bracket_res
140+
&& style == ast::AttrStyle::Inner
141+
&& pound_hi == not_lo
142+
{
143+
err.note(
144+
"the token sequence `#!` here looks like the start of \
145+
a shebang interpreter directive but it is not",
146+
);
147+
err.help(
148+
"if you meant this to be a shebang interpreter directive, \
149+
move it to the very start of the file",
150+
);
151+
}
152+
bracket_res?;
136153
let item = this.parse_attr_item(ForceCollect::No)?;
137154
this.expect(exp!(CloseBracket))?;
138155
let attr_sp = lo.to(this.prev_token.span);

compiler/rustc_session/src/config.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -2709,7 +2709,12 @@ pub fn parse_crate_types_from_list(list_list: Vec<String>) -> Result<Vec<CrateTy
27092709
"cdylib" => CrateType::Cdylib,
27102710
"bin" => CrateType::Executable,
27112711
"proc-macro" => CrateType::ProcMacro,
2712-
_ => return Err(format!("unknown crate type: `{part}`")),
2712+
_ => {
2713+
return Err(format!(
2714+
"unknown crate type: `{part}`, expected one of: \
2715+
`lib`, `rlib`, `staticlib`, `dylib`, `cdylib`, `bin`, `proc-macro`",
2716+
));
2717+
}
27132718
};
27142719
if !crate_types.contains(&new_part) {
27152720
crate_types.push(new_part)

library/core/src/marker.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,13 @@ impl<T: ?Sized> Copy for &T {}
465465
/// Notably, this doesn't include all trivially-destructible types for semver
466466
/// reasons.
467467
///
468-
/// Bikeshed name for now.
468+
/// Bikeshed name for now. This trait does not do anything other than reflect the
469+
/// set of types that are allowed within unions for field validity.
469470
#[unstable(feature = "bikeshed_guaranteed_no_drop", issue = "none")]
470471
#[lang = "bikeshed_guaranteed_no_drop"]
472+
#[rustc_deny_explicit_impl]
473+
#[rustc_do_not_implement_via_object]
474+
#[doc(hidden)]
471475
pub trait BikeshedGuaranteedNoDrop {}
472476

473477
/// Types for which it is safe to share references between threads.

library/core/src/ptr/const_ptr.rs

-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ impl<T: ?Sized> *const T {
193193
/// This is an [Exposed Provenance][crate::ptr#exposed-provenance] API.
194194
///
195195
/// [`with_exposed_provenance`]: with_exposed_provenance
196-
#[must_use]
197196
#[inline(always)]
198197
#[stable(feature = "exposed_provenance", since = "1.84.0")]
199198
pub fn expose_provenance(self) -> usize {

src/bootstrap/src/core/build_steps/test.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1908,8 +1908,6 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
19081908
llvm_components_passed = true;
19091909
}
19101910
if !builder.is_rust_llvm(target) {
1911-
// FIXME: missing Rust patches is not the same as being system llvm; we should rename the flag at some point.
1912-
// Inspecting the tests with `// no-system-llvm` in src/test *looks* like this is doing the right thing, though.
19131911
cmd.arg("--system-llvm");
19141912
}
19151913

src/ci/docker/host-aarch64/aarch64-gnu-debug/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ COPY scripts/sccache.sh /scripts/
3030
RUN sh /scripts/sccache.sh
3131

3232
ENV RUSTBUILD_FORCE_CLANG_BASED_TESTS 1
33-
ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
3433

3534
# llvm.use-linker conflicts with downloading CI LLVM
3635
ENV NO_DOWNLOAD_CI_LLVM 1

src/ci/docker/host-x86_64/mingw-check/Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ COPY host-x86_64/mingw-check/check-default-config-profiles.sh /scripts/
4141
COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
4242
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/
4343

44-
ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
45-
4644
# Check library crates on all tier 1 targets.
4745
# We disable optimized compiler built-ins because that requires a C toolchain for the target.
4846
# We also skip the x86_64-unknown-linux-gnu target as it is well-tested by other jobs.

src/ci/docker/host-x86_64/x86_64-gnu-debug/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ COPY scripts/sccache.sh /scripts/
3030
RUN sh /scripts/sccache.sh
3131

3232
ENV RUSTBUILD_FORCE_CLANG_BASED_TESTS 1
33-
ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
3433

3534
# llvm.use-linker conflicts with downloading CI LLVM
3635
ENV NO_DOWNLOAD_CI_LLVM 1

src/ci/docker/run.sh

+1
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ docker \
361361
--env TOOLSTATE_PUBLISH \
362362
--env RUST_CI_OVERRIDE_RELEASE_CHANNEL \
363363
--env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \
364+
--env CI_JOB_DOC_URL="${CI_JOB_DOC_URL}" \
364365
--env BASE_COMMIT="$BASE_COMMIT" \
365366
--env DIST_TRY_BUILD \
366367
--env PR_CI_JOB \

src/ci/run.sh

-13
Original file line numberDiff line numberDiff line change
@@ -260,19 +260,6 @@ else
260260
do_make "$RUST_CHECK_TARGET"
261261
fi
262262

263-
if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then
264-
rm -f config.toml
265-
$SRC/configure --set change-id=99999999
266-
267-
# Save the build metrics before we wipe the directory
268-
mv build/metrics.json .
269-
rm -rf build
270-
mkdir build
271-
mv metrics.json build
272-
273-
CARGO_INCREMENTAL=0 ../x check
274-
fi
275-
276263
echo "::group::sccache stats"
277264
sccache --show-stats || true
278265
echo "::endgroup::"

src/doc/rustc-dev-guide/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ cargo +stable install josh-proxy --git https://github.com/josh-project/josh --ta
8282
Older versions of `josh-proxy` may not round trip commits losslessly so it is important to install this exact version.
8383

8484
### Pull changes from `rust-lang/rust` into this repository
85+
8586
1) Checkout a new branch that will be used to create a PR into `rust-lang/rustc-dev-guide`
8687
2) Run the pull command
8788
```
@@ -95,3 +96,15 @@ Older versions of `josh-proxy` may not round trip commits losslessly so it is im
9596
$ cargo run --manifest-path josh-sync/Cargo.toml rustc-push <branch-name> <gh-username>
9697
```
9798
2) Create a PR from `<branch-name>` into `rust-lang/rust`
99+
100+
#### Minimal git config
101+
102+
For simplicity (ease of implementation purposes), the josh-sync script simply calls out to system git. This means that the git invocation may be influenced by global (or local) git configuration.
103+
104+
You may observe "Nothing to pull" even if you *know* rustc-pull has something to pull if your global git config sets `fetch.prunetags = true` (and possibly other configurations may cause unexpected outcomes).
105+
106+
To minimize the likelihood of this happening, you may wish to keep a separate *minimal* git config that *only* has `[user]` entries from global git config, then repoint system git to use the minimal git config instead. E.g.
107+
108+
```
109+
$ GIT_CONFIG_GLOBAL=/path/to/minimal/gitconfig GIT_CONFIG_SYSTEM='' cargo +stable run --manifest-path josh-sync/Cargo.toml -- rustc-pull
110+
```

src/doc/rustc-dev-guide/rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4ecd70ddd1039a3954056c1071e40278048476fa
1+
8536f201ffdb2c24925d7f9e87996d7dca93428b

src/doc/rustc-dev-guide/src/SUMMARY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
- [Inference details](./opaque-types-impl-trait-inference.md)
179179
- [Return Position Impl Trait In Trait](./return-position-impl-trait-in-trait.md)
180180
- [Region inference restrictions][opaque-infer]
181-
- [Effect checking](./effects.md)
181+
- [Const condition checking](./effects.md)
182182
- [Pattern and Exhaustiveness Checking](./pat-exhaustive-checking.md)
183183
- [Unsafety Checking](./unsafety-checking.md)
184184
- [MIR dataflow](./mir/dataflow.md)

src/doc/rustc-dev-guide/src/backend/updating-llvm.md

+9-14
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ so let's go through each in detail.
116116
at the time of the branch,
117117
and the remaining part is the current date.
118118

119-
2. Apply Rust-specific patches to the llvm-project repository.
119+
1. Apply Rust-specific patches to the llvm-project repository.
120120
All features and bugfixes are upstream,
121121
but there's often some weird build-related patches
122122
that don't make sense to upstream.
123123
These patches are typically the latest patches in the
124124
rust-lang/llvm-project branch that rustc is currently using.
125125

126-
3. Build the new LLVM in the `rust` repository.
126+
1. Build the new LLVM in the `rust` repository.
127127
To do this,
128128
you'll want to update the `src/llvm-project` repository to your branch,
129129
and the revision you've created.
@@ -151,7 +151,7 @@ so let's go through each in detail.
151151
download-ci-llvm = false
152152
```
153153

154-
4. Test for regressions across other platforms. LLVM often has at least one bug
154+
1. Test for regressions across other platforms. LLVM often has at least one bug
155155
for non-tier-1 architectures, so it's good to do some more testing before
156156
sending this to bors! If you're low on resources you can send the PR as-is
157157
now to bors, though, and it'll get tested anyway.
@@ -170,22 +170,17 @@ so let's go through each in detail.
170170
* `./src/ci/docker/run.sh dist-various-2`
171171
* `./src/ci/docker/run.sh armhf-gnu`
172172

173-
5. Prepare a PR to `rust-lang/rust`. Work with maintainers of
173+
1. Prepare a PR to `rust-lang/rust`. Work with maintainers of
174174
`rust-lang/llvm-project` to get your commit in a branch of that repository,
175175
and then you can send a PR to `rust-lang/rust`. You'll change at least
176176
`src/llvm-project` and will likely also change [`llvm-wrapper`] as well.
177177

178-
<!-- date-check: Sep 2024 -->
178+
<!-- date-check: mar 2025 -->
179179
> For prior art, here are some previous LLVM updates:
180-
> - [LLVM 11](https://github.com/rust-lang/rust/pull/73526)
181-
> - [LLVM 12](https://github.com/rust-lang/rust/pull/81451)
182-
> - [LLVM 13](https://github.com/rust-lang/rust/pull/87570)
183-
> - [LLVM 14](https://github.com/rust-lang/rust/pull/93577)
184-
> - [LLVM 15](https://github.com/rust-lang/rust/pull/99464)
185-
> - [LLVM 16](https://github.com/rust-lang/rust/pull/109474)
186180
> - [LLVM 17](https://github.com/rust-lang/rust/pull/115959)
187181
> - [LLVM 18](https://github.com/rust-lang/rust/pull/120055)
188182
> - [LLVM 19](https://github.com/rust-lang/rust/pull/127513)
183+
> - [LLVM 20](https://github.com/rust-lang/rust/pull/135763)
189184
190185
Note that sometimes it's easiest to land [`llvm-wrapper`] compatibility as a PR
191186
before actually updating `src/llvm-project`.
@@ -194,17 +189,17 @@ so let's go through each in detail.
194189
others interested in trying out the new LLVM can benefit from work you've done
195190
to update the C++ bindings.
196191

197-
3. Over the next few months,
192+
1. Over the next few months,
198193
LLVM will continually push commits to its `release/a.b` branch.
199194
We will often want to have those bug fixes as well.
200195
The merge process for that is to use `git merge` itself to merge LLVM's
201196
`release/a.b` branch with the branch created in step 2.
202197
This is typically
203198
done multiple times when necessary while LLVM's release branch is baking.
204199

205-
4. LLVM then announces the release of version `a.b`.
200+
1. LLVM then announces the release of version `a.b`.
206201

207-
5. After LLVM's official release,
202+
1. After LLVM's official release,
208203
we follow the process of creating a new branch on the
209204
rust-lang/llvm-project repository again,
210205
this time with a new date.

src/doc/rustc-dev-guide/src/building/bootstrapping/debugging-bootstrap.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Both `tracing::*` macros and the `tracing::instrument` proc-macro attribute need
129129

130130
```rs
131131
#[cfg(feature = "tracing")]
132-
use tracing::{instrument, trace};
132+
use tracing::instrument;
133133

134134
struct Foo;
135135

@@ -138,7 +138,6 @@ impl Step for Foo {
138138

139139
#[cfg_attr(feature = "tracing", instrument(level = "trace", name = "Foo::should_run", skip_all))]
140140
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
141-
#[cfg(feature = "tracing")]
142141
trace!(?run, "entered Foo::should_run");
143142

144143
todo!()
@@ -154,7 +153,6 @@ impl Step for Foo {
154153
),
155154
)]
156155
fn run(self, builder: &Builder<'_>) -> Self::Output {
157-
#[cfg(feature = "tracing")]
158156
trace!(?run, "entered Foo::run");
159157

160158
todo!()

src/doc/rustc-dev-guide/src/building/new-target.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ These are a set of steps to add support for a new target. There are
44
numerous end states and paths to get there, so not all sections may be
55
relevant to your desired goal.
66

7-
See also the associated documentation in the
8-
[target tier policy][target_tier_policy_add].
7+
See also the associated documentation in the [target tier policy].
98

109
<!-- toc -->
1110

12-
[target_tier_policy_add]: https://doc.rust-lang.org/rustc/target-tier-policy.html#adding-a-new-target
11+
[target tier policy]: https://doc.rust-lang.org/rustc/target-tier-policy.html#adding-a-new-target
1312

1413
## Specifying a new LLVM
1514

0 commit comments

Comments
 (0)