Forbid `!Sized` types and references · model-checking/verify-rust-std@857ed93
@@ -995,13 +995,22 @@ marker_impls! {
995995isize, i8, i16, i32, i64, i128,
996996bool,
997997char,
998-str /* Technically requires `[u8]: ConstParamTy` */,
999998(),
1000999{T: ConstParamTy, const N: usize} [T; N],
1001-{T: ConstParamTy} [T],
1002-{T: ?Sized + ConstParamTy} &T,
10031000}
100410011002+#[unstable(feature = "adt_const_params", issue = "95174")]
1003+#[rustc_reservation_impl = "types that are not `Sized` are not supported as the type of a const generic parameter"]
1004+impl<T> ConstParamTy for [T] {}
1005+1006+#[unstable(feature = "adt_const_params", issue = "95174")]
1007+#[rustc_reservation_impl = "types that are not `Sized` are not supported as the type of a const generic parameter"]
1008+impl ConstParamTy for str {}
1009+1010+#[unstable(feature = "adt_const_params", issue = "95174")]
1011+#[rustc_reservation_impl = "references are not supported as the type of a const generic parameter"]
1012+impl<T: ?Sized> ConstParamTy for &T {}
1013+10051014/// A common trait implemented by all function pointers.
10061015#[unstable(
10071016 feature = "fn_ptr_trait",