Commit Graph

291081 Commits

Author SHA1 Message Date
Tshepang Mbambo
0497f31122 rustc book: fix erratic sentence by making it more simple 2025-05-26 17:55:03 +02:00
Boxy
c27aff35ca Add test 2025-05-26 16:35:36 +01:00
MarcoIeni
6ec41a7950 ci: fix llvm test coverage 2025-05-26 16:52:24 +02: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
MarcoIeni
1e7c4377de ci: move dist-x86_64-linux job to codebuild 2025-05-26 15:37:45 +02:00
Lukas Wirth
1d35ac9ce0 Add missing edition directives for async-await tests 2025-05-26 14:59:48 +02:00
Boxy
8b4f9b6ebe Merge pull request #2414 from smanilov/patch-15
Link normalization chapter
2025-05-26 13:44:34 +01:00
Stan Manilov
740aaf7ed9 Add time reference and tracking info for trait system refactor 2025-05-26 15:43:07 +03:00
Stan Manilov
b73dfdfbd3 Link normalization chapter 2025-05-26 15:39:25 +03:00
Michael Goulet
5e31cd30aa Support opaque_types_defined_by for SyntheticCoroutineBody 2025-05-26 12:19:34 +00:00
Jieyou Xu
0ea12c3c5f cfg_version: pull out dedicated syntax test from feature gate test
The feature gate test was dual-purposing causing feature gate errors to
distract from syntax exercises.
2025-05-26 19:58:33 +08:00
León Orell Valerian Liehr
d5b3f8dba3 Merge pull request #2413 from fmease/glacier-no-crashes-tests-yes
Flesh out sections about crashes tests and update mentions of glacier
2025-05-26 13:55:14 +02:00
León Orell Valerian Liehr
8d1337bf6a Flesh out sections about crashes tests and update mentions of glacier 2025-05-26 13:54:49 +02: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
Timo
32a3744efc refactor(mut_reference): replace match with if-let to reduce nesting (#14890)
One downside to this is that, since the patterns matched against (on the
left) are quite long, it's a bit difficult to see what's even getting
matched. Using `matches!()` could help with that

changelog: none
2025-05-26 10:13:33 +00: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
Ada Alakbarova
c256bcc057 refactor(mut_reference): replace match with if-let to reduce nesting 2025-05-26 11:54:09 +02:00
vremyavnikuda
57707c2287 fix: formated to clippy 2025-05-26 16:41:49 +07:00
vremyavnikuda
693ff34702 fix: the lines are formatted according to clippy 2025-05-26 16:00:45 +07:00
vremyavnikuda
1e8eacd192 fix: the lines are formatted according to clippy 2025-05-26 15:51:50 +07:00
vremyavnikuda
44612c5f9c docs: add documentation for find_all_refs constructor search (#10725) 2025-05-26 15:51:50 +07: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
Lukas Wirth
94c624e7f5 Merge pull request #19792 from A4-Tacks/fix-generate-mut-trait-impl-indent
fix: ide-assists, generate mut trait impl indent
2025-05-26 08:29:22 +00:00
Michael Goulet
3efd885927 Avoid obligation construction dance with query region constraints 2025-05-26 08:28:45 +00:00
Lukas Wirth
376edac94f Merge pull request #19819 from Veykril/push-utvzwvwuuvlm
Change import prefix default to be by crate
2025-05-26 08:28:16 +00:00
Lukas Wirth
3d67336f65 Merge pull request #19785 from A4-Tacks/fix-generate-new-indent
fixes: ide-assists, generate_new indent loses
2025-05-26 07:24:41 +00:00
Lukas Wirth
6b49172242 Merge pull request #19851 from ChayimFriedman2/normalize-exhaustiveness
fix: Normalize when checking for uninhabited types for pattern exhaustiveness checking
2025-05-26 07:19:12 +00:00
Nicholas Nethercote
4f1f1a2b57 Avoid some unnecessary cloning. 2025-05-26 16:47:44 +10:00
Lukas Wirth
a493526c92 Merge pull request #19864 from ChayimFriedman2/is-in-macro
fix: Properly implement `might_be_inside_macro_call()` using semantic information instead of syntactical hacks
2025-05-26 05:21:01 +00:00
Nicholas Nethercote
750f57fafe Make {Type,Path}::generics return iterators.
Instead of a `Vec`, to avoid some allocations.
2025-05-26 15:09:40 +10:00
Nicholas Nethercote
b9b482e9d9 Simplify make_href.
It never fails, so it doesn't need to return `Result`. And the
`ItemType` in the result is just a copy of the one passed in via the
`shortty` arg, so it can also be removed.
2025-05-26 15:09:38 +10:00
onur-ozkan
b71a1279a1 dist: make sure llvm-project submodule is present
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-26 08:08:50 +03:00
Nicholas Nethercote
f19d40a3d6 Rename some methods.
Most of the methods returning `impl Display` have `print` in their name.
This commit renames a few that didn't follow that convention.
2025-05-26 15:07:47 +10: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
905b46a6d4 Rollup merge of #141502 - marcoieni:x86_64-gnu-tools-codebuild, r=Kobzol
ci: move PR job x86_64-gnu-tools to codebuild
2025-05-26 03:38:18 +02:00
Jacob Pratt
a49ae1c40f Rollup merge of #141472 - fluiderson:dev, r=workingjubilee
Attempt to improve the `std::fs::create_dir_all` docs related to atomicity

The original paragraph was added in rust-lang/rust#124520. It doesn't match the actual code logic. It says "function returns an error" if "the parent components" _(which also implies directories)_ "have been created already". The code is as follows:

e88e854634/library/std/src/fs.rs (L3146)
e88e854634/library/std/src/fs.rs (L3160)

These lines suppress all errors if any path component is a directory. I've updated the paragraph to mirror this.
2025-05-26 03:38:18 +02:00
Jacob Pratt
8624f9c62f Rollup merge of #140952 - SimonSapin:ascii_whitespace_definition, r=dtolnay
Specify that split_ascii_whitespace uses the same definition as is_ascii_whitespace
2025-05-26 03:38:17 +02:00
Jacob Pratt
9aae60befc Rollup merge of #140936 - teor2345:wtf-surrogate-docs, r=workingjubilee
Clarify WTF-8 safety docs

This PR is a follow-up to PR #140159, which clarifies ~~two things~~:
- the WTF-8 safety comment [was confusing](https://github.com/rust-lang/rust/pull/140159#discussion_r2082766965), either surrogate condition is actually sufficient for safety, both are not required
- ~~the private `os_str::Slice` type name is easily confused with `std::slice`~~

~~Happy to bikeshed the `OsSlice` name, other alternatives are `OsStrSlice` and `StrSlice`. Now it's got a distinct name from `std::slice`, it's easy to search and replace.~~

cc ``@thaliaarchi`` ``@workingjubilee``
2025-05-26 03:38:17 +02:00
Jacob Pratt
6257d2fb1c Rollup merge of #140863 - GuillaumeGomez:cleanup-tyalias-render, r=lolbinarycat
[rustdoc] Unify type aliases rendering with other ADT

Fixes #140739.

Better reviewed one commit at a time.

Just one thing I'm wondering: should we also render non-`repr` attributes? If so, I wonder if we shouldn't simply change `clean::TypeAlias` to contain the other ADT directly (`Struct`, `Enum` and `Union`) and remove the `TypeAlias::generics` field.

Can be done in a follow-up too.

cc ``@camelid``
r? ``@notriddle``
2025-05-26 03:38:16 +02:00