about summary refs log tree commit diff
path: root/tests/ui/generics
AgeCommit message (Collapse)AuthorLines
2025-02-06Remove some unnecessary parens in `assert!` conditionsEsteban Küber-1/+1
While working on #122661, some of these started triggering our "unnecessary parens" lints due to a change in the `assert!` desugaring. A cursory search identified a few more. Some of these have been carried from before 1.0, were a bulk rename from the previous name of `assert!` left them in that state. I went and removed as many of these unnecessary parens as possible in order to have fewer annoyances in the future if we make the lint smarter.
2025-01-23Bless and add testsBoxy-5/+0
2024-12-13Use a more precise span in placeholder_type_error_diagArthur Carcano-0/+60
Closes: https://github.com/rust-lang/rust/issues/123861
2024-11-26tests: remove `//@ pretty-expanded` usages许杰友 Jieyou Xu (Joe)-9/+0
Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
2024-11-20Store resolution for self and crate root module segmentsMichael Goulet-0/+50
2024-08-31elided_named_lifetimes: bless & add testsPavel Grigorenko-2/+2
2024-07-22Revert suggestion verbosity changeEsteban Küber-238/+117
2024-07-22On generic and lifetime removal suggestion, do not leave behind stray `,`Esteban Küber-26/+26
2024-07-22Change suggestion message wordingEsteban Küber-50/+50
2024-07-22Use verbose suggestion for "wrong # of generics"Esteban Küber-117/+238
2024-07-18More accurate span for type parameter suggestionEsteban Küber-12/+18
After: ``` error[E0229]: associated item constraints are not allowed here --> $DIR/impl-block-params-declared-in-wrong-spot-issue-113073.rs:3:10 | LL | impl Foo<T: Default> for String {} | ^^^^^^^^^^ associated item constraint not allowed here | help: declare the type parameter right after the `impl` keyword | LL - impl Foo<T: Default> for String {} LL + impl<T: Default> Foo<T> for String {} | ``` Before: ``` error[E0229]: associated item constraints are not allowed here --> $DIR/impl-block-params-declared-in-wrong-spot-issue-113073.rs:3:10 | LL | impl Foo<T: Default> for String {} | ^^^^^^^^^^ associated item constraint not allowed here | help: declare the type parameter right after the `impl` keyword | LL | impl<T: Default> Foo<T> for String {} | ++++++++++++ ~ ```
2024-07-12Use more accurate span for `:` to `::` suggestionEsteban Küber-1/+1
2024-07-12Make parse error suggestions verbose and fix spansEsteban Küber-7/+17
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-09Automatically taint when reporting errors from ItemCtxtOli Scherer-10/+2
2024-06-26Automatically taint InferCtxt when errors are emittedOli Scherer-2/+10
2024-06-05Update TestsVeera-0/+129
2024-05-20Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses.surechen-0/+120
fixes #122714
2024-03-17Test generic arg suggestion inside nested itemKornel-1/+26
2024-03-17Suggest _ for missing generic arguments in turbofishKornel-2/+25
2024-03-14preserve span when evaluating mir::ConstOperandRalf Jung-2/+19
2024-03-01If suggestion would leave an empty line, delete itclubby789-2/+0
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-58/+58
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-3/+12
2024-02-07Update testsr0cky-2/+2
2024-02-01On E0277 be clearer about implicit `Sized` bounds on type params and assoc typesEsteban Küber-2/+2
``` 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-09Avoid silencing relevant follow-up errorsOli Scherer-16/+16
2024-01-02Adjust compiler tests for unused_tuple_struct_fields -> dead_codeJake Goulding-11/+11
2023-12-01Tweak unclosed generics errorsEsteban Küber-0/+15
Remove unnecessary span label for parse errors that already have a suggestion. Provide structured suggestion to close generics in more cases.
2023-11-30generic_const_exprs: suggest to add the feature, not use itRalf Jung-1/+1
2023-11-24Show number in error message even for one errorNilstrieb-20/+20
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-09-22diagnostics: simpler 83556 handling by bailing outMichael Howell-12/+1
2023-09-21diagnostics: avoid mismatch between variance index and hir genericMichael Howell-0/+23
This happens because variances are constructed from ty generics, and ty generics are always constructed with lifetimes first. See compiler/rustc_hir_analysis/src/collect/generics_of.rs:248-269 Fixes #83556
2023-09-10Generalize E0401León Orell Valerian Liehr-6/+6
2023-07-27Update the minimum external LLVM to 15Josh Stone-1/+0
2023-07-21Revert "Auto merge of #113166 - moulins:ref-niches-initial, r=oli-obk"David Tolnay-1/+0
This reverts commit 557359f92512ca88b62a602ebda291f17a953002, reversing changes made to 1e6c09a803fd543a98bfbe1624d697a55300a786.
2023-07-21add `naive_layout_of` queryMoulins-0/+1
2023-06-30Use structured suggestion when telling user about `for<'a>`Esteban Küber-4/+3
``` error[E0637]: `&` without an explicit lifetime name cannot be used here --> $DIR/E0637.rs:13:13 | LL | T: Into<&u32>, | ^ explicit lifetime name needed here | help: consider introducing a higher-ranked lifetime here | LL | T: for<'a> Into<&'a u32>, | +++++++ ++ ```
2023-06-12Adjust UI tests for `unit_bindings`许杰友 Jieyou Xu (Joe)-1/+1
- Either explicitly annotate `let x: () = expr;` where `x` has unit type, or remove the unit binding to leave only `expr;` instead. - Fix disjoint-capture-in-same-closure test
2023-05-01soften the wording for removing type ascriptionyukang-1/+1
2023-05-01Rip it outNilstrieb-7/+8
My type ascription Oh rip it out Ah If you think we live too much then You can sacrifice diagnostics Don't mix your garbage Into my syntax So many weird hacks keep diagnostics alive Yet I don't even step outside So many bad diagnostics keep tyasc alive Yet tyasc doesn't even bother to survive!
2023-04-22Encode lifetime param spans tooMichael Goulet-0/+48
2023-04-15add UI test for #79605SparkyPotato-0/+20
2023-04-02Move some UI tests into subdirectoriesjyn-0/+28
to avoid going over the existing limit now that the ui-fulldeps tests have been moved to ui.
2023-02-23diagnostics: remove inconsistent English article "this" from E0107Michael Howell-128/+128
Consider `tests/ui/const-generics/generic_const_exprs/issue-102768.stderr`, the error message where it gives additional notes about where the associated type is defined, and how the dead code lint doesn't have an article, like in `tests/ui/lint/dead-code/issue-85255.stderr`. They don't have articles, so it seems unnecessary to have one here.
2023-02-09Introduce `ReError`Esteban Küber-16/+3
CC #69314
2023-01-30Modify primary span label for E0308Esteban Küber-12/+12
The previous output was unintuitive to users.
2023-01-15make error emitted on `impl &Trait` nicerEzra Shaw-0/+117
2023-01-11Move /src/test to /testsAlbert Larsan-0/+3556