Commit graph

23562 commits

Author SHA1 Message Date
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
Matthias Krüger
9a4ce0b5f7
Rollup merge of #152146 - zedddie:mgca-improve-const-bindings-wfck, r=BoxyUwU
mGCA: Add associated const type check

rust-lang/rust#151642

r? BoxyUwU

I didn't bless tests just yet as it only fixes the dyn arm
2026-02-11 13:48:49 +01:00
Matthias Krüger
6c8bbfed38
Rollup merge of #152436 - fmease:reenable-gci-test-case, r=mati865
Reenable a GCI+mGCA+GCPT test case

The GCI+mGCA+GCPT test case can now be made to work with the necessary features and tweaks.
2026-02-11 13:48:48 +01:00
Matthias Krüger
88eda646f2
Rollup merge of #152431 - oli-obk:limited_stability_attr, r=jdonszelmann
Restrict the set of things that const stability can be applied to

r? @jdonszelmann
2026-02-11 13:48:47 +01:00
Nik Revenco
846e4ee5dc Add FCW for derive helper attributes that will conflict with built-in attributes 2026-02-10 19:39:19 +00:00
Jonathan Brouwer
70ef5048d4
Rollup merge of #152351 - JonathanBrouwer:remove_subdiag, r=nnethercote
Remove `SubdiagMessage` in favour of the identical `DiagMessage`

For https://github.com/rust-lang/rust/issues/151366
Just some more cleanup :)
SubdiagMessage is now identical to DiagMessage, so there's no point in having both of them
2026-02-10 13:00:47 +01:00
Jonathan Brouwer
2af7bc0e17
Rollup merge of #152226 - fmease:modernize-indeterminate-object-lifetime-diag, r=chenyukang
Modernize diagnostic for indeterminate trait object lifetime bounds

* remove suggestion from the diagnostic message (bad style, too long) and turn it into a structured suggestion
* replace *object type* with *trait object type* since the former is an outdated term
2026-02-10 13:00:46 +01:00
Jonathan Brouwer
39bb68119d
Rollup merge of #151954 - Muhtasim-Rasheed:issue-109829-help-message, r=eholk
Add help message suggesting explicit reference cast for From/TryFrom

Closes rust-lang/rust#109829

Improves E0277 diagnostics when a `From` or `TryFrom` implementation is expected, but the provided type is a reference that can be explicitly cast to a type the trait can convert from.
2026-02-10 13:00:45 +01:00
Folkert de Vries
c9b5c934ca
Fix passing/returning structs with the 64-bit SPARC ABI
Co-authored-by: beetrees <b@beetr.ee>
2026-02-10 12:39:45 +01:00
León Orell Valerian Liehr
32e49a8b40
Reenable a GCI+mGCA+GCPT test case 2026-02-10 12:04:09 +01:00
Oli Scherer
475b9d9819 Prevent const stability attrs from being applied to macros via the normal attribute logic instead of special cased checks 2026-02-10 09:48:03 +00:00
Jana Dönszelmann
954f483557
Port rustc_never_type_options to the new attribute parser 2026-02-10 10:17:24 +01:00
Jonathan Brouwer
ea361287be Remove SubdiagMessage in favour of the identical DiagMessage 2026-02-10 09:13:45 +00:00
zedddie
ec03e39afd
bless tests 2026-02-10 06:28:03 +01:00
zedddie
b6b6dc0b82
mGCA: add associated const type check in dyn arm 2026-02-10 03:49:14 +01:00
bors
f21b4c0888 Auto merge of #152412 - JonathanBrouwer:rollup-hShycIY, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#151960 (rustc_parse: improve the error diagnostic for "missing let")
 - rust-lang/rust#152157 (Fix error spans for `asm!()` args that are macros)
 - rust-lang/rust#152317 (fix: sup_trace to sub_trace)
 - rust-lang/rust#150897 (rustc_parse_format: improve diagnostics for unsupported debug = syntax)
 - rust-lang/rust#151154 (Add `s390x-unknown-none-softfloat` with `RustcAbi::Softfloat`)
 - rust-lang/rust#152013 (Update to Xcode 26.2)
 - rust-lang/rust#152326 (Remove the compiler adhoc group)
