Commit graph

3086 commits

Author SHA1 Message Date
Jacob Pratt
c19c4b91f5
Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obk
Autodiff Upstreaming - rustc_codegen_ssa, rustc_middle

This PR should not be merged until the rustc_codegen_llvm part is merged.
I will also alter it a little based on what get's shaved off from the cg_llvm PR,
and address some of the feedback I received in the other PR (including cleanups).

I am putting it already up to
1) Discuss with `@jieyouxu` if there is more work needed to add tests to this and
2) Pray that there is someone reviewing who can tell me why some of my autodiff invocations get lost.

Re 1: My test require fat-lto. I also modify the compilation pipeline. So if there are any other llvm-ir tests in the same compilation unit then I will likely break them. Luckily there are two groups who currently have the same fat-lto requirement for their GPU code which I have for my autodiff code and both groups have some plans to enable support for thin-lto. Once either that work pans out, I'll copy it over for this feature. I will also work on not changing the optimization pipeline for functions not differentiated, but that will require some thoughts and engineering, so I think it would be good to be able to run the autodiff tests isolated from the rest for now. Can you guide me here please?
For context, here are some of my tests in the samples folder: https://github.com/EnzymeAD/rustbook

Re 2: This is a pretty serious issue, since it effectively prevents publishing libraries making use of autodiff: https://github.com/EnzymeAD/rust/issues/173. For some reason my dummy code persists till the end, so the code which calls autodiff, deletes the dummy, and inserts the code to compute the derivative never gets executed. To me it looks like the rustc_autodiff attribute just get's dropped, but I don't know WHY? Any help would be super appreciated, as rustc queries look a bit voodoo to me.

Tracking:

- https://github.com/rust-lang/rust/issues/124509

