diff options
| author | ouz-a <ouz.agz@gmail.com> | 2023-09-05 17:52:39 +0300 |
|---|---|---|
| committer | ouz-a <ouz.agz@gmail.com> | 2023-09-06 12:09:29 +0300 |
| commit | 7928c5f830825a913ddeecbd4ec711152c7addb5 (patch) | |
| tree | c7ef8721eb924b249c4f8d6cfbbe3dc7036043f8 | |
| parent | 810573919f24b2293ed806797ff8507577c809a9 (diff) | |
| download | rust-7928c5f830825a913ddeecbd4ec711152c7addb5.tar.gz rust-7928c5f830825a913ddeecbd4ec711152c7addb5.zip | |
make comments less cryptic
| -rw-r--r-- | compiler/rustc_lint/src/traits.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_lint_defs/src/builtin.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 2 | ||||
| -rw-r--r-- | tests/ui/drop-bounds/drop-bounds-impl-drop.rs | 10 | ||||
| -rw-r--r-- | tests/ui/privacy/unnameable_types.rs | 8 |
5 files changed, 12 insertions, 12 deletions
diff --git a/compiler/rustc_lint/src/traits.rs b/compiler/rustc_lint/src/traits.rs index 56508a2a6cc..e812493b3dd 100644 --- a/compiler/rustc_lint/src/traits.rs +++ b/compiler/rustc_lint/src/traits.rs @@ -96,7 +96,7 @@ impl<'tcx> LateLintPass<'tcx> for DropTraitConstraints { }; let def_id = trait_predicate.trait_ref.def_id; if cx.tcx.lang_items().drop_trait() == Some(def_id) { - // Explicitly allow `impl Drop`, a drop-guards-as-Voldemort-type pattern. + // Explicitly allow `impl Drop`, a drop-guards-as-unnameable-type pattern. if trait_predicate.trait_ref.self_ty().is_impl_trait() { continue; } diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 0aa37642b74..aac83dda901 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -4408,7 +4408,7 @@ declare_lint! { /// pub struct S; /// } /// - /// pub fn get_voldemort() -> m::S { m::S } + /// pub fn get_unnameable() -> m::S { m::S } /// # fn main() {} /// ``` /// diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 0291cdd6c57..fbbdfe5f14f 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -2857,7 +2857,7 @@ impl<'tcx> Ty<'tcx> { | ty::Uint(..) | ty::Float(..) => true, - // The voldemort ZSTs are fine. + // ZST which can't be named are fine. ty::FnDef(..) => true, ty::Array(element_ty, _len) => element_ty.is_trivially_pure_clone_copy(), diff --git a/tests/ui/drop-bounds/drop-bounds-impl-drop.rs b/tests/ui/drop-bounds/drop-bounds-impl-drop.rs index 063efc7b31a..15aebdf1bc9 100644 --- a/tests/ui/drop-bounds/drop-bounds-impl-drop.rs +++ b/tests/ui/drop-bounds/drop-bounds-impl-drop.rs @@ -2,13 +2,13 @@ #![deny(drop_bounds)] // As a special exemption, `impl Drop` in the return position raises no error. // This allows a convenient way to return an unnamed drop guard. -fn voldemort_type() -> impl Drop { - struct Voldemort; - impl Drop for Voldemort { +fn unnameable_type() -> impl Drop { + struct Unnameable; + impl Drop for Unnameable { fn drop(&mut self) {} } - Voldemort + Unnameable } fn main() { - let _ = voldemort_type(); + let _ = unnameable_type(); } diff --git a/tests/ui/privacy/unnameable_types.rs b/tests/ui/privacy/unnameable_types.rs index 46e24915259..9fa14c50583 100644 --- a/tests/ui/privacy/unnameable_types.rs +++ b/tests/ui/privacy/unnameable_types.rs @@ -21,10 +21,10 @@ mod m { } } -pub trait Voldemort<T> {} +pub trait Unnameable<T> {} -impl Voldemort<m::PubStruct> for i32 {} -impl Voldemort<m::PubE> for i32 {} -impl<T> Voldemort<T> for u32 where T: m::PubTr {} +impl Unnameable<m::PubStruct> for i32 {} +impl Unnameable<m::PubE> for i32 {} +impl<T> Unnameable<T> for u32 where T: m::PubTr {} fn main() {} |
