Commit graph

298901 commits

Author SHA1 Message Date
Deadbeef
62435f922a impl Default for array::IntoIter 2025-05-26 15:21:03 +08: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
yukang
6b5b97a4df Fix incorrect eq_unspanned in TokenStream 2025-05-26 13:47:53 +08: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
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
Jacob Pratt
6341f4ef23
Rollup merge of #134696 - ChrisDenton:normalize-lexically, r=workingjubilee
Implement `normalize_lexically`

Implements #134694

This is, I think, the most straightforward implementation I could do, which will hopefully more easily allow experimentation if we decide to change the design here.
2025-05-26 03:38:15 +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
Nicholas Nethercote
b8ce853914 Refactor the end of generate_item_def_id_path.
To avoids the early return and duplication of `Ok((url_parts, shortty,
fqp))`.
2025-05-26 09:33:40 +10:00
Nicholas Nethercote
fa8e910ed9 Simplify make_href.
Currently it is passed an `fqp` slice which it calls `to_vec` on and
returns. This is a bit odd. It's better to let the call site clone if
necessary. (One call site does, one does not).
2025-05-26 09:10:04 +10:00
Nicholas Nethercote
581fd271f6 Avoid Box in href_relative_parts.
This reverts part of #91948, going back to returning a
`UrlPartsBuilder`. It makes the code simpler, and also avoids some
allocations.
2025-05-26 08:52:05 +10:00
Ada Alakbarova
028e1c28c9
use let-chains 2025-05-26 00:32:45 +02:00
Ada Alakbarova
f04eb5984e
use if-let 2025-05-26 00:25:16 +02:00
Ada Alakbarova
b72cb4847b
use ? 2025-05-26 00:25:16 +02:00
Ada Alakbarova
93a509fca3
exhaustive match instead of returns 2025-05-26 00:25:16 +02:00
Nia Espera
e388a3e405
extend allocbytes with associated type 2025-05-26 00:15:16 +02:00
bors
9f8929fbec Auto merge of #141557 - bjorn3:sync_cg_clif-2025-05-25, r=bjorn3
Subtree sync for rustc_codegen_cranelift

The main highlights this time are a Cranelift update and (thanks for beetrees) f16/f128 support.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2025-05-25 21:06:24 +00: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
4aed799d34 Update tidy exceptions 2025-05-25 18:58:21 +00:00
bjorn3
2357fb6578 Merge branch 'sync_from_rust' 2025-05-25 18:55:47 +00:00
dswij
954034b497
Fix manual_find suggests wrongly when return type needs adjustment (#14892)
Closes rust-lang/rust-clippy#14826

changelog: [`manual_find`] fix wrong suggestions when return type needs
adjustment
2025-05-25 18:55:31 +00:00
bjorn3
4f24d142d9 Merge commit '979dcf8e2f' into sync_cg_clif-2025-05-25 2025-05-25 18:51:16 +00:00
bjorn3
3816385b09 Merge commit '979dcf8e2f' into sync_cg_clif-2025-05-25 2025-05-25 18:51:16 +00:00
bendn
245bf503e2
increase perf of charsearcher for single ascii characters 2025-05-26 01:50:13 +07:00
bjorn3
979dcf8e2f Rustup to rustc 1.89.0-nightly (5e16c6620 2025-05-24) 2025-05-25 18:39:17 +00:00
bjorn3
aa04a27268 Sync from rust 5e16c66206 2025-05-25 18:33:21 +00:00
Chayim Refael Friedman
753c62c889 Properly implement might_be_inside_macro_call() using semantic information instead of syntactical hacks
And rename it to `is_inside_macro_call()` accordingly.
2025-05-25 20:15:58 +03:00
quininer
45ed022d63 Add compiler tests for xray 2025-05-26 00:39:23 +08: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
bors
283db70ace Auto merge of #141545 - GuillaumeGomez:rollup-myrvuqq, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#141413 (Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING)
 - rust-lang/rust#141443 (make teach_help message for cast-before-pass-to-variadic more precise)
 - rust-lang/rust#141508 (bootstrap: clippy: set TESTNAME based on given paths)
 - rust-lang/rust#141512 (Avoid extra path trimming in method not found error)
 - rust-lang/rust#141530 (Added unstable feature doc comments to unstable book)
 - rust-lang/rust#141541 (Random nits)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-25 14:46:28 +00:00
Chayim Refael Friedman
fe1808718c Fix IDE resolution of item macros
It wasn't inside the source, because there was no source map.
2025-05-25 17:20:20 +03:00
Michael Goulet
84a3255cc3 Fast path fold_predicate in old canonicalizer 2025-05-25 14:12:17 +00:00
Guillaume Gomez
ec97b0f0b5 Update to new API 2025-05-25 15:27:32 +02: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