From 8c5ef0a09a55032c1b0b922b8b8ec5cc2672452e Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Thu, 19 Jul 2018 23:09:45 -0400 Subject: [PATCH] Add compile-fail test for #42060 Closes #42060 --- src/test/compile-fail/issue-42060.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/compile-fail/issue-42060.rs diff --git a/src/test/compile-fail/issue-42060.rs b/src/test/compile-fail/issue-42060.rs new file mode 100644 index 000000000000..23df42d03c4e --- /dev/null +++ b/src/test/compile-fail/issue-42060.rs @@ -0,0 +1,22 @@ +// 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. + +fn main() { + let thing = (); + let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant + //~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516] +} + +fn f(){ + let q = 1; + ::N //~ ERROR attempt to use a non-constant value in a constant + //~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516] +} +