From bdff9463a0afbbdcd52825ead6b6f9f1245652db Mon Sep 17 00:00:00 2001 From: Christopher Vittal Date: Fri, 10 Nov 2017 12:58:52 -0500 Subject: Add universal_impl_trait feature gate Move feature gate check to inside HIR lowering. Change error messages and update tests. --- .../compile-fail/impl-trait/feature-gate-universal.rs | 16 ++++++++++++++++ src/test/compile-fail/impl-trait/feature-gate.rs | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/test/compile-fail/impl-trait/feature-gate-universal.rs (limited to 'src/test') diff --git a/src/test/compile-fail/impl-trait/feature-gate-universal.rs b/src/test/compile-fail/impl-trait/feature-gate-universal.rs new file mode 100644 index 00000000000..e5bdf3a42eb --- /dev/null +++ b/src/test/compile-fail/impl-trait/feature-gate-universal.rs @@ -0,0 +1,16 @@ +// Copyright 2017 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. + +// gate-test-universal_impl_trait + +fn foo(x: impl std::fmt::Debug) { print!("{:?}", x); } +//~^ ERROR `impl Trait` in argument position is experimental + +fn main() {} diff --git a/src/test/compile-fail/impl-trait/feature-gate.rs b/src/test/compile-fail/impl-trait/feature-gate.rs index f171b6becc4..d46a16450db 100644 --- a/src/test/compile-fail/impl-trait/feature-gate.rs +++ b/src/test/compile-fail/impl-trait/feature-gate.rs @@ -11,6 +11,6 @@ // gate-test-conservative_impl_trait fn foo() -> impl Fn() { || {} } -//~^ ERROR `impl Trait` is experimental +//~^ ERROR `impl Trait` in return position is experimental fn main() {} -- cgit 1.4.1-3-g733a5