mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #154882 - zedddie:gate-tuple-const-params, r=BoxyUwU
Gate tuple const params behind `min_adt_const_params` feature r? BoxyUwU
This commit is contained in:
@@ -904,7 +904,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &ty::GenericParamDef) -> Result<(), Er
|
||||
) => None,
|
||||
Err(ConstParamTyImplementationError::UnsizedConstParamsFeatureRequired) => {
|
||||
Some(vec![
|
||||
(adt_const_params_feature_string, sym::adt_const_params),
|
||||
(adt_const_params_feature_string, sym::min_adt_const_params),
|
||||
(
|
||||
" references to implement the `ConstParamTy` trait".into(),
|
||||
sym::unsized_const_params,
|
||||
@@ -931,11 +931,13 @@ fn ty_is_local(ty: Ty<'_>) -> bool {
|
||||
|
||||
ty_is_local(ty).then_some(vec![(
|
||||
adt_const_params_feature_string,
|
||||
sym::adt_const_params,
|
||||
sym::min_adt_const_params,
|
||||
)])
|
||||
}
|
||||
// Implements `ConstParamTy`, suggest adding the feature to enable.
|
||||
Ok(..) => Some(vec![(adt_const_params_feature_string, sym::adt_const_params)]),
|
||||
Ok(..) => {
|
||||
Some(vec![(adt_const_params_feature_string, sym::min_adt_const_params)])
|
||||
}
|
||||
};
|
||||
if let Some(features) = may_suggest_feature {
|
||||
tcx.disabled_nightly_features(&mut diag, features);
|
||||
|
||||
@@ -1095,9 +1095,13 @@ pub trait ConstParamTy_: StructuralPartialEq + Eq {}
|
||||
/* compiler built-in */
|
||||
}
|
||||
|
||||
// For `adt_const_params` to be recognized as a feature
|
||||
#[unstable(feature = "adt_const_params", issue = "95174")]
|
||||
const _: () = ();
|
||||
|
||||
// FIXME(adt_const_params): handle `ty::FnDef`/`ty::Closure`
|
||||
marker_impls! {
|
||||
#[unstable(feature = "adt_const_params", issue = "95174")]
|
||||
#[unstable(feature = "min_adt_const_params", issue = "154042")]
|
||||
ConstParamTy_ for
|
||||
usize, u8, u16, u32, u64, u128,
|
||||
isize, i8, i16, i32, i64, i128,
|
||||
|
||||
@@ -47,8 +47,7 @@ impl<$($T: [const] Eq),+> const Eq for ($($T,)+)
|
||||
|
||||
maybe_tuple_doc! {
|
||||
$($T)+ @
|
||||
#[unstable(feature = "adt_const_params", issue = "95174")]
|
||||
#[unstable_feature_bound(unsized_const_params)]
|
||||
#[unstable(feature = "min_adt_const_params", issue = "154042")]
|
||||
impl<$($T: ConstParamTy_),+> ConstParamTy_ for ($($T,)+)
|
||||
{}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
// Can never be used as const generics.
|
||||
fn uwu_0<const N: &'static mut ()>() {}
|
||||
//~^ ERROR: forbidden as the type of a const generic
|
||||
//~| HELP: add `#![feature(adt_const_params)]`
|
||||
//~| HELP: add `#![feature(adt_const_params)]`
|
||||
//~| HELP: add `#![feature(adt_const_params)]`
|
||||
//~| HELP: add `#![feature(min_adt_const_params)]`
|
||||
//~| HELP: add `#![feature(min_adt_const_params)]`
|
||||
//~| HELP: add `#![feature(min_adt_const_params)]`
|
||||
//~| HELP: add `#![feature(unsized_const_params)]`
|
||||
//~| HELP: add `#![feature(unsized_const_params)]`
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ LL | fn owo_0<const N: &'static u32>() {}
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
@@ -29,9 +29,9 @@ LL | fn meow_0<const N: Meow>() {}
|
||||
| ^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `&'static Meow` is forbidden as the type of a const generic parameter
|
||||
@@ -41,9 +41,9 @@ LL | fn meow_1<const N: &'static Meow>() {}
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
//! Ensure we allow tuples behind `min_adt_const_params`
|
||||
//@check-pass
|
||||
#![feature(min_adt_const_params)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
use std::marker::ConstParamTy;
|
||||
|
||||
fn foo<const N: (i32, u32, i16)>() {}
|
||||
fn foo2<const TUP: Something>() {}
|
||||
|
||||
#[derive(PartialEq, Eq, ConstParamTy)]
|
||||
struct Something(i8, i16, i32);
|
||||
|
||||
fn main() {}
|
||||
@@ -17,9 +17,9 @@ LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `[u8; N]` is forbidden as the type of a const generic parameter
|
||||
@@ -29,9 +29,9 @@ LL | pub struct SelfDependent<const N: [u8; N]>;
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
+2
-2
@@ -23,9 +23,9 @@ LL | struct B<const CFG: Config> {
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
@@ -19,9 +19,9 @@ LL | pub struct A<const z: [usize; x]> {}
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error[E0308]: mismatched types
|
||||
|
||||
@@ -82,9 +82,9 @@ LL | pub struct v17<const v10: usize, const v7: v11> {
|
||||
| ^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error[E0425]: cannot find function `v6` in this scope
|
||||
|
||||
@@ -14,9 +14,9 @@ LL | trait Trait<const S: &'static str> {}
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
|
||||
@@ -11,9 +11,9 @@ LL | fn foo<const N: usize, const A: [u8; N]>() {}
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | fn test<const T: &'static dyn A>() {
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | struct Collatz<const N: Option<usize>>;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
|
||||
|
||||
@@ -14,9 +14,9 @@ LL | struct Collatz<const N: Option<usize>>;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | struct Const<const V: [usize; 0]> {}
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | struct Foo<const V: [usize; 0] > {}
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
@@ -11,9 +11,9 @@ LL | fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | fn hoge<const IN: [u32; LEN]>() {}
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ LL | fn a<const X: &'static [u32]>() {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | fn test<const N: [u8; 1 + 2]>() {}
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `[u8; 1 + 2]` is forbidden as the type of a const generic parameter
|
||||
@@ -17,9 +17,9 @@ LL | struct Foo<const N: [u8; 1 + 2]>;
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | fn ice_struct_fn<const I: IceEnum>() {}
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | struct Outer<const I: Inner>;
|
||||
| ^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `Inner` is forbidden as the type of a const generic parameter
|
||||
@@ -18,9 +18,9 @@ LL | struct Outer<const I: Inner>;
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `Inner` is forbidden as the type of a const generic parameter
|
||||
@@ -31,9 +31,9 @@ LL | struct Outer<const I: Inner>;
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `Inner` is forbidden as the type of a const generic parameter
|
||||
@@ -44,9 +44,9 @@ LL | struct Outer<const I: Inner>;
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | struct Foo<const N: [u8; Bar::<u32>::value()]>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | struct Foo<const N: [u8; 0]>;
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `()` is forbidden as the type of a const generic parameter
|
||||
@@ -17,9 +17,9 @@ LL | struct Bar<const N: ()>;
|
||||
| ^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `No` is forbidden as the type of a const generic parameter
|
||||
@@ -29,9 +29,9 @@ LL | struct Fez<const N: No>;
|
||||
| ^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `&'static u8` is forbidden as the type of a const generic parameter
|
||||
@@ -41,9 +41,9 @@ LL | struct Faz<const N: &'static u8>;
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
@@ -65,9 +65,9 @@ LL | enum Goo<const N: ()> { A, B }
|
||||
| ^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `()` is forbidden as the type of a const generic parameter
|
||||
@@ -77,9 +77,9 @@ LL | union Boo<const N: ()> { a: () }
|
||||
| ^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
@@ -29,9 +29,9 @@ LL | | }]>;
|
||||
| |__^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | struct ConstString<const T: &'static str>;
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
@@ -21,9 +21,9 @@ LL | struct ConstBytes<const T: &'static [u8]>;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | struct _Range<const R: std::ops::Range<usize>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `std::ops::RangeFrom<usize>` is forbidden as the type of a const generic parameter
|
||||
@@ -17,9 +17,9 @@ LL | struct _RangeFrom<const R: std::ops::RangeFrom<usize>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `RangeFull` is forbidden as the type of a const generic parameter
|
||||
@@ -29,9 +29,9 @@ LL | struct _RangeFull<const R: std::ops::RangeFull>;
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `std::ops::RangeInclusive<usize>` is forbidden as the type of a const generic parameter
|
||||
@@ -41,9 +41,9 @@ LL | struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `RangeTo<usize>` is forbidden as the type of a const generic parameter
|
||||
@@ -53,9 +53,9 @@ LL | struct _RangeTo<const R: std::ops::RangeTo<usize>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `std::ops::RangeToInclusive<usize>` is forbidden as the type of a const generic parameter
|
||||
@@ -65,9 +65,9 @@ LL | struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | struct Const<const P: &'static ()>;
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | trait Get<'a, const N: &'static str> {
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
@@ -21,9 +21,9 @@ LL | fn ask<'a, const N: &'static str>(&'a self) -> &'a <Self as Get<N>>::Ta
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | struct Foo<const N: Bar>;
|
||||
| ^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
@@ -11,9 +11,9 @@ LL | struct MyADT<const LEN: usize, const ARRAY: [u8; LEN]>;
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
struct Foo<const N: [u8]>;
|
||||
//~^ ERROR: `[u8]` is forbidden as the type of a const generic parameter
|
||||
//~| HELP: add `#![feature(adt_const_params)]` to the crate
|
||||
//~| HELP: add `#![feature(min_adt_const_params)]` to the crate
|
||||
//~| HELP: add `#![feature(unsized_const_params)]` to the crate
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | struct Foo<const N: [u8]>;
|
||||
| ^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
|
||||
@@ -20,9 +20,9 @@ LL | pub struct Quantity<S, const D: Dimension>(S);
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error[E0107]: trait takes at most 1 generic argument but 2 generic arguments were supplied
|
||||
@@ -38,9 +38,9 @@ LL | impl<const D: Dimension, LHS, RHS> Add<LHS, D> for Quantity<LHS, { Dimensio
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: `Dimension` is forbidden as the type of a const generic parameter
|
||||
@@ -50,9 +50,9 @@ LL | pub fn add<const U: Dimension>(x: Quantity<f32, U>) -> Quantity<f32, U> {
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
@@ -5,9 +5,9 @@ LL | const fn concat_strs<const A: &'static str>() -> &'static str {
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
@@ -21,9 +21,9 @@ LL | struct Inner<const A: &'static str>;
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool`, and `char`
|
||||
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
||||
|
|
||||
LL + #![feature(adt_const_params)]
|
||||
LL + #![feature(min_adt_const_params)]
|
||||
|
|
||||
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
||||
|
|
||||
|
||||
Reference in New Issue
Block a user