Skip to content

Commit 25c5e71

Browse files
authored
Mention when drop is run for const/static
1 parent acbf2c4 commit 25c5e71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

const.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ impl Drop for Foo {
7575
}
7676
}
7777

78-
const FOO: Foo = Foo; // Ok
79-
static FOOO: Foo = Foo; // Ok
78+
const FOO: Foo = Foo; // Ok, drop is run at each use site in runtime code
79+
static FOOO: Foo = Foo; // Ok, drop is never run
8080

8181
// Not ok, cannot run `Foo::drop` because it's not a const fn
8282
const BAR: i32 = (Foo, 42).1;

0 commit comments

Comments
 (0)