Commit Graph

4006 Commits

Author SHA1 Message Date
Tshepang Mbambo 469ebdd4fe
Merge pull request #2383 from rust-lang/tshepang-unused
remove dangling references
2025-05-15 00:32:57 +02:00
Matthias Krüger 43e8b50e9c
Rollup merge of #140989 - xizheyin:issue-139631, r=compiler-errors
Suggest replace f with f: Box<f> when expr field is short hand

Fixes #139631

r? compiler
2025-05-14 18:43:40 +02:00
Matthias Krüger 50946237cc
Rollup merge of #140988 - mathisbot:docfix_maybeuninit_write, r=tgross35
MaybeUninit::write: fix doc

# Fix doc for `MaybeUninit::write`

The documentation refers to the way `MaybeUninit` stores data internally. The property of not dropping content on context exit is the responsibility of `ManuallyDrop`.
2025-05-14 18:43:40 +02:00
Matthias Krüger 0ae5d00ab6
Rollup merge of #140976 - samueltardieu:diag-ipaddr-v4v6, r=Urgau
Add `Ipv4Addr` and `Ipv6Addr` diagnostic items

They will be used in Clippy to detect runtime parsing of known-valid IP addresses.
2025-05-14 18:43:39 +02:00
Matthias Krüger cb888ed71a
Rollup merge of #140973 - Berrysoft:update-bootstrap-lock, r=jieyouxu
Update rustix to 1.0.7 for bootstrap

Another bump for bootstrap. Finally it compiles on Cygwin:) Hooray!

r? ``@jieyouxu``
2025-05-14 18:43:39 +02:00
Matthias Krüger a00f0dd85d
Rollup merge of #140953 - jieyouxu:compiletest-bless-msg, r=compiler-errors
Fix a compiletest blessing message

It was showing compare mode instead of test name.

Fixes #140945.
Noticed in https://github.com/rust-lang/rust/pull/140622#issuecomment-2868705612.
2025-05-14 18:43:38 +02:00
Matthias Krüger 278937a7a8
Rollup merge of #140904 - ehuss:future-incompat-template, r=Mark-Simulacrum
Add an issue template for future-incompatible lints

This adds a GitHub issue template for future-incompatible lints. Most of the existing tracking issues have been using different formats with different information, and I think it would be helpful to make them a little more consistent and to ensure that sufficient information is provided.

Some comments on my choices:
* Added a dedicated section to describe *why* the change is being made. Many existing issues already have this, so let's standardize on it.
* Have a section with a very clear example. Almost all of the existing issues have this in one form or another.
* Added a "Recommendations" section, since this is something I see missing in several of the existing issues, and this is really important information IMHO.
* I reworded the "When" section. The existing template mentioned that these get reviewed every 6 weeks which my understanding is not true. That's also not very helpful information to the user, since it doesn't really answer the question. I'm not sure this section will actually be useful since I suspect most of the time we don't know when it will change (there have been a few exceptions).
* Clearly show the expected progression steps. Several issues already have this.
* Added implementation history, which is useful for linking PRs. (IDK, this could get merged with "Steps".)
2025-05-14 18:43:38 +02:00
Matthias Krüger 4716db0ab2
Rollup merge of #140827 - compiler-errors:gather-locals-twice, r=oli-obk
Do not ICE when reassigning in GatherLocalsVisitor on the bad path

Fixes https://github.com/rust-lang/rust/issues/140785
Fixes https://github.com/rust-lang/rust/issues/140730

See comment in code.

r? oli-obk
2025-05-14 18:43:37 +02:00
bors f521fd2627 Auto merge of #140921 - Berrysoft:update-rustc-lock, r=jieyouxu
Update `ctrlc`, `libloading` and `nix` for rustc

The main purpose is to update `nix` to 0.30.1. It adds support for cygwin.
2025-05-13 13:06:57 +00:00
bors 9561999183 Auto merge of #140887 - pietroalbini:pa-bootstrap-update, r=compiler-errors
Stage0 bootstrap update

