Commit Graph

3006 Commits

Author SHA1 Message Date
bors
145f9cf95d Auto merge of #132402 - bjorn3:remove_snap_decompression, r=jieyouxu,Veykril
Remove support for decompressing dylib metadata

We haven't been compressing dylib metadata for a while now. Removing decompression support will regress error messages about an incompatible rustc version being used, but dylibs are pretty rare anyway.

Fixes https://github.com/rust-lang/rust-analyzer/issues/18451
2024-11-01 08:01:24 +00:00
bjorn3
87b9c092fb Remove support for decompressing dylib metadata
We haven't been compressing dylib metadata for a while now. Removing
decompression support will regress error messages about an incompatible
rustc version being used, but dylibs are pretty rare anyway.
2024-10-31 11:51:00 +00:00
Jubilee Young
8a0e64078e compiler: Switch to rustc_abi in hir_pretty, lint_defs, and mir_build
Completely abandon usage of rustc_target in these crates, as
they need no special knowledge of rustc's target tuples.
2024-10-30 22:38:49 -07:00
Jubilee Young
eca17022ef compiler: Lift rustc_target::spec::abi::Abi to rustc_abi::ExternAbi 2024-10-30 22:38:49 -07:00
许杰友 Jieyou Xu (Joe)
e419b3d1ec compiletest: improve robustness of LLVM version handling 2024-10-30 12:54:44 +08:00
Jubilee
5d0f52efa4
Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillot
compiler: apply clippy::clone_on_ref_ptr for CI

Apply lint https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_ref_ptr for compiler, also see https://github.com/rust-lang/rust/pull/131225#discussion_r1790109443.

Some Arc's can be misplaced with Lrc's, sorry.

https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/enable.20more.20clippy.20lints.20for.20compiler.20.28and.5Cor.20std.29
2024-10-29 03:11:39 -07:00
Jubilee
259ddf9b50
Rollup merge of #132255 - workingjubilee:layout-is-🏚️, r=compiler-errors
Add `LayoutS::is_uninhabited` and use it

Use accessors for the things that accessors are good at: reducing everyone's need to be nosy and peek at the internals of every data structure.
2024-10-28 10:18:50 -07:00
Jubilee
d6be363400
Rollup merge of #132249 - workingjubilee:add-rustc-abi, r=compiler-errors
compiler: Add rustc_abi dependence to the compiler

Depend on rustc_abi in compiler crates that use it indirectly but have not yet taken on that dependency, and are not *significantly* entangled in my other PRs. This leaves an "excise rustc_target" step after the dust settles.
2024-10-28 10:18:50 -07:00
Jubilee Young
88a9edc091 compiler: Add is_uninhabited and use LayoutS accessors
This reduces the need of the compiler to peek on the fields of LayoutS.
2024-10-28 09:58:30 -07:00
klensy
746b675c5a fix clippy::clone_on_ref_ptr for compiler 2024-10-28 18:05:08 +03:00
Jubilee Young
3f73fe7db4 compiler: Depend on rustc_abi in rustc_lint 2024-10-27 23:59:31 -07:00
Jubilee Young
4839d6e6e5 compiler: Add rustc_abi dependence to the compiler
Depend on rustc_abi in compiler crates that use it indirectly but have
not yet taken on that dependency, and are not entangled in my other PRs.
This leaves an "excise rustc_target" step after the dust settles.
2024-10-27 21:10:58 -07:00
Jubilee Young
27207069d8 rustc_transmute: Directly use types from rustc_abi 2024-10-27 20:29:27 -07:00
bors
4d88de2acd Auto merge of #125116 - blyxyas:ignore-allowed-lints-final, r=cjgillot
(Big performance change) Do not run lints that cannot emit

Before this change, adding a lint was a difficult matter because it always had some overhead involved. This was because all lints would run, no matter their default level, or if the user had `#![allow]`ed them. This PR changes that. This change would improve both the Rust lint infrastructure and Clippy, but Clippy will see the most benefit, as it has about 900 registered lints (and growing!)

So yeah, with this little patch we filter all lints pre-linting, and remove any lint that is either:
- Manually `#![allow]`ed in the whole crate,
- Allowed in the command line, or
- Not manually enabled with `#[warn]` or similar, and its default level is `Allow`