r? `@jieyouxu`
2025-01-31 00:26:30 -05:00
Manuel Drehwald
1f30517d40 upstream rustc_codegen_ssa/rustc_middle changes for enzyme/autodiff 2025-01-29 21:31:13 -05:00
Josh Stone
314238f92e Flip the rustc-rayon/indexmap dependency order
[`rustc-rayon v0.5.1`](https://github.com/rust-lang/rustc-rayon/pull/14)
added `indexmap` implementations that will allow `indexmap` to drop its
own "internal-only" implementations.

(This is separate from `indexmap`'s implementation for normal `rayon`.)
2025-01-27 10:14:37 -08:00
jyn
c1b4ab0e73 Shorten linker output even more when --verbose is not present
- Don't show environment variables. Seeing PATH is almost never useful, and it can be extremely long.
- For .rlibs in the sysroot, replace crate hashes with a `"-*"` string. This will expand to the full crate name when pasted into the shell.
- Move `.rlib` to outside the glob.
- Abbreviate the sysroot path to `<sysroot>` wherever it appears in the arguments.

This also adds an example of the linker output as a run-make test. Currently it only runs on x86_64-unknown-linux-gnu, because each platform has its own linker arguments. So that it's stable across machines, pass BUILD_ROOT as an argument through compiletest through to run-make tests.

- Only use linker-flavor=gnu-cc if we're actually going to compare the output. It doesn't exist on MacOS.
2025-01-25 16:04:52 -05:00
Matthias Krüger
dafc861aa3
Rollup merge of #135766 - lcnr:candidate-assembly-3, r=compiler-errors
handle global trait bounds defining assoc types

This also fixes the compare-mode for
- tests/ui/coherence/coherent-due-to-fulfill.rs
- tests/ui/codegen/mono-impossible-2.rs
- tests/ui/trivial-bounds/trivial-bounds-inconsistent-projection.rs
- tests/ui/nll/issue-61320-normalize.rs

I first considered the alternative to always prefer where-bounds during normalization, regardless of how the trait goal has been proven by changing `fn merge_candidates` instead. ecda83b30f/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs (L785)

This approach is more restrictive than behavior of the old solver to avoid mismatches between trait and normalization goals. This may be breaking in case the where-bound adds unnecessary region constraints and we currently don't ever try to normalize an associated type. I would like to detect these cases and change the approach to exactly match the old solver if required. I want to minimize cases where attempting to normalize in more places causes code to break.

r? `@compiler-errors`
2025-01-23 19:54:25 +01:00
Matthias Krüger
b0bb6e3474
Rollup merge of #135850 - alexcrichton:update-wasm-component-ld, r=jieyouxu
Update the `wasm-component-ld` tool

This commit updates the `wasm-component-ld` tool from 0.5.11 to 0.5.12. This pulls in a fix for the binary adapters that are included with this tool for an issue described in bytecodealliance/wasmtime#10058. Some other dependencies have additionally been updated in the meantime of `wasm-component-ld` but there should otherwise be no major changes.
2025-01-22 19:29:42 +01:00
Alex Crichton
8600694b89 Update the wasm-component-ld tool
This commit updates the `wasm-component-ld` tool from 0.5.11 to 0.5.12.
This pulls in a fix for the binary adapters that are included with this
tool for an issue described in bytecodealliance/wasmtime#10058. Some
other dependencies have additionally been updated in the meantime of
`wasm-component-ld` but there should otherwise be no major changes.
2025-01-21 15:22:01 -08:00
klensy
84ce2e129a bumpt compiler and tools to windows 0.59 2025-01-21 16:48:44 +03:00
lcnr
7171fee4ec remove unnecessary collection 2025-01-20 18:51:45 +01:00
github-actions
715c3d4fcf cargo update
compiler & tools dependencies:
     Locking 13 packages to latest compatible versions
    Updating anstyle-wincon v3.0.6 -> v3.0.7
    Updating bitflags v2.7.0 -> v2.8.0
    Updating chrono-tz v0.10.0 -> v0.10.1
    Updating js-sys v0.3.76 -> v0.3.77
    Updating log v0.4.22 -> v0.4.25
    Updating miniz_oxide v0.8.2 -> v0.8.3
    Updating uuid v1.11.1 -> v1.12.0
    Updating valuable v0.1.0 -> v0.1.1
    Updating wasm-bindgen v0.2.99 -> v0.2.100
    Updating wasm-bindgen-backend v0.2.99 -> v0.2.100
    Updating wasm-bindgen-macro v0.2.99 -> v0.2.100
    Updating wasm-bindgen-macro-support v0.2.99 -> v0.2.100
    Updating wasm-bindgen-shared v0.2.99 -> v0.2.100
note: pass `--verbose` to see 41 unchanged dependencies behind latest

library dependencies:
     Locking 1 package to latest compatible version
    Updating miniz_oxide v0.8.2 -> v0.8.3
note: pass `--verbose` to see 4 unchanged dependencies behind latest

rustbook dependencies:
     Locking 12 packages to latest compatible versions
    Updating anstyle-wincon v3.0.6 -> v3.0.7
    Updating bitflags v2.7.0 -> v2.8.0
    Updating cc v1.2.8 -> v1.2.10
    Updating js-sys v0.3.76 -> v0.3.77
    Updating log v0.4.22 -> v0.4.25
    Updating miniz_oxide v0.8.2 -> v0.8.3
      Adding rustversion v1.0.19
    Updating wasm-bindgen v0.2.99 -> v0.2.100
    Updating wasm-bindgen-backend v0.2.99 -> v0.2.100
    Updating wasm-bindgen-macro v0.2.99 -> v0.2.100
    Updating wasm-bindgen-macro-support v0.2.99 -> v0.2.100
    Updating wasm-bindgen-shared v0.2.99 -> v0.2.100
2025-01-19 00:21:55 +00:00
Rémy Rakic
00844be421 new solver: prefer trivial builtin impls over where-clauses
for now, only builtin `Sized` impls are tracked as being `Trivial`
2025-01-17 18:50:29 +00:00
github-actions
0f1e253066 cargo update
compiler & tools dependencies:
     Locking 27 packages to latest compatible versions
    Updating bitflags v2.6.0 -> v2.7.0
    Updating clap v4.5.23 -> v4.5.26
    Updating clap_builder v4.5.23 -> v4.5.26
    Updating clap_complete v4.5.40 -> v4.5.42
    Updating clap_derive v4.5.18 -> v4.5.24
    Updating handlebars v6.2.0 -> v6.3.0
    Updating libz-sys v1.1.20 -> v1.1.21
    Updating linux-raw-sys v0.4.14 -> v0.4.15
    Updating phf v0.11.2 -> v0.11.3
    Updating phf_codegen v0.11.2 -> v0.11.3
    Updating phf_generator v0.11.2 -> v0.11.3
    Updating phf_shared v0.11.2 -> v0.11.3
    Updating pin-project-lite v0.2.15 -> v0.2.16
    Updating proc-macro2 v1.0.92 -> v1.0.93
    Updating rustix v0.38.42 -> v0.38.43
    Updating serde_json v1.0.134 -> v1.0.135
      Adding siphasher v1.0.1
    Updating syn v2.0.94 -> v2.0.96
    Updating thiserror v2.0.9 -> v2.0.11
    Updating thiserror-impl v2.0.9 -> v2.0.11
    Updating tokio v1.42.0 -> v1.43.0
    Updating uuid v1.11.0 -> v1.11.1
    Updating wasm-encoder v0.222.0 -> v0.223.0
      Adding wasmparser v0.223.0
    Updating wast v222.0.0 -> v223.0.0
    Updating wat v1.222.0 -> v1.223.0
    Updating xattr v1.3.1 -> v1.4.0
note: pass `--verbose` to see 39 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 4 unchanged dependencies behind latest

rustbook dependencies:
     Locking 27 packages to latest compatible versions
    Updating bitflags v2.6.0 -> v2.7.0
    Updating cc v1.2.7 -> v1.2.8
    Updating clap v4.5.23 -> v4.5.26
    Updating clap_builder v4.5.23 -> v4.5.26
    Updating clap_complete v4.5.40 -> v4.5.42
    Updating clap_derive v4.5.18 -> v4.5.24
      Adding darling v0.20.10
      Adding darling_core v0.20.10
      Adding darling_macro v0.20.10
      Adding derive_builder v0.20.2
      Adding derive_builder_core v0.20.2
      Adding derive_builder_macro v0.20.2
    Updating handlebars v6.2.0 -> v6.3.0
      Adding ident_case v1.0.1
    Updating linux-raw-sys v0.4.14 -> v0.4.15
    Updating phf v0.11.2 -> v0.11.3
    Updating phf_codegen v0.11.2 -> v0.11.3
    Updating phf_generator v0.11.2 -> v0.11.3
    Updating phf_shared v0.11.2 -> v0.11.3
    Updating proc-macro2 v1.0.92 -> v1.0.93
    Updating rustix v0.38.42 -> v0.38.43
    Updating serde_json v1.0.134 -> v1.0.135
      Adding siphasher v1.0.1
    Updating syn v2.0.94 -> v2.0.96
    Updating thiserror v2.0.9 -> v2.0.11
    Updating thiserror-impl v2.0.9 -> v2.0.11
    Updating winnow v0.6.22 -> v0.6.24
2025-01-12 00:23:37 +00:00
David Wood
cc9a9ecccb
mir_build: check annotated functions w/out callers 2025-01-10 18:37:57 +00:00
Philipp Krones
43c3b30d37
Update Cargo.lock 2025-01-09 19:33:06 +01:00
bors
6afee111c2 Auto merge of #133858 - dianne:better-blame-constraints-for-static, r=lcnr
`best_blame_constraint`: Blame better constraints when the region graph has cycles from invariance or `'static`

This fixes #132749 by changing which constraint is blamed for region errors in several cases. `best_blame_constraint` had a heuristic that tried to pinpoint the constraint causing an error by filtering out any constraints where the outliving region is unified with the ultimate target region being outlived. However, it used the SCCs of the region graph to do this, which is unreliable; in particular, if the target region is `'static`, or if there are cycles from the presence of invariant types, it was skipping over the constraints it should be blaming. As is the case in that issue, this could lead to confusing diagnostics. The simplest fix seems to work decently, judging by test stderr: this makes `best_blame_constraint` no longer filter constraints by their outliving region's SCC.

There are admittedly some quirks in the test output. In many cases, subdiagnostics that depend on the particular constraint being blamed have either started or stopped being emitted. After starting at this for quite a while, I think anything too fickle about whether it outputs based on the particular constraint being blamed should instead be looking at the constraint path as a whole, similar to what's done for [the placeholder-from-predicate note](https://github.com/rust-lang/rust/compare/master...dianne:rust:better-blame-constraints-for-static#diff-3c0de6462469af483c9ecdf2c4b00cb26192218ef2d5c62a0fde75107a74caaeR506).

Very many tests involving invariant types gained a note pointing out the types' invariance, but in a few cases it was lost. A particularly illustrative example is [tests/ui/lifetimes/copy_modulo_regions.stderr](https://github.com/rust-lang/rust/compare/master...dianne:rust:better-blame-constraints-for-static?expand=1#diff-96e1f8b29789b3c4ce2f77a5e0fba248829b97ef9d1ce39e7d2b4aa57b2cf4f0); I'd argue the new constraint is a better one to blame, but it lacks the variance diagnostic information that's elsewhere in the constraint path. If desired, I can try making that note check the whole path rather than just the blamed constraint.

The subdiagnostic [`BorrowExplanation::add_object_lifetime_default_note`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/diagnostics/explain_borrow/enum.BorrowExplanation.html#method.add_object_lifetime_default_note) depends on a `Cast` being blamed, so [a special case](364ca7f99c) was necessary to keep it from disappearing from tests specifically testing for it. However, see the FIXME comment in that commit; I think the special case should be removed once that subdiagnostic works properly, but it's nontrivial enough to warrant a separate PR. Incidentally, this removes the note from a test where it was being added erroneously: in [tests/ui/borrowck/two-phase-surprise-no-conflict.stderr](https://github.com/rust-lang/rust/compare/master...dianne:rust:better-blame-constraints-for-static?expand=1#diff-8cf085af8203677de6575a45458c9e6b03412a927df879412adec7e4f7ff5e14), the object lifetime is explicitly provided and it's not `'static`.
2025-01-08 12:37:54 +00:00
dianne
6421d4cf80 best_blame_constraint: prioritize blaming interesting-seeming constraints 2025-01-06 16:12:11 -08:00
Matthias Krüger
8e2631bdb6
Rollup merge of #135146 - Zalathar:anyhow-backtrace, r=jieyouxu
Don't enable anyhow's `backtrace` feature in opt-dist

As of the stabilization of `std::backtrace` in Rust 1.65, this package flag has no effect other than to enable an unused dependency on the `backtrace` crate.

(See <af0937ef72/Cargo.toml (L18-L23)>.)

While the presence of this feature in opt-dist doesn't cause other tools (which use anyhow) to actually *build* backtrace, it does affect the global crate graph used for dependency version resolution. After removing this feature, we can use `cargo tree --invert --package backtrace` to see that the only remaining reverse-dependency of backtrace is `color-eyre`, which is used by `ui_test`.
2025-01-06 20:59:35 +01:00
Zalathar
85e0d42a77 Don't enable anyhow's backtrace feature in opt-dist
As of the stabilization of `std::backtrace` in Rust 1.65, this package flag has
no effect other than to enable an unused dependency on the `backtrace` crate.
2025-01-06 13:08:49 +11:00
Jacob Pratt
b9f971a52c
Rollup merge of #135115 - Zalathar:dwarf-const, r=workingjubilee
cg_llvm: Use constants for DWARF opcodes, instead of FFI calls

Split off from #134009 to incorporate feedback from https://github.com/rust-lang/rust/pull/134009#discussion_r1903133906.

Most of the constant values now come from gimli, which is already a compiler dependency.

I noticed that `DW_OP_LLVM_fragment` is an LLVM detail that is not defined by DWARF and could hypothetically change, so I added a static assertion on the C++ side to detect that if it ever happens.

r? workingjubilee
2025-01-05 18:35:04 -05:00
Zalathar
e267106104 Use gimli to get the values of DWARF constants needed by codegen
The `gimli` crate is already a dependency of `thorin-dwp`, which is already a
dependency of `rustc_codegen_ssa`.
2025-01-05 22:07:48 +11:00
github-actions
7bcf985334 cargo update
compiler & tools dependencies:
     Locking 4 packages to latest compatible versions
    Updating bstr v1.11.1 -> v1.11.3
    Updating spdx v0.10.7 -> v0.10.8
    Updating syn v2.0.93 -> v2.0.94
    Updating tempfile v3.14.0 -> v3.15.0
note: pass `--verbose` to see 35 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 3 unchanged dependencies behind latest

rustbook dependencies:
     Locking 5 packages to latest compatible versions
    Updating bstr v1.11.1 -> v1.11.3
    Updating cc v1.2.6 -> v1.2.7
    Updating syn v2.0.93 -> v2.0.94
    Updating tempfile v3.14.0 -> v3.15.0
    Updating winnow v0.6.20 -> v0.6.22
2025-01-05 00:22:51 +00:00
Chris Denton
cfe61320b8
Bump cc in the compiler 2025-01-03 11:51:13 +00:00
bors
c1566141b6 Auto merge of #134865 - clubby789:proc-macro-tls, r=onur-ozkan
bootstrap: Don't apply -Ztls-model=initial-exec to deps of proc-macros

Fixes #134863

1. Checks if a crate name is in a static list before applying the flag
2. Adds a tidy check that gathers transitive deps of proc macros and ensures the list is up to date

cc `@bjorn3` - the issue specifies `rustc_fluent_macro` but I assume this applies to all proc macro crates.
2024-12-30 07:26:13 +00:00
clubby789
f4d215ea91 Add tidy check for list of proc-macro crate transitive dependencies 2024-12-29 21:48:03 +00:00
Stuart Cook
ea2851b24b
Rollup merge of #134869 - clubby789:cc-bump, r=jieyouxu
Bump compiler cc

Fixes #134657
Pulls in https://github.com/rust-lang/cc-rs/pull/1330

try-job: x86_64-msvc
2024-12-29 22:45:38 +11:00
clubby789
8c8fed7ea9 Bump compiler cc 2024-12-29 00:30:32 +00:00
github-actions
519c233cbb cargo update
compiler & tools dependencies:
     Locking 8 packages to latest compatible versions
    Updating anyhow v1.0.94 -> v1.0.95
    Updating glob v0.3.1 -> v0.3.2
    Updating quote v1.0.37 -> v1.0.38
    Updating rustversion v1.0.18 -> v1.0.19
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating unicase v2.8.0 -> v2.8.1
note: pass `--verbose` to see 36 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 5 unchanged dependencies behind latest

rustbook dependencies:
     Locking 7 packages to latest compatible versions
    Updating anyhow v1.0.94 -> v1.0.95
    Updating cc v1.2.5 -> v1.2.6
    Updating quote v1.0.37 -> v1.0.38
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating unicase v2.8.0 -> v2.8.1
2024-12-29 00:22:58 +00:00
github-actions
b4ef16857e cargo update
compiler & tools dependencies:
     Locking 15 packages to latest compatible versions
    Updating clap_complete v4.5.39 -> v4.5.40
    Updating env_filter v0.1.2 -> v0.1.3
    Updating env_logger v0.11.5 -> v0.11.6
    Updating expect-test v1.5.0 -> v1.5.1
    Updating foldhash v0.1.3 -> v0.1.4
    Updating miniz_oxide v0.8.1 -> v0.8.2
    Updating object v0.36.5 -> v0.36.7
    Updating serde_json v1.0.133 -> v1.0.134
    Updating thiserror v2.0.7 -> v2.0.9
    Updating thiserror-impl v2.0.7 -> v2.0.9
    Updating tinyvec v1.8.0 -> v1.8.1
    Updating wasm-encoder v0.221.2 -> v0.222.0
    Removing wasmparser v0.218.0
    Removing wasmparser v0.221.2
      Adding wasmparser v0.222.0
    Updating wast v221.0.2 -> v222.0.0
    Updating wat v1.221.2 -> v1.222.0
note: pass `--verbose` to see 35 unchanged dependencies behind latest

library dependencies:
     Locking 1 package to latest compatible version
    Updating object v0.36.5 -> v0.36.7
note: pass `--verbose` to see 6 unchanged dependencies behind latest

rustbook dependencies:
     Locking 9 packages to latest compatible versions
    Updating cc v1.2.0 -> v1.2.5
    Updating clap_complete v4.5.39 -> v4.5.40
    Updating env_filter v0.1.2 -> v0.1.3
    Updating env_logger v0.11.5 -> v0.11.6
    Updating libc v0.2.168 -> v0.2.169
    Updating miniz_oxide v0.8.1 -> v0.8.2
    Updating serde_json v1.0.133 -> v1.0.134
    Updating thiserror v2.0.7 -> v2.0.9
    Updating thiserror-impl v2.0.7 -> v2.0.9
2024-12-22 00:22:56 +00:00
bors
4c40c89c26 Auto merge of #134505 - jieyouxu:boop-compiler-cc, r=clubby789,jieyouxu
Bump compiler `cc` to 1.2.5

- `cc` 1.2.4 contains a fix to address [rustc uses wrong build tools when compiling from MSVC #133794](https://github.com/rust-lang/rust/issues/133794). See <https://github.com/rust-lang/cc-rs/releases/tag/cc-v1.2.4>.
- `cc` 1.2.5 contains a fix to also check linking when testing if certain compiler flags are supported, which fixed an issue that was causing previous compiler `cc` bumps to fail. See <https://github.com/rust-lang/cc-rs/releases/tag/cc-v1.2.5>.

Supersedes #134419.
Fixes #133794.

r? `@clubby789`
2024-12-21 17:58:54 +00:00
DianQK
1652e3a560
Rollup merge of #134366 - harrisonkaiser:no-break-space, r=davidtwco
Fix logical error with what text is considered whitespace.

There appears to be a logical issue around what counts as leading white-space. There is code which does a subtraction assuming that no errors will be reported inside the leading whitespace. However we compute the length of that whitespace with std::char::is_whitespace and not rustc_lexer::is_whitespace. The former will include a no-break space while later will excluded it. We can only safely make the assumption that no errors will be reported  in whitespace if it is all "Rust Standard" whitespace. Indeed an error does occur in unicode whitespace if it contains a no-break space. In that case the subtraction will cause a ICE (for a compiler in debug mode) as described in https://github.com/rust-lang/rust/issues/132918.
2024-12-20 21:46:59 +08:00
许杰友 Jieyou Xu (Joe)
3775d220af Bump compiler cc to 1.2.5
- `cc` 1.2.4 contains a fix to address [rustc uses wrong build tools
  when compiling from MSVC
  #133794](https://github.com/rust-lang/rust/issues/133794). See
  <https://github.com/rust-lang/cc-rs/releases/tag/cc-v1.2.4>.
- `cc` 1.2.5 contains a fix to also check linking when testing if
  certain compiler flags are supported, which fixed an issue that was
  causing previous compiler `cc` bumps to fail. See
  <https://github.com/rust-lang/cc-rs/releases/tag/cc-v1.2.5>.

Co-authored-by: David Lönnhager <david.l@mullvad.net>
2024-12-19 19:02:01 +08:00
Sergio Gasquez
c28e3e36b5 build: Update libc version 2024-12-19 10:08:29 +01:00
bors
3378a5e084 Auto merge of #134425 - clubby789:cargo-update, r=jieyouxu
Pin `cc` and run `cargo update`

`cc` tends to cause issues with automatic bumps so locking it to be bumped individually when necessary
<details>
<summary>compiler and tools dependencies</summary>

```
    Updating allocator-api2 v0.2.20 -> v0.2.21
    Updating annotate-snippets v0.11.4 -> v0.11.5
    Updating anyhow v1.0.93 -> v1.0.94
    Updating bstr v1.11.0 -> v1.11.1
    Updating chrono v0.4.38 -> v0.4.39
    Updating clap v4.5.21 -> v4.5.23
    Updating clap_builder v4.5.21 -> v4.5.23
    Updating clap_complete v4.5.38 -> v4.5.39
    Updating clap_lex v0.7.3 -> v0.7.4
    Updating colored v2.1.0 -> v2.2.0
    Updating console v0.15.8 -> v0.15.10
    Updating crossbeam-channel v0.5.13 -> v0.5.14
    Updating crossbeam-deque v0.8.5 -> v0.8.6
    Updating crossbeam-utils v0.8.20 -> v0.8.21
    Updating encode_unicode v0.3.6 -> v1.0.0
    Updating fastrand v2.2.0 -> v2.3.0
    Updating home v0.5.9 -> v0.5.11
    Updating js-sys v0.3.74 -> v0.3.76
    Updating libc v0.2.167 -> v0.2.168
    Updating miniz_oxide v0.8.0 -> v0.8.1
    Updating pest v2.7.14 -> v2.7.15
    Updating pest_derive v2.7.14 -> v2.7.15
    Updating pest_generator v2.7.14 -> v2.7.15
    Updating pest_meta v2.7.14 -> v2.7.15
    Updating redox_syscall v0.5.7 -> v0.5.8
    Updating rustc-stable-hash v0.1.0 -> v0.1.1
    Updating rustix v0.38.41 -> v0.38.42
    Updating self_cell v1.0.4 -> v1.1.0
    Updating semver v1.0.23 -> v1.0.24
    Updating serde v1.0.215 -> v1.0.216
    Updating serde_derive v1.0.215 -> v1.0.216
      Adding thiserror v2.0.7
      Adding thiserror-impl v2.0.7
    Updating time v0.3.36 -> v0.3.37
    Updating time-macros v0.2.18 -> v0.2.19
    Updating tokio v1.41.1 -> v1.42.0
    Updating wasm-bindgen v0.2.97 -> v0.2.99
    Updating wasm-bindgen-backend v0.2.97 -> v0.2.99
    Updating wasm-bindgen-macro v0.2.97 -> v0.2.99
    Updating wasm-bindgen-macro-support v0.2.97 -> v0.2.99
    Updating wasm-bindgen-shared v0.2.97 -> v0.2.99
    Updating wasm-encoder v0.221.0 -> v0.221.2
    Updating wasmparser v0.221.0 -> v0.221.2
    Updating wast v221.0.0 -> v221.0.2
    Updating wat v1.221.0 -> v1.221.2
```

</details>

<details>
<summary>library dependencies</summary>

```
    Updating allocator-api2 v0.2.20 -> v0.2.21
    Updating libc v0.2.167 -> v0.2.168
```

</details>

<details>
<summary>rustbook dependencies</summary>

```
    Updating anyhow v1.0.93 -> v1.0.94
    Updating bstr v1.11.0 -> v1.11.1
    Updating chrono v0.4.38 -> v0.4.39
    Updating clap v4.5.21 -> v4.5.23
    Updating clap_builder v4.5.21 -> v4.5.23
    Updating clap_complete v4.5.38 -> v4.5.39
    Updating clap_lex v0.7.3 -> v0.7.4
    Updating fastrand v2.2.0 -> v2.3.0
    Updating js-sys v0.3.74 -> v0.3.76
    Updating libc v0.2.167 -> v0.2.168
    Updating miniz_oxide v0.8.0 -> v0.8.1
    Updating pest v2.7.14 -> v2.7.15
    Updating pest_derive v2.7.14 -> v2.7.15
    Updating pest_generator v2.7.14 -> v2.7.15
    Updating pest_meta v2.7.14 -> v2.7.15
    Updating pulldown-cmark-to-cmark v19.0.0 -> v19.0.1
    Updating redox_syscall v0.5.7 -> v0.5.8
    Updating rustix v0.38.41 -> v0.38.42
    Updating semver v1.0.23 -> v1.0.24
    Updating serde v1.0.215 -> v1.0.216
    Updating serde_derive v1.0.215 -> v1.0.216
      Adding thiserror v2.0.7
      Adding thiserror-impl v2.0.7
    Updating wasm-bindgen v0.2.97 -> v0.2.99
    Updating wasm-bindgen-backend v0.2.97 -> v0.2.99
    Updating wasm-bindgen-macro v0.2.97 -> v0.2.99
    Updating wasm-bindgen-macro-support v0.2.97 -> v0.2.99
    Updating wasm-bindgen-shared v0.2.97 -> v0.2.99
    Removing windows-sys v0.52.0
```

</details>
2024-12-18 09:23:22 +00:00
bors
a4cb3c8318 Auto merge of #134381 - jdonszelmann:move-attribute-types, r=oli-obk
Split up attribute parsing code and move data types to `rustc_attr_data_structures`

This change renames `rustc_attr` to `rustc_attr_parsing`, and splits up the parsing code. At the same time, all the data types used move to `rustc_attr_data_structures`. This is in preparation of also having a third crate: `rustc_attr_validation`

I initially envisioned this as two separate PRs, but I think doing it in one go reduces the number of ways others would have to rebase their changes on this. However, I can still split them.

r? `@oli-obk` (we already discussed how this is a first step in a larger plan)

For a more detailed plan on how attributes are going to change, see https://github.com/rust-lang/rust/issues/131229

Edit: this looks like a giant PR, but the changes are actually rather trivial. Each commit is reviewable on its own, and mostly moves code around. No new logic is added.
2024-12-17 18:50:50 +00:00
clubby789
0b095f80d8 compiler & tools dependencies:
Updating allocator-api2 v0.2.20 -> v0.2.21
    Updating annotate-snippets v0.11.4 -> v0.11.5
    Updating anyhow v1.0.93 -> v1.0.94
    Updating bstr v1.11.0 -> v1.11.1
    Updating chrono v0.4.38 -> v0.4.39
    Updating clap v4.5.21 -> v4.5.23
    Updating clap_builder v4.5.21 -> v4.5.23
    Updating clap_complete v4.5.38 -> v4.5.39
    Updating clap_lex v0.7.3 -> v0.7.4
    Updating colored v2.1.0 -> v2.2.0
    Updating console v0.15.8 -> v0.15.10
    Updating crossbeam-channel v0.5.13 -> v0.5.14
    Updating crossbeam-deque v0.8.5 -> v0.8.6
    Updating crossbeam-utils v0.8.20 -> v0.8.21
    Updating encode_unicode v0.3.6 -> v1.0.0
    Updating fastrand v2.2.0 -> v2.3.0
    Updating home v0.5.9 -> v0.5.11
    Updating js-sys v0.3.74 -> v0.3.76
    Updating libc v0.2.167 -> v0.2.168
    Updating miniz_oxide v0.8.0 -> v0.8.1
    Updating pest v2.7.14 -> v2.7.15
    Updating pest_derive v2.7.14 -> v2.7.15
    Updating pest_generator v2.7.14 -> v2.7.15
    Updating pest_meta v2.7.14 -> v2.7.15
    Updating redox_syscall v0.5.7 -> v0.5.8
    Updating rustc-stable-hash v0.1.0 -> v0.1.1
    Updating rustix v0.38.41 -> v0.38.42
    Updating self_cell v1.0.4 -> v1.1.0
    Updating semver v1.0.23 -> v1.0.24
    Updating serde v1.0.215 -> v1.0.216
    Updating serde_derive v1.0.215 -> v1.0.216
      Adding thiserror v2.0.7
      Adding thiserror-impl v2.0.7
    Updating time v0.3.36 -> v0.3.37
    Updating time-macros v0.2.18 -> v0.2.19
    Updating tokio v1.41.1 -> v1.42.0
    Updating wasm-bindgen v0.2.97 -> v0.2.99
    Updating wasm-bindgen-backend v0.2.97 -> v0.2.99
    Updating wasm-bindgen-macro v0.2.97 -> v0.2.99
    Updating wasm-bindgen-macro-support v0.2.97 -> v0.2.99
    Updating wasm-bindgen-shared v0.2.97 -> v0.2.99
    Updating wasm-encoder v0.221.0 -> v0.221.2
    Updating wasmparser v0.221.0 -> v0.221.2
    Updating wast v221.0.0 -> v221.0.2
    Updating wat v1.221.0 -> v1.221.2

library dependencies:
    Updating allocator-api2 v0.2.20 -> v0.2.21
    Updating libc v0.2.167 -> v0.2.168

rustbook dependencies:
    Updating anyhow v1.0.93 -> v1.0.94
    Updating bstr v1.11.0 -> v1.11.1
    Updating chrono v0.4.38 -> v0.4.39
    Updating clap v4.5.21 -> v4.5.23
    Updating clap_builder v4.5.21 -> v4.5.23
    Updating clap_complete v4.5.38 -> v4.5.39
    Updating clap_lex v0.7.3 -> v0.7.4
    Updating fastrand v2.2.0 -> v2.3.0
    Updating js-sys v0.3.74 -> v0.3.76
    Updating libc v0.2.167 -> v0.2.168
    Updating miniz_oxide v0.8.0 -> v0.8.1
    Updating pest v2.7.14 -> v2.7.15
    Updating pest_derive v2.7.14 -> v2.7.15
    Updating pest_generator v2.7.14 -> v2.7.15
    Updating pest_meta v2.7.14 -> v2.7.15
    Updating pulldown-cmark-to-cmark v19.0.0 -> v19.0.1
    Updating redox_syscall v0.5.7 -> v0.5.8
    Updating rustix v0.38.41 -> v0.38.42
    Updating semver v1.0.23 -> v1.0.24
    Updating serde v1.0.215 -> v1.0.216
    Updating serde_derive v1.0.215 -> v1.0.216
      Adding thiserror v2.0.7
      Adding thiserror-impl v2.0.7
    Updating wasm-bindgen v0.2.97 -> v0.2.99
    Updating wasm-bindgen-backend v0.2.97 -> v0.2.99
    Updating wasm-bindgen-macro v0.2.97 -> v0.2.99
    Updating wasm-bindgen-macro-support v0.2.97 -> v0.2.99
    Updating wasm-bindgen-shared v0.2.97 -> v0.2.99
    Removing windows-sys v0.52.0
2024-12-17 17:41:00 +00:00
Jacob Pratt
52b4557639
Rollup merge of #134202 - nnethercote:rm-existing_doc_keyword, r=GuillaumeGomez
Remove `rustc::existing_doc_keyword` lint

The check doesn't require a lint.

r? ``@GuillaumeGomez``
2024-12-17 05:36:52 -05:00
Harrison Kaiser
1e33dd1711 Fix logical error with what text is considered whitespace.
There is a logical issue around what counts as leading white-space.
There is code which does a subtraction assuming that no errors will be reported
inside the leading whitespace. However we compute the length of
that whitespace with std::char::is_whitespace and not
rustc_lexer::is_whitespace. The former will include a no-break space while
later will excluded it. We can only safely make the assumption that no errors
will be reported  in whitespace if it is all "Rust Standard" whitespace.
Indeed an error does occur in unicode whitespace if it contains a no-break
space.
2024-12-16 23:34:46 -05:00
Nicholas Nethercote
121e87bf14 Remove rustc::existing_doc_keyword lint.
`CheckAttrVisitor::check_doc_keyword` checks `#[doc(keyword = "..")]`
attributes to ensure they are on an empty module, and that the value is
a non-empty identifier.

The `rustc::existing_doc_keyword` lint checks these attributes to ensure
that the value is the name of a keyword.

It's silly to have two different checking mechanisms for these
attributes. This commit does the following.
- Changes `check_doc_keyword` to check that the value is the name of a
  keyword (avoiding the need for the identifier check, which removes a
  dependency on `rustc_lexer`).
- Removes the lint.
- Updates tests accordingly.

There is one hack: the `SelfTy` FIXME case used to used to be handled by
disabling the lint, but now is handled with a special case in
`is_doc_keyword`. That hack will go away if/when the FIXME is fixed.

Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
2024-12-17 13:56:10 +11:00
Jonathan Dönszelmann
efb98b6552
rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures 2024-12-16 19:08:19 +01:00
Jonathan Dönszelmann
d50c0a5480
Add hir::Attribute 2024-12-15 19:18:46 +01:00
bjorn3
ead78fdfdf Remove jobserver from Session
It is effectively a global resource and the jobserver::Client in Session
was a clone of GLOBAL_CLIENT anyway.
2024-12-13 10:21:22 +00:00
León Orell Valerian Liehr
b1122b5054
Rollup merge of #133456 - clubby789:cargo-update, r=ChrisDenton
Add licenses + Run `cargo update`

Replaces #131311

try-job: dist-x86_64-linux

License changes:
- `unicode_ident` 1.0.14 introduces `(MIT OR Apache-2.0) AND Unicode-3.0`, but `unicode_ident` 1.0.12 (`(MIT OR Apache-2.0) AND Unicode-DFS-2016`) is still in tree
- `instant` and its license exception are no longer used
```
compiler & tools dependencies:
    Updating allocator-api2 v0.2.18 -> v0.2.20
    Updating anyhow v1.0.92 -> v1.0.93
    Removing bitflags v1.3.2
    Updating blake3 v1.5.4 -> v1.5.5
    Updating bstr v1.10.0 -> v1.11.0
    Updating bytes v1.8.0 -> v1.9.0
    Updating cargo-platform v0.1.8 -> v0.1.9
    Updating cc v1.2.0 -> v1.2.2
    Updating clap v4.5.20 -> v4.5.21
    Updating clap_builder v4.5.20 -> v4.5.21
    Updating clap_complete v4.5.36 -> v4.5.38
    Updating clap_lex v0.7.2 -> v0.7.3
    Updating color-print v0.3.6 -> v0.3.7
    Updating color-print-proc-macro v0.3.6 -> v0.3.7
    Updating cpufeatures v0.2.14 -> v0.2.16
    Updating curl-sys v0.4.77+curl-8.10.1 -> v0.4.78+curl-8.11.0
    Updating errno v0.3.9 -> v0.3.10
    Updating fastrand v2.1.1 -> v2.2.0
    Updating flate2 v1.0.34 -> v1.0.35
    Updating handlebars v5.1.2 -> v6.2.0
      Adding icu_collections v1.5.0
      Adding icu_normalizer v1.5.0
      Adding icu_normalizer_data v1.5.0
      Adding icu_properties v1.5.1
      Adding icu_properties_data v1.5.0
    Updating idna v0.5.0 -> v1.0.3
      Adding idna_adapter v1.2.0
    Updating indexmap v2.6.0 -> v2.7.0
    Updating indicatif v0.17.8 -> v0.17.9
    Removing instant v0.1.13
    Updating itoa v1.0.11 -> v1.0.14
    Updating js-sys v0.3.72 -> v0.3.74
    Updating libc v0.2.164 -> v0.2.167
    Updating libloading v0.8.5 -> v0.8.6
    Updating litemap v0.7.3 -> v0.7.4
    Updating mdbook v0.4.40 -> v0.4.43
      Adding num-modular v0.6.1
      Adding num-order v1.2.0
    Updating pathdiff v0.2.2 -> v0.2.3
    Updating portable-atomic v1.9.0 -> v1.10.0
    Updating proc-macro2 v1.0.89 -> v1.0.92
    Updating regex-automata v0.4.8 -> v0.4.9
    Updating rustc-hash v2.0.0 -> v2.1.0
    Updating rustc_apfloat v0.2.1+llvm-462a31f5a5ab -> v0.2.2+llvm-462a31f5a5ab
    Updating rustix v0.38.38 -> v0.38.41
    Updating schannel v0.1.26 -> v0.1.27
    Updating serde v1.0.214 -> v1.0.215
    Updating serde_derive v1.0.214 -> v1.0.215
    Updating serde_json v1.0.132 -> v1.0.133
    Updating socket2 v0.5.7 -> v0.5.8
    Updating spdx v0.10.6 -> v0.10.7
    Updating syn v2.0.87 -> v2.0.90
    Updating tempfile v3.13.0 -> v3.14.0
    Updating terminal_size v0.4.0 -> v0.4.1
    Updating thiserror v1.0.66 -> v1.0.69 (available: v2.0.3)
    Updating thiserror-impl v1.0.66 -> v1.0.69
    Updating tokio v1.41.0 -> v1.41.1
    Updating tracing-attributes v0.1.27 -> v0.1.28
    Updating tracing-error v0.2.0 -> v0.2.1
    Removing unicode-bidi v0.3.17
    Updating unicode-ident v1.0.13 -> v1.0.14
    Updating url v2.5.2 -> v2.5.4
      Adding utf16_iter v1.0.5
      Adding utf8_iter v1.0.4
     Updating wasm-bindgen v0.2.95 -> v0.2.97
    Updating wasm-bindgen-backend v0.2.95 -> v0.2.97
    Updating wasm-bindgen-macro v0.2.95 -> v0.2.97
    Updating wasm-bindgen-macro-support v0.2.95 -> v0.2.97
    Updating wasm-bindgen-shared v0.2.95 -> v0.2.97
    Updating wasm-encoder v0.220.0 -> v0.221.0
      Adding wasmparser v0.221.0
    Updating wast v219.0.1 -> v221.0.0
    Updating wat v1.219.1 -> v1.221.0
      Adding web-time v1.1.0
      Adding write16 v1.0.0
    Updating yoke v0.7.4 -> v0.7.5
    Updating yoke-derive v0.7.4 -> v0.7.5
    Updating zerofrom v0.1.4 -> v0.1.5
    Updating zerofrom-derive v0.1.4 -> v0.1.5

library dependencies:
    Updating allocator-api2 v0.2.18 -> v0.2.20
    Updating cc v1.2.0 -> v1.2.2
    Updating libc v0.2.162 -> v0.2.164
    Updating unwinding v0.2.3 -> v0.2.4

rustbook dependencies:
    Updating anstream v0.6.17 -> v0.6.18
    Updating anyhow v1.0.92 -> v1.0.93
    Updating bstr v1.10.0 -> v1.11.0
    Updating cc v1.2.0 -> v1.2.2
    Updating clap v4.5.20 -> v4.5.21
    Updating clap_builder v4.5.20 -> v4.5.21
    Updating clap_complete v4.5.36 -> v4.5.38
    Updating clap_lex v0.7.2 -> v0.7.3
    Updating cpufeatures v0.2.14 -> v0.2.16
      Adding displaydoc v0.2.5
    Updating errno v0.3.9 -> v0.3.10
    Updating fastrand v2.1.1 -> v2.2.0
    Updating flate2 v1.0.34 -> v1.0.35
    Updating hashbrown v0.15.0 -> v0.15.2
      Adding icu_collections v1.5.0
      Adding icu_locid v1.5.0
      Adding icu_locid_transform v1.5.0
      Adding icu_locid_transform_data v1.5.0
      Adding icu_normalizer v1.5.0
      Adding icu_normalizer_data v1.5.0
      Adding icu_properties v1.5.1
      Adding icu_properties_data v1.5.0
      Adding icu_provider v1.5.0
      Adding icu_provider_macros v1.5.0
    Updating idna v0.5.0 -> v1.0.3
      Adding idna_adapter v1.2.0
    Updating indexmap v2.6.0 -> v2.7.0
    Updating itoa v1.0.11 -> v1.0.14
    Updating js-sys v0.3.72 -> v0.3.74
    Updating libc v0.2.161 -> v0.2.167
      Adding litemap v0.7.4
    Updating mdbook v0.4.42 -> v0.4.43
    Updating pathdiff v0.2.2 -> v0.2.3
    Updating proc-macro2 v1.0.89 -> v1.0.92
    Updating regex-automata v0.4.8 -> v0.4.9
    Updating rustix v0.38.38 -> v0.38.41
    Updating serde v1.0.214 -> v1.0.215
    Updating serde_derive v1.0.214 -> v1.0.215
    Updating serde_json v1.0.132 -> v1.0.133
      Adding stable_deref_trait v1.2.0
    Updating syn v2.0.87 -> v2.0.90
      Adding synstructure v0.13.1
    Updating tempfile v3.13.0 -> v3.14.0
    Updating terminal_size v0.4.0 -> v0.4.1
    Updating thiserror v1.0.66 -> v1.0.69
    Updating thiserror-impl v1.0.66 -> v1.0.69
      Adding tinystr v0.7.6
    Removing tinyvec v1.8.0
    Removing tinyvec_macros v0.1.1
    Removing unicode-bidi v0.3.17
    Updating unicode-ident v1.0.13 -> v1.0.14
    Removing unicode-normalization v0.1.24
    Updating url v2.5.2 -> v2.5.4
      Adding utf16_iter v1.0.5
      Adding utf8_iter v1.0.4
    Updating wasm-bindgen v0.2.95 -> v0.2.97
    Updating wasm-bindgen-backend v0.2.95 -> v0.2.97
    Updating wasm-bindgen-macro v0.2.95 -> v0.2.97
    Updating wasm-bindgen-macro-support v0.2.95 -> v0.2.97
    Updating wasm-bindgen-shared v0.2.95 -> v0.2.97
      Adding write16 v1.0.0
      Adding writeable v0.5.5
      Adding yoke v0.7.5
      Adding yoke-derive v0.7.5
      Adding zerofrom v0.1.5
      Adding zerofrom-derive v0.1.5
      Adding zerovec v0.10.4
      Adding zerovec-derive v0.10.3
```
2024-12-10 08:55:56 +01:00
León Orell Valerian Liehr
94d780d647
Rollup merge of #131558 - sassman:feat/warnin-for-no-mangle-together-with-export-name, r=Urgau
Lint on combining `#[no_mangle]` and `#[export_name]`

This is my very first contribution to the compiler, even though I read the [chapter about lints](https://rustc-dev-guide.rust-lang.org/diagnostics.html) I'm not very certain that this ~~new lint is done right as a builtin lint~~ PR is right. I appreciate any guidance on how to improve the code.

- Add test for issue #47446
- ~~Implement the new lint `mixed_export_name_and_no_mangle` as a builtin lint (not sure if that is the right way to go)~~ Extend `unused_attributes` lint
- Add suggestion how to fix it

<details>

<summary>Old proposed new lint</summary>

> The `mixed_export_name_and_no_mangle` lint detects usage of both `#[export_name]` and `#[no_mangle]` on the same item which results on `#[no_mangle]` being ignored.
>
> *warn-by-default*
>
> ### Example
>
> ```rust
> #[no_mangle] // ignored
> #[export_name = "foo"] // takes precedences
> pub fn bar() {}
> ```
>
> ### Explanation
>
> The compiler will not respect the `#[no_mangle]` attribute when generating the symbol name for the function, as the `#[export_name]` attribute takes precedence. This can lead to confusion and is unnecessary.

</details>
2024-12-10 08:55:54 +01:00
bors
1b3fb31675 Auto merge of #134052 - matthiaskrgr:rollup-puxwqrk, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #133567 (A bunch of cleanups)
 - #133789 (Add doc alias 'then_with' for `then` method on `bool`)
 - #133880 (Expand home_dir docs)
 - #134036 (crash tests: use individual mir opts instead of mir-opt-level where easily possible)
 - #134045 (Fix some triagebot mentions paths)
 - #134046 (Remove ignored tests for hangs w/ new solver)
 - #134050 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-09 03:24:24 +00:00
Ralf Jung
a33b4b1ca0 update lockfile 2024-12-08 22:54:38 +01:00
clubby789
2d8a871d4b Downgrade cc 2024-12-08 18:18:03 +00:00
Maksim Bondarenkov
dd875edc59 deps: Update psm 2024-12-08 18:58:15 +03:00
Alex Crichton
c0a00b73f8 Update wasm-component-ld to 0.5.11
This pulls in an update that supports `@`-files used to pass arguments
to linkers to fix invocations on Windows that are large.

Closes #133649
2024-12-03 10:22:08 -08:00
Rémy Rakic
a69fe84ec8 switch jemalloc-sys back to tikv-jemalloc-sys, and update to 0.6.0 2024-12-03 08:56:33 +00:00
clubby789
868668e05d Run cargo update and update licenses 2024-12-01 11:06:44 +00:00