Commit Graph

314301 Commits

Author SHA1 Message Date
Vadim Petrochenkov b018f42b7b resolve: Keep all encountered bindings in resolve_ident_in_scope_set 2025-12-28 00:01:28 +03:00
Vadim Petrochenkov 1c7d3f0ff6 resolve: Preserve binding scopes in ambiguity errors
It allows to get rid of `AmbiguityErrorMisc` and `Flags`.
2025-12-27 22:50:02 +03:00
bors 50db29bbd7 Auto merge of #150435 - JonathanBrouwer:rollup-gkvgsfb, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#150362 (rustdoc: fix duplicate Re-exports sections)
 - rust-lang/rust#150397 (Update hir.rs: fix typo ("aligement" -> "alignment"), conform to max_width)
 - rust-lang/rust#150410 (Document default SOCK_CLOEXEC flag on new UnixStream)
 - rust-lang/rust#150429 (Improve missing core error for tier 3 targets)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-27 16:12:14 +00:00
Jonathan Brouwer 4af704522e Rollup merge of #150429 - Noratrieb:tier-3-errors, r=Urgau
Improve missing core error for tier 3 targets

Tier 3 targets can't be installed via rustup, so don't recommend that. Additionally, do recommend build-std on stable because it's the recommended way to use these targets, people should switch to nightly.
2025-12-27 15:46:57 +01:00
Jonathan Brouwer e2e271b7b0 Rollup merge of #150410 - crescentrose:document-socket-cloexec, r=ChrisDenton
Document default SOCK_CLOEXEC flag on new UnixStream

Currently, the `std::os::unix::net::UnixStream` docs do not specify that the SOCK_CLOEXEC flag is set on new sockets. This commit adds a note clarifying that, in line with the note abuot the `MSG_NOSIGNAL` flag.
2025-12-27 15:46:56 +01:00
Jonathan Brouwer adbcef3c12 Rollup merge of #150397 - BioTomateHP:patch-1, r=petrochenkov
Update hir.rs: fix typo ("aligement" -> "alignment"), conform to max_width
2025-12-27 15:46:56 +01:00
Jonathan Brouwer af77f2d644 Rollup merge of #150362 - heathdutton:fix-rustdoc-duplicate-reexports-150211, r=notriddle
rustdoc: fix duplicate Re-exports sections

Fixes rust-lang/rust#150211

When a module contains both `pub extern crate` and `pub use` items, they were being rendered under two separate "Re-exports" section headers instead of one.

This fix tracks the current section and only renders a new header when the section actually changes, consolidating items that belong to the same section under a single header.
2025-12-27 15:46:55 +01:00
bors 4c6706452c Auto merge of #150430 - JonathanBrouwer:rollup-seh9m66, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#150393 (Document relative and absolute paths handling in `--remap-path-prefix`)
 - rust-lang/rust#150405 (Don't use `matches!` when `==` suffices)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-27 12:58:59 +00:00
Jonathan Brouwer d63068b3b4 Rollup merge of #150405 - estebank:matches-could-be-equals, r=Kivooeo
Don't use `matches!` when `==` suffices

In the codebase we sometimes use `matches!` for values that can actually just be compared. Replace them with `==`.

Subset of rust-lang/rust#149933.
2025-12-27 13:42:01 +01:00
Jonathan Brouwer b1fd0b3f2f Rollup merge of #150393 - Urgau:remap-path-relative-doc, r=jieyouxu
Document relative and absolute paths handling in `--remap-path-prefix`

After what we have been through with https://github.com/rust-lang/rust/pull/150110 and https://github.com/rust-lang/rust/pull/150283 in the compiler, I think it would be good to document the user-facing parts of the relative and absolute paths handling in `--remap-path-prefix`.

