From: Venkata Giri Reddy Date: Thu, 25 May 2017 21:43:25 +0000 (-0400) Subject: regression test for #38160 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=9ee9abcdbd94a54fe53f48065b1b05d96168665e;p=rust.git regression test for #38160 --- diff --git a/src/test/compile-fail/issue-38160.rs b/src/test/compile-fail/issue-38160.rs new file mode 100644 index 00000000000..311d0ceb4d3 --- /dev/null +++ b/src/test/compile-fail/issue-38160.rs @@ -0,0 +1,31 @@ +// 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. + +#![feature(associated_consts, rustc_attrs)] +#![allow(warnings)] + +trait MyTrait { + const MY_CONST: &'static str; +} + +macro_rules! my_macro { + () => { + struct MyStruct; + + impl MyTrait for MyStruct { + const MY_CONST: &'static str = stringify!(abc); + } + } +} + +my_macro!(); + +#[rustc_error] +fn main() {} //~ ERROR compilation successful