Commit graph

163117 commits

Author SHA1 Message Date
bors
d9ca9bd014 Auto merge of #142556 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2025-06-16 11:25:56 +00:00
León Orell Valerian Liehr
b83fb800a7
Rollup merge of #142499 - Shourya742:2025-06-14-remove-check-run-bootstrap, r=Kobzol
Remove check run bootstrap

This PR migrates all usage of check_run to new execution context api's.

r? `@Kobzol`
2025-06-15 23:51:58 +02:00
León Orell Valerian Liehr
b79d3b1ec1
Rollup merge of #134661 - dtolnay:prefixattr, r=fmease
Reduce precedence of expressions that have an outer attr

Previously, `-Zunpretty=expanded` would expand this program as follows:

```rust
#![feature(stmt_expr_attributes)]

macro_rules! repro {
    ($e:expr) => {
        #[allow(deprecated)] $e
    };
}

#[derive(Default)]
struct Thing {
    #[deprecated]
    field: i32,
}

fn main() {
    let thing = Thing::default();
    let _ = repro!(thing).field;
}
```

```rs
#![feature(prelude_import)]
#![feature(stmt_expr_attributes)]
#[prelude_import]
use std::prelude::rust_2021::*;
#[macro_use]
extern crate std;

struct Thing {
    #[deprecated]
    field: i32,
}

#[automatically_derived]
impl ::core::default::Default for Thing {
    #[inline]
    fn default() -> Thing {
        Thing { field: ::core::default::Default::default() }
    }
}

fn main() {
    let thing = Thing::default();
    let _ = #[allow(deprecated)] thing.field;
}
```

This is not the correct expansion. The correct output would have `(#[allow(deprecated)] thing).field` with the attribute applying only to `thing`, not to `thing.field`.
2025-06-15 23:51:54 +02:00
León Orell Valerian Liehr
d6dc9656ea
Rollup merge of #133952 - bjorn3:remove_wasm_legacy_abi, r=alexcrichton
Remove wasm legacy abi

Closes https://github.com/rust-lang/rust/issues/122532
Closes https://github.com/rust-lang/rust/issues/138762
Fixes https://github.com/rust-lang/rust/issues/71871
https://github.com/rust-lang/rust/issues/88152
Fixes https://github.com/rust-lang/rust/issues/115666
Fixes https://github.com/rust-lang/rust/issues/129486
2025-06-15 23:51:53 +02:00
Ralf Jung
19beef4205 Merge from rustc 2025-06-15 20:46:23 +09:00
Ralf Jung
a576180419 Preparing for merge from rustc 2025-06-15 20:45:45 +09:00
bors
38c41d0f92 Auto merge of #142335 - nnethercote:rustdoc-json-allocations, r=aDotInTheVoid
rustdoc_json: reduce allocations

These commits reduce the number of allocations done for rustdoc_json, mostly by avoiding unnecessary clones.

Best reviewed one commit at a time.

r? `@aDotInTheVoid`
2025-06-14 23:21:16 +00:00
bit-aloo
c9eeeb4b5f
remove check_run function from helpers 2025-06-14 18:23:35 +05:30
bit-aloo
b5db059b83
remove check_run method from config 2025-06-14 17:10:44 +05:30
bit-aloo
c67f7ae27f
replace all instances of check_run in download with execution context 2025-06-14 17:10:07 +05:30
bit-aloo
e11e640013
replace all instances of check_run in config with execution context 2025-06-14 17:09:25 +05:30
bjorn3
4d536bd1dc Remove outdated docs about broken ABI 2025-06-14 09:57:07 +00:00
Matthias Krüger
db23a76217
Rollup merge of #141811 - mejrs:bye_locals, r=compiler-errors
Unimplement unsized_locals

Implements https://github.com/rust-lang/compiler-team/issues/630

Tracking issue here: https://github.com/rust-lang/rust/issues/111942

Note that this just removes the feature, not the implementation, and does not touch `unsized_fn_params`. This is because it is required to support `Box<dyn FnOnce()>: FnOnce()`.

There may be more that should be removed (possibly in follow up prs)
- the `forget_unsized` function and `forget` intrinsic.
- the `unsized_locals` test directory; I've just fixed up the tests for now
- various codegen support for unsized values and allocas

cc ``@JakobDegen`` ``@oli-obk`` ``@Noratrieb`` ``@programmerjake`` ``@bjorn3``

``@rustbot`` label F-unsized_locals

Fixes rust-lang/rust#79409
2025-06-14 11:27:10 +02:00
Matthias Krüger
9bdf5d371f
Rollup merge of #141399 - GuillaumeGomez:extracted-doctest, r=aDotInTheVoid
[rustdoc] Give more information into extracted doctest information