r? `@jieyouxu`
2025-12-27 13:42:01 +01:00
Noratrieb 7898df42b9 Improve missing core error for tier 3 targets
Tier 3 targets can't be installed via rustup, so don't recommend that.
Additionally, do recommend build-std on stable because it's the
recommended way to use these targets, people should switch to nightly.
2025-12-27 13:17:28 +01:00
Ivan ee9db30421 fix late night markdown 2025-12-27 10:59:21 +01:00
bors 0850949213 Auto merge of #149775 - WaffleLapkin:core-mem-maybe-dangling, r=Mark-Simulacrum
Add `MaybeDangling` to `core`

This is the library part of adding `MaybeDangling`. Note that it doesn't actually do anything described in its docs (yet), I'll make a separate PR for that.

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

r? libs
cc `@RalfJung`
2025-12-27 09:45:21 +00:00
bors c7aa99f36c Auto merge of #142881 - cjgillot:minimap, r=saethlin
JumpThreading: compute place and value indices on-demand

Profiling JumpThreading reveals that a large part of the runtime happens constructing the place and value `Map`. This is unfortunate, as jump-threading may end up not even doing anything.

The cause for this large up-front cost is following: `Map` attempts to create a `PlaceIndex` for each place that *may* hold a relevant value. This means all places that appear in MIR, but also all places whose value is accessed by a projection of a copy of a larger place.

This PR refactors the creation of `Map` to happen on-demand: place and value indices are created when threading computation happens.

The up-front mode is still relevant for DataflowConstProp, so is not touched.
2025-12-27 03:12:17 +00:00
bors 38ed7700e7 Auto merge of #150395 - GuillaumeGomez:fix-copy-code-example-with-line-numbers, r=yotamofek
Fix copy code example with line numbers

Fixes rust-lang/rust#150339.

Since the line numbers are now included in the actual highlighted code, we need to filter them out when we "copy" the code.

r? `@yotamofek`
2025-12-27 00:03:03 +00:00
Ivan 106e88e0ba Document default SOCK_CLOEXEC flag on new UnixStream
Currently, the `std::os::unix::net::UnixStream` docs do not specify that
the SOCK_CLOEXEC flag is set on new sockets. This commit adds a note
clarifying that, in line with the note abuot the `MSG_NOSIGNAL` flag.
2025-12-26 23:25:32 +01:00
Waffle Lapkin 6b4f4f57e7 bless a mir-opt and a miri tests 2025-12-26 22:02:19 +01:00
Waffle Lapkin d42f7ea7ca fixup debugger files wrt to MaybeDangling
- fixup `BTreeMap` gdb provider
- fixup `ManuallyDrop` natvis thingy

Now that `MaybeUninit` contains `ManuallyDrop` which contains
`MaybeDangling` (tbc this is the addition), we need to unwrap one more
layer.
2025-12-26 22:02:17 +01:00
bors 1107bbac4b Auto merge of #150407 - JonathanBrouwer:rollup-1v99kga, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#147717 (compiler/middle/lint: Suggest `#[expect(dead_code)]` instead of `#[allow(dead_code)]`)
 - rust-lang/rust#150236 (Port `#[rustc_must_implement_one_of]` to attribute parser)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-26 20:51:49 +00:00
Jonathan Brouwer 096bb5b615 Rollup merge of #150236 - Bryntet:parse_rustc_must_impl, r=JonathanBrouwer
Port `#[rustc_must_implement_one_of]` to attribute parser

Stumbled upon a weird (bug ?) behaviour while making this PR

it seems like it is possible to reach `check_attr.rs` checks without the attribute allowed target checks having already been finished, I added a comment about how to reproduce this in `check_attr.rs`

otherwise good to note is that a bunch of code was moved from `compiler/rustc_hir_analysis/src/collect.rs` to `check_attr.rs`

r? `@JonathanBrouwer`
2025-12-26 21:50:17 +01:00
Jonathan Brouwer 20d4bb924d Rollup merge of #147717 - Turbo87:accept-to-expect, r=petrochenkov
compiler/middle/lint: Suggest `#[expect(dead_code)]` instead of `#[allow(dead_code)]`

