about summary refs log tree commit diff
path: root/compiler/rustc_hir_pretty/src
AgeCommit message (Collapse)AuthorLines
2021-08-28Remove obsolete `MacroDef` variant of `OwnerNode`inquisitivecrystal-1/+0
2021-08-28Treat macros as HIR itemsinquisitivecrystal-0/+5
2021-08-15Introduce hir::ExprKind::Let - Take 2Caio-63/+61
2021-08-01Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisabors-2/+2
more clippy::complexity fixes (also a couple of clippy::perf fixes)
2021-07-30Do not discard `?Sized` type params and suggest their removalEsteban Küber-0/+3
2021-07-27Auto merge of #83484 - JulianKnodt:infer, r=oli-obk,lcnrbors-3/+5
Add hir::GenericArg::Infer In order to extend inference to consts, make an Infer type on hir::GenericArg.
2021-07-26Actually infer args in visitorskadmin-1/+1
2021-07-25Introduce OwnerNode::Crate.Camille GILLOT-1/+1
2021-07-25use vec![] macro to create Vector with first item inside instead of pushing ↵Matthias Krüger-2/+2
to an empty vec![] slightly reduces code bloat
2021-07-25Add generic arg inferkadmin-3/+5
2021-06-29Rollup merge of #86358 - klensy:pp-loop, r=Mark-SimulacrumYuki Okushi-1/+0
fix pretty print for `loop`
2021-06-25Auto merge of #86599 - Amanieu:asm_raw, r=nagisabors-0/+3
Add a "raw" option for asm! which ignores format string specifiers This is useful when including raw assembly snippets using `include_str!`.
2021-06-24Add a "raw" option for asm! which ignores format string specifiersAmanieu d'Antras-0/+3
2021-06-23fix pretty print for `loop` in mir and hirklensy-1/+0
2021-06-06Remove some last remants of {push,pop}_unsafe!Smitty-2/+0
These macros have already been removed, but there was still some code handling these macros. That code is now removed.
2021-05-24remove cfg(bootstrap)Pietro Albini-1/+0
2021-05-13Add support for const operands and options to global_asm!Amanieu d'Antras-105/+109
On x86, the default syntax is also switched to Intel to match asm!
2021-04-23Handle pretty printing of `else if let` clausesSmitty-2/+22
Closes #84434. Closes #82329.
2021-04-06Use AnonConst for asm! constantsAmanieu d'Antras-2/+2
2021-03-30Remove hir::CrateItem.Camille GILLOT-1/+1
2021-03-27Remove (lots of) dead codeJoshua Nelson-33/+0
Found with https://github.com/est31/warnalyzer. Dubious changes: - Is anyone else using rustc_apfloat? I feel weird completely deleting x87 support. - Maybe some of the dead code in rustc_data_structures, in case someone wants to use it in the future? - Don't change rustc_serialize I plan to scrap most of the json module in the near future (see https://github.com/rust-lang/compiler-team/issues/418) and fixing the tests needed more work than I expected. TODO: check if any of the comments on the deleted code should be kept.
2021-03-23Add has_default to GenericParamDefKind::Constkadmin-2/+4
This currently creates a field which is always false on GenericParamDefKind for future use when consts are permitted to have defaults Update const_generics:default locations Previously just ignored them, now actually do something about them. Fix using type check instead of value Add parsing This adds all the necessary changes to lower const-generics defaults from parsing. Change P<Expr> to AnonConst This matches the arguments passed to instantiations of const generics, and makes it specific to just anonymous constants. Attempt to fix lowering bugs
2021-03-19stabilize or_patternsmark-1/+1
2021-03-18hir: Preserve used syntax in `TyKind::TraitObject`Vadim Petrochenkov-1/+4
2021-03-16ast/hir: Rename field-related structuresVadim Petrochenkov-2/+2
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.
2021-03-09Use BTreeMap to store attributes.Camille GILLOT-5/+6
2021-03-09Remove hir::Expr::attrs.Camille GILLOT-1/+1
2021-03-09Remove hir::Item::attrs.Camille GILLOT-4/+5
2021-03-09Remove hir::ImplItem::attrs.Camille GILLOT-1/+1
2021-03-09Remove hir::TraitItem::attrs.Camille GILLOT-1/+1
2021-03-09Remove hir::ForeignItem::attrs.Camille GILLOT-1/+1
2021-03-09Remove hir::StructField::attrs.Camille GILLOT-2/+2
2021-03-09Remove hir::Variant::attrs.Camille GILLOT-1/+1
2021-03-09Remove hir::Param::attrs.Camille GILLOT-1/+1
2021-03-09Remove hir::Arm::attrs.Camille GILLOT-5/+17
2021-03-09Remove hir::Crate::attrs.Camille GILLOT-1/+1
2021-02-16Auto merge of #81611 - cjgillot:meowner, r=estebankbors-6/+6
Only store a LocalDefId in some HIR nodes Some HIR nodes are guaranteed to be HIR owners: Item, TraitItem, ImplItem, ForeignItem and MacroDef. As a consequence, we do not need to store the `HirId`'s `local_id`, and we can directly store a `LocalDefId`. This allows to avoid a bit of the dance with `tcx.hir().local_def_id` and `tcx.hir().local_def_id_to_hir_id` mappings.
2021-02-16avoid full-slicing slicesMatthias Krüger-2/+2
If we already have a slice, there is no need to get another full-range slice from that, just use the original. clippy::redundant_slicing
2021-02-15Only store a LocalDefId in hir::ImplItem.Camille GILLOT-2/+2
2021-02-15Only store a LocalDefId in hir::TraitItem.Camille GILLOT-2/+2
2021-02-15Use ItemId as a strongly typed index.Camille GILLOT-2/+2
2021-02-04hir pretty printingb-naber-0/+1
2021-01-21Add loop head span to hirEsteban Küber-1/+1
2021-01-14Auto merge of #79328 - c410-f3r:hir-if, r=matthewjasperbors-1/+54
Reintroduce hir::ExprKind::If Basically copied and paste #59288/https://github.com/rust-lang/rust-clippy/pull/4080 with some modifications. The vast majority of tests were fixed and now there are only a few remaining. Since I am still unable to figure out the missing pieces, any help with the following list is welcome. - [ ] **Unnecessary `typeck` exception**: [Cheated on this one to make CI green.](https://github.com/rust-lang/rust/pull/79328/files#diff-3faee9ba23fc54a12b7c43364ba81f8c5660045c7e1d7989a02a0cee1c5b2051) - [x] **Incorrect span**: [Span should reference `then` and `else` separately.](https://github.com/rust-lang/rust/pull/79328/files#diff-cf2c46e82222ee4b1037a68fff8a1af3c4f1de7a6b3fd798aacbf3c0475abe3d) - [x] **New note regarding `assert!`**: [Modified but not "wrong". Maybe can be a good thing?](https://github.com/rust-lang/rust/pull/79328/files#diff-9e0d7c89ed0224e2b62060c957177c27db43c30dfe3c2974cb6b5091cda9cfb5) - [x] **Inverted report location**: [Modified but not "wrong". Locations were inverted.](https://github.com/rust-lang/rust/pull/79328/files#diff-f637ce7c1f68d523a165aa9651765df05e36c4d7d279194b1a6b28b48a323691) - [x] **`src/test/ui/point-to-type-err-cause-on-impl-trait-return.rs` has weird errors**: [Not sure why this is happening.](https://github.com/rust-lang/rust/pull/79328/files#diff-c823c09660f5b112f95e97e8ff71f1797b6c7f37dbb3d16f8e98bbaea8072e95) - [x] **Missing diagnostic**: [???](https://github.com/rust-lang/rust/pull/79328/files#diff-6b8ab09360d725ba4513933827f9796b42ff9522b0690f80b76de067143af2fc)
2021-01-13Auto merge of #77524 - Patryk27:fixes/66228, r=estebankbors-10/+6
Rework diagnostics for wrong number of generic args (fixes #66228 and #71924) This PR reworks the `wrong number of {} arguments` message, so that it provides more details and contextual hints.
2021-01-12Separate out a `hir::Impl` structJoshua Nelson-2/+2
This makes it possible to pass the `Impl` directly to functions, instead of having to pass each of the many fields one at a time. It also simplifies matches in many cases.
2021-01-10Rework diagnostics for wrong number of generic argsPatryk Wychowaniec-10/+6
2021-01-07Reintroduce hir::ExprKind::IfCaio-1/+54
2021-01-08rustc_ast_pretty: Remove `PrintState::insert_extra_parens`Vadim Petrochenkov-3/+0
It's no longer necessary after #79472
2021-01-02reduce borrowing and (de)referencing around match patterns ↵Matthias Krüger-11/+9
(clippy::match_ref_pats)