As some lints **need** to run, this PR also adds **loadbearing lints**. On a lint declaration, you can use the ``@eval_always` = true` marker to label it as loadbearing. A loadbearing lint will never be filtered (it will always run)

Fixes #106983
2024-10-26 16:37:43 +00:00
bors
662180b34d Auto merge of #131949 - Noratrieb:fxhashup-thanks-alona, r=WaffleLapkin
Update rustc-hash to version 2 but again

it's like #129533 but not closed by bors and rebased

r? WaffleLapkin meow
2024-10-20 19:01:54 +00:00
Matthias Krüger
fb42a4581b
Rollup merge of #131647 - jieyouxu:unicode-table-generator, r=Mark-Simulacrum
Register `src/tools/unicode-table-generator` as a runnable tool

It seems like `src/tools/unicode-table-generator` is not currently managed by bootstrap. This PR wires it up with bootstrap as a runnable tool.

This tool seems to take two possible args:

1. (Mandatory) path to `library/core/src/unicode/unicode_data.rs`, and
2. (Optional) path to generate a test file.

I only passed the mandatory path to `unicode_data.rs` in bootstrap and didn't do anything about (2). I'm not sure about how this tool is supposed to be run.

`Cargo.lock` is modified because I renamed `unicode-table-generator`'s bin name to match the tool name, as bootstrap's tool running logic expects the bin name to be derived from the tool name.

