Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #138506

Merged
merged 51 commits into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
78e0d10
Rewrite effects checking chapter
fee1-dead Feb 20, 2025
243f569
Don't suggest explicitly `cfg`-gating `trace!` calls in bootstrap
moxian Mar 5, 2025
515be00
Merge pull request #2269 from moxian/patch-1
jieyouxu Mar 6, 2025
41f95b0
consider `explicit_implied_const_bounds`
fee1-dead Mar 8, 2025
24f3812
numbers were not sequential, so stop trying
tshepang Mar 8, 2025
93a8c7e
only a few are needed as examples
tshepang Mar 8, 2025
ce2eef3
link to latest major llvm update pr
tshepang Mar 8, 2025
2391f10
fix text
tshepang Mar 8, 2025
f1a0665
ignore-stage0 and only-stage0 do not exist
tshepang Mar 8, 2025
d9c920b
Merge pull request #2272 from rust-lang/tshepang-patch-2
jieyouxu Mar 9, 2025
fc7ad74
Merge pull request #2271 from rust-lang/tshepang-patch-1
jieyouxu Mar 9, 2025
7f83057
Merge pull request #2270 from tshepang/example-llvm-prs
jieyouxu Mar 9, 2025
d51c922
use new terminology
tshepang Mar 10, 2025
7751672
already mentioned before showing code snippet
tshepang Mar 10, 2025
7384623
Merge pull request #2274 from rust-lang/tshepang-patch-2
tshepang Mar 10, 2025
f2e7735
add a pause, for readability
tshepang Mar 10, 2025
e9088e4
Merge pull request #2275 from rust-lang/tshepang-patch-2
tshepang Mar 10, 2025
7c6d6e3
clean --bless text
tshepang Mar 10, 2025
225e571
Merge pull request #2276 from rust-lang/tshepang-patch-2
tshepang Mar 10, 2025
4b2c077
add missing punctuation
tshepang Mar 10, 2025
4cc14ce
Merge pull request #2277 from rust-lang/tshepang-patch-2
tshepang Mar 10, 2025
e405878
Merge pull request #2273 from rust-lang/tshepang-patch-1
jieyouxu Mar 10, 2025
240a6d3
Merge pull request #2258 from fee1-dead-contrib/constck
oli-obk Mar 10, 2025
b06a136
remove must_use from <*const T>::expose_provenance
RalfJung Mar 11, 2025
26176b0
less text for same effect
tshepang Mar 13, 2025
d0a3160
Merge pull request #2281 from rust-lang/tshepang-patch-1
tshepang Mar 13, 2025
d4c5e75
Preparing for merge from rustc
jieyouxu Mar 13, 2025
7bde176
Merge from rustc
jieyouxu Mar 13, 2025
440d336
Document `fetch.prunetags = true` gotcha during rustc-pull
jieyouxu Mar 13, 2025
ed29ebb
Merge pull request #2282 from jieyouxu/fetch-prunetags
Kobzol Mar 13, 2025
a73e44b
Provide helpful diagnostics for shebang lookalikes
Pyr0de Feb 27, 2025
190187b
Remove the doc for `no-system-llvm`
cuviper Mar 13, 2025
27d71f0
Merge pull request #2284 from rust-lang/cuviper-patch-1
jieyouxu Mar 13, 2025
54d26b3
remove comment regarding a removed test directive
tshepang Mar 13, 2025
88aaf1d
Fix grammar and remove redundant info
KonaeAkira Mar 13, 2025
4c32adb
Deny impls for BikeshedGuaranteedNoDrop
compiler-errors Mar 14, 2025
a863f2c
Merge pull request #2285 from KonaeAkira/master
tshepang Mar 14, 2025
90bf2b1
Show valid crate types when the user passes unknown `--crate-type` value
malezjaa Dec 24, 2024
3d9bf08
Merge pull request #2283 from jieyouxu/sync
jieyouxu Mar 14, 2025
7afad54
Pass `CI_JOB_DOC_URL` to Docker
Kobzol Mar 14, 2025
2aa68ac
Remove `RUN_CHECK_WITH_PARALLEL_QUERIES`
Kobzol Mar 13, 2025
db8aa92
Take a break from reviews
ChrisDenton Mar 14, 2025
f8842bd
Rollup merge of #134720 - malezjaa:feat/crate-type-valid-values, r=ji…
fmease Mar 14, 2025
881d237
Rollup merge of #137619 - Pyr0de:issue_137249, r=fmease
fmease Mar 14, 2025
ffa96fe
Rollup merge of #138353 - RalfJung:expose-provenance-must-use, r=ibra…
fmease Mar 14, 2025
40ac358
Rollup merge of #138452 - Kobzol:remove-run-check-with-parallel-queri…
fmease Mar 14, 2025
1e7441f
Rollup merge of #138469 - tshepang:patch-6, r=onur-ozkan
fmease Mar 14, 2025
c42866f
Rollup merge of #138477 - compiler-errors:deny-bikeshed-guaranteed-no…
fmease Mar 14, 2025
8eeecb7
Rollup merge of #138485 - BoxyUwU:rdg-push, r=jieyouxu
fmease Mar 14, 2025
c5e3857
Rollup merge of #138487 - Kobzol:fix-doc-url-docker, r=marcoieni
fmease Mar 14, 2025
401b325
Rollup merge of #138495 - ChrisDenton:vacate, r=ChrisDenton
fmease Mar 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion compiler/rustc_parse/src/parser/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,29 @@ impl<'a> Parser<'a> {
let lo = self.token.span;
// Attributes can't have attributes of their own [Editor's note: not with that attitude]
self.collect_tokens_no_attrs(|this| {
let pound_hi = this.token.span.hi();
assert!(this.eat(exp!(Pound)), "parse_attribute called in non-attribute position");

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

this.expect(exp!(OpenBracket))?;
let mut bracket_res = this.expect(exp!(OpenBracket));
// If `#!` is not followed by `[`
if let Err(err) = &mut bracket_res
&& style == ast::AttrStyle::Inner
&& pound_hi == not_lo
{
err.note(
"the token sequence `#!` here looks like the start of \
a shebang interpreter directive but it is not",
);
err.help(
"if you meant this to be a shebang interpreter directive, \
move it to the very start of the file",
);
}
bracket_res?;
let item = this.parse_attr_item(ForceCollect::No)?;
this.expect(exp!(CloseBracket))?;
let attr_sp = lo.to(this.prev_token.span);
Expand Down
7 changes: 6 additions & 1 deletion compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2709,7 +2709,12 @@ pub fn parse_crate_types_from_list(list_list: Vec<String>) -> Result<Vec<CrateTy
"cdylib" => CrateType::Cdylib,
"bin" => CrateType::Executable,
"proc-macro" => CrateType::ProcMacro,
_ => return Err(format!("unknown crate type: `{part}`")),
_ => {
return Err(format!(
"unknown crate type: `{part}`, expected one of: \
`lib`, `rlib`, `staticlib`, `dylib`, `cdylib`, `bin`, `proc-macro`",
));
}
};
if !crate_types.contains(&new_part) {
crate_types.push(new_part)
Expand Down
6 changes: 5 additions & 1 deletion library/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,13 @@ impl<T: ?Sized> Copy for &T {}
/// Notably, this doesn't include all trivially-destructible types for semver
/// reasons.
///
/// Bikeshed name for now.
/// Bikeshed name for now. This trait does not do anything other than reflect the
/// set of types that are allowed within unions for field validity.
#[unstable(feature = "bikeshed_guaranteed_no_drop", issue = "none")]
#[lang = "bikeshed_guaranteed_no_drop"]
#[rustc_deny_explicit_impl]
#[rustc_do_not_implement_via_object]
#[doc(hidden)]
pub trait BikeshedGuaranteedNoDrop {}

/// Types for which it is safe to share references between threads.
Expand Down
1 change: 0 additions & 1 deletion library/core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ impl<T: ?Sized> *const T {
/// This is an [Exposed Provenance][crate::ptr#exposed-provenance] API.
///
/// [`with_exposed_provenance`]: with_exposed_provenance
#[must_use]
#[inline(always)]
#[stable(feature = "exposed_provenance", since = "1.84.0")]
pub fn expose_provenance(self) -> usize {
Expand Down
2 changes: 0 additions & 2 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1908,8 +1908,6 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
llvm_components_passed = true;
}
if !builder.is_rust_llvm(target) {
// FIXME: missing Rust patches is not the same as being system llvm; we should rename the flag at some point.
// Inspecting the tests with `// no-system-llvm` in src/test *looks* like this is doing the right thing, though.
cmd.arg("--system-llvm");
}

Expand Down
1 change: 0 additions & 1 deletion src/ci/docker/host-aarch64/aarch64-gnu-debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV RUSTBUILD_FORCE_CLANG_BASED_TESTS 1
ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1

# llvm.use-linker conflicts with downloading CI LLVM
ENV NO_DOWNLOAD_CI_LLVM 1
Expand Down
2 changes: 0 additions & 2 deletions src/ci/docker/host-x86_64/mingw-check/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ COPY host-x86_64/mingw-check/check-default-config-profiles.sh /scripts/
COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/

ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1

# Check library crates on all tier 1 targets.
# We disable optimized compiler built-ins because that requires a C toolchain for the target.
# We also skip the x86_64-unknown-linux-gnu target as it is well-tested by other jobs.
Expand Down
1 change: 0 additions & 1 deletion src/ci/docker/host-x86_64/x86_64-gnu-debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV RUSTBUILD_FORCE_CLANG_BASED_TESTS 1
ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1

# llvm.use-linker conflicts with downloading CI LLVM
ENV NO_DOWNLOAD_CI_LLVM 1
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ docker \
--env TOOLSTATE_PUBLISH \
--env RUST_CI_OVERRIDE_RELEASE_CHANNEL \
--env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \
--env CI_JOB_DOC_URL="${CI_JOB_DOC_URL}" \
--env BASE_COMMIT="$BASE_COMMIT" \
--env DIST_TRY_BUILD \
--env PR_CI_JOB \
Expand Down
13 changes: 0 additions & 13 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,19 +260,6 @@ else
do_make "$RUST_CHECK_TARGET"
fi

if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then
rm -f config.toml
$SRC/configure --set change-id=99999999

# Save the build metrics before we wipe the directory
mv build/metrics.json .
rm -rf build
mkdir build
mv metrics.json build

CARGO_INCREMENTAL=0 ../x check
fi

echo "::group::sccache stats"
sccache --show-stats || true
echo "::endgroup::"
13 changes: 13 additions & 0 deletions src/doc/rustc-dev-guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ cargo +stable install josh-proxy --git https://github.com/josh-project/josh --ta
Older versions of `josh-proxy` may not round trip commits losslessly so it is important to install this exact version.

### Pull changes from `rust-lang/rust` into this repository

1) Checkout a new branch that will be used to create a PR into `rust-lang/rustc-dev-guide`
2) Run the pull command
```
Expand All @@ -95,3 +96,15 @@ Older versions of `josh-proxy` may not round trip commits losslessly so it is im
$ cargo run --manifest-path josh-sync/Cargo.toml rustc-push <branch-name> <gh-username>
```
2) Create a PR from `<branch-name>` into `rust-lang/rust`

#### Minimal git config

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.

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).

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.

