Commit Graph

277127 Commits

Author SHA1 Message Date
bors
870c13dc9b Auto merge of #135053 - workingjubilee:backtrace-without-ruzstd, r=workingjubilee
Bump backtrace to rust-lang/backtrace-rs@4d7906b

Compare: 230570f...4d7906b

Mostly cleanups and enabling backtraces for the RTEMS target.

r? `@ghost`
2025-01-03 03:56:07 +00:00
Michael Goulet
c29838843b Report impl has stricter requirements even when RPITIT inference gets in the way 2025-01-03 02:45:29 +00:00
Jubilee Young
6f5fd6d26a Bump backtrace to rust-lang/backtrace-rs@4d7906b
Compare: 230570f...4d7906b

Mostly cleanups and enabling backtraces for the RTEMS target.
2025-01-02 17:10:55 -08:00
Michael Goulet
0fd64efa2f Fix macro shenanigans 2025-01-02 23:39:17 +00:00
Michael Goulet
7601adb4a0 Make suggestion verbose and tweak error message 2025-01-02 23:39:17 +00:00
Michael Goulet
8e344ae127 Suppress type param suggestion if encountering invalid const infer 2025-01-02 23:39:16 +00:00
Michael Goulet
6885ff4a7b Unconditionally lower generic_arg_infer 2025-01-02 23:39:16 +00:00
Michael Goulet
b85a91fc59 More refined spans for placeholder error in const/static 2025-01-02 23:39:16 +00:00
Michael Goulet
c529fe0475 Remove diagnostic_only_typeck and fix placeholder suggestion for const/static 2025-01-02 23:39:16 +00:00
Michael Goulet
c5d4996404 nit: Make get_infer_ret_ty name more consistent with is_suggestable_infer_ty 2025-01-02 23:39:16 +00:00
Taylor Cramer
9281be94b5 Remove unused fields from RepeatElementCopy obligation 2025-01-02 14:46:36 -08:00
bors
ab3924b298 Auto merge of #122565 - Zoxc:atomic-panic-msg, r=the8472
Try to write the panic message with a single `write_all` call

This writes the panic message to a buffer before writing to stderr. This allows it to be printed with a single `write_all` call, preventing it from being interleaved with other outputs. It also adds newlines before and after the message ensuring that only the panic message will have its own lines.

Before:
```
thread 'thread 'thread 'thread 'thread '<unnamed>thread 'thread 'thread 'thread '<unnamed><unnamed>thread '<unnamed>' panicked at ' panicked at <unnamed><unnamed><unnamed><unnamed><unnamed>' panicked at <unnamed>' panicked at src\heap.rssrc\heap.rs'
panicked at ' panicked at ' panicked at ' panicked at ' panicked at src\heap.rs' panicked at src\heap.rs::src\heap.rssrc\heap.rssrc\heap.rssrc\heap.rssrc\heap.rs:src\heap.rs:455455:::::455:455::455455455455455:455:99:::::9:9:
:
999:
999:
assertion failed: size <= (*queue).block_size:
:
assertion failed: size <= (*queue).block_size:
assertion failed: size <= (*queue).block_size:
:
:
assertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_size

assertion failed: size <= (*queue).block_size
assertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_sizeerror: process didn't exit successfully: `target\debug\direct_test.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
```
After:
```

thread '<unnamed>' panicked at src\heap.rs:455:9:
assertion failed: size <= (*queue).block_size

thread '<unnamed>' panicked at src\heap.rs:455:9:
assertion failed: size <= (*queue).block_size

thread '<unnamed>' panicked at src\heap.rs:455:9:
assertion failed: size <= (*queue).block_size

