summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/path.rs
AgeCommit message (Collapse)AuthorLines
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-2/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-10-29Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillotJubilee-1/+1
compiler: apply clippy::clone_on_ref_ptr for CI Apply lint https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_ref_ptr for compiler, also see https://github.com/rust-lang/rust/pull/131225#discussion_r1790109443. Some Arc's can be misplaced with Lrc's, sorry. https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/enable.20more.20clippy.20lints.20for.20compiler.20.28and.5Cor.20std.29
2024-10-28fix clippy::clone_on_ref_ptr for compilerklensy-1/+1
2024-10-27Move an impl-Trait check from AST validation to AST loweringLeón Orell Valerian Liehr-3/+16
2024-10-23nightly feature tracking: get rid of the per-feature bool fieldsRalf Jung-2/+2
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-4/+4
2024-09-20Add missing diagnostics and flesh out testsMichael Goulet-7/+8
2024-09-20Implement RTN in resolve_bound_vars and HIR ty loweringMichael Goulet-3/+2
2024-09-20Conditionally allow lowering RTN (..) in pathsMichael Goulet-4/+62
2024-08-26Rename ParenthesizedGenericArgs to GenericArgsModeMichael Goulet-19/+18
2024-07-29Reformat `use` declarations.Nicholas Nethercote-11/+10
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-23Gate AsyncFn* under async_closure featureMichael Goulet-7/+15
2024-07-03Rollup merge of #127092 - compiler-errors:rtn-dots-redux, r=estebankMatthias Krüger-1/+14
Change return-type-notation to use `(..)` Aligns the syntax with the current wording of [RFC 3654](https://github.com/rust-lang/rfcs/pull/3654). Also implements rustfmt support (along with making a match exhaustive). Tracking: * https://github.com/rust-lang/rust/issues/109417
2024-06-28Make sure we deny unimplemented RTN on qpath segmentsMichael Goulet-3/+13
2024-06-28Change RTN to use .. againMichael Goulet-0/+3
2024-06-28implement new effects desugaringDeadbeef-9/+0
2024-05-30Rename HIR `TypeBinding` to `AssocItemConstraint` and related cleanupLeón Orell Valerian Liehr-14/+17
2024-04-30Remove `extern crate tracing` from numerous crates.Nicholas Nethercote-0/+1
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