summaryrefslogtreecommitdiffstats
path: root/src/test/incremental/const-generics
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/incremental/const-generics')
-rw-r--r--src/test/incremental/const-generics/hash-tyvid-regression-1.rs16
-rw-r--r--src/test/incremental/const-generics/hash-tyvid-regression-2.rs18
-rw-r--r--src/test/incremental/const-generics/hash-tyvid-regression-3.rs26
-rw-r--r--src/test/incremental/const-generics/hash-tyvid-regression-4.rs40
-rw-r--r--src/test/incremental/const-generics/issue-61338.rs12
-rw-r--r--src/test/incremental/const-generics/issue-61516.rs14
-rw-r--r--src/test/incremental/const-generics/issue-62536.rs9
-rw-r--r--src/test/incremental/const-generics/issue-64087.rs9
-rw-r--r--src/test/incremental/const-generics/issue-65623.rs12
-rw-r--r--src/test/incremental/const-generics/issue-68477.rs25
-rw-r--r--src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs23
-rw-r--r--src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-2.rs18
-rw-r--r--src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs22
-rw-r--r--src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-82034.rs34
-rw-r--r--src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-1.rs23
-rw-r--r--src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-3.rs25
-rw-r--r--src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-86953.rs16
-rw-r--r--src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs28
18 files changed, 0 insertions, 370 deletions
diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-1.rs b/src/test/incremental/const-generics/hash-tyvid-regression-1.rs
deleted file mode 100644
index 5ff7b19d8..000000000
--- a/src/test/incremental/const-generics/hash-tyvid-regression-1.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// revisions: cfail
-#![feature(generic_const_exprs, adt_const_params)]
-#![allow(incomplete_features)]
-// regression test for #77650
-fn c<T, const N: std::num::NonZeroUsize>()
-where
- [T; N.get()]: Sized,
-{
- use std::convert::TryFrom;
- <[T; N.get()]>::try_from(())
- //~^ error: the trait bound
- //~| error: the trait bound
- //~| error: mismatched types
-}
-
-fn main() {}
diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-2.rs b/src/test/incremental/const-generics/hash-tyvid-regression-2.rs
deleted file mode 100644
index 5cdd43cd7..000000000
--- a/src/test/incremental/const-generics/hash-tyvid-regression-2.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// revisions: cfail
-#![feature(generic_const_exprs, adt_const_params)]
-#![allow(incomplete_features)]
-// regression test for #77650
-struct C<T, const N: core::num::NonZeroUsize>([T; N.get()])
-where
- [T; N.get()]: Sized;
-impl<'a, const N: core::num::NonZeroUsize, A, B: PartialEq<A>> PartialEq<&'a [A]> for C<B, N>
-where
- [B; N.get()]: Sized,
-{
- fn eq(&self, other: &&'a [A]) -> bool {
- self.0 == other
- //~^ error: can't compare
- }
-}
-
-fn main() {}
diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-3.rs b/src/test/incremental/const-generics/hash-tyvid-regression-3.rs
deleted file mode 100644
index 61f568f79..000000000
--- a/src/test/incremental/const-generics/hash-tyvid-regression-3.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-// revisions: cfail
-#![feature(generic_const_exprs)]
-#![allow(incomplete_features)]
-// regression test for #79251
-struct Node<const D: usize>
-where
- SmallVec<{ D * 2 }>: ,
-{
- keys: SmallVec<{ D * 2 }>,
-}
-
-impl<const D: usize> Node<D>
-where
- SmallVec<{ D * 2 }>: ,
-{
- fn new() -> Self {
- let mut node = Node::new();
- node.keys.some_function();
- //~^ error: no method named
- node
- }
-}
-
-struct SmallVec<const D: usize> {}
-
-fn main() {}
diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-4.rs b/src/test/incremental/const-generics/hash-tyvid-regression-4.rs
deleted file mode 100644
index 12e8ac7ab..000000000
--- a/src/test/incremental/const-generics/hash-tyvid-regression-4.rs
+++ /dev/null
@@ -1,40 +0,0 @@
-// revisions: cfail
-#![feature(generic_const_exprs)]
-#![allow(incomplete_features)]
-// regression test for #79251
-#[derive(Debug)]
-struct Node<K, const D: usize>
-where
- SmallVec<K, { D * 2 }>: ,
-{
- keys: SmallVec<K, { D * 2 }>,
-}
-
-impl<K, const D: usize> Node<K, D>
-where
- SmallVec<K, { D * 2 }>: ,
-{
- fn new() -> Self {
- panic!()
- }
-
- #[inline(never)]
- fn split(&mut self, i: usize, k: K, right: bool) -> Node<K, D> {
- let mut node = Node::new();
- node.keys.push(k);
- //~^ error: no method named
- node
- }
-}
-
-#[derive(Debug)]
-struct SmallVec<T, const D: usize> {
- data: [T; D],
-}
-impl<T, const D: usize> SmallVec<T, D> {
- fn new() -> Self {
- panic!()
- }
-}
-
-fn main() {}
diff --git a/src/test/incremental/const-generics/issue-61338.rs b/src/test/incremental/const-generics/issue-61338.rs
deleted file mode 100644
index e9d67fee2..000000000
--- a/src/test/incremental/const-generics/issue-61338.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// revisions:rpass1
-
-struct Struct<T>(T);
-
-impl<T, const N: usize> Struct<[T; N]> {
- fn f() {}
- fn g() { Self::f(); }
-}
-
-fn main() {
- Struct::<[u32; 3]>::g();
-}
diff --git a/src/test/incremental/const-generics/issue-61516.rs b/src/test/incremental/const-generics/issue-61516.rs
deleted file mode 100644
index c781484d1..000000000
--- a/src/test/incremental/const-generics/issue-61516.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// revisions:rpass1
-
-struct FakeArray<T, const N: usize>(T);
-
-impl<T, const N: usize> FakeArray<T, N> {
- fn len(&self) -> usize {
- N
- }
-}
-
-fn main() {
- let fa = FakeArray::<u32, { 32 }>(1);
- assert_eq!(fa.len(), 32);
-}
diff --git a/src/test/incremental/const-generics/issue-62536.rs b/src/test/incremental/const-generics/issue-62536.rs
deleted file mode 100644
index 93c1dbf44..000000000
--- a/src/test/incremental/const-generics/issue-62536.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// revisions:cfail1
-struct S<T, const N: usize>([T; N]);
-
-fn f<T, const N: usize>(x: T) -> S<T, {N}> { panic!() }
-
-fn main() {
- f(0u8);
- //[cfail1]~^ ERROR type annotations needed
-}
diff --git a/src/test/incremental/const-generics/issue-64087.rs b/src/test/incremental/const-generics/issue-64087.rs
deleted file mode 100644
index 81c813531..000000000
--- a/src/test/incremental/const-generics/issue-64087.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// revisions:cfail1
-
-fn combinator<T, const S: usize>() -> [T; S] {}
-//[cfail1]~^ ERROR mismatched types
-
-fn main() {
- combinator().into_iter();
- //[cfail1]~^ ERROR type annotations needed
-}
diff --git a/src/test/incremental/const-generics/issue-65623.rs b/src/test/incremental/const-generics/issue-65623.rs
deleted file mode 100644
index 22bbcbcab..000000000
--- a/src/test/incremental/const-generics/issue-65623.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// revisions:rpass1
-pub struct Foo<T, const N: usize>([T; 0]);
-
-impl<T, const N: usize> Foo<T, {N}> {
- pub fn new() -> Self {
- Foo([])
- }
-}
-
-fn main() {
- let _: Foo<u32, 0> = Foo::new();
-}
diff --git a/src/test/incremental/const-generics/issue-68477.rs b/src/test/incremental/const-generics/issue-68477.rs
deleted file mode 100644
index 9e35cf93d..000000000
--- a/src/test/incremental/const-generics/issue-68477.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// edition:2018
-// revisions:rpass1
-
-// Needed to supply generic arguments to the anon const in `[(); FOO]`.
-#![feature(generic_const_exprs)]
-
-const FOO: usize = 1;
-
-struct Container<T> {
- val: std::marker::PhantomData<T>,
- blah: [(); FOO]
-}
-
-async fn dummy() {}
-
-async fn foo() {
- let a: Container<&'static ()>;
- dummy().await;
-}
-
-fn is_send<T: Send>(_: T) {}
-
-fn main() {
- is_send(foo());
-}
diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs
deleted file mode 100644
index 8262a2a21..000000000
--- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-// revisions: cfail
-#![feature(generic_const_exprs)]
-#![allow(incomplete_features, unused_braces)]
-
-trait Delegates<T> {}
-
-struct FileCap<const Op: bool> {}
-
-fn writes_to_path<C>(cap: &C)
-where
- C: Delegates<FileCap<{ false }>>,
-{
- writes_to_specific_path(&cap);
- //~^ error: the trait bound
-}
-
-fn writes_to_specific_path<C>(cap: &C)
-where
- C: Delegates<FileCap<{ false }>>,
-{
-}
-
-fn main() {}
diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-2.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-2.rs
deleted file mode 100644
index 92bbcba4b..000000000
--- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-2.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// revisions: rpass
-#![feature(generic_const_exprs)]
-#![allow(incomplete_features)]
-
-struct Z;
-const fn one() -> usize {
- 1
-}
-
-fn from_a_to_b<T>(source: [u8; one()]) -> T {
- todo!()
-}
-
-fn not_main() {
- let _: &Z = from_a_to_b([0; 1]);
-}
-
-fn main() {}
diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs
deleted file mode 100644
index fc114f224..000000000
--- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-// revisions: rpass
-#![feature(generic_const_exprs, adt_const_params)]
-#![allow(incomplete_features)]
-
-use std::{convert::TryFrom, num::NonZeroUsize};
-
-struct A<const N: NonZeroUsize>([u8; N.get()])
-where
- [u8; N.get()]: Sized;
-
-impl<'a, const N: NonZeroUsize> TryFrom<&'a [u8]> for A<N>
-where
- [u8; N.get()]: Sized,
-{
- type Error = ();
- fn try_from(slice: &'a [u8]) -> Result<A<N>, ()> {
- let _x = <&[u8; N.get()] as TryFrom<&[u8]>>::try_from(slice);
- unimplemented!();
- }
-}
-
-fn main() {}
diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-82034.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-82034.rs
deleted file mode 100644
index c05d8355c..000000000
--- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-82034.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-// revisions: rpass
-#![feature(generic_const_exprs)]
-#![allow(incomplete_features)]
-pub trait IsTrue {}
-pub trait IsFalse {}
-
-pub struct Assert<const CHECK: bool> {}
-
-impl IsTrue for Assert<true> {}
-impl IsFalse for Assert<false> {}
-
-pub struct SliceConstWriter<'a, const N: usize> {
- ptr: &'a mut [u8],
-}
-impl<'a, const N: usize> SliceConstWriter<'a, { N }> {
- pub fn from_slice(vec: &'a mut [u8]) -> Self {
- Self { ptr: vec }
- }
-
- pub fn convert<const NN: usize>(mut self) -> SliceConstWriter<'a, { NN }> {
- SliceConstWriter { ptr: self.ptr }
- }
-}
-
-impl<'a, const N: usize> SliceConstWriter<'a, { N }>
-where
- Assert<{ N >= 2 }>: IsTrue,
-{
- pub fn write_u8(mut self) -> SliceConstWriter<'a, { N - 2 }> {
- self.convert()
- }
-}
-
-fn main() {}
diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-1.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-1.rs
deleted file mode 100644
index 8886a556d..000000000
--- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-1.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-// revisions: rpass
-#![feature(generic_const_exprs)]
-#![allow(incomplete_features)]
-
-pub struct Ref<'a, const NUM: usize>(&'a i32);
-
-impl<'a, const NUM: usize> Ref<'a, NUM> {
- pub fn foo<const A: usize>(r: Ref<'a, A>) -> Self
- where
- ([(); NUM - A], [(); A - NUM]): Sized,
- {
- Self::bar(r)
- }
-
- pub fn bar<const A: usize>(r: Ref<'a, A>) -> Self
- where
- ([(); NUM - A], [(); A - NUM]): Sized,
- {
- Self(r.0)
- }
-}
-
-fn main() {}
diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-3.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-3.rs
deleted file mode 100644
index 5b2f5edc8..000000000
--- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-3.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// revisions: rpass
-#![feature(generic_const_exprs)]
-#![allow(incomplete_features)]
-
-fn test<const SIZE: usize>() {}
-
-trait SomeTrait {
- const SIZE: usize;
-}
-
-struct A<'a, T> {
- some_ref: &'a str,
- _maker: core::marker::PhantomData<T>,
-}
-
-impl<'a, T: SomeTrait> A<'a, T>
-where
- [(); T::SIZE]: ,
-{
- fn call_test() {
- test::<{ T::SIZE }>();
- }
-}
-
-fn main() {}
diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-86953.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-86953.rs
deleted file mode 100644
index d659c5676..000000000
--- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-86953.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// revisions: rpass
-#![feature(generic_const_exprs)]
-#![allow(incomplete_features)]
-
-struct Foo;
-impl<'a> std::ops::Add<&'a Foo> for Foo
-where
- [(); 0 + 0]: Sized,
-{
- type Output = ();
- fn add(self, _: &Foo) -> Self::Output {
- loop {}
- }
-}
-
-fn main() {}
diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs
deleted file mode 100644
index 5f5435ba9..000000000
--- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-// revisions: cfail
-#![feature(generic_const_exprs)]
-#![allow(incomplete_features, unused_braces)]
-
-struct Buffer<T, const S: usize>
-where
- [(); { S * 2 }]: Default,
-{
- data: [T; { S * 2 }],
-}
-
-struct BufferIter<'a, T, const S: usize>(&'a Buffer<T, S>)
-where
- [(); { S * 2 }]: Default;
-
-impl<'a, T, const S: usize> Iterator for BufferIter<'a, T, S> {
- //~^ error: the trait bound
- //~^^ error: unconstrained generic constant
- type Item = &'a T;
-
- fn next(&mut self) -> Option<Self::Item> {
- //~^ error: the trait bound
- //~^^ error: unconstrained generic constant
- None
- }
-}
-
-fn main() {}