From d1486108bc517edf8fb401da587e1fac22ffffb0 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sat, 16 Jul 2016 10:45:13 +0200 Subject: Erase regions before computing type layout Fixes #34839 --- src/test/compile-fail/issue-34839.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/test/compile-fail/issue-34839.rs (limited to 'src/test/compile-fail') diff --git a/src/test/compile-fail/issue-34839.rs b/src/test/compile-fail/issue-34839.rs new file mode 100644 index 00000000000..be7e7820020 --- /dev/null +++ b/src/test/compile-fail/issue-34839.rs @@ -0,0 +1,31 @@ +// Copyright 2016 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(rustc_attrs)] +#![allow(dead_code)] + +trait RegularExpression: Sized { + type Text; +} + +struct ExecNoSyncStr<'a>(&'a u8); + +impl<'c> RegularExpression for ExecNoSyncStr<'c> { + type Text = u8; +} + +struct FindCaptures<'t, R>(&'t R::Text) where R: RegularExpression, R::Text: 't; + +enum FindCapturesInner<'r, 't> { + Dynamic(FindCaptures<'t, ExecNoSyncStr<'r>>), +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful -- cgit 1.4.1-3-g733a5