2026-02-10 02:25:24 +00:00
Jonathan Brouwer
1f59a4a86b
Rollup merge of #151154 - fneddy:s390x_softfloat_abi, r=workingjubilee
Add `s390x-unknown-none-softfloat` with `RustcAbi::Softfloat`

followup on rust-lang/rust#150766

add an `s390x-unknown-none-softfloat` target to use for kernel compilation, as the Linux kernel does not wish to pay the overhead of saving float registers by default on kernel switch. this target's `extern "C"` ABI is unspecified, so it is unstable and subject to change between versions, just like the Linux intrakernel ABI and `extern "Rust"` ABIs are unstable.

enforce target feature incompatibility by adding `RustcAbi::Softfloat`. this is itself just a rename of `RustcAbi::X86Softfloat`, accepting both "x86-softfloat" and "softfloat" as valid strings in the target.json format. the target-features of `"soft-float"` and `"vector"` are incompatible for s390x, so issue a compatibility warning if they are combined.
2026-02-09 23:37:48 +01:00
Jonathan Brouwer
af70d82355
Rollup merge of #150897 - Unique-Usman:ua/debug, r=estebank
rustc_parse_format: improve diagnostics for unsupported debug = syntax

Detect Python-style f-string debug syntax in format strings and emit a
clear diagnostic explaining that it is not supported in Rust. When the
intended operation can be inferred, suggest the corresponding Rust
alternative (e.g. `dbg!` for `{x=}`).
2026-02-09 23:37:47 +01:00
Jonathan Brouwer
e0c8737f8a
Rollup merge of #152157 - gurry:131292-asm-concat-unicode, r=petrochenkov
Fix error spans for `asm!()` args that are macros

Fixes rust-lang/rust#131292 which is exactly the same issue as rust-lang/rust#129503 but for [`err.secondary_label`](9f4b56a5ae/compiler/rustc_builtin_macros/src/asm.rs (L399-L401)) instead of [`err.span`](9f4b56a5ae/compiler/rustc_builtin_macros/src/asm.rs (L385-L391)). The latter issue was fixed in https://github.com/rust-lang/rust/pull/130917 so see that PR for context.

In addition to the above, the current PR also proactively fixes potential future issues of the same kind which would have occurred over [here ](9f4b56a5ae/compiler/rustc_builtin_macros/src/asm.rs (L478-L482))and [here](9f4b56a5ae/compiler/rustc_builtin_macros/src/asm.rs (L493-L497)).
2026-02-09 23:37:45 +01:00
Jonathan Brouwer
9709215995
Rollup merge of #151960 - Unique-Usman:ua/missingletleft, r=estebank
rustc_parse: improve the error diagnostic for "missing let"
2026-02-09 23:37:45 +01:00
bors
381e9ef09e Auto merge of #152324 - Keith-Cancel:mgca4, r=BoxyUwU
Update mgca to use `type const` syntax instead of the `#[type_const]` attribute. 

This PR changes the `#[type_const]` attribute to the `type const` syntax for  https://github.com/rust-lang/rust/issues/132980.

This will fixes https://github.com/rust-lang/rust/issues/151273 and similar issues, since we need to check `type const` of items before expansion. The move to add a syntax was mentioned here: https://github.com/rust-lang/rust/pull/151289#issuecomment-3765241397

The first part of this PR adds support by allowing `type const <IDENT>: <TYPE> { = <EXPR> };` syntax in `rustc_parse/src/parser/item.rs`.

The next part since the AST item does not contain enough information to determine if we have a `type const` was rework `ConstItemRhs` into `ConstItemRhsKind` to store the information since we no longer have the attribute acting as a source of extra data/metadata. 

The hir node `ConstItemRhsKind` current shape mostly works, except in the case of `TraitItemKind` where it is an option. I initially went about giving `hir::ConstItemRhsKind` a similar form the AST, but it touches a lot more lines of code and files so because of that, the less invasive option was to add a simple boolean flag to `TraitItemKind`. 

The forth part of this PR includes adding a query I called `is_rhs_type_const` so that we can handle both local and foreign def_ids. 

