From 3dcc631dee7b2f4be3443b4bbc1dd916436d60ca Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Sun, 22 Feb 2015 07:14:53 -0500 Subject: [PATCH] Add additional test case for superregion --- .../typeck-default-trait-impl-superregion.rs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/test/compile-fail/typeck-default-trait-impl-superregion.rs diff --git a/src/test/compile-fail/typeck-default-trait-impl-superregion.rs b/src/test/compile-fail/typeck-default-trait-impl-superregion.rs new file mode 100644 index 000000000000..4a6a77ac7b44 --- /dev/null +++ b/src/test/compile-fail/typeck-default-trait-impl-superregion.rs @@ -0,0 +1,29 @@ +// Copyright 2015 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. + +// Test that when a `..` impl applies, we also check that any +// supertrait conditions are met. + +#![feature(optin_builtin_traits)] + +use std::marker::MarkerTrait; + +trait MyTrait : 'static {} + +impl MyTrait for .. {} + +fn foo() { } + +fn bar<'a>() { + foo::<&'a ()>(); //~ ERROR does not fulfill the required lifetime +} + +fn main() { +}