Commit Graph

291081 Commits

Author SHA1 Message Date
The Miri Cronjob Bot
bf0aab9b2e fmt 2025-05-27 05:03:22 +00:00
The Miri Cronjob Bot
1c73fb9fc4 Merge from rustc 2025-05-27 05:02:07 +00:00
The Miri Cronjob Bot
aa94ac1252 Preparing for merge from rustc 2025-05-27 04:54:50 +00:00
Ben Kimock
6d0e04d6f3 Wrap NonZero::new_unchecked call in the print_type_sizes test in a const 2025-05-27 00:35:25 -04:00
Chayim Refael Friedman
7baa85d16b Fix inference of AsyncFnX return type 2025-05-27 06:44:50 +03:00
bors
d76fe15402 Auto merge of #140790 - quininer:mac-xray, r=wesleywiser,jieyouxu
Enable xray support for Mac

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

Upstream has supported Mac for a while, let's enable it.

I've tested it on M4 and it generates nop sled correctly.

* https://maskray.me/blog/2023-06-18-port-llvm-xray-to-apple-systems
* https://github.com/llvm/llvm-project/blob/llvmorg-20.1.4/clang/lib/Driver/XRayArgs.cpp#L31

try-job: x86_64-apple-1
try-job: aarch64-apple
2025-05-26 23:44:21 +00:00
Nicholas Nethercote
ec8baa5d43 Avoid fold/flat_map.
This pattern of iterating over scopes and drops occurs multiple times in
this file, with slight variations. All of them use `for` loops except
this one. This commits changes it for consistency.
2025-05-27 09:28:39 +10:00
Nicholas Nethercote
84bb48fc88 Factor out some repeated code in build_exit_tree. 2025-05-27 09:28:39 +10:00
Nicholas Nethercote
bf4532c05d Rename DropTree::drops as DropTree::drop_nodes.
Because `Scope` also has a field named `drops`, and I found having two
fields with the same name made this code harder to read.
2025-05-27 09:28:39 +10:00
Nicholas Nethercote
df09feddfa Remove DropNodeKey::kind.
It's not needed, because `next` and `local` fields uniquely identify the
drop. This is a ~2% speed win on the very large program in #134404, and
it's also a tiny bit simpler.
2025-05-27 09:28:39 +10:00
Folkert de Vries
7fe8263285 use custom types to clarify arguments to emit_ptr_va_arg 2025-05-27 01:24:19 +02:00
Nicholas Nethercote
1f3d9a4b61 Streamline visibility_print_with_space.
Moving the visibility stuff into the `from_fn` avoids the `Cow` and
makes the code a little shorter and simpler.
2025-05-27 08:40:32 +10:00
Nicholas Nethercote
8dde6d5349 Streamline TypeAliasPart::get.
- `ret` only ever gets at most one entry, so it can be an `Option`
  instead of a `Vec`.
- Which means we can use `filter_map` instead of `flat_map`.
- Move `trait_` next to the `ret` assignment, which can only happen
  once.
