about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src
AgeCommit message (Collapse)AuthorLines
2022-08-04Explicitly gather lifetimes and definitions for bare async fnsSantiago Pastorino-39/+30
2022-08-04Extract create_and_capture_lifetime_defs functionSantiago Pastorino-74/+81
2022-08-04Remove NEW_COLLECT_LIFETIMES env varSantiago Pastorino-104/+82
2022-08-04Add debug! callsSantiago Pastorino-0/+5
2022-08-04Explicitly gather lifetimes and definitions in RPITSantiago Pastorino-41/+147
2022-08-04Unroll while_capturing_lifetimes into lower_opaque_impl_traitSantiago Pastorino-5/+15
2022-08-04Add captures flag to capture or not while loweringSantiago Pastorino-111/+211
2022-08-04Make lower_generic_bound_predicate receive AST bounds instead of HIR boundsSantiago Pastorino-5/+9
2022-08-04Remove old docs on lower_async_fn_ret_tySantiago Pastorino-2/+0
2022-08-01Store associated item defaultness in impl_defaultness.Camille GILLOT-22/+20
2022-07-26Replace LifetimeRes::Anonymous by LifetimeRes::Infer.Camille GILLOT-19/+1
2022-07-26Remove the distinction between LifetimeName::Implicit and ↵Camille GILLOT-6/+2
LifetimeName::Underscore.
2022-07-25Auto merge of #97313 - cjgillot:ast-lifetimes-anon, r=petrochenkovbors-1/+0
Resolve function lifetime elision on the AST ~Based on https://github.com/rust-lang/rust/pull/97720~ Lifetime elision for functions is purely syntactic in nature, so can be resolved on the AST. This PR replicates the elision logic and diagnostics on the AST, and replaces HIR-based resolution by a `delay_span_bug`. This refactor allows for more consistent diagnostics, which don't have to guess the original code from HIR. r? `@petrochenkov`
2022-07-25Report elision failures on the AST.Camille GILLOT-1/+0
2022-07-20Remove unused StableMap and StableSet types from rustc_data_structuresMichael Woerister-2/+1
2022-07-19Rollup merge of #99401 - TaKO8Ki:avoid-symbol-to-&str-conversions, r=nnethercoteMatthias Krüger-2/+2
Avoid `Symbol` to `&str` conversions `Symbol::as_str` is a slowish operation, so this patch removes some usages of it.
2022-07-18avoid `Symbol` to `&str` conversionsTakayuki Maeda-2/+2
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-15Correctly handle path stability for 'use tree' itemsAaron Hill-2/+20
PR #5956 started checking the stability of path segments. However, this was not applied to 'use tree' items (e.g. 'use some::path::{ItemOne, ItemTwo}') due to the way that we desugar these items in HIR lowering. This PR modifies 'use tree' lowering to preserve resolution information, which is needed by stability checking.
2022-07-14Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPCbors-15/+56
Rollup of 5 pull requests Successful merges: - #97720 (Always create elided lifetime parameters for functions) - #98315 (Stabilize `core::ffi:c_*` and rexport in `std::ffi`) - #98705 (Implement `for<>` lifetime binder for closures) - #99126 (remove allow(rustc::potential_query_instability) in rustc_span) - #99139 (Give a better error when `x dist` fails for an optional tool) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-15/+56
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-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-2/+2
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-12Add an indirection for closures in `hir::ExprKind`Maybe Waffle-14/+21
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-19/+29
2022-07-12Parse closure bindersMaybe Waffle-0/+24
This is first step in implementing RFC 3216. - Parse `for<'a>` before closures in ast - Error in lowering - Add `closure_lifetime_binder` feature
2022-07-11extract method to read scrutinee conditionallyDing Xiang Fei-16/+2
2022-07-11move else block into the `Local` structDing Xiang Fei-6/+28
2022-07-11lower let-else in MIR insteadDing Xiang Fei-74/+23
2022-07-11Auto merge of #98637 - cjgillot:bare-trait-anon-lt, r=petrochenkovbors-0/+27
Create fresh lifetime parameters for bare fn trait too The current code fails to account for the equivalence between `dyn FnMut(&mut u8)` and bare `FnMut(&mut u8)`, and treated them differently. This PR introduces a special case for `Fn` traits, which are always fully resolved. Fixes #98616 Fixes #98726 This will require a beta-backport, as beta contains that bug. r? `@petrochenkov`
2022-07-07Auto merge of #95573 - cjgillot:lower-query, r=michaelwoeristerbors-166/+150
Make lowering a query Split from https://github.com/rust-lang/rust/pull/88186. This PR refactors the relationship between lowering and the resolver outputs in order to make lowering itself a query. In a first part, lowering is changed to avoid modifying resolver outputs, by maintaining its own data structures for creating new `NodeId`s and so. Then, the `TyCtxt` is modified to allow creating new `LocalDefId`s from inside it. This is done by: - enclosing `Definitions` in a lock, so as to allow modification; - creating a query `register_def` whose purpose is to declare a `LocalDefId` to the query system. See `TyCtxt::create_def` and `TyCtxt::iter_local_def_id` for more detailed explanations of the design.
2022-07-07Auto merge of #98827 - aDotInTheVoid:suggest-extern-block, r=nagisabors-2/+2
Suggest using block for `extern "abi" fn` with no body `@rustbot` modify labels: +A-diagnostics
2022-07-06Use DefIdTree instead of re-implementing it.Camille GILLOT-7/+2
2022-07-06Remove `sess` field from LoweringContext.Camille GILLOT-57/+69
2022-07-06Expand comment in `with_hir_id_owner`.Camille GILLOT-2/+9
2022-07-06Do not create a new NodeId when not used.Camille GILLOT-2/+6
2022-07-06Remove useless branch.Camille GILLOT-7/+3
2022-07-06Make AST lowering a query.Camille GILLOT-96/+66
2022-07-02ast: Add span to `Extern`Nixon Enraght-Moony-2/+2
2022-07-02Handle fresh lifetimes on bare trait objects.Camille GILLOT-0/+27
2022-07-01Factor out hir::Node::BindingCameron Steffen-3/+1
2022-06-21Use CreateParameter mode for closures too.Camille GILLOT-23/+34
2022-06-21Always create parameters for functions-like types.Camille GILLOT-47/+64
2022-06-19Leave the responsibility to create `Fresh` lifetimes to lowering.Camille GILLOT-6/+20
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-239/+273
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-16Rollup merge of #98119 - EdwinRy:path-parenthesized-type-error, r=estebankYuki Okushi-19/+26
Refactor path segment parameter error This PR attempts to rewrite the error handling for an unexpected parenthesised type parameters to: - Use provided data instead of re-parsing the whole span - Add a multipart suggestion to reflect on the changes with an underline - Remove the unnecessary "if" nesting
2022-06-15Consume resolutions for lowering separately.Camille GILLOT-24/+18
2022-06-15Update next_node_id.Camille GILLOT-7/+4
2022-06-15Rollup merge of #98110 - cjgillot:closure-brace, r=Aaron1011Yuki Okushi-20/+20
Make `ExprKind::Closure` a struct variant. Simple refactor since we both need it to introduce additional fields in `ExprKind::Closure`. r? ``@Aaron1011``
2022-06-15Refactor path segment parameter errorEdwinRy-19/+26
2022-06-15rename function and remove return typeEdwinRy-2/+2