about summary refs log tree commit diff
path: root/compiler/rustc_passes/src/loops.rs
AgeCommit message (Collapse)AuthorLines
2024-02-07hir: Remove `fn opt_hir_id` and `fn opt_span`Vadim Petrochenkov-2/+2
2023-12-26Auto merge of #119258 - compiler-errors:closure-kind, r=eholkbors-10/+9
Make closures carry their own ClosureKind Right now, we use the "`movability`" field of `hir::Closure` to distinguish a closure and a coroutine. This is paired together with the `CoroutineKind`, which is located not in the `hir::Closure`, but the `hir::Body`. This is strange and redundant. This PR introduces `ClosureKind` with two variants -- `Closure` and `Coroutine`, which is put into `hir::Closure`. The `CoroutineKind` is thus removed from `hir::Body`, and `Option<Movability>` no longer needs to be a stand-in for "is this a closure or a coroutine". r? eholk
2023-12-25Only regular coroutines have movabilityMichael Goulet-7/+4
2023-12-25Make closures carry their own ClosureKind, rather than deducing what it is ↵Michael Goulet-10/+12
from movability
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-9/+9
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-12Move some methods from `tcx.hir()` to `tcx`zetanumbers-8/+7
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-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-6/+6
`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-10-16tweak pass description and fix lint fail post-rebaseArthur Lafrance-1/+1
2023-10-09Account for macrosEsteban Küber-1/+1
2023-10-09Suggest labeling block if `break` is in bare blockEsteban Küber-8/+47
Fix #103982.
2023-08-14Use `{Local}ModDefId` in many queriesNilstrieb-2/+2
2023-06-02Separate AnonConst from ConstBlock in HIR.Camille GILLOT-3/+7
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-1/+1
2022-11-05Specify that `break` cannot be used outside of loop *or* labeled blockclubby789-1/+1
2022-10-07migrate loops.rs to translateable diagnosticsNathan Stocks-116/+45
2022-07-12Add an indirection for closures in `hir::ExprKind`Maybe Waffle-1/+7
This helps bring `hir::Expr` size down, `Closure` was the biggest variant, especially after `for<>` additions.
2022-07-07Reword comments and rename HIR visiting methods.Camille GILLOT-1/+1
2022-06-15Rollup merge of #98110 - cjgillot:closure-brace, r=Aaron1011Yuki Okushi-5/+5
Make `ExprKind::Closure` a struct variant. Simple refactor since we both need it to introduce additional fields in `ExprKind::Closure`. r? ``@Aaron1011``
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-1/+1
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-5/+5
2022-05-13rename visit item-like methodsMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13remove ItemLikeVisitor and DeepVisitorMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-01-16Replace NestedVisitorMap with NestedFilterCameron Steffen-4/+5
2021-01-21Do not suggest using a break label when one is already presentEsteban Küber-6/+11
2021-01-21Tweak error for invalid `break expr`Esteban Küber-20/+56
Point at loop head on invalid `break expr`. Suggest removing `expr` or using label if available.
2021-01-21Add loop head span to hirEsteban Küber-3/+2
2020-08-30mv compiler to compiler/mark-0/+240