This PR [follows the release process](https://forge.rust-lang.org/release/process.html#master-bootstrap-update-tuesday) to update the stage0 compiler.

The only thing of note is 58651d1b31, which was flagged by clippy as a correctness fix. I think allowing that lint in our case makes sense, but it's worth to have a second pair of eyes on it.

r? `@Mark-Simulacrum`
2025-05-13 09:54:28 +00:00
bors 44646899f1 Auto merge of #140951 - compiler-errors:super-fmt, r=ytmimi
Do not remove `super` keyword from `super let`

This is affecting a macro in the standard library:

bc7512ee63/library/core/src/pin.rs (L1945)

I added an exception in 6f6a9a585891d0a2d1114a7a621f35f28f39c0d9, but I'd like to remove it eventually, so opening this in-tree to not block this on the next rustfmt sync.

r? `@calebcartwright` or `@ytmimi`
2025-05-13 06:43:56 +00:00
bors d8dec87e1a Auto merge of #140935 - omahs:patch-5, r=jieyouxu
Fix typos

Fix typos
2025-05-13 03:33:22 +00:00
bors bf57a659f7 Auto merge of #140927 - mejrs:test5, r=jieyouxu
chore: move more ui tests

r? `@jieyouxu`
2025-05-13 00:03:33 +00:00
Tshepang Mbambo 45107c759a remove dangling references 2025-05-12 23:59:55 +02:00
bors 9fa6e479a7 Auto merge of #140914 - Zalathar:asm-bindings, r=compiler-errors
cg_llvm: Clean up some inline assembly bindings

This PR combines a few loosely-related cleanups to LLVM bindings related to inline assembly. These include:
- Replacing `LLVMRustInlineAsm` with LLVM-C's `LLVMGetInlineAsm`
- Adjusting FFI declarations to avoid the need for explicit `as_c_char_ptr` conversions
- Flattening control flow in `inline_asm_call`

There should be no functional changes.
2025-05-12 17:39:21 +00:00
omahs 5a04183ad2 Fix typos 2025-05-12 17:20:49 +00:00
许杰友 Jieyou Xu (Joe) 946f27e9d3
Merge pull request #2378 from smanilov/patch-7 2025-05-12 21:32:54 +08:00
Stan Manilov e96bd9bfc0 Remove n.b. about parser refactoring
Discussed in PR 2378; the note was outdated.
2025-05-12 14:27:26 +03:00
Yuki Okushi d4bf7d4b73
Merge pull request #2382 from Zalathar/no-tuple-unsize 2025-05-12 19:47:40 +09:00
Zalathar 8ebe4672cb Remove obsolete reference to `unsized_tuple_coercion` 2025-05-12 18:14:43 +10:00
bors 33ca0c9341 Auto merge of #140925 - the8472:test-140207, r=compiler-errors
add regression test for 140207

Assembly test for #140207
2025-05-12 04:32:50 +00:00
bors d5a97f1a08 Auto merge of #140923 - Zalathar:operand-bundle, r=lcnr
cg_llvm: Rename `OperandBundleOwned` to `OperandBundleBox`

As with `DIBuilderBox`, the "Box" suffix does a better job of communicating that this is an owning pointer to some borrowable resource.

This also renames the `raw` method to `as_ref`, which is what it would have been named originally if the `Deref` problem (#137603) had been known at the time.

No functional change.
2025-05-12 01:26:55 +00:00
bors 85730efd76 Auto merge of #140842 - tmiasko:print-mono-items, r=saethlin
Remove mono item collection strategy override from -Zprint-mono-items

Previously `-Zprint-mono-items` would override the mono item collection
strategy. When debugging one doesn't want to change the behaviour, so
this was counter productive. Additionally, the produced behaviour was
artificial and might never arise without using the option in the first
place (`-Zprint-mono-items=eager` without `-Clink-dead-code`).  Finally,
the option was incorrectly marked as `UNTRACKED`.

Resolve those issues, by turning `-Zprint-mono-items` into a boolean
flag that prints results of mono item collection without changing the
behaviour of mono item collection.

For codegen-units test incorporate `-Zprint-mono-items` flag directly
into compiletest tool.

Test changes are mechanical. `-Zprint-mono-items=lazy` was removed
without additional changes, and `-Zprint-mono-items=eager` was turned
into `-Clink-dead-code`.  Linking dead code disables internalization, so
tests have been updated accordingly.
2025-05-11 22:15:30 +00:00
Eric Huss 90d8951b3a Add an issue template for future-incompatible lints 2025-05-11 06:55:36 -07:00
bors 4fffc99071 Auto merge of #140854 - oli-obk:merge-queries, r=nnethercote
Merge typeck loop with static/const item eval loop

r? `@ghost`

Let's try a small one first. Doing this in general has some bad cache coherence issues because the query caches are laid out in `Vec<QueryResult>` lists per query where each index refers to a `DefId` in the same order as we're iterating. Iterating two or more lists at the same time does have cache issues, so I want to poke a bit at it to see if we can't merge just a few of them at a time.
2025-05-10 14:20:43 +00:00
Tshepang Mbambo a1603f1859 noise 2025-05-10 13:48:45 +02:00
Tshepang Mbambo 330cb46b36 we are a collective 2025-05-10 13:48:35 +02:00
Tshepang Mbambo 5e2a659b1d "cargo fmt" 2025-05-10 13:47:31 +02:00
Tshepang Mbambo 9f710fd775 bump edition 2025-05-10 13:47:31 +02:00
Tshepang Mbambo f99df9199f no point versioning these
They are internal tools.
2025-05-10 13:47:31 +02:00
Tshepang Mbambo 7fa4f19ab4 add missing word 2025-05-10 13:14:38 +02:00
Tshepang Mbambo 7f333c0cd2 last updated a year ago 2025-05-10 13:07:34 +02:00
Tshepang Mbambo 919836d9f2 sembr 2025-05-10 12:59:37 +02:00
Tshepang Mbambo 1dff715902 reduce clutter when reading source 2025-05-10 12:56:03 +02:00
Tshepang Mbambo 6b12439a07 fix broken links 2025-05-10 12:43:59 +02:00
Tshepang Mbambo e2171b97e7 is a question 2025-05-10 12:35:50 +02:00
Tshepang Mbambo 39c758c3af sembr 2025-05-10 12:35:40 +02:00
Tshepang Mbambo ff1e1d1bcc make more readable 2025-05-10 12:34:43 +02:00
Tshepang Mbambo 1d1a050dcd make more clear what is meant 2025-05-10 12:33:45 +02:00
Tshepang Mbambo ac44773f06 use the right case 2025-05-10 12:32:59 +02:00
Tshepang Mbambo fde7c94e0d link to chapter referred to
This made it look the the topic was covered in the chapter just before
the current one.
2025-05-10 12:21:56 +02:00
Tshepang Mbambo eadf6dc2e2
Merge pull request #2369 from rust-lang/tshepang-patch-1
add rdg push git config entry for git protocol pushers
2025-05-10 10:28:33 +02:00
bors af315f19be Auto merge of #140705 - LegNeato:backtracelock, r=Mark-Simulacrum
Update `backtrace` in Cargo.lock

Ran `cargo update -p backtrace`. This is needed to forward port the rust-gpu compiler backend.

Subsumes https://github.com/rust-lang/rust/pull/140631. Was supposed to be fixed by https://github.com/rust-lang/rust/pull/140353, but there were test failures and the backtrace update was backed out.
2025-05-10 06:13:41 +00:00
Tshepang Mbambo a2cc4ae295
Merge pull request #2376 from smanilov/patch-5
Fix minor typo in rustdoc-internals.md
2025-05-09 15:53:15 +02:00
Stan Manilov 374f53e02b Fix minor typo in rustdoc-internals.md 2025-05-09 15:50:49 +03:00
Tomasz Miąsko b82a852640 Remove mono item collection strategy override from -Zprint-mono-items
Previously `-Zprint-mono-items` would override the mono item collection
strategy. When debugging one doesn't want to change the behaviour, so
this was counter productive. Additionally, the produced behaviour was
artificial and might never arise without using the option in the first
place (`-Zprint-mono-items=eager` without `-Clink-dead-code`).  Finally,
the option was incorrectly marked as `UNTRACKED`.

Resolve those issues, by turning `-Zprint-mono-items` into a boolean
flag that prints results of mono item collection without changing the
behaviour of mono item collection.

For codegen-units test incorporate `-Zprint-mono-items` flag directly
into compiletest tool.

Test changes are mechanical. `-Zprint-mono-items=lazy` was removed
without additional changes, and `-Zprint-mono-items=eager` was turned
into `-Clink-dead-code`.  Linking dead code disables internalization, so
tests have been updated accordingly.
2025-05-09 12:19:09 +02:00
bors 52f9761766 Auto merge of #140176 - dpaoliello:arm64ecdec, r=wesleywiser
Fix linking statics on Arm64EC

Arm64EC builds recently started to fail due to the linker not finding a symbol:
```
symbols.o : error LNK2001: unresolved external symbol #_ZN3std9panicking11EMPTY_PANIC17hc8d2b903527827f1E (EC Symbol)
          C:\Code\hello-world\target\arm64ec-pc-windows-msvc\debug\deps\hello_world.exe : fatal error LNK1120: 1 unresolved externals
```

It turns out that `EMPTY_PANIC` is a new static variable that was being exported then imported from the standard library, but when exporting LLVM didn't prepend the name with `#` (as only functions are prefixed with this character), whereas Rust was prefixing with `#` when attempting to import it.

The fix is to have Rust not prefix statics with `#` when importing.

Adding tests discovered another issue: we need to correctly mark static exported from dylibs with `DATA`, otherwise MSVC's linker assumes they are functions and complains that there is no exit thunk for them.

CI found another bug: we only apply `DllImport` to non-local statics that aren't foreign items (i.e., in an `extern` block), that is we want to use `DllImport` for statics coming from other Rust crates. However, `__rust_no_alloc_shim_is_unstable` is a static generated by the Rust compiler if required, but downstream crates consider it a foreign item since it is declared in an `extern "Rust"` block, thus they do not apply `DllImport` to it and so fails to link if it is exported by the previous crate as `DATA`. The fix is to apply `DllImport` to foreign items that are marked with the `rustc_std_internal_symbol` attribute (i.e., we assume they aren't actually foreign and will be in some Rust crate).

Fixes #138541

---
try-job: dist-aarch64-msvc
try-job: dist-x86_64-msvc
try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
2025-05-09 00:43:28 +00:00
bors b7f61ea85e Auto merge of #140818 - matthiaskrgr:rollup-5eaotr2, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #140095 (Eliminate `word_and_empty` methods.)
 - #140341 (Clarify black_box warning a bit)
 - #140684 (Only include `dyn Trait<Assoc = ...>` associated type bounds for `Self: Sized` associated types if they are provided)
 - #140707 (Structurally normalize in range pattern checking in HIR typeck)
 - #140716 (Improve `-Zremap-path-scope` tests with dependency)
 - #140800 (Make `rustdoc-tempdir-removal` run-make tests work on other platforms than linux)
 - #140802 (Add release notes for 1.87.0)
 - #140811 (Enable triagebot note functionality for rust-lang/rust)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-08 21:32:19 +00:00
Matthias Krüger ab9644d117
Rollup merge of #140684 - compiler-errors:unnecessary-assoc, r=lcnr
Only include `dyn Trait<Assoc = ...>` associated type bounds for `Self: Sized` associated types if they are provided

Since #136458, we began filtering out associated types with `Self: Sized` bounds when constructing the list of associated type bounds to put into our `dyn Trait` types. For example, given:

```rust
trait Trait {
    type Assoc where Self: Sized;
}
```

After #136458, even if a user writes `dyn Trait<Assoc = ()>`, the lowered ty would have an empty projection list, and thus be equivalent to `dyn Trait`. However, this has the side effect of no longer constraining any types in the RHS of `Assoc = ...`, not implying any WF implied bounds, and not requiring that they hold when unsizing.

After this PR, we include these bounds, but (still) do not require that they are provided. If the are not provided, they are skipped from the projections list.

This results in `dyn Trait` types that have differing numbers of projection bounds. This will lead to re-introducing type mismatches e.g. between `dyn Trait` and `dyn Trait<Assoc = ()>`. However, this is expected and doesn't suffer from any of the deduplication unsoundness from before #136458.

We may want to begin to ignore thse bounds in the future by bumping `unused_associated_type_bounds` to an FCW. I don't want to tangle that up into the fix that was originally intended in #136458, so I'm doing a "fix-forward" in this PR and deferring thinking about this for the future.

Fixes #140645

r? lcnr
2025-05-08 20:22:16 +02:00
Matthias Krüger c494714d30
Rollup merge of #140341 - saethlin:black-box-qoi, r=Mark-Simulacrum
Clarify black_box warning a bit

Trying to bring the docs on black_box more in line with the advice that we have discussed in Zulip.

https://github.com/rust-lang/rust/pull/140341#issuecomment-2832592382
2025-05-08 20:22:13 +02:00