summary refs log tree commit diff
path: root/compiler/rustc_hir_pretty/src
AgeCommit message (Collapse)AuthorLines
2022-12-06Remove outdated syntax from trait alias pretty printingMaybe Waffle-12/+1
2022-12-03Rollup merge of #104199 - SarthakSingh31:issue-97417-1, r=cjgillotMatthias Krüger-0/+1
Keep track of the start of the argument block of a closure This removes a call to `tcx.sess.source_map()` from [compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs](https://github.com/rust-lang/rust/compare/master...SarthakSingh31:issue-97417-1?expand=1#diff-8406bbc0d0b43d84c91b1933305df896ecdba0d1f9269e6744f13d87a2ab268a) as required by #97417. VsCode automatically applied `rustfmt` to the files I edited under `src/tools`. I can undo that if its a problem. r? `@cjgillot`
2022-12-01rustc_hir: Change representation of import paths to support multiple resolutionsVadim Petrochenkov-1/+1
2022-11-28Keep track of the start of the argument block of a closureSarthak Singh-0/+1
2022-11-27Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errorsbors-1/+1
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
2022-11-23Add `Mutability::{is_mut,is_not}`Maybe Waffle-2/+2
2022-11-23Separate lifetime ident from resolution in HIR.Camille GILLOT-1/+1
2022-11-13Store a LocalDefId in hir::Variant & hir::Field.Camille GILLOT-1/+1
2022-11-13Store LocalDefId in hir::Closure.Camille GILLOT-0/+1
2022-10-15pretty: fix to print some lifetimes on HIR pretty-printYutaro Ohno-1/+5
2022-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-1/+1
2022-09-08Introduce `DotDotPos`.Nicholas Nethercote-2/+3
This shrinks `hir::Pat` from 88 to 72 bytes.
2022-09-06Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillotbors-15/+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-05Auto merge of #101261 - TaKO8Ki:separate-receiver-from-arguments-in-hir, ↵bors-7/+12
r=cjgillot Separate the receiver from arguments in HIR Related to #100232 cc `@cjgillot`
2022-09-05separate the receiver from arguments in HIRTakayuki Maeda-7/+12
2022-09-05Remove dead code from `print_generic_args`.Nicholas Nethercote-27/+7
2022-09-02Refactor and re-use BindingAnnotationCameron Steffen-15/+9
2022-08-18Add diagnostic translation lints to crates that don't emit them5225225-0/+2
2022-08-16Rename some things related to literals.Nicholas Nethercote-1/+1
- Rename `ast::Lit::token` as `ast::Lit::token_lit`, because its type is `token::Lit`, which is not a token. (This has been confusing me for a long time.) reasonable because we have an `ast::token::Lit` inside an `ast::Lit`. - Rename `LitKind::{from,to}_lit_token` as `LitKind::{from,to}_token_lit`, to match the above change and `token::Lit`.
2022-08-15Auto merge of #96745 - ehuss:even-more-attribute-validation, r=cjgillotbors-28/+32
Visit attributes in more places. This adds 3 loosely related changes (I can split PRs if desired): - Attribute checking on pattern struct fields. - Attribute checking on struct expression fields. - Lint level visiting on pattern struct fields, struct expression fields, and generic parameters. There are still some lints which ignore lint levels in various positions. This is a consequence of how the lints themselves are implemented. For example, lint levels on associated consts don't work with `unused_braces`.
2022-08-11Check attributes on struct expression fields.Eric Huss-14/+16
Attributes on struct expression fields were not being checked for validity. This adds the fields as HIR nodes so that `CheckAttrVisitor` can visit those nodes to check their attributes.
2022-08-11Check attributes on pattern fields.Eric Huss-14/+16
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-08-12Fix HIR pretty printing of let elseMichael Goulet-0/+4
2022-07-17use rustc_hir_pretty::qpath_to_string to avoid span_to_snippet when ↵Michael Goulet-0/+4
rendering path
2022-07-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-3/+41
Implement `for<>` lifetime binder for closures This PR implements RFC 3216 ([TI](https://github.com/rust-lang/rust/issues/97362)) and allows code like the following: ```rust let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) }; // ^^^^^^^^^^^--- new! ``` cc ``@Aaron1011`` ``@cjgillot``
2022-07-12Add an indirection for closures in `hir::ExprKind`Maybe Waffle-3/+3
This helps bring `hir::Expr` size down, `Closure` was the biggest variant, especially after `for<>` additions.
2022-07-12Lower closure binders to hir & properly check themMaybe Waffle-1/+39
2022-07-11move else block into the `Local` structDing Xiang Fei-3/+3
2022-07-11lower let-else in MIR insteadDing Xiang Fei-5/+17
2022-07-03clean up the borrowing in rustc_hir_prettyKaDiWa-281/+264
a lot of the `&`s and `ref`s were redundant
2022-07-01Factor out hir::Node::BindingCameron Steffen-1/+1
2022-06-21Use CreateParameter mode for closures too.Camille GILLOT-0/+2
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-3/+11
2022-06-04Compute lifetimes in scope at diagnostic time.Camille GILLOT-15/+20
2022-05-09use hir::Let in hir::GuardSparrowLii-7/+2
2022-04-30Store all generic bounds as where predicates.Camille GILLOT-14/+1
2022-04-30Inline WhereClause into Generics.Camille GILLOT-17/+13
2022-04-30Box HIR Generics and Impl.Camille GILLOT-4/+4
2022-04-23Stop pretty-printing HIR visibility.Camille GILLOT-79/+27
2022-04-23Stop visiting visibility.Camille GILLOT-1/+0
2022-04-14Reimplement lowering of sym operands for asm! so that it also works with ↵Amanieu d'Antras-3/+8
global_asm!
2022-02-24resolve: Fix incorrect results of `opt_def_kind` query for some built-in macrosVadim Petrochenkov-1/+1
Previously it always returned `MacroKind::Bang` while some of those macros are actually attributes and derives
2022-02-09Rollup merge of #93746 - cjgillot:nodefii, r=nikomatsakisYuki Okushi-1/+0
Remove defaultness from ImplItem. This information is not really used anywhere, except HIR pretty-printing. This makes ImplItem and TraitItem more similar.
2022-02-03Change pp indent to signed to allow negative indentsDavid Tolnay-1/+1
2022-02-03Remove defaultness from ImplItem.Camille GILLOT-1/+0
2022-01-27try apply `rustc_pass_by_value` to `Span`lcnr-1/+1
2022-01-21Remove a span from hir::ExprKind::MethodCallCameron Steffen-1/+1
2022-01-17Use Term in ProjectionPredicatekadmin-7/+6
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 eq constraints on associated constantskadmin-0/+4
2022-01-17Auto merge of #92816 - tmiasko:rm-llvm-asm, r=Amanieubors-61/+0
Remove deprecated LLVM-style inline assembly The `llvm_asm!` was deprecated back in #87590 1.56.0, with intention to remove it once `asm!` was stabilized, which already happened in #91728 1.59.0. Now it is time to remove `llvm_asm!` to avoid continued maintenance cost. Closes #70173. Closes #92794. Closes #87612. Closes #82065. cc `@rust-lang/wg-inline-asm` r? `@Amanieu`