Skip to content

Commit 6a0b1bc

Browse files
committed
make voldemort less cryptic
1 parent 8105739 commit 6a0b1bc

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

compiler/rustc_lint/src/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'tcx> LateLintPass<'tcx> for DropTraitConstraints {
9696
};
9797
let def_id = trait_predicate.trait_ref.def_id;
9898
if cx.tcx.lang_items().drop_trait() == Some(def_id) {
99-
// Explicitly allow `impl Drop`, a drop-guards-as-Voldemort-type pattern.
99+
// Explicitly allow `impl Drop`, a drop-guards-as-unnameable-type pattern.
100100
if trait_predicate.trait_ref.self_ty().is_impl_trait() {
101101
continue;
102102
}

compiler/rustc_middle/src/ty/sty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2857,7 +2857,7 @@ impl<'tcx> Ty<'tcx> {
28572857
| ty::Uint(..)
28582858
| ty::Float(..) => true,
28592859

2860-
// The voldemort ZSTs are fine.
2860+
// ZST which can't be named are fine.
28612861
ty::FnDef(..) => true,
28622862

28632863
ty::Array(element_ty, _len) => element_ty.is_trivially_pure_clone_copy(),

tests/ui/drop-bounds/drop-bounds-impl-drop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![deny(drop_bounds)]
33
// As a special exemption, `impl Drop` in the return position raises no error.
44
// This allows a convenient way to return an unnamed drop guard.
5+
// Voldemort here refers to types that are unnameable.
56
fn voldemort_type() -> impl Drop {
67
struct Voldemort;
78
impl Drop for Voldemort {

0 commit comments

Comments
 (0)