Follow-up of https://github.com/rust-lang/rust/pull/134531.

This update fragment the doctest code into its sub-parts to give more control to the end users on how they want to use it.

The new JSON looks like this:

```json
{
  "format_version":2,
  "doctests":[
    {
      "file":"$DIR/extract-doctests-result.rs",
      "line":8,
      "doctest_attributes":{
        "original":"",
        "should_panic":false,
        "no_run":false,
        "ignore":"None",
        "rust":true,
        "test_harness":false,
        "compile_fail":false,
        "standalone_crate":false,
        "error_codes":[],
        "edition":null,
        "added_css_classes":[],
        "unknown":[]
      },
      "original_code":"let x = 12;\nOk(())",
      "doctest_code":{
        "crate_level":"#![allow(unused)]\n",
        "code":"let x = 12;\nOk(())",
        "wrapper":{
          "before":"fn main() { fn _inner() -> core::result::Result<(), impl core::fmt::Debug> {\n",
          "after":"\n} _inner().unwrap() }",
          "returns_result":true
        }
      },
      "name":"$DIR/extract-doctests-result.rs - (line 8)"
    }
  ]
}
```

for this doctest:

```rust
let x = 12;
Ok(())
```

With this, I think it matches what you need ``@ojeda?`` If so, once merged I'll update the patch I sent to RfL.

r? ``@aDotInTheVoid``
2025-06-14 11:27:09 +02:00
Matthias Krüger
ade745e214
Rollup merge of #140593 - m-ou-se:some-temp, r=Nadrieril
Temporary lifetime extension through tuple struct and tuple variant constructors

This makes temporary lifetime extension work for tuple struct and tuple variant constructors, such as `Some()`.

Before:
```rust
let a = &temp(); // Extended
let a = Some(&temp()); // Not extended :(
let a = Some { 0: &temp() }; // Extended
```

After:
```rust
let a = &temp(); // Extended
let a = Some(&temp()); // Extended
let a = Some { 0: &temp() }; // Extended
```

So, with this change, this works:

```rust
let a = Some(&String::from("hello")); // New: String lifetime now extended!

println!("{a:?}");
```

Until now, we did not extend through tuple struct/variant constructors (like `Some`), because they are function calls syntactically, and we do not want to extend the String lifetime in:

```rust
let a = some_function(&String::from("hello")); // String not extended!
```

However, it turns out to be very easy to distinguish between regular functions and constructors at the point where we do lifetime extension.

In practice, constructors nearly always use UpperCamelCase while regular functions use lower_snake_case, so it should still be easy to for a human programmer at the call site to see whether something qualifies for lifetime extension or not.

This needs a lang fcp.

---

More examples of what will work after this change:

```rust
let x = Person {
    name: "Ferris",
    job: Some(&Job { // `Job` now extended!
        title: "Chief Rustacean",
        organisation: "Acme Ltd.",
    }),
};

dbg!(x);
```

```rust
let file = if use_stdout {
    None
} else {
    Some(&File::create("asdf")?) // `File` now extended!
};

set_logger(file);
```

```rust
use std::path::Component;

let c = Component::Normal(&OsString::from(format!("test-{num}"))); // OsString now extended!

assert_eq!(path.components.first().unwrap(), c);
```
2025-06-14 11:27:09 +02:00
Ralf Jung
82127d82a3 Merge from rustc 2025-06-14 10:41:37 +02:00
Ralf Jung
f7719c50b9 Preparing for merge from rustc 2025-06-14 10:41:22 +02:00
The Miri Cronjob Bot
e5b0c02c42 fmt 2025-06-14 05:03:34 +00:00
The Miri Cronjob Bot
1930043c36 Merge from rustc 2025-06-14 05:02:24 +00:00
bors
64033a4ee5 Auto merge of #142483 - workingjubilee:rollup-8qnhueh, r=workingjubilee
Rollup of 16 pull requests

