We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3636f11 commit 8cd2bf6Copy full SHA for 8cd2bf6
tests/ui/missing_const_for_fn/could_be_const.rs
@@ -41,12 +41,14 @@ fn generic<T>(t: T) -> T {
41
t
42
}
43
44
-// FIXME: This could be const but is currently not linted
+// 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.
46
fn sub(x: u32) -> usize {
47
unsafe { transmute(&x) }
48
49
50
+// NOTE: This is currently not yet allowed to be const
51
+// Once implemented, Clippy should be able to suggest this as const, too.
52
fn generic_arr<T: Copy>(t: [T; 1]) -> T {
53
t[0]
54
0 commit comments