- No need for `impls` to be a `Vec`, it can remain an iterator.
- Avoid `Result` when collecting `impls`.
2025-05-27 08:26:50 +10:00
Chayim Refael Friedman
2e9c2cec04 Merge pull request #19862 from ChayimFriedman2/item-resolve-macro-hir
fix: Fix IDE resolution of item macros
2025-05-26 21:34:18 +00:00
Santiago Pastorino
c8ed2a7423 Remove spastorino from vacations 2025-05-26 18:13:54 -03:00
Alex Macleod
3927a61a54 [manual_flatten]: Fix with nested Some or Ok pattern (#14846)
changelog: [`manual_flatten`]: fix with nested `Some` or `Ok` pattern
fixes rust-lang/rust-clippy#6776
2025-05-26 21:03:39 +00:00
bors
2805e1dc4c Auto merge of #141605 - jieyouxu:rollup-3gjqh5l, r=jieyouxu
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#140898 (minor improvements on running miri)
 - rust-lang/rust#141392 (Avoid obligation construction dance with query region constraints)
 - rust-lang/rust#141431 (Emit dummy open drop for unsafe binder)
 - rust-lang/rust#141433 (Properly analyze captures from unsafe binders)
 - rust-lang/rust#141439 (Deduplicate dyn compatibility violations due to coercion)
 - rust-lang/rust#141449 (further deduplicate ast visitor code)
 - rust-lang/rust#141513 (interpret: add allocation parameters to `AllocBytes`)
 - rust-lang/rust#141516 (speed up charsearcher for ascii chars)
 - rust-lang/rust#141526 (add a dedicated section for compiler environment variables in the unstable book)
 - rust-lang/rust#141550 (Fix `unused_braces` lint suggestion when encountering attributes)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-26 20:30:06 +00:00
MarcoIeni
1b7a927d84 ci: move tests from x86_64-gnu-llvm-19 job to aarch64 2025-05-26 22:27:20 +02:00
León Orell Valerian Liehr
6f7927d9b5 Merge pull request #2416 from rust-lang/tshepang-patch-1
diagnostic translations work is on pause
2025-05-26 22:14:47 +02:00
Tshepang Mbambo
c170a699a6 diagnostic translations work is on pause 2025-05-26 22:09:35 +02:00
lcnr
0830ce036f assert we never incorrectly canonicalize envs 2025-05-26 19:57:48 +00:00
lcnr
c56efaedfa add additional TypeFlags fast paths 2025-05-26 19:57:48 +00:00
Alona Enraght-Moony
464cb9bf49 Merge pull request #2415 from rust-lang/aDotInTheVoid-patch-1
Remove rustdoc askama migration from getting started
2025-05-26 20:56:45 +01:00
Alona Enraght-Moony
04f466a2bd Remove rustdoc askama migration from getting started
This effort is blocked, so pointing new contributors here would be setting them up for failure.

https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/about.3A.20status.20of.20askama.20migration/with/497389045
2025-05-26 20:56:14 +01:00
Urgau
3fd0265fbb rustdoc: use custom CfgMatchesLintEmitter to make check-cfg work 2025-05-26 21:52:21 +02:00
Urgau
93f3db25c0 Expose rustc_lint::decorate_builtin_lint for use in rustdoc 2025-05-26 21:51:09 +02:00
Urgau
e33fe611f5 Add custom trait for emitting lint within cfg_matches 2025-05-26 21:51:09 +02:00
Marcelo Domínguez
c6c2fde737 Minor macro docs fixes 2025-05-26 19:47:42 +00:00
binarycat
e7683f1055 core: begin deduplicating pointer docs
this also cleans up two inconsistancies:
1. both doctests on the ::add methods were
   actually calling the const version.
2. on of the ::offset methods was missing
   a line of clarification.

part of https://github.com/rust-lang/rust/issues/139190
2025-05-26 14:29:23 -05:00
Jacob Pratt
7aef56d9b9 Call out possibility of invariant result 2025-05-26 15:06:36 -04:00
Eric Huss
6a8663ae26 Update mdbook to 0.4.51
This fixes a silly regression introduced in 0.4.50 that broke the search
hotkey (https://github.com/rust-lang/rust/pull/141457).

Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0451
2025-05-26 12:01:43 -07:00
Timo
b719f99090 Consider consts in patterns as refutable (#14887)
changelog: none
2025-05-26 18:13:29 +00:00
Jeremy Drake
108c16eebd bootstrap: translate Windows paths in a way that works for both Cygwin and MSYS2
Cygwin defaults to rooting Windows paths in /cygdrive/X, while MSYS2
configures them to be /X.  Regardless of configuration, drives are
always accessible as /proc/cygdrive/X, so use that.
2025-05-26 10:31:56 -07:00
许杰友 Jieyou Xu (Joe)
bca4279457 Rollup merge of #141550 - Urgau:unused_braces-attrs, r=chenyukang
Fix `unused_braces` lint suggestion when encountering attributes

This PR fixes the `unused_braces` lint suggestion when encountering attributes by not removing them in the suggestion.

Fixes rust-lang/rust#141549
2025-05-27 01:29:22 +08:00
许杰友 Jieyou Xu (Joe)
d5a26c5660 Rollup merge of #141526 - jyn514:env-vars, r=petrochenkov
add a dedicated section for compiler environment variables in the unstable book

rendered: ![image](https://github.com/user-attachments/assets/dcb6e2a3-2e2d-43bb-8f45-79715705bf45)

fixes https://github.com/rust-lang/rust/issues/141523
2025-05-27 01:29:21 +08:00
许杰友 Jieyou Xu (Joe)
408dc51f97 Rollup merge of #141516 - bend-n:okay, r=workingjubilee
speed up charsearcher for ascii chars

attempt at fixing rust-lang/rust#82471

this implementation should be valid because ascii characters are always one byte and there are no continuation bytes that overlap with ascii characters

im not completely sure that this is _always_ an improvement but it seems to be an improvement for this case and i dont think it can significantly regress any cases
2025-05-27 01:29:20 +08:00
许杰友 Jieyou Xu (Joe)
afb57cadda Rollup merge of #141513 - nia-e:allocbytes-extend, r=RalfJung
interpret: add allocation parameters to `AllocBytes`

Necessary for a better implementation of [rust-lang/miri#4343](https://github.com/rust-lang/miri/pull/4343). Also included here is the code from that PR, adapted to this new interface for the sake of example and so that CI can run on them; the Miri changes can be reverted and merged separately, though.

r? `@RalfJung`
2025-05-27 01:29:20 +08:00
许杰友 Jieyou Xu (Joe)
be778ed1f8 Rollup merge of #141449 - fee1-dead-contrib:push-qkosmtkqztkk, r=oli-obk
further deduplicate ast visitor code

Previous PR: #141249

Tracking issue: #127615

r? `@oli-obk`
2025-05-27 01:29:19 +08:00
许杰友 Jieyou Xu (Joe)
92b07de1ca Rollup merge of #141439 - compiler-errors:dyn-compatible-coerce, r=oli-obk
Deduplicate dyn compatibility violations due to coercion

Don't unnecessarily emit dyn compatibility violations due to coercion to a non-dyn-compatible target type.

For us to even have that target type, we would have had to write `dyn Trait` somewhere in source, and that would have led to us *already* emitting a dyn compatibility violation when checking that user written type is WF.

r? oli-obk
2025-05-27 01:29:19 +08:00
许杰友 Jieyou Xu (Joe)
ce0adf08c9 Rollup merge of #141433 - compiler-errors:unsafe-binder-captures, r=oli-obk
Properly analyze captures from unsafe binders

We need to represent the unsafe binder unwrap as an adjustment in HIR. Pretty straightforward b/c we already represent it as a projection elem in MIR.

Fixes #141418
Fixes #141417

r? oli-obk
2025-05-27 01:29:18 +08:00
许杰友 Jieyou Xu (Joe)
9f93c48ddc Rollup merge of #141433 - compiler-errors:unsafe-binder-captures, r=oli-obk
Properly analyze captures from unsafe binders

We need to represent the unsafe binder unwrap as an adjustment in HIR. Pretty straightforward b/c we already represent it as a projection elem in MIR.

Fixes #141418
Fixes #141417

r? oli-obk
2025-05-27 01:29:18 +08:00
许杰友 Jieyou Xu (Joe)
0e710d0883 Rollup merge of #141431 - compiler-errors:open-drop, r=oli-obk
Emit dummy open drop for unsafe binder

Fixes rust-lang/rust#141394

We can't taint the body in wfcheck when we have a `T: Copy` bound failure, so we end up binding MIR here. Emit a dummy open drop so that drop elaboration doesn't fail.

r? oli-obk
2025-05-27 01:29:18 +08:00
许杰友 Jieyou Xu (Joe)
aa9978229e Rollup merge of #141392 - compiler-errors:query-outlives, r=lcnr
Avoid obligation construction dance with query region constraints

And some renaming...
2025-05-27 01:29:17 +08:00
许杰友 Jieyou Xu (Joe)
0912d1f06a Rollup merge of #140898 - onur-ozkan:miri-run, r=Kobzol
minor improvements on running miri

It should be clear from the commit messages when reviewing them one by one.
2025-05-27 01:29:16 +08:00
a-yossy
816fa0a923 changelog: [manual_flatten]: fix with nested Some or Ok pattern 2025-05-27 02:28:30 +09:00
bors
40d2563ea2 Auto merge of #141500 - compiler-errors:rerun-cache-2, r=lcnr
Don't rerun goals if none of their vars have changed

r? `@ghost`

Alternative to rust-lang/rust#141488. I'm pretty sure that we don't need to re-run the goal at all if the inputs don't change... 🤔
2025-05-26 17:02:43 +00:00
Tshepang Mbambo
db998211e8 Merge pull request #2407 from smanilov/patch-14
Add time reference and tracking info for trait system refactor
2025-05-26 18:49:20 +02:00
Alexey Semenyuk
8cced0fd6f Show total count lints 2025-05-26 21:40:25 +05:00
binarycat
f9931d198c rustdoc: refactor Tooltip rendering logic 2025-05-26 11:35:45 -05:00
Nicholas Nethercote
19802e8e9c Remove an unnecessary use of Box::into_inner. 2025-05-27 02:06:40 +10:00