Successful merges:

 - rust-lang/rust#140969 (Allow initializing logger with additional tracing Layer)
 - rust-lang/rust#141352 (builtin dyn impl no guide inference)
 - rust-lang/rust#142046 (add Vec::peek_mut)
 - rust-lang/rust#142273 (tests: Minicore `extern "gpu-kernel"` feature test)
 - rust-lang/rust#142302 (Rework how the disallowed qualifier in function type diagnostics are generated)
 - rust-lang/rust#142405 (Don't hardcode the intrinsic return types twice in the compiler)
 - rust-lang/rust#142434 ( Pre-install JS dependencies in tidy Dockerfile)
 - rust-lang/rust#142439 (doc: mention that intrinsics should not be called in user code)
 - rust-lang/rust#142441 (Delay replacing escaping bound vars in `FindParamInClause`)
 - rust-lang/rust#142449 (Require generic params for const generic params)
 - rust-lang/rust#142452 (Remove "intermittent" wording from `ReadDir`)
 - rust-lang/rust#142459 (Remove output helper bootstrap)
 - rust-lang/rust#142460 (cleanup search graph impl)
 - rust-lang/rust#142461 (compiletest: Clarify that `--no-capture` is needed with `--verbose`)
 - rust-lang/rust#142475 (Add platform support docs & maintainers for *-windows-msvc)
 - rust-lang/rust#142480 (tests: Convert two handwritten minicores to add-core-stubs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-14 04:58:22 +00:00
The Miri Cronjob Bot
69b2bb67b1 Preparing for merge from rustc 2025-06-14 04:55:08 +00:00
Jubilee
e3aa60d947
Rollup merge of #142475 - wesleywiser:windows_msvc_maintainers, r=ChrisDenton
Add platform support docs & maintainers for *-windows-msvc

Thanks to `@ChrisDenton,` `@dpaoliello,` `@lambdageek` and `@sivadeilra` for agreeing to be target maintainers!

cc rust-lang/rust#113739
2025-06-13 20:59:22 -07:00
Jubilee
52894f9698
Rollup merge of #142461 - Enselic:no-capture-tip, r=jieyouxu
compiletest: Clarify that `--no-capture` is needed with `--verbose`

Confusingly, this does not make compile test print what command is used to run a ui test:

    ./x test tests/ui/panics/abort-on-panic.rs --verbose

It is also necessary to pass `--no-capture`, like this:

    ./x test tests/ui/panics/abort-on-panic.rs --verbose --no-capture

Then you will see prints like this:

    executing cd "/rust/build/x86_64-unknown-linux-gnu/test/ui/panics/abort-on-panic.next" && \
        RUSTC="/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" \
        RUST_TEST_THREADS="32" \
        "/rust/build/x86_64-unknown-linux-gnu/test/ui/panics/abort-on-panic.next/a"

Add a hint in the code for this that would have helped me figure this out.

(See https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/compiltest.20show.20rustc.20commands.3F for some more context.)
2025-06-13 20:59:22 -07:00
Jubilee
8b22fcbd51
Rollup merge of #142459 - Shourya742:2025-06-11-remove-output-helper, r=Kobzol
Remove output helper bootstrap

This PR removes output utility helper method.

r? `@Kobzol`
2025-06-13 20:59:21 -07:00
Jubilee
c3537c2f9e
Rollup merge of #142441 - compiler-errors:lazier-binder-value-folding, r=lcnr
Delay replacing escaping bound vars in `FindParamInClause`

By uplifting the `BoundVarReplacer`, which is used by (e.g.) normalization to replace escaping bound vars that are encountered when folding binders, we can use a similar strategy to delay the instantiation of a binder's contents in the `FindParamInClause` used by the new trait solver.

This should alleviate the recently added requirement that `Binder<T>: TypeVisitable` only if `T: TypeFoldable`, which was previously required b/c we were calling `enter_forall` so that we could structurally normalize aliases that we found within the predicates of a param-env clause.

r? lcnr
2025-06-13 20:59:19 -07:00
Jubilee
fa359f66a1
Rollup merge of #142434 - Kobzol:preinstall-eslint, r=marcoieni
Pre-install JS dependencies in tidy Dockerfile

Also fixes passing `TIDY_PRINT_DIFF` to tidy, which has been passed to `npm install` rather than to tidy after the latest change here.

r? `@GuillaumeGomez`

Fixes: https://github.com/rust-lang/rust/issues/142433
2025-06-13 20:59:18 -07:00
bors
64c81fd105 Auto merge of #142235 - Kobzol:rustc-dist-alt-assertions, r=marcoieni
Build rustc with assertions in `dist-alt` jobs

Revival of https://github.com/rust-lang/rust/pull/131077, to check CI times now that we don't do PGO/BOLT anymore on Linux `-alt` builds.

r? `@ghost`

try-job: dist-x86_64-msvc-alt
try-job: dist-x86_64-linux-alt
2025-06-14 01:59:38 +00:00
David Tolnay
2171f89eb2
Reduce precedence of expressions that have an outer attr 2025-06-13 18:09:13 -07:00
Wesley Wiser
bdc531e92e Add platform support docs & maintainers for *-windows-msvc 2025-06-13 17:16:30 -05:00
Michael Goulet
b138202002 TypeVisiting binders no longer requires TypeFolding its interior 2025-06-13 17:54:45 +00:00
bors
8da623945f Auto merge of #142443 - matthiaskrgr:rollup-l1l6d0v, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#128425 (Make `missing_fragment_specifier` an unconditional error)
 - rust-lang/rust#135927 (retpoline and retpoline-external-thunk flags (target modifiers) to enable retpoline-related target features)
 - rust-lang/rust#140770 (add `extern "custom"` functions)
 - rust-lang/rust#142176 (tests: Split dont-shuffle-bswaps along opt-levels and arches)
 - rust-lang/rust#142248 (Add supported asm types for LoongArch32)
 - rust-lang/rust#142267 (assert more in release in `rustc_ast_lowering`)
 - rust-lang/rust#142274 (Update the stdarch submodule)
 - rust-lang/rust#142276 (Update dependencies in `library/Cargo.lock`)
 - rust-lang/rust#142308 (Upgrade `object`, `addr2line`, and `unwinding` in the standard library)

Failed merges:

 - rust-lang/rust#140920 (Extract some shared code from codegen backend target feature handling)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: aarch64-apple
try-job: x86_64-msvc-1
try-job: x86_64-gnu
try-job: dist-i586-gnu-i586-i686-musl
try-job: test-various
2025-06-13 17:44:15 +00:00
Martin Nordholts
764e97c86b compiletest: Clarify that --no-capture is needed with --verbose
Confusingly, this does not make compile test print what command is used
to run a ui test:

    ./x test tests/ui/panics/abort-on-panic.rs --verbose

It is also necessary to pass `--no-capture`, like this:

    ./x test tests/ui/panics/abort-on-panic.rs --verbose --no-capture

Now you will see prints like this:

    executing cd "/rust/build/x86_64-unknown-linux-gnu/test/ui/panics/abort-on-panic.next" && \
        RUSTC="/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" \
        RUST_TEST_THREADS="32" \
        "/rust/build/x86_64-unknown-linux-gnu/test/ui/panics/abort-on-panic.next/a"

Add a hint in the code for this that would have helped me figure this out.
2025-06-13 17:37:30 +02:00
bors
0d6ab209c5 Auto merge of #142451 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

1 day late. Got distracted yesterday evening and forgot about it.
2025-06-13 14:42:56 +00:00
bit-aloo
2f7cc5a285
remove output from helpers 2025-06-13 20:03:29 +05:30
bit-aloo
66beaa6e5d
replace output usage in bootstrap/lib.rs with new execution context 2025-06-13 20:03:24 +05:30
bit-aloo
da0cceebf0
replace output usage in sanity with new execution context 2025-06-13 18:29:48 +05:30
bors
c359117819 Auto merge of #142442 - matthiaskrgr:rollup-6yodjfx, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#134847 (Implement asymmetrical precedence for closures and jumps)
 - rust-lang/rust#141491 (Delegate `<CStr as Debug>` to `ByteStr`)
 - rust-lang/rust#141770 (Merge `Cfg::render_long_html` and `Cfg::render_long_plain` methods common code)
 - rust-lang/rust#142069 (Introduce `-Zmacro-stats`)
 - rust-lang/rust#142158 (Tracking the old name of renamed unstable library features)
 - rust-lang/rust#142221 ([AIX] strip underlying xcoff object)
 - rust-lang/rust#142340 (miri: we can use apfloat's mul_add now)
 - rust-lang/rust#142379 (Add bootstrap option to compile a tool with features)
 - rust-lang/rust#142410 (intrinsics: rename min_align_of to align_of)
 - rust-lang/rust#142413 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-13 11:42:31 +00:00
Philipp Krones
9cb0a64e51
Move COERCE_CONTAINER_TO_ANY to nursery, as it has FPs 2025-06-13 12:55:22 +02:00
Philipp Krones
8fe9c2cc6b
Merge commit '4ef75291b5' into clippy-subtree-update 2025-06-13 11:24:45 +02:00
Mara Bos
ff5ba7aa74 Update tests. 2025-06-13 09:20:48 +02:00
Jakub Beránek
9d642fe6f3
Pre-install eslint in mingw-check-tidy Dockerfile 2025-06-13 06:54:36 +02:00
Matthias Krüger
f6b02bbfa3
Rollup merge of #142248 - heiher:loong32-asm-types, r=Amanieu
Add supported asm types for LoongArch32

