about summary refs log tree commit diff
path: root/tests/ui/range
AgeCommit message (Collapse)AuthorLines
2025-09-08change end to lastJeremy Smart-4/+4
2025-07-16future-incompat lints: don't link to the nightly edition-guide versiondianne-2/+2
2025-06-20Bless UI tests: do not print alternate implementors of `Step`Samuel Tardieu-10/+0
Alternative candidates for a trait implementation are not printed when the trait has a diagnostic name, to avoid printing alternatives for common stdlib traits such as `Copy` or `Debug`. However, this affects all traits for which a diagnostic item is added. Here, the list of alternatives candidates for `Step` does not seem useful, and `Step` is unstable, so this will not be missed.
2025-03-14Do not suggest using `-Zmacro-backtrace` for builtin macrosEsteban Küber-24/+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-01-30std::rangePeter Jaszkowiak-7/+7
2024-12-09Provide diagnostic for `Struct(a, .., z)` expressionEsteban Küber-6/+19
People might extrapolate from `Struct { .. }` that `Struct(..)` would work, but it doesn't.
2024-10-29Remove detail from label/note that is already available in other noteEsteban Küber-1/+1
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-10-18Fix #131471, range misleading field accessFalco Hirschenberger-0/+17
Fixes #131471 by checking if the range-start is a literal.
2024-07-12Make parse error suggestions verbose and fix spansEsteban Küber-4/+24
Go over all structured parser suggestions and make them verbose style. When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
2024-07-05add `new_range_api` for RFC 3550Peter Jaszkowiak-3/+3
This includes a `From<legacy::RangeInclusive> for RangeInclusive` impl for convenience, instead of the `TryFrom` impl from the RFC. Having `From` is highly convenient and the assertion is unlikely to be a problem in practice. This includes re-exports of all existing `Range` types under `core::range`, plus the range-related traits (`RangeBounds`, `Step`, `OneSidedRange`) and the `Bound` enum. Currently the iterators are just wrappers around the old range types, and most other trait impls delegate to the old rage types as well. Also includes an `.iter()` shorthand for `.clone().into_iter()`
2024-05-20Move 100 entries from tests/ui into subdirsJubilee Young-0/+180
- Move super-fast-paren-parsing test into ui/parser - Move stmt_expr_attrs test into ui/feature-gates - Move macro tests into ui/macros - Move global_asm tests into ui/asm - Move env tests into ui/process - Move xcrate tests into ui/cross-crate - Move unop tests into ui/unop - Move backtrace tests into ui/backtrace - Move check-static tests into ui/statics - Move expr tests into ui/expr - Move optimization fuel tests into ui/fuel - Move ffi attribute tests into ui/ffi-attrs - Move suggestion tests into ui/suggestions - Move main tests into ui/fn-main - Move lint tests into ui/lint - Move repr tests into ui/repr - Move intrinsics tests into ui/intrinsics - Move tool lint tests into ui/tool-attributes - Move return tests into ui/return - Move pattern tests into ui/patttern - Move range tests into ui/range - Move foreign-fn tests into ui/foreign - Move orphan-check tests into ui/coherence - Move inference tests into ui/inference - Reduce ROOT_ENTRY_LIMIT
2024-05-02Stabilize exclusive_rangeRoss Smyth-3/+2
2024-03-27Use `TraitRef::to_string` sorting in favor of `TraitRef::ord`, as the latter ↵Oli Scherer-4/+4
compares `DefId`s which we need to avoid
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-10/+10
2024-02-01On E0277 be clearer about implicit `Sized` bounds on type params and assoc typesEsteban Küber-1/+1
``` error[E0277]: the size for values of type `[i32]` cannot be known at compilation time --> f100.rs:2:33 | 2 | let _ = std::mem::size_of::<[i32]>(); | ^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[i32]` note: required by an implicit `Sized` bound in `std::mem::size_of` --> /home/gh-estebank/rust/library/core/src/mem/mod.rs:312:22 | 312 | pub const fn size_of<T>() -> usize { | ^ required by the implicit `Sized` requirement on this bound in `size_of` ``` Fix #120178.
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-1/+1
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.
2023-12-07recurse into refs when comparing tys for diagnosticsjyn-2/+2
2023-11-24Show number in error message even for one errorNilstrieb-5/+5
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-11Fix range overflow checkingNadrieril-2/+2
2023-09-19rustc_hir_analysis: add a helper to check function the signature mismatchesEduardo Sánchez Muñoz-16/+4
This function is now used to check `#[panic_handler]`, `start` lang item, `main`, `#[start]` and intrinsic functions. The diagnosis produced are now closer to the ones produced by trait/impl method signature mismatch.
2023-09-16impl Step for IP addressesltdk-1/+1
2023-08-14Implement Step for AsciiCharltdk-1/+1
2023-06-27Don't sort strings right after we just sorted by typesMichael Goulet-4/+4
2023-05-08Make suggest_deref_or_ref return a multipart suggestionMichael Goulet-74/+102
2023-05-08Tweak borrow suggestionMichael Goulet-72/+96
2023-04-03Perform match checking on THIR.Camille GILLOT-16/+2
2023-03-08may not => cannotMichael Goulet-3/+3
2023-01-30Modify primary span label for E0308Esteban Küber-26/+26
The previous output was unintuitive to users.
2023-01-11Detect out of bounds range pattern valueEsteban Küber-0/+39
Fix #68972.
2023-01-11Move /src/test to /testsAlbert Larsan-0/+1254