about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/pat.rs
AgeCommit message (Collapse)AuthorLines
2023-11-29Rollup merge of #118157 - Nadrieril:never_pat-feature-gate, r=compiler-errorsMatthias Krüger-0/+1
Add `never_patterns` feature gate This PR adds the feature gate and most basic parsing for the experimental `never_patterns` feature. See the tracking issue (https://github.com/rust-lang/rust/issues/118155) for details on the experiment. `@scottmcm` has agreed to be my lang-team liaison for this experiment.
2023-11-29Add `never_patterns` feature gateNadrieril-0/+1
2023-11-28Reduce exposure of some things.Nicholas Nethercote-1/+1
2023-08-06lower impl const to bind to host effect paramDeadbeef-0/+3
2023-02-25Add ErrorGuaranteed to HIR ExprKind::ErrMichael Goulet-2/+2
2022-12-25fix more clippy::style findingsMatthias Krüger-3/+3
match_result_ok obfuscated_if_else single_char_add writeln_empty_string collapsible_match iter_cloned_collect unnecessary_mut_passed
2022-11-22`rustc_ast_lowering`: remove `ref` patternsMaybe Waffle-27/+27
2022-11-11Introduce `ExprKind::IncludedBytes`clubby789-1/+4
2022-10-11rustc_hir: Less error-prone methods for accessing `PartialRes` resolutionVadim Petrochenkov-1/+1
2022-09-08Introduce `DotDotPos`.Nicholas Nethercote-2/+2
This shrinks `hir::Pat` from 88 to 72 bytes.
2022-09-06Pass ImplTraitContext as &mut to avoid the need of ↵Santiago Pastorino-3/+3
ImplTraitContext::reborrow later on
2022-09-06Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillotbors-18/+9
`BindingAnnotation` refactor * `ast::BindingMode` is deleted and replaced with `hir::BindingAnnotation` (which is moved to `ast`) * `BindingAnnotation` is changed from an enum to a tuple struct e.g. `BindingAnnotation(ByRef::No, Mutability::Mut)` * Associated constants added for convenience `BindingAnnotation::{NONE, REF, MUT, REF_MUT}` One goal is to make it more clear that `BindingAnnotation` merely represents syntax `ref mut` and not the actual binding mode. This was especially confusing since we had `ast::BindingMode`->`hir::BindingAnnotation`->`thir::BindingMode`. I wish there were more symmetry between `ByRef` and `Mutability` (variant) naming (maybe `Mutable::Yes`?), and I also don't love how long the name `BindingAnnotation` is, but this seems like the best compromise. Ideas welcome.
2022-09-05Address review comments.Nicholas Nethercote-1/+1
2022-09-05Make `hir::PathSegment::hir_id` non-optional.Nicholas Nethercote-1/+2
2022-09-05Make `hir::PathSegment::res` non-optional.Nicholas Nethercote-8/+11
2022-09-02Refactor and re-use BindingAnnotationCameron Steffen-18/+9
2022-08-22Migrate all span_err(...) in ast_lowering to SessionDiagnosticJean CASPAR-3/+4
2022-08-22Migrate ast_lowering::pat to SessionDiagnosticJean CASPAR-24/+9
2022-08-11Check attributes on pattern fields.Eric Huss-6/+11
Attributes on pattern struct fields were not being checked for validity. This adds the fields as HIR nodes so that the `CheckAttrVisitor` can visit those nodes to check their attributes.
2022-06-14Make ResolverAstLowering a struct.Camille GILLOT-2/+2
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-1/+1
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-3/+3
2022-02-17Add more information to `impl Trait` deny errorMichael Goulet-3/+5
2022-01-01Move `PatKind::Lit` checking from ast_validation to ast loweringAaron Hill-3/+34
Fixes #92074 This allows us to insert an `ExprKind::Err` when an invalid expression is used in a literal pattern, preventing later stages of compilation from seeing an unexpected literal pattern.
2021-08-29ast_lowering: Introduce `lower_span` for catching all spans entering HIRVadim Petrochenkov-6/+6
2021-07-15Remove refs from pat slicesCameron Steffen-12/+16
2021-06-10Add support for using qualified paths with structs in expression and patternRyan Levick-4/+4
position.
2021-03-16ast/hir: Rename field-related structuresVadim Petrochenkov-1/+1
StructField -> FieldDef ("field definition") Field -> ExprField ("expression field", not "field expression") FieldPat -> PatField ("pattern field", not "field pattern") Also rename visiting and other methods working on them.
2020-11-07Implement destructuring assignment for tuplesFabian Zaiser-2/+7
Co-authored-by: varkor <github@varkor.com>
2020-10-24Loop instead of recursionDániel Buga-71/+79
2020-08-30mv compiler to compiler/mark-0/+300