From 7920a65c5ff8bde8a80b0c350de949c39b3a407d Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Wed, 15 Aug 2018 02:24:05 +0100 Subject: [PATCH] Added tests. --- src/test/run-pass/self-in-typedefs.rs | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/test/run-pass/self-in-typedefs.rs diff --git a/src/test/run-pass/self-in-typedefs.rs b/src/test/run-pass/self-in-typedefs.rs new file mode 100644 index 000000000000..d262e8c60a18 --- /dev/null +++ b/src/test/run-pass/self-in-typedefs.rs @@ -0,0 +1,40 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(self_in_typedefs)] +#![feature(untagged_unions)] + +#![allow(dead_code)] + +enum A<'a, T: 'a> +where + Self: Send, T: PartialEq +{ + Foo(&'a Self), + Bar(T), +} + +struct B<'a, T: 'a> +where + Self: Send, T: PartialEq +{ + foo: &'a Self, + bar: T, +} + +union C<'a, T: 'a> +where + Self: Send, T: PartialEq +{ + foo: &'a Self, + bar: T, +} + +fn main() {}