I also added a triagebot message to remind to not manually edit the library source file and edit the tool then regenerate instead, but this should probably be a tidy check (if that's desirable then that can be in a follow-up PR, though may be overkill).

Helps with #131640 but does not close it because still no docs.

r? `@Mark-Simulacrum` (since I think you authored this tool?)
2024-10-20 16:54:09 +02:00
Noratrieb
4348383a0f Update rustc-hash to version 2
This brings in the new algorithm.
2024-10-20 00:12:49 -07:00
Matthias Krüger
1dcb77b25f
Rollup merge of #131908 - aDotInTheVoid:rustdoc-gamer-hashing, r=notriddle,GuillaumeGomez
rustdoc: Switch from FxHash to sha256 for static file hashing.

Fixes https://github.com/rust-lang/rust/pull/129533#issuecomment-2422891519

fxhash isn't well defined, and it's implementation is being changed in #129533. But because rustdoc uses it for static files (and encodes that hashing in rustdoc.css), this broke our tests. Given that this isn't performace critical, I think the right fix is to used a well-defined hash that will never change its definition. I've picked (rather arbitrarily) sha256.
2024-10-19 17:25:35 +02:00
blyxyas
b4da058595 Do not run lints that cannot emit
Before this change, adding a lint was a difficult matter
because it always had some overhead involved. This was
because all lints would run, no matter their default level,
or if the user had #![allow]ed them. This PR changes that
2024-10-19 16:19:44 +02:00
Alona Enraght-Moony
3cf8a61a7a rustdoc: Switch from FxHash to sha256 for static file hashing. 2024-10-19 01:05:58 +00:00
Philipp Krones
375ca8d90f
Update Cargo.lock 2024-10-18 13:44:57 +02:00
bors
9618da7c99 Auto merge of #131422 - GnomedDev:smallvec-predicate-obligations, r=compiler-errors
Use `ThinVec` for PredicateObligation storage

~~I noticed while profiling clippy on a project that a large amount of time is being spent allocating `Vec`s for `PredicateObligation`, and the `Vec`s are often quite small. This is an attempt to optimise this by using SmallVec to avoid heap allocations for these common small Vecs.~~

This PR turns all the `Vec<PredicateObligation>` into a single type alias while avoiding referring to `Vec` around it, then swaps the type over to `ThinVec<PredicateObligation>` and fixes the fallout. This also contains an implementation of `ThinVec::extract_if`, copied from `Vec::extract_if` and currently being upstreamed to https://github.com/Gankra/thin-vec/pull/66.

This leads to a small (0.2-0.7%) performance gain in the latest perf run.
2024-10-16 04:06:14 +00:00
Ralf Jung
1f501a7f09 update lockfile 2024-10-15 07:51:50 +02:00
许杰友 Jieyou Xu (Joe)
d21aa86c65 unicode-table-generator: match bin name with tool name
Bootstrap assumes that the binary name is the same as tool name, just
makes everyone's lives easier.
2024-10-13 19:14:06 +08:00
printfn
46b41b4fc8 Update unicode-width to 0.2.0 2024-10-12 21:57:50 +00:00
GnomedDev
8de8f46f78 Swap PredicateObligation to ThinVec 2024-10-12 15:17:16 +01:00
Matthias Krüger
007d635ff6
Rollup merge of #131464 - alexcrichton:update-wasm-component-ld, r=jieyouxu
Update wasm-component-ld to 0.5.10

This pulls in a bug fix relative to the 0.5.9 release which was updated-to recently.
2024-10-11 12:21:05 +02:00
Alex Crichton
9c9d3c85bb Update wasm-component-ld to 0.5.10
This pulls in a bug fix relative to the 0.5.9 release which was
updated-to recently.
2024-10-09 13:21:00 -07:00
Jubilee Young
43e198a3ae compiler: Seal off the rustc_target::abi enum glob imports 2024-10-08 18:24:56 -07:00
Jubilee
44f6275e14
Rollup merge of #126930 - Xaeroxe:file-checksum-hint, r=chenyukang
Add unstable support for outputting file checksums for use in cargo

Adds an unstable option that appends file checksums and expected lengths to the end of the dep-info file such that `cargo` can read and use these values as an alternative to file mtimes.

This PR powers the changes made in this cargo PR https://github.com/rust-lang/cargo/pull/14137

Here's the tracking issue for the cargo feature https://github.com/rust-lang/cargo/issues/14136.
2024-10-02 21:26:58 -07:00
Matthias Krüger
f9ba5529eb
Rollup merge of #130863 - compiler-errors:relax-codegen-dyn-assert, r=lcnr
Relax a debug assertion for dyn principal *equality* in codegen

Maybe this sucks and I should just bite the bullet and use `infcx.sub` here. Thoughts?

r? lcnr

Fixes #130855
2024-10-02 17:10:43 +02:00
Jacob Kiesel
bb5a8276be add unstable support for outputting file checksums for use in cargo 2024-10-01 21:23:20 -06:00
bors
1d71891c6b Auto merge of #131070 - tgross35:update-root-cc, r=wesleywiser
Unpin `cc` and upgrade to the latest version

`cc` was previously pinned because 1.1.106 dropped support for Visual Studio 12 (2013), and we wanted to decouple that from the rest of the automated updates. As noted in [2], there is no longer anything indicating we support VS2013, so it should be okay to unpin it.

`cc` 1.1.22 contains a fix that may help improve the high MSVC CI failure rate [3], so we also have motivation to update to that point.

[1]: https://github.com/rust-lang/rust/issues/129307
[2]: https://github.com/rust-lang/rust/issues/129307#issuecomment-2383749868
[3]: https://github.com/rust-lang/rust/issues/127883

try-job: x86_64-msvc-ext
2024-10-02 00:35:40 +00:00
Alex Crichton
91d0752e16 Update wasm-component-ld to 0.5.9
This updates the `wasm-component-ld` linker binary for the
`wasm32-wasip2` target to 0.5.9, pulling in a few bug fixes and recent
updates.
2024-09-30 16:56:40 -07:00
Trevor Gross
eaaa94318b Unpin cc and upgrade to the latest version
`cc` was previously pinned because version 1.1.106 dropped support for
Visual Studio 12 (2013), and we wanted to decouple that from the rest of
the automated updates. As noted in [2], there is no longer anything
indicating we support VS2013, so it should be okay to unpin it.

`cc` 1.1.22 contains a fix that may help improve the high MSVC CI
failure rate [3], so we also have motivation to update to that point.

[1]: https://github.com/rust-lang/rust/issues/129307
[2]: https://github.com/rust-lang/rust/issues/129307#issuecomment-2383749868
[3]: https://github.com/rust-lang/rust/issues/127883
2024-09-30 13:31:42 -04:00
Michael Goulet
eb75d20a55 Relax a debug assertion in codegen 2024-09-30 12:18:02 -04:00
bors
e9df22f51d Auto merge of #131036 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-09-30 03:16:29 +00:00
Ralf Jung
8c0adc6716 update lockfile 2024-09-29 23:08:25 +02:00
github-actions
bfc9951fa8 cargo update
Locking 5 packages to latest compatible versions
    Updating autocfg v1.3.0 -> v1.4.0
    Updating flate2 v1.0.33 -> v1.0.34
    Updating portable-atomic v1.8.0 -> v1.9.0
    Updating syn v2.0.77 -> v2.0.79
    Updating tempfile v3.12.0 -> v3.13.0
note: pass `--verbose` to see 81 unchanged dependencies behind latest

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

rustbook dependencies:
     Locking 13 packages to latest compatible versions
    Updating autocfg v1.3.0 -> v1.4.0
    Updating cc v1.1.21 -> v1.1.22
    Updating flate2 v1.0.33 -> v1.0.34
    Updating libc v0.2.158 -> v0.2.159
    Updating pkg-config v0.3.30 -> v0.3.31
    Updating redox_syscall v0.5.4 -> v0.5.6
    Updating serde_spanned v0.6.7 -> v0.6.8
    Updating syn v2.0.77 -> v2.0.79
    Updating tempfile v3.12.0 -> v3.13.0
    Updating thiserror v1.0.63 -> v1.0.64
    Updating thiserror-impl v1.0.63 -> v1.0.64
    Updating toml_edit v0.22.21 -> v0.22.22
    Updating winnow v0.6.18 -> v0.6.20
note: pass `--verbose` to see 30 unchanged dependencies behind latest
2024-09-29 00:22:29 +00:00
klensy
26c09b6553 bump few deps
cargo_metadata, thorin-dwp, windows
2024-09-27 09:23:05 +03:00
Trevor Gross
4a515bdf7b Run cargo update in the project root 2024-09-26 13:40:17 -04:00
bors
38352b01ae Auto merge of #130778 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

Really delayed sync (2 1/2 weeks), because of a `debug_assertion` we hit, and I didn't have the time to investigate earlier.

It would be nice to merge this PR with some priority, as it includes a lot of formatting changes due to the rustfmt bump.

Include Cargo.lock update due to Clippy version bump and ui_test bump in Clippy.
2024-09-25 11:40:41 +00:00
Trevor Gross
e95d15a115 Pin memchr to 2.5.0 in the library rather than rustc_ast
The latest versions of `memchr` experience LTO-related issues when
compiling for windows-gnu [1], so needs to be pinned. The issue is
present in the standard library.

`memchr` has been pinned in `rustc_ast`, but since the workspace was
recently split, this pin no longer has any effect on library crates.

Resolve this by adding `memchr` as an _unused_ dependency in `std`,
pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow
non-library crates to upgrade to the latest version.

Link: https://github.com/rust-lang/rust/issues/127890 [1]
2024-09-24 18:09:43 +02:00
Philipp Krones
907b6a1bc3
Update Cargo.lock 2024-09-24 11:58:12 +02:00
Yacin Tmimi
eeda9dd070 Merge commit 'b23b69900eab1260be510b2bd8922f4b6de6cf1e' into sync-from-rustfmt 2024-09-19 21:46:44 -04:00
Yacin Tmimi
b23b69900e chore: prep v1.8.0 release 2024-09-19 21:33:01 -04:00
Ralf Jung
ba86cf8686 update lockfile 2024-09-17 15:20:50 +02:00
klensy
2e66891370 remove unused tracing-attributes 2024-09-12 00:26:05 -04:00
bors
6d05f12170 Auto merge of #129346 - nnethercote:fix-double-handling-in-collect_tokens, r=petrochenkov
Fix double handling in `collect_tokens`

Double handling of AST nodes can occur in `collect_tokens`. This is when an inner call to `collect_tokens` produces an AST node, and then an outer call to `collect_tokens` produces the same AST node. This can happen in a few places, e.g. expression statements where the statement delegates `HasTokens` and `HasAttrs` to the expression. It will also happen more after #124141.

This PR fixes some double handling cases that cause problems, including #129166.

r? `@petrochenkov`
2024-09-08 05:35:23 +00:00
Matthias Krüger
8a60d0a5ec
Rollup merge of #101339 - the8472:ci-randomize-debug, r=Mark-Simulacrum
enable -Zrandomize-layout in debug CI builds

This builds rustc/libs/tools with `-Zrandomize-layout` on *-debug CI runners.

Only a handful of tests and asserts break with that enabled, which is promising. One test was fixable, the rest is dealt with by disabling them through new cargo features or compiletest directives.

The config.toml flag `rust.randomize-layout` defaults to false, so it has to be explicitly enabled for now.
2024-09-05 03:47:39 +02:00