summaryrefslogtreecommitdiff
path: root/compiler/rustc_parse/src/parser/generics.rs
Commit message (Collapse)AuthorAgeFilesLines
* Recover `impl<T ?Sized>` correctlyMichael Goulet2023-05-151-0/+5
|
* Implement negative boundsMichael Goulet2023-05-021-2/+2
|
* Fix static string lintsclubby7892023-04-251-28/+9
|
* Fix some clippy::complexityNilstrieb2023-04-091-1/+1
|
* Use `ThinVec` in various AST types.Nicholas Nethercote2023-02-211-3/+3
| | | | | This commit changes the sequence parsers to produce `ThinVec`, which triggers numerous conversions.
* Use `ThinVec` in `ast::WhereClause`.Nicholas Nethercote2023-02-211-2/+2
|
* Use `ThinVec` in `ast::Generics` and related types.Nicholas Nethercote2023-02-211-3/+4
|
* Recover from default value for a lifetime in generic parameters.Lenko Donchev2023-02-041-1/+16
|
* rustc_parse: migrate more to diagnostic structsXiretza2023-02-011-17/+12
|
* parser: recover from where clauses placed before tuple struct bodiesLeón Orell Valerian Liehr2023-01-111-10/+108
|
* fix #102182, recover from impl Trait in type param boundyukang2022-10-081-2/+34
|
* Use `AttrVec` in more places.Nicholas Nethercote2022-08-221-8/+6
| | | | | | | | | | | | | | | | | | | In some places we use `Vec<Attribute>` and some places we use `ThinVec<Attribute>` (a.k.a. `AttrVec`). This results in various points where we have to convert between `Vec` and `ThinVec`. This commit changes the places that use `Vec<Attribute>` to use `AttrVec`. A lot of this is mechanical and boring, but there are some interesting parts: - It adds a few new methods to `ThinVec`. - It implements `MapInPlace` for `ThinVec`, and introduces a macro to avoid the repetition of this trait for `Vec`, `SmallVec`, and `ThinVec`. Overall, it makes the code a little nicer, and has little effect on performance. But it is a precursor to removing `rustc_data_structures::thin_vec::ThinVec` and replacing it with `thin_vec::ThinVec`, which is implemented more efficiently.
* Remove `{ast,hir}::WhereEqPredicate::id`.Nicholas Nethercote2022-08-161-1/+0
| | | | These fields are unused.
* remove unnecessary `to_string` and `String::new`Takayuki Maeda2022-06-131-1/+1
|
* Remove `crate` visibility usage in compilerJacob Pratt2022-05-201-1/+1
|
* Save colon span to suggest bounds.Camille GILLOT2022-04-301-4/+9
|
* diagnostics: correct generic bounds with doubled colonMichael Howell2022-03-251-0/+1
| | | | Fixes #95208
* replace `this.clone()` with `this.create_snapshot_for_diagnostic()`Takayuki Maeda2022-03-231-2/+2
|
* rustc_errors: take `self` by value in `DiagnosticBuilder::cancel`.Eduard-Mihai Burtescu2022-02-231-1/+1
|
* compiler: clippy::complexity fixesMatthias Krüger2022-02-031-1/+1
| | | | | | | | | | useless_format map_flatten useless_conversion needless_bool filter_next clone_on_copy needless_option_as_deref
* better suggestion for duplicated `where`Michael Goulet2022-02-021-2/+16
|
* remove feature gate and cleanup codeEllen2021-12-101-14/+3
|
* Rollup merge of #90022 - hkmatsumoto:self-upper-as-generic-parameter, r=jackh726Matthias Krüger2021-12-051-0/+13
|\ | | | | | | | | | | | | | | Explain why `Self` is invalid in generic parameters Close #89985. r? `@estebank`
| * Explain why `Self` is invalid in generic parametersHirochika Matsumoto2021-10-191-0/+13
| |
* | Account for incorrect `impl Foo<const N: ty> {}` syntaxEsteban Küber2021-11-241-1/+4
|/ | | | Fix #84946
* Require passing an `AttrWrapper` to `collect_tokens_trailing_token`Aaron Hill2021-02-131-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.
* make `const_generics_defaults` use the unstable syntax mechanismRémy Rakic2021-01-011-3/+14
| | | | This is important to not accidentally stabilize the parsing of the syntax while it still is experimental and not formally accepted
* first pass at default values for const genericsJulian Knodt2021-01-011-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
* stabilize min_const_genericsBastian Kauschke2020-12-261-3/+1
|
* Gracefully handle confusing -> with : in function return typemibac1382020-12-031-1/+1
|
* mv compiler to compiler/mark2020-08-301-0/+292