Commit Graph

291081 Commits

Author SHA1 Message Date
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
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
3816385b09 Merge commit '979dcf8e2f213e4f4b645cb62e7fe9f4f2c0c785' 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
Guillaume Gomez
5cc27332b5 Rollup merge of #141530 - ranger-ross:unstable-feature-doc-comments, r=Urgau
Added unstable feature doc comments to unstable book

This PR adds doc comments for unstables features in [compiler/rustc_feature/src/unstable.rs](d3a2440384/compiler/rustc_feature/src/unstable.rs (L190-L191)) to the unstable book feature pages.

Fixes rust-lang/rust#141528

Example features rendered

![image](https://github.com/user-attachments/assets/2b65f534-26f8-441f-ba29-65554c9154b7)

![image](https://github.com/user-attachments/assets/6077491b-ddaf-447e-9519-0bc110c7a893)

r? `@jyn514`
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
c747b7da6c Rollup merge of #141508 - xtexx:gh-104200, r=onur-ozkan
bootstrap: clippy: set TESTNAME based on given paths

This addresses #104200 by setting the TESTNAME environment variable automatically based on the paths from run configs, marking a selected set of UI tests to be run.

Note that this does not filter out other unit tests using #[test].
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
Guillaume Gomez
3646a09811 Improve code 2025-05-25 15:10:50 +02:00
Guillaume Gomez
2b292d1b78 Add regression test for #140739 2025-05-25 15:10:24 +02:00
Guillaume Gomez
4f3dd7b018 Tweak attribute rendering depending on wether or not it is a type alias 2025-05-25 15:10:23 +02:00
Guillaume Gomez
eb9f05481b Rename the document_* argument/field into is_type_alias 2025-05-25 15:09:12 +02:00
Guillaume Gomez
4194745687 Split Item::attributes method into three 2025-05-25 15:08:23 +02:00
Guillaume Gomez
560aec13ba Unify rendering of type aliases without ADT items 2025-05-25 15:05:56 +02:00
Guillaume Gomez
5f857a9871 Rename clean::Enum::variants method into non_stripped_variants 2025-05-25 15:05:56 +02:00
jyn
231e8cb34e add "Compiler environment variables" section to the unstable book 2025-05-25 08:46:58 -04:00
Ada Alakbarova
aa667f4317 use the correct path to the function 2025-05-25 13:39:03 +02:00
bors
88b3b520e8 Auto merge of #141086 - a1phyr:spec_advance_by, r=jhpratt
Implement `advance_by` via `try_fold` for `Sized` iterators

When `try_fold` is overriden, it is usually easier for compilers to optimize.

Example difference: https://iter.godbolt.org/z/z8cEfnKro
2025-05-25 11:34:43 +00:00
Ross Sullivan
3850b1faa2 feat(unstable-book): Added unstable feature doc comments as feature descriptions 2025-05-25 20:00:14 +09: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