about summary refs log tree commit diff
path: root/tests/ui/consts/const-blocks
AgeCommit message (Collapse)AuthorLines
2025-06-06Make obligation cause code suggestions verboseEsteban Küber-7/+7
``` error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:28:10 | LL | e!().await; | ^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required for `()` to implement `IntoFuture` help: remove the `.await` | LL - e!().await; LL + e!(); | ``` ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:1:47 | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [None; 5]; | ^^^^ the trait `Copy` is not implemented for `String` | = note: required for `Option<String>` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array help: create an inline `const` block | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [const { None }; 5]; | +++++++ + ```
2025-06-03Use non-2015 edition paths in tests that do not test for their resolutionLukas Wirth-6/+6
This allows for testing these tests on editions other than 2015
2025-04-15Add test for issue 125668reddevilmidzy-0/+5
2025-03-14Do not suggest using `-Zmacro-backtrace` for builtin macrosEsteban Küber-1/+0
For macros that are implemented on the compiler, we do *not* mention the `-Zmacro-backtrace` flag. This includes `derive`s and standard macros.
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-2/+3
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2024-10-29Remove detail from label/note that is already available in other noteEsteban Küber-6/+6
Remove the "which is required by `{root_obligation}`" post-script in "the trait `X` is not implemented for `Y`" explanation in E0277. This information is already conveyed in the notes explaining requirements, making it redundant while making the text (particularly in labels) harder to read. ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ``` vs the prior ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`, which is required by `Option<NotCopy>: Copy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ```
2024-06-24Suggest inline const blocks for array initializationPavel Grigorenko-12/+7
2024-04-24Fix tests and blessGary Guo-1/+0
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-5/+5
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-6/+6
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote: ``` error[E0277]: the trait bound `i32: Bar` is not satisfied --> f100.rs:6:6 | 6 | <i32 as Foo>::foo(); | ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo` | help: this trait has no implementations, consider adding one --> f100.rs:2:1 | 2 | trait Bar {} | ^^^^^^^^^ note: required for `i32` to implement `Foo` --> f100.rs:3:14 | 3 | impl<T: Bar> Foo for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here ``` Fix #40120.
2024-01-24Remove extra # from urlest31-4/+4
2024-01-21Suggest arry::from_fn for array initializationyukang-0/+8
2023-11-24Show number in error message even for one errorNilstrieb-2/+2
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-07-24Improve diagnostic for const ctors in array repeat expressionsclubby789-2/+10
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-5/+10
2023-01-11Note predicate span on ImplDerivedObligationMichael Goulet-1/+1
2023-01-11Move /src/test to /testsAlbert Larsan-0/+473