Skip to content

Commit 8cd2bf6

Browse files
committed
Update notes with regards to feature gates
* `const_transmute` currently also seems to depend on the `const_fn` feature. * Only `Sized` is currently allowed as a bound, not Copy.
1 parent 3636f11 commit 8cd2bf6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/ui/missing_const_for_fn/could_be_const.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ fn generic<T>(t: T) -> T {
4141
t
4242
}
4343

44-
// FIXME: This could be const but is currently not linted
44+
// FIXME: Depends on the `const_transmute` and `const_fn` feature gates.
45+
// In the future Clippy should be able to suggest this as const, too.
4546
fn sub(x: u32) -> usize {
4647
unsafe { transmute(&x) }
4748
}
4849

49-
// FIXME: This could be const but is currently not linted
50+
// NOTE: This is currently not yet allowed to be const
51+
// Once implemented, Clippy should be able to suggest this as const, too.
5052
fn generic_arr<T: Copy>(t: [T; 1]) -> T {
5153
t[0]
5254
}

0 commit comments

Comments
 (0)