1
Fork 0
Commit graph

286863 commits

Author SHA1 Message Date
Matthias Krüger
b3e55a5c84
Rollup merge of #139819 - Kobzol:rust-cache, r=marcoieni
Use `rust-cache` to speed-up `citool` compilation

Alternative to https://github.com/rust-lang/rust/pull/139678.

r? ``@marcoieni``
2025-04-15 21:16:04 +02:00
Matthias Krüger
27f1f4d27b
Rollup merge of #139818 - compiler-errors:normalize-tails, r=oli-obk
Normalize ADT field in `find_tails_for_unsizing`

See the comment inline and in the test.

TL;DR is that we're getting getting a type from a `type_of` query and then matching on it structurally in codegen, so we're obligated to normalize it. The fact that this wasn't triggered earlier is that all of the types that have `CoerceUnsized` implementations never encounter aliases when peeling the ADT down to their base reference/ptr type.

**NOTE**: I also renamed some things and reorganized the function a bit.

Fixes #139812
Fixes #74451, which I didn't think was interesting enough to add another test.

r? oli-obk
2025-04-15 21:16:03 +02:00
Matthias Krüger
ca0b7f4dcf
Rollup merge of #138455 - yotamofek:pr/rustdoc/more-impl-display, r=GuillaumeGomez
`librustdoc`: more `impl fmt::Display`

Continuation of #137425 and #136828 and #136784
Working towards getting rid of the `write_str` helper
r? `@GuillaumeGomez` (if you want!)
2025-04-15 21:16:03 +02:00
Michael Goulet
11e5987d01 Don't compute name of associated item if it's an RPITIT 2025-04-15 18:46:26 +00:00
Michael Goulet
c774adcbb5 Split TypeFolder and FallibleTypeFolder 2025-04-15 18:30:35 +00:00
Vadim Petrochenkov
38f7060a73 Revert "Deduplicate template parameter creation"
This reverts commit 6adc2c1fd6.
2025-04-15 21:00:11 +03:00
Josh Triplett
043c5ff982 Add warning comment to Take::get_ref and Chain::get_ref
The methods `Take::get_mut` and `Chain::get_mut` include comments
warning about modifying the I/O state of the underlying reader. However,
many readers (e.g. `File`) allow I/O using a shared reference (e.g.
`&File`). So, add the same caveat to the `get_ref` methods.
2025-04-15 10:54:08 -07:00
onur-ozkan
6d52b51d3e add comment in TomlConfig::merge about the merge order
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 19:10:31 +03:00
bors
414da5b63d Auto merge of #138906 - thaliaarchi:unsupported-test-exe, r=bjorn3
Reject test executables when not supported by target

Currently, compiling tests for SOLID produces an ICE, because SOLID does not support executables.

See https://github.com/rust-lang/rust/issues/138047
2025-04-15 16:05:15 +00:00
reddevilmidzy
812095031b Add test for issue 125668 2025-04-15 23:51:10 +09:00
Jason Newcomb
52694034ba Add copy_within to IndexSlice 2025-04-15 10:44:28 -04:00
Waffle Lapkin
8934ac5759
add a comment for code that isn't 2025-04-15 15:02:05 +02:00
Waffle Lapkin
dda4d7bc44
slightly correct comments and diagnostics about checking modifications
I feel like they are still wrong, but maybe less so .-.

The `info:` was unhelpful -- we only use upstream in CI nowdays.
2025-04-15 15:02:05 +02:00
Waffle Lapkin
52f4b16075
use helper function instead of writing rustfmt stamp by hand 2025-04-15 15:02:05 +02:00
Waffle Lapkin
502b630cd1
tidy: don't crush on non-existent submodules 2025-04-15 15:01:56 +02:00
Jakub Beránek
3c01dfe2ae
Rename is_builder_target to is_host_target 2025-04-15 14:13:53 +02:00
Jakub Beránek
2907ab5bf9
Move is_builder_target, is_system_llvm and is_rust_llvm from Builder to Config 2025-04-15 14:12:48 +02:00
Obei Sideg
ee53c26b41
Add explicit_extern_abis unstable feature
also add `explicit-extern-abis` feature section to
the unstable book.
2025-04-15 14:33:19 +03:00
bors
40dacd50b7 Auto merge of #139632 - Darksonn:cfi-fmt, r=m-ou-se
cfi: do not transmute function pointers in formatting code

