summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/path.rs
AgeCommit message (Collapse)AuthorLines
2024-03-08Simplify ImplTraitContextMichael Goulet-1/+1
2024-02-07No need to take ImplTraitContext by refMichael Goulet-8/+8
2024-02-06Rollup merge of #120609 - petrochenkov:nousestem2, r=compiler-errorsMatthias Krüger-0/+1
hir: Stop keeping prefixes for most of `use` list stems And make sure all other imports have non-empty resolution lists. Addresses one of FIXMEs in https://github.com/rust-lang/rust/pull/120206.
2024-02-03hir: Stop keeping prefixes for most of `use` list stemsVadim Petrochenkov-0/+1
And make sure all other imports have non-empty resolution lists.
2024-01-31Error on incorrect item kind in async boundMichael Goulet-9/+20
2024-01-31Add async bound modifier to enable async Fn boundsMichael Goulet-9/+78
2023-12-27Introduce `const Trait` (always-const trait bounds)León Orell Valerian Liehr-2/+2
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-2/+2
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-18Auto merge of #119069 - matthiaskrgr:rollup-xxk4m30, r=matthiaskrgrbors-1/+4
Rollup of 5 pull requests Successful merges: - #118852 (coverage: Skip instrumenting a function if no spans were extracted from MIR) - #118905 ([AIX] Fix XCOFF metadata) - #118967 (Add better ICE messages for some undescriptive panics) - #119051 (Replace `FileAllocationInfo` with `FileEndOfFileInfo`) - #119059 (Deny `~const` trait bounds in inherent impl headers) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-18Rename `Session::span_diagnostic` as `Session::dcx`.Nicholas Nethercote-1/+1
2023-12-15Add better ICE messages for some undescriptive panicsRoss Smyth-1/+4
2023-12-08Support async gen fnMichael Goulet-1/+1
2023-12-04Address code review feedbackEric Holk-3/+3
2023-12-04Lower return types for gen fn to impl IteratorEric Holk-4/+5
2023-12-02Inline and remove `LoweringContext::handler()`.Nicholas Nethercote-1/+1
It has a single call site.
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-3/+3
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-08-06lower impl const to bind to host effect paramDeadbeef-1/+12
2023-05-03Restrict `From<S>` for `{D,Subd}iagnosticMessage`.Nicholas Nethercote-1/+1
Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile.
2023-04-10Remove `..` from return type notationMichael Goulet-13/+0
2023-03-28Add `(..)` syntax for RTNMichael Goulet-5/+25
2023-03-28ParenthesizedGenericArgs::{Ok -> ParenSugar}Michael Goulet-4/+4
2022-12-06Add help for `#![feature(impl_trait_in_fn_trait_return)]`Josh Stone-6/+13
This adds a new variant `ImplTraitContext::FeatureGated`, so we can generalize the help for `return_position_impl_trait_in_trait` to also work for `impl_trait_in_fn_trait_return`.
2022-12-01rustc_hir: Change representation of import paths to support multiple resolutionsVadim Petrochenkov-16/+5
2022-11-24Use kw::Empty for elided lifetimes in path.Camille GILLOT-1/+1
2022-11-22`rustc_ast_lowering`: remove `ref` patternsMaybe Waffle-4/+4
2022-11-17Box `ExprKind::{Closure,MethodCall}`, and `QSelf` in expressions, types, and ↵Nicholas Nethercote-1/+1
patterns.
2022-10-25adopt to compiler changesMaybe Waffle-1/+1
2022-10-25Feature gate `impl_trait_in_fn_trait_return`Maybe Waffle-1/+4
2022-10-25Allow `impl Fn() -> impl Trait` in return positionMaybe Waffle-1/+12
This allows writing the following function signatures: ```rust fn f0() -> impl Fn() -> impl Trait; fn f3() -> &'static dyn Fn() -> impl Trait; ``` These signatures were already allowed for common traits and associated types, there is no reason why `Fn*` traits should be special in this regard.
2022-10-11rustc_hir: Less error-prone methods for accessing `PartialRes` resolutionVadim Petrochenkov-4/+6
2022-09-14Pass ImplTraitContext as &, there's no need for that to be &mutSantiago Pastorino-10/+8
2022-09-06Pass ImplTraitContext as &mut to avoid the need of ↵Santiago Pastorino-8/+10
ImplTraitContext::reborrow later on
2022-09-05Auto merge of #101228 - nnethercote:simplify-hir-PathSegment, r=petrochenkovbors-4/+4
Simplify `hir::PathSegment` r? `@petrochenkov`
2022-09-05Rollup merge of #101142 - nnethercote:improve-hir-stats, r=davidtwcoDylan DPC-1/+1
Improve HIR stats #100398 improve the AST stats collection done by `-Zhir-stats`. This PR does the same for HIR stats collection. r? `@davidtwco`
2022-09-05Make `hir::PathSegment::hir_id` non-optional.Nicholas Nethercote-3/+3
2022-09-05Make `hir::PathSegment::res` non-optional.Nicholas Nethercote-1/+1
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-1/+0
by module
2022-08-29Use `&'hir Ty` everywhere.Nicholas Nethercote-1/+1
For consistency, and because it makes HIR measurement simpler and more accurate.
2022-08-22Migrate ast_lowering::path to SessionDiagnosticJean CASPAR-15/+8
2022-07-06Remove `sess` field from LoweringContext.Camille GILLOT-2/+2
2022-06-21Always create parameters for functions-like types.Camille GILLOT-29/+22
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-0/+1
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-15Refactor path segment parameter errorEdwinRy-19/+26
2022-06-14Make ResolverAstLowering a struct.Camille GILLOT-0/+1
2022-06-07Instrument important fns in AST loweringSantiago Pastorino-1/+1
2022-05-31Remove ImplTraitContext::reborrowSantiago Pastorino-9/+7
2022-05-31Move defs and bounds from Universal to LoweringContextSantiago Pastorino-3/+3
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-5/+5
2022-04-27Create a specific struct for lifetime capture.Camille GILLOT-27/+25
2022-04-27Use LifetimeRes during lowering.Camille GILLOT-91/+85