about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src
AgeCommit message (Collapse)AuthorLines
2022-02-25Auto merge of #94290 - Mark-Simulacrum:bump-bootstrap, r=pietroalbinibors-1/+1
Bump bootstrap to 1.60 This bumps the bootstrap compiler to 1.60 and cleans up cfgs and Span's rustc_pass_by_value (enabled by the bootstrap bump).
2022-02-25Switch bootstrap cfgsMark Rousskov-1/+1
2022-02-24Remove in-band lifetimesMichael Goulet-45/+12
2022-02-24resolve: Fix incorrect results of `opt_def_kind` query for some built-in macrosVadim Petrochenkov-3/+5
Previously it always returned `MacroKind::Bang` while some of those macros are actually attributes and derives
2022-02-24Auto merge of #93438 - spastorino:node_id_to_hir_id_refactor, r=oli-obkbors-59/+61
Node id to hir id refactor Related to #89278 r? `@oli-obk`
2022-02-22local_id is always != 0 at this pointSantiago Pastorino-11/+10
2022-02-21Take CodegenFnAttrs into account when validating asm! register operandsAmanieu d'Antras-21/+7
Checking of asm! register operands now properly takes function attributes such as #[target_feature] and #[instruction_set] into account.
2022-02-21On ARM, use relocation_model to detect whether r9 should be reservedAmanieu d'Antras-0/+2
The previous approach of checking for the reserve-r9 target feature didn't actually work because LLVM only sets this feature very late when initializing the per-function subtarget.
2022-02-20Move trait_map to Lowering ContextSantiago Pastorino-11/+10
2022-02-20Move local_id_to_def_id to Lowering ContextSantiago Pastorino-29/+29
2022-02-20Avoid call to lower_node_id when not neededSantiago Pastorino-1/+1
2022-02-20Make node_id_to_hir_id owner-local.Camille GILLOT-36/+40
2022-02-20Rollup merge of #94146 - est31:let_else, r=cjgillotMatthias Krüger-9/+6
Adopt let else in more places Continuation of #89933, #91018, #91481, #93046, #93590, #94011. I have extended my clippy lint to also recognize tuple passing and match statements. The diff caused by fixing it is way above 1 thousand lines. Thus, I split it up into multiple pull requests to make reviewing easier. This is the biggest of these PRs and handles the changes outside of rustdoc, rustc_typeck, rustc_const_eval, rustc_trait_selection, which were handled in PRs #94139, #94142, #94143, #94144.
2022-02-19Adopt let else in more placesest31-9/+6
2022-02-18Rollup merge of #93877 - Amanieu:asm_fixes, r=nagisaMatthias Krüger-5/+6
asm: Allow the use of r8-r14 as clobbers on Thumb1 Previously these were entirely disallowed, except for r11 which was allowed by accident. cc `@hudson-ayers`
2022-02-18Rollup merge of #92806 - compiler-errors:better-impl-trait-deny, r=estebankMatthias Krüger-90/+240
Add more information to `impl Trait` error Fixes #92458 Let me know if I went overboard here, or if the suggestions could use some refinement. r? `@estebank` Feel free to reassign to someone else
2022-02-18asm: Allow the use of r8-r14 as clobbers on Thumb1Amanieu d'Antras-5/+6
Previously these were entirely disallowed, except for r11 which was allowed by accident.
2022-02-17fix impl trait message, bless testsMichael Goulet-4/+3
2022-02-17Add more information to `impl Trait` deny errorMichael Goulet-90/+241
2022-02-17Revert "Auto merge of #91403 - cjgillot:inherit-async, r=oli-obk"Oli Scherer-19/+50
This reverts commit 3cfa4def7c87d571bd46d92fed608edf8fad236e, reversing changes made to 5d8767cb229b097fedb1dd4bd9420d463c37774f.
2022-02-12Auto merge of #91403 - cjgillot:inherit-async, r=oli-obkbors-50/+19
Inherit lifetimes for async fn instead of duplicating them. The current desugaring of `async fn foo<'a>(&usize) -> &u8` is equivalent to ```rust fn foo<'a, '0>(&'0 usize) -> foo<'static, 'static>::Opaque<'a, '0, '_>; type foo<'_a, '_0>::Opaque<'a, '0, '1> = impl Future<Output = &'1 u8>; ``` following the RPIT model. Duplicating all the inherited lifetime parameters and setting the inherited version to `'static` makes lowering more complex and causes issues like #61949. This PR removes the duplication of inherited lifetimes to directly use ```rust fn foo<'a, '0>(&'0 usize) -> foo<'a, '0>::Opaque<'_>; type foo<'a, '0>::Opaque<'1> = impl Future<Output = &'1 u8>; ``` following the TAIT model. Fixes https://github.com/rust-lang/rust/issues/61949
2022-02-12Inherit lifetimes for async fn instead of duplicating them.Camille GILLOT-50/+19
2022-02-10Fix incorrect register conflict detection in asm!Amanieu d'Antras-1/+3
This would previously incorrectly reject two subregisters that were distinct but part of the same larger register, for example `al` and `ah`.
2022-02-09Rollup merge of #93746 - cjgillot:nodefii, r=nikomatsakisYuki Okushi-4/+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-03Remove defaultness from ImplItem.Camille GILLOT-4/+0
2022-02-02More let_else adoptionsest31-3/+2
2022-02-01add a rustc::query_stability lintlcnr-0/+1
2022-01-27Store def_id_to_hir_id as variant in hir_owner.Camille GILLOT-24/+22
If hir_owner is Owner(_), the LocalDefId is pointing to an owner, so the ItemLocalId is 0. If the HIR node does not exist, we store Phantom. Otherwise, we store the HirId associated to the LocalDefId.
2022-01-26Filter out local_id == 0, those are already considered on the call siteSantiago Pastorino-2/+6
2022-01-25Store hir_id_to_def_id in OwnerInfo.Camille GILLOT-1/+17
2022-01-23Rollup merge of #93103 - estebank:await-span, r=nagisaMatthias Krüger-10/+10
Tweak `expr.await` desugaring `Span` Fix #93074
2022-01-21Remove a span from hir::ExprKind::MethodCallCameron Steffen-6/+1
2022-01-20Tweak `expr.await` desugaring `Span`Esteban Kuber-10/+10
Fix #93074
2022-01-18Formally implement let chainsCaio-6/+12
2022-01-18Auto merge of #92731 - bjorn3:asm_support_changes, r=nagisabors-3/+3
Avoid unnecessary monomorphization of inline asm related functions This should reduce build time for codegen backends by avoiding duplicated monomorphization of certain inline asm related functions for each passed in closure type.
2022-01-18Auto merge of #87648 - JulianKnodt:const_eq_constrain, r=oli-obkbors-6/+10
allow eq constraints on associated constants Updates #70256 (cc `@varkor,` `@Centril)`
2022-01-17Use Term in ProjectionPredicatekadmin-6/+9
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 termkadmin-6/+4
Instead of having a separate enum variant for types and consts have one but have either a const or type.
2022-01-17add eq constraints on associated constantskadmin-3/+6
2022-01-17Pass target_features set instead of has_feature closurebjorn3-2/+2
This avoids unnecessary monomorphizations in codegen backends
2022-01-17Use Symbol for target features in asm handlingbjorn3-3/+3
This saves a couple of Symbol::intern calls
2022-01-17Auto merge of #90986 - camsteffen:nested-filter, r=cjgillotbors-13/+1
Replace `NestedVisitorMap` with generic `NestedFilter` This is an attempt to make the `intravisit::Visitor` API simpler and "more const" with regard to nested visiting. With this change, `intravisit::Visitor` does not visit nested things by default, unless you specify `type NestedFilter = nested_filter::OnlyBodies` (or `All`). `nested_visit_map` returns `Self::Map` instead of `NestedVisitorMap<Self::Map>`. It panics by default (unreachable if `type NestedFilter` is omitted). One somewhat trixty thing here is that `nested_filter::{OnlyBodies, All}` live in `rustc_middle` so that they may have `type Map = map::Map` and so that `impl Visitor`s never need to specify `type Map` - it has a default of `Self::NestedFilter::Map`.
2022-01-17Auto merge of #92816 - tmiasko:rm-llvm-asm, r=Amanieubors-33/+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`
2022-01-16Replace NestedVisitorMap with NestedFilterCameron Steffen-13/+1
2022-01-15Auto merge of #92441 - cjgillot:resolve-trait-impl-item, r=matthewjasperbors-1/+3
Link impl items to corresponding trait items in late resolver. Hygienically linking trait impl items to declarations in the trait can be done directly by the late resolver. In fact, it is already done to diagnose unknown items. This PR uses this resolution work and stores the `DefId` of the trait item in the HIR. This avoids having to do this resolution manually later. r? `@matthewjasper` Related to #90639. The added `trait_item_id` field can be moved to `ImplItemRef` to be used directly by your PR.
2022-01-12Remove deprecated LLVM-style inline assemblyTomasz Miąsko-33/+0
2022-01-10Use pre-interned symbols in a couple of placesbjorn3-6/+8
2022-01-08Link impl items to corresponding trait items in late resolver.Camille GILLOT-1/+3
2022-01-04Rollup merge of #91907 - lcnr:const-arg-infer, r=BoxyUwUMatthias Krüger-2/+23
Allow `_` as the length of array types and repeat expressions r? `@BoxyUwU` cc `@varkor`
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.