Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
7
tests/rustdoc-ui/error-in-impl-trait/README.md
Normal file
7
tests/rustdoc-ui/error-in-impl-trait/README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
Each of these needs to be in a separate file,
|
||||
because the `delay_span_bug` ICE in rustdoc won't be triggerred
|
||||
if even a single other error was emitted.
|
||||
|
||||
However, conceptually they are all testing basically the same thing.
|
||||
See https://github.com/rust-lang/rust/pull/73566#issuecomment-653689128
|
||||
for more details.
|
7
tests/rustdoc-ui/error-in-impl-trait/async.rs
Normal file
7
tests/rustdoc-ui/error-in-impl-trait/async.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// edition:2018
|
||||
// check-pass
|
||||
|
||||
/// Should compile fine
|
||||
pub async fn a() -> u32 {
|
||||
error::_in::async_fn()
|
||||
}
|
5
tests/rustdoc-ui/error-in-impl-trait/closure.rs
Normal file
5
tests/rustdoc-ui/error-in-impl-trait/closure.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
// check-pass
|
||||
// manually desugared version of an `async fn` (but with a closure instead of a generator)
|
||||
pub fn a() -> impl Fn() -> u32 {
|
||||
|| content::doesnt::matter()
|
||||
}
|
23
tests/rustdoc-ui/error-in-impl-trait/const-generics.rs
Normal file
23
tests/rustdoc-ui/error-in-impl-trait/const-generics.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
// check-pass
|
||||
// edition:2018
|
||||
trait ValidTrait {}
|
||||
|
||||
/// This has docs
|
||||
pub fn extern_fn<const N: usize>() -> impl Iterator<Item = [u8; N]> {
|
||||
loop {}
|
||||
}
|
||||
|
||||
pub trait Trait<const N: usize> {}
|
||||
impl Trait<1> for u8 {}
|
||||
impl Trait<2> for u8 {}
|
||||
impl<const N: usize> Trait<N> for [u8; N] {}
|
||||
|
||||
/// This also has docs
|
||||
pub fn test<const N: usize>() -> impl Trait<N> where u8: Trait<N> {
|
||||
loop {}
|
||||
}
|
||||
|
||||
/// Document all the functions
|
||||
pub async fn a_sink<const N: usize>(v: [u8; N]) -> impl Trait<N> {
|
||||
loop {}
|
||||
}
|
7
tests/rustdoc-ui/error-in-impl-trait/generic-argument.rs
Normal file
7
tests/rustdoc-ui/error-in-impl-trait/generic-argument.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// check-pass
|
||||
trait ValidTrait {}
|
||||
|
||||
/// This has docs
|
||||
pub fn f() -> impl ValidTrait {
|
||||
Vec::<DoesNotExist>::new()
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
// check-pass
|
||||
pub trait ValidTrait {}
|
||||
/// This returns impl trait
|
||||
pub fn g() -> impl ValidTrait {
|
||||
(|| error::_in::impl_trait::alias::nested::closure())()
|
||||
}
|
6
tests/rustdoc-ui/error-in-impl-trait/impl-keyword.rs
Normal file
6
tests/rustdoc-ui/error-in-impl-trait/impl-keyword.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// check-pass
|
||||
pub trait ValidTrait {}
|
||||
/// This returns impl trait
|
||||
pub fn g() -> impl ValidTrait {
|
||||
error::_in::impl_trait()
|
||||
}
|
28
tests/rustdoc-ui/error-in-impl-trait/realistic-async.rs
Normal file
28
tests/rustdoc-ui/error-in-impl-trait/realistic-async.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
// edition:2018
|
||||
// check-pass
|
||||
|
||||
mod windows {
|
||||
pub trait WinFoo {
|
||||
fn foo(&self) {}
|
||||
}
|
||||
|
||||
impl WinFoo for () {}
|
||||
}
|
||||
|
||||
#[cfg(any(windows, doc))]
|
||||
use windows::*;
|
||||
|
||||
mod unix {
|
||||
pub trait UnixFoo {
|
||||
fn foo(&self) {}
|
||||
}
|
||||
|
||||
impl UnixFoo for () {}
|
||||
}
|
||||
|
||||
#[cfg(any(unix, doc))]
|
||||
use unix::*;
|
||||
|
||||
async fn bar() {
|
||||
().foo()
|
||||
}
|
10
tests/rustdoc-ui/error-in-impl-trait/trait-alias-closure.rs
Normal file
10
tests/rustdoc-ui/error-in-impl-trait/trait-alias-closure.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// check-pass
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
pub trait ValidTrait {}
|
||||
type ImplTrait = impl ValidTrait;
|
||||
|
||||
/// This returns impl trait, but using a type alias
|
||||
pub fn h() -> ImplTrait {
|
||||
(|| error::_in::impl_trait::alias::nested::closure())()
|
||||
}
|
10
tests/rustdoc-ui/error-in-impl-trait/trait-alias.rs
Normal file
10
tests/rustdoc-ui/error-in-impl-trait/trait-alias.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// check-pass
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
pub trait ValidTrait {}
|
||||
type ImplTrait = impl ValidTrait;
|
||||
|
||||
/// This returns impl trait, but using a type alias
|
||||
pub fn h() -> ImplTrait {
|
||||
error::_in::impl_trait::alias()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue