about summary refs log tree commit diff
path: root/compiler/rustc_hir/src
AgeCommit message (Collapse)AuthorLines
2021-12-07Store impl_trait_fn inside OpaqueTyOrigin.Camille GILLOT-4/+5
2021-12-04Use IntoIterator for array impl everywhere.Mara Bos-3/+3
2021-12-04Rollup merge of #90519 - estebank:issue-84003, r=petrochenkovMatthias Krüger-8/+15
Keep spans for generics in `#[derive(_)]` desugaring Keep the spans for generics coming from a `derive`d Item, so that errors and suggestions have better detail. Fix #84003.
2021-12-03Auto merge of #90737 - eholk:intofuture, r=tmandrybors-0/+1
Reintroduce `into_future` in `.await` desugaring This is a reintroduction of the remaining parts from https://github.com/rust-lang/rust/pull/65244 that have not been relanded yet. This isn't quite ready to merge yet. The last attempt was reverting due to performance regressions, so we need to make sure this does not introduce those issues again. Issues #67644, #67982 /cc `@yoshuawuyts`
2021-12-03review commentEsteban Kuber-1/+0
2021-12-03Annotate `derive`d spans and move span suggestion codeEsteban Kuber-15/+16
* Annotate `derive`d spans from the user's code with the appropciate context * Add `Span::can_be_used_for_suggestion` to query if the underlying span at the users' code
2021-12-03Modify `bounds_span` to ignore bounds coming from a `derive` macroEsteban Kuber-3/+12
2021-12-03Keep spans for generics in `#[derive(_)]` desugaringEsteban Kuber-3/+1
Keep the spans for generics coming from a `derive`d Item, so that errors and suggestions have better detail. Fix #84003.
2021-12-03Revert "Auto merge of #91354 - fee1-dead:const_env, r=spastorino"Santiago Pastorino-0/+25
This reverts commit 18bb8c61a975fff6424cda831ace5b0404277145, reversing changes made to d9baa361902b172be716f96619b909f340802dea.
2021-12-02Auto merge of #91354 - fee1-dead:const_env, r=spastorinobors-25/+0
Cleanup: Eliminate ConstnessAnd This is almost a behaviour-free change and purely a refactoring. "almost" because we appear to be using the wrong ParamEnv somewhere already, and this is now exposed by failing a test using the unstable `~const` feature. We most definitely need to review all `without_const` and at some point should probably get rid of many of them by using `TraitPredicate` instead of `TraitRef`. This is a continuation of https://github.com/rust-lang/rust/pull/90274. r? `@oli-obk` cc `@spastorino` `@ecstatic-morse`
2021-11-30Merge Implicit and ImplicitMissing.Camille GILLOT-11/+7
2021-11-30Lint elided lifetimes in path during lifetime resolution.Camille GILLOT-0/+6
2021-11-29`ParamEnv` should be const when `ImplItem` is within a const impl.Deadbeef-27/+0
2021-11-29Always use const param envs for const eval.Oli Scherer-0/+1
Nothing else makes sense, and there is no "danger" in doing so, as it only does something if there are const bounds, which are unstable. This used to happen implicitly via the inferctxt before, which was much more fragile.
2021-11-29Static items are also constOli Scherer-0/+1
2021-11-23Add generator lang-itemMichael Goulet-0/+1
2021-11-22Reintroduce `into_future` in `.await` desugaringEric Holk-0/+1
This is a reintroduction of the remaining parts from https://github.com/rust-lang/rust/pull/65244 that have not been relanded yet. Issues GH-67644, GH-67982
2021-11-21Simplify for loop desugarCameron Steffen-2/+11
2021-11-19Rollup merge of #90990 - nnethercote:arenas-cleanup, r=oli-obkYuki Okushi-38/+38
Arenas cleanup I was looking closely at the arenas code and here are some small improvement to readability.
2021-11-19Add some comments.Nicholas Nethercote-1/+1
Also use `Default::default()` in one `TypedArena::default()`, for consistency with `DroplessArena::default()`.
2021-11-18rustc: Remove `#[rustc_synthetic]`Vadim Petrochenkov-11/+1
This function parameter attribute was introduced in https://github.com/rust-lang/rust/pull/44866 as an intermediate step in implementing `impl Trait`, it's not necessary or used anywhere by itself.
2021-11-17Remove unnecessary lifetime argument from arena macros.Nicholas Nethercote-37/+37
Because it's always `'tcx`. In fact, some of them use a mixture of passed-in `$tcx` and hard-coded `'tcx`, so no other lifetime would even work. This makes the code easier to read.
2021-11-16Auto merge of #90919 - nnethercote:rm-DropArena, r=Mark-Simulacrumbors-10/+5
Remove `DropArena`. Most arena-allocate types that impl `Drop` get their own `TypedArena`, but a few infrequently used ones share a `DropArena`. This sharing adds complexity but doesn't help performance or memory usage. Perhaps it was more effective in the past prior to some other improvements to arenas. This commit removes `DropArena` and the sharing of arenas via the `few` attribute of the `arena_types` macro. This change removes over 100 lines of code and nine uses of `unsafe` (one of which affects the parallel compiler) and makes the remaining code easier to read.
2021-11-15refactor is_param_boundTaylor Yu-0/+16
2021-11-15Remove `DropArena`.Nicholas Nethercote-10/+5
Most arena-allocate types that impl `Drop` get their own `TypedArena`, but a few infrequently used ones share a `DropArena`. This sharing adds complexity but doesn't help performance or memory usage. Perhaps it was more effective in the past prior to some other improvements to arenas. This commit removes `DropArena` and the sharing of arenas via the `few` attribute of the `arena_types` macro. This change removes over 100 lines of code and nine uses of `unsafe` (one of which affects the parallel compiler) and makes the remaining code easier to read.
2021-11-07Give inline const separate DefKindGary Guo-1/+6
2021-11-01Auto merge of #90406 - nbdd0121:panic, r=cjgillotbors-2/+2
Collect `panic/panic_bounds_check` during monomorphization This would prevent link time errors if these functions are `#[inline]` (e.g. when `panic_immediate_abort` is used). Fix #90405 Fix rust-lang/cargo#10019 `@rustbot` label: T-compiler A-codegen
2021-10-31Remove `rustc_hir::hir_id::HirIdVec`pierwill-68/+0
2021-10-31Require `panic` and `panic_bounds_check` to be non-genericGary Guo-2/+2
2021-10-21Use SortedMap in HIR.Camille GILLOT-4/+4
2021-10-21Rollup merge of #90071 - cjgillot:no-blocks, r=oli-obkYuki Okushi-0/+35
Remove hir::map::blocks and use FnKind instead The principal tool is `FnLikeNode`, which is not often used and can be easily implemented using `rustc_hir::intravisit::FnKind`.
2021-10-19Replace FnLikeNode by FnKind.Camille GILLOT-0/+35
2021-10-20Rollup merge of #88860 - nbdd0121:panic, r=m-ou-seYuki Okushi-1/+0
Deduplicate panic_fmt std's begin_panic_fmt and core's panic_fmt are duplicates. Merge them to declutter code and remove a lang item.
2021-10-19Deduplicate panic_fmtGary Guo-1/+0
std's begin_panic_fmt and core's panic_fmt are duplicates. Merge them to declutter code and remove a lang item.
2021-10-18Auto merge of #89124 - cjgillot:owner-info, r=michaelwoeristerbors-36/+135
Index and hash HIR as part of lowering Part of https://github.com/rust-lang/rust/pull/88186 ~Based on https://github.com/rust-lang/rust/pull/88880 (see merge commit).~ Once HIR is lowered, it is later indexed by the `index_hir` query and hashed for `crate_hash`. This PR moves those post-processing steps to lowering itself. As a side objective, the HIR crate data structure is refactored as an `IndexVec<LocalDefId, Option<OwnerInfo<'hir>>>` where `OwnerInfo` stores all the relevant information for an HIR owner. r? `@michaelwoerister` cc `@petrochenkov`
2021-10-17rustc_span: `Ident::invalid` -> `Ident::empty`Vadim Petrochenkov-3/+3
The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s.
2021-10-14Document structs.Camille GILLOT-1/+5
2021-10-14Auto merge of #89247 - fee1-dead:const-eval-select, r=oli-obkbors-0/+2
Add `const_eval_select` intrinsic Adds an intrinsic that calls a given function when evaluated at compiler time, but generates a call to another function when called at runtime. See https://github.com/rust-lang/const-eval/issues/7 for previous discussion. r? `@oli-obk.`
2021-10-13Re-use logic for adding a suggestion when a lifetime bound is missing on an ↵Oli Scherer-2/+1
impl trait
2021-10-12Use invalid local id for zeroth node parent.Camille GILLOT-1/+7
2021-10-12Add const_eval_select intrinsicDeadbeef-0/+2
2021-10-11Remove unused function.Camille GILLOT-6/+0
2021-10-11Make naming more explicit.Camille GILLOT-5/+6
2021-10-10Compute full HIR hash during lowering.Camille GILLOT-3/+18
2021-10-10Directly use AttributeMap inside OwnerInfo.Camille GILLOT-4/+31
2021-10-09Perform indexing during lowering.Camille GILLOT-42/+73
Do not access DefId<->HirId maps before they are initialized.
2021-10-09Make index_hir incremental.Camille GILLOT-0/+6
2021-10-09Hash during lowering.Camille GILLOT-0/+5
2021-10-09Use an IndexVec for bodies.Camille GILLOT-3/+4
2021-10-09Store lowering outputs per owner.Camille GILLOT-15/+24