about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-02-12Rollup merge of #136900 - workingjubilee:format-externabi-directly, r=oli-obkGuillaume Gomez-34/+27
compiler: replace `ExternAbi::name` calls with formatters Most of these just format the ABI string, so... just format ExternAbi? This makes it more consistent and less jank when we can do it.
2025-02-12Rollup merge of #136875 - BoxyUwU:rdg-push, r=jieyouxuGuillaume Gomez-94/+155
Rustc dev guide subtree update r? ``@ghost``
2025-02-12Rollup merge of #136829 - GuillaumeGomez:move-line-numbers-into-code, ↵Guillaume Gomez-222/+280
r=notriddle [rustdoc] Move line numbers into the `<code>` directly Fixes #84242. This is the first for adding support for https://github.com/rust-lang/rust/issues/127334 and also for another feature I'm working on. A side-effect of this change is that it also fixes source code pages display in lynx since they're not directly in the source code. To allow having code wrapping, the grid approach doesn't work as the line numbers are in their own container, so we need to move them into the code. Now with this, it becomes much simpler to do what we want (with CSS mostly). One downside: the highlighting became more complex and slow as we need to generate some extra HTML tags directly into the highlighting process. However that also allows to not have a huge HTML size increase. You can test the result [here](https://rustdoc.crud.net/imperio/move-line-numbers-into-code/scrape_examples/fn.test_many.html) and [here](https://rustdoc.crud.net/imperio/move-line-numbers-into-code/src/scrape_examples/lib.rs.html#10). The appearance should have close to no changes. r? ``@notriddle``
2025-02-12Rollup merge of #136767 - onur-ozkan:is-host-target, r=albertlarsan68,jieyouxuGuillaume Gomez-13/+35
improve host/cross target checking Using an invalid equality operator on `builder.config.build !=/==` can be hard to detect in reviews (which is quite dangerous). Replaced them with `is_host_target`, which is much clearer as it explicitly states what it does.
2025-02-12Rollup merge of #136698 - jackpot51:i586-redox, r=RalfJungGuillaume Gomez-9/+9
Replace i686-unknown-redox target with i586-unknown-redox This change is related to https://github.com/rust-lang/rust/issues/136495
2025-02-12Rollup merge of #134981 - estebank:issue-93993, r=BoxyUwUGuillaume Gomez-24/+70
Explain that in paths generics can't be set on both the enum and the variant ``` error[E0109]: type arguments are not allowed on tuple variant `TSVariant` --> $DIR/enum-variant-generic-args.rs:54:29 | LL | Enum::<()>::TSVariant::<()>(()); | --------- ^^ type argument not allowed | | | not allowed on tuple variant `TSVariant` | = note: generic arguments are not allowed on both an enum and its variant's path segments simultaneously; they are only valid in one place or the other help: remove the generics arguments from one of the path segments | LL - Enum::<()>::TSVariant::<()>(()); LL + Enum::TSVariant::<()>(()); | LL - Enum::<()>::TSVariant::<()>(()); LL + Enum::<()>::TSVariant(()); | ``` Fix #93993.
2025-02-12Auto merge of #136905 - matthiaskrgr:rollup-8zwcgta, r=matthiaskrgrbors-556/+738
Rollup of 8 pull requests Successful merges: - #135549 (Document some safety constraints and use more safe wrappers) - #135965 (In "specify type" suggestion, skip type params that are already known) - #136193 (Implement pattern type ffi checks) - #136646 (Add a TyPat in the AST to reuse the generic arg lowering logic) - #136874 (Change the issue number for `likely_unlikely` and `cold_path`) - #136884 (Lower fn items as ZST valtrees and delay a bug) - #136885 (i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change) - #136891 (Check sig for errors before checking for unconstrained anonymous lifetime) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-12Rollup merge of #136891 - compiler-errors:unconstrained-anon-lt, r=lqdMatthias Krüger-21/+41
Check sig for errors before checking for unconstrained anonymous lifetime Fixes #136841
2025-02-12Rollup merge of #136885 - RalfJung:linux-android-base-cpu, r=jieyouxuMatthias Krüger-2/+2
i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change As per ``@maurer's`` [comment](https://github.com/rust-lang/rust/issues/136495#issuecomment-2648743078), this shouldn't actually change anything since we anyway add a bunch of extensions that bump things up way beyond Pentium 4. But Pentium 4 is consistent with the other i686 targets and I don't know enough about the exact sequence of CPU generations to be confident with more than this. ;)
2025-02-12Rollup merge of #136884 - compiler-errors:fn-zst, r=BoxyUwUMatthias Krüger-9/+50
Lower fn items as ZST valtrees and delay a bug Lower it as a ZST instead of a const error, which we can handle mostly fine. Delay a bug so we don't accidentally support it tho. r? BoxyUwU Fixes #136855 Fixes #136853 Fixes #136854 Fixes #136337 Only added one test bc that's really the crux of the issue (fn item in array length position).
2025-02-12Rollup merge of #136874 - tgross35:likely-unlikely-tracking, r=jhprattMatthias Krüger-3/+3
Change the issue number for `likely_unlikely` and `cold_path` These currently point to rust-lang/rust#26179, which is nearly a decade old and has a lot of outdated discussion. Move these features to a new tracking issue specifically for the recently added API. New tracking issue: https://github.com/rust-lang/rust/issues/136873
2025-02-12Rollup merge of #136646 - oli-obk:pattern-types-ast, r=BoxyUwUMatthias Krüger-264/+241
Add a TyPat in the AST to reuse the generic arg lowering logic This simplifies ast lowering significantly with little cost to the pattern types parser. Also fixes any problems we've had with generic args (well, pushes any problems onto the `generic_const_exprs` feature gate) follow-up to https://github.com/rust-lang/rust/pull/136284#discussion_r1939292367 r? ``@BoxyUwU``
2025-02-12Rollup merge of #136193 - oli-obk:pattern-type-ffi-checks, r=chenyukangMatthias Krüger-88/+178
Implement pattern type ffi checks Previously we just rejected pattern types outright in FFI, but that was never meant to be a permanent situation. We'll need them supported to use them as the building block for `NonZero` and `NonNull` after all (both of which are FFI safe). best reviewed commit by commit.
2025-02-12Rollup merge of #135965 - estebank:shorten-ty-sugg, r=lcnrMatthias Krüger-22/+113
In "specify type" suggestion, skip type params that are already known When we suggest specifying a type for an expression or pattern, like in a `let` binding, we previously would print the entire type as the type system knew it. We now look at the params that have *no* inference variables, so they are fully known to the type system which means that they don't need to be specified. This helps in suggestions for types that are really long, because we can usually skip most of the type params and make the annotation as short as possible: ``` error[E0282]: type annotations needed for `Result<_, ((..., ..., ..., ...), ..., ..., ...)>` --> $DIR/really-long-type-in-let-binding-without-sufficient-type-info.rs:7:9 | LL | let y = Err(x); | ^ ------ type must be known at this point | help: consider giving `y` an explicit type, where the type for type parameter `T` is specified | LL | let y: Result<T, _> = Err(x); | ++++++++++++++ ``` Fix #135919.
2025-02-12Rollup merge of #135549 - oli-obk:push-tmxtpnrloyqu, r=compiler-errorsMatthias Krüger-147/+110
Document some safety constraints and use more safe wrappers Lots of unsafe codegen_llvm code has safe wrappers already, so I used some of them and added some where applicable. I stopped here because this diff is large enough and should probably be reviewed independently of other changes.
2025-02-12Auto merge of #136074 - compiler-errors:deeply-normalize-next-solver, r=lcnrbors-47/+250
Properly deeply normalize in the next solver Turn deep normalization into a `TypeOp`. In the old solver, just dispatch to the `Normalize` type op, but in the new solver call `deeply_normalize`. I chose to separate it into a different type op b/c some normalization is a no-op in the new solver, so this distinguishes just the normalization we need for correctness. Then use `DeeplyNormalize` in the callsites we used to be using a `CustomTypeOp` (for normalizing known type outlives obligations), and also use it to normalize function args and impl headers in the new solver. Finally, use it to normalize signatures for WF checks in the new solver as well. This addresses https://github.com/rust-lang/trait-system-refactor-initiative/issues/146.
2025-02-11compiler: replace ExternAbi::name calls with formattersJubilee Young-34/+27
Most of these just format the ABI string, so... just format ExternAbi? This makes it more consistent and less jank when we can do it.
2025-02-11Auto merge of #136878 - matthiaskrgr:rollup-opilhjv, r=matthiaskrgrbors-556/+225
Rollup of 8 pull requests Successful merges: - #135285 (it-self → itself, build-system → build system, type-alias → type alias) - #135677 (Small `rustc_resolve` cleanups) - #136239 (show supported register classes in error message) - #136246 (include note on variance and example) - #136354 (Update docs for impl keyword) - #136786 (Remove the deduplicate_blocks pass) - #136833 (compiler: die immediately instead of handling unknown target codegen) - #136847 (Simplify intra-crate qualifiers.) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-11Remove some the spans pointing at the enum in the path and its generic argsEsteban Küber-29/+23
``` error[E0109]: type arguments are not allowed on tuple variant `TSVariant` --> $DIR/enum-variant-generic-args.rs:54:29 | LL | Enum::<()>::TSVariant::<()>(()); | --------- ^^ type argument not allowed | | | not allowed on tuple variant `TSVariant` | = note: generic arguments are not allowed on both an enum and its variant's path segments simultaneously; they are only valid in one place or the other help: remove the generics arguments from one of the path segments | LL - Enum::<()>::TSVariant::<()>(()); LL + Enum::<()>::TSVariant(()); | ```
2025-02-11Explain that in paths generics can't be set on both the enum and the variantEsteban Küber-42/+94
``` error[E0109]: type arguments are not allowed on enum `Enum` and tuple variant `TSVariant` --> $DIR/enum-variant-generic-args.rs:54:12 | LL | Enum::<()>::TSVariant::<()>(()); | ---- ^^ --------- ^^ type argument not allowed | | | | | not allowed on tuple variant `TSVariant` | not allowed on enum `Enum` | = note: generic arguments are not allowed on both an enum and its variant's path segments simultaneously; they are only valid in one place or the other help: remove the generics arguments from one of the path segments | LL - Enum::<()>::TSVariant::<()>(()); LL + Enum::<()>::TSVariant(()); | ``` Fix #93993.
2025-02-11Check sig for errors before checking for unconstrained anonymous lifetimeMichael Goulet-21/+41
2025-02-11Auto merge of #136605 - lsunsi:update-rustc-hash, r=lqdbors-8/+8
chore: update rustc-hash 2.1.0 to 2.1.1 This PR updates the rustc-hash crate to include a palliative fix for #135477. The discussion for this can be found in the issue and on https://github.com/rust-lang/rustc-hash/pull/55. This PR is the output of running `cargo +nightly update rustc-hash@2.1.0`. I ran all tests locally and they all seem to pass, with the exception of `tests/ui/process/nofile-limit.rs` which always fails on my setup. `@steffahn` `@orlp` and `@Noratrieb` all have full context on this, I'm opening the pull request trying to be helpful. I'm not sure if anything else needs to be done, like documentation I'm not aware of or running any special CIs but if I can do anything else please let me know!
2025-02-11i686-linux-android: increase CPU baseline to Pentium 4 (without an actual ↵Ralf Jung-2/+2
change)
2025-02-11Deeply normalize signature in new solverMichael Goulet-9/+129
2025-02-11Deeply normalize in impl headerMichael Goulet-1/+29
2025-02-11Deeply normalize args for implied boundsMichael Goulet-1/+23
2025-02-11Make DeeplyNormalize a real type opMichael Goulet-37/+70
2025-02-11Lower fn items as ZST valtrees and delay a bugMichael Goulet-9/+50
2025-02-11Auto merge of #136586 - Kobzol:lto-rustdoc-fix-stage-1, r=onur-ozkanbors-11/+17
Only apply LTO to rustdoc at stage 2 It doesn't make much sense at stage 1, and it was broken anyway. This was implemented in https://github.com/rust-lang/rust/pull/135832. The issue with LTO and stage 1 rustdoc was reported [here](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/x.20test.20with.20lto.20.3D.20.22thin.22.20fails.20to.20build.20rustdoc.3F). r? `@onur-ozkan`
2025-02-11rename `is_host_target` to `is_builder_target`onur-ozkan-18/+20
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-11Remove quotes around href in code line numbersGuillaume Gomez-1/+1
2025-02-11Rollup merge of #136847 - nnethercote:simplify-intra-crate-quals, r=oli-obkMatthias Krüger-51/+53
Simplify intra-crate qualifiers. The following is a weird pattern for a file within `rustc_middle`: ``` use rustc_middle::aaa; use crate::bbb; ``` More sensible and standard would be this: ``` use crate::{aaa, bbb}; ``` I.e. we generally prefer using `crate::` to using a crate's own name. (Exceptions are things like in macros where `crate::` doesn't work because the macro is used in multiple crates.) This commit fixes a bunch of these weird qualifiers. r? `@jieyouxu`
2025-02-11Rollup merge of #136833 - workingjubilee:let-the-impossible-be-impossible, ↵Matthias Krüger-64/+8
r=compiler-errors compiler: die immediately instead of handling unknown target codegen We cannot produce anything useful if asked to compile unknown targets. We should handle the error immediately at the point of discovery instead of propagating it upward, and preferably in the simplest way: Die. This allows cleaning up our "error-handling" spread across 5 crates.
2025-02-11Rollup merge of #136786 - compiler-errors:de-de-duplicate-blocks, r=oli-obkMatthias Krüger-414/+0
Remove the deduplicate_blocks pass I don't think this pass does anything. It's a lot of complexity for 🤷 amount of benefit. r? oli-obk
2025-02-11Rollup merge of #136354 - hkBst:patch-34, r=ibraheemdevMatthias Krüger-7/+34
Update docs for impl keyword This started as a fix for #79878, but also introduces some structure (headings), and elaborates a tiny bit on impl Trait syntax.
2025-02-11Rollup merge of #136246 - hkBst:patch-29, r=ibraheemdevMatthias Krüger-2/+96
include note on variance and example Fixes #89150
2025-02-11Rollup merge of #136239 - folkertdev:show-supported-register-classes, ↵Matthias Krüger-8/+23
r=SparrowLii,jieyouxu show supported register classes in error message a simple diagnostic change that shows the supported register classes when an invalid one is found. This information can be hard to find (especially for unstable targets), and this message now gives at least something to try or search for. I've followed the pattern for invalid clobber ABIs. `@rustbot` label +A-inline-assembly
2025-02-11Rollup merge of #135677 - yotamofek:resolve-cleanups2, r=compiler-errorsMatthias Krüger-7/+8
Small `rustc_resolve` cleanups 1. Don't open-code `Reverse` 2. Use slice patterns where possible
2025-02-11Rollup merge of #135285 - tbu-:pr_fix_typo4, r=GuillaumeGomezMatthias Krüger-3/+3
it-self → itself, build-system → build system, type-alias → type alias
2025-02-11Change the issue number for `likely_unlikely` and `cold_path`Trevor Gross-3/+3
These currently point to rust-lang/rust#26179, which is nearly a decade old and has a lot of outdated discussion. Move these features to a new tracking issue specifically for the recently added API. New tracking issue: https://github.com/rust-lang/rust/issues/136873
2025-02-11add coverage for `Builder::is_host_target`onur-ozkan-0/+15
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-11add `Builder::is_host_target`onur-ozkan-13/+18
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-11Correctly handle `user-select: none`Guillaume Gomez-0/+5
2025-02-11Add regression test for source line numbersGuillaume Gomez-0/+35
2025-02-11Update rustdoc testsGuillaume Gomez-156/+72
2025-02-11Auto merge of #136571 - marcoieni:ubuntu-24-large-runners, r=Mark-Simulacrumbors-3/+3
ci: use ubuntu 24 for x86 large runners try-job: dist-powerpc64le-linux try-job: x86_64-gnu-debug try-job: dist-arm-linux try-job: x86_64-fuchsia try-job: x86_64-gnu-distcheck try-job: dist-x86_64-linux try-job: dist-x86_64-linux-alt
2025-02-11Auto merge of #136851 - jhpratt:rollup-ftijn95, r=jhprattbors-336/+241
Rollup of 11 pull requests Successful merges: - #136606 (Fix long lines which rustfmt fails to format) - #136663 (Stabilize `NonZero::count_ones`) - #136672 (library: doc: core::alloc::Allocator: trivial typo fix) - #136704 (Improve examples for file locking) - #136721 (cg_llvm: Reduce visibility of some items outside the `llvm` module) - #136813 (rustc_target: Add the fp16 target feature for AArch32) - #136830 (fix i686-unknown-hurd-gnu x87 footnote) - #136832 (Fix platform support table for i686-unknown-uefi) - #136835 (Stop using span hack for contracts feature gating) - #136837 (Overhaul how contracts are lowered on fn-like bodies) - #136839 (fix ensure_monomorphic_enough) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-11Document some safety constraints and use more safe wrappersOli Scherer-59/+50
2025-02-11Add a safe wrapper for `WriteBitcodeToFile`Oli Scherer-8/+10
2025-02-11Remove an unsafe closure invariant by inlining the closure wrapper into the ↵Oli Scherer-80/+50
called function