error: process didn't exit successfully: `target\debug\direct_test.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
```

---

try-jobs: x86_64-gnu-llvm-18
2025-01-02 22:06:09 +00:00
Noratrieb
4da3aedb5e Pass objcopy args for stripping on OSX
When `-Cstrip` was changed to use the bundled rust-objcopy instead of
/usr/bin/strip on OSX, strip-like arguments were preserved.

But strip and objcopy are, while being the same binary, different, they
have different defaults depending on which binary they are.
Notably, strip strips everything by default, and objcopy doesn't strip
anything by default.

Additionally, `-S` actually means `--strip-all`, so debuginfo stripped
everything and symbols didn't strip anything.

We now correctly pass `--strip-debug` and `--strip-all`.
2025-01-02 22:17:39 +01:00
Michael Howell
8af769d1b1
Use is_some_and helper
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2025-01-02 14:08:43 -07:00
Michael Howell
c7cb8224e2 rustdoc: treat allowed_through_unstable_modules as deprecation
This ensures `std::intrinsics::transmute` is deemphasized
in the search engine and other UI, by cleaning it into a deprecation
without propagating it through reexports when the parent module
is stable.
2025-01-02 12:03:24 -07:00
bors
4363f9b6f6 Auto merge of #135040 - matthiaskrgr:rollup-34vsa8n, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #135016 (Ping me for rustc-dev-guide subtree changes on this repo)
 - #135027 (Remove range-metadata amdgpu workaround)
 - #135029 (Update mailmap)
 - #135033 (try to dedup me in the mailmap)
 - #135035 (Fix formatting command)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-02 19:02:41 +00:00
Lukas Markeffsky
93bb639ad6 taint fcx on selection errors during unsizing 2025-01-02 19:16:00 +01:00
Matthias Krüger
666794e5c7
Rollup merge of #135035 - Noratrieb:fixfmt, r=jieyouxu
Fix formatting command

The formatting command previously had two issues:
- if rustfmt failed, it would print the command invocation. this is unnecessarily noisy
- there was a race condition that lead to orphan rustfmts that would print their output after bootstrap exited

We fix this by
- removing the printing, it's not really useful
- threading failure through properly instead of just yoloing exit(1)
2025-01-02 18:27:22 +01:00
Matthias Krüger
ea662fc8cb
Rollup merge of #135033 - Eh2406:Eh2406-mailmap, r=jieyouxu
try to dedup me in the mailmap

I have a few more aliases than appeared in the mail map. Perhaps that is why I have been duplicated.
2025-01-02 18:27:21 +01:00
Matthias Krüger
7ec49fda6d
Rollup merge of #135029 - weihanglo:mailmap, r=jieyouxu
Update mailmap

Saw this Zulip thread: https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/Changes.20to.20thanks.2Erust-lang.2Eorg

and decided to add myself to mailmap
2025-01-02 18:27:21 +01:00
Matthias Krüger
e0cc6f15a2
Rollup merge of #135027 - Flakebi:remove-range-workaround, r=compiler-errors
Remove range-metadata amdgpu workaround

Range metadata was disabled for amdgpu due to a backend bug. I did not encounter any problems when removing the workaround to enable range metadata (tried compiling `core` and `alloc`), so I assume this has been fixed in LLVM in the last years.

Remove the workaround to re-enable range metadata.

Tracking issue: #135024
2025-01-02 18:27:20 +01:00
Matthias Krüger
c3ffc2d049
Rollup merge of #135016 - jieyouxu:dev-guide-ping-list, r=Kobzol
Ping me for rustc-dev-guide subtree changes on this repo

r? `@Kobzol`
2025-01-02 18:27:20 +01:00
Noratrieb
8b73fc5e27 Fix formatting command
The formatting command previously had two issues:
- if rustfmt failed, it would print the command invocation. this is
  unnecessarily noisy
- there was a race condition that lead to orphan rustfmts that would
  print their output after bootstrap exited

We fix this by
- removing the printing, it's not really useful
- threading failure through properly instead of just yoloing exit(1)
2025-01-02 17:26:46 +01:00
bors
1b2745d72a Auto merge of #135014 - Zalathar:tool-build-step, r=jieyouxu
bootstrap: Overhaul and simplify the `tool_extended!` macro

Similar to #134950, but for the macro that declares build steps for some tools.

The main changes are:
- Removing some functionality that isn't needed by any of the tools currently using the macro
- Moving some code out of the macro and into ordinary helper functions
- Switching to one macro invocation per tool, and struct-like syntax so that rustfmt will format them

There should be no functional change.
2025-01-02 16:18:28 +00:00
Urgau
c73d81ec33 Temporarily make the test cfg a well known bootstrap cfg 2025-01-02 16:49:55 +01:00
Urgau
e8a4792b3e Make the test cfg a "userspace" check-cfg 2025-01-02 16:49:55 +01:00
Jacob Finkelman
1b06dfd3fa
try to dedup me in the mailmap 2025-01-02 10:47:39 -05:00
Weihang Lo
da3b9ee36b
Update mailmap 2025-01-02 10:02:30 -05:00
Flakebi
56bf673f0a
Remove range-metadata amdgpu workaround
Range metadata was disabled for amdgpu due to a backend bug. I did not
encounter any problems when removing the workaround to enable range
metadata (tried compiling `core` and `alloc`), so I assume this has
been fixed in LLVM in the last years.

Remove the workaround to re-enable range metadata.
2025-01-02 15:45:04 +01:00
Liigo Zhuang
862fc62208 path in detail 2025-01-02 22:30:56 +08:00
bors
6ca66598ad Auto merge of #135023 - jieyouxu:boop, r=onur-ozkan
bootstrap: flip `compile::Rustc` vs `compile::Assemble`

The `PathSet` prefix matching unfortunately also has implications for `./x build compiler --stage 0`, because the path filter `"compiler"` gets consumed by `compile::Rustc` step first after `PathSet` prefix matching, whereas before `PathSet` prefix matching, `compile::Rustc` would not have consumed `"compiler"`.

This merely papers over #134970 to unblock contributors from using `./x build compiler --stage 0`.

The `PathSet` prefix matching behavior is tracked in #135022.

Closes #134970.
2025-01-02 13:29:37 +00:00
许杰友 Jieyou Xu (Joe)
552c1f5f45 bootstrap: temporarily flip compile::Rustc vs compile::Assemble
The PathSet prefix matching unfortunately also has implications for `./x
build compiler`, because the path filter `"compiler"` gets consumed by
`compile::Rustc` step first after PathSet prefix matching, whereas
before PathSet prefix matching, the later-registered `compile::Assemble`
step would've consumed the `"compiler"` path filter.

This merely papers over the issue with PathSet prefix handling to
unblock contributors for using `./x build compiler`.
2025-01-02 21:00:14 +08:00
Pavel Grigorenko
ee2ad4dfb1 Move some things to std::sync::poison and reexport them in std::sync 2025-01-02 15:21:41 +03:00
许杰友 Jieyou Xu (Joe)
44d2740a8d Ping me for rustc-dev-guide changes on r-l/r 2025-01-02 15:55:04 +08:00
Zalathar
5a32a35ab7 Move most of Step::should_run out of tool_extended! 2025-01-02 18:43:34 +11:00
Zalathar
08d70f57e2 Use struct-like syntax in tool_extended!
Using struct-like syntax allows rustfmt to format macro invocations, instead of
giving up and ignoring them.

Using a separate macro invocation per tool makes the macro slightly simpler,
and isolates syntax errors to individual invocations.
2025-01-02 18:43:34 +11:00
Zalathar
725fccda2b Move most of Step::run out of tool_extended! 2025-01-02 18:43:33 +11:00
bors
bf6f8a4d32 Auto merge of #135009 - DiuDiu777:box-doc, r=jhpratt
Fix doc for missing Box allocator consistency

### Description:
This PR addresses missing document regarding consistency of `Box::from_raw` and `Box::from_raw_in`.

- [from_raw](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.from_raw): The document now misses the raw pointer passed to `Box::from_raw` must point to a block of memory allocated by the `Global Allocator` (specified in source code).

- [from_raw_in](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.from_raw_in): The safety conditions don't include the allocator consistency.

Besides, [Boxed Memory Layout](https://doc.rust-lang.org/nightly/std/boxed/index.html#memory-layout) doesn't explicitly cover the allocator consistency issue.

This change builds upon the improvements made in [PR #134496](https://github.com/rust-lang/rust/pull/134496).
2025-01-02 06:56:57 +00:00
Zalathar
bba24a2ffe Don't pass (self, builder) identifiers to tool_extended! 2025-01-02 17:47:13 +11:00
Zalathar
b84c54ac87 Remove two unused parameters from tool_extended! 2025-01-02 17:47:13 +11:00
Zalathar
e76c484d6d Remove the unused extra_features field from tool_extended!
This field was introduced in #48097 to support the "clippy" feature of RLS.
2025-01-02 17:47:13 +11:00
LemonJ
a5494a8e6c fix doc for missing Box allocator consistency 2025-01-02 11:12:31 +08:00
bors
c528b8c678 Auto merge of #134907 - Kobzol:rustc-dev-guide-josh, r=ehuss
Turn rustc-dev-guide into a Josh subtree

Discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/196385-t-compiler.2Fwg-rustc-dev-guide/topic/a.20move.20to.20main.20repo.20.28rust-lang.2Frust.29).

Accompanying rustc-dev-guide PR: https://github.com/rust-lang/rustc-dev-guide/pull/2183

I didn't create a bootstrap step for rustc-dev-guide yet, because the rustc-dev-guide version that we currently use in this repo doesn't have linkcheck enabled and that fails tests.

The subtree starts with commit [ad93c5f1c49f2aeb45f7a4954017b1e607df9f5e](ad93c5f1c4).

What I did:
```
export DIR=src/doc/rustc-dev-guide

