diff options
| author | Caio <c410.f3r@gmail.com> | 2021-11-06 15:35:20 -0300 |
|---|---|---|
| committer | Caio <c410.f3r@gmail.com> | 2021-11-06 15:35:20 -0300 |
| commit | 7fd15f09008dd72f40d76a5bebb60e3991095a5f (patch) | |
| tree | 45b540395fe976fa12c67d74f4f965023b84ad3f /src/test/ui/regions | |
| parent | d32993afe81a49701edd6f2b8f018020ca50da1a (diff) | |
| download | rust-7fd15f09008dd72f40d76a5bebb60e3991095a5f.tar.gz rust-7fd15f09008dd72f40d76a5bebb60e3991095a5f.zip | |
Move some tests to more reasonable directories
Diffstat (limited to 'src/test/ui/regions')
| -rw-r--r-- | src/test/ui/regions/issue-21520.rs | 22 | ||||
| -rw-r--r-- | src/test/ui/regions/issue-26448-1.rs | 13 | ||||
| -rw-r--r-- | src/test/ui/regions/issue-26448-2.rs | 21 | ||||
| -rw-r--r-- | src/test/ui/regions/issue-26448-3.rs | 25 |
4 files changed, 81 insertions, 0 deletions
diff --git a/src/test/ui/regions/issue-21520.rs b/src/test/ui/regions/issue-21520.rs new file mode 100644 index 00000000000..ab4ac7237c7 --- /dev/null +++ b/src/test/ui/regions/issue-21520.rs @@ -0,0 +1,22 @@ +// check-pass +#![allow(dead_code)] +// Test that the requirement (in `Bar`) that `T::Bar : 'static` does +// not wind up propagating to `T`. + +// pretty-expanded FIXME #23616 + +pub trait Foo { + type Bar; + + fn foo(&self) -> Self; +} + +pub struct Static<T:'static>(T); + +struct Bar<T:Foo> + where T::Bar : 'static +{ + x: Static<Option<T::Bar>> +} + +fn main() { } diff --git a/src/test/ui/regions/issue-26448-1.rs b/src/test/ui/regions/issue-26448-1.rs new file mode 100644 index 00000000000..7d2d75bf2e8 --- /dev/null +++ b/src/test/ui/regions/issue-26448-1.rs @@ -0,0 +1,13 @@ +// run-pass + +pub trait Foo<T> { + fn foo(self) -> T; +} + +impl<'a, T> Foo<T> for &'a str where &'a str: Into<T> { + fn foo(self) -> T { + panic!(); + } +} + +fn main() {} diff --git a/src/test/ui/regions/issue-26448-2.rs b/src/test/ui/regions/issue-26448-2.rs new file mode 100644 index 00000000000..c60e06c3ceb --- /dev/null +++ b/src/test/ui/regions/issue-26448-2.rs @@ -0,0 +1,21 @@ +// check-pass + +pub struct Bar<T> { + items: Vec<&'static str>, + inner: T, +} + +pub trait IntoBar<T> { + fn into_bar(self) -> Bar<T>; +} + +impl<'a, T> IntoBar<T> for &'a str where &'a str: Into<T> { + fn into_bar(self) -> Bar<T> { + Bar { + items: Vec::new(), + inner: self.into(), + } + } +} + +fn main() {} diff --git a/src/test/ui/regions/issue-26448-3.rs b/src/test/ui/regions/issue-26448-3.rs new file mode 100644 index 00000000000..d48022c09fe --- /dev/null +++ b/src/test/ui/regions/issue-26448-3.rs @@ -0,0 +1,25 @@ +// check-pass + +pub struct Item { + _inner: &'static str, +} + +pub struct Bar<T> { + items: Vec<Item>, + inner: T, +} + +pub trait IntoBar<T> { + fn into_bar(self) -> Bar<T>; +} + +impl<'a, T> IntoBar<T> for &'a str where &'a str: Into<T> { + fn into_bar(self) -> Bar<T> { + Bar { + items: Vec::new(), + inner: self.into(), + } + } +} + +fn main() {} |
