about summary refs log tree commit diff
path: root/src/test/ui/parser
AgeCommit message (Collapse)AuthorLines
2022-01-17Rollup merge of #92876 - compiler-errors:fix-turbofish-lifetime-suggestion, ↵Matthias Krüger-19/+60
r=nagisa Fix suggesting turbofish with lifetime arguments Now we suggest turbofish correctly given exprs like `foo<'_>`. Also fix suggestion when we have `let x = foo<bar, baz>;` which was broken.
2022-01-13Fix suggesting turbofish with lifetime argumentsMichael Goulet-19/+60
2022-01-14Parse `Ty?` as `Option<Ty>` and provide structured suggestionEsteban Kuber-34/+68
Swift has specific syntax that desugars to `Option<T>` similar to our `?` operator, which means that people might try to use it in Rust. Parse it and gracefully recover.
2021-12-29Fix whitespace in pretty printed PatKind::RangeDavid Tolnay-2/+2
2021-12-28Parse and suggest moving where clauses after equals for type aliasesJack Huey-0/+77
2021-12-18Rollup merge of #89090 - cjgillot:bare-dyn, r=jackh726Matthias Krüger-69/+37
Lint bare traits in AstConv. Removing the lint from lowering allows to: - make lowering querification easier; - have the lint implementation in only one place. r? `@estebank`
2021-12-13Update test to new error messageAlexis Bourget-15/+17
2021-12-13Fix broken span and related testsAlexis Bourget-6/+16
2021-12-13Add tests for misplaced/duplicated pub in fn declAlexis Bourget-0/+37
2021-12-12Auto merge of #90207 - BoxyUwU:stabilise_cg_defaults, r=lcnrbors-5/+5
Stabilise `feature(const_generics_defaults)` `feature(const_generics_defaults)` is complete implementation wise and has a pretty extensive test suite so I think is ready for stabilisation. needs stabilisation report and maybe an RFC :sweat_smile: r? `@lcnr` cc `@rust-lang/project-const-generics`
2021-12-11Tweak assoc type obligation spansEsteban Kuber-6/+10
* Point at RHS of associated type in obligation span * Point at `impl` assoc type on projection error * Reduce verbosity of recursive obligations * Point at source of binding lifetime obligation * Tweak "required bound" note * Tweak "expected... found opaque (return) type" labels * Point at set type in impl assoc type WF errors
2021-12-10bless testsEllen-5/+5
2021-12-09Auto merge of #91692 - matthiaskrgr:rollup-u7dvh0n, r=matthiaskrgrbors-0/+37
Rollup of 6 pull requests Successful merges: - #87599 (Implement concat_bytes!) - #89999 (Update std::env::temp_dir to use GetTempPath2 on Windows when available.) - #90796 (Remove the reg_thumb register class for asm! on ARM) - #91042 (Use Vec extend instead of repeated pushes on several places) - #91634 (Do not attempt to suggest help for overly malformed struct/function call) - #91685 (Install llvm tools to sysroot when assembling local toolchain) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-09Rollup merge of #91634 - terrarier2111:fix-recover-from-variant-ice, r=nagisaMatthias Krüger-0/+37
Do not attempt to suggest help for overly malformed struct/function call This fixes: https://github.com/rust-lang/rust/issues/91461
2021-12-09Auto merge of #91691 - matthiaskrgr:rollup-wfommdr, r=matthiaskrgrbors-1/+12
Rollup of 5 pull requests Successful merges: - #91042 (Use Vec extend instead of repeated pushes on several places) - #91476 (Improve 'cannot contain emoji' error.) - #91568 (Pretty print break and continue without redundant space) - #91645 (Implement `core::future::join!`) - #91666 (update Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-09Rollup merge of #91476 - m-ou-se:ferris-identifier, r=estebankMatthias Krüger-1/+12
Improve 'cannot contain emoji' error. Before: ``` error: identifiers cannot contain emoji: `🦀` --> src/main.rs:2:9 | 2 | let 🦀 = 1; | ^^ ``` After: ``` error: Ferris cannot be used as an identifier --> src/main.rs:2:9 | 2 | let 🦀 = 1; | ^^ help: try using their name instead: `ferris` ``` r? `@estebank`
2021-12-08Rollup merge of #91337 - FabianWolff:issue-91227-misspelled-macro, r=nagisaMatthias Krüger-0/+36
Add a suggestion if `macro_rules` is misspelled Fixes #91227.
2021-12-08Do not attempt to suggest help for overly malformed struct/function callthreadexception-0/+37
2021-12-04Use multipart suggestions.Camille GILLOT-3/+18
2021-12-04Lint bare traits in AstConv.Camille GILLOT-69/+22
2021-12-04Do not add `;` to expected tokens list when it's wrongMichael Howell-19/+21
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-03Extend emoji-identifiers ui test.Mara Bos-1/+12
2021-12-02Rollup merge of #91435 - FabianWolff:issue-91421-if-then, r=lcnrMatthias Krüger-0/+31
Improve diagnostic for missing half of binary operator in `if` condition Fixes #91421. I've also changed it so that it doesn't consume the `else` token in the error case, because it will try to consume it again afterwards, leading to this incorrect error message (where the `else` reported as missing is actually there): ``` error: expected one of `.`, `;`, `?`, `else`, or an operator, found `{` --> src/main.rs:4:12 | 4 | } else { 4 }; | ^ expected one of `.`, `;`, `?`, `else`, or an operator ``` r? `@lcnr`
2021-12-01Improve diagnostic for missing half of binary operator in `if` conditionFabian Wolff-0/+31
2021-12-01Rollup merge of #87160 - estebank:colon-recovery, r=nagisaMatthias Krüger-28/+63
When recovering from a `:` in a pattern, use adequate AST pattern If the suggestion to use `::` instead of `:` in the pattern isn't correct, a second resolution error will be emitted.
2021-11-28Add a suggestion if `macro_rules` is misspelledFabian Wolff-0/+36
2021-11-25Auto merge of #91037 - c410-f3r:testsssssss, r=petrochenkovbors-648/+0
Move some tests to more reasonable directories - 10 cc #73494 r? `@petrochenkov`
2021-11-25When recovering from a `:` in a pattern, use adequate AST patternEsteban Küber-28/+63
2021-11-25Move some tests to more reasonable directoriesCaio-648/+0
2021-11-25Auto merge of #88781 - estebank:emoji-idents, r=oli-obkbors-0/+99
Tokenize emoji as if they were valid identifiers In the lexer, consider emojis to be valid identifiers and reject them later to avoid knock down parse errors. Partially address #86102.
2021-11-24Tweak span and add more testsEsteban Kuber-4/+38
2021-11-24Account for incorrect `impl Foo<const N: ty> {}` syntaxEsteban Küber-0/+28
Fix #84946
2021-11-23Sort `FxHashSet`'s contents before emitting errors for consistent outputEsteban Kuber-20/+20
2021-11-23review comment: plural of emoji is emojiEsteban Kuber-12/+12
2021-11-23Account for confusable codepoints when recovering emoji identifiersEsteban Kuber-4/+16
2021-11-23fix fmtEsteban Kuber-1/+0
2021-11-23Replace ZWJ with nothing in terminal outputEsteban Kuber-2/+2
2021-11-23Tokenize emoji as if they were valid indentifiersEsteban Kuber-0/+88
In the lexer, consider emojis to be valid identifiers and reject them later to avoid knock down parse errors.
2021-11-21Auto merge of #89580 - estebank:trait-bounds-are-tricky, r=nagisabors-5/+0
Point at source of trait bound obligations in more places Be more thorough in using `ItemObligation` and `BindingObligation` when evaluating obligations so that we can point at trait bounds that introduced unfulfilled obligations. We no longer incorrectly point at unrelated trait bounds (`substs-ppaux.verbose.stderr`). In particular, we now point at trait bounds on method calls. We no longer point at "obvious" obligation sources (we no longer have a note pointing at `Trait` saying "required by a bound in `Trait`", like in `associated-types-no-suitable-supertrait*`). We no longer point at associated items (`ImplObligation`), as they didn't add any user actionable information, they just added noise. Address part of #89418.
2021-11-20Rollup merge of #90994 - Badel2:issue-90993, r=estebankMatthias Krüger-0/+37
Fix ICE `#90993`: add missing call to cancel Fix #90993
2021-11-20Do not mention associated items when they introduce an obligationEsteban Kuber-5/+0
2021-11-20Fix float ICEthreadexception-0/+26
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2021-11-20Move parser tests to parser/issues subdirectoryBadel2-0/+0
Because the parser directory has already reached the 1000 file limit.
2021-11-20Fix ICE `#90993`: add missing call to cancelBadel2-0/+37
2021-11-20Rollup merge of #91021 - compiler-errors:print_future_output, r=estebankMatthias Krüger-2/+2
Elaborate `Future::Output` when printing opaque `impl Future` type I would love to see the `Output =` type when printing type errors involving opaque `impl Future`. [Test code](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a800b481edd31575fbcaf5771a9c3678) Before (cut relevant part of output): ``` note: while checking the return type of the `async fn` --> /home/michael/test.rs:5:19 | 5 | async fn bar() -> usize { | ^^^^^ checked the `Output` of this `async fn`, found opaque type = note: expected type `usize` found opaque type `impl Future` ``` After: ``` note: while checking the return type of the `async fn` --> /home/michael/test.rs:5:19 | 5 | async fn bar() -> usize { | ^^^^^ checked the `Output` of this `async fn`, found opaque type = note: expected type `usize` found opaque type `impl Future<Output = usize>` ``` Note the "found opaque type `impl Future<Output = usize>`" in the new output. ---- Questions: 1. We skip printing the output type when it's a projection, since I have been seeing some types like `impl Future<Output = <[static generator@/home/michael/test.rs:2:11: 2:21] as Generator<ResumeTy>>::Return>` which are not particularly helpful and leak implementation detail. * Am I able to normalize this type within `rustc_middle::ty::print::pretty`? Alternatively, can we normalize it when creating the diagnostic? Otherwise, I'm fine with skipping it and falling back to the old output. * Should I suppress any other types? I didn't encounter anything other than this generator projection type. 2. Not sure what the formatting of this should be. Do I include spaces in `Output = `?
2021-11-18Print output ty for opaque future tyMichael Goulet-2/+2
2021-11-18Move some tests to more reasonable directoriesCaio-0/+87
2021-11-16Remove debug output from test stderr5225225-1/+0
2021-11-16Suggest removing the non-printing characters5225225-8/+8
2021-11-16Print full char literal on error if any are non-printing5225225-0/+27