Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions tests/ui/regions/regions-outlives-nominal-type-enum-region-rev.rs

This file was deleted.

20 changes: 0 additions & 20 deletions tests/ui/regions/regions-outlives-nominal-type-enum-region.rs

This file was deleted.

20 changes: 0 additions & 20 deletions tests/ui/regions/regions-outlives-nominal-type-enum-type-rev.rs

This file was deleted.

20 changes: 0 additions & 20 deletions tests/ui/regions/regions-outlives-nominal-type-enum-type.rs

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions tests/ui/regions/regions-outlives-nominal-type-struct-region.rs

This file was deleted.

20 changes: 0 additions & 20 deletions tests/ui/regions/regions-outlives-nominal-type-struct-type-rev.rs

This file was deleted.

20 changes: 0 additions & 20 deletions tests/ui/regions/regions-outlives-nominal-type-struct-type.rs

This file was deleted.

80 changes: 80 additions & 0 deletions tests/ui/regions/regions-outlives-nominal-type.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
// arguments (like `'a`) outlive `'b`.
//
// Rule OutlivesNominalType from RFC 1214.

//@ check-pass

mod variant_enum_region {
struct Foo<'a> {
x: &'a i32,
}
enum Bar<'a, 'b> {
V(&'a Foo<'b>),
}
}

mod rev_variant_enum_region {
struct Foo<'a> {
x: fn(&'a i32),
}
enum Bar<'a, 'b> {
V(&'a Foo<'b>),
}
}

mod variant_enum_type {
struct Foo<T> {
x: T,
}
enum Bar<'a, 'b> {
V(&'a Foo<&'b i32>),
}
}

mod rev_variant_enum_type {
struct Foo<T> {
x: fn(T),
}
enum Bar<'a, 'b> {
V(&'a Foo<&'b i32>),
}
}

mod variant_struct_region {
struct Foo<'a> {
x: &'a i32,
}
struct Bar<'a, 'b> {
f: &'a Foo<'b>,
}
}

mod rev_variant_struct_region {
struct Foo<'a> {
x: fn(&'a i32),
}
struct Bar<'a, 'b> {
f: &'a Foo<'b>,
}
}

mod variant_struct_type {
struct Foo<T> {
x: T,
}
struct Bar<'a, 'b> {
f: &'a Foo<&'b i32>,
}
}

mod rev_variant_struct_type {
struct Foo<T> {
x: fn(T),
}
struct Bar<'a, 'b> {
f: &'a Foo<&'b i32>,
}
}

fn main() {}
Loading