File tree 2 files changed +7
-2
lines changed
src/test/ui/const_evaluatable
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
// check-pass
2
+ #![ warn( const_evaluatable_unchecked) ]
2
3
3
4
const fn foo < T > ( ) -> usize {
4
5
if std:: mem:: size_of :: < * mut T > ( ) < 8 { // size of *mut T does not depend on T
Original file line number Diff line number Diff line change 1
1
warning: cannot use constants which depend on generic parameters in types
2
- --> $DIR/function-call.rs:12 :17
2
+ --> $DIR/function-call.rs:13 :17
3
3
|
4
4
LL | let _ = [0; foo::<T>()];
5
5
| ^^^^^^^^^^
6
6
|
7
- = note: `#[warn(const_evaluatable_unchecked)]` on by default
7
+ note: the lint level is defined here
8
+ --> $DIR/function-call.rs:2:9
9
+ |
10
+ LL | #![warn(const_evaluatable_unchecked)]
11
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
8
12
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9
13
= note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
10
14
You can’t perform that action at this time.
0 commit comments