summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src
AgeCommit message (Collapse)AuthorLines
2022-07-15Handle fresh lifetimes on bare trait objects.Camille GILLOT-0/+27
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
2022-06-14Separate `source_span` and `expn_that_defined` from `Definitions`.Camille GILLOT-50/+17
2022-06-14Do not modify the resolver outputs.Camille GILLOT-75/+83
2022-06-14Make ResolverAstLowering a struct.Camille GILLOT-160/+228
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-2/+2
2022-06-11Address commentsMichael Goulet-4/+0
2022-06-11Handle empty where-clause betterMichael Goulet-4/+8
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-20/+20
2022-06-07Extract lower_generic_and_bounds functionSantiago Pastorino-32/+47
2022-06-07Extract lower_generic_param_kindSantiago Pastorino-12/+19
2022-06-07Instrument important fns in AST loweringSantiago Pastorino-6/+18
2022-06-04Compute lifetimes in scope at diagnostic time.Camille GILLOT-0/+7
2022-06-04Auto merge of #97717 - matthiaskrgr:rollup-lalaii2, r=matthiaskrgrbors-25/+49
Rollup of 5 pull requests Successful merges: - #97446 (Make hir().get_generics and generics_of consistent.) - #97656 (Add a suggestion to replace parentheses with angle brackets on associated trait constraint) - #97692 (Add `#T-types/nominated` zulip notification) - #97696 (Do not ICE when failing to normalize during inlining.) - #97702 (Remove useless LocalDefId in ImplTraitContext::Universal.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-03Auto merge of #97670 - spastorino:simplify-universal-impl-trait-lowering2, ↵bors-1/+2
r=Dylan-DPC Make params be SmallVec as originally was r? `@cjgillot` It was originally a [`SmallVec`](https://github.com/rust-lang/rust/pull/97598/files#diff-0a61b538a3cec072c76fecae4635af6a12ec3256860029ac70549c2aa53ab394L1497), I've mistakenly changed it [here](https://github.com/rust-lang/rust/pull/97598/files#diff-0a61b538a3cec072c76fecae4635af6a12ec3256860029ac70549c2aa53ab394R1377) to a `Vec`
2022-06-04Rollup merge of #97702 - cjgillot:no-universal-did, r=spastorinoMatthias Krüger-17/+11
Remove useless LocalDefId in ImplTraitContext::Universal.
2022-06-04Rollup merge of #97656 - EdwinRy:error_ast_low_type_contraint_parentheses, ↵Matthias Krüger-8/+38
r=cjgillot Add a suggestion to replace parentheses with angle brackets on associated trait constraint This implements a requested suggestion FIXME in [`compiler/rustc_ast_lowering/src/lib.rs` ](https://github.com/rust-lang/rust/blob/9598b4b594c97dff66feb93522e22db500deea07/compiler/rustc_ast_lowering/src/lib.rs#L921) The suggestion asks for the parentheses to either be replaced with angle brackets or removed completely depending on whether there are arguments provided within. ![image](https://user-images.githubusercontent.com/20026256/171770414-ab60bfe2-ae27-44b0-964d-9ffcc32a7475.png) ![image](https://user-images.githubusercontent.com/20026256/171770383-ca8a2766-b3aa-43e3-8ba4-ae18874886ce.png) r? `@oli-obk`
2022-06-03Remove useless LocalDefId in ImplTraitContext::Universal.Camille GILLOT-17/+11
2022-06-03Suggest replace parentheses with angle bracketsEdwinRy-8/+38
2022-06-03Manipulate lifetimes by LocalDefId for region resolution.Camille GILLOT-24/+17
2022-06-03Auto merge of #96296 - cjgillot:remove-label-lt-shadow, r=petrochenkovbors-12/+9
Remove label/lifetime shadowing warnings This PR removes some pre-1.0 shadowing warnings for labels and lifetimes. The current behaviour of the compiler is to warn * labels that shadow unrelated labels in the same function --> removed ```rust 'a: loop {} 'a: loop {} // STOP WARNING ``` * labels that shadow enclosing labels --> kept, but only if shadowing is hygienic ```rust 'a: loop { 'a: loop {} // KEEP WARNING } ``` * labels that shadow lifetime --> removed ```rust fn foo<'a>() { 'a: loop {} // STOP WARNING } ``` * lifetimes that shadow labels --> removed ```rust 'a: loop { let b = Box::new(|x: &i8| *x) as Box<dyn for <'a> Fn(&'a i8) -> i8>; // STOP WARNING } ``` * lifetimes that shadow lifetimes --> kept ```rust fn foo<'a>() { let b = Box::new(|x: &i8| *x) as Box<dyn for <'a> Fn(&'a i8) -> i8>; // KEEP WARNING } ``` Closes https://github.com/rust-lang/rust/issues/31745. ----- From `@petrochenkov` in https://github.com/rust-lang/rust/pull/95781#issuecomment-1105199014 > I think we should remove these silly checks entirely. > They were introduced long time ago in case some new language features appear and require this space. > Now we have another mechanism for such language changes - editions, and if "lifetimes in expressions" or something like that needs to be introduced it could be introduced as an edition change. > However, there was no plans to introduce anything like for years, so it's unlikely that even the edition mechanism will be necessary. r? rust-lang/lang
2022-06-03Do not lower generic lifetime params when AST resolution emitted an error.Camille GILLOT-12/+9
2022-06-02Make params be SmallVec as originally wasSantiago Pastorino-1/+2
2022-06-02Auto merge of #97598 - spastorino:simplify-universal-impl-trait-lowering, ↵bors-267/+194
r=cjgillot Simplify universal impl trait lowering Closes #96644 r? `@cjgillot`
2022-06-01Always assert that impl_trait_def|bounds are empty at startSantiago Pastorino-7/+2
2022-06-01instrument lower_fn_declSantiago Pastorino-9/+1
2022-06-01Split extend + inner chain into to extend callsSantiago Pastorino-8/+5
2022-06-01Add debug_assert commentSantiago Pastorino-0/+1
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
2022-06-01Remove #[rustc_box] attr during loweringest31-3/+6
2022-06-01Add #[rustc_box]est31-1/+13
This commit adds an alternative content boxing syntax, and uses it inside alloc. The usage inside the very performance relevant code in liballoc is the only remaining relevant usage of box syntax in the compiler (outside of tests, which are comparatively easy to port). box syntax was originally designed to be used by all Rust developers. This introduces a replacement syntax more tailored to only being used inside the Rust compiler, and with it, lays the groundwork for eventually removing box syntax.
2022-05-31Fix lower_generics rustdocsSantiago Pastorino-3/+2
2022-05-31Inline lower_generics_mut and remove GenericsCtorSantiago Pastorino-54/+29
2022-05-31Remove ImplTraitContext::reborrowSantiago Pastorino-42/+21
2022-05-31derive Copy, Clone, PartialEq, Eq for ImplTraitContextSantiago Pastorino-1/+1
2022-05-31Move lower_generics definition to item.rsSantiago Pastorino-38/+38
2022-05-31Rename add_implicit_generics to lower_genericsSantiago Pastorino-18/+17
2022-05-31Replace calls to lower_generics with calls to add_implicit_genericsSantiago Pastorino-89/+87
2022-05-31Add itctx: ImplTraitContext arg to add_implicit_genericsSantiago Pastorino-9/+22
2022-05-31Take and restore fields in with_hir_id_owner callsSantiago Pastorino-0/+6
2022-05-31Move defs and bounds from Universal to LoweringContextSantiago Pastorino-87/+60
2022-05-22rustc_parse: Move AST -> TokenStream conversion logic to `rustc_ast`Vadim Petrochenkov-38/+3