2022-12-06 21:55:30 -06:00
|
|
|
error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
|
|
|
--> $DIR/issue-105257.rs:5:12
|
|
|
|
|
|
|
|
|
LL | fn fnc<const N: usize = "">(&self) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-12-07 23:11:29 -06:00
|
|
|
error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
2023-10-31 08:45:26 -05:00
|
|
|
--> $DIR/issue-105257.rs:7:12
|
2022-12-07 23:11:29 -06:00
|
|
|
|
|
|
|
|
LL | fn foo<const N: usize = { std::mem::size_of::<T>() }>(&self) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2023-10-31 08:45:26 -05:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/issue-105257.rs:5:29
|
|
|
|
|
|
|
|
|
LL | fn fnc<const N: usize = "">(&self) {}
|
|
|
|
| ^^ expected `usize`, found `&str`
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2022-12-06 21:55:30 -06:00
|
|
|
|
2023-10-31 08:45:26 -05:00
|
|
|
For more information about this error, try `rustc --explain E0308`.
|