about summary refs log tree commit diff
path: root/tests/ui/inference
AgeCommit message (Collapse)AuthorLines
2023-12-14update use of feature flagslcnr-1/+1
2023-12-08Support bare unit structs in destructuring assignmentsMichael Goulet-5/+1
2023-11-24Show number in error message even for one errorNilstrieb-30/+30
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-20Avoid a `track_errors` by bubbling up most errors from `check_well_formed`Oli Scherer-18/+5
2023-10-18Tweak wording of type errors involving type paramsEsteban Küber-1/+1
Fix #78206.
2023-10-15Suggest adding `return` if the type of unused semi return value can coerce ↵yukang-0/+159
to the fn return type
2023-10-06Fix windows test that has different stderr outputEsteban Küber-1/+2
2023-10-04Reorder fullfillment errors to keep more interesting ones firstEsteban Küber-56/+29
In `report_fullfillment_errors` push back `T: Sized`, `T: WellFormed` and coercion errors to the end of the list. The pre-existing deduplication logic eliminates redundant errors better that way, keeping the resulting output with fewer errors than before, while also having more detail.
2023-10-04Show more information when multiple `impl` applyEsteban Küber-2/+103
2023-08-28Tweak output of `to_pretty_impl_header` involving only anon lifetimesEsteban Küber-15/+15
Do not print `impl<> Foo for &Bar`.
2023-08-26More accurately point at argumentsEsteban Küber-7/+7
2023-08-16Fix suggestion for attempting to define a string with single quotesbeetrees-1/+14
2023-08-01Don't select infer -> dyn TraitMichael Goulet-1/+3
2023-07-16stop mentioning number of applicate implementationslcnr-1/+1
2023-07-16self type param infer, avoid ICElcnr-0/+21
2023-07-11Rollup merge of #113567 - chenyukang:yukang-fix-113354-while-let, r=cjgillotJubilee-0/+22
While let suggestion will work for closure body Fixes #113354
2023-07-11While let suggestion will work for closureyukang-0/+22
2023-07-08Don't suggest `impl Trait` in path position许杰友 Jieyou Xu (Joe)-0/+26
2023-06-08Point at correct exprs for assert_eq type mismatchMichael Goulet-6/+7
2023-05-09Rollup merge of #111021 - c410-f3r:dqewdas, r=petrochenkovMatthias Krüger-0/+23
Move some tests r? ``@petrochenkov``
2023-05-08Move testsCaio-0/+23
2023-05-08Tweak borrow suggestionMichael Goulet-8/+12
2023-04-26Rollup merge of #110825 - notriddle:notriddle/issue-70082, r=compiler-errorsMatthias Krüger-0/+27
diagnostics: add test case for already-solved issue Fixes #70082
2023-04-25diagnostics: add test case for already-solved issueMichael Howell-0/+27
Fixes #70082
2023-04-19Suggest deref on comparison binop RHS even if type is not CopyMichael Goulet-1/+23
2023-04-07update tests/uiickk-1/+1
2023-04-07Rollup merge of #109957 - fmease:fix-109905, r=petrochenkovMatthias Krüger-4/+48
diagnostics: account for self type when looking for source of unsolved type variable Fixes #109905. When searching for the source of an unsolved infer var inside of a list of generic args, we look through the `tcx.generics_of(…).own_substs(…)` which *skips* the self type if present. However, the computed `argument_index` is later[^1] used to index into `tcx.generics_of(…).params` which may still contain the self type. In such case, we are off by one when indexing into the parameters. From now on, we account for this immediately after calling `own_substs` which keeps things local. This also fixes the wrong output in the preexisting UI test `inference/need_type_info/concrete-impl.rs` which was overlooked. It used to claim that the *type of type parameter `Self`* couldn't be inferred in `<Struct as Ambiguous<_>>::method()` which of course isn't true: `Self` equals `Struct` here, `A` couldn't be inferred. `@rustbot` label A-diagnostics [^1]: https://github.com/rust-lang/rust/blob/f98a2718141593fbb8dbad10acc537786d748156/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs#L471
2023-04-05account for self type when looking for source of unsolved ty varLeón Orell Valerian Liehr-4/+48
2023-04-05Add regression test for #80409Yuki Okushi-0/+36
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-03-25fix type suggestions in match armsLukas Markeffsky-1/+32
2023-02-22diagnostics: update test cases to refer to assoc fn with `self` as methodMichael Howell-12/+12
2023-02-12Suggest the correct array length on mismatchclubby789-0/+33
2023-02-10Rollup merge of #107789 - jieyouxu:issue-107745, r=lcnrMatthias Krüger-0/+30
Avoid exposing type parameters and implementation details sourced from macro expansions Fixes #107745. ~~I would like to **request some guidance** for this issue, because I don't think this is a good fix (a band-aid at best).~~ ### The Problem The code ```rust fn main() { println!("{:?}", []); } ``` gets desugared into (`rustc +nightly --edition=2018 issue-107745.rs -Z unpretty=hir`): ```rust #[prelude_import] use std::prelude::rust_2018::*; #[macro_use] extern crate std; fn main() { { ::std::io::_print(<#[lang = "format_arguments"]>::new_v1(&["", "\n"], &[<#[lang = "format_argument"]>::new_debug(&[])])); }; } ``` so the diagnostics code tries to be as specific and helpful as possible, and I think it finds that `[]` needs a type parameter and so does `new_debug`. But since `[]` doesn't have an origin for the type parameter definition, it points to `new_debug` instead and leaks the internal implementation detail since all `[]` has is an type inference variable. ### ~~The Bad Fix~~ ~~This PR currently tries to fix the problem by bypassing the generated function `<#[lang = "format_argument"]>::new_debug` to avoid its generic parameter (I think it is auto-generated from the argument `[_; 0]`?) from getting collected as an `InsertableGenericArg`. This is problematic because it also prevents the help from getting displayed.~~ ~~I think this fix is not ideal and hard-codes the format generated code pattern, but I can't think of a better fix. I have tried asking on Zulip but no responses there yet.~~
2023-02-09Introduce `ReError`Esteban Küber-110/+15
CC #69314
2023-02-09Don't expose type parameters and implementation details from macro expansion许杰友 Jieyou Xu (Joe)-0/+30
2023-01-30Modify primary span label for E0308Esteban Küber-3/+3
The previous output was unintuitive to users.
2023-01-18add tests for 107090yukang-0/+204
2023-01-18defer array len printing to const arg printingBoxy-3/+3
2023-01-14Deprioritize fulfillment errors that come from expansions.Mara Bos-4/+7
2023-01-11Note predicate span on ImplDerivedObligationMichael Goulet-3/+6
2023-01-11Move /src/test to /testsAlbert Larsan-0/+2241