Commit Graph

48659 Commits

Author SHA1 Message Date
Nicholas Nethercote
c42d1fc2c6 Remove unused P stuff. 2025-05-27 02:54:52 +10:00
Nicholas Nethercote
68597509aa Remove support for P<[T]>.
It's no longer used.
2025-05-27 02:54:52 +10:00
Nicholas Nethercote
0f285e346f Remove the one use of P<[T]>.
A `Vec` is fine, the additional word (vector vs. boxed slice) doesn't
matter here.
2025-05-27 02:54:18 +10:00
Nicholas Nethercote
6973fa08a3 Remove P::map.
It's barely used, and the places that use it are better if they don't.
2025-05-27 02:07:15 +10:00
Nicholas Nethercote
a35675d38f Remove 'static bounds on P.
These date back to 2014. I don't think they're needed any more.
2025-05-27 02:07:15 +10:00
Nicholas Nethercote
19802e8e9c Remove an unnecessary use of Box::into_inner. 2025-05-27 02:06:40 +10:00
bors
9c0bcb514f Auto merge of #141442 - compiler-errors:fast-path-pred, r=lcnr
Fold predicate fast path in canonicalizer and eager resolver

See individual commits.

r? lcnr
2025-05-26 13:42:30 +00:00
Michael Goulet
5e31cd30aa Support opaque_types_defined_by for SyntheticCoroutineBody 2025-05-26 12:19:34 +00:00
Michael Goulet
a59c86ab44 Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
bors
b5eb9893f4 Auto merge of #141406 - RalfJung:less-force-allocate, r=oli-obk
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-26 10:29:19 +00:00
dianqk
457f8ba447 mir-opt: Do not transform non-int type in match_branches 2025-05-26 18:15:54 +08:00
bjorn3
165fb98849 Reduce indentation in codegen_panic_intrinsic 2025-05-26 10:13:03 +00:00
bjorn3
7122648e34 Don't depend on FnAbi for intrinsics
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-26 10:13:03 +00:00
bjorn3
0a14e1b2e7 Remove usage of FnAbi in codegen_intrinsic_call 2025-05-26 10:13:03 +00:00
bjorn3
6016f84e71 Pass PlaceRef rather than Bx::Value to codegen_intrinsic_call 2025-05-26 10:13:03 +00:00
bjorn3
c83358beb5 Move caller_location handling into codegen_intrinsic_call 2025-05-26 10:13:02 +00:00
bjorn3
e4700e76d8 Always use fn_span in codegen_call_terminator 2025-05-26 10:13:01 +00:00
bjorn3
1e9e17704a Move some code around in codegen_call_terminator 2025-05-26 10:11:23 +00:00
Michael Goulet
e2215a8ad9 Don't rerun goals if none of its vars have changed 2025-05-26 10:10:03 +00:00
yukang
d3347bb32b remove eq_unspanned from TokenStream 2025-05-26 17:02:51 +08:00
Michael Goulet
9d742eea25 Rename 2025-05-26 08:48:19 +00:00
Michael Goulet
4d783c3c19 Don't retry in pred_known_to_hold_modulo_regions in new solver, since new 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-26 08:37:28 +00:00
Michael Goulet
3efd885927 Avoid obligation construction dance with query region constraints 2025-05-26 08:28:45 +00:00
yukang
6b5b97a4df Fix incorrect eq_unspanned in TokenStream 2025-05-26 13:47:53 +08:00
bors
95a2212587 Auto merge of #141567 - jhpratt:rollup-uuhcmci, r=jhpratt
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-26 04:30:06 +00:00
Jacob Pratt
5a8cb6f892 Rollup merge of #141559 - RalfJung:less-rustc_allow_const_fn_unstable, 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-26 03:38:19 +02:00
Jacob Pratt
761e5464dd Rollup merge of #140539 - nnethercote:simplify-attribute_groups, r=jdonszelmann
Simplify `attribute_groups`

It's more complicated than it needs to be.

r? ``@jdonszelmann``
2025-05-26 03:38:16 +02:00
bors
46264e6dfd Auto merge of #138489 - tmiasko:call-tmps-lifetime, r=workingjubilee
Describe lifetime of call argument temporaries passed indirectly

Fixes #132014.
2025-05-26 01:16:52 +00:00
Nia Espera
e388a3e405 extend allocbytes with associated type 2025-05-26 00:15:16 +02:00
Ralf Jung
cf9ac0eec1 const-check: stop recommending the use of rustc_allow_const_fn_unstable 2025-05-25 22:47:21 +02:00
Michael Goulet
ade24354f4 Do not canonicalize in new solver if it has nothing to canonicalize 2025-05-25 20:14:11 +00:00
bjorn3
3816385b09 Merge commit '979dcf8e2f213e4f4b645cb62e7fe9f4f2c0c785' into sync_cg_clif-2025-05-25 2025-05-25 18:51:16 +00:00
Urgau
4765fd6b76 Fix unused_braces lint suggestion when encountering attributes 2025-05-25 18:17:43 +02:00
Michael Goulet
295a8d56f5 Make UNNECESSARY_TRANSMUTES into a HIR lint 2025-05-25 15:57:48 +00:00
Michael Goulet
5370c5753f Make PTR_TO_INTEGER_TRANSMUTE_IN_CONSTS into a HIR lint 2025-05-25 15:57:48 +00:00
Michael Goulet
a8ae2af967 hir_body_const_context should take LocalDefId 2025-05-25 15:57:24 +00:00
Urgau
77e295c39c Improve ambiguous_wide_pointer_comparisons lint compare diagnostics 2025-05-25 17:08:58 +02:00
Michael Goulet
84a3255cc3 Fast path fold_predicate in old canonicalizer 2025-05-25 14:12:17 +00:00
Guillaume Gomez
43cb506383 Rollup merge of #141541 - compiler-errors:nits, r=lcnr
Random nits

