Commit Graph

21219 Commits

Author SHA1 Message Date
Matthew Maurer
258915a555 llvm: Accept new LLVM lifetime format
LLVM removed the size parameter from the lifetime format.
Tolerate not having that size parameter.
2025-08-11 22:00:41 +00:00
Cameron Steffen
3aa0ac0a8a Tweak trait modifier errors 2025-08-11 16:58:21 -05:00
Cameron Steffen
fa733909ed Move trait impl modifier errors to parsing
This is a technically a breaking change for what can be parsed in
`#[cfg(false)]`.
2025-08-11 16:58:21 -05:00
Cameron Steffen
39c5d6d1ca Factor out InherentImplCannotUnsafe 2025-08-11 16:58:20 -05:00
Mads Marquart
1d1316240f Always attempt to invoke xcrun to get the Apple SDK
The exact reasoning why we do not always pass the SDK root when linking
on macOS eludes me, but I suspect it's because we want to support
compiler drivers which do not support the `-isysroot` option.

Since we now pass the SDK root via the environment variable SDKROOT,
compiler drivers that don't support it can just ignore it.

Similarly, since we only warn when xcrun fails, users that expect their
compiler driver to provide the SDK location can do so now.
2025-08-11 23:31:07 +02:00
Chen Zhongyao
a4cf5e9eca Add new Tier-3 target: riscv64a23-unknown-linux-gnu 2025-08-11 21:08:35 +00:00
bors
1ebbd87a62 Auto merge of #145254 - GuillaumeGomez:rollup-7bp43pv, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#144966 ( Improve suggestion for "missing function argument" on multiline call)
 - rust-lang/rust#145111 (remove some unused private trait impls)
 - rust-lang/rust#145221 (Fix Cargo cross-compilation (take two))
 - rust-lang/rust#145247 (Update `sysinfo` version to `0.37.0`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-11 19:28:22 +00:00
Esteban Küber
32ee26c625 Add more docs to templates for attrs with incorrect arguments 2025-08-11 17:02:32 +00:00
bors
6355cd39c8 Auto merge of #145207 - Kobzol:codegen-backend-clif-dist, r=jieyouxu
Ship correct Cranelift library in its dist component

The first commit adds a post-dist UI test to check that Cranelift can be used with the extracted dist x64 Linux archive.

The original codegen copy logic in the Cranelift dist step was a bit redundant, and I didn't notice in https://github.com/rust-lang/rust/pull/144787 that it's copying the codegen backend from the build compiler's sysroot, rather than the target compiler's sysroot. The second commit modifies the logic to directly access the built codegen file (there is no need to search for it in the compiler's sysroot, in fact when you run just `x dist rustc_codegen_cranelift`, it shouldn't "taint" the sysroot with the codegen backend! Which it did before https://github.com/rust-lang/rust/pull/144787) and copy it to the tarball under a normalized name. Thus we get around any similar potential issues in the future, and make previously implicit logic more explicit.

This also fixes running just `x dist rustc_codegen_cranelift` without enabling `cranelift` in `rust.codegen-backends`, which should have been enabled by https://github.com/rust-lang/rust/pull/144787, but it didn't work fully, because the dist step tried to copy the codegen backend from the compiler's sysroot, but it didn't contain the codegen backend if it was not enabled by `rust.codegen-backends`.

Fixes: https://github.com/rust-lang/rust/issues/145201

try-job: dist-x86_64-linux
2025-08-11 16:13:06 +00:00
Esteban Küber
413ca5d9f0 fix tests 2025-08-11 16:05:02 +00:00
Esteban Küber
6bb29af766 Add link to invalid repr error 2025-08-11 16:00:49 +00:00
Esteban Küber
625143bac3 Add link to docs on malformed attributes 2025-08-11 16:00:49 +00:00
Esteban Küber
189f264926 Allow attr entries to declare list of alternatives for List and NamedValueStr
Modify `AttributeTemplate` to support list of alternatives for list and name value attribute styles.

Suggestions now provide more correct suggested code:

```
error[E0805]: malformed `used` attribute input
  --> $DIR/used_with_multi_args.rs:3:1
   |
LL | #[used(compiler, linker)]
   | ^^^^^^------------------^
   |       |
   |       expected a single argument here
   |
help: try changing it to one of the following valid forms of the attribute
   |
LL - #[used(compiler, linker)]
LL + #[used(compiler)]
   |
LL - #[used(compiler, linker)]
LL + #[used(linker)]
   |
LL - #[used(compiler, linker)]
LL + #[used]
   |
```

instead of the prior "masking" of the lack of this feature by suggesting pipe-separated lists:

```
error[E0805]: malformed `used` attribute input
  --> $DIR/used_with_multi_args.rs:3:1
   |
LL | #[used(compiler, linker)]
   | ^^^^^^------------------^
   |       |
   |       expected a single argument here
   |
help: try changing it to one of the following valid forms of the attribute
   |
LL - #[used(compiler, linker)]
LL + #[used(compiler|linker)]
   |
LL - #[used(compiler, linker)]
LL + #[used]
   |
```
2025-08-11 16:00:49 +00:00
binarycat
c022ed9927 don't emit rustdoc::broken_intra_doc_links for stuff like [!NOTE] 2025-08-11 10:50:44 -05:00
Guillaume Gomez
180e7ce700 Rollup merge of #144966 - scrabsha:push-rozroqqmurvu, r=jdonszelmann
Improve suggestion for "missing function argument" on multiline call

`rustc` has a very neat suggestion when the argument count does not match, with a nice placeholder that shows where an argument may be missing. Unfortunately the suggestion is always single-line, even when the function call spans across multiple lines. With this PR, `rustc` tries to guess if the function call is multiline or not, and emits a multiline suggestion when required.

r? `@jdonszelmann`
2025-08-11 16:19:04 +02:00
tiif
bcf87e4172 Update error message 2025-08-11 13:28:23 +00:00
tiif
d523b9f325 Support using #[unstable_feature_bound] on trait 2025-08-11 13:28:19 +00:00
Sasha Pourcelot
6603fe1caa Port #[allow_internal_unsafe] to the new attribute system (attempt 2) 2025-08-11 15:01:52 +02:00
Nikita Popov
ebef9d7f63 Set dead_on_return attribute for indirect arguments
Set the dead_on_return attribute (added in LLVM 21) for arguments
that are passed indirectly, but not byval.

This indicates that the value of the argument on return does not
matter, enabling additional dead store elimination.
2025-08-11 12:39:23 +02:00
Stuart Cook
3ce0ee2555 Rollup merge of #145225 - joshtriplett:infinite-print-no-semi, r=lqd
Fix macro infinite recursion test to not trigger warning about semicolon in expr

The test cases for rust-lang/rust#41731 are about infinite macro recursion that
incorporates `print!` and `println!`. However, they also included
trailing semicolons despite expanding to expressions; that isn't what
these particular test cases are designed to test.

Eliminate the trailing semicolons, to simplify future work on removing
this special case. Every *other* macro that expands to a semicolon in an
expression is a test case for that specifically.
2025-08-11 18:22:33 +10:00
Stuart Cook
ad14de2375 Rollup merge of #145194 - compiler-errors:coro-witness-re, r=lcnr
Ignore coroutine witness type region args in auto trait confirmation

## The problem

Consider code like:

```
async fn process<'a>() {
    Box::pin(process()).await;
}

fn require_send(_: impl Send) {}

fn main() {
    require_send(process());
}
```

When proving that the coroutine `{coroutine@process}::<'?0>: Send`, we end up instantiating a nested goal `{witness@process}::<'?0>: Send` by synthesizing a witness type from the coroutine's args:

Proving a coroutine witness type implements an auto trait requires looking up the coroutine's witness types. The witness types are a binder that look like `for<'r> { Pin<Box<{coroutine@process}::<'r>>> }`. We instantiate this binder with placeholders and prove `Send` on the witness types. This ends up eventually needing to prove something like `{coroutine@process}::<'!1>: Send`. Repeat this process, and we end up in an overflow during fulfillment, since fulfillment does not use freshening.

This can be visualized with a trait stack that ends up looking like:
* `{coroutine@process}::<'?0>: Send`
  * `{witness@process}::<'?0>: Send`
    * `Pin<Box<{coroutine@process}::<'!1>>>: Send`
      * `{coroutine@process}::<'!1>: Send`
        * ...
          * `{coroutine@process}::<'!2>: Send`
            * `{witness@process}::<'!2>: Send`
              * ...
                * overflow!

The problem here specifically comes from the first step: synthesizing a witness type from the coroutine's args.

## Why wasn't this an issue before?

Specifically, before 63f6845e57, this wasn't an issue because we were instead extracting the witness from the coroutine type itself. It turns out that given some `{coroutine@process}::<'?0>`, the witness type was actually something like `{witness@process}::<'erased>`!

So why do we end up with a witness type with `'erased` in its args? This is due to the fact that opaque type inference erases all regions from the witness. This is actually explicitly part of opaque type inference -- changing this to actually visit the witness types actually replicates this overflow even with 63f6845e57 reverted:

ca77504943/compiler/rustc_borrowck/src/type_check/opaque_types.rs (L303-L313)

To better understand this difference and how it avoids a cycle, if you look at the trait stack before 63f6845e57, we end up with something like:

* `{coroutine@process}::<'?0>: Send`
  * `{witness@process}::<'erased>: Send` **<-- THIS CHANGED**
    * `Pin<Box<{coroutine@process}::<'!1>>>: Send`
      * `{coroutine@process}::<'!1>: Send`
        * ...
          * `{coroutine@process}::<'erased>: Send` **<-- THIS CHANGED**
            * `{witness@process}::<'erased>: Send` **<-- THIS CHANGED**
              * coinductive cycle! 🎉

## So what's the fix?

This hack replicates the behavior in opaque type inference to erase regions from the witness type, but instead erasing the regions during auto trait confirmation. This is kinda a hack, but is sound. It does not need to be replicated in the new trait solver, of course.

---

I hope this explanation makes sense.

We could beta backport this instead of the revert https://github.com/rust-lang/rust/pull/145193, but then I'd like to un-revert that on master in this PR along with landing this this hack. Thoughts?

r? lcnr
2025-08-11 18:22:33 +10:00
Stuart Cook
4e87b74810 Rollup merge of #144156 - compiler-errors:dtorck-upvars, r=lcnr
Check coroutine upvars in dtorck constraint

Fix rust-lang/rust#144155.

This PR fixes an unsoundness where we were not considering coroutine upvars as drop-live if the coroutine interior types (witness types) had nothing which required drop.

In the case that the coroutine does not have any interior types that need to be dropped, then we don't need to treat all of the upvars as use-live; instead, this PR uses the same logic as closures, and descends into the upvar types to collect anything that must be drop-live. The rest of this PR is reworking the comment to explain the behavior here.

r? `@lcnr` or reassign 😸

---

Just some thoughts --- a proper fix for this whole situation would be to consider `TypingMode` in the `needs_drop` function, and just calling `coroutine_ty.needs_drop(tcx, typing_env)` in the dtorck constraint check.

During MIR building, we should probably use a typing mode that stalls the local coroutines and considers them to be unconditionally drop, or perhaps just stall *all* coroutines in analysis mode. Then in borrowck mode, we can re-check `needs_drop` but descend into witness types properly. https://github.com/rust-lang/rust/pull/144158 implements this experimentally.

This is a pretty involved fix, and conflicts with some in-flight changes (rust-lang/rust#144157) that I have around removing coroutine witnesses altogether. I'm happy to add a FIXME to rework this whole approach, but I don't want to block this quick fix since it's obviously more correct than the status-quo.
2025-08-11 18:22:31 +10:00
Stuart Cook
64aea0027a Rollup merge of #135331 - fmease:ban-assoc-ty-unbounds, r=lcnr
Reject relaxed bounds inside associated type bounds (ATB)

**Reject** relaxed bounds — most notably `?Sized` — inside associated type bounds `TraitRef<AssocTy: …>`.

This was previously accepted without warning despite being incorrect: ATBs are *not* a place where we perform *sized elaboration*, meaning `TraitRef<AssocTy: …>` does *not* elaborate to `TraitRef<AssocTy: Sized + …>` if `…` doesn't contain `?Sized`. Therefore `?Sized` is meaningless. In no other (stable) place do we (intentionally) allow relaxed bounds where we don't also perform sized elab, this is highly inconsistent and confusing! Another point of comparison: For the desugared `$SelfTy: TraitRef, $SelfTy::AssocTy: …` we don't do sized elab either (and thus also don't allow relaxed bounds).

Moreover — as I've alluded to back in https://github.com/rust-lang/rust/pull/135841#pullrequestreview-2619462717 — some later validation steps only happen during sized elaboration during HIR ty lowering[^1]. Namely, rejecting duplicates (e.g., `?Trait + ?Trait`) and ensuring that `Trait` in `?Trait` is equal to `Sized`[^2]. As you can probably guess, on stable/master we don't run these checks for ATBs (so we allow even more nonsensical bounds like `Iterator<Item: ?Copy>` despite T-types's ruling established in the FCP'ed rust-lang/rust#135841).

This PR rectifies all of this. I cratered this back in 2025-01-10 with (allegedly) no regressions found ([report](https://github.com/rust-lang/rust/pull/135331#issuecomment-2585330783), [its analysis](https://github.com/rust-lang/rust/pull/135331#issuecomment-2585356422)). [However a contributor manually found two occurrences](https://github.com/rust-lang/rust/issues/135229#issuecomment-2581832852) of `TraitRef<AssocTy: ?Sized>` in small hobby projects (presumably via GH code search). I immediately sent downstream PRs: https://github.com/Gui-Yom/turbo-metrics/pull/14, https://github.com/ireina7/summon/pull/1 (however, the owners have showed no reaction so far).

I'm leaning towards banning these forms **without a FCW** because a FCW isn't worth the maintenance cost[^3]. Note that associated type bounds were stabilized in 1.79.0 (released 2024-06-13 which is 13 months ago), so the proliferation of ATBs shouldn't be that high yet. If you think we should do another crater run since the last one was 6 months ago, I'm fine with that.

Fixes rust-lang/rust#135229.

[^1]: I consider this a flaw in the implementation and [I've already added a huge FIXME](82a02aefe0/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs (L195-L207)).
[^2]: To be more precise, if the internal flag `-Zexperimental-default-bounds` is provided other "default traits" (needs internal feature `lang_items`) are permitted as well (cc closely related internal feature: `more_maybe_bounds`).
[^3]: Having to track this and adding an entire lint whose remnants would remain in the code base forever (we never *fully* remove lints).
2025-08-11 18:22:31 +10:00
bors
53af067bb0 Auto merge of #145236 - Zalathar:rollup-1ggbztv, r=Zalathar
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#143949 (Constify remaining traits/impls for `const_ops`)
 - rust-lang/rust#144330 (document assumptions about `Clone` and `Eq` traits)
 - rust-lang/rust#144350 (std: sys: io: io_slice: Add UEFI types)
 - rust-lang/rust#144558 (Point at the `Fn()` or `FnMut()` bound that coerced a closure, which caused a move error)
 - rust-lang/rust#145149 (Make config method invoke inside parse use dwn_ctx)
 - rust-lang/rust#145227 (Tweak spans providing type context on errors when involving macros)
 - rust-lang/rust#145228 (Remove unnecessary parentheses in `assert!`s)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-11 02:59:13 +00:00
Stuart Cook
44c9eceb26 Rollup merge of #145227 - estebank:tweak-inference-span, r=joshtriplett
Tweak spans providing type context on errors when involving macros

Do not point at macro invocation multiple times when we try to add span labels mentioning what type each expression has, which is unnecessary when the error is at a macro invocation.
2025-08-11 12:21:09 +10:00
Stuart Cook
907076c3dd Rollup merge of #144558 - estebank:issue-68119, r=lcnr
Point at the `Fn()` or `FnMut()` bound that coerced a closure, which caused a move error

When encountering a move error involving a closure because the captured value isn't `Copy`, and the obligation comes from a bound on a type parameter that requires `Fn` or `FnMut`, we point at it and explain that an `FnOnce` wouldn't cause the move error.

```
error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure
  --> f111.rs:15:25
   |
14 | fn do_stuff(foo: Option<Foo>) {
   |             ---  ----------- move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait
   |             |
   |             captured outer variable
15 |     require_fn_trait(|| async {
   |                      -- ^^^^^ `foo` is moved here
   |                      |
   |                      captured by this `Fn` closure
16 |         if foo.map_or(false, |f| f.foo()) {
   |            --- variable moved due to use in coroutine
   |
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
  --> f111.rs:12:53
   |
12 | fn require_fn_trait<F: Future<Output = ()>>(_: impl Fn() -> F) {}
   |                                                     ^^^^^^^^^
help: consider cloning the value if the performance cost is acceptable
   |
16 |         if foo.clone().map_or(false, |f| f.foo()) {
   |               ++++++++
```

Fix rust-lang/rust#68119, by pointing at `Fn` and `FnMut` bounds involved in move errors.
2025-08-11 12:21:08 +10:00
bors
21a19c297d Auto merge of #135846 - estebank:non-exhaustive-dfv-ctor-2, r=BoxyUwU
Detect struct construction with private field in field with default

When trying to construct a struct that has a public field of a private type, suggest using `..` if that field has a default value.

```
error[E0603]: struct `Priv1` is private
  --> $DIR/non-exhaustive-ctor-2.rs:19:39
   |
LL |     let _ = S { field: (), field1: m::Priv1 {} };
   |                            ------     ^^^^^ private struct
   |                            |
   |                            while setting this field
   |
note: the struct `Priv1` is defined here
  --> $DIR/non-exhaustive-ctor-2.rs:14:4
   |
LL |    struct Priv1 {}
   |    ^^^^^^^^^^^^
help: the type `Priv1` of field `field1` is private, but you can construct the default value defined for it in `S` using `..` in the struct initializer expression
   |
LL |     let _ = S { field: (), .. };
   |                            ~~
```
2025-08-10 23:47:25 +00:00
Josh Triplett
38df15805b cfg_select: Support unbraced expressions
When operating on expressions, `cfg_select!` can now handle expressions
without braces. (It still requires braces for other things, such as
items.)

Expand the test coverage and documentation accordingly.
2025-08-10 16:18:01 -07:00
dianne
9449b78621 show a trailing comma on singleton tuple constructors in witness pats 2025-08-10 15:32:14 -07:00
Esteban Küber
48816e7493 Do not point at macro invocation when providing inference context 2025-08-10 21:55:02 +00:00
Esteban Küber
d9bd24d331 Add test showing innecessary inference span 2025-08-10 21:52:23 +00:00
Esteban Küber
e9609abda4 Account for macros when trying to point at inference cause
Do not point at macro invocation which expands to an inference error. Avoid the following:

```
error[E0308]: mismatched types
  --> $DIR/does-not-have-iter-interpolated.rs:12:5
   |
LL |     quote!($($nonrep)*);
   |     ^^^^^^^^^^^^^^^^^^^
   |     |
   |     expected `HasIterator`, found `ThereIsNoIteratorInRepetition`
   |     expected due to this
   |     here the type of `has_iter` is inferred to be `ThereIsNoIteratorInRepetition`
```
2025-08-10 21:47:52 +00:00
Josh Triplett
0885f660a5 Fix macro infinite recursion test to not trigger warning about semicolon in expr
The test cases for issue 41731 are about infinite macro recursion that
incorporates `print!` and `println!`. However, they also included
trailing semicolons despite expanding to expressions; that isn't what
these particular test cases are designed to test.

Eliminate the trailing semicolons, to simplify future work on removing
this special case. Every *other* macro that expands to a semicolon in an
expression is a test case for that specifically.
2025-08-10 14:08:18 -07:00
bors
c8ca44c98e Auto merge of #145223 - jhpratt:rollup-xcqbwqe, r=jhpratt
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#144553 (Rehome 32 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`)
 - rust-lang/rust#145064 (Add regression test for `saturating_sub` bounds check issue)
 - rust-lang/rust#145121 (bootstrap: `x.py dist rustc-src` should keep LLVM's siphash)
 - rust-lang/rust#145150 (Replace unsafe `security_attributes` function with safe `inherit_handle` alternative)
 - rust-lang/rust#145152 (Use `eq_ignore_ascii_case` to avoid heap alloc in `detect_confuse_type`)
 - rust-lang/rust#145200 (mbe: Fix typo in attribute tracing)
 - rust-lang/rust#145222 (Fix typo with paren rustc_llvm/build.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-10 20:44:38 +00:00
Jacob Pratt
a7a4e17225 Rollup merge of #145064 - okaneco:saturating_sub_regression_tests, r=nikic
Add regression test for `saturating_sub` bounds check issue

Add codegen test for issue where `valid_index.saturating_sub(X)` produced an extra bounds check.
This was fixed by the LLVM upgrade.

Closes rust-lang/rust#139759
2025-08-10 15:43:53 -04:00
Jacob Pratt
5bd4e832d3 Rollup merge of #144553 - Oneirical:uncountable-integer-4, r=jieyouxu
Rehome 32 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`

rust-lang/rust#143902 divided into smaller, easier to review chunks.

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
2025-08-10 15:43:52 -04:00
Esteban Küber
2484e189bf Add support for method calls 2025-08-10 19:22:49 +00:00
Esteban Küber
1aa5668d20 Point at the Fn() or FnMut() bound that coerced a closure, which caused a move error
When encountering a move error involving a closure because the captured value isn't `Copy`, and the obligation comes from a bound on a type parameter that requires `Fn` or `FnMut`, we point at it and explain that an `FnOnce` wouldn't cause the move error.

```
error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure
  --> f111.rs:15:25
   |
14 | fn do_stuff(foo: Option<Foo>) {
   |             ---  ----------- move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait
   |             |
   |             captured outer variable
15 |     require_fn_trait(|| async {
   |                      -- ^^^^^ `foo` is moved here
   |                      |
   |                      captured by this `Fn` closure
16 |         if foo.map_or(false, |f| f.foo()) {
   |            --- variable moved due to use in coroutine
   |
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
  --> f111.rs:12:53
   |
12 | fn require_fn_trait<F: Future<Output = ()>>(_: impl Fn() -> F) {}
   |                                                     ^^^^^^^^^
help: consider cloning the value if the performance cost is acceptable
   |
16 |         if foo.clone().map_or(false, |f| f.foo()) {
   |               ++++++++
```
2025-08-10 19:22:49 +00:00
Esteban Küber
464a6b1b4a Detect struct construction with private field in field with default
When trying to construct a struct that has a public field of a private type, suggest using `..` if that field has a default value.

```
error[E0603]: struct `Priv1` is private
  --> $DIR/non-exhaustive-ctor.rs:25:39
   |
LL |     let _ = S { field: (), field1: m::Priv1 {} };
   |                            ------     ^^^^^ private struct
   |                            |
   |                            while setting this field
   |
note: the struct `Priv1` is defined here
  --> $DIR/non-exhaustive-ctor.rs:14:4
   |
LL |    struct Priv1 {}
   |    ^^^^^^^^^^^^
help: the field `field1` you're trying to set has a default value, you can use `..` to use it
   |
LL |     let _ = S { field: (), .. };
   |                            ~~
```
2025-08-10 19:15:18 +00:00
Jakub Beránek
6893e691ea Add a post-dist test for compiling a basic program with Cranelift 2025-08-10 20:46:30 +02:00
bors
29737cb44b Auto merge of #144544 - JonathanBrouwer:illformed-in-deps, r=traviscross
Start reporting future breakage for `ILL_FORMED_ATTRIBUTE_INPUT` in dependencies

This has been a warn lint since early 2019 and a deny-by-default lint since late 2019.
We're currently transitioning some of the cases where this lint is being produced to a hard error (https://github.com/rust-lang/rust/pull/143607 https://github.com/rust-lang/rust/pull/143808 and more)
So let's report this lint in all dependencies for the remaining attributes

r? `@traviscross`
`@rustbot` labels +I-lang-nominated +T-lang -T-compiler
cc `@jdonszelmann`

(Separate question: Why does the "Future incompatibility report" only trigger if `report_in_deps` is true, even if the future incompatibility happens in the same crate, is this correct?)

This also needs a crater run, but I don't have permissions to trigger this
2025-08-10 17:44:40 +00:00
Oneirical
aa543963c6 Rehome tests/ui/issues/ tests [4/?] 2025-08-10 11:54:15 -04:00
Eval EXEC
de13718c66 test: Add rustdoc test for enum negative overflow 2025-08-10 23:02:53 +08:00
bors
18eeac04fc Auto merge of #145210 - Zalathar:rollup-dm4reb2, r=Zalathar
Rollup of 17 pull requests

Successful merges:

 - rust-lang/rust#141624 (unstable-book: Add stubs for environment variables; document some of the important ones)
 - rust-lang/rust#143093 (Simplify polonius location-sensitive analysis)
 - rust-lang/rust#144402 (Stabilize loongarch32 inline asm)
 - rust-lang/rust#144403 (`tests/ui/issues/`: The Issues Strike Back [4/N])
 - rust-lang/rust#144739 (Use new public libtest `ERROR_EXIT_CODE` constant in rustdoc)
 - rust-lang/rust#145089 (Improve error output when a command fails in bootstrap)
 - rust-lang/rust#145112 ([win][arm64ec] Partial fix for raw-dylib-link-ordinal on Arm64EC)
 - rust-lang/rust#145129 ([win][arm64ec] Add `/machine:arm64ec` when linking LLVM as Arm64EC)
 - rust-lang/rust#145130 (improve "Documentation problem" issue template.)
 - rust-lang/rust#145135 (Stabilize `duration_constructors_lite` feature)
 - rust-lang/rust#145145 (some `derive_more` refactors)
 - rust-lang/rust#145147 (rename `TraitRef::from_method` to `from_assoc`)
 - rust-lang/rust#145156 (Override custom Cargo `build-dir` in bootstrap)
 - rust-lang/rust#145160 (Change days-threshold to 28 in [behind-upstream])
 - rust-lang/rust#145162 (`{BTree,Hash}Map`: add "`Entry` API" section heading)
 - rust-lang/rust#145187 (Fix an unstable feature comment that wasn't a doc comment)
 - rust-lang/rust#145191 (`suggest_borrow_generic_arg`: use the correct generic args)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-10 14:17:41 +00:00
Pierre Tardy
bc14ad38a3 strip prefix of temporary file names when it exceeds filesystem name length limit
When doing lto, rustc generates filenames that are concatenating many information.

In the case of this testcase, it is concatenating crate name and rust file name, plus some hash, and the extension.
In some other cases it will concatenate even more information reducing the maximum effective crate name to about 110 chars on linux filesystems where
filename max length is 255

This commit is ensuring that the temporary file names are limited in size, while still reasonabily ensuring the unicity (with hashing of the stripped part)
2025-08-10 15:50:40 +02:00
Lee ByeongJun
ba350ff911 fix: re-enable self-assignment 2025-08-10 22:50:14 +09:00
Guillaume Gomez
25e767b0ee Ignore impl associated types in jump to def feature 2025-08-10 15:49:22 +02:00
Folkert de Vries
3e76b58453 add place mention for #[loop_match] scrutinee 2025-08-10 14:25:49 +02:00
Guillaume Gomez
d528a49fd7 Fix panic if an item does not have a body 2025-08-10 12:00:08 +02:00
Guillaume Gomez
f1649a4e43 Better handling of paths in link to def feature 2025-08-10 12:00:08 +02:00