about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src
AgeCommit message (Collapse)AuthorLines
2022-03-31Record item-likes in ItemLowerer.Camille GILLOT-61/+69
2022-03-31Create a new LoweringContext for each item-like.Camille GILLOT-129/+104
2022-03-31Make lowering pull-based.Camille GILLOT-55/+120
2022-03-31Implement with_parent_item_lifetime_defs on ItemLowerer.Camille GILLOT-70/+62
2022-03-31Move lower_crate outside the LoweringContext.Camille GILLOT-41/+39
2022-03-31Stop emitting lints during lowering.Camille GILLOT-3/+0
2022-03-31Remove mutability in ResolverAstLowering.Camille GILLOT-7/+5
2022-03-31Rollup merge of #95011 - michaelwoerister:awaitee_field, r=tmandryDylan DPC-13/+16
async: Give predictable name to binding generated from .await expressions. This name makes it to debuginfo and allows debuggers to identify such bindings and their captured versions in suspended async fns. This will be useful for async stack traces, as discussed in https://internals.rust-lang.org/t/async-debugging-logical-stack-traces-setting-goals-collecting-examples/15547. I don't know if this needs some discussion by ````@rust-lang/compiler,```` e.g. about the name of the binding (`__awaitee`) or about the fact that this PR introduces a (soft) guarantee about a compiler generated name. Although, regarding the later, I think the same reasoning applies here as it does for debuginfo in general. r? ````@tmandry````
2022-03-30async: Give predictable, reserved name to binding generated from .await ↵Michael Woerister-13/+16
expressions. This name makes it to debuginfo and allows debuggers to identify such bindings and their captured versions in suspended async fns.
2022-03-30Spellchecking some commentsYuri Astrakhan-1/+1
This PR attempts to clean up some minor spelling mistakes in comments
2022-03-17Rollup merge of #94960 - codehorseman:master, r=oli-obkDylan DPC-1/+1
Fix many spelling mistakes Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-16rustc_error: make ErrorReported impossible to constructmark-1/+1
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
2022-03-16resolve the conflict in compiler/rustc_session/src/parse.rscodehorseman-1/+1
Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-15Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuberbors-2/+2
More robust fallback for `use` suggestion Our old way to suggest where to add `use`s would first look for pre-existing `use`s in the relevant crate/module, and if there are *no* uses, it would fallback on trying to use another item as the basis for the suggestion. But this was fragile, as illustrated in issue #87613 This PR instead identifies span of the first token after any inner attributes, and uses *that* as the fallback for the `use` suggestion. Fix #87613
2022-03-13Update comments.Camille GILLOT-9/+5
2022-03-12Identify anonymous lifetimes by their DefId in HIR.Camille GILLOT-67/+102
2022-03-07remove unnecessary `..` patternsTakayuki Maeda-6/+2
2022-03-05Fallback to other where clause if preferred is missingJack Huey-8/+24
2022-03-05Change syntax for TyAlias where clausesJack Huey-9/+34
2022-03-03Adjusted diagnostic output so that if there is no `use` in a item sequence,Felix S. Klock II-1/+1
then we just suggest the first legal position where you could inject a use. To do this, I added `inject_use_span` field to `ModSpans`, and populate it in parser (it is the span of the first token found after inner attributes, if any). Then I rewrote the use-suggestion code to utilize it, and threw out some stuff that is now unnecessary with this in place. (I think the result is easier to understand.) Then I added a test of issue 87613.
2022-03-03Associate multiple with a crate too.Felix S. Klock II-1/+1
2022-03-03refactor: prepare to associate multiple spans with a module.Felix S. Klock II-1/+1
2022-03-01compiler: fix some typoscuishuang-1/+1
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