about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/middle/region.rs
AgeCommit message (Collapse)AuthorLines
2023-12-12Move some methods from `tcx.hir()` to `tcx`zetanumbers-1/+1
Renamings: - find -> opt_hir_node - get -> hir_node - find_by_def_id -> opt_hir_node_by_def_id - get_by_def_id -> hir_node_by_def_id Fix rebase changes using removed methods Use `tcx.hir_node_by_def_id()` whenever possible in compiler Fix clippy errors Fix compiler Apply suggestions from code review Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> Add FIXME for `tcx.hir()` returned type about its removal Simplify with with `tcx.hir_node_by_def_id`
2023-12-04Don't include destruction scopes in THIRMatthew Jasper-4/+0
They are not used by anyone, and add memory/performance overhead.
2023-11-22Replace `no_ord_impl` with `orderable`.Nicholas Nethercote-0/+1
Similar to the previous commit, this replaces `newtype_index`'s opt-out `no_ord_impl` attribute with the opt-in `orderable` attribute.
2023-11-22Replace `custom_encodable` with `encodable`.Nicholas Nethercote-0/+1
By default, `newtype_index!` types get a default `Encodable`/`Decodable` impl. You can opt out of this with `custom_encodable`. Opting out is the opposite to how Rust normally works with autogenerated (derived) impls. This commit inverts the behaviour, replacing `custom_encodable` with `encodable` which opts into the default `Encodable`/`Decodable` impl. Only 23 of the 59 `newtype_index!` occurrences need `encodable`. Even better, there were eight crates with a dependency on `rustc_serialize` just from unused default `Encodable`/`Decodable` impls. This commit removes that dependency from those eight crates.
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`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-11-14finish `RegionKind` renamelcnr-1/+1
- `ReFree` -> `ReLateParam` - `ReEarlyBound` -> `ReEarlyParam`
2023-10-20s/generator/coroutine/Oli Scherer-2/+2
2023-07-14Enable potential_query_instability lint in rustc_hir_typeck.Michael Woerister-2/+2
Fix linting errors by using FxIndex(Map|Set) and Unord(Map|Set) as appropriate.
2023-04-28Remove some unnecessary derives.Nicholas Nethercote-3/+3
I was curious about how many `Encodable`/`Decodable` derives we have. Some grepping revealed that it's over 500 of each, but the number of `Encodable` ones was higher, which was weird. Most of the `Encodable`-only ones were in `hir.rs`. This commit removes them all, plus some other unnecessary derives in that file and others that I found via trial and error.
2022-12-18A few small cleanups for `newtype_index`Nilstrieb-2/+1
Remove the `..` from the body, only a few invocations used it and it's inconsistent with rust syntax. Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
2022-12-18Use `#[derive]` instead of custom syntax in all `newtype_index`Nilstrieb-1/+1
2022-06-03Replace `&Vec<_>`s with `&[_]`sMaybe Waffle-2/+3
2022-05-22factor out the rvalue lifetime ruleDing Xiang Fei-45/+33
remove region_scope_tree from RegionCtxt Apply suggestions from code review Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-04-14Update issue-92893.stderrouz-a-6/+3
2022-04-12Remove NodeIdHashingMode.Camille GILLOT-5/+2
2022-03-11Auto merge of #90253 - Kobzol:hash-stable-sort-index-map, r=cjgillotbors-4/+4
Change several HashMaps to IndexMap to improve incremental hashing performance Stable hashing hash maps in incremental mode takes a lot of time, especially for some benchmarks like `clap`. As noted by `@Mark-Simulacrum` [here](https://github.com/rust-lang/rust/pull/89404#issuecomment-950043892), this cost could be reduced by replacing some hash maps by indexmaps. I gathered some statistics and found several hash maps that took a lot of time to hash and replaced them by indexmaps. However, in order for this to work, we need to make sure that these indexmaps have deterministic insertion order. These three are used only in visitors as far as I can see, which seems deterministic. Can we enforce this somehow? Or should some explaining comment be included for these maps?
2022-02-19Adopt let else in more placesest31-3/+2
2022-01-18Track drops across multiple yieldsEric Holk-3/+3
2021-12-28Change several HashMaps to IndexMap to improve incremental hashing performanceJakub Beránek-4/+4
2021-11-28Remove unused root_parent.Camille GILLOT-12/+4
2021-10-03Remove re-export.Camille GILLOT-1/+1
2021-09-20Adjust documentation for compatibility with 2021Mark Rousskov-1/+2
This also adjusts the lint docs generation to accept (and ignore) an allow attribute, rather than expecting the documentation to be immediately followed by the lint name.
2021-09-01Fix drop handling for `if let` expressionsMatthew Jasper-0/+5
MIR lowering for `if let` expressions is now more complicated now that `if let` exists in HIR. This PR adds a scope for the variables bound in an `if let` expression and then uses an approach similar to how we handle loops to ensure that we reliably drop the correct variables.
2021-08-23Rollup merge of #88230 - steffahn:a_an, r=oli-obkMara Bos-1/+1
Fix typos “a”→“an” Fix typos in comments; found using a regex to find some easy instance of incorrect usage of a vs. an. While automation was used to find these, every change was checked manually. Changes in submodules get separate PRs: * https://github.com/rust-lang/stdarch/pull/1201 * https://github.com/rust-lang/cargo/pull/9821 * https://github.com/rust-lang/miri/pull/1874 * https://github.com/rust-lang/rls/pull/1746 * https://github.com/rust-analyzer/rust-analyzer/pull/9984 _folks @ rust-analyzer are fast at merging…_ * https://github.com/rust-analyzer/rust-analyzer/pull/9985 * https://github.com/rust-analyzer/rust-analyzer/pull/9987 * https://github.com/rust-analyzer/rust-analyzer/pull/9989 _For `clippy`, I don’t know if the changes should better better be moved to a PR to the original repo._ <hr> This has some overlap with #88226, but neither is a strict superset of the other. If you want multiple commits, I can split it up; in that case, make sure to suggest a criterion for splitting.
2021-08-22Fix typos “a”→“an”Frank Steffahn-1/+1
2021-08-21cleanup: `Span::new` -> `Span::with_lo`Vadim Petrochenkov-1/+1
2021-04-19Remove closure_treeCameron Steffen-31/+0
2021-03-27Remove (lots of) dead codeJoshua Nelson-0/+2
Found with https://github.com/est31/warnalyzer. Dubious changes: - Is anyone else using rustc_apfloat? I feel weird completely deleting x87 support. - Maybe some of the dead code in rustc_data_structures, in case someone wants to use it in the future? - Don't change rustc_serialize I plan to scrap most of the json module in the near future (see https://github.com/rust-lang/compiler-team/issues/418) and fixing the tests needed more work than I expected. TODO: check if any of the comments on the deleted code should be kept.
2020-12-22docs: Update rustc_middle::middle::region::ScopeTreepierwill-4/+2
This corrects the return type in docs for yield_in_source method. Closes #80287.
2020-10-21Clean up and improve some docsCamelid-11/+11
* compiler docs * Don't format list as part of a code block * Clean up some other formatting * rustdoc book * Update CommonMark spec version to latest (0.28 -> 0.29) * Clean up some various wording and formatting
2020-10-14documentation fixDing Xiang Fei-3/+7
2020-08-30mv compiler to compiler/mark-0/+490