about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/messages.ftl
AgeCommit message (Collapse)AuthorLines
2025-07-18AST lowering: More robustly deal with relaxed boundsLeón Orell Valerian Liehr-3/+0
2025-06-18Rollup merge of #141610 - BoxyUwU:stabilize_generic_arg_infer, ↵Jakub Beránek-3/+0
r=lcnr,traviscross Stabilize `feature(generic_arg_infer)` Fixes rust-lang/rust#85077 r? lcnr cc ````@rust-lang/project-const-generics````
2025-06-17Reject union default field valuesJieyou Xu-0/+2
2025-06-11stabilize gaiBoxy-3/+0
2025-03-23Stabilize precise_capturing_in_traitsMichael Goulet-3/+0
2025-03-17Stabilize asm_gotoGary Guo-2/+0
2025-03-01Rollup merge of #137824 - estebank:rtn-sugg, r=compiler-errorsMatthias Krüger-2/+2
Tweak invalid RTN errors Make suggestions verbose. When encountering `method(type)` bound, suggest `method(..)` instead of `method()`. ``` error: argument types not allowed with return type notation --> $DIR/bad-inputs-and-output.rs:9:23 | LL | fn foo<T: Trait<method(i32): Send>>() {} | ^^^^^ | help: remove the input types | LL - fn foo<T: Trait<method(i32): Send>>() {} LL + fn foo<T: Trait<method(..): Send>>() {} | ``` When encountering both return type and arg list that isn't `..`, suggest replacing both. ``` error: return type not allowed with return type notation --> $DIR/bad-inputs-and-output.rs:12:25 | LL | fn bar<T: Trait<method() -> (): Send>>() {} | ^^^^^^ | help: use the right argument notation and remove the return type | LL - fn bar<T: Trait<method() -> (): Send>>() {} LL + fn bar<T: Trait<method(..): Send>>() {} | ``` When encountering a return type, suggest removing it including the leading whitespace. ``` error: return type not allowed with return type notation --> $DIR/bad-inputs-and-output.rs:24:45 | LL | fn bay_path<T: Trait>() where T::method(..) -> (): Send {} | ^^^^^ | help: remove the return type | LL - fn bay_path<T: Trait>() where T::method(..) -> (): Send {} LL + fn bay_path<T: Trait>() where T::method(..): Send {} | ``` r? ``@compiler-errors``
2025-02-28Tweak invalid RTN errorsEsteban Küber-2/+2
Make suggestions verbose. When encountering `method(type)` bound, suggest `method(..)` instead of `method()`. ``` error: argument types not allowed with return type notation --> $DIR/bad-inputs-and-output.rs:9:23 | LL | fn foo<T: Trait<method(i32): Send>>() {} | ^^^^^ | help: remove the input types | LL - fn foo<T: Trait<method(i32): Send>>() {} LL + fn foo<T: Trait<method(..): Send>>() {} | ``` When encountering both return type and arg list that isn't `..`, suggest replacing both. ``` error: return type not allowed with return type notation --> $DIR/bad-inputs-and-output.rs:12:25 | LL | fn bar<T: Trait<method() -> (): Send>>() {} | ^^^^^^ | help: use the right argument notation and remove the return type | LL - fn bar<T: Trait<method() -> (): Send>>() {} LL + fn bar<T: Trait<method(..): Send>>() {} | ``` When encountering a return type, suggest removing it including the leading whitespace. ``` error: return type not allowed with return type notation --> $DIR/bad-inputs-and-output.rs:24:45 | LL | fn bay_path<T: Trait>() where T::method(..) -> (): Send {} | ^^^^^ | help: remove the return type | LL - fn bay_path<T: Trait>() where T::method(..) -> (): Send {} LL + fn bay_path<T: Trait>() where T::method(..): Send {} | ```
2025-02-28Tweak incorrect ABI suggestionEsteban Küber-1/+1
Provide a better suggestion message, and make the suggestion verbose. ``` error[E0703]: invalid ABI: found `riscv-interrupt` --> $DIR/riscv-discoverability-guidance.rs:17:8 | LL | extern "riscv-interrupt" fn isr() {} | ^^^^^^^^^^^^^^^^^ invalid ABI | = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions help: there's a similarly named valid ABI `"riscv-interrupt-m"` | LL | extern "riscv-interrupt-m" fn isr() {} | ++ ```
2025-01-29show supported register classesFolkert de Vries-1/+2
in inline assembly, show the supported register classes when an invalid one is found
2024-12-09review comments: rewordingsEsteban Küber-1/+1
2024-12-09Detect `struct S(ty = val);`Esteban Küber-0/+3
Emit a specific error for unsupported default field value syntax in tuple structs.
2024-12-09Introduce `default_field_values` featureEsteban Küber-4/+0
Initial implementation of `#[feature(default_field_values]`, proposed in https://github.com/rust-lang/rfcs/pull/3681. Support default fields in enum struct variant Allow default values in an enum struct variant definition: ```rust pub enum Bar { Foo { bar: S = S, baz: i32 = 42 + 3, } } ``` Allow using `..` without a base on an enum struct variant ```rust Bar::Foo { .. } ``` `#[derive(Default)]` doesn't account for these as it is still gating `#[default]` only being allowed on unit variants. Support `#[derive(Default)]` on enum struct variants with all defaulted fields ```rust pub enum Bar { #[default] Foo { bar: S = S, baz: i32 = 42 + 3, } } ``` Check for missing fields in typeck instead of mir_build. Expand test with `const` param case (needs `generic_const_exprs` enabled). Properly instantiate MIR const The following works: ```rust struct S<A> { a: Vec<A> = Vec::new(), } S::<i32> { .. } ``` Add lint for default fields that will always fail const-eval We *allow* this to happen for API writers that might want to rely on users' getting a compile error when using the default field, different to the error that they would get when the field isn't default. We could change this to *always* error instead of being a lint, if we wanted. This will *not* catch errors for partially evaluated consts, like when the expression relies on a const parameter. Suggestions when encountering `Foo { .. }` without `#[feature(default_field_values)]`: - Suggest adding a base expression if there are missing fields. - Suggest enabling the feature if all the missing fields have optional values. - Suggest removing `..` if there are no missing fields.
2024-11-25Rollup merge of #131664 - taiki-e:s390x-asm-vreg-inout, r=AmanieuMatthias Krüger-0/+2
Support input/output in vector registers of s390x inline assembly (under asm_experimental_reg feature) This extends currently clobber-only vector registers (`vreg`) support to allow passing `#[repr(simd)]` types, floats (f32/f64/f128), and integers (i32/i64/i128) as input/output. This is unstable and gated under new `#![feature(asm_experimental_reg)]` (tracking issue: https://github.com/rust-lang/rust/issues/133416). If the feature is not enabled, only clober is supported as before. | Architecture | Register class | Target feature | Allowed types | | ------------ | -------------- | -------------- | -------------- | | s390x | `vreg` | `vector` | `i32`, `f32`, `i64`, `f64`, `i128`, `f128`, `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` | This matches the list of types that are supported by the vector registers in LLVM: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td#L301-L313 In addition to `core::simd` types and floats listed above, custom `#[repr(simd)]` types of the same size and type are also allowed. All allowed types other than i32/f32/i64/f64/i128, and relevant target features are currently unstable. Currently there is no SIMD type for s390x in `core::arch`, but this is tracked in https://github.com/rust-lang/rust/issues/130869. cc https://github.com/rust-lang/rust/issues/130869 about vector facility support in s390x cc https://github.com/rust-lang/rust/issues/125398 & https://github.com/rust-lang/rust/issues/116909 about f128 support in asm `@rustbot` label +O-SystemZ +A-inline-assembly
2024-11-24Make asm_goto_with_outputs a separate feature gateGary Guo-0/+2
2024-11-24Make s390x non-clobber-only vector register support unstableTaiki Endo-0/+2
2024-11-16Fix ICE when passing DefId-creating args to legacy_const_generics.Luca Versari-0/+6
2024-08-13stabilize `asm_const`Folkert-2/+0
2024-08-10rustc_ast_lowering: make asm-related unstability messages translatablePavel Grigorenko-0/+7
2024-08-10rustc_ast_lowering: make "yield syntax is experimental" translatablePavel Grigorenko-0/+2
2024-08-10rustc_ast_lowering: make "using `_` for array lengths is unstable" translatablePavel Grigorenko-0/+3
2024-06-28Make sure we deny unimplemented RTN on qpath segmentsMichael Goulet-0/+2
2024-06-28Change RTN to use .. againMichael Goulet-0/+3
2024-06-25Rollup merge of #126746 - compiler-errors:no-rpitit, r=oli-obkMatthias Krüger-0/+3
Deny `use<>` for RPITITs Precise capturing `use<>` syntax is currently a no-op on RPITITs, since GATs have no variance, so all captured lifetimes are captured invariantly. We don't currently *need* to support `use<>` on RPITITs, since `use<>` is initially intended for migrating RPIT *overcaptures* from edition 2021->2024, but since RPITITs currently capture all in-scope lifetimes, we'll never need to write `use<>` on an RPITIT. Eventually, though, it would be desirable to support precise capturing on RPITITs, since RPITITs overcapturing by default can be annoying to some folks. But let's separate that (which will likely require some delicate types team work for adding variances to GATs and adjusting the refinement rules) from the stabilization of the feature for edition 2024. r? oli-obk cc ``@traviscross`` Tracking: - https://github.com/rust-lang/rust/issues/123432
2024-06-24Deny use<> for RPITITsMichael Goulet-0/+3
2024-06-21Fix remaining casesMichael Goulet-1/+1
2024-06-17Add tests for illegal use bound syntaxMichael Goulet-1/+1
2024-04-29Change wordingest31-1/+1
2024-04-28Add a note to the ArbitraryExpressionInPattern errorest31-0/+1
2024-04-24Error on using `yield` without also using `#[coroutine]` on the closureOli Scherer-0/+3
And suggest adding the `#[coroutine]` to the closure
2024-04-15Validation and other thingsMichael Goulet-0/+2
2024-02-24Add asm label support to AST and HIRGary Guo-0/+3
2024-02-10Add a helpful suggestionMichael Goulet-0/+1
2024-02-10No more associated type bounds in dyn traitMichael Goulet-3/+3
2024-02-06Auto merge of #120361 - compiler-errors:async-closures, r=oli-obkbors-3/+0
Rework support for async closures; allow them to return futures that borrow from the closure's captures This PR implements a new lowering for async closures via `TyKind::CoroutineClosure` which handles the curious relationship between the closure and the coroutine that it returns. I wrote up a bunch in [this hackmd](https://hackmd.io/`@compiler-errors/S1HvqQxca)` which will be copied to the dev guide after this PR lands, and hopefully left sufficient comments in the source code explaining why this change is as large as it is. This also necessitates that they begin implementing the `AsyncFn`-family of traits, rather than the `Fn`-family of traits -- if you need `Fn` implementations, you should probably use the non-sugar `|| async {}` syntax instead. Notably this PR does not yet implement `async Fn()` syntax sugar for bounds, but I expect to add those soon (**edit:** #120392). For now, users must use `AsyncFn()` traits directly, which necessitates adding the `async_fn_traits` feature gate as well. I will add this as a follow-up very soon. r? oli-obk This is based on top of #120322, but that PR is minimal.
2024-02-06Make async closures directly lower to ClosureKind::CoroutineClosureMichael Goulet-3/+0
2024-01-31Error on incorrect item kind in async boundMichael Goulet-0/+6
2024-01-16Async closures will move params into the future alwaysMichael Goulet-4/+0
2024-01-09Add error code for missing base expression in struct update syntaxclubby789-1/+1
2024-01-07Split note, fix const/static impl trait errorMichael Goulet-1/+2
2024-01-01Deny defaults for higher-ranked generic parametersLeón Orell Valerian Liehr-2/+3
2023-12-26fallback `default` to `None` during ast-loweing for lifetime binderbohan-0/+2
2023-12-03Disallow arm bodies on never patternsNadrieril-0/+5
2023-12-03Disallow guards on never patternsNadrieril-0/+4
2023-12-03Disallow an arm without a body (except for never patterns)Nadrieril-0/+4
Parsing now accepts a match arm without a body, so we must make sure to only accept that if the pattern is a never pattern.
2023-10-20s/generator/coroutine/Oli Scherer-5/+5
2023-10-13Deprecate E0706Michael Goulet-6/+0
2023-10-04Tweak wording of E0562Esteban Küber-1/+1
Fix #80476.
2023-09-12cleanup on messagesyukang-4/+0
2023-05-25Ensure Fluent messages are in alphabetical orderclubby789-84/+84