about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/path.rs
AgeCommit message (Collapse)AuthorLines
2022-02-284 - Make more use of `let_chains`Caio-7/+7
Continuation of #94376. cc #53667
2022-02-25Suggest {} around more bad const generic exprsMichael Goulet-2/+17
2022-02-23rustc_errors: take `self` by value in `DiagnosticBuilder::cancel`.Eduard-Mihai Burtescu-1/+1
2022-01-18Rollup merge of #91150 - dtolnay:qpath, r=davidtwcoMatthias Krüger-10/+34
Let qpath contain NtTy: `<$:ty as $:ty>::…` Example: ```rust macro_rules! m { (<$type:ty as $trait:ty>::$name:ident) => { <$type as $trait>::$name }; } fn main() { let _: m!(<str as ToOwned>::Owned); } ``` Previous behavior: ```console error: expected identifier, found `ToOwned` --> src/main.rs:3:19 | 3 | <$type as $trait>::$name | ^^^^^^ expected identifier ... 8 | let _: m!(<str as ToOwned>::Owned); | --------------------------- | | | this macro call doesn't expand to a type | in this macro invocation ``` The <code>expected identifier, found \`ToOwned\`</code> error is particularly silly. I think it should be fine to accept this code as long as $trait is of the form `TyKind::Path(None, path)`; if it is any other kind of `NtTy`, we'll keep the same behavior as before.
2022-01-17Add term to ExistentialProjectionkadmin-1/+4
Also prevent ICE when adding a const in associated const equality.
2022-01-17Use Term in ProjectionPredicatekadmin-7/+5
ProjectionPredicate should be able to handle both associated types and consts so this adds the first step of that. It mainly just pipes types all the way down, not entirely sure how to handle consts, but hopefully that'll come with time.
2022-01-17Add termkadmin-2/+4
Instead of having a separate enum variant for types and consts have one but have either a const or type.
2022-01-17add eq constraints on associated constantskadmin-20/+17
2021-11-25Reject generic arguments on mod style interpolated pathDavid Tolnay-10/+24
2021-11-25Let qpath contain NtTy: <$:ty as $:ty>::restDavid Tolnay-0/+10
2021-11-24Account for incorrect `impl Foo<const N: ty> {}` syntaxEsteban Küber-39/+49
Fix #84946
2021-09-28Improve error messages for bad type constraintsMichael Howell-11/+20
Co-authored-by: Esteban Kuber <esteban@kuber.com.ar>
2021-09-16feat(rustc_parse): recover from pre-RFC-2000 const generics syntaxMichael Howell-1/+19
Fixes #89013
2021-06-05Fix handling of unmatched angle brackets in parserFabian Wolff-37/+47
2021-02-27Fix turbofish recovery with multiple generic argsÖmer Sinan Ağacan-1/+1
check_mistyped_turbofish_with_multiple_type_params was previously expecting type arguments between angle brackets, which is not right, as we can also see const expressions. We now use generic argument parser instead of type parser. Test with one, two, and three generic arguments added to check consistentcy between 1. check_no_chained_comparison: Called after parsing a nested binop application like `x < A > ...` where angle brackets are interpreted as binary operators and `A` is an expression. 2. check_mistyped_turbofish_with_multiple_type_params: called by `parse_full_stmt` when we expect to see a semicolon after parsing an expression but don't see it. (In `T2<1, 2>::C;`, the expression is `T2 < 1`)
2021-01-26Point only at generic arguments when they are unexpectedEsteban Küber-1/+9
2021-01-22improve diagnostics for angle argsb-naber-44/+11
2021-01-10Rework diagnostics for wrong number of generic argsPatryk Wychowaniec-1/+2
2021-01-01first pass at default values for const genericsJulian Knodt-11/+18
- Adds optional default values to const generic parameters in the AST and HIR - Parses these optional default values - Adds a `const_generics_defaults` feature gate
2020-12-24use matches!() macro in more placesMatthias Krüger-4/+3
2020-12-03Gracefully handle confusing -> with : in function return typemibac138-2/+2
2020-12-01Gracefully handle mistyping -> as => in function return typemibac138-2/+3
2020-11-27Auto merge of #79266 - b-naber:gat_trait_path_parser, r=petrochenkovbors-26/+83
Generic Associated Types in Trait Paths - Ast part The Ast part of https://github.com/rust-lang/rust/pull/78978 r? `@petrochenkov`
2020-11-25ast and parserb-naber-26/+83
2020-11-18Permit standalone generic parameters as const generic arguments in macrosvarkor-0/+8
2020-10-30Fix even more clippy warningsJoshua Nelson-6/+8
2020-10-26Suggest expressions that look like const generic arguments should be ↵varkor-17/+33
enclosed in brackets Co-Authored-By: Esteban Kuber <github@kuber.com.ar>
2020-09-10Attach `TokenStream` to `ast::Path`Aaron Hill-3/+6
2020-08-30mv compiler to compiler/mark-0/+516