The fifth aspect of the PR is adding a `mgca_type_const_syntax` feature gate that is checked before expansion. The standard mgca feature gate is ran after expansion. This feature gate allows for conditional compilation (e.g #[cfg(..)]) of the `type const` syntax  in nightly without `min_generic_const_args` being enabled. 

The last bit is updating all the the tests that used the `#[type_const]` attribute to use the new syntax that failed because of the changes. This is the bulk of touched/edited files in the PR. 

r? @BoxyUwU 
@rustbot label +F-associated_const_equality +F-min_generic_const_args
2026-02-09 22:37:29 +00:00
Matthias Krüger
1f0e21584e
Rollup merge of #152327 - adwinwhite:fix-non-defining-use-ices-ready, r=lcnr
Check stalled coroutine obligations eagerly

Fixes rust-lang/rust#151322
Fixes rust-lang/rust#151323
Fixes rust-lang/rust#137916
Fixes rust-lang/rust#138274

The problem is that stalled coroutine obligations can't be satisifed so that they cause normalization to fail in `mir_borrowck`.
Thus, we failed to register any opaque to storage in the next solver.
I fix it by checking these obligations earlier in `mir_borrowck`.

r? @lcnr
2026-02-09 18:39:43 +01:00
Matthias Krüger
2ce5f487e0
Rollup merge of #145504 - Jules-Bertholet:more_conversion_trait_impls, r=tgross35
Add some conversion trait impls

- `impl<T, const N: usize> From<[MaybeUninit<T>; N]> for MaybeUninit<[T; N]>` (cc https://github.com/rust-lang/rust/issues/96097)
- `impl<T, const N: usize> AsRef<[MaybeUninit<T>; N]> for MaybeUninit<[T; N]>` (cc https://github.com/rust-lang/rust/issues/96097)
- `impl<T, const N: usize> AsRef<[MaybeUninit<T>]> for MaybeUninit<[T; N]>` (cc https://github.com/rust-lang/rust/issues/96097)
- `impl<T, const N: usize> AsMut<[MaybeUninit<T>; N]> for MaybeUninit<[T; N]>` (cc https://github.com/rust-lang/rust/issues/96097)
- `impl<T, const N: usize> AsMut<[MaybeUninit<T>]> for MaybeUninit<[T; N]>` (cc https://github.com/rust-lang/rust/issues/96097)
- `impl<T, const N: usize> From<MaybeUninit<[T; N]>> for [MaybeUninit<T>; N]` (cc https://github.com/rust-lang/rust/issues/96097)
- `impl<T, const N: usize> AsRef<[Cell<T>; N]> for Cell<[T; N]>` (equivalent of `as_array_of_cells`, cc https://github.com/rust-lang/rust/issues/88248)
- `impl<T, const N: usize> AsRef<[Cell<T>]> for Cell<[T; N]>`
- `impl<T> AsRef<[Cell<T>]> for Cell<[T]>` (equivalent of `as_slice_of_cells`)

@rustbot label T-libs-api needs-fcp -T-libs

I’ve tried to only add impls that are unlikely to cause single-applicable-impl inference breakage.
2026-02-09 18:39:42 +01:00
Matthias Krüger
8afd63610b
Rollup merge of #152287 - jakubadamw:issue-137190, r=petrochenkov
Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented

compiler/rustc_trait_selection/src/traits/vtable.rs@`vtable_entries`:

The impossible predicates check in `vtable_entries` used `instantiate_own` which only includes the method's own `where` clauses, without the parent trait's bounds. Replace it with `instantiate_and_check_impossible_predicates` which also checks the trait ref itself, so unsatisfied supertrait bounds are caught and the method is marked `Vacant` instead of ICEing.

Closes rust-lang/rust#137190.
Closes rust-lang/rust#135470.
2026-02-09 18:39:41 +01:00
Matthias Krüger
5fa914c13a
Rollup merge of #152134 - hoodmane:emscripten-crt-static-allow-dylibs, r=petrochenkov
Set crt_static_allow_dylibs to true for Emscripten target

And add a test. This is followup work to rust-lang/rust#151704. It introduced a regression where cargo is now unwilling to build cdylibs for Emscripten because `crt_static_default` is `true` but `crt_static_allows_dylibs` is `false`. Unfortunately the added test does not fail without the change because the validation logic is in Cargo, not in rustc. But it's good to have some coverage of this anyways.
2026-02-09 18:39:39 +01:00
Keith-Cancel
73a991fb9d Allow provisional mgca syntax of type const <IDENT> = <EXPR> to be reconized.
Revert, but without type const.

Update symbol for feature err, then update suggestion output, and lastly update tests that change because of those.

Update these new tests with the correct syntax, and few existing tests with the new outputs the merge with main added.

Fix for tidyfmt and some errors when manually resolving a merge conflicts.

Update these tests to use update error messages and type const syntax.

Update comments and error message to use new syntax instead of old type_const attribute.

Remove the type_const attribute

update some more tests to use the new syntax.

Update these test cases.

update feature gate test

Change gate logic for `mgca_type_const_syntax` to work also if `min_generic_const_args` is enabled.

Create a new feature gate that checks for the feature before expansion.

Make rustfmt handle the `type const` syntax correctly.

Add a convience method to check if a RhsKind is type const.

Rename `Const` discriminant to `Body` for `ConstItemRhsKind`

Give the `TraitItemKind` flag an enum instead of a simple bool to better describe what the flag is for.

Update formatting for these match statements.

Update clippy test to use type const syntax.

Update test to use type const syntax.

update rustfmt to match ast items.

Update clippy to match ast and hir items.

Few more test cases that used old attribute, instead of 'type const'

Update to match the output from the feature gate checks.

tidyfmt adjustments.

Update the is_type_const, so I can constrain record!(..) in encoder.rs

Update conditional compilation test.

Move the feature gate to after expansion to allow for cfg(...) to work.

Update some more tests to use the new syntax.

Update type const tests in associated-const-bindings to use new syntax.

Don't check based off the attribute, but the item here.

Update some tests outside of the const_generics folder that were using #[type_const]

update the tests in associated consts that use #[type_const] to use type const

Update these mgca tests with the type const syntax.

Add a flag to TraitItemKind for detecting type const for now. Maybe later change ItemConstRhs to have optional consts but that touches a lot more lines of code.

Don't need into for these now that it's a query.

Add is_type_const query to handle foreign def ids.

update this test to use type const syntax.

Fix logic here, we only want to lower if there is expression in this case.

Update built-in macros to use ConstItemRhsKind

Update more instance of the old ConstItemRhs.

Rename ConstItemKind to ConstItemRhsKind, I noticed there is a typed called ConstantItemKind, so add the Rhs to the name to avoid confusion.

Update lower to use ConstItemKind

Add an other helper method to check if the rhs kinda has an expr.

Update item parse to use ConstItemKind enum.

Felt the field name could a be little clear when editing a few other things.

Change the ConstItem struct see know if we have a type const or regular const.

Make sure this syntax is properly feature gated.
2026-02-09 07:59:24 -08:00
Eddy (Eduard) Stefes
51affa0394 add tests for s390x-unknown-none-softfloat
tests will check:
- correct emit of assembly for softfloat target
- incompatible set features will emit warnings/errors
- incompatible target tripples in crates will not link
2026-02-09 09:29:16 +01:00
Eddy (Eduard) Stefes
2b1dc3144b add a new s390x-unknown-none-softfloat target
This target is intended to be used for kernel development. Becasue on s390x
float and vector registers overlap we have to disable the vector extension.

The default s390x-unknown-gnu-linux target will not allow use of
softfloat.

Co-authored-by: Jubilee <workingjubilee@gmail.com>
2026-02-09 09:28:54 +01:00
xizheyin
ed90b35669 Add note when inherent impl for a alias type defined outside of the crate 2026-02-09 15:10:01 +08:00
Adwin White
f248395394 bless tests 2026-02-09 15:09:43 +08:00
xizheyin
3b705eae4f Add ui test insufficient-suggestion-issue-141679.rs 2026-02-09 14:24:59 +08:00
Stuart Cook
7ae47be6aa
Rollup merge of #150823 - camelid:ogca, r=BoxyUwU
Implement MVP for opaque generic const arguments

This is meant to be the interim successor to generic const expressions.
Essentially, const item RHS's will be allowed to do arbitrary const
operations using generics. The limitation is that these const items will
be treated opaquely, like ADTs in nominal typing, such that uses of them
will only be equal if the same const item is referenced. In other words,
two const items with the exact same RHS will not be considered equal.

I also added some logic to check feature gates that depend on others
being enabled (like oGCA depending on mGCA).

### Coherence

During coherence, OGCA consts should be normalized ambiguously because
they are opaque but eventually resolved to a real value. We don't want
two OGCAs that have the same value to be treated as distinct for
coherence purposes. (Just like opaque types.)

This actually doesn't work yet because there are pre-existing
fundamental issues with equate relations involving consts that need to
be normalized. The problem is that we normalize only one layer of the
const item and don't actually process the resulting anon const. Normally
the created inference variable should be handled, which in this case
would cause us to hit the anon const, but that's not happening.
Specifically, `visit_const` on `Generalizer` should be updated to be
similar to `visit_ty`.

r? @BoxyUwU
2026-02-09 14:31:59 +11:00
bors
1c316d3461 Auto merge of #152361 - JonathanBrouwer:rollup-Qkwz1vN, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151869 (add test for codegen of SIMD vector from array repeat)
 - rust-lang/rust#152077 (bootstrap: always propagate `CARGO_TARGET_{host}_LINKER`)
 - rust-lang/rust#126100 (Reword the caveats on `array::map`)
 - rust-lang/rust#152275 (Stop having two different alignment constants)
 - rust-lang/rust#152325 (Remove more adhoc groups that correspond to teams)
2026-02-08 21:42:19 +00:00
Jonathan Brouwer
9f778b4341
Rollup merge of #152275 - scottmcm:range-range-inclusive, r=Mark-Simulacrum
Stop having two different alignment constants

Now that there's a `<T as SizedTypeProperties>::ALIGNMENT` constant, `Alignment::of` can use that instead of an inline constant, like how `Layout::new` uses the constant from `SizedTypeProperties`.
2026-02-08 21:06:30 +01:00
Jonathan Brouwer
b566ac2c47
Rollup merge of #151869 - folkertdev:simd-array-repeat, r=Mark-Simulacrum
add test for codegen of SIMD vector from array repeat

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

It appears that this issue was fixed silently in LLVM 19. The original codegen was terrible, but starting at LLVM 19 `opt` is able to generate good code.

https://llvm.godbolt.org/z/5vq8scP6q

cc @programmerjake
2026-02-08 21:06:28 +01:00
Mark Rousskov
4a979d546b Stop having two different alignment constants
* Stop having two different alignment constants
* Update library/core/src/alloc/global.rs
2026-02-08 19:54:03 +00:00
Jonathan Brouwer
78bd6abbe6
Rollup merge of #152341 - folkertdev:cfg-select-optional-comma, r=JonathanBrouwer
`cfg_select!`: allow optional comma after `{ /* ... */ }`
2026-02-08 19:15:28 +01:00
Jonathan Brouwer
e01abd7409
Rollup merge of #152339 - JonatanLindh:fix-issue-152331, r=Urgau
diagnostics: fix ICE in closure signature mismatch

Fixes rust-lang/rust#152331

Fixes an ICE where `AdjustSignatureBorrow` caused a panic because it attempted to set the `len` argument which was already defined by the parent diagnostic.

Both variants used `len` as  argument name, but can both be present in a diagnostic. They now use different names for the argument.
2026-02-08 19:15:27 +01:00
Jonathan Brouwer
6521fcf018
Rollup merge of #152309 - rynewang:fix/ice-152158-rtn-trait-alias, r=fmease
Fix bound var resolution for trait aliases

Fixes rust-lang/rust#152158
Fixes rust-lang/rust#152244
2026-02-08 19:15:27 +01:00
Jonathan Brouwer
16c7ee5c05
Rollup merge of #151640 - ZuseZ4:cleanup-datatransfer, r=nnethercote
Cleanup offload datatransfer

There are 3 steps to run code on a GPU: Copy data from the host to the device, launch the kernel, and move it back.
At the moment, we have a single variable describing the memory handling to do in each step, but that makes it hard for LLVM's opt pass to understand what's going on. We therefore split it into three variables, each only including the bits relevant for the corresponding stage.

cc @jdoerfert @kevinsala

r? compiler
2026-02-08 19:15:26 +01:00
Jonathan Brouwer
0d9b0ab620
Rollup merge of #152328 - JonathanBrouwer:fix_diags, r=JonathanBrouwer
Fix a few diagnostics

When working on the inline diagnostics conversion (https://github.com/rust-lang/rust/issues/151366), I noticed that my script sometimes took the wrong message.
Because it didn't happen very often, I just fixed it manually when a uitest fails.

However I got paranoid that the script changed messages that were not covered by uitests, so I checked for all messages in the previous `messages.ftl` files, whether they occured at least once in the codebase. I found 3 messages that indeed were wrongly replaced by my script, fixed them, and added uitests to make sure this doesn't happen again :)

r? @jdonszelmann (Anyone else, also feel free to review, just assigning to Jana because she's been reviewing the other PRs)
2026-02-08 19:15:26 +01:00
Jonathan Brouwer
7fbde8b9c8
Rollup merge of #152250 - JonathanBrouwer:convert_finish, r=jdonszelmann
Remove support for slugs in diagnostic messages

This PR contains 5 commits, and is best reviewed commit-by-commit:
- https://github.com/rust-lang/rust/pull/152250/changes/ea8733133cacf4496a2766b3d002492cc29ea7bf Removes support from slugs from `rustc_errors`
- https://github.com/rust-lang/rust/pull/152250/changes/62dd37131f6f43d0dab3e26cf125cd841a08e003 Removes support from slugs from `rustc_macros` (which declares `derive(Diagnostic)`)
- https://github.com/rust-lang/rust/pull/152250/changes/2289e6cfb7e379eba777a10df0a6f474f9450b02 Adjuist the `ui-fulldeps` testsuite to match the changes in `rustc_macros`
- https://github.com/rust-lang/rust/pull/152250/changes/0db0acd6993cbdf84384b00773d7509df6bc20fb Removes support for the fallback bundle (which previously contained all messages, but is now empty) from `rustc_driver_impl` and `rustc_session`
- https://github.com/rust-lang/rust/pull/152250/changes/81d42146040c4a6b3d252e3dc3ac32e563694796 Removes an integration test that tested the translation system using fluent
2026-02-08 19:15:25 +01:00
Jonathan Brouwer
329353e42c
Rollup merge of #151455 - eggyal:normalized-byte-pos, r=cjgillot
Fix `SourceFile::normalized_byte_pos`

This method was broken by 258ace6, which changed `self.normalized_pos` to use relative offsets however this method continued to compare against an absolute offset.

Also adds a regression test for the issue that this method was originally introduced to fix.

Closes rust-lang/rust#149568
Fixes regression of rust-lang/rust#110885

r? cjgillot (as author of the breaking commit)
2026-02-08 19:15:24 +01:00
Noah Lev
9a30ec8149 Implement MVP for opaque generic const arguments
This is meant to be the interim successor to generic const expressions.
Essentially, const item RHS's will be allowed to do arbitrary const
operations using generics. The limitation is that these const items will
be treated opaquely, like ADTs in nominal typing, such that uses of them
will only be equal if the same const item is referenced. In other words,
two const items with the exact same RHS will not be considered equal.

I also added some logic to check feature gates that depend on others
being enabled (like oGCA depending on mGCA).

= Coherence =

During coherence, OGCA consts should be normalized ambiguously because
they are opaque but eventually resolved to a real value. We don't want
two OGCAs that have the same value to be treated as distinct for
coherence purposes. (Just like opaque types.)

This actually doesn't work yet because there are pre-existing
fundamental issues with equate relations involving consts that need to
be normalized. The problem is that we normalize only one layer of the
const item and don't actually process the resulting anon const. Normally
the created inference variable should be handled, which in this case
would cause us to hit the anon const, but that's not happening.
Specifically, `visit_const` on `Generalizer` should be updated to be
similar to `visit_ty`.
2026-02-08 18:15:11 +00:00
Jonathan Brouwer
d14c26f45a
Fix help on AmbiguousMissingKwForItemSub diagnostic 2026-02-08 17:02:40 +01:00
Jonathan Brouwer
8aa0e905f4
Fix suggestion on CallToDeprecatedSafeFnRequiresUnsafe diagnostic 2026-02-08 17:02:40 +01:00
Folkert de Vries
053f76e9f0
cfg_select!: allow optional comma after { /* ... */ } 2026-02-08 13:46:29 +01:00
Jonatan Lindh
fb55b5dcf3 diagnostics: fix ICE in closure signature mismatch
This fixes the ICE by renaming conflicting arguments in the diagnostic.
2026-02-08 13:32:50 +01:00