# Remove submodule
git submodule status ${DIR}
git submodule deinit ${DIR}
git rm -r --cached ${DIR}
rm -rf ${DIR}
# Remove rustc-dev-guide from .gitmodules
git commit -m"Removed `${DIR}` submodule"

# Import history with josh
git fetch https://github.com/rust-lang/rustc-dev-guide ad93c5f1c49f2aeb45f7a4954017b1e607df9f5e
josh-filter ':prefix=src/doc/rustc-dev-guide' FETCH_HEAD
git merge --allow-unrelated FILTERED_HEAD

# A few follow-up cleanup commits
```

r? ehuss
2025-01-02 03:05:42 +00:00
Michael Goulet
dd210eca43 Simplify declared_generic_bounds_from_env 2025-01-02 01:30:55 +00:00
Michael Goulet
2a373d7dd3 Make it clearer that the only infers we expect to see when processing outlives are regions 2025-01-02 00:48:06 +00:00
Michael Goulet
f3646748cd Remove hack for filtering out param-env outlives that match item-bound outlives 2025-01-02 00:48:06 +00:00
bors
504f4f5275 Auto merge of #130060 - EnzymeAD:enzyme-cg-llvm, r=oli-obk
Autodiff Upstreaming - rustc_codegen_llvm changes

Now that the autodiff/Enzyme backend is merged, this is an upstream PR for the `rustc_codegen_llvm` changes.
It also includes small changes to three files under `compiler/rustc_ast`, which overlap with my frontend PR (https://github.com/rust-lang/rust/pull/129458).
Here I only include minimal definitions of structs and enums to be able to build this backend code.
The same goes for minimal changes to `compiler/rustc_codegen_ssa`, the majority of changes there will be in another PR, once either this or the frontend gets merged.

We currently have 68 files left to merge, 19 in the frontend PR, 21 (+3 from the frontend) in this PR, and then ~30 in the middle-end.

This PR is large because it includes two of my three large files (~800 loc each). I could also first only upstream enzyme_ffi.rs, but I think people might want to see some use of these bindings in the same PR?

To already highlight the things which reviewers might want to discuss:

1) `enzyme_ffi.rs`: I do have a fallback module to make sure that we don't link rustc against Enzyme when we build rustc without autodiff support.

2) `add_panic_msg_to_global` was a pain to write and I currently can't even use it. Enzyme writes gradients into shadow memory. Pass in one float scalar? We'll allocate and return an extra float telling you how this float affected the output. Pass in a slice of floats? We'll let you allocate the vector and pass in a mutable reference to a float slice, we'll then write the gradient into that slice. It should be at least as large as your original slice, so we check that and panic if not. Currently we panic silently, but I already generate a nicer panic message with this function. I just don't know how to print it to the user. yet. I discussed this with a few rustc devs and the best we could come up with (for now), was to look for mangled panic calls in the IR and pick one, which works surprisingly reliably. If someone knows a good way to clean this up and print the panic message I'm all in, otherwise I can remove the code that writes the nicer panic message and keep the silent panic, since it's enough for soundness. Especially since this PR is already a bit larger.

3) `SanitizeHWAddress`: When differentiating C++, Enzyme can use TBAA to "understand" enums/unions, but for Rust we don't have this information. LLVM might to speculative loads which (without TBAA) confuse Enzyme, so we disable those with this attribute. This attribute is only set during the first opt run before Enzyme differentiates code. We then remove it again once we are done with autodiff and run the opt pipeline a second time. Since enums are everywhere in Rust, support for them is crucial, but if this looks too cursed I can remove these ~100 lines and keep them in my fork for now, we can then discuss them separately to make this PR simpler?

4) Duplicated llvm-opt runs: Differentiating already optimized code (and being able to do additional optimizations on the fly, e.g. for GPU code) is _the_ reason why Enzyme is so fast, so the compile time is acceptable for autodiff users:  https://enzyme.mit.edu/talks/Publications/ (There are also algorithmic issues in Enzyme core which are more serious than running opt twice).

5) I assume that if we merge these minimal cg_ssa changes here already, I also need to fix the other backends (GCC and cliff) to have dummy implementations, correct?

6) *I'm happy to split this PR up further if reviewers have recommendations on how to.*

For the full implementation, see: https://github.com/rust-lang/rust/pull/129175

Tracking:

- https://github.com/rust-lang/rust/issues/124509
2025-01-02 00:20:57 +00:00
bors
62b13a9019 Auto merge of #135005 - matthiaskrgr:rollup-5ubuitt, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #134967 (handle submodules automatically on `doc` steps)
 - #134973 (Fix typos)
 - #134984 (`ObligationCause` construction tweaks in typeck)
 - #134985 (Remove qualification of `std::cmp::Ordering` in `Ord` doc)
 - #135000 (Fix ICE when opaque captures a duplicated/invalid lifetime)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-01 21:37:33 +00:00
Matthias Krüger
92dbfcc2c0
Rollup merge of #135000 - compiler-errors:opaque-captures-dupe, r=lqd
Fix ICE when opaque captures a duplicated/invalid lifetime

See description on test.

Fixes #132766
Fixes #133693
Fixes #134780
2025-01-01 22:04:18 +01:00
Matthias Krüger
fac31a1398
Rollup merge of #134985 - mgsloan:remove-unnecessary-qualification-in-Ord-trait-docs, r=Noratrieb
Remove qualification of `std::cmp::Ordering` in `Ord` doc
2025-01-01 22:04:17 +01:00