r? ``````@Amanieu``````
2025-06-13 05:19:15 +02:00
Matthias Krüger
1a865fbe4e
Rollup merge of #135927 - azhogin:azhogin/retpoline, r=davidtwco
retpoline and retpoline-external-thunk flags (target modifiers) to enable retpoline-related target features

`-Zretpoline` and `-Zretpoline-external-thunk` flags are target modifiers (tracked to be equal in linked crates).
* Enables target features for `-Zretpoline-external-thunk`:
`+retpoline-external-thunk`, `+retpoline-indirect-branches`, `+retpoline-indirect-calls`.
* Enables target features for `-Zretpoline`:
`+retpoline-indirect-branches`, `+retpoline-indirect-calls`.

It corresponds to clang -mretpoline & -mretpoline-external-thunk flags.

Also this PR forbids to specify those target features manually (warning).

Issue: rust-lang/rust#116852
2025-06-13 05:19:13 +02:00
Matthias Krüger
9c826de980
Rollup merge of #142413 - tshepang:rdg-push, r=jieyouxu
rustc-dev-guide subtree update

r? `@ghost`
2025-06-13 05:17:00 +02:00
Matthias Krüger
86e9995e7a
Rollup merge of #142410 - RalfJung:align_of, r=WaffleLapkin,workingjubilee
intrinsics: rename min_align_of to align_of

Now that `pref_align_of` is gone (https://github.com/rust-lang/rust/pull/141803), we can give the intrinsic backing `align_of` its proper name.

r? `@workingjubilee` or `@bjorn3`
2025-06-13 05:16:59 +02:00
Matthias Krüger
4838c0085c
Rollup merge of #142379 - Stypox:bootstrap-tool-config, r=Kobzol
Add bootstrap option to compile a tool with features

Add an option to specify which features to build a tool with, e.g. it will be useful to build Miri with tracing enabled:
```toml
tool-config.miri.features = ["tracing"]
```

See [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Passing.20--features.20to.20Miri.20build.20using.20.2E.2Fx.2Epy/with/523564773) for the options considered. If the final decision will be different than what I wrote now, I will update the code as needed. The reason why the option is `tool-config.miri.features` instead of something like `tool-features.miri` is to possibly allow adding more tool-specific configurations in the future.

I didn't do any validation of the keys of the `tool-config` hashmap, since I saw that no validation is done on the `tools` hashset either.

I don't like much the fact that features can be chosen by various places of the codebase: `Step`s can have some fixed `extra_features`, `prepare_tool_cargo` will add features depending on some bootstrapping options, and the newly added option can also contribute features to tools. However I think it is out of scope of this PR to try to refactor all of that (if it even is refactorable), so I left a comment in the codebase explaining all of the sources of features I could find.
2025-06-13 05:16:59 +02:00
Matthias Krüger
7cf087060c
Rollup merge of #142340 - RalfJung:miri-apfloat-mul-add, r=oli-obk
miri: we can use apfloat's mul_add now

With https://github.com/rust-lang/rustc_apfloat/issues/11 fixed, there is no reason to still use host floats here.
Fixes https://github.com/rust-lang/miri/issues/2995

We already have a test for this:
a7153db254/src/tools/miri/tests/pass/float.rs (L998-L1003)

r? ``@oli-obk``
2025-06-13 05:16:58 +02:00
Matthias Krüger
fac011eb2d
Rollup merge of #142158 - xizheyin:141617, r=jdonszelmann
Tracking the old name of renamed unstable library features

This PR resolves the first problem of rust-lang/rust#141617 : tracking renamed unstable features. The first commit is to add a ui test, and the second one tracks the changes. I will comment on the code for clarification.

r? `@jdonszelmann`
There have been a lot of PR's reviewed by you lately, thanks for your time!

cc `@jyn514`
2025-06-13 05:16:56 +02:00
Matthias Krüger
9639a7c522
Rollup merge of #142069 - nnethercote:Zmacro-stats, r=petrochenkov
Introduce `-Zmacro-stats`

Introduce `-Zmacro-stats`.

It collects data about macro expansions and prints them in a table after expansion finishes. It's very useful for detecting macro bloat, especially for proc macros.

r? `@petrochenkov`
2025-06-13 05:16:56 +02:00
Matthias Krüger
06dc33853e
Rollup merge of #141770 - GuillaumeGomez:cfg-false-mod-rendering, r=camelid
Merge `Cfg::render_long_html` and `Cfg::render_long_plain` methods common code

Follow-up of https://github.com/rust-lang/rust/pull/141747.

Thanks `@camelid` for spotting it!

r? `@camelid`
2025-06-13 05:16:55 +02:00