```
$ GIT_CONFIG_GLOBAL=/path/to/minimal/gitconfig GIT_CONFIG_SYSTEM='' cargo +stable run --manifest-path josh-sync/Cargo.toml -- rustc-pull
```
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide/rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4ecd70ddd1039a3954056c1071e40278048476fa
8536f201ffdb2c24925d7f9e87996d7dca93428b
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
- [Inference details](./opaque-types-impl-trait-inference.md)
- [Return Position Impl Trait In Trait](./return-position-impl-trait-in-trait.md)
- [Region inference restrictions][opaque-infer]
- [Effect checking](./effects.md)
- [Const condition checking](./effects.md)
- [Pattern and Exhaustiveness Checking](./pat-exhaustive-checking.md)
- [Unsafety Checking](./unsafety-checking.md)
- [MIR dataflow](./mir/dataflow.md)
Expand Down
23 changes: 9 additions & 14 deletions src/doc/rustc-dev-guide/src/backend/updating-llvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ so let's go through each in detail.
at the time of the branch,
and the remaining part is the current date.

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

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

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

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

<!-- date-check: Sep 2024 -->
<!-- date-check: mar 2025 -->
> For prior art, here are some previous LLVM updates:
> - [LLVM 11](https://github.com/rust-lang/rust/pull/73526)
> - [LLVM 12](https://github.com/rust-lang/rust/pull/81451)
> - [LLVM 13](https://github.com/rust-lang/rust/pull/87570)
> - [LLVM 14](https://github.com/rust-lang/rust/pull/93577)
> - [LLVM 15](https://github.com/rust-lang/rust/pull/99464)
> - [LLVM 16](https://github.com/rust-lang/rust/pull/109474)
> - [LLVM 17](https://github.com/rust-lang/rust/pull/115959)
> - [LLVM 18](https://github.com/rust-lang/rust/pull/120055)
> - [LLVM 19](https://github.com/rust-lang/rust/pull/127513)
> - [LLVM 20](https://github.com/rust-lang/rust/pull/135763)

Note that sometimes it's easiest to land [`llvm-wrapper`] compatibility as a PR
before actually updating `src/llvm-project`.
Expand All @@ -194,17 +189,17 @@ so let's go through each in detail.
others interested in trying out the new LLVM can benefit from work you've done
to update the C++ bindings.

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

4. LLVM then announces the release of version `a.b`.
1. LLVM then announces the release of version `a.b`.

5. After LLVM's official release,
1. After LLVM's official release,
we follow the process of creating a new branch on the
rust-lang/llvm-project repository again,
this time with a new date.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Both `tracing::*` macros and the `tracing::instrument` proc-macro attribute need

```rs
#[cfg(feature = "tracing")]
use tracing::{instrument, trace};
use tracing::instrument;

struct Foo;

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

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

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

todo!()
Expand Down
5 changes: 2 additions & 3 deletions src/doc/rustc-dev-guide/src/building/new-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ These are a set of steps to add support for a new target. There are
numerous end states and paths to get there, so not all sections may be
relevant to your desired goal.

See also the associated documentation in the
[target tier policy][target_tier_policy_add].
See also the associated documentation in the [target tier policy].

<!-- toc -->

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

## Specifying a new LLVM

Expand Down
Loading
Loading