add tracking issue and feature-gate and run-make tests

This commit is contained in:
Jorge Aparicio 2017-03-05 23:03:42 -05:00
parent 4c7e277340
commit bc1bd8a609
3 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,15 @@
// 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 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[used]
fn foo() {}
//~^^ ERROR the `#[used]` attribute is an experimental feature
fn main() {}

View file

@ -0,0 +1,12 @@
-include ../tools.mk
ifdef IS_WINDOWS
# Do nothing on MSVC.
all:
exit 0
else
all:
$(RUSTC) -C opt-level=3 --emit=obj used.rs
nm -C used.o | grep FOO
nm -C used.o | grep -v BAR
endif

View file

@ -0,0 +1,17 @@
// 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 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type = "lib"]
#![feature(used)]
#[used]
static FOO: u32 = 0;
static BAR: u32 = 0;