Until now the compiler suggested

> help: to override `-W unused` add `#[allow(dead_code)]`

when encountering e.g. an unused function in the codebase.

This PR changes the suggestion to `#[expect(dead_code)]`, which will warn again once the code is being used somewhere. This is helpful because it lets the developer know that the attribute can now be removed again. Without this the codebase will eventually be littered with stray `#[allow(dead_code)]` attributes that are no longer serving any purpose.

This was suggested in https://bsky.app/profile/steveklabnik.com/post/3m2uh7pf6e225 and I agreed strongly enough to take a look and implement it 😆
2025-12-26 21:50:17 +01:00
Esteban Küber 9f566f2463 Don't use matches! when == suffices
In the codebase we sometimes use `matches!` for values that can actually just be compared. Replace them with `==`.
2025-12-26 20:28:19 +00:00
Guillaume Gomez c054e52bc9 Add GUI test for copying code when line numbers are displayed in code examples 2025-12-26 20:24:50 +01:00
Guillaume Gomez 7f550f6f37 Fix "copy code" button 2025-12-26 20:24:50 +01:00
Edvin Bryntesson 94e16291e0 Port #[rustc_must_implement_one_of] to attribute parser 2025-12-26 19:08:21 +01:00
BioTomateHP 09f57eb96f Update hir.rs: fix typo, conform to max_width 2025-12-26 18:05:59 +01:00
bors 82dd3cb008 Auto merge of #150380 - Kivooeo:add-match-for-constkidn, r=BoxyUwU
avoid recreating field_const vec

r? BoxyUwU

fixes https://github.com/rust-lang/rust/issues/150354
fixes https://github.com/rust-lang/rust/issues/150355
2025-12-26 16:59:44 +00:00
Urgau 90e80f5b81 Document relative and absolute paths handling in --remap-path-prefix 2025-12-26 16:38:46 +01:00
bors 8da80d36a3 Auto merge of #150388 - reddevilmidzy:hir-analysis, r=Kivooeo
Update links in compiler/rustc_hir_analysis/README.md for type checking

cc: https://github.com/rust-lang/rustc-dev-guide/pull/2662
2025-12-26 13:52:26 +00:00
Kivooeo 517411f143 add const kind match 2025-12-26 13:12:56 +00:00
bors 2e854a9344 Auto merge of #150357 - ZuseZ4:zusez4-stdarch-push, r=sayantan
stdarch subtree update

Subtree update of `stdarch` to https://github.com/rust-lang/stdarch/commit/61119062fb9be522df5bd81ff0974d6c1e887dbc.

Created using https://github.com/rust-lang/josh-sync.

r? `@sayantn`

My first josh sync, it lgtm, but let me know if I missed something.
I'm especially looking forward to the amd GPU module, which we want to use for the offload project.
2025-12-26 10:44:27 +00:00
Manuel Drehwald 6f06d386b8 cpuid is safe since the stdarch sync, so remove unsafe from usages 2025-12-26 08:46:49 +01:00
Tobias Bieniek 86cef2ff98 compiler/middle/lint: Suggest #[expect(dead_code)] as alternative to #[allow(dead_code)] 2025-12-26 08:38:20 +01:00
Redddy d81ff8588c Update links in compiler/rustc_hir_analysis/README.md for type checking 2025-12-26 16:34:49 +09:00
Tobias Bieniek 4d43e78082 Add dead-code/unused-fn-with-check-pass UI test 2025-12-26 08:33:46 +01:00
bors 4c383cd5cb Auto merge of #150377 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? Manishearth

