Commit graph

23743 commits

Author SHA1 Message Date
Jonathan Brouwer
7ea8f5b721
Rollup merge of #152407 - AprilNEA:test/issue-148953-type-const-ctor, r=Kivooeo
Add regression test for type_const with unit struct ctor under mGCA

- Add a regression test for https://github.com/rust-lang/rust/issues/148953

Closes #148953
2026-02-13 13:35:01 +01:00
Jonathan Brouwer
e91d02a8c3
Rollup merge of #152392 - TaKO8Ki:missing-generics-in-traits-used-in-const, r=jieyouxu
Fix ICE in supertrait_vtable_slot when supertrait has missing generics

Fixes rust-lang/rust#151330
2026-02-13 13:35:01 +01:00
Jonathan Brouwer
98e8f99bc0
Rollup merge of #152218 - adwinwhite:fix-mir-borrowck-opaque-handling-keep-all-errors, r=lcnr
Report unconstrained region in hidden types lazily

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/264

I didn't copy the mechanism of HIR typeck as I found that we just need to be lax in the unconstrained region case.
It already ignores non-defining uses and invalid params.

About tests, I'm having trouble coming up with more complex ones. 🙁

This fixes `ukanren` and `codecrafters-redis-rust` but not rust-lang/rust#151322 and rust-lang/rust#151323.
I believe they are a [different problem](https://github.com/rust-lang/rust/issues/151322#issuecomment-3864656974).

r? @lcnr
2026-02-13 13:35:00 +01:00
Jonathan Brouwer
9d662b5815
Rollup merge of #152323 - JohnTitor:issue-135845-2, r=lcnr
Fix ICE in borrowck when recovering `fn_sig` for `-> _`

(Should be) a proper fix for rust-lang/rust#135845, replaces a dummy binder with a concrete one not to ICE, as mentioned in https://github.com/rust-lang/rust/pull/147631#issuecomment-3460724226.
Fixes rust-lang/rust#135845
r? @lcnr @jackh726
2026-02-13 13:34:58 +01:00
Kivooeo
f63007cd3b fix missleading error for tuple ctor 2026-02-13 09:54:04 +00:00
Yuki Okushi
391a395158 Improve diagnostics following reviews 2026-02-13 16:41:47 +09:00
Yuki Okushi
a8d7a47927 improve associated-type suggestions from bounds 2026-02-13 16:41:47 +09:00
xonx
7a7d48ea62 add tests 2026-02-13 05:32:55 +00:00
Stuart Cook
9e0a05b481
Rollup merge of #152550 - Ozzy1423:rustc-attrs, r=JonathanBrouwer
Port #[prelude_import] to the attribute parser

Tracking issue: https://github.com/rust-lang/rust/issues/131229

r? @JonathanBrouwer

Didn't change any use-sites of it in the compiler
2026-02-13 15:19:15 +11:00
Stuart Cook
5266800936
Rollup merge of #152548 - dianne:reject-const-block-pat-pre-expansion, r=fmease
reject inline const patterns pre-expansion

Reverts the parser changes from https://github.com/rust-lang/rust/pull/149667

Fixes https://github.com/rust-lang/rust/issues/152499

Awkwardly, some cases of inline const pats can only be caught pre-expansion and some can only be caught post-expansion. https://github.com/rust-lang/rust/pull/149667 switched from only rejecting the former to only rejecting the latter.
2026-02-13 15:19:14 +11:00
Stuart Cook
3b0a16738a
Rollup merge of #152529 - folkertdev:sparc64-enable-abi-compat-test, r=RalfJung
sparc64: enable abi compatibility test

fixes https://github.com/rust-lang/rust/issues/115336

We can now remove the exceptions for sparc64 from the abi compatibility tests (since https://github.com/rust-lang/rust/pull/142680).

I was also able to remove a cfg for mips64. The remaining (tested) issues seem to be around how `f64` is handled there.

cc @RalfJung
r? tgross35
2026-02-13 15:19:14 +11:00
Stuart Cook
426921007e
Rollup merge of #152519 - scottmcm:fix-152501, r=fmease
Fix feature gating for new `try bikeshed` expressions

r? fmease
Fixes rust-lang/rust#152501
2026-02-13 15:19:13 +11:00
Stuart Cook
8b036c7b72
Rollup merge of #152486 - fneddy:s390x_simplify_backchain, r=dingxiangfei2009
remove redundant backchain attribute in codegen

llvm will look at both
1. the values of `"target-features"` and
2. the function string attributes.

this patch removes the redundant function string attribute because it is not needed at all. rustc sets the `+backchain` attribute through `target_features_attr(...)`
d34f1f9314/compiler/rustc_codegen_llvm/src/attributes.rs (L590)
d34f1f9314/compiler/rustc_codegen_llvm/src/attributes.rs (L326-L337)
2026-02-13 15:19:13 +11:00
Stuart Cook
0c0af5c6a8
Rollup merge of #152444 - ShoyuVanilla:unsized-recursion-limit, r=lcnr
`-Znext-solver` Prevent committing unfulfilled unsized coercion

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/266

r? lcnr
2026-02-13 15:19:12 +11:00
Stuart Cook
492eb8361e
Rollup merge of #152082 - Delta17920:move-tests, r=chenyukang,Kivooeo
Move tests

moved few tests

r? @Kivooeo
2026-02-13 15:19:11 +11:00
Stuart Cook
15e349d084
Rollup merge of #152496 - ZuseZ4:fix-autodiff-dbg-build, r=bjorn3
Fix multi-cgu+debug builds using autodiff by delaying autodiff till lto

fixes: https://github.com/rust-lang/rust/issues/152470

r? @bjorn3
2026-02-13 15:19:09 +11:00
Stuart Cook
6c2700b256
Rollup merge of #150988 - chenyukang:yukang-fix-150899-macro-rules, r=petrochenkov
Improve code suggestion for incorrect macro_rules! usage

Fixes rust-lang/rust#150899
2026-02-13 15:19:08 +11:00
Adwin White
20c46d647f report unconstrained region in hidden types lazily 2026-02-13 11:38:53 +08:00
Yuki Okushi
7d7b381660 Fix ICE in borrowck when recovering fn_sig for -> _ 2026-02-13 12:26:16 +09:00
Jonathan Brouwer
42a3c864d2
Remove deprecated_safe and its corresponding feature gate 2026-02-12 22:16:28 +01:00
Maja Kądziołka
e098327271 Don't ICE on layout error in vtable computation 2026-02-12 22:01:31 +01:00
Scott McMurray
6afebcc4dd Fix feature gating for new try bikeshed expressions 2026-02-12 12:17:49 -08:00
Oscar Bray
dd8a98a9bc Fix pretty print tests with #[prelude_import] 2026-02-12 17:43:58 +00:00
dianne
60f802fe11 reject inline const patterns pre-expansion 2026-02-12 08:26:03 -08:00
Shoyu Vanilla
891acbd787 -Znext-solver Prevent committing unfulfilled unsized coercion 2026-02-13 00:57:01 +09:00
Shoyu Vanilla
f5a8b86695 WF check lifetime bounds for locals with type params 2026-02-13 00:33:47 +09:00
bors
bb8b30a5fc Auto merge of #148537 - oli-obk:push-yxuttqrqqyvu, r=dianqk
Start using pattern types in libcore (NonZero and friends)

part of rust-lang/rust#136006 

This PR only changes the internal representation of `NonZero`, `NonMax`, ... and other integral range types in libcore. This subsequently affects other types made up of it, but nothing really changes except that the field of `NonZero` is now accessible safely in contrast to the `rustc_layout_scalar_range_start` attribute, which has all kinds of obscure rules on how to properly access its field.
2026-02-12 13:23:22 +00:00
Folkert de Vries
d8ed639e30
sparc64: enable abi compatibility test 2026-02-12 12:42:39 +01:00
Eddy (Eduard) Stefes
c6f57becfc remove redundant backchain attribute in codegen
llvm will look at both
1. the values of "target-features" and
2. the function string attributes.

this removes the redundant function string attribute because it is not needed at all.
rustc sets the `+backchain` attribute through `target_features_attr(...)`
2026-02-12 09:58:25 +01:00
Ralf Jung
0cbe1cc992 try to work around rustdoc bug, and other rustdoc adjustments 2026-02-12 09:09:35 +01:00
Ralf Jung
590c1c9966 UnsafePinned: implement opsem effects of UnsafeUnpin 2026-02-12 09:09:35 +01:00
yukang
caf7cdf558 Improve code suggestion for incorrect macro_rules! usage 2026-02-12 15:30:41 +08:00
mu001999
8c77b6c025 Exclude final methods from dyn-compat check and vtable 2026-02-12 15:18:15 +08:00
mu001999
f0a019bf90 Render final associated functions correctly in rustdoc
Co-authored-by: Michael Goulet <michael@errs.io>
2026-02-12 15:18:15 +08:00
mu001999
3572d482a0 Validate no override impl definitions
Co-authored-by: Michael Goulet <michael@errs.io>
2026-02-12 15:18:15 +08:00
mu001999
460cda8c95 Validate final usages in AST
Co-authored-by: Michael Goulet <michael@errs.io>
2026-02-12 15:18:09 +08:00
mu001999
7077797f52 Parse and lower final for methods
Co-authored-by: Michael Goulet <michael@errs.io>
2026-02-12 15:12:29 +08:00
bors
7ad4e69ad5 Auto merge of #152517 - jhpratt:rollup-fGRcId6, r=jhpratt
Rollup of 17 pull requests

Successful merges:

 - rust-lang/rust#142415 (Add note when inherent impl for a alias type defined outside of the crate)
 - rust-lang/rust#142680 (Fix passing/returning structs with the 64-bit SPARC ABI)
 - rust-lang/rust#150768 (Don't compute FnAbi for LLVM intrinsics in backends)
 - rust-lang/rust#151152 (Add FCW for derive helper attributes that will conflict with built-in attributes)
 - rust-lang/rust#151814 (layout: handle rigid aliases without params)
 - rust-lang/rust#151863 (Borrowck: simplify diagnostics for placeholders)
 - rust-lang/rust#152159 (Add note for `?Sized` params in int-ptr casts diag)
 - rust-lang/rust#152434 (Clarify names of `QueryVTable` functions for "executing" a query)
 - rust-lang/rust#152478 (Remove tm_factory field from CodegenContext)
 - rust-lang/rust#152498 (Partially revert "resolve: Update `NameBindingData::vis` in place")
 - rust-lang/rust#152316 (fix: add continue)
 - rust-lang/rust#152394 (Correctly check if a macro call is actually a macro call in rustdoc highlighter)
 - rust-lang/rust#152425 (Port #![test_runner] to the attribute parser)
 - rust-lang/rust#152481 (Use cg_ssa's produce_final_output_artifacts in cg_clif)
 - rust-lang/rust#152485 (fix issue#152482)
 - rust-lang/rust#152495 (Clean up some subdiagnostics)
 - rust-lang/rust#152502 (Implement `BinaryHeap::from_raw_vec`)
2026-02-12 06:57:59 +00:00
Jacob Pratt
4bc90240e1
Rollup merge of #152394 - GuillaumeGomez:macro-call, r=lolbinarycat
Correctly check if a macro call is actually a macro call in rustdoc highlighter

Fixes rust-lang/rust#151904.

Issues was that if there was a `!` following an ident, we would always assume it's a macro call... except it's very lacking. I'm actually surprised it went for so long unnoticed. To fix it, I added a check for the next (non-blank) token after the `!`, if it's a `{` or a `[` or a `(`, then only do we consider it to be a macro call.

r? @lolbinarycat
2026-02-12 00:41:10 -05:00
Jacob Pratt
8193067abd
Rollup merge of #152498 - petrochenkov:revoverglob, r=jieyouxu
Partially revert "resolve: Update `NameBindingData::vis` in place"

Partial revert of 227e7bd48b.
This is a minimal fix for backporting to beta, I'll submit proper fixes later.

Fixes rust-lang/rust#152004
Fixes rust-lang/rust#151124
Fixes rust-lang/rust#152347
2026-02-12 00:41:09 -05:00
Jacob Pratt
3ad8e9ce04
Rollup merge of #152159 - JohnTitor:issue-74756, r=estebank
Add note for `?Sized` params in int-ptr casts diag

Close rust-lang/rust#74756
2026-02-12 00:41:07 -05:00
Jacob Pratt
3db13e22b7
Rollup merge of #151814 - lcnr:silent-layout-error, r=jackh726
layout: handle rigid aliases without params

fixes rust-lang/rust#151791

r? types
2026-02-12 00:41:07 -05:00
Jacob Pratt
2dba56033e
Rollup merge of #151152 - nik-contrib:helper_attr_builtin, r=chenyukang
Add FCW for derive helper attributes that will conflict with built-in attributes

Adds a future-compatibility-warning deny-by-default lint that helps catch invalid derive helper attribute names early.

This issues the lint, saying that `ignore` helper will clash with the built-in `ignore` attribute.

```rust
#![crate_type = "proc-macro"]
#![deny(ambiguous_derive_helpers)]
use proc_macro::TokenStream;

#[proc_macro_derive(Trait, attributes(ignore))]
pub fn example(input: TokenStream) -> TokenStream {
    TokenStream::new()
}
```

If you actually tried to use that `ignore` helper attribute, you won't be able to due to the ambiguity:

```rust
#[derive(Trait)]
struct Foo {
    #[ignore]
    field: (),
}
```

Produces:

```
error[E0659]: `ignore` is ambiguous
 --> src/lib.rs:5:7
  |
5 |     #[ignore]
  |       ^^^^^^ ambiguous name
  |
  = note: ambiguous because of a name conflict with a builtin attribute
  = note: `ignore` could refer to a built-in attribute
note: `ignore` could also refer to the derive helper attribute defined here
 --> src/lib.rs:3:10
  |
3 | #[derive(Trait)]
  |          ^^^^^
```
2026-02-12 00:41:06 -05:00
Jacob Pratt
b1b6533077
Rollup merge of #142680 - beetrees:sparc64-float-struct-abi, r=tgross35
Fix passing/returning structs with the 64-bit SPARC ABI

Fixes the 64-bit SPARC part of rust-lang/rust#115609 by replacing the current implementation with a new implementation modelled on the RISC-V calling convention code ([SPARC ABI reference](https://sparc.org/wp-content/uploads/2014/01/SCD.2.4.1.pdf.gz)).

Pinging `sparcv9-sun-solaris` target maintainers: @psumbera @kulikjak
Fixes rust-lang/rust#115336
Fixes rust-lang/rust#115399
Fixes rust-lang/rust#122620
Fixes https://github.com/rust-lang/rust/issues/147883
r? @workingjubilee
2026-02-12 00:41:05 -05:00
Jacob Pratt
c509454f89
Rollup merge of #142415 - xizheyin:141679, r=estebank
Add note when inherent impl for a alias type defined outside of the crate

Fixes rust-lang/rust#141679

r? compiler
2026-02-12 00:41:05 -05:00
bors
605f49b274 Auto merge of #152506 - Urgau:rollup-MlGAszj, r=Urgau
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#152505 (Sync relnotes for stable 1.93.1)
 - rust-lang/rust#137487 (Stabilize `assert_matches`)
 - rust-lang/rust#152281 (borrowck: suggest `&mut *x` for pattern reborrows)
 - rust-lang/rust#151142 (Support ADT types in type info reflection)
 - rust-lang/rust#152477 (rustc-dev-guide subtree update)
 - rust-lang/rust#152488 (allow `deprecated(since = "CURRENT_RUSTC_VERSION")`)
 - rust-lang/rust#152491 (Remove unused `fluent-syntax` dependency from tidy)
2026-02-12 03:44:50 +00:00
arferreira
0bcec37604 Improve write! and writeln! error when called without destination 2026-02-11 20:37:45 -05:00
Urgau
c87a89ed14
Rollup merge of #151142 - SpriteOvO:type-info-adt, r=oli-obk
Support ADT types in type info reflection

Tracking issue: rust-lang/rust#146922 `#![feature(type_info)]`

This PR supports ADT types for feature `type_info` reflection.
(It's still a draft PR, with implementation in progress)

Note that this PR does not take SemVer into consideration (I left a FIXME comment). As discussed earlier ([comment](https://github.com/rust-lang/rust/pull/146923#discussion_r2372249477)), this requires further discussion. However, I hope we could get an initial implementation to land first, so we can start playing with it.

### Progress / Checklist

- [x] Struct support.
- [x] Enum
- [x] Union
- [x] Generics
- [ ] ~Methods~ Implemented and to be implemented in other PRs
- [ ] ~Traits~ Implemented and to be implemented in other PRs
- [x] Rebasing PR to `main` branch
  ~~(It's currently based on PR rust-lang/rust#151123, so here's an extra commit)~~
- [x] Cleanup and Rebase.
- [x] Fix field info for references. (see [comment](https://github.com/rust-lang/rust/pull/151142#discussion_r2777920512))

r? @oli-obk
2026-02-12 00:04:15 +01:00
Urgau
050b48a693
Rollup merge of #152281 - JohnTitor:sugg-mut-deref-borrows, r=estebank
borrowck: suggest `&mut *x` for pattern reborrows

Fixes rust-lang/rust#81059
r? @estebank as you should have some context here, but feel free to re-assign if you don't have time to review right now.
2026-02-12 00:04:14 +01:00
Vadim Petrochenkov
324267ccaa Partially revert "resolve: Update NameBindingData::vis in place" 2026-02-11 22:27:56 +03:00