about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src
AgeCommit message (Collapse)AuthorLines
2023-07-19add comment for lower_use_treeSparrowLii-0/+3
Signed-off-by: SparrowLii <liyuan179@huawei.com>
2023-07-19avoid clone path prefix when lowering to hirSparrowLii-21/+0
Signed-off-by: SparrowLii <liyuan179@huawei.com>
2023-07-17Properly document lifetime_mapping in OpaqueTyMichael Goulet-10/+14
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-3/+4
2023-07-04include `host_effect_index` in `Generics`Deadbeef-8/+5
2023-07-04Add effects during lowering for `~const` boundsDeadbeef-17/+112
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-06-26`hir`: Add `Become` expression kindMaybe Waffle-3/+1
2023-06-19Syntatically accept `become` expressionsMaybe Waffle-0/+6
2023-06-02Separate AnonConst from ConstBlock in HIR.Camille GILLOT-3/+15
2023-05-29Auto merge of #111235 - loongarch-rs:stabilize-asm, r=Amanieubors-0/+1
Stabilize inline asm for LoongArch64 This PR is used to tracking for stabilize `inline asm` for LoongArch64. **Status** - [x] https://github.com/rust-lang/rust/pull/111237 - [x] https://github.com/rust-lang/rust/pull/111332 - [ ] https://github.com/rust-lang/reference/pull/1357 Any others I missed? r? `@Amanieu`
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-18/+28
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-09Limit lifetime of format_args!() with inlined args.Mara Bos-1/+24
2023-05-08asm: Stabilize loongarch64WANG Rui-0/+1
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-04Rollup merge of #110791 - compiler-errors:negative-bounds, r=oli-obkDylan DPC-2/+15
Implement negative bounds for internal testing purposes Implements partial support the `!` negative polarity on trait bounds. This is incomplete, but should allow us to at least be able to play with the feature. Not even gonna consider them as a public-facing feature, but I'm implementing them because would've been nice to have in UI tests, for example in #110671.
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-05-02Implement negative boundsMichael Goulet-2/+15
2023-05-01Rollup merge of #110823 - compiler-errors:tweak-await-span, r=b-naberMatthias Krüger-21/+7
Tweak await span to not contain dot Fixes a discrepancy between method calls and await expressions where the latter are desugared to have a span that *contains* the dot (i.e. `.await`) but method call identifiers don't contain the dot. This leads to weird suggestions suggestions in borrowck -- see linked issue. Fixes #110761 This mostly touches a bunch of tests to tighten their `await` span.
2023-04-28Rollup merge of #110766 - m-ou-se:fmt-rt, r=jyn514Matthias Krüger-9/+9
More core::fmt::rt cleanup. - Removes the `V1` suffix from the `Argument` and `Flag` types. - Moves more of the format_args lang items into the `core::fmt::rt` module. (The only remaining lang item in `core::fmt` is `Arguments` itself, which is a public type.) Part of https://github.com/rust-lang/rust/issues/99012 Follow-up to https://github.com/rust-lang/rust/pull/110616
2023-04-27Make async removal span more resilient to macro expansionsMichael Goulet-11/+3
2023-04-27Tweak await spanMichael Goulet-15/+9
2023-04-26IntoFuture::into_future is no longer unstableMichael Goulet-8/+1
2023-04-24Restructure std::fmt::rt a bit.Mara Bos-1/+1
This moves more of the internal/lang items into the private rt module.
2023-04-24Remove "V1" from ArgumentsV1 and FlagsV1.Mara Bos-9/+9
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-3/+3
2023-04-22Also arena-allocate `ast::MacroDef` to make `Item: Copy`Nilstrieb-1/+2
2023-04-21offset_ofDrMeepster-0/+9
2023-04-20Update comments in format args lowering.Mara Bos-7/+7
These lang items have been moved/renamed.
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-19Rollup merge of #110451 - WaffleLapkin:ensure_return_elem, r=scottmcmMatthias Krüger-13/+12
Minor changes to `IndexVec::ensure_contains_elem` & related methods r? `@scottmcm`
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-17Use `Item::expect_*` and `ImplItem::expect_*` moreMaybe Waffle-6/+4
2023-04-17Make `IndexVec::ensure_contains_elem` return a reference to the elementMaybe Waffle-13/+12
2023-04-17Auto merge of #109588 - Nilstrieb:dropless-expr, r=compiler-errorsbors-30/+25
Alloc `hir::Lit` in an arena to remove the destructor from `Expr` This allows allocating `Expr`s into a dropless arena, which is useful for using length prefixed thing slices in HIR, since these can only be allocated in the dropless arena and not in a typed arena.
2023-04-16Alloc `hir::Lit` in an arena to remove the destructor from `Expr`Nilstrieb-30/+25
This allows allocating `Expr`s into a dropless arena, which is useful for using length prefixed thing slices in HIR, since these can only be allocated in the dropless arena and not in a typed arena. This is something I'm working on.
2023-04-16use matches! macro in more placesMatthias Krüger-4/+1
2023-04-12Rollup merge of #110203 - compiler-errors:rtn-dots, r=eholkMatthias Krüger-31/+17
Remove `..` from return type notation `@nikomatsakis` and I decided that using `..` in the return-type notation syntax is probably overkill. r? `@eholk` since you reviewed the last one Since this is piggybacking now totally off of a pre-existing syntax (parenthesized generics), let me know if you need any explanation of the logic here, since it's a bit more complicated now.
2023-04-10Remove `..` from return type notationMichael Goulet-31/+17
2023-04-10Fix typos in compilerDaniPopes-4/+4
2023-04-04Rename `ast::Static` to `ast::StaticItem` to match `ast::ConstItem`Oli Scherer-1/+1
2023-04-04box a bunch of large typesOli Scherer-4/+4