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

File tree

31 files changed

+264
-134
lines changed

31 files changed

+264
-134
lines changed

compiler/rustc_parse/src/parser/attr.rs

Lines changed: 18 additions & 1 deletion
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

Lines changed: 6 additions & 1 deletion
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

Lines changed: 5 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 0 additions & 13 deletions
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::"

0 commit comments

Comments
 (0)