about summary refs log tree commit diff
path: root/src/test/ui/self
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-4352/+0
2022-11-11Rollup merge of #103531 - chenyukang:yukang/fix-103474, r=estebankManish Goregaokar-0/+4
Suggest calling the instance method of the same name when method not found Fixes #103474
2022-10-26suggest calling the method of the same name when method not foundyukang-0/+4
2022-10-25Name impl trait in region bound suggestionMichael Goulet-2/+2
2022-08-18Reword "Required because of the requirements on the impl of ..."Andy Wang-2/+2
2022-07-26Use real opaque type instead of just saying impl TraitMichael Goulet-2/+2
2022-07-07Track implicit `Sized` obligations in type paramsEsteban Küber-2/+2
Suggest adding a `?Sized` bound if appropriate on E0599 by inspecting the HIR Generics. (Fix #98539)
2022-06-22point to type param definition when not finding variant, method and assoc typeTakayuki Maeda-2/+2
use `def_ident_span` , `body_owner_def_id` instead of `in_progress_typeck_results`, `guess_head_span` use `body_id.owner` directly add description to label
2022-06-03Fully stabilize NLLJack Huey-1270/+128
2022-05-29Handle anonymous lifetimes properly in diagnostics.Camille GILLOT-2/+2
2022-05-29Make lifetime errors more precise in the presence of `Fresh` lifetimes.Camille GILLOT-1/+342
2022-04-27Recover suggestions to introduce named lifetime under NLLmarmeladema-0/+155
2022-04-18Rollup merge of #96148 - marmeladema:nll-revisions-self, r=jackh726Dylan DPC-192/+360
Use revisions instead of nll compare mode for `/self/` ui tests r? ``@jackh726``
2022-04-17Use revisions instead of nll compare mode for `/self/` ui testsmarmeladema-192/+360
2022-04-16Implementation for 65853Jack Huey-1/+9
This attempts to bring better error messages to invalid method calls, by applying some heuristics to identify common mistakes. The algorithm is inspired by Levenshtein distance and longest common sub-sequence. In essence, we treat the types of the function, and the types of the arguments you provided as two "words" and compute the edits to get from one to the other. We then modify that algorithm to detect 4 cases: - A function input is missing - An extra argument was provided - The type of an argument is straight up invalid - Two arguments have been swapped - A subset of the arguments have been shuffled (We detect the last two as separate cases so that we can detect two swaps, instead of 4 parameters permuted.) It helps to understand this argument by paying special attention to terminology: "inputs" refers to the inputs being *expected* by the function, and "arguments" refers to what has been provided at the call site. The basic sketch of the algorithm is as follows: - Construct a boolean grid, with a row for each argument, and a column for each input. The cell [i, j] is true if the i'th argument could satisfy the j'th input. - If we find an argument that could satisfy no inputs, provided for an input that can't be satisfied by any other argument, we consider this an "invalid type". - Extra arguments are those that can't satisfy any input, provided for an input that *could* be satisfied by another argument. - Missing inputs are inputs that can't be satisfied by any argument, where the provided argument could satisfy another input - Swapped / Permuted arguments are identified with a cycle detection algorithm. As each issue is found, we remove the relevant inputs / arguments and check for more issues. If we find no issues, we match up any "valid" arguments, and start again. Note that there's a lot of extra complexity: - We try to stay efficient on the happy path, only computing the diagonal until we find a problem, and then filling in the rest of the matrix. - Closure arguments are wrapped in a tuple and need to be unwrapped - We need to resolve closure types after the rest, to allow the most specific type constraints - We need to handle imported C functions that might be variadic in their inputs. I tried to document a lot of this in comments in the code and keep the naming clear.
2022-03-28Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"Oli Scherer-4/+4
This reverts commit 6499c5e7fc173a3f55b7a3bd1e6a50e9edef782d, reversing changes made to 78450d2d602b06d9b94349aaf8cece1a4acaf3a8.
2022-03-01update (bless) test resultsFausto-31/+31
2022-02-28Suggest adding a new lifetime parameter when two elided lifetimes should ↵Fausto-0/+186
match up for traits and impls. Issue #94462
2022-02-17Revert "Auto merge of #91403 - cjgillot:inherit-async, r=oli-obk"Oli Scherer-66/+125
This reverts commit 3cfa4def7c87d571bd46d92fed608edf8fad236e, reversing changes made to 5d8767cb229b097fedb1dd4bd9420d463c37774f.
2022-02-12Bless nll tests.Camille GILLOT-3/+2
2022-02-12Inherit lifetimes for async fn instead of duplicating them.Camille GILLOT-122/+64
2022-02-11Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"Oli Scherer-4/+4
This reverts commit e7cc3bddbe0d0e374d05e7003e662bba1742dbae, reversing changes made to 734368a200904ef9c21db86c595dc04263c87be0.
2022-02-02Register member constraints on the final merged hidden typeOli Scherer-6/+7
Previously we did this per hidden type candiate, which didn't always have all the information available.
2022-02-02Lazily resolve type-alias-impl-trait defining usesOli Scherer-8/+7
by using an opaque type obligation to bubble up comparisons between opaque types and other types Also uses proper obligation causes so that the body id works, because out of some reason nll uses body ids for logic instead of just diagnostics.
2022-01-20Rollup merge of #92582 - lcnr:generic-arg-infer, r=BoxyUwUMatthias Krüger-4/+4
improve `_` constants in item signature handling removing the "type" from the error messages does slightly worsen the error messages for types, but figuring out whether the placeholder is for a type or a constant and correctly dealing with that seemed fairly difficult to me so I took the easy way out :sparkles: Imo the error message is still clear enough. r? `@BoxyUwU` cc `@estebank`
2022-01-19Simplify error reporting code, remove await point wordingTyler Mandry-128/+96
2022-01-19NiceRegionError: Use written return type for async fnTyler Mandry-128/+128
2022-01-18generic_arg_infer: placeholder in signature errlcnr-4/+4
2021-12-17Fix typo in "new region bound" suggestionEsteban Kuber-2/+2
The lifetime name shoud always appear in text surrounded by `.
2021-11-14Move some tests to more reasonable directoriesCaio-0/+59
2021-11-06Move some tests to more reasonable directoriesCaio-0/+53
2021-10-18Remove regionck member constraint handling and leave it to mir borrowckOli Scherer-52/+7
2021-10-15simplify constrain_opaque_typesNiko Matsakis-30/+40
2021-09-30Rollup merge of #88838 - FabianWolff:issue-88472, r=estebankManish Goregaokar-3/+4
Do not suggest importing inaccessible items Fixes #88472. For this example: ```rust mod a { struct Foo; } mod b { type Bar = Foo; } ``` rustc currently emits: ``` error[E0412]: cannot find type `Foo` in this scope --> test.rs:6:16 | 6 | type Bar = Foo; | ^^^ not found in this scope | help: consider importing this struct | 6 | use a::Foo; | ``` this is incorrect, as applying this suggestion leads to ``` error[E0603]: struct `Foo` is private --> test.rs:6:12 | 6 | use a::Foo; | ^^^ private struct | note: the struct `Foo` is defined here --> test.rs:2:5 | 2 | struct Foo; | ^^^^^^^^^^^ ``` With my changes, I get: ``` error[E0412]: cannot find type `Foo` in this scope --> test.rs:6:16 | 6 | type Bar = Foo; | ^^^ not found in this scope | = note: this struct exists but is inaccessible: a::Foo ``` As for the wildcard mentioned in #88472, I would argue that the warning is actually correct, since the import _is_ unused. I think the real issue is the wrong suggestion, which I have fixed here.
2021-09-26Improve diagnostics for inaccessible itemsFabian Wolff-2/+5
2021-09-26Do not suggest importing inaccessible itemsFabian Wolff-4/+2
2021-09-26Remove box syntax from most places in src/test outside of the issues direst31-25/+15
2021-09-09Ignore automatically derived impls of `Clone` and `Debug` in dead code analysisFabian Wolff-0/+1
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-23/+0
2021-08-11Modify structured suggestion outputEsteban Küber-8/+8
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-07-22bless nll testsOli Scherer-2/+2
2021-07-20Get back the more precise suggestion spans of old regionckOli Scherer-2/+2
2021-07-14Warn about useless assignments of variables/fields to themselvesFabian Wolff-0/+1
2021-06-22Updated tests to reflect specified types in E0121Deadbeef-4/+4
2021-03-29Suggest box/pin/arc ing receiver on method callsEsteban Küber-0/+10
2020-11-10Rollup merge of #76765 - guswynn:async_return, r=tmandryJonas Schievink-96/+128
Make it more clear what an about async fn's returns when referring to what it returns see #76547 This is *likely* not the ONLY place that this happens to be unclear, but we can move this fn to rustc_middle or something like that and reuse it if need be, to apply it to more diagnostics One outstanding question I have is, if the fn returns (), should I make the message more clear (what about `fn f()` vs `fn f() -> ()`, can you tell those apart in the hir?) R? `@tmandry` `@rustbot` modify labels +A-diagnostics +T-compiler
2020-10-20review commentsEsteban Küber-3/+3
2020-10-20Tweak "object unsafe" errorsEsteban Küber-18/+25
Fix #77598.
2020-10-17Make it more clear when complaining about async fn's return typesGus Wynn-96/+128
2020-10-16stabilize union with 'ManuallyDrop' fields and 'impl Drop for Union'Ralf Jung-3/+0