summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2023-09-26subst -> instantiatelcnr-1/+1
2023-09-19Auto merge of #113955 - cjgillot:name-apit, r=WaffleLapkinbors-6/+6
Pretty-print argument-position impl trait to name it. This removes a corner case. RPIT and TAIT keep having no name, and it would be wrong to use the one in HIR (Ident::empty), so I make this case ICE.
2023-09-07Enable incremental-relative-spans by default.Camille GILLOT-1/+1
2023-09-02Don't hold the definitions' lock across `index_hir`John Kåre Alsaker-2/+1
2023-08-30Pretty-print impl trait to name it.Camille GILLOT-6/+6
2023-08-30Capture lifetimes for associated type bounds destined to be lowered to opaquesMichael Goulet-0/+11
2023-08-28RPITITs capture all their lifetimesMichael Goulet-22/+31
2023-08-24Auto merge of #115131 - frank-king:feature/unnamed-fields-lite, r=petrochenkovbors-0/+12
Parse unnamed fields and anonymous structs or unions (no-recovery) It is part of #114782 which implements #49804. Only parse anonymous structs or unions in struct field definition positions. r? `@petrochenkov`
2023-08-24Parse unnamed fields and anonymous structs or unionsFrank King-0/+12
Anonymous structs or unions are only allowed in struct field definitions. Co-authored-by: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com>
2023-08-14Remove constness from `ImplSource::Param`Deadbeef-27/+23
2023-08-09rustc: Move `crate_types` from `Session` to `GlobalCtxt`Vadim Petrochenkov-2/+2
Removes a piece of mutable state. Follow up to #114578.
2023-08-08Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obkbors-8/+87
correctly lower `impl const` to bind to host effect param r? `@oli-obk`
2023-08-08Unconditionally record lifetime mappingMichael Goulet-5/+1
2023-08-07Fix ICEDeadbeef-3/+13
2023-08-06lower impl const to bind to host effect paramDeadbeef-8/+77
2023-08-05Consolidate opaque ty and async fn lowering codeMichael Goulet-414/+181
2023-07-21Auto merge of #113847 - SparrowLii:path_clone, r=cjgillotbors-10/+0
avoid clone path prefix when lowering to hir Found this while trying to parallelize `lower_to_hir`. When lowering to hir, `Nested` paths in `ast` will be split and the prefix segments will be cloned. This could be omited, since the only consequence is that the prefix segments in `Path`s in hir will have the same `HirId`s, and it seems harmless. This simplifies the process of lowering to hir and avoids re-modification of `ResolverAstLowering`. r? `@Aaron1011` cc #99292
2023-07-19avoid clone path prefix when lowering to hirSparrowLii-10/+0
Signed-off-by: SparrowLii <liyuan179@huawei.com>
2023-07-17Properly document lifetime_mapping in OpaqueTyMichael Goulet-10/+14
2023-06-29Do not generate lifetime_mapping for RPIT no in_traitSantiago Pastorino-12/+32
2023-06-29Add bidirectional where clauses on RPITIT synthesized GATsSantiago Pastorino-22/+28
2023-06-29Intern OpaqueTy on ItemKind::OpaqueTySantiago Pastorino-1/+1
2023-06-29Reorganize opaque lowering codeSantiago Pastorino-43/+50
2023-05-25Don't print newlines in APITsMichael Goulet-1/+10
2023-05-16Turn debugger_visualizers from feed- into regular query.Michael Woerister-1/+2
2023-05-12Require `impl Trait` in associated types to appear in method signaturesOli Scherer-16/+20
2023-05-09Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillotMatthias Krüger-3/+5
Various changes to name resolution of anon consts Sorry this PR is kind of all over the place ^^' Fixes #111012 - Rewrites anon const nameres to all go through `fn resolve_anon_const` explicitly instead of `visit_anon_const` to ensure that we do not accidentally resolve anon consts as if they are allowed to use generics when they aren't. Also means that we dont have bits of code for resolving anon consts that will get out of sync (i.e. legacy const generics and resolving path consts that were parsed as type arguments) - Renames two of the `LifetimeRibKind`, `AnonConst -> ConcreteAnonConst` and `ConstGeneric -> ConstParamTy` - Noticed while doing this that under `generic_const_exprs` all lifetimes currently get resolved to errors without any error being emitted which was causing a bunch of tests to pass without their bugs having been fixed, incidentally fixed that in this PR and marked those tests as `// known-bug:`. I'm fine to break those since `generic_const_exprs` is a very unstable incomplete feature and this PR _does_ make generic_const_exprs "less broken" as a whole, also I can't be assed to figure out what the underlying causes of all of them are. This PR reopens #77357 #83993 - Changed `generics_of` to stop providing generics and predicates to enum variant discriminant anon consts since those are not allowed to use generic parameters - Updated the error for non 'static lifetime in const arguments and the error for non 'static lifetime in const param tys to use `derive(Diagnostic)` I have a vague idea why const-arg-in-const-arg.rs, in-closure.rs and simple.rs have started failing which is unfortunate since these were deliberately made to work, I think lifetime resolution being broken just means this regressed at some point and nobody noticed because the tests were not testing anything :( I'm fine breaking these too for the same reason as the tests for #77357 #83993. I couldn't get `// known-bug` to work for these ICEs and just kept getting different stderr between CI and local `--bless` so I just removed them and will create an issue to track re-adding (and fixing) the bugs if this PR lands. r? `@cjgillot` cc `@compiler-errors`
2023-05-08Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, ↵bors-2/+4
r=Mark-Simulacrum enable `rust_2018_idioms` lint group for doctests With this change, `rust_2018_idioms` lint group will be enabled for compiler/libstd doctests. Resolves #106086 Resolves #99144 Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-07enable `rust_2018_idioms` for doctestsozkanonur-2/+4
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-05misc nameres changes for anon constsBoxy-3/+5
2023-05-02Implement negative boundsMichael Goulet-2/+15
2023-04-26IntoFuture::into_future is no longer unstableMichael Goulet-1/+0
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-1/+1
2023-04-21offset_ofDrMeepster-0/+2
2023-04-19Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwcobors-1/+1
Add `rustc_fluent_macro` to decouple fluent from `rustc_macros` Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-1/+1
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-17Make `IndexVec::ensure_contains_elem` return a reference to the elementMaybe Waffle-8/+7
2023-04-16use matches! macro in more placesMatthias Krüger-4/+1
2023-04-10Remove `..` from return type notationMichael Goulet-11/+16
2023-04-02Use `&IndexSlice` instead of `&IndexVec` where possibleScott McMurray-2/+2
All the same reasons as for `[T]`: more general, less pointer chasing, and `&mut IndexSlice` emphasizes that it doesn't change *length*.
2023-03-28Add `(..)` syntax for RTNMichael Goulet-30/+55
2023-03-28Add tests and error messagesMichael Goulet-5/+12
2023-03-28RTNMichael Goulet-0/+12
2023-03-28ParenthesizedGenericArgs::{Ok -> ParenSugar}Michael Goulet-1/+1
2023-03-22rustc: Remove unused `Session` argument from some attribute functionsVadim Petrochenkov-1/+1
2023-03-12Auto merge of #108820 - cjgillot:ensure-on-disk, r=oli-obkbors-2/+3
Ensure value is on the on-disk cache before returning from `ensure()`. The current logic for `ensure()` a query just checks that the node is green in the dependency graph. However, a lot of places use `ensure()` to prevent the query from being called later. This is the case before stealing a query result. If the query is actually green but the value is not available in the on-disk cache, `ensure` would return, but a subsequent call to the full query would run the code, and attempt to read from a stolen value. This PR conforms the query system to the usage by checking whether the queried value is loadable from disk before returning. Sadly, I can't manage to craft a proper test... Should fix all instances of "attempted to read from stolen value".
2023-03-12Auto merge of #108794 - nnethercote:avoid-unnecessary-hashing, r=cjgillotbors-31/+24
Avoid unnecessary hashing I noticed some stable hashing being done in a non-incremental build. It turns out that some of this is necessary to compute the crate hash, but some of it is not. Removing the unnecessary hashing is a perf win. r? `@cjgillot`
2023-03-11Use ensure_with_value in a few more places.Camille GILLOT-2/+3
2023-03-11Simplify message pathsest31-1/+1
This makes it easier to open the messages file while developing on features. The commit was the result of automatted changes: for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done
2023-03-11Rollup merge of #108806 - cjgillot:query-lints, r=davidtwcoMatthias Krüger-0/+1
Querify register_tools and post-expansion early lints The 2 extra queries correspond to code that happen before and after macro expansion, and don't need the resolver to exist.