about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/generics.rs
AgeCommit message (Collapse)AuthorLines
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-1/+1
2022-04-30Save colon span to suggest bounds.Camille GILLOT-4/+9
2022-03-25diagnostics: correct generic bounds with doubled colonMichael Howell-0/+1
Fixes #95208
2022-03-23replace `this.clone()` with `this.create_snapshot_for_diagnostic()`Takayuki Maeda-2/+2
2022-02-23rustc_errors: take `self` by value in `DiagnosticBuilder::cancel`.Eduard-Mihai Burtescu-1/+1
2022-02-03compiler: clippy::complexity fixesMatthias Krüger-1/+1
useless_format map_flatten useless_conversion needless_bool filter_next clone_on_copy needless_option_as_deref
2022-02-02better suggestion for duplicated `where`Michael Goulet-2/+16
2021-12-10remove feature gate and cleanup codeEllen-14/+3
2021-12-05Rollup merge of #90022 - hkmatsumoto:self-upper-as-generic-parameter, r=jackh726Matthias Krüger-0/+13
Explain why `Self` is invalid in generic parameters Close #89985. r? `@estebank`
2021-11-24Account for incorrect `impl Foo<const N: ty> {}` syntaxEsteban Küber-1/+4
Fix #84946
2021-10-19Explain why `Self` is invalid in generic parametersHirochika Matsumoto-0/+13
2021-02-13Require passing an `AttrWrapper` to `collect_tokens_trailing_token`Aaron Hill-59/+80
This is a pure refactoring split out from #80689. It represents the most invasive part of that PR, requiring changes in every caller of `parse_outer_attributes` In order to eagerly expand `#[cfg]` attributes while preserving the original `TokenStream`, we need to know the range of tokens that corresponds to every attribute target. This is accomplished by making `parse_outer_attributes` return an opaque `AttrWrapper` struct. An `AttrWrapper` must be converted to a plain `AttrVec` by passing it to `collect_tokens_trailing_token`. This makes it difficult to accidentally construct an AST node with attributes without calling `collect_tokens_trailing_token`, since AST nodes store an `AttrVec`, not an `AttrWrapper`. As a result, we now call `collect_tokens_trailing_token` for attribute targets which only support inert attributes, such as generic arguments and struct fields. Currently, the constructed `LazyTokenStream` is simply discarded. Future PRs will record the token range corresponding to the attribute target, allowing those tokens to be removed from an enclosing `collect_tokens_trailing_token` call if necessary.
2021-01-01make `const_generics_defaults` use the unstable syntax mechanismRémy Rakic-3/+14
This is important to not accidentally stabilize the parsing of the syntax while it still is experimental and not formally accepted
2021-01-01first pass at default values for const genericsJulian Knodt-1/+4
- 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-26stabilize min_const_genericsBastian Kauschke-3/+1
2020-12-03Gracefully handle confusing -> with : in function return typemibac138-1/+1
2020-08-30mv compiler to compiler/mark-0/+292