`Cargo.lock` update due to 28d62f0833. It should not affect the Rust repo, as `clippy_dev` is not used in the Rust repo.
2025-12-26 07:18:50 +00:00
Philipp Krones b04a3dce20 Update Cargo.lock 2025-12-25 23:25:04 +01:00
Philipp Krones b79a1338a2 Merge commit '99edcadfd5f6f6e8da34b1ba62774b53f5ca3863' into clippy-subtree-update 2025-12-25 23:24:43 +01:00
Philipp Krones 99edcadfd5 Rustup (#16299)
r? @ghost

changelog: none
2025-12-25 22:23:34 +00:00
bors fabece9e94 Auto merge of #150381 - JonathanBrouwer:rollup-c7pqytw, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#149964 (Write file with channel to S3)
 - rust-lang/rust#150365 (refactor: simplify code)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-25 20:13:39 +00:00
Jonathan Brouwer d37f008be8 Rollup merge of #150365 - cuiweixie:first_pr, r=JonathanBrouwer,Kivooeo
refactor: simplify code
2025-12-25 21:11:54 +01:00
Jonathan Brouwer 2a9bc187a6 Rollup merge of #149964 - Mark-Simulacrum:ci-channel, r=Kobzol
Write file with channel to S3

This will let rustup-toolchain-install-master gain support for installing stable artifacts, which is currently only possible when explicitly overriding the channel. That in turn will unblock letting Crater kick off a beta run as soon as both a new beta and a new stable artifact are ready, rather than waiting until the actual release.
2025-12-25 21:11:53 +01:00
Philipp Krones 28d62f0833 Don't take rustc-literal-escaper from sysroot
This resulted in the following error for me:

    error[E0464]: multiple candidates for `rlib` dependency `rustc_literal_escaper` found
      --> clippy_dev/src/lib.rs:25:1
       |
    25 | extern crate rustc_literal_escaper;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: candidate #1: /home/pkrones/.rustup/toolchains/nightly-2025-12-25-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_literal_escaper-4f30574e01c3dad1.rlib
       = note: candidate #2: /home/pkrones/.rustup/toolchains/nightly-2025-12-25-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_literal_escaper-c8a0e29ad1040cee.rmeta

Other tools in the Rust repo also take that as an explicit dependency, like rust-analyzer or lint-docs.
2025-12-25 20:51:01 +01:00
Philipp Krones b460a1d5e2 Bump nightly version -> 2025-12-25 2025-12-25 20:50:52 +01:00
Philipp Krones 7f4b539293 Merge remote-tracking branch 'upstream/master' into rustup 2025-12-25 20:50:32 +01:00
Heath Dutton🕴️ b2f19eac2f rustdoc: fix duplicate Re-exports sections
When a module contains both `pub extern crate` and `pub use` items,
they were being rendered under two separate "Re-exports" section
headers instead of one. This happened because the code iterated over
each ItemType separately and rendered a section header for each,
even though both ExternCrate and Import map to the same ItemSection.

This fix tracks the current section and only renders a new header
when the section actually changes, consolidating items that belong
to the same section under a single header.
2025-12-25 12:31:23 -05:00
bors 1bf12c32a0 Auto merge of #150376 - JonathanBrouwer:rollup-6umj8ur, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#150360 (rustdoc: fix incorrect type filter name in help popup)
 - rust-lang/rust#150366 (Fix typos and grammar errors in README files)
 - rust-lang/rust#150371 (several `proc_macro` cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-25 16:54:45 +00:00
Philipp Krones d61e73abbb Upgrade Node.js setup action and version (#16039)
Upgrade Node.js setup action and version at remark workflow

changelog: none
2025-12-25 16:02:06 +00:00
Philipp Krones b42bfda348 Use actions/checkout@v6 consistently (#16263)
Two places were not updated from v5 to v6.

changelog: none
r? flip1995
2025-12-25 16:01:27 +00:00
Jonathan Brouwer d80a406ffe Rollup merge of #150371 - cyrgani:pm-cleanups-again, r=petrochenkov
several `proc_macro` cleanups

Fixes typos and applies the suggestions from a few clippy lints that made sense here.
2025-12-25 16:29:22 +01:00