about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-05-26Auto merge of #140790 - quininer:mac-xray, r=wesleywiser,jieyouxubors-0/+2
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-27Avoid `fold`/`flat_map`.Nicholas Nethercote-5/+6
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-27Factor out some repeated code in `build_exit_tree`.Nicholas Nethercote-12/+6
2025-05-27Rename `DropTree::drops` as `DropTree::drop_nodes`.Nicholas Nethercote-34/+46
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-27Remove `DropNodeKey::kind`.Nicholas Nethercote-2/+1
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-27use custom types to clarify arguments to `emit_ptr_va_arg`Folkert de Vries-22/+61
2025-05-26Limit the size of cgu names when using the `-Zhuman-readable-cgu-names` optionDiggory Blake-6/+31
Prior to this change, cgu names could be generated which would result in filenames longer than the limit imposed by the OS.
2025-05-26Auto merge of #141605 - jieyouxu:rollup-3gjqh5l, r=jieyouxubors-588/+506
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-26assert we never incorrectly canonicalize envslcnr-0/+7
2025-05-26add additional `TypeFlags` fast pathslcnr-18/+131
2025-05-26Expose `rustc_lint::decorate_builtin_lint` for use in `rustdoc`Urgau-3/+4
2025-05-26Add custom trait for emitting lint within `cfg_matches`Urgau-6/+21
2025-05-27Rollup merge of #141550 - Urgau:unused_braces-attrs, r=chenyukang许杰友 Jieyou Xu (Joe)-16/+19
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-27Rollup merge of #141513 - nia-e:allocbytes-extend, r=RalfJung许杰友 Jieyou Xu (Joe)-27/+68
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-27Rollup merge of #141449 - fee1-dead-contrib:push-qkosmtkqztkk, r=oli-obk许杰友 Jieyou Xu (Joe)-430/+285
further deduplicate ast visitor code Previous PR: #141249 Tracking issue: #127615 r? `@oli-obk`
2025-05-27Rollup merge of #141439 - compiler-errors:dyn-compatible-coerce, r=oli-obk许杰友 Jieyou Xu (Joe)-2/+16
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-27Rollup merge of #141433 - compiler-errors:unsafe-binder-captures, r=oli-obk许杰友 Jieyou Xu (Joe)-5/+28
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-27Rollup merge of #141431 - compiler-errors:open-drop, r=oli-obk许杰友 Jieyou Xu (Joe)-0/+17
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-27Rollup merge of #141392 - compiler-errors:query-outlives, r=lcnr许杰友 Jieyou Xu (Joe)-108/+73
Avoid obligation construction dance with query region constraints And some renaming...
2025-05-26Auto merge of #141500 - compiler-errors:rerun-cache-2, r=lcnrbors-89/+291
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-27Remove unused `P` stuff.Nicholas Nethercote-42/+2
2025-05-27Remove support for `P<[T]>`.Nicholas Nethercote-78/+1
It's no longer used.
2025-05-27Remove the one use of `P<[T]>`.Nicholas Nethercote-2/+2
A `Vec` is fine, the additional word (vector vs. boxed slice) doesn't matter here.
2025-05-27Remove `P::map`.Nicholas Nethercote-38/+21
It's barely used, and the places that use it are better if they don't.
2025-05-27Remove `'static` bounds on `P`.Nicholas Nethercote-4/+4
These date back to 2014. I don't think they're needed any more.
2025-05-27Remove an unnecessary use of `Box::into_inner`.Nicholas Nethercote-2/+1
2025-05-26Auto merge of #141442 - compiler-errors:fast-path-pred, r=lcnrbors-8/+59
Fold predicate fast path in canonicalizer and eager resolver See individual commits. r? lcnr
2025-05-26Support opaque_types_defined_by for SyntheticCoroutineBodyMichael Goulet-3/+5
2025-05-26Deduplicate dyn compatibility violations due to coercionMichael Goulet-2/+16
2025-05-26Auto merge of #141406 - RalfJung:less-force-allocate, r=oli-obkbors-89/+84
interpret: do not force_allocate all return places A while ago I cleaned up our `PlaceTy` a little, but as a side-effect of that, return places had to always be force-allocated. That turns out to cause quite a few extra allocations, and for a project we are doing where we marry Miri with a model checker, that means a lot of extra work -- local variables are just so much easier to reason about than allocations. So, this PR brings back the ability to have the return place be just a local of the caller. To make this work cleanly I had to rework stack pop handling a bit, which also changes the output of Miri in some cases as the span for errors occurring during a particular phase of stack pop changed. With these changes, a no-std binary with a function of functions that just take and return scalar types and that uses no pointers now does not move *any* local variables into memory. :) r? `@oli-obk`
2025-05-26mir-opt: Do not transform non-int type in match_branchesdianqk-2/+4
2025-05-26Reduce indentation in codegen_panic_intrinsicbjorn3-49/+47
2025-05-26Don't depend on FnAbi for intrinsicsbjorn3-32/+42
Intrinsics are not real functions and as such don't have any calling convention. Trying to compute a calling convention for an intrinsic anyway is a nonsensical operation.
2025-05-26Remove usage of FnAbi in codegen_intrinsic_callbjorn3-63/+31
2025-05-26Pass PlaceRef rather than Bx::Value to codegen_intrinsic_callbjorn3-45/+38
2025-05-26Move caller_location handling into codegen_intrinsic_callbjorn3-18/+20
2025-05-26Always use fn_span in codegen_call_terminatorbjorn3-15/+11
2025-05-26Move some code around in codegen_call_terminatorbjorn3-99/+103
2025-05-26Don't rerun goals if none of its vars have changedMichael Goulet-88/+290
2025-05-26remove eq_unspanned from TokenStreamyukang-9/+9
2025-05-26RenameMichael Goulet-30/+39
2025-05-26Don't retry in pred_known_to_hold_modulo_regions in new solver, since new ↵Michael Goulet-1/+1
solver is more complete Just a totally unrelated nitpick I'm folding into the PR, since it's code I'd like for us to prune when the new solver lands.
2025-05-26Avoid obligation construction dance with query region constraintsMichael Goulet-96/+52
2025-05-26Fix incorrect eq_unspanned in TokenStreamyukang-8/+2
2025-05-26Auto merge of #141567 - jhpratt:rollup-uuhcmci, r=jhprattbors-55/+48
Rollup of 8 pull requests Successful merges: - rust-lang/rust#134696 (Implement `normalize_lexically`) - rust-lang/rust#140539 (Simplify `attribute_groups`) - rust-lang/rust#140863 ([rustdoc] Unify type aliases rendering with other ADT) - rust-lang/rust#140936 (Clarify WTF-8 safety docs) - rust-lang/rust#140952 (Specify that split_ascii_whitespace uses the same definition as is_ascii_whitespace) - rust-lang/rust#141472 (Attempt to improve the `std::fs::create_dir_all` docs related to atomicity) - rust-lang/rust#141502 (ci: move PR job x86_64-gnu-tools to codebuild) - rust-lang/rust#141559 (const-check: stop recommending the use of rustc_allow_const_fn_unstable) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-26Rollup merge of #141559 - RalfJung:less-rustc_allow_const_fn_unstable, ↵Jacob Pratt-7/+1
r=compiler-errors const-check: stop recommending the use of rustc_allow_const_fn_unstable I have seen way too many people see the compiler suggest this attribute and then just apply it without a second thought. This is bad. So let's just stop recommending it; for the rare case where someone needs it, they'll eventually ask us and that way we can be sure that it is truly needed. The dev-guide still also explains `rustc_allow_const_fn_unstable`. Cc ``@rust-lang/wg-const-eval``
2025-05-26Rollup merge of #140539 - nnethercote:simplify-attribute_groups, r=jdonszelmannJacob Pratt-48/+47
Simplify `attribute_groups` It's more complicated than it needs to be. r? ``@jdonszelmann``
2025-05-26Auto merge of #138489 - tmiasko:call-tmps-lifetime, r=workingjubileebors-13/+35
Describe lifetime of call argument temporaries passed indirectly Fixes #132014.
2025-05-26extend allocbytes with associated typeNia Espera-27/+68
2025-05-25const-check: stop recommending the use of rustc_allow_const_fn_unstableRalf Jung-7/+1