[[package]]
name = "rls"
-version = "0.126.0"
+version = "0.127.0"
dependencies = [
"cargo 0.28.0",
"cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-rustc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-vfs 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustfmt-nightly 0.6.0",
+ "rustfmt-nightly 0.6.1",
"serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "rustc-ap-rustc_cratesio_shim"
-version = "110.0.0"
+version = "113.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-rustc_data_structures"
-version = "110.0.0"
+version = "113.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_cratesio_shim 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-rustc_errors"
-version = "110.0.0"
+version = "113.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
+[[package]]
+name = "rustc-ap-rustc_target"
+version = "113.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_cratesio_shim 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
[[package]]
name = "rustc-ap-serialize"
-version = "110.0.0"
+version = "113.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc-ap-syntax"
-version = "110.0.0"
+version = "113.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_errors 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_errors 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_target 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-syntax_pos"
-version = "110.0.0"
+version = "113.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "rustc-ap-rustc_data_structures 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "rustfmt-nightly"
-version = "0.6.0"
+version = "0.6.1"
dependencies = [
"assert_cli 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"derive-new 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_target 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
"checksum rls-rustc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "885f66b92757420572cbb02e033d4a9558c7413ca9b7ac206f28fd58ffdb44ea"
"checksum rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d7c7046dc6a92f2ae02ed302746db4382e75131b9ce20ce967259f6b5867a6a"
"checksum rls-vfs 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "be231e1e559c315bc60ced5ad2cc2d7a9c208ed7d4e2c126500149836fda19bb"
-"checksum rustc-ap-rustc_cratesio_shim 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0256e318ad99c467d24bd7188f2d4a3028360621bb92d769b4b65fc44717d514"
-"checksum rustc-ap-rustc_data_structures 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83430df7f76ea85c1f70fe145041576eee8fd5d77053bf426df24b480918d185"
-"checksum rustc-ap-rustc_errors 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2b03f874277103039816f6467b1ff30a81b1d6a29d4de6efccefe4c488f6535a"
-"checksum rustc-ap-serialize 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a2e47cf949f06b0c7ab7566c2f69d49f28cb3ecf1bb8bf0bda48b1ba5b7945ae"
-"checksum rustc-ap-syntax 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "625e6fb41fde299082cda3bceb08f81c9ba56b14a2ec737b4366f9c3c9be07d8"
-"checksum rustc-ap-syntax_pos 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "474a23ef1a1245ae02c5fd6a1e9a0725ce6fd25ca2294703c03bddce041f867b"
+"checksum rustc-ap-rustc_cratesio_shim 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a01334797c5c4cf56cc40bb9636d7b4c4a076665b9b9b7f100fd666cf0a02ffc"
+"checksum rustc-ap-rustc_data_structures 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03d6f8f7da0de905f6ef80dc14dce3bbc372430622b6aeb421cf13190bc70e8a"
+"checksum rustc-ap-rustc_errors 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3dfd6183804a685c48601651d8c8c7b0daa8f83b0b5e24edfbcb6a0337085127"
+"checksum rustc-ap-rustc_target 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5f223157f51bf0e0621bef099de862468892ee4c4b83056f48f63e1bc00ccb72"
+"checksum rustc-ap-serialize 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2104a55a87d65cba8a845656f1f19a35da52af403863cd2a4bd5876ba522d879"
+"checksum rustc-ap-syntax 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b50671adb9b0a7c57a4690ac6a40cb614879f543b64aada42f55b66212492323"
+"checksum rustc-ap-syntax_pos 113.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "55793c2a775230c42661194c48d44b35d4c8439d79ad8528e56651e854c48c63"
"checksum rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11fb43a206a04116ffd7cfcf9bcb941f8eb6cc7ff667272246b0a1c74259a3cb"
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
"checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7"
"tools/rls/test_data/workspace_symbol",
]
-# Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit
-# MSVC when running the compile-fail test suite when a should-fail test panics.
-# But hey if this is removed and it gets past the bots, sounds good to me.
-[profile.release]
-opt-level = 2
-[profile.bench]
-opt-level = 2
-
# These options are controlled from our rustc wrapper script, so turn them off
# here and have them controlled elsewhere.
[profile.dev]
}
impl Config {
+ fn path_from_python(var_key: &str) -> PathBuf {
+ match env::var_os(var_key) {
+ // Do not trust paths from Python and normalize them slightly (#49785).
+ Some(var_val) => Path::new(&var_val).components().collect(),
+ _ => panic!("expected '{}' to be set", var_key),
+ }
+ }
+
pub fn default_opts() -> Config {
let mut config = Config::default();
config.llvm_enabled = true;
config.deny_warnings = true;
// set by bootstrap.py
- config.src = env::var_os("SRC").map(PathBuf::from).expect("'SRC' to be set");
config.build = INTERNER.intern_str(&env::var("BUILD").expect("'BUILD' to be set"));
- config.out = env::var_os("BUILD_DIR").map(PathBuf::from).expect("'BUILD_DIR' set");
+ config.src = Config::path_from_python("SRC");
+ config.out = Config::path_from_python("BUILD_DIR");
let stage0_root = config.out.join(&config.build).join("stage0/bin");
config.initial_rustc = stage0_root.join(exe("rustc", &config.build));
}
impl BoolTrie {
pub fn lookup(&self, c: char) -> bool {
- let c = c as usize;
+ let c = c as u32;
if c < 0x800 {
- trie_range_leaf(c, self.r1[c >> 6])
+ trie_range_leaf(c, self.r1[(c >> 6) as usize])
} else if c < 0x10000 {
- let child = self.r2[(c >> 6) - 0x20];
+ let child = self.r2[(c >> 6) as usize - 0x20];
trie_range_leaf(c, self.r3[child as usize])
} else {
- let child = self.r4[(c >> 12) - 0x10];
- let leaf = self.r5[((child as usize) << 6) + ((c >> 6) & 0x3f)];
+ let child = self.r4[(c >> 12) as usize - 0x10];
+ let leaf = self.r5[((child as usize) << 6) + ((c >> 6) as usize & 0x3f)];
trie_range_leaf(c, self.r6[leaf as usize])
}
}
impl SmallBoolTrie {
pub fn lookup(&self, c: char) -> bool {
- let c = c as usize;
- match self.r1.get(c >> 6) {
+ let c = c as u32;
+ match self.r1.get((c >> 6) as usize) {
Some(&child) => trie_range_leaf(c, self.r2[child as usize]),
None => false,
}
}
}
-fn trie_range_leaf(c: usize, bitmap_chunk: u64) -> bool {
+fn trie_range_leaf(c: u32, bitmap_chunk: u64) -> bool {
((bitmap_chunk >> (c & 63)) & 1) != 0
}
let mut result = IndexVec::from_elem(vec![], mir.basic_blocks());
for (bb, data) in mir.basic_blocks().iter_enumerated() {
if let Some(ref term) = data.terminator {
- for &tgt in term.successors().iter() {
+ for &tgt in term.successors() {
result[tgt].push(bb);
}
}
use std::borrow::{Cow};
use rustc_data_structures::sync::ReadGuard;
use std::fmt::{self, Debug, Formatter, Write};
-use std::{iter, mem, u32};
+use std::{iter, mem, option, u32};
use std::ops::{Index, IndexMut};
use std::vec::IntoIter;
use syntax::ast::{self, Name};
},
}
+pub type Successors<'a> =
+ iter::Chain<option::IntoIter<&'a BasicBlock>, slice::Iter<'a, BasicBlock>>;
+pub type SuccessorsMut<'a> =
+ iter::Chain<option::IntoIter<&'a mut BasicBlock>, slice::IterMut<'a, BasicBlock>>;
+
impl<'tcx> Terminator<'tcx> {
- pub fn successors(&self) -> Cow<[BasicBlock]> {
+ pub fn successors(&self) -> Successors {
self.kind.successors()
}
- pub fn successors_mut(&mut self) -> Vec<&mut BasicBlock> {
+ pub fn successors_mut(&mut self) -> SuccessorsMut {
self.kind.successors_mut()
}
}
}
- pub fn successors(&self) -> Cow<[BasicBlock]> {
+ pub fn successors(&self) -> Successors {
use self::TerminatorKind::*;
match *self {
- Goto { target: ref b } => slice::from_ref(b).into_cow(),
- SwitchInt { targets: ref b, .. } => b[..].into_cow(),
- Resume | Abort | GeneratorDrop => (&[]).into_cow(),
- Return => (&[]).into_cow(),
- Unreachable => (&[]).into_cow(),
- Call { destination: Some((_, t)), cleanup: Some(c), .. } => vec![t, c].into_cow(),
- Call { destination: Some((_, ref t)), cleanup: None, .. } =>
- slice::from_ref(t).into_cow(),
- Call { destination: None, cleanup: Some(ref c), .. } => slice::from_ref(c).into_cow(),
- Call { destination: None, cleanup: None, .. } => (&[]).into_cow(),
- Yield { resume: t, drop: Some(c), .. } => vec![t, c].into_cow(),
- Yield { resume: ref t, drop: None, .. } => slice::from_ref(t).into_cow(),
- DropAndReplace { target, unwind: Some(unwind), .. } |
- Drop { target, unwind: Some(unwind), .. } => {
- vec![target, unwind].into_cow()
+ Resume | Abort | GeneratorDrop | Return | Unreachable |
+ Call { destination: None, cleanup: None, .. } => {
+ None.into_iter().chain(&[])
+ }
+ Goto { target: ref t } |
+ Call { destination: None, cleanup: Some(ref t), .. } |
+ Call { destination: Some((_, ref t)), cleanup: None, .. } |
+ Yield { resume: ref t, drop: None, .. } |
+ DropAndReplace { target: ref t, unwind: None, .. } |
+ Drop { target: ref t, unwind: None, .. } |
+ Assert { target: ref t, cleanup: None, .. } |
+ FalseUnwind { real_target: ref t, unwind: None } => {
+ Some(t).into_iter().chain(&[])
}
- DropAndReplace { ref target, unwind: None, .. } |
- Drop { ref target, unwind: None, .. } => {
- slice::from_ref(target).into_cow()
+ Call { destination: Some((_, ref t)), cleanup: Some(ref u), .. } |
+ Yield { resume: ref t, drop: Some(ref u), .. } |
+ DropAndReplace { target: ref t, unwind: Some(ref u), .. } |
+ Drop { target: ref t, unwind: Some(ref u), .. } |
+ Assert { target: ref t, cleanup: Some(ref u), .. } |
+ FalseUnwind { real_target: ref t, unwind: Some(ref u) } => {
+ Some(t).into_iter().chain(slice::from_ref(u))
+ }
+ SwitchInt { ref targets, .. } => {
+ None.into_iter().chain(&targets[..])
}
- Assert { target, cleanup: Some(unwind), .. } => vec![target, unwind].into_cow(),
- Assert { ref target, .. } => slice::from_ref(target).into_cow(),
FalseEdges { ref real_target, ref imaginary_targets } => {
- let mut s = vec![*real_target];
- s.extend_from_slice(imaginary_targets);
- s.into_cow()
+ Some(real_target).into_iter().chain(&imaginary_targets[..])
}
- FalseUnwind { real_target: t, unwind: Some(u) } => vec![t, u].into_cow(),
- FalseUnwind { real_target: ref t, unwind: None } => slice::from_ref(t).into_cow(),
}
}
- // FIXME: no mootable cow. I’m honestly not sure what a “cow” between `&mut [BasicBlock]` and
- // `Vec<&mut BasicBlock>` would look like in the first place.
- pub fn successors_mut(&mut self) -> Vec<&mut BasicBlock> {
+ pub fn successors_mut(&mut self) -> SuccessorsMut {
use self::TerminatorKind::*;
match *self {
- Goto { target: ref mut b } => vec![b],
- SwitchInt { targets: ref mut b, .. } => b.iter_mut().collect(),
- Resume | Abort | GeneratorDrop => Vec::new(),
- Return => Vec::new(),
- Unreachable => Vec::new(),
- Call { destination: Some((_, ref mut t)), cleanup: Some(ref mut c), .. } => vec![t, c],
- Call { destination: Some((_, ref mut t)), cleanup: None, .. } => vec![t],
- Call { destination: None, cleanup: Some(ref mut c), .. } => vec![c],
- Call { destination: None, cleanup: None, .. } => vec![],
- Yield { resume: ref mut t, drop: Some(ref mut c), .. } => vec![t, c],
- Yield { resume: ref mut t, drop: None, .. } => vec![t],
- DropAndReplace { ref mut target, unwind: Some(ref mut unwind), .. } |
- Drop { ref mut target, unwind: Some(ref mut unwind), .. } => vec![target, unwind],
- DropAndReplace { ref mut target, unwind: None, .. } |
- Drop { ref mut target, unwind: None, .. } => {
- vec![target]
+ Resume | Abort | GeneratorDrop | Return | Unreachable |
+ Call { destination: None, cleanup: None, .. } => {
+ None.into_iter().chain(&mut [])
+ }
+ Goto { target: ref mut t } |
+ Call { destination: None, cleanup: Some(ref mut t), .. } |
+ Call { destination: Some((_, ref mut t)), cleanup: None, .. } |
+ Yield { resume: ref mut t, drop: None, .. } |
+ DropAndReplace { target: ref mut t, unwind: None, .. } |
+ Drop { target: ref mut t, unwind: None, .. } |
+ Assert { target: ref mut t, cleanup: None, .. } |
+ FalseUnwind { real_target: ref mut t, unwind: None } => {
+ Some(t).into_iter().chain(&mut [])
+ }
+ Call { destination: Some((_, ref mut t)), cleanup: Some(ref mut u), .. } |
+ Yield { resume: ref mut t, drop: Some(ref mut u), .. } |
+ DropAndReplace { target: ref mut t, unwind: Some(ref mut u), .. } |
+ Drop { target: ref mut t, unwind: Some(ref mut u), .. } |
+ Assert { target: ref mut t, cleanup: Some(ref mut u), .. } |
+ FalseUnwind { real_target: ref mut t, unwind: Some(ref mut u) } => {
+ Some(t).into_iter().chain(slice::from_ref_mut(u))
+ }
+ SwitchInt { ref mut targets, .. } => {
+ None.into_iter().chain(&mut targets[..])
}
- Assert { ref mut target, cleanup: Some(ref mut unwind), .. } => vec![target, unwind],
- Assert { ref mut target, .. } => vec![target],
FalseEdges { ref mut real_target, ref mut imaginary_targets } => {
- let mut s = vec![real_target];
- s.extend(imaginary_targets.iter_mut());
- s
+ Some(real_target).into_iter().chain(&mut imaginary_targets[..])
}
- FalseUnwind { real_target: ref mut t, unwind: Some(ref mut u) } => vec![t, u],
- FalseUnwind { ref mut real_target, unwind: None } => vec![real_target],
}
}
impl<'tcx> Debug for TerminatorKind<'tcx> {
fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
self.fmt_head(fmt)?;
- let successors = self.successors();
+ let successor_count = self.successors().count();
let labels = self.fmt_successor_labels();
- assert_eq!(successors.len(), labels.len());
+ assert_eq!(successor_count, labels.len());
- match successors.len() {
+ match successor_count {
0 => Ok(()),
- 1 => write!(fmt, " -> {:?}", successors[0]),
+ 1 => write!(fmt, " -> {:?}", self.successors().nth(0).unwrap()),
_ => {
write!(fmt, " -> [")?;
- for (i, target) in successors.iter().enumerate() {
+ for (i, target) in self.successors().enumerate() {
if i > 0 {
write!(fmt, ", ")?;
}
fn successors<'graph>(&'graph self, node: Self::Node)
-> <Self as GraphSuccessors<'graph>>::Iter
{
- self.basic_blocks[node].terminator().successors().into_owned().into_iter()
+ self.basic_blocks[node].terminator().successors().cloned()
}
}
impl<'a, 'b> GraphSuccessors<'b> for Mir<'a> {
type Item = BasicBlock;
- type Iter = IntoIter<BasicBlock>;
+ type Iter = iter::Cloned<Successors<'b>>;
}
#[derive(Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use std::vec;
-
use rustc_data_structures::bitvec::BitVector;
use rustc_data_structures::indexed_vec::Idx;
let data = &self.mir[idx];
if let Some(ref term) = data.terminator {
- for &succ in term.successors().iter() {
+ for &succ in term.successors() {
self.worklist.push(succ);
}
}
pub struct Postorder<'a, 'tcx: 'a> {
mir: &'a Mir<'tcx>,
visited: BitVector,
- visit_stack: Vec<(BasicBlock, vec::IntoIter<BasicBlock>)>
+ visit_stack: Vec<(BasicBlock, Successors<'a>)>
}
impl<'a, 'tcx> Postorder<'a, 'tcx> {
if let Some(ref term) = data.terminator {
po.visited.insert(root.index());
-
- let succs = term.successors().into_owned().into_iter();
-
- po.visit_stack.push((root, succs));
+ po.visit_stack.push((root, term.successors()));
po.traverse_successor();
}
// two iterations yield `C` and finally `A` for a final traversal of [E, D, B, C, A]
loop {
let bb = if let Some(&mut (_, ref mut iter)) = self.visit_stack.last_mut() {
- if let Some(bb) = iter.next() {
+ if let Some(&bb) = iter.next() {
bb
} else {
break;
if self.visited.insert(bb.index()) {
if let Some(ref term) = self.mir[bb].terminator {
- let succs = term.successors().into_owned().into_iter();
- self.visit_stack.push((bb, succs));
+ self.visit_stack.push((bb, term.successors()));
}
}
}
// We increase the size of the discriminant to avoid LLVM copying
// padding when it doesn't need to. This normally causes unaligned
// load/stores and excessive memcpy/memset operations. By using a
- // bigger integer size, LLVM can be sure about it's contents and
+ // bigger integer size, LLVM can be sure about its contents and
// won't be so conservative.
// Use the initial field alignment
- let mut ity = Integer::for_abi_align(dl, start_align).unwrap_or(min_ity);
+ let mut ity = if def.repr.c() || def.repr.int.is_some() {
+ min_ity
+ } else {
+ Integer::for_abi_align(dl, start_align).unwrap_or(min_ity)
+ };
// If the alignment is not larger than the chosen discriminant size,
// don't use the alignment as the final size.
block_data
.terminator()
.successors()
- .iter()
.map(|&basic_block| Location {
statement_index: 0,
block: basic_block,
block_data
.terminator()
.successors()
- .iter()
.map(|&basic_block| Location {
statement_index: 0,
block: basic_block,
pub struct Edge { source: BasicBlock, index: usize }
fn outgoing(mir: &Mir, bb: BasicBlock) -> Vec<Edge> {
- let succ_len = mir[bb].terminator().successors().len();
- (0..succ_len).map(|index| Edge { source: bb, index: index}).collect()
+ mir[bb].terminator().successors().enumerate()
+ .map(|(index, _)| Edge { source: bb, index: index}).collect()
}
impl<'a, 'tcx, MWF, P> dot::Labeller<'a> for Graph<'a, 'tcx, MWF, P>
fn target(&self, edge: &Edge) -> Node {
let mir = self.mbcx.mir();
- mir[edge.source].terminator().successors()[edge.index]
+ *mir[edge.source].terminator().successors().nth(edge.index).unwrap()
}
}
//! (non-mutating) use of `SRC`. These restrictions are conservative and may be relaxed in the
//! future.
-use rustc::hir;
use rustc::mir::{Constant, Local, LocalKind, Location, Place, Mir, Operand, Rvalue, StatementKind};
use rustc::mir::visit::MutVisitor;
use rustc::ty::TyCtxt;
impl MirPass for CopyPropagation {
fn run_pass<'a, 'tcx>(&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- source: MirSource,
+ _source: MirSource,
mir: &mut Mir<'tcx>) {
- // Don't run on constant MIR, because trans might not be able to
- // evaluate the modified MIR.
- // FIXME(eddyb) Remove check after miri is merged.
- let id = tcx.hir.as_local_node_id(source.def_id).unwrap();
- match (tcx.hir.body_owner_kind(id), source.promoted) {
- (_, Some(_)) |
- (hir::BodyOwnerKind::Const, _) |
- (hir::BodyOwnerKind::Static(_), _) => return,
-
- (hir::BodyOwnerKind::Fn, _) => {
- if tcx.is_const_fn(source.def_id) {
- // Don't run on const functions, as, again, trans might not be able to evaluate
- // the optimized IR.
- return
- }
- }
- }
-
// We only run when the MIR optimization level is > 1.
// This avoids a slow pass, and messing up debug info.
if tcx.sess.opts.debugging_opts.mir_opt_level <= 1 {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use rustc::hir;
use rustc::ty::TyCtxt;
use rustc::mir::*;
use rustc_data_structures::indexed_vec::Idx;
impl MirPass for Deaggregator {
fn run_pass<'a, 'tcx>(&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- source: MirSource,
+ _source: MirSource,
mir: &mut Mir<'tcx>) {
- // Don't run on constant MIR, because trans might not be able to
- // evaluate the modified MIR.
- // FIXME(eddyb) Remove check after miri is merged.
- let id = tcx.hir.as_local_node_id(source.def_id).unwrap();
- match (tcx.hir.body_owner_kind(id), source.promoted) {
- (_, Some(_)) |
- (hir::BodyOwnerKind::Const, _) |
- (hir::BodyOwnerKind::Static(_), _) => return,
-
- (hir::BodyOwnerKind::Fn, _) => {
- if tcx.is_const_fn(source.def_id) {
- // Don't run on const functions, as, again, trans might not be able to evaluate
- // the optimized IR.
- return
- }
- }
- }
-
let (basic_blocks, local_decls) = mir.basic_blocks_and_local_decls_mut();
let local_decls = &*local_decls;
for bb in basic_blocks {
use dataflow::{drop_flag_effects_for_location, on_lookup_result_bits};
use dataflow::MoveDataParamEnv;
use dataflow::{self, do_dataflow, DebugFormatted};
-use rustc::hir;
use rustc::ty::{self, TyCtxt};
use rustc::mir::*;
use rustc::middle::const_val::ConstVal;
{
debug!("elaborate_drops({:?} @ {:?})", src, mir.span);
- // Don't run on constant MIR, because trans might not be able to
- // evaluate the modified MIR.
- // FIXME(eddyb) Remove check after miri is merged.
let id = tcx.hir.as_local_node_id(src.def_id).unwrap();
- match (tcx.hir.body_owner_kind(id), src.promoted) {
- (hir::BodyOwnerKind::Fn, None) => {},
- _ => return
- }
let param_env = tcx.param_env(src.def_id).with_reveal_all();
let move_data = MoveData::gather_moves(mir, tcx).unwrap();
let elaborate_patch = {
}
if !is_drop {
- for &succ in &term.successors()[..] {
+ for &succ in term.successors() {
work_list.push(succ);
}
}
TerminatorKind::SwitchInt { .. } |
TerminatorKind::FalseEdges { .. } |
TerminatorKind::FalseUnwind { .. } => {
- terminator.successors().iter().all(|succ| {
+ terminator.successors().all(|succ| {
nop_landing_pads.contains(succ.index())
})
},
for (_, data) in traversal::preorder(mir) {
if let Some(ref term) = data.terminator {
- for &tgt in term.successors().iter() {
+ for &tgt in term.successors() {
pred_count[tgt] += 1;
}
}
};
let first_succ = {
- let successors = terminator.successors();
- if let Some(&first_succ) = terminator.successors().get(0) {
- if successors.iter().all(|s| *s == first_succ) {
- self.pred_count[first_succ] -= (successors.len()-1) as u32;
+ if let Some(&first_succ) = terminator.successors().nth(0) {
+ if terminator.successors().all(|s| *s == first_succ) {
+ let count = terminator.successors().count();
+ self.pred_count[first_succ] -= (count - 1) as u32;
first_succ
} else {
return false
let terminator = mir[source].terminator();
let labels = terminator.kind.fmt_successor_labels();
- for (&target, label) in terminator.successors().iter().zip(labels) {
+ for (&target, label) in terminator.successors().zip(labels) {
writeln!(w, r#" {} -> {} [label="{}"];"#, node(source), node(target), label)?;
}
for b in mir.basic_blocks().indices().rev() {
// outs[b] = ∪ {ins of successors}
bits.clear();
- for &successor in mir.basic_blocks()[b].terminator().successors().into_iter() {
+ for &successor in mir.basic_blocks()[b].terminator().successors() {
bits.union(&ins[successor]);
}
outs[b].clone_from(&bits);
use resolve_imports::ImportDirective;
use resolve_imports::ImportDirectiveSubclass::{self, GlobImport, SingleImport};
use {Module, ModuleData, ModuleKind, NameBinding, NameBindingKind, ToNameBinding};
-use {Resolver, ResolverArenas};
+use {PerNS, Resolver, ResolverArenas};
use Namespace::{self, TypeNS, ValueNS, MacroNS};
use {resolve_error, resolve_struct_error, ResolutionError};
struct LegacyMacroImports {
import_all: Option<Span>,
imports: Vec<(Name, Span)>,
- reexports: Vec<(Name, Span)>,
}
impl<'a> Resolver<'a> {
let subclass = SingleImport {
target: ident,
source,
- result: self.per_ns(|_, _| Cell::new(Err(Undetermined))),
+ result: PerNS {
+ type_ns: Cell::new(Err(Undetermined)),
+ value_ns: Cell::new(Err(Undetermined)),
+ macro_ns: Cell::new(Err(Undetermined)),
+ },
type_ns_only,
};
self.add_import_directive(
let legacy_imports = self.legacy_macro_imports(&item.attrs);
let mut used = legacy_imports != LegacyMacroImports::default();
- // `#[macro_use]` and `#[macro_reexport]` are only allowed at the crate root.
+ // `#[macro_use]` is only allowed at the crate root.
if self.current_module.parent.is_some() && used {
span_err!(self.session, item.span, E0468,
"an `extern crate` loading macros must be at the crate root");
}
}
}
- for (name, span) in legacy_imports.reexports {
- self.cstore.export_macros_untracked(module.def_id().unwrap().krate);
- let ident = Ident::with_empty_ctxt(name);
- let result = self.resolve_ident_in_module(module, ident, MacroNS, false, false, span);
- if let Ok(binding) = result {
- let (def, vis) = (binding.def(), binding.vis);
- self.macro_exports.push(Export { ident, def, vis, span, is_import: true });
- } else {
- span_err!(self.session, span, E0470, "re-exported macro not found");
- }
- }
used
}
},
None => imports.import_all = Some(attr.span),
}
- } else if attr.check_name("macro_reexport") {
- let bad_macro_reexport = |this: &mut Self, span| {
- span_err!(this.session, span, E0467, "bad macro re-export");
- };
- if let Some(names) = attr.meta_item_list() {
- for attr in names {
- if let Some(word) = attr.word() {
- imports.reexports.push((word.ident.name, attr.span()));
- } else {
- bad_macro_reexport(self, attr.span());
- }
- }
- } else {
- bad_macro_reexport(self, attr.span());
- }
}
}
imports
arguments.
"##,
-E0467: r##"
-Macro re-export declarations were empty or malformed.
-
-Erroneous code examples:
-
-```compile_fail,E0467
-#[macro_reexport] // error: no macros listed for export
-extern crate core as macros_for_good;
-
-#[macro_reexport(fun_macro = "foo")] // error: not a macro identifier
-extern crate core as other_macros_for_good;
-```
-
-This is a syntax error at the level of attribute declarations.
-
-Currently, `macro_reexport` requires at least one macro name to be listed.
-Unlike `macro_use`, listing no names does not re-export all macros from the
-given crate.
-
-Decide which macros you would like to export and list them properly.
-
-These are proper re-export declarations:
-
-```ignore (cannot-doctest-multicrate-project)
-#[macro_reexport(some_macro, another_macro)]
-extern crate macros_for_good;
-```
-"##,
-
E0468: r##"
A non-root module attempts to import macros from another crate.
```
"##,
-E0470: r##"
-A macro listed for re-export was not found.
-
-Erroneous code example:
-
-```compile_fail,E0470
-#[macro_reexport(drink, be_merry)]
-extern crate alloc;
-
-fn main() {
- // ...
-}
-```
-
-Either the listed macro is not contained in the imported crate, or it is not
-exported from the given crate.
-
-This could be caused by a typo. Did you misspell the macro's name?
-
-Double-check the names of the macros listed for re-export, and that the crate
-in question exports them.
-
-A working version:
-
-```ignore (cannot-doctest-multicrate-project)
-// In some_crate crate:
-#[macro_export]
-macro_rules! eat {
- ...
-}
-
-#[macro_export]
-macro_rules! drink {
- ...
-}
-
-// In your_crate:
-#[macro_reexport(eat, drink)]
-extern crate some_crate;
-```
-"##,
-
E0530: r##"
A binding shadowed something it shouldn't.
// E0421, merged into 531
E0531, // unresolved pattern path kind `name`
// E0427, merged into 530
+// E0467, removed
+// E0470, removed
E0573,
E0574,
E0575,
pub struct PerNS<T> {
value_ns: T,
type_ns: T,
- macro_ns: Option<T>,
+ macro_ns: T,
}
impl<T> ::std::ops::Index<Namespace> for PerNS<T> {
match ns {
ValueNS => &self.value_ns,
TypeNS => &self.type_ns,
- MacroNS => self.macro_ns.as_ref().unwrap(),
+ MacroNS => &self.macro_ns,
}
}
}
match ns {
ValueNS => &mut self.value_ns,
TypeNS => &mut self.type_ns,
- MacroNS => self.macro_ns.as_mut().unwrap(),
+ MacroNS => &mut self.macro_ns,
}
}
}
graph_root: Module<'a>,
prelude: Option<Module<'a>>,
+ extern_prelude: FxHashSet<Name>,
/// n.b. This is used only for better diagnostics, not name resolution itself.
has_self: FxHashSet<DefId>,
// AST.
graph_root,
prelude: None,
+ extern_prelude: session.opts.externs.iter().map(|kv| Symbol::intern(kv.0)).collect(),
has_self: FxHashSet(),
field_names: FxHashMap(),
ribs: PerNS {
value_ns: vec![Rib::new(ModuleRibKind(graph_root))],
type_ns: vec![Rib::new(ModuleRibKind(graph_root))],
- macro_ns: Some(vec![Rib::new(ModuleRibKind(graph_root))]),
+ macro_ns: vec![Rib::new(ModuleRibKind(graph_root))],
},
label_ribs: Vec::new(),
}
/// Runs the function on each namespace.
- fn per_ns<T, F: FnMut(&mut Self, Namespace) -> T>(&mut self, mut f: F) -> PerNS<T> {
- PerNS {
- type_ns: f(self, TypeNS),
- value_ns: f(self, ValueNS),
- macro_ns: match self.use_extern_macros {
- true => Some(f(self, MacroNS)),
- false => None,
- },
+ fn per_ns<F: FnMut(&mut Self, Namespace)>(&mut self, mut f: F) {
+ f(self, TypeNS);
+ f(self, ValueNS);
+ if self.use_extern_macros {
+ f(self, MacroNS);
}
}
}
}
- match self.prelude {
- Some(prelude) if !module.no_implicit_prelude => {
- self.resolve_ident_in_module_unadjusted(prelude, ident, ns, false, false, path_span)
- .ok().map(LexicalScopeBinding::Item)
+ if !module.no_implicit_prelude {
+ // `record_used` means that we don't try to load crates during speculative resolution
+ if record_used && ns == TypeNS && self.extern_prelude.contains(&ident.name) {
+ if !self.session.features_untracked().extern_prelude {
+ feature_err(&self.session.parse_sess, "extern_prelude",
+ ident.span, GateIssue::Language,
+ "access to extern crates through prelude is experimental").emit();
+ }
+
+ let crate_id = self.crate_loader.process_path_extern(ident.name, ident.span);
+ let crate_root = self.get_module(DefId { krate: crate_id, index: CRATE_DEF_INDEX });
+ self.populate_module_if_necessary(crate_root);
+
+ let binding = (crate_root, ty::Visibility::Public,
+ ident.span, Mark::root()).to_name_binding(self.arenas);
+ return Some(LexicalScopeBinding::Item(binding));
+ }
+ if let Some(prelude) = self.prelude {
+ if let Ok(binding) = self.resolve_ident_in_module_unadjusted(prelude, ident, ns,
+ false, false, path_span) {
+ return Some(LexicalScopeBinding::Item(binding));
+ }
}
- _ => None,
}
+
+ None
}
fn hygienic_lexical_parent(&mut self, mut module: Module<'a>, span: &mut Span)
// We can see through blocks
} else {
// Items from the prelude
- if let Some(prelude) = self.prelude {
- if !module.no_implicit_prelude {
+ if !module.no_implicit_prelude {
+ names.extend(self.extern_prelude.iter().cloned());
+ if let Some(prelude) = self.prelude {
add_module_candidates(prelude, &mut names);
}
}
use syntax_pos::Span;
use std::cell::{Cell, RefCell};
-use std::mem;
+use std::{mem, ptr};
/// Contains data for specific types of import directives.
#[derive(Clone, Debug)]
None,
/// Only the given single import can define the name in the namespace.
MaybeOne(&'a ImportDirective<'a>),
+ /// Only one of these two single imports can define the name in the namespace.
+ MaybeTwo(&'a ImportDirective<'a>, &'a ImportDirective<'a>),
/// At least one single import will define the name in the namespace.
AtLeastOne,
}
}
impl<'a> SingleImports<'a> {
- fn add_directive(&mut self, directive: &'a ImportDirective<'a>) {
+ fn add_directive(&mut self, directive: &'a ImportDirective<'a>, use_extern_macros: bool) {
match *self {
SingleImports::None => *self = SingleImports::MaybeOne(directive),
- // If two single imports can define the name in the namespace, we can assume that at
- // least one of them will define it since otherwise both would have to define only one
- // namespace, leading to a duplicate error.
- SingleImports::MaybeOne(_) => *self = SingleImports::AtLeastOne,
+ SingleImports::MaybeOne(directive_one) => *self = if use_extern_macros {
+ SingleImports::MaybeTwo(directive_one, directive)
+ } else {
+ SingleImports::AtLeastOne
+ },
+ // If three single imports can define the name in the namespace, we can assume that at
+ // least one of them will define it since otherwise we'd get duplicate errors in one of
+ // other namespaces.
+ SingleImports::MaybeTwo(..) => *self = SingleImports::AtLeastOne,
SingleImports::AtLeastOne => {}
};
}
- fn directive_failed(&mut self) {
+ fn directive_failed(&mut self, dir: &'a ImportDirective<'a>) {
match *self {
SingleImports::None => unreachable!(),
SingleImports::MaybeOne(_) => *self = SingleImports::None,
+ SingleImports::MaybeTwo(dir1, dir2) =>
+ *self = SingleImports::MaybeOne(if ptr::eq(dir1, dir) { dir1 } else { dir2 }),
SingleImports::AtLeastOne => {}
}
}
}
// Check if a single import can still define the name.
+ let resolve_single_import = |this: &mut Self, directive: &'a ImportDirective<'a>| {
+ let module = match directive.imported_module.get() {
+ Some(module) => module,
+ None => return false,
+ };
+ let ident = match directive.subclass {
+ SingleImport { source, .. } => source,
+ _ => unreachable!(),
+ };
+ match this.resolve_ident_in_module(module, ident, ns, false, false, path_span) {
+ Err(Determined) => {}
+ _ => return false,
+ }
+ true
+ };
match resolution.single_imports {
SingleImports::AtLeastOne => return Err(Undetermined),
- SingleImports::MaybeOne(directive) if self.is_accessible(directive.vis.get()) => {
- let module = match directive.imported_module.get() {
- Some(module) => module,
- None => return Err(Undetermined),
- };
- let ident = match directive.subclass {
- SingleImport { source, .. } => source,
- _ => unreachable!(),
- };
- match self.resolve_ident_in_module(module, ident, ns, false, false, path_span) {
- Err(Determined) => {}
- _ => return Err(Undetermined),
+ SingleImports::MaybeOne(directive) => {
+ let accessible = self.is_accessible(directive.vis.get());
+ if accessible {
+ if !resolve_single_import(self, directive) {
+ return Err(Undetermined)
+ }
+ }
+ }
+ SingleImports::MaybeTwo(directive1, directive2) => {
+ let accessible1 = self.is_accessible(directive1.vis.get());
+ let accessible2 = self.is_accessible(directive2.vis.get());
+ if accessible1 && accessible2 {
+ if !resolve_single_import(self, directive1) &&
+ !resolve_single_import(self, directive2) {
+ return Err(Undetermined)
+ }
+ } else if accessible1 {
+ if !resolve_single_import(self, directive1) {
+ return Err(Undetermined)
+ }
+ } else {
+ if !resolve_single_import(self, directive2) {
+ return Err(Undetermined)
+ }
}
}
- SingleImports::MaybeOne(_) | SingleImports::None => {},
+ SingleImports::None => {},
}
let no_unresolved_invocations =
SingleImport { target, .. } => {
self.per_ns(|this, ns| {
let mut resolution = this.resolution(current_module, target, ns).borrow_mut();
- resolution.single_imports.add_directive(directive);
+ resolution.single_imports.add_directive(directive, this.use_extern_macros);
});
}
// We don't add prelude imports to the globs since they only affect lexical scopes,
Err(Undetermined) => indeterminate = true,
Err(Determined) => {
this.update_resolution(parent, target, ns, |_, resolution| {
- resolution.single_imports.directive_failed()
+ resolution.single_imports.directive_failed(directive)
});
}
Ok(binding) if !binding.is_importable() => {
.map(|ty| dtorck_constraint_for_ty(tcx, span, for_ty, depth + 1, ty))
.collect(),
- ty::TyGenerator(def_id, substs, _) => {
- // Note that the interior types are ignored here.
- // Any type reachable inside the interior must also be reachable
- // through the upvars.
- substs
- .upvar_tys(def_id, tcx)
- .map(|ty| dtorck_constraint_for_ty(tcx, span, for_ty, depth + 1, ty))
- .collect()
+ ty::TyGenerator(def_id, substs, _interior) => {
+ // rust-lang/rust#49918: types can be constructed, stored
+ // in the interior, and sit idle when generator yields
+ // (and is subsequently dropped).
+ //
+ // It would be nice to descend into interior of a
+ // generator to determine what effects dropping it might
+ // have (by looking at any drop effects associated with
+ // its interior).
+ //
+ // However, the interior's representation uses things like
+ // TyGeneratorWitness that explicitly assume they are not
+ // traversed in such a manner. So instead, we will
+ // simplify things for now by treating all generators as
+ // if they were like trait objects, where its upvars must
+ // all be alive for the generator's (potential)
+ // destructor.
+ //
+ // In particular, skipping over `_interior` is safe
+ // because any side-effects from dropping `_interior` can
+ // only take place through references with lifetimes
+ // derived from lifetimes attached to the upvars, and we
+ // *do* incorporate the upvars here.
+
+ let constraint = DtorckConstraint {
+ outlives: substs.upvar_tys(def_id, tcx).map(|t| t.into()).collect(),
+ dtorck_types: vec![],
+ overflows: vec![],
+ };
+ debug!("dtorck_constraint: generator {:?} => {:?}", def_id, constraint);
+
+ Ok(constraint)
}
ty::TyAdt(def, substs) => {
debug!("cleanup_kinds: {:?}/{:?}/{:?} propagating funclet {:?}",
bb, data, result[bb], funclet);
- for &succ in data.terminator().successors().iter() {
+ for &succ in data.terminator().successors() {
let kind = result[succ];
debug!("cleanup_kinds: propagating {:?} to {:?}/{:?}",
funclet, succ, kind);
inlining: bool,
/// Is the current module and all of its parents public?
inside_public_path: bool,
- reexported_macros: FxHashSet<DefId>,
exact_paths: Option<FxHashMap<DefId, Vec<String>>>,
}
view_item_stack: stack,
inlining: false,
inside_public_path: true,
- reexported_macros: FxHashSet(),
exact_paths: Some(FxHashMap()),
cstore,
}
if let Some(exports) = self.cx.tcx.module_exports(def_id) {
for export in exports.iter().filter(|e| e.vis == Visibility::Public) {
if let Def::Macro(def_id, ..) = export.def {
- if def_id.krate == LOCAL_CRATE || self.reexported_macros.contains(&def_id) {
+ if def_id.krate == LOCAL_CRATE {
continue // These are `krate.exported_macros`, handled in `self.visit()`.
}
let is_no_inline = use_attrs.lists("doc").has_word("no_inline") ||
use_attrs.lists("doc").has_word("hidden");
- // Memoize the non-inlined `pub use`'d macros so we don't push an extra
- // declaration in `visit_mod_contents()`
- if !def_did.is_local() {
- if let Def::Macro(did, _) = def {
- if please_inline { return true }
- debug!("memoizing non-inlined macro export: {:?}", def);
- self.reexported_macros.insert(did);
- return false;
- }
- }
-
// For cross-crate impl inlining we need to know whether items are
// reachable in documentation - a previously nonreachable item can be
// made reachable by cross-crate inlining which we're checking here.
#![feature(libc)]
#![feature(link_args)]
#![feature(linkage)]
-#![feature(macro_reexport)]
#![feature(macro_vis_matcher)]
#![feature(needs_panic_runtime)]
#![feature(never_type)]
#![feature(unboxed_closures)]
#![feature(untagged_unions)]
#![feature(unwind_attributes)]
+#![feature(use_extern_macros)]
#![feature(vec_push_all)]
#![feature(doc_cfg)]
#![feature(doc_masked)]
#[cfg(test)] extern crate test;
#[cfg(test)] extern crate rand;
-// We want to re-export a few macros from core but libcore has already been
-// imported by the compiler (via our #[no_std] attribute) In this case we just
-// add a new crate name so we can attach the re-exports to it.
-#[macro_reexport(assert_eq, assert_ne, debug_assert, debug_assert_eq,
- debug_assert_ne, unreachable, unimplemented, write, writeln, try)]
-extern crate core as __core;
+// Re-export a few macros from core
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use core::{assert_eq, assert_ne, debug_assert, debug_assert_eq, debug_assert_ne};
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use core::{unreachable, unimplemented, write, writeln, try};
+#[allow(unused_imports)] // macros from `alloc` are not used on all platforms
#[macro_use]
-#[macro_reexport(vec, format)]
extern crate alloc as alloc_crate;
extern crate alloc_system;
#[doc(masked)]
#[stable(feature = "rust1", since = "1.0.0")]
pub use alloc_crate::fmt;
#[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc_crate::format;
+#[stable(feature = "rust1", since = "1.0.0")]
pub use alloc_crate::slice;
#[stable(feature = "rust1", since = "1.0.0")]
pub use alloc_crate::str;
}
};
- ($((removed, $feature: ident, $ver: expr, $issue: expr, None),)+) => {
+ ($((removed, $feature: ident, $ver: expr, $issue: expr, None, $reason: expr),)+) => {
/// Represents unstable features which have since been removed (it was once Active)
- const REMOVED_FEATURES: &'static [(&'static str, &'static str, Option<u32>)] = &[
- $((stringify!($feature), $ver, $issue)),+
+ const REMOVED_FEATURES: &[(&str, &str, Option<u32>, Option<&str>)] = &[
+ $((stringify!($feature), $ver, $issue, $reason)),+
];
};
($((stable_removed, $feature: ident, $ver: expr, $issue: expr, None),)+) => {
/// Represents stable features which have since been removed (it was once Accepted)
- const STABLE_REMOVED_FEATURES: &'static [(&'static str, &'static str, Option<u32>)] = &[
- $((stringify!($feature), $ver, $issue)),+
+ const STABLE_REMOVED_FEATURES: &[(&str, &str, Option<u32>, Option<&str>)] = &[
+ $((stringify!($feature), $ver, $issue, None)),+
];
};
($((accepted, $feature: ident, $ver: expr, $issue: expr, None),)+) => {
/// Those language feature has since been Accepted (it was once Active)
- const ACCEPTED_FEATURES: &'static [(&'static str, &'static str, Option<u32>)] = &[
- $((stringify!($feature), $ver, $issue)),+
+ const ACCEPTED_FEATURES: &[(&str, &str, Option<u32>, Option<&str>)] = &[
+ $((stringify!($feature), $ver, $issue, None)),+
];
}
}
// OIBIT specific features
(active, optin_builtin_traits, "1.0.0", Some(13231), None),
- // macro re-export needs more discussion and stabilization
- (active, macro_reexport, "1.0.0", Some(29638), None),
-
// Allows use of #[staged_api]
// rustc internal
(active, staged_api, "1.0.0", None, None),
(active, generic_associated_types, "1.23.0", Some(44265), None),
// Resolve absolute paths as paths from other crates
- (active, extern_absolute_paths, "1.24.0", Some(44660), None),
+ (active, extern_absolute_paths, "1.24.0", Some(44660), Some(Edition::Edition2018)),
// `foo.rs` as an alternative to `foo/mod.rs`
(active, non_modrs_mods, "1.24.0", Some(44660), Some(Edition::Edition2018)),
// #[doc(alias = "...")]
(active, doc_alias, "1.27.0", Some(50146), None),
+
+ // Access to crate names passed via `--extern` through prelude
+ (active, extern_prelude, "1.27.0", Some(44660), Some(Edition::Edition2018)),
);
declare_features! (
- (removed, import_shadowing, "1.0.0", None, None),
- (removed, managed_boxes, "1.0.0", None, None),
+ (removed, import_shadowing, "1.0.0", None, None, None),
+ (removed, managed_boxes, "1.0.0", None, None, None),
// Allows use of unary negate on unsigned integers, e.g. -e for e: u8
- (removed, negate_unsigned, "1.0.0", Some(29645), None),
- (removed, reflect, "1.0.0", Some(27749), None),
+ (removed, negate_unsigned, "1.0.0", Some(29645), None, None),
+ (removed, reflect, "1.0.0", Some(27749), None, None),
// A way to temporarily opt out of opt in copy. This will *never* be accepted.
- (removed, opt_out_copy, "1.0.0", None, None),
- (removed, quad_precision_float, "1.0.0", None, None),
- (removed, struct_inherit, "1.0.0", None, None),
- (removed, test_removed_feature, "1.0.0", None, None),
- (removed, visible_private_types, "1.0.0", None, None),
- (removed, unsafe_no_drop_flag, "1.0.0", None, None),
+ (removed, opt_out_copy, "1.0.0", None, None, None),
+ (removed, quad_precision_float, "1.0.0", None, None, None),
+ (removed, struct_inherit, "1.0.0", None, None, None),
+ (removed, test_removed_feature, "1.0.0", None, None, None),
+ (removed, visible_private_types, "1.0.0", None, None, None),
+ (removed, unsafe_no_drop_flag, "1.0.0", None, None, None),
// Allows using items which are missing stability attributes
// rustc internal
- (removed, unmarked_api, "1.0.0", None, None),
- (removed, pushpop_unsafe, "1.2.0", None, None),
- (removed, allocator, "1.0.0", None, None),
- // Allows the `#[simd]` attribute -- removed in favor of `#[repr(simd)]`
- (removed, simd, "1.0.0", Some(27731), None),
- // Merged into `slice_patterns`
- (removed, advanced_slice_patterns, "1.0.0", Some(23121), None),
+ (removed, unmarked_api, "1.0.0", None, None, None),
+ (removed, pushpop_unsafe, "1.2.0", None, None, None),
+ (removed, allocator, "1.0.0", None, None, None),
+ (removed, simd, "1.0.0", Some(27731), None,
+ Some("removed in favor of `#[repr(simd)]`")),
+ (removed, advanced_slice_patterns, "1.0.0", Some(23121), None,
+ Some("merged into `#![feature(slice_patterns)]`")),
+ (removed, macro_reexport, "1.0.0", Some(29638), None,
+ Some("subsumed by `#![feature(use_extern_macros)]` and `pub use`")),
);
declare_features! (
("forbid", Normal, Ungated),
("deny", Normal, Ungated),
- ("macro_reexport", Normal, Ungated),
("macro_use", Normal, Ungated),
("macro_export", Normal, Ungated),
("plugin_registrar", Normal, Ungated),
let found = ACCEPTED_FEATURES.iter().chain(REMOVED_FEATURES).chain(STABLE_REMOVED_FEATURES)
.find(|t| t.0 == feature);
match found {
- Some(&(_, _, issue)) => issue,
+ Some(&(_, _, issue, _)) => issue,
None => panic!("Feature `{}` is not declared anywhere", feature),
}
}
gate_feature_post!(&self, underscore_imports, i.span,
"renaming extern crates with `_` is unstable");
}
- if let Some(attr) = attr::find_by_name(&i.attrs[..], "macro_reexport") {
- gate_feature_post!(&self, macro_reexport, attr.span,
- "macros re-exports are experimental \
- and possibly buggy");
- }
}
ast::ItemKind::ForeignMod(ref foreign_module) => {
pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute],
crate_edition: Edition) -> Features {
- fn feature_removed(span_handler: &Handler, span: Span) {
- span_err!(span_handler, span, E0557, "feature has been removed");
+ fn feature_removed(span_handler: &Handler, span: Span, reason: Option<&str>) {
+ let mut err = struct_span_err!(span_handler, span, E0557, "feature has been removed");
+ if let Some(reason) = reason {
+ err.span_note(span, reason);
+ }
+ err.emit();
}
let mut features = Features::new();
set(&mut features, mi.span);
feature_checker.collect(&features, mi.span);
}
- else if let Some(&(_, _, _)) = REMOVED_FEATURES.iter()
- .find(|& &(n, _, _)| name == n)
+ else if let Some(&(.., reason)) = REMOVED_FEATURES.iter()
+ .find(|& &(n, ..)| name == n)
.or_else(|| STABLE_REMOVED_FEATURES.iter()
- .find(|& &(n, _, _)| name == n)) {
- feature_removed(span_handler, mi.span);
+ .find(|& &(n, ..)| name == n)) {
+ feature_removed(span_handler, mi.span, reason);
}
- else if let Some(&(_, _, _)) = ACCEPTED_FEATURES.iter()
- .find(|& &(n, _, _)| name == n) {
+ else if let Some(&(..)) = ACCEPTED_FEATURES.iter()
+ .find(|& &(n, ..)| name == n) {
features.declared_stable_lang_features.push((name, mi.span));
} else if let Some(&edition) = ALL_EDITIONS.iter()
.find(|e| name == e.feature_name()) {
if edition <= crate_edition {
- feature_removed(span_handler, mi.span);
+ feature_removed(span_handler, mi.span, None);
} else {
for &(.., f_edition, set) in ACTIVE_FEATURES.iter() {
if let Some(f_edition) = f_edition {
debug!("mk_printer {}", linewidth);
Printer {
out,
- buf_len: n,
+ buf_max_len: n,
margin: linewidth as isize,
space: linewidth as isize,
left: 0,
right: 0,
- buf: vec![BufEntry { token: Token::Eof, size: 0 }; n],
+ // Initialize a single entry; advance_right() will extend it on demand
+ // up to `buf_max_len` elements.
+ buf: vec![BufEntry::default()],
left_total: 0,
right_total: 0,
scan_stack: VecDeque::new(),
pub struct Printer<'a> {
out: Box<io::Write+'a>,
- buf_len: usize,
+ buf_max_len: usize,
/// Width of lines we're constrained to
margin: isize,
/// Number of spaces left on line
size: isize,
}
+impl Default for BufEntry {
+ fn default() -> Self {
+ BufEntry { token: Token::Eof, size: 0 }
+ }
+}
+
impl<'a> Printer<'a> {
pub fn last_token(&mut self) -> Token {
self.buf[self.right].token.clone()
self.right_total = 1;
self.left = 0;
self.right = 0;
- } else { self.advance_right(); }
+ } else {
+ self.advance_right();
+ }
debug!("pp Begin({})/buffer Vec<{},{}>",
b.offset, self.left, self.right);
self.buf[self.right] = BufEntry { token: token, size: -self.right_total };
self.right_total = 1;
self.left = 0;
self.right = 0;
- } else { self.advance_right(); }
+ } else {
+ self.advance_right();
+ }
debug!("pp Break({})/buffer Vec<{},{}>",
b.offset, self.left, self.right);
self.check_stack(0);
}
pub fn advance_right(&mut self) {
self.right += 1;
- self.right %= self.buf_len;
+ self.right %= self.buf_max_len;
+ // Extend the buf if necessary.
+ if self.right == self.buf.len() {
+ self.buf.push(BufEntry::default());
+ }
assert_ne!(self.right, self.left);
}
pub fn advance_left(&mut self) -> io::Result<()> {
}
self.left += 1;
- self.left %= self.buf_len;
+ self.left %= self.buf_max_len;
left_size = self.buf[self.left].size;
}
+++ /dev/null
-// Copyright 2014 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.
-
-// Test that macro re-exports item are gated by `macro_reexport` feature gate.
-
-// aux-build:macro_reexport_1.rs
-// gate-test-macro_reexport
-
-#![crate_type = "dylib"]
-
-#[macro_reexport(reexported)]
-//~^ ERROR macros re-exports are experimental and possibly buggy
-#[macro_use] #[no_link]
-extern crate macro_reexport_1;
+++ /dev/null
-// 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 <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 = "dylib"]
-
-// Since we load a serialized macro with all its attributes, accidentally
-// re-exporting a `#[macro_export] macro_rules!` is something of a concern!
-//
-// We avoid it at the moment only because of the order in which we do things.
-
-#[macro_use] #[no_link]
-extern crate macro_reexport_1;
+++ /dev/null
-// Copyright 2014 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 = "dylib"]
-#[macro_export]
-macro_rules! reexported {
- () => ( 3 )
-}
+++ /dev/null
-// 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 <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.
-
-// aux-build:macro_reexport_1.rs
-// aux-build:macro_non_reexport_2.rs
-
-#[macro_use] #[no_link]
-extern crate macro_non_reexport_2;
-
-fn main() {
- assert_eq!(reexported!(), 3);
- //~^ ERROR cannot find macro `reexported!` in this scope
-}
+++ /dev/null
-// Copyright 2014 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.
-
-#![no_std]
-#![feature(macro_reexport)]
-
-#[allow(unused_extern_crates)]
-#[macro_reexport] //~ ERROR bad macro re-export
-extern crate std;
+++ /dev/null
-// Copyright 2014 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.
-
-#![no_std]
-#![feature(macro_reexport)]
-
-#[allow(unused_extern_crates)]
-#[macro_reexport="foo"] //~ ERROR bad macro re-export
-extern crate std;
+++ /dev/null
-// Copyright 2014 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.
-
-#![no_std]
-#![feature(macro_reexport)]
-
-#[allow(unused_extern_crates)]
-#[macro_reexport(foo="bar")] //~ ERROR bad macro re-export
-extern crate std;
+++ /dev/null
-// 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 <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.
-
-// aux-build:macro_reexport_1.rs
-
-#![feature(macro_reexport)]
-
-#[macro_reexport(reexported)]
-#[no_link]
-extern crate macro_reexport_1;
-
-fn main() {
- assert_eq!(reexported!(), 3);
- //~^ ERROR cannot find macro
-}
+++ /dev/null
-// 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 <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.
-
-// aux-build:two_macros.rs
-
-#![feature(macro_reexport)]
-
-#[macro_use(macro_two)]
-#[macro_reexport(no_way)] //~ ERROR re-exported macro not found
-extern crate two_macros;
-
-pub fn main() {
- macro_two!();
-}
--- /dev/null
+-include ../tools.mk
+
+all:
+ $(RUSTC) ep-lib.rs
+ $(RUSTC) ep-vec.rs
+
+ $(RUSTC) basic.rs --extern ep_lib=$(TMPDIR)/libep_lib.rlib
+ $(RUSTC) shadow-mod.rs --extern ep_lib=$(TMPDIR)/libep_lib.rlib
+ $(RUSTC) shadow-prelude.rs --extern Vec=$(TMPDIR)/libep_vec.rlib
+ $(RUSTC) feature-gate.rs --extern ep_lib=$(TMPDIR)/libep_lib.rlib 2>&1 | $(CGREP) "access to extern crates through prelude is experimental"
+ $(RUSTC) relative-only.rs --extern ep_lib=$(TMPDIR)/libep_lib.rlib 2>&1 | $(CGREP) "unresolved import"
+ $(RUSTC) relative-only.rs --extern ep_lib=$(TMPDIR)/libep_lib.rlib 2>&1 | $(CGREP) "failed to resolve"
--- /dev/null
+// 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 <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.
+
+#![feature(extern_prelude)]
+
+fn main() {
+ let s = ep_lib::S; // It works
+ s.external();
+}
--- /dev/null
+// 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 = "rlib"]
+
+pub struct S;
+
+impl S {
+ pub fn external(&self) {}
+}
--- /dev/null
+// 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 = "rlib"]
+
+pub fn new(arg1: f32, arg2: ()) {}
--- /dev/null
+// 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 <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.
+
+fn main() {
+ let s = ep_lib::S; // Feature error
+}
--- /dev/null
+// 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 <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.
+
+// Extern prelude names are not available by absolute paths
+
+#![feature(extern_prelude)]
+
+use ep_lib::S;
+
+fn main() {
+ let s = ::ep_lib::S;
+}
--- /dev/null
+// 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 <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.
+
+// Local module shadows `ep_lib` from extern prelude
+
+mod ep_lib {
+ pub struct S;
+
+ impl S {
+ pub fn internal(&self) {}
+ }
+}
+
+fn main() {
+ let s = ep_lib::S;
+ s.internal(); // OK
+}
--- /dev/null
+// 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 <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.
+
+// Extern prelude shadows standard library prelude
+
+#![feature(extern_prelude)]
+
+fn main() {
+ let x = Vec::new(0f32, ()); // OK
+}
+++ /dev/null
-// Copyright 2016 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.
-
-// ignore-test not a test, auxiliary
-
-#![feature(macro_reexport)]
-
-#[macro_reexport(A)]
-extern crate derive_a;
+++ /dev/null
-// Copyright 2016 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.
-
-// aux-build:derive-a.rs
-// aux-build:derive-reexport.rs
-// ignore-stage1
-
-#[macro_use]
-extern crate derive_reexport;
-
-#[derive(Debug, PartialEq, A, Eq, Copy, Clone)]
-struct A;
-
-fn main() {}
+++ /dev/null
-// Copyright 2014 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 = "dylib"]
-#[macro_export]
-macro_rules! reexported {
- () => ( 3 )
-}
+++ /dev/null
-// Copyright 2014 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 = "dylib"]
-#![feature(macro_reexport)]
-
-#[macro_reexport(reexported)]
-#[macro_use] #[no_link]
-extern crate macro_reexport_1;
+++ /dev/null
-// 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 <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 = "dylib"]
-#![feature(macro_reexport)]
-
-#[macro_reexport(reexported)]
-#[no_link]
-extern crate macro_reexport_1;
--- /dev/null
+// Copyright 2014 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.
+
+// compile-flags: --extern LooksLikeExternCrate=/path/to/nowhere
+
+mod m {
+ pub struct LooksLikeExternCrate;
+}
+
+fn main() {
+ // OK, speculative resolution for `unused_qualifications` doesn't try
+ // to resolve this as an extern crate and load that crate
+ let s = m::LooksLikeExternCrate {};
+}
+++ /dev/null
-// 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 <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.
-
-// aux-build:macro_reexport_1.rs
-// aux-build:macro_reexport_2_no_use.rs
-
-#[macro_use] #[no_link]
-extern crate macro_reexport_2_no_use;
-
-fn main() {
- assert_eq!(reexported!(), 3_usize);
-}
+++ /dev/null
-// Copyright 2014 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.
-
-// aux-build:macro_reexport_1.rs
-// aux-build:macro_reexport_2.rs
-
-#[macro_use] #[no_link]
-extern crate macro_reexport_2;
-
-fn main() {
- assert_eq!(reexported!(), 3_usize);
-}
--- /dev/null
+// 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 <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.
+
+// compile-flags: -O
+
+#![allow(dead_code)]
+
+#[repr(C, u8)]
+enum ReprCu8 {
+ A(u16),
+ B,
+}
+
+#[repr(u8)]
+enum Repru8 {
+ A(u16),
+ B,
+}
+
+#[repr(C)]
+struct ReprC {
+ tag: u8,
+ padding: u8,
+ payload: u16,
+}
+
+fn main() {
+ // Test `repr(C, u8)`.
+ let r1 = ReprC { tag: 0, padding: 0, payload: 0 };
+ let r2 = ReprC { tag: 0, padding: 1, payload: 1 };
+
+ let t1: &ReprCu8 = unsafe { std::mem::transmute(&r1) };
+ let t2: &ReprCu8 = unsafe { std::mem::transmute(&r2) };
+
+ match (t1, t2) {
+ (ReprCu8::A(_), ReprCu8::A(_)) => (),
+ _ => assert!(false)
+ };
+
+ // Test `repr(u8)`.
+ let t1: &Repru8 = unsafe { std::mem::transmute(&r1) };
+ let t2: &Repru8 = unsafe { std::mem::transmute(&r2) };
+
+ match (t1, t2) {
+ (Repru8::A(_), Repru8::A(_)) => (),
+ _ => assert!(false)
+ };
+}
#[doc(no_inline)]
pub use all_item_types::FOO_CONSTANT;
-// @has 'foo/index.html' '//a[@href="../all_item_types/macro.foo_macro.html"]' 'foo_macro'
+// @has 'foo/index.html' '//a[@href="../foo/macro.foo_macro.html"]' 'foo_macro'
#[doc(no_inline)]
pub use all_item_types::foo_macro;
// aux-build:pub-use-extern-macros.rs
-#![feature(use_extern_macros, macro_reexport)]
+#![feature(use_extern_macros)]
-// @has pub_use_extern_macros/macro.foo.html
-// @!has pub_use_extern_macros/index.html 'pub use macros::foo;'
-#[macro_reexport(foo)] extern crate macros;
+extern crate macros;
-// @has pub_use_extern_macros/index.html 'pub use macros::bar;'
-// @!has pub_use_extern_macros/macro.bar.html
+// @has pub_use_extern_macros/macro.bar.html
pub use macros::bar;
// @has pub_use_extern_macros/macro.baz.html
#[doc(inline)]
pub use macros::baz;
-// @!has pub_use_extern_macros/macro.quux.html
+// @has pub_use_extern_macros/macro.quux.html
// @!has pub_use_extern_macros/index.html 'pub use macros::quux;'
#[doc(hidden)]
pub use macros::quux;
--- /dev/null
+// 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 <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.
+
+can-only-test-this-in-run-make-fulldeps //~ ERROR expected one of `!` or `::`, found `-`
--- /dev/null
+error: expected one of `!` or `::`, found `-`
+ --> $DIR/feature-gate-extern_prelude.rs:11:4
+ |
+LL | can-only-test-this-in-run-make-fulldeps //~ ERROR expected one of `!` or `::`, found `-`
+ | ^ expected one of `!` or `::` here
+
+error: aborting due to previous error
+
#![allow (x5300)] //~ WARN unknown lint: `x5300`
#![forbid (x5200)] //~ WARN unknown lint: `x5200`
#![deny (x5100)] //~ WARN unknown lint: `x5100`
-#![macro_reexport = "5000"] //~ WARN unused attribute
#![macro_use] // (allowed if no argument; see issue-43160-gating-of-macro_use.rs)
#![macro_export = "4800"] //~ WARN unused attribute
#![plugin_registrar = "4700"] //~ WARN unused attribute
//~^ WARN unknown lint: `x5100`
}
-#[macro_reexport = "5000"]
-//~^ WARN unused attribute
-mod macro_reexport {
- mod inner { #![macro_reexport="5000"] }
- //~^ WARN unused attribute
-
- #[macro_reexport = "5000"] fn f() { }
- //~^ WARN unused attribute
-
- #[macro_reexport = "5000"] struct S;
- //~^ WARN unused attribute
-
- #[macro_reexport = "5000"] type T = S;
- //~^ WARN unused attribute
-
- #[macro_reexport = "5000"] impl S { }
- //~^ WARN unused attribute
-}
-
#[macro_use]
mod macro_use {
mod inner { #![macro_use] }
warning: macro_escape is a deprecated synonym for macro_use
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:513:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:493:1
|
LL | #[macro_escape]
| ^^^^^^^^^^^^^^^
warning: macro_escape is a deprecated synonym for macro_use
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:516:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:496:17
|
LL | mod inner { #![macro_escape] }
| ^^^^^^^^^^^^^^^^
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:113:8
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:112:8
|
LL | #[warn(x5400)]
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:116:25
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:115:25
|
LL | mod inner { #![warn(x5400)] }
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:119:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:118:12
|
LL | #[warn(x5400)] fn f() { }
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:122:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:121:12
|
LL | #[warn(x5400)] struct S;
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:125:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:124:12
|
LL | #[warn(x5400)] type T = S;
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:128:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:127:12
|
LL | #[warn(x5400)] impl S { }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:132:9
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:131:9
|
LL | #[allow(x5300)]
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:135:26
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:134:26
|
LL | mod inner { #![allow(x5300)] }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:138:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:137:13
|
LL | #[allow(x5300)] fn f() { }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:141:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:140:13
|
LL | #[allow(x5300)] struct S;
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:144:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:143:13
|
LL | #[allow(x5300)] type T = S;
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:147:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:146:13
|
LL | #[allow(x5300)] impl S { }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:151:10
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:150:10
|
LL | #[forbid(x5200)]
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:154:27
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:153:27
|
LL | mod inner { #![forbid(x5200)] }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:157:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:156:14
|
LL | #[forbid(x5200)] fn f() { }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:160:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:159:14
|
LL | #[forbid(x5200)] struct S;
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:163:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:162:14
|
LL | #[forbid(x5200)] type T = S;
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:166:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:165:14
|
LL | #[forbid(x5200)] impl S { }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:170:8
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:169:8
|
LL | #[deny(x5100)]
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:173:25
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:172:25
|
LL | mod inner { #![deny(x5100)] }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:176:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:175:12
|
LL | #[deny(x5100)] fn f() { }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:179:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:178:12
|
LL | #[deny(x5100)] struct S;
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:182:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:181:12
|
LL | #[deny(x5100)] type T = S;
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:185:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:184:12
|
LL | #[deny(x5100)] impl S { }
| ^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:192:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:192:5
|
-LL | mod inner { #![macro_reexport="5000"] }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[macro_use] fn f() { }
+ | ^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:44:9
warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:195:5
|
-LL | #[macro_reexport = "5000"] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:198:5
- |
-LL | #[macro_reexport = "5000"] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:201:5
- |
-LL | #[macro_reexport = "5000"] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:5
- |
-LL | #[macro_reexport = "5000"] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:189:1
- |
-LL | #[macro_reexport = "5000"]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:212:5
- |
-LL | #[macro_use] fn f() { }
- | ^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:215:5
- |
LL | #[macro_use] struct S;
| ^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:218:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:198:5
|
LL | #[macro_use] type T = S;
| ^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:221:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:201:5
|
LL | #[macro_use] impl S { }
| ^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:208:17
|
LL | mod inner { #![macro_export="4800"] }
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:231:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:211:5
|
LL | #[macro_export = "4800"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:234:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:214:5
|
LL | #[macro_export = "4800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:237:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:217:5
|
LL | #[macro_export = "4800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:240:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:220:5
|
LL | #[macro_export = "4800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:225:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:205:1
|
LL | #[macro_export = "4800"]
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:247:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:227:17
|
LL | mod inner { #![plugin_registrar="4700"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:252:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:232:5
|
LL | #[plugin_registrar = "4700"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:255:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:235:5
|
LL | #[plugin_registrar = "4700"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:258:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:238:5
|
LL | #[plugin_registrar = "4700"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:244:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:224:1
|
LL | #[plugin_registrar = "4700"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:265:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:245:17
|
LL | mod inner { #![main="4300"] }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:270:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:250:5
|
LL | #[main = "4400"] struct S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:273:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:253:5
|
LL | #[main = "4400"] type T = S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:276:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:256:5
|
LL | #[main = "4400"] impl S { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:262:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:242:1
|
LL | #[main = "4400"]
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:283:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:263:17
|
LL | mod inner { #![start="4300"] }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:288:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:268:5
|
LL | #[start = "4300"] struct S;
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:291:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:271:5
|
LL | #[start = "4300"] type T = S;
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:294:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:274:5
|
LL | #[start = "4300"] impl S { }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:280:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:260:1
|
LL | #[start = "4300"]
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:333:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:313:17
|
LL | mod inner { #![repr="3900"] }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:336:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:316:5
|
LL | #[repr = "3900"] fn f() { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:341:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:321:5
|
LL | #[repr = "3900"] type T = S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:344:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:324:5
|
LL | #[repr = "3900"] impl S { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:330:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:310:1
|
LL | #[repr = "3900"]
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:352:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:332:5
|
LL | #[path = "3800"] fn f() { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:335:5
|
LL | #[path = "3800"] struct S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:358:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:338:5
|
LL | #[path = "3800"] type T = S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:341:5
|
LL | #[path = "3800"] impl S { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:368:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:348:17
|
LL | mod inner { #![abi="3700"] }
| ^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:371:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:351:5
|
LL | #[abi = "3700"] fn f() { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:374:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:354:5
|
LL | #[abi = "3700"] struct S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:377:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:357:5
|
LL | #[abi = "3700"] type T = S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:360:5
|
LL | #[abi = "3700"] impl S { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:365:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:345:1
|
LL | #[abi = "3700"]
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:387:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:17
|
LL | mod inner { #![automatically_derived="3600"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:390:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:370:5
|
LL | #[automatically_derived = "3600"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:393:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:373:5
|
LL | #[automatically_derived = "3600"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:396:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:376:5
|
LL | #[automatically_derived = "3600"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:399:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:379:5
|
LL | #[automatically_derived = "3600"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:384:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:364:1
|
LL | #[automatically_derived = "3600"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: function is marked #[no_mangle], but not exported
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:407:27
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:387:27
|
LL | #[no_mangle = "3500"] fn f() { }
| -^^^^^^^^^
= note: #[warn(private_no_mangle_fns)] on by default
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:400:17
|
LL | mod inner { #![no_link="3400"] }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:423:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:403:5
|
LL | #[no_link = "3400"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:406:5
|
LL | #[no_link = "3400"] struct S;
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:429:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:409:5
|
LL | #[no_link = "3400"]type T = S;
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:412:5
|
LL | #[no_link = "3400"] impl S { }
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:397:1
|
LL | #[no_link = "3400"]
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:439:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:419:17
|
LL | mod inner { #![should_panic="3200"] }
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:442:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:422:5
|
LL | #[should_panic = "3200"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:445:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:425:5
|
LL | #[should_panic = "3200"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:448:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:428:5
|
LL | #[should_panic = "3200"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:451:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:431:5
|
LL | #[should_panic = "3200"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:436:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:416:1
|
LL | #[should_panic = "3200"]
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:17
|
LL | mod inner { #![ignore="3100"] }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:461:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:441:5
|
LL | #[ignore = "3100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:464:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:444:5
|
LL | #[ignore = "3100"] struct S;
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:467:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:447:5
|
LL | #[ignore = "3100"] type T = S;
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:450:5
|
LL | #[ignore = "3100"] impl S { }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:455:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:435:1
|
LL | #[ignore = "3100"]
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:477:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:17
|
LL | mod inner { #![no_implicit_prelude="3000"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:460:5
|
LL | #[no_implicit_prelude = "3000"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:483:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:463:5
|
LL | #[no_implicit_prelude = "3000"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:486:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:466:5
|
LL | #[no_implicit_prelude = "3000"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:489:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:469:5
|
LL | #[no_implicit_prelude = "3000"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:454:1
|
LL | #[no_implicit_prelude = "3000"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:496:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:17
|
LL | mod inner { #![reexport_test_harness_main="2900"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:499:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:5
|
LL | #[reexport_test_harness_main = "2900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:502:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:482:5
|
LL | #[reexport_test_harness_main = "2900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:505:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:485:5
|
LL | #[reexport_test_harness_main = "2900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:508:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:488:5
|
LL | #[reexport_test_harness_main = "2900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:493:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:1
|
LL | #[reexport_test_harness_main = "2900"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:519:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:499:5
|
LL | #[macro_escape] fn f() { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:522:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:502:5
|
LL | #[macro_escape] struct S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:525:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:505:5
|
LL | #[macro_escape] type T = S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:528:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:508:5
|
LL | #[macro_escape] impl S { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:536:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:516:17
|
LL | mod inner { #![no_std="2600"] }
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:536:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:516:17
|
LL | mod inner { #![no_std="2600"] }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:540:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:520:5
|
LL | #[no_std = "2600"] fn f() { }
| ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:540:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:520:5
|
LL | #[no_std = "2600"] fn f() { }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:544:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:524:5
|
LL | #[no_std = "2600"] struct S;
| ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:544:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:524:5
|
LL | #[no_std = "2600"] struct S;
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:548:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:528:5
|
LL | #[no_std = "2600"] type T = S;
| ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:548:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:528:5
|
LL | #[no_std = "2600"] type T = S;
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:552:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532:5
|
LL | #[no_std = "2600"] impl S { }
| ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:552:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532:5
|
LL | #[no_std = "2600"] impl S { }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:1
|
LL | #[no_std = "2600"]
| ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:1
|
LL | #[no_std = "2600"]
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:17
|
LL | mod inner { #![crate_name="0900"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:17
|
LL | mod inner { #![crate_name="0900"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:5
|
LL | #[crate_name = "0900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:5
|
LL | #[crate_name = "0900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5
|
LL | #[crate_name = "0900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5
|
LL | #[crate_name = "0900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:5
|
LL | #[crate_name = "0900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:5
|
LL | #[crate_name = "0900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:5
|
LL | #[crate_name = "0900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:5
|
LL | #[crate_name = "0900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:1
|
LL | #[crate_name = "0900"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:1
|
LL | #[crate_name = "0900"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:17
|
LL | mod inner { #![crate_type="0800"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:17
|
LL | mod inner { #![crate_type="0800"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5
|
LL | #[crate_type = "0800"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5
|
LL | #[crate_type = "0800"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:5
|
LL | #[crate_type = "0800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:5
|
LL | #[crate_type = "0800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:5
|
LL | #[crate_type = "0800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:5
|
LL | #[crate_type = "0800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:732:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:5
|
LL | #[crate_type = "0800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:732:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:5
|
LL | #[crate_type = "0800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:1
|
LL | #[crate_type = "0800"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:1
|
LL | #[crate_type = "0800"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:17
|
LL | mod inner { #![feature(x0600)] }
| ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:17
|
LL | mod inner { #![feature(x0600)] }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5
|
LL | #[feature(x0600)] fn f() { }
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5
|
LL | #[feature(x0600)] fn f() { }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5
|
LL | #[feature(x0600)] struct S;
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5
|
LL | #[feature(x0600)] struct S;
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5
|
LL | #[feature(x0600)] type T = S;
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5
|
LL | #[feature(x0600)] type T = S;
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:5
|
LL | #[feature(x0600)] impl S { }
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:5
|
LL | #[feature(x0600)] impl S { }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:1
|
LL | #[feature(x0600)]
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:1
|
LL | #[feature(x0600)]
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:767:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:17
|
LL | mod inner { #![no_main="0400"] }
| ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:767:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:17
|
LL | mod inner { #![no_main="0400"] }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:771:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:5
|
LL | #[no_main = "0400"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:771:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:5
|
LL | #[no_main = "0400"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:775:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5
|
LL | #[no_main = "0400"] struct S;
| ^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:775:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5
|
LL | #[no_main = "0400"] struct S;
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:779:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5
|
LL | #[no_main = "0400"] type T = S;
| ^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:779:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5
|
LL | #[no_main = "0400"] type T = S;
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:783:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:5
|
LL | #[no_main = "0400"] impl S { }
| ^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:783:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:5
|
LL | #[no_main = "0400"] impl S { }
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:1
|
LL | #[no_main = "0400"]
| ^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:1
|
LL | #[no_main = "0400"]
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:17
|
LL | mod inner { #![recursion_limit="0200"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:17
|
LL | mod inner { #![recursion_limit="0200"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5
|
LL | #[recursion_limit="0200"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5
|
LL | #[recursion_limit="0200"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:813:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:5
|
LL | #[recursion_limit="0200"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:813:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:5
|
LL | #[recursion_limit="0200"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:797:5
|
LL | #[recursion_limit="0200"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:797:5
|
LL | #[recursion_limit="0200"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:821:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:5
|
LL | #[recursion_limit="0200"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:821:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:5
|
LL | #[recursion_limit="0200"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:1
|
LL | #[recursion_limit="0200"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:1
|
LL | #[recursion_limit="0200"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:810:17
|
LL | mod inner { #![type_length_limit="0100"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:810:17
|
LL | mod inner { #![type_length_limit="0100"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:5
|
LL | #[type_length_limit="0100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:5
|
LL | #[type_length_limit="0100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:838:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:5
|
LL | #[type_length_limit="0100"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:838:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:5
|
LL | #[type_length_limit="0100"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:842:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:5
|
LL | #[type_length_limit="0100"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:842:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:5
|
LL | #[type_length_limit="0100"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:846:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:5
|
LL | #[type_length_limit="0100"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:846:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:5
|
LL | #[type_length_limit="0100"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:806:1
|
LL | #[type_length_limit="0100"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:806:1
|
LL | #[type_length_limit="0100"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:1
- |
-LL | #![macro_reexport = "5000"] //~ WARN unused attribute
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:54:1
|
LL | #![macro_export = "4800"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:56:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:1
|
LL | #![plugin_registrar = "4700"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:58:1
|
LL | #![main = "x4400"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1
|
LL | #![start = "x4300"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:63:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:62:1
|
LL | #![repr = "3900"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:64:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:63:1
|
LL | #![path = "3800"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:65:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:64:1
|
LL | #![abi = "3700"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:66:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:65:1
|
LL | #![automatically_derived = "3600"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:68:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:67:1
|
LL | #![no_link = "3400"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:70:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:69:1
|
LL | #![should_panic = "3200"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:71:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:70:1
|
LL | #![ignore = "3100"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:77:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:76:1
|
LL | #![proc_macro_derive = "2500"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: compilation successful
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:857:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:837:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | println!("Hello World");
-error: compilation successful
- --> $DIR/borrowing.rs:15:1
+error[E0597]: `a` does not live long enough
+ --> $DIR/borrowing.rs:18:18
|
-LL | / fn main() { #![rustc_error] // rust-lang/rust#49855
-LL | | let _b = {
-LL | | let a = 3;
-LL | | unsafe { (|| yield &a).resume() }
-... |
-LL | | };
-LL | | }
- | |_^
+LL | unsafe { (|| yield &a).resume() }
+ | ^^^^^^^^^^^^^
+ | |
+ | borrowed value does not live long enough
+ | borrow may end up in a temporary, created here
+LL | //~^ ERROR: `a` does not live long enough
+LL | };
+ | -- temporary later dropped here, potentially using the reference
+ | |
+ | borrowed value only lives until here
-error: aborting due to previous error
+error[E0597]: `a` does not live long enough
+ --> $DIR/borrowing.rs:24:9
+ |
+LL | / || {
+LL | | yield &a
+LL | | //~^ ERROR: `a` does not live long enough
+LL | | }
+ | |_________^ borrowed value does not live long enough
+LL | };
+ | - borrowed value only lives until here
+LL | }
+ | - borrow later used here, when `_b` is dropped
+
+error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0597`.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(generators, generator_trait, rustc_attrs)]
+#![feature(generators, generator_trait)]
use std::ops::Generator;
-fn main() { #![rustc_error] // rust-lang/rust#49855
+fn main() {
let _b = {
let a = 3;
unsafe { (|| yield &a).resume() }
-error: compilation successful
- --> $DIR/dropck.rs:16:1
+error[E0597]: `ref_` does not live long enough
+ --> $DIR/dropck.rs:22:11
|
-LL | / fn main() { #![rustc_error] // rust-lang/rust#49855
-LL | | let (cell, mut gen);
-LL | | cell = Box::new(RefCell::new(0));
-LL | | let ref_ = Box::leak(Box::new(Some(cell.borrow_mut())));
-... |
-LL | | // drops the RefCell and then the Ref, leading to use-after-free
-LL | | }
- | |_^
+LL | gen = || {
+ | ___________^
+LL | | // but the generator can use it to drop a `Ref<'a, i32>`.
+LL | | let _d = ref_.take(); //~ ERROR `ref_` does not live long enough
+LL | | yield;
+LL | | };
+ | |_____^ borrowed value does not live long enough
+...
+LL | }
+ | -
+ | |
+ | borrowed value only lives until here
+ | borrow later used here, when `gen` is dropped
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0597`.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(generators, generator_trait, box_leak, rustc_attrs)]
+#![feature(generators, generator_trait, box_leak)]
use std::cell::RefCell;
use std::ops::Generator;
-fn main() { #![rustc_error] // rust-lang/rust#49855
+fn main() {
let (cell, mut gen);
cell = Box::new(RefCell::new(0));
let ref_ = Box::leak(Box::new(Some(cell.borrow_mut())));
+ //~^ ERROR `*cell` does not live long enough [E0597]
// the upvar is the non-dropck `&mut Option<Ref<'a, i32>>`.
gen = || {
// but the generator can use it to drop a `Ref<'a, i32>`.
+error[E0597]: `*cell` does not live long enough
+ --> $DIR/dropck.rs:19:40
+ |
+LL | let ref_ = Box::leak(Box::new(Some(cell.borrow_mut())));
+ | ^^^^ borrowed value does not live long enough
+...
+LL | }
+ | - `*cell` dropped here while still borrowed
+ |
+ = note: values in a scope are dropped in the opposite order they are created
+
error[E0597]: `ref_` does not live long enough
- --> $DIR/dropck.rs:23:18
+ --> $DIR/dropck.rs:24:18
|
LL | gen = || {
| -- capture occurs here
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to previous error
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0597`.
error[E0597]: `b` does not live long enough
--> $DIR/ref-escapes-but-not-over-yield.rs:24:13
|
-LL | a = &b;
- | ^^ borrowed value does not live long enough
-LL | //~^ ERROR `b` does not live long enough
-LL | };
- | - borrowed value only lives until here
+LL | let mut b = move || {
+ | _________________-
+LL | | yield();
+LL | | let b = 5;
+LL | | a = &b;
+ | | ^^ borrowed value does not live long enough
+LL | | //~^ ERROR `b` does not live long enough
+LL | | };
+ | | -
+ | | |
+ | | borrowed value only lives until here
+ | |_____temporary later dropped here, potentially using the reference
+ | borrow may end up in a temporary, created here
error: aborting due to previous error
--- /dev/null
+// 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 <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.
+
+// compile-pass
+
+#![feature(use_extern_macros, decl_macro)]
+
+mod type_ns {
+ pub type A = u8;
+}
+mod value_ns {
+ pub const A: u8 = 0;
+}
+mod macro_ns {
+ pub macro A() {}
+}
+
+mod merge2 {
+ pub use type_ns::A;
+ pub use value_ns::A;
+}
+mod merge3 {
+ pub use type_ns::A;
+ pub use value_ns::A;
+ pub use macro_ns::A;
+}
+
+mod use2 {
+ pub use merge2::A;
+}
+mod use3 {
+ pub use merge3::A;
+}
+
+fn main() {
+ type B2 = use2::A;
+ let a2 = use2::A;
+
+ type B3 = use3::A;
+ let a3 = use3::A;
+ use3::A!();
+}
--- /dev/null
+// 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 <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.
+
+// aux-build:two_macros.rs
+
+#![feature(macro_reexport)] //~ ERROR feature has been removed
+
+#[macro_reexport(macro_one)] //~ ERROR attribute `macro_reexport` is currently unknown
+extern crate two_macros;
+
+fn main() {}
--- /dev/null
+error[E0557]: feature has been removed
+ --> $DIR/macro-reexport-removed.rs:13:12
+ |
+LL | #![feature(macro_reexport)] //~ ERROR feature has been removed
+ | ^^^^^^^^^^^^^^
+ |
+note: subsumed by `#![feature(use_extern_macros)]` and `pub use`
+ --> $DIR/macro-reexport-removed.rs:13:12
+ |
+LL | #![feature(macro_reexport)] //~ ERROR feature has been removed
+ | ^^^^^^^^^^^^^^
+
+error[E0658]: The attribute `macro_reexport` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
+ --> $DIR/macro-reexport-removed.rs:15:1
+ |
+LL | #[macro_reexport(macro_one)] //~ ERROR attribute `macro_reexport` is currently unknown
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
+error: aborting due to 2 previous errors
+
+Some errors occurred: E0557, E0658.
+For more information about an error, try `rustc --explain E0557`.
--- /dev/null
+// 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 <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.
+
+// compile-flags: -Z print-type-sizes
+// compile-pass
+
+// This test makes sure that the tag is not grown for `repr(C)` or `repr(u8)`
+// variants (see https://github.com/rust-lang/rust/issues/50098 for the original bug).
+
+#![feature(start)]
+#![allow(dead_code)]
+
+#[repr(C, u8)]
+enum ReprCu8 {
+ A(u16),
+ B,
+}
+
+#[repr(u8)]
+enum Repru8 {
+ A(u16),
+ B,
+}
+
+#[start]
+fn start(_: isize, _: *const *const u8) -> isize {
+ 0
+}
--- /dev/null
+print-type-size type: `ReprCu8`: 4 bytes, alignment: 2 bytes
+print-type-size discriminant: 1 bytes
+print-type-size variant `A`: 3 bytes
+print-type-size padding: 1 bytes
+print-type-size field `.0`: 2 bytes, alignment: 2 bytes
+print-type-size variant `B`: 1 bytes
+print-type-size type: `Repru8`: 4 bytes, alignment: 2 bytes
+print-type-size discriminant: 1 bytes
+print-type-size variant `A`: 3 bytes
+print-type-size padding: 1 bytes
+print-type-size field `.0`: 2 bytes, alignment: 2 bytes
+print-type-size variant `B`: 0 bytes
-Subproject commit 9144e223a5b90e078366275ff3dcdd406e62eae3
+Subproject commit 99796f6a6592b4d897719a1736ec580c96f5441a
-Subproject commit 0f4ed08d0e3d180d66e46904126c3792f57668a9
+Subproject commit d8982e5efe8fda1d6f64e88a67da2f05b6af225e