Two completely random commits that I didn't know where to integrate into another PR.

* Don't use the full type relation machinery to equate two regions (it's overkill).
* Add a comment that `select_in_new_trait_solver` shouldn't be used directly.

r? lcnr or reassign
2025-05-25 15:11:49 +02:00
Guillaume Gomez
9460f64362 Rollup merge of #141512 - Noratrieb:stop-trimming-this-much, r=compiler-errors
Avoid extra path trimming in method not found error

Method errors have an extra check that force trim paths whenever the normal string is longer than 10 characters, which can be quite unhelpful when multiple items have the same name (for example an `Error`).

A user reported this force trimming as being quite unhelpful when they had a method error where the precise path of the `Error` mattered.

The code uses `tcx.short_string` already to get the normal path, which tries to be clever around trimming paths if necessary, so there is no reason for this extra force trimming.
2025-05-25 15:11:48 +02:00
Guillaume Gomez
d72bc29a33 Rollup merge of #141443 - RalfJung:c-variadic-teach-help, r=workingjubilee
make teach_help message for cast-before-pass-to-variadic more precise

r? `@workingjubilee`
based on your comment [here](https://github.com/rust-lang/rust/issues/44930#issuecomment-2199663198)
2025-05-25 15:11:47 +02:00
Guillaume Gomez
b0ae228007 Rollup merge of #141413 - est31:cfg_version_env_var, r=jieyouxu
Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING

The `#[cfg(version(...))]` feature is currently under-tested. Part of it is the difficulty that it is hard to write a test that never changes, while the version of the Rust compiler indeed *does* change.

PR #81468 added the first and so far only test of `#[cfg(version(...))]`'s functionality (there is one other test for the *syntax*, that also acts as feature gate). But that test uses a proc macro that parses the version: the text of the test doesn't contain the actual `#[cfg(version(...))]`.

This PR makes `#[cfg(version(...))]` respect `RUSTC_OVERRIDE_VERSION_STRING`, added by PR #124339, allowing us to virtually pin the rustc version and write tests from all directions against some specific version.

The PR also adds a functional test of `#[cfg(version(...))]` that leverages `RUSTC_OVERRIDE_VERSION_STRING`.

Pulled out of #141137.

Tracking issue: #64796
2025-05-25 15:11:47 +02:00
Michael Goulet
9a8cf3dd0c Comment for not using select_in_new_trait_solver 2025-05-25 10:37:58 +00:00
Michael Goulet
7820d2caba Don't use relation just to equate regions in response 2025-05-25 10:37:43 +00:00
Ralf Jung
4e8b8dad7f fix help message
Co-authored-by: Jubilee <workingjubilee@gmail.com>
2025-05-25 09:35:36 +02:00
est31
f3245e48f9 Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING 2025-05-24 23:54:17 +02:00
Noratrieb
01503d0c1e Avoid extra path trimming in method not found error
Method errors have an extra check that force trim paths whenever the
normal string is longer than 10 characters, which can be quite unhelpful
when multiple items have the same name (for example an `Error`).

A user reported this force trimming as being quite unhelpful when they
had a method error where the precise path of the `Error` mattered.

The code uses `tcx.short_string` already to get the normal path, which
tries to be clever around trimming paths if necessary, so there is no
reason for this extra force trimming.
2025-05-24 23:31:07 +02:00
bors
3d86494a0d Auto merge of #141518 - GuillaumeGomez:rollup-ivjep2j, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#140066 (Stabilize `<[T; N]>::as_mut_slice` as `const`)
 - rust-lang/rust#141105 (additional edge cases tests for `path.rs` 🧪 )
 - rust-lang/rust#141487 (Update askama to `0.14.0`)
 - rust-lang/rust#141498 (Use C-string literals to reduce boilerplate)
 - rust-lang/rust#141505 (rename internal panicking::try to catch_unwind)
 - rust-lang/rust#141511 (Cleanup CodegenFnAttrFlags)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-24 21:00:10 +00:00
Guillaume Gomez
7cd749deff Rollup merge of #141511 - Noratrieb:codegen-fn-attrs, r=compiler-errors
Cleanup CodegenFnAttrFlags

- Rename `USED` to `USED_COMPILER` to better reflect its behavior.
- Reorder some items to group the used and allocator flags together
- Renumber them without gaps
2025-05-24 21:23:50 +02:00
Noratrieb
fa2bb599bc Cleanup CodegenFnAttrFlags
- Rename `USED` to `USED_COMPILER` to better reflect its behavior.
- Reorder some items to group the used and allocator flags together
- Renumber them without gaps
2025-05-24 20:31:37 +02:00