about summary refs log tree commit diff
path: root/src/test/ui/fn
AgeCommit message (Collapse)AuthorLines
2022-01-21Rollup merge of #92467 - Aaron1011:extern-local-region, r=oli-obkMatthias Krüger-1/+1
Ensure that early-bound function lifetimes are always 'local' During borrowchecking, we treat any free (early-bound) regions on the 'defining type' as `RegionClassification::External`. According to the doc comments, we should only have 'external' regions when checking a closure/generator. However, a plain function can also have some if its regions be considered 'early bound' - this occurs when the region is constrained by an argument, appears in a `where` clause, or in an opaque type. This was causing us to incorrectly mark these regions as 'external', which caused some diagnostic code to act as if we were referring to a 'parent' region from inside a closure. This PR marks all instantiated region variables as 'local' when we're borrow-checking something other than a closure/generator/inline-const.
2022-01-18generic_arg_infer: placeholder in signature errlcnr-4/+4
2021-12-31Ensure that early-bound function lifetimes are always 'local'Aaron Hill-1/+1
During borrowchecking, we treat any free (early-bound) regions on the 'defining type' as `RegionClassification::External`. According to the doc comments, we should only have 'external' regions when checking a closure/generator. However, a plain function can also have some if its regions be considered 'early bound' - this occurs when the region is constrained by an argument, appears in a `where` clause, or in an opaque type. This was causing us to incorrectly mark these regions as 'external', which caused some diagnostic code to act as if we were referring to a 'parent' region from inside a closure. This PR marks all instantiated region variables as 'local' when we're borrow-checking something other than a closure/generator/inline-const.
2021-12-14Add another regression test for unnormalized fn args with SelfJack Huey-0/+37
2021-12-08Rollup merge of #91531 - notriddle:notriddle/issue-87647-expected-semicolon, ↵Matthias Krüger-3/+3
r=estebank Do not add `;` to expected tokens list when it's wrong There's a few spots where semicolons are checked for to do error recovery, and should not be suggested (or checked for other stuff). Fixes #87647
2021-12-04Do not add `;` to expected tokens list when it's wrongMichael Howell-3/+3
There's a few spots where semicolons are checked for to do error recovery, and should not be suggested (or checked for other stuff). Fixes #87647
2021-12-03Tweak "call this function" suggestion to have smaller spanEsteban Kuber-2/+2
2021-12-02Change to check-passJack Huey-1/+1
2021-12-02Add additional test from rust issue number 91068Frank Steffahn-0/+22
2021-11-30Rollup merge of #91243 - jackh726:issue-91068, r=nikomatsakisYuki Okushi-0/+49
Don't treat unnormalized function arguments as well-formed Partial revert of #88312 r? ``@pnkfelix`` cc ``@nikomatsakis``
2021-11-29Bless nllJack Huey-0/+14
2021-11-25Don't treat unnormalized function arguments as well-formedjackh726-0/+35
2021-11-18Move some tests to more reasonable directoriesCaio-0/+12
2021-11-14Move some tests to more reasonable directoriesCaio-0/+104
2021-09-26Remove box syntax from most places in src/test outside of the issues direst31-12/+12
2021-09-16Point at call span that introduced obligation for the argEsteban Kuber-1/+3
2021-08-16Use note to point at bound introducing requirementEsteban Küber-3/+5
2021-08-11Modify structured suggestion outputEsteban Küber-2/+2
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-06-22Updated tests to reflect specified types in E0121Deadbeef-4/+4
2021-04-17Move some tests to more reasonable directories - 6Caio-0/+13
2020-12-22Add regression test for #80179ThePuzzlemaker-0/+48
2020-12-03Gracefully handle confusing -> with : in function return typemibac138-50/+86
2020-12-01Gracefully handle mistyping -> as => in function return typemibac138-0/+68
2020-10-27This flag is not really needed in the testSantiago Pastorino-1/+0
2020-10-27Add unsized_fn_params featureSantiago Pastorino-1/+1
2020-09-02pretty: trim paths of unique symbolsDan Aloni-24/+24
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-06-23review comments: wording and styleEsteban Küber-20/+20
2020-06-22Provide context on E0308 involving fn itemsEsteban Küber-10/+55
2020-05-08Skip tests on emscriptenYuki Okushi-0/+1
2020-05-06Move tests from `test/run-fail` to UIYuki Okushi-0/+10
2020-04-18Make Box<dyn FnOnce> respect self alignmentSantiago Pastorino-0/+24
2020-04-08Small tweaks to required bound spanEsteban Küber-1/+1
2020-02-03Tweak borrow error on `FnMut` when `Fn` is expectedEsteban Küber-9/+8
2019-11-25Auto merge of #66682 - estebank:fn-type-err, r=davidtwcobors-10/+10
Highlight parts of fn in type errors When a type error arises between two fn items, fn pointers or tuples, highlight only the differing parts of each. Examples: <img width="699" alt="" src="https://user-images.githubusercontent.com/1606434/69487597-ab561600-0e11-11ea-9b4e-d4fd9e91d5dc.png"> <img width="528" alt="" src="https://user-images.githubusercontent.com/1606434/69487207-9033d800-0e0a-11ea-93e3-8c4d002411a5.png"> <img width="468" alt="" src="https://user-images.githubusercontent.com/1606434/69487208-9033d800-0e0a-11ea-92e3-2b2cee120335.png"> <img width="775" alt="" src="https://user-images.githubusercontent.com/1606434/69487209-9033d800-0e0a-11ea-9e68-7f6ed5c8cb08.png">
2019-11-23Highlight parts of fn in type errorsEsteban Küber-10/+10
When a type error arises between two fn items, fn pointers or tuples, highlight only the differing parts of each.
2019-11-21Point at type in `let` assignment on type errorsEsteban Küber-3/+9
2019-11-21Auto merge of #66389 - estebank:type-err-labels, r=petrochenkovbors-34/+34
Specific labels when referring to "expected" and "found" types
2019-11-18Surround types with backticks in type errorsEsteban Küber-8/+8
2019-11-18review comments: tweak prefix stringsEsteban Küber-9/+9
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-20/+20
2019-11-18Update ui testsGuillaume Gomez-0/+1
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+1
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-09-22On obligation errors point at the unfulfilled binding when possibleEsteban Küber-1/+1
2019-09-19When possible point at argument causing item obligation failureEsteban Küber-2/+2
2019-08-31Use span label instead of note for cause in E0631Esteban Küber-5/+3
2019-05-29Update ui test suite to use dynmemoryruins-9/+9
2019-04-22update tests for migrate mode by defaultMatthew Jasper-20/+6
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-4/+2
2019-04-17Do not mention missing `PartialOrd` impl when involving uncalled fnsEsteban Küber-2/+0
2019-04-12add the logic for when other_ty is FnDefrchaser53-0/+8