kadmin
fb57b7518d
Add term
...
Instead of having a separate enum variant for types and consts have one but have either a const
or type.
2022-01-17 17:20:57 +00:00
kadmin
0765999622
add eq constraints on associated constants
2022-01-17 17:20:57 +00:00
David Tolnay
87a7defa8e
Reject generic arguments on mod style interpolated path
2021-11-25 15:05:07 -08:00
David Tolnay
0cbb00f898
Let qpath contain NtTy: <$:ty as $:ty>::rest
2021-11-25 15:03:59 -08:00
Esteban Küber
7190bc3097
Account for incorrect impl Foo<const N: ty> {}
syntax
...
Fix #84946
2021-11-24 20:02:09 +00:00
Michael Howell
befdfb5c71
Improve error messages for bad type constraints
...
Co-authored-by: Esteban Kuber <esteban@kuber.com.ar>
2021-09-28 13:02:45 -07:00
Michael Howell
d8e9db0dcf
feat(rustc_parse): recover from pre-RFC-2000 const generics syntax
...
Fixes #89013
2021-09-16 15:06:31 -07:00
Fabian Wolff
6a6a605a61
Fix handling of unmatched angle brackets in parser
2021-06-05 00:31:28 +02:00
Ömer Sinan Ağacan
fb631a55c2
Fix turbofish recovery with multiple generic args
...
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-02-27 13:46:49 +03:00
Esteban Küber
2e846d6f61
Point only at generic arguments when they are unexpected
2021-01-26 15:59:43 -08:00
b-naber
728d257839
improve diagnostics for angle args
2021-01-22 17:07:27 +01:00
Patryk Wychowaniec
d2f8e398f1
Rework diagnostics for wrong number of generic args
2021-01-10 13:07:40 +01:00
Julian Knodt
61f33bfd29
first pass at default values for const generics
...
- 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
2021-01-01 10:55:10 +01:00
Matthias Krüger
d12a358673
use matches!() macro in more places
2020-12-24 13:35:12 +01:00
mibac138
3548be94c0
Gracefully handle confusing -> with : in function return type
2020-12-03 18:19:42 +01:00
mibac138
5404deeb64
Gracefully handle mistyping -> as => in function return type
2020-12-01 12:12:48 +01:00
bors
cfed9184f4
Auto merge of #79266 - b-naber:gat_trait_path_parser, r=petrochenkov
...
Generic Associated Types in Trait Paths - Ast part
The Ast part of https://github.com/rust-lang/rust/pull/78978
r? `@petrochenkov`
2020-11-27 00:18:24 +00:00
b-naber
823dbb38e4
ast and parser
2020-11-25 19:55:41 +01:00
varkor
efcbf1b00b
Permit standalone generic parameters as const generic arguments in macros
2020-11-18 13:16:35 +00:00
Joshua Nelson
57c6ed0c07
Fix even more clippy warnings
2020-10-30 10:13:39 -04:00
varkor
ac1454001c
Suggest expressions that look like const generic arguments should be enclosed in brackets
...
Co-Authored-By: Esteban Kuber <github@kuber.com.ar>
2020-10-26 21:54:45 +00:00
Aaron Hill
55082ce413
Attach TokenStream
to ast::Path
2020-09-10 17:33:06 -04:00
mark
9e5f7d5631
mv compiler to compiler/
2020-08-30 18:45:07 +03:00