Follow-up to #115954.
Addresses #115199 point 2.
Related to #128728.
Discussion [on the LKML](https://lore.kernel.org/all/20250410115420.366349-1-panikiel@google.com/).

cc `@maurer` `@rcvalle` `@RalfJung`
2025-04-15 11:11:31 +00:00
MarcoIeni
73065b9484
CI: rename MacOS runner 2025-04-15 12:28:32 +02:00
Mara Bos
1ca9300989 Update tests. 2025-04-15 11:14:23 +02:00
Mara Bos
d20b270b4e Don't name macro internals in "does not live long enough" errors. 2025-04-15 11:14:23 +02:00
Mara Bos
1dd77cd24a Implement pin!() using super let. 2025-04-15 11:14:21 +02:00
onur-ozkan
7dfb457745 add FIXME note in TomlConfig::merge
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:53:21 +03:00
onur-ozkan
8e6f50bb4d fix path and the ordering logic
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:33:15 +03:00
onur-ozkan
3f70f197f2 apply nit notes
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:33:11 +03:00
onur-ozkan
78cb4538ee document include in bootstrap.example.toml
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:33:06 +03:00
onur-ozkan
4e80659b32 implement cyclic inclusion handling
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:33:01 +03:00
onur-ozkan
89e3befe63 document config extensions
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:32:56 +03:00
onur-ozkan
1c1febc59d add new config option: include
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:32:46 +03:00
León Orell Valerian Liehr
6242335fdb
Improve diagnostic for E0178 (bad + in type)
Namely, use a more sensical primary span.
Don't pretty-print AST nodes for the diagnostic message. Why:
* It's lossy (e.g., it doesn't replicate trailing `+`s in trait objects.
* It's prone to leak error nodes (printed as `(/*ERROR*/)`) since
  the LHS can easily represent recovered code (e.g., `fn(i32?) + T`).
2025-04-15 10:08:49 +02:00
León Orell Valerian Liehr
8887af72a0
Improve parse errors for lifetimes in type position 2025-04-15 10:08:36 +02:00
Jakub Beránek
c49b0bdb1a
Use rust-cache to speed-up citool compilation 2025-04-15 10:04:25 +02:00
bors
f433fa46b0 Auto merge of #139845 - Zalathar:rollup-u5u5y1v, r=Zalathar
Rollup of 17 pull requests

Successful merges:

 - #138374 (Enable contracts for const functions)
 - #138380 (ci: add runners for vanilla LLVM 20)
 - #138393 (Allow const patterns of matches to contain pattern types)
 - #139517 (std: sys: process: uefi: Use NULL stdin by default)
 - #139554 (std: add Output::exit_ok)
 - #139660 (compiletest: Add an experimental new executor to replace libtest)
 - #139669 (Overhaul `AssocItem`)
 - #139671 (Proc macro span API redesign: Replace proc_macro::SourceFile by Span::{file, local_file})
 - #139750 (std/thread: Use default stack size from menuconfig for NuttX)
 - #139772 (Remove `hir::Map`)
 - #139785 (Let CStrings be either 1 or 2 byte aligned.)
 - #139789 (do not unnecessarily leak auto traits in item bounds)
 - #139791 (drop global where-bounds before merging candidates)
 - #139798 (normalize: prefer `ParamEnv` over `AliasBound` candidates)
 - #139822 (Fix: Map EOPNOTSUPP to ErrorKind::Unsupported on Unix)
 - #139833 (Fix some HIR pretty-printing problems)
 - #139836 (Basic tests of MPMC receiver cloning)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-15 08:02:23 +00:00
Waffle Lapkin
6c441cc7a5
canonicalize test build dir before normalizing it
Fix fixes failures of the following tests when build directory is a
symlink:
- `tests/ui/error-codes/E{0464,0523}.rs`
- `tests/ui/crate-loading/crateresolve{1,2}.rs` (those are the same tests)
2025-04-15 09:46:22 +02:00
Waffle Lapkin
1397dabd1e
fix typo 2025-04-15 09:42:30 +02:00
Waffle Lapkin
fc8df06f4f
update submodules if the directory doesn't exist 2025-04-15 09:42:25 +02:00
mejrs
4ac3877521 unstable book; document macro_metavar_expr_concat 2025-04-15 09:28:04 +02:00
Alice Ryhl
6513df9652 Add comment
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-04-15 07:25:42 +00:00
Alice Ryhl
1cbdfab75d Use full path for core::mem::transmute
Suggested-by: Tamir Duberstein <tamird@gmail.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
2025-04-15 07:24:35 +00:00
Tamir Duberstein
2009ca6d88 Remove #![feature(no_sanitize)] 2025-04-15 07:24:34 +00:00
Nicholas Nethercote
c12b4aade0 Use a dummy ident for a lint_if_path_starts_with_module call.
This is pretty weird code. As the `HACK` comment indicates, we push the
empty ident here only to make the path longer, so certain checks to
occur within `lint_if_path_starts_with_module`. `dummy` is a better
choice because it explicitly communicates that the actual value doesn't
matter.
2025-04-15 16:05:13 +10:00
Nicholas Nethercote
2b43e66496 Remove a kw::Empty usage in symbol mangling.
Field names are never empty, so the unwrap is unnecessary.
2025-04-15 16:05:13 +10:00
Nicholas Nethercote
f3847f0639 Remove some "name isn't empty" assertions.
These were low value even before #137978 resulted in empty names being
used much less. (Why check for non-emptiness in these three places?
There are thousands of places in the compiler you could check.)
2025-04-15 16:04:11 +10:00
Stuart Cook
783b08156e
Rollup merge of #139836 - glyn:test-mpmc-receiver-cloning, r=jhpratt
Basic tests of MPMC receiver cloning

Ref: https://github.com/rust-lang/rust/issues/126840#issuecomment-2802321146
2025-04-15 15:47:32 +10:00
Stuart Cook
4d5284a866
Rollup merge of #139833 - nnethercote:fix-139633, r=oli-obk
Fix some HIR pretty-printing problems

r? `@oli-obk`
2025-04-15 15:47:32 +10:00
Stuart Cook
45b644b3c1
Rollup merge of #139822 - 0x79de:fix-eopnotsupp-mapping, r=dtolnay
Fix: Map EOPNOTSUPP to ErrorKind::Unsupported on Unix

This change maps the EOPNOTSUPP errno value (95) to std::io::ErrorKind::Unsupported in the decode_error_kind function for Unix platforms. Previously, it was incorrectly mapped to ErrorKind::Uncategorized.

Fixes #139803
2025-04-15 15:47:31 +10:00
Stuart Cook
b21c5cd025
Rollup merge of #139798 - lcnr:where-bounds-gt-alias-bound, r=compiler-errors
normalize: prefer `ParamEnv` over `AliasBound` candidates

cc https://github.com/rust-lang/trait-system-refactor-initiative/issues/175 not the only issue affecting bevy sadly

r? ``@compiler-errors``
2025-04-15 15:47:30 +10:00
Stuart Cook
e8c9dcc79e
Rollup merge of #139791 - lcnr:ignore-global-where-bounds, r=compiler-errors
drop global where-bounds before merging candidates

fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/172

r? ```@compiler-errors```
2025-04-15 15:47:30 +10:00
Stuart Cook
8118fca7fd
Rollup merge of #139789 - lcnr:opaques-auto-trait-leakage, r=compiler-errors
do not unnecessarily leak auto traits in item bounds

fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/158

Not a fix for https://github.com/rust-lang/trait-system-refactor-initiative/issues/173 as you may have realized/tried yourself, cc #139788. However, fixing this feels desirable regardless and I don't see any reason not to.

r? ```@compiler-errors```
2025-04-15 15:47:29 +10:00