about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/errors
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-11-05 08:30:56 +0000
committerbors <bors@rust-lang.org>2024-11-05 08:30:56 +0000
commit096277e989d6de11c3077472fc05778e261e7b8e (patch)
tree8370b41060b277a08ab05e274feb2c97e09bdef0 /compiler/rustc_trait_selection/src/errors
parent27e38f8fc7efc57b75e9a763d7a0ee44822cd5f7 (diff)
parentd458f850aad26480df913ddddfdeec9065f9e985 (diff)
downloadrust-096277e989d6de11c3077472fc05778e261e7b8e.tar.gz
rust-096277e989d6de11c3077472fc05778e261e7b8e.zip
Auto merge of #132580 - compiler-errors:globs, r=Noratrieb
Remove unnecessary pub enum glob-imports from `rustc_middle::ty`

We used to have an idiom in the compiler where we'd prefix or suffix all the variants of an enum, for example `BoundRegionKind`, with something like `Br`, and then *glob-import* that enum variant directly.

`@noratrieb` brought this up, and I think that it's easier to read when we just use the normal style `EnumName::Variant`.

This PR is a bit large, but it's just naming.

The only somewhat opinionated change that this PR does is rename `BorrowKind::Imm` to `BorrowKind::Immutable` and same for the other variants. I think these enums are used sparingly enough that the extra length is fine.

r? `@noratrieb` or reassign
Diffstat (limited to 'compiler/rustc_trait_selection/src/errors')
-rw-r--r--compiler/rustc_trait_selection/src/errors/note_and_explain.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/errors/note_and_explain.rs b/compiler/rustc_trait_selection/src/errors/note_and_explain.rs
index 67463b9884c..cc0a637a78e 100644
--- a/compiler/rustc_trait_selection/src/errors/note_and_explain.rs
+++ b/compiler/rustc_trait_selection/src/errors/note_and_explain.rs
@@ -48,7 +48,7 @@ impl<'a> DescriptionCtx<'a> {
                 } else {
                     let scope = fr.scope.expect_local();
                     match fr.bound_region {
-                        ty::BoundRegionKind::BrNamed(_, name) => {
+                        ty::BoundRegionKind::Named(_, name) => {
                             let span = if let Some(param) = tcx
                                 .hir()
                                 .get_generics(scope)
@@ -64,7 +64,7 @@ impl<'a> DescriptionCtx<'a> {
                                 (Some(span), "as_defined", name.to_string())
                             }
                         }
-                        ty::BrAnon => {
+                        ty::BoundRegionKind::Anon => {
                             let span = Some(tcx.def_span(scope));
                             (span, "defined_here", String::new())
                         }