du . | sort -nr | head -n100
after_failure:
+ # Requested by travis to debug "shutting down NOW" errors
+ - sudo tail -n 500 /var/log/syslog
- >
echo "#### Build failed; Disk usage after running script:";
df -h;
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
dependencies = [
"backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
"filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"petgraph 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
"pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libgit2-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazycell 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libgit2-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
"filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"core-foundation-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
dependencies = [
"curl-sys 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
"schannel 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libgit2-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libc"
-version = "0.2.42"
+version = "0.2.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"curl-sys 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libssh2-sys 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
"vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
dependencies = [
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
"filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
"cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
"vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "racer"
-version = "2.1.2"
+version = "2.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
dependencies = [
"cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
dependencies = [
"crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rls"
-version = "0.130.2"
+version = "0.130.4"
dependencies = [
"cargo 0.30.0",
"cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ordslice 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "racer 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "racer 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-analysis 0.14.0 (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.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-workspace-hack 1.0.0",
- "rustfmt-nightly 0.99.1",
+ "rustfmt-nightly 0.99.2",
"serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "rustc-ap-arena"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc-ap-rustc_data_structures 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-arena"
-version = "211.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc-ap-rustc_data_structures 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-rustc_cratesio_shim"
-version = "209.0.0"
+version = "218.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-rustc_cratesio_shim"
-version = "211.0.0"
+version = "218.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "rustc-ap-rustc_data_structures"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "ena 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (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-rustc_cratesio_shim 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-rustc_data_structures"
-version = "211.0.0"
+version = "218.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (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-rustc_cratesio_shim 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_cratesio_shim 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "rustc-ap-rustc_errors"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 209.0.0 (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.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-rustc_errors"
-version = "211.0.0"
+version = "218.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 218.0.0 (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.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-rustc_target"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-rustc_target"
-version = "211.0.0"
+version = "218.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_cratesio_shim 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-serialize"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "rustc-ap-serialize"
-version = "211.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "rustc-ap-syntax"
-version = "209.0.0"
+version = "218.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_errors 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
[[package]]
name = "rustc-ap-syntax"
-version = "211.0.0"
+version = "218.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_errors 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-syntax_pos"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-arena 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_errors 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_target 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-syntax_pos"
-version = "211.0.0"
+version = "218.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-arena 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-arena 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
dependencies = [
"crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
name = "rustc_codegen_llvm"
version = "0.0.0"
dependencies = [
- "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc 0.0.0",
"rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc_allocator 0.0.0",
- "rustc_apfloat 0.0.0",
- "rustc_codegen_utils 0.0.0",
- "rustc_data_structures 0.0.0",
- "rustc_errors 0.0.0",
- "rustc_incremental 0.0.0",
"rustc_llvm 0.0.0",
- "rustc_mir 0.0.0",
- "rustc_platform_intrinsics 0.0.0",
- "rustc_target 0.0.0",
- "serialize 0.0.0",
- "syntax 0.0.0",
- "syntax_pos 0.0.0",
- "tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "rustfmt-nightly"
-version = "0.99.1"
+version = "0.99.2"
dependencies = [
"assert_cli 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_target 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
"checksum lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fb497c35d362b6a331cfd94956a07fc2c78a4604cdbee844a81170386b996dd3"
"checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef"
"checksum lazycell 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d33a48d0365c96081958cc663eef834975cb1e8d8bea3378513fc72bdbf11e50"
-"checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1"
+"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
"checksum libgit2-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c9051a4b288ba6f8728e9e52bb2510816946b8bcb2e20259e4d4cdc93b9ecafd"
"checksum libssh2-sys 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c628b499e8d1a4f4bd09a95d6cb1f8aeb231b46a9d40959bbd0408f14dd63adf"
"checksum libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "87f737ad6cc6fd6eefe3d9dc5412f1573865bded441300904d2f42269e140f16"
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
"checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8"
"checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035"
-"checksum racer 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c20890fccfc19a28835ee4ffab6af13d300a60a33be29162cfdf8db981811f25"
+"checksum racer 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "dcbc5ababaffee8d8f34910f925287c8f716b1ead48561c4278a152d08264f7c"
"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5"
"checksum rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "12397506224b2f93e6664ffc4f664b29be8208e5157d3d90b44f09b5fae470ea"
"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2"
"checksum rls-rustc 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9dba7390427aefa953608429701e3665192ca810ba8ae09301e001b7c7bed0"
"checksum rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d7c7046dc6a92f2ae02ed302746db4382e75131b9ce20ce967259f6b5867a6a"
"checksum rls-vfs 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ecbc8541b4c341d6271eae10f869dd9d36db871afe184f5b6f9bffbd6ed0373f"
-"checksum rustc-ap-arena 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b098827864368459cbc7a79fbc54eafb92df7e00a46c0cda352b5a21583ee436"
-"checksum rustc-ap-arena 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eec75ed880706dd9a05bc770c327ed142fa7d4b648d9757fbc71d821d68448a5"
-"checksum rustc-ap-rustc_cratesio_shim 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef4d923dea14fb085bca743fb982f6a3bc11c0d5d30b822bcf6fa16e9464a56c"
-"checksum rustc-ap-rustc_cratesio_shim 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0f5d54615bedbae65a976e0835edf0de90dd962ec818c0149fe181d5cd81da9e"
-"checksum rustc-ap-rustc_data_structures 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18c6a5c9edc6b4ae035cdc03af7d8662d39fad7879c5501d103e7087dfaebc80"
-"checksum rustc-ap-rustc_data_structures 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7c51cc6e79eab25c7ea84a7e104e81e6f44cca32709df54c2cdb4e7059d7843"
-"checksum rustc-ap-rustc_errors 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9a1e9bdc597abd95cebce0c14c1da58943a9e5b8255530a0fec30659d144eb0b"
-"checksum rustc-ap-rustc_errors 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff050095b7afb254506591ee7d3a5d0fb9c03c16f8c2741b588178085e563d49"
-"checksum rustc-ap-rustc_target 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "142ddef3dc12dda2bcd3412f0d96d3745413a8fbc2f224f0cc97afa04c071d89"
-"checksum rustc-ap-rustc_target 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "53c7a8c21c3b05f24998fa6ab9ded6269810a2f3ae12ff301c432c1e9fa8e111"
-"checksum rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8b08f8f175b038a82caa7e51fc52b72ff96cfe8c1429755da30380dbd4199c7f"
-"checksum rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad4713c2c0c26a45ead8fb16fee88e16fecf999588ae6920847cbaeb19565b7f"
-"checksum rustc-ap-syntax 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4c802e0e1fbc64eddc21e0798527eb1f5fdbd5781d119bd2c44b6130afdc81cc"
-"checksum rustc-ap-syntax 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "768e2698f912913be2ccd355b2dea62c978efc356f75db1400605f3642905d53"
-"checksum rustc-ap-syntax_pos 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "008d47cc54ed12a2784217b9e6630a7fa1c8dc3591a283f65ad4b7fa307d49d5"
-"checksum rustc-ap-syntax_pos 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a280dc8919aa7f684832ba3eeab2f6c96dbe2e2e4f6a922f7f0bdb3a9dd9e641"
+"checksum rustc-ap-arena 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e905467184ce31ccdbd33ac33b9ba377f8cc7aefb340a733ab7e5efe34cddda"
+"checksum rustc-ap-rustc_cratesio_shim 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2a1a45817e78d0c1e2800fb933c526747ef2c5ee4b2dc0946e0c2d901329b88"
+"checksum rustc-ap-rustc_data_structures 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4e9e5588883318e0e58bb7ea7cde2a66eaca55b25e32908f0982365988657"
+"checksum rustc-ap-rustc_errors 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d233c0d9beda42a52d329a5df865c8f20c64773d2ab7aa6b4ae4248bacf3188"
+"checksum rustc-ap-rustc_target 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eec0bc13feecf9e88e39439b24b4b3ca54db8caf12fb7172d0c430451c8b377c"
+"checksum rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffcfb1102cd7cbf5f25c008a00f7253427af9dfac8989ede48c19bd47f556893"
+"checksum rustc-ap-syntax 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3a2ca0ef078a735c81a0d33589e04148dcf41f80ee7ebe30e72904a631b7c669"
+"checksum rustc-ap-syntax_pos 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1bbd31d1bbc7210983c3bbbcb9ee35bac443c6c899f979b8114e58bb7101c28"
"checksum rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "76d7ba1feafada44f2d38eed812bd2489a03c0f5abb975799251518b68848649"
"checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8"
"checksum rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c6d5a683c6ba4ed37959097e88d71c9e8e26659a3cb5be8b389078e7ad45306"
let target = self.target;
let backend = self.backend;
+ let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);
+ builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target));
+
let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "check");
- let features = builder.rustc_features().to_string();
cargo.arg("--manifest-path").arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml"));
rustc_cargo_env(builder, &mut cargo);
let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage));
run_cargo(builder,
- cargo.arg("--features").arg(features),
+ &mut cargo,
&codegen_backend_stamp(builder, compiler, target, backend),
true);
}
return;
}
+ let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);
+ builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target));
+
let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "build");
- let mut features = builder.rustc_features().to_string();
cargo.arg("--manifest-path")
.arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml"));
rustc_cargo_env(builder, &mut cargo);
- features += &build_codegen_backend(&builder, &mut cargo, &compiler, target, backend);
+ let features = build_codegen_backend(&builder, &mut cargo, &compiler, target, backend);
- let tmp_stamp = builder.cargo_out(compiler, Mode::Codegen, target)
- .join(".tmp.stamp");
+ let tmp_stamp = out_dir.join(".tmp.stamp");
let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage));
let files = run_cargo(builder,
let suffix = match mode {
Mode::Std => "-std",
Mode::Test => "-test",
- Mode::Codegen => "-rustc",
Mode::Rustc => "-rustc",
+ Mode::Codegen => "-codegen",
Mode::ToolBootstrap => "-bootstrap-tools",
Mode::ToolStd => "-tools",
Mode::ToolRustc => "-tools",
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(rand)]
-
extern crate rand;
mod _common;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(rand)]
-
extern crate rand;
mod _common;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(rand)]
#![feature(repr_simd)]
#![feature(slice_sort_by_cached_key)]
#![feature(test)]
use core::mem::{self, PinMut};
use core::ops::{CoerceUnsized, Deref, DerefMut, Generator, GeneratorState};
use core::ptr::{self, NonNull, Unique};
-use core::task::{Context, Poll, Executor, SpawnErrorKind, SpawnObjError};
+use core::task::{Context, Poll, Spawn, SpawnErrorKind, SpawnObjError};
use raw_vec::RawVec;
use str::from_boxed_utf8_unchecked;
}
#[unstable(feature = "futures_api", issue = "50547")]
-impl<E> Executor for Box<E>
- where E: Executor + ?Sized
+impl<Sp> Spawn for Box<Sp>
+ where Sp: Spawn + ?Sized
{
- fn spawn_obj(&mut self, task: FutureObj<'static, ()>) -> Result<(), SpawnObjError> {
- (**self).spawn_obj(task)
+ fn spawn_obj(
+ &mut self,
+ future: FutureObj<'static, ()>,
+ ) -> Result<(), SpawnObjError> {
+ (**self).spawn_obj(future)
}
fn status(&self) -> Result<(), SpawnErrorKind> {
__impl_slice_eq1! { $Lhs, $Rhs, Sized }
};
($Lhs: ty, $Rhs: ty, $Bound: ident) => {
- #[stable(feature = "vec-deque-partial-eq-slice", since = "1.17.0")]
+ #[stable(feature = "vec_deque_partial_eq_slice", since = "1.17.0")]
impl<'a, 'b, A: $Bound, B> PartialEq<$Rhs> for $Lhs where A: PartialEq<B> {
fn eq(&self, other: &$Rhs) -> bool {
if self.len() != other.len() {
#![needs_allocator]
#![deny(missing_debug_implementations)]
-#![cfg_attr(test, allow(deprecated))] // rand
-#![cfg_attr(not(test), feature(exact_size_is_empty))]
+#![cfg_attr(not(test), feature(fn_traits))]
#![cfg_attr(not(test), feature(generator_trait))]
-#![cfg_attr(test, feature(rand, test))]
+#![cfg_attr(test, feature(test))]
+
#![feature(allocator_api)]
#![feature(allow_internal_unstable)]
#![feature(arbitrary_self_types)]
-#![feature(ascii_ctype)]
#![feature(box_into_raw_non_null)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(cfg_target_has_atomic)]
#![feature(coerce_unsized)]
-#![feature(collections_range)]
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(custom_attribute)]
#![feature(dropck_eyepatch)]
#![feature(exact_size_is_empty)]
#![feature(fmt_internals)]
-#![feature(from_ref)]
#![feature(fundamental)]
#![feature(futures_api)]
#![feature(lang_items)]
#![feature(allocator_internals)]
#![feature(on_unimplemented)]
#![feature(exact_chunks)]
-#![feature(pointer_methods)]
-#![feature(inclusive_range_methods)]
#![feature(rustc_const_unstable)]
#![feature(const_vec_new)]
-#![cfg_attr(not(test), feature(fn_traits, i128))]
-#![cfg_attr(test, feature(test))]
-
// Allow testing this library
#[cfg(test)]
#![feature(drain_filter)]
#![feature(exact_size_is_empty)]
#![feature(pattern)]
-#![feature(rand)]
#![feature(slice_sort_by_cached_key)]
-#![feature(splice)]
#![feature(str_escape)]
-#![feature(string_retain)]
#![feature(try_reserve)]
#![feature(unboxed_closures)]
#![feature(exact_chunks)]
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
#![feature(concat_idents)]
#![feature(const_fn)]
#![feature(const_int_ops)]
-#![feature(core_float)]
+#![feature(const_fn_union)]
#![feature(custom_attribute)]
#![feature(doc_cfg)]
#![feature(doc_spotlight)]
#![feature(rustc_attrs)]
#![feature(rustc_const_unstable)]
#![feature(simd_ffi)]
-#![feature(core_slice_ext)]
-#![feature(core_str_ext)]
#![feature(specialization)]
#![feature(staged_api)]
#![feature(stmt_expr_attributes)]
#![feature(untagged_unions)]
#![feature(unwind_attributes)]
#![feature(doc_alias)]
-#![feature(inclusive_range_methods)]
#![feature(mmx_target_feature)]
#![feature(tbm_target_feature)]
#![feature(sse4a_target_feature)]
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
/// # Examples
///
/// ```
- /// #![feature(ascii_ctype)]
- ///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
fn index_mut(self, slice: &mut T) -> &mut Self::Output;
}
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
impl<T> SliceIndex<[T]> for usize {
type Output = T;
}
}
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
impl<T> SliceIndex<[T]> for ops::Range<usize> {
type Output = [T];
}
}
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
impl<T> SliceIndex<[T]> for ops::RangeTo<usize> {
type Output = [T];
}
}
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
impl<T> SliceIndex<[T]> for ops::RangeFrom<usize> {
type Output = [T];
}
}
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
impl<T> SliceIndex<[T]> for ops::RangeFull {
type Output = [T];
/// This length is in bytes, not [`char`]s or graphemes. In other words,
/// it may not be what a human considers the length of the string.
///
- /// [`char`]: primitive.char.html
- ///
/// # Examples
///
/// Basic usage:
/// Value, and may not match your idea of what a 'character' is. Iteration
/// over grapheme clusters may be what you actually want.
///
- /// [`char`]: primitive.char.html
- ///
/// # Examples
///
/// Basic usage:
/// The iterator yields tuples. The position is first, the [`char`] is
/// second.
///
- /// [`char`]: primitive.char.html
- ///
/// # Examples
///
/// Basic usage:
/// The pattern can be a `&str`, [`char`], or a closure that determines if
/// a character matches.
///
- /// [`char`]: primitive.char.html
/// [`None`]: option/enum.Option.html#variant.None
///
/// # Examples
/// The pattern can be a `&str`, [`char`], or a closure that determines if
/// a character matches.
///
- /// [`char`]: primitive.char.html
/// [`None`]: option/enum.Option.html#variant.None
///
/// # Examples
/// If the pattern allows a reverse search but its results might differ
/// from a forward search, the [`rsplit`] method can be used.
///
- /// [`char`]: primitive.char.html
/// [`rsplit`]: #method.rsplit
///
/// # Examples
/// The pattern can be a `&str`, [`char`], or a closure that determines the
/// split.
///
- /// [`char`]: primitive.char.html
- ///
/// # Iterator behavior
///
/// The returned iterator requires that the pattern supports a reverse
/// elements. This is true for, eg, [`char`] but not for `&str`.
///
/// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
- /// [`char`]: primitive.char.html
///
/// If the pattern allows a reverse search but its results might differ
/// from a forward search, the [`rsplit_terminator`] method can be used.
/// Additional libraries might provide more complex patterns like
/// regular expressions.
///
- /// [`char`]: primitive.char.html
- ///
/// Equivalent to [`split`], except that the trailing substring is
/// skipped if empty.
///
/// The pattern can be a `&str`, [`char`], or a closure that determines the
/// split.
///
- /// [`char`]: primitive.char.html
- ///
/// # Iterator behavior
///
/// The returned iterator will not be double ended, because it is
/// The pattern can be a `&str`, [`char`], or a closure that
/// determines the split.
///
- /// [`char`]: primitive.char.html
- ///
/// # Iterator behavior
///
/// The returned iterator will not be double ended, because it is not
/// The pattern can be a `&str`, [`char`], or a closure that
/// determines if a character matches.
///
- /// [`char`]: primitive.char.html
- ///
/// # Iterator behavior
///
/// The returned iterator will be a [`DoubleEndedIterator`] if the pattern
/// elements. This is true for, eg, [`char`] but not for `&str`.
///
/// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
- /// [`char`]: primitive.char.html
///
/// If the pattern allows a reverse search but its results might differ
/// from a forward search, the [`rmatches`] method can be used.
/// The pattern can be a `&str`, [`char`], or a closure that determines if
/// a character matches.
///
- /// [`char`]: primitive.char.html
- ///
/// # Iterator behavior
///
/// The returned iterator requires that the pattern supports a reverse
/// The pattern can be a `&str`, [`char`], or a closure that determines
/// if a character matches.
///
- /// [`char`]: primitive.char.html
- ///
/// # Iterator behavior
///
/// The returned iterator will be a [`DoubleEndedIterator`] if the pattern
/// The pattern can be a `&str`, [`char`], or a closure that determines if a
/// character matches.
///
- /// [`char`]: primitive.char.html
- ///
/// # Iterator behavior
///
/// The returned iterator requires that the pattern supports a reverse
/// The pattern can be a [`char`] or a closure that determines if a
/// character matches.
///
- /// [`char`]: primitive.char.html
- ///
/// # Examples
///
/// Simple patterns:
/// The pattern can be a `&str`, [`char`], or a closure that determines if
/// a character matches.
///
- /// [`char`]: primitive.char.html
- ///
/// # Text directionality
///
/// A string is a sequence of bytes. 'Left' in this context means the first
/// The pattern can be a `&str`, [`char`], or a closure that
/// determines if a character matches.
///
- /// [`char`]: primitive.char.html
- ///
/// # Text directionality
///
/// A string is a sequence of bytes. 'Right' in this context means the last
issue = "50547")]
use fmt;
-use super::{Executor, Waker, LocalWaker};
+use super::{Spawn, Waker, LocalWaker};
/// Information about the currently-running task.
///
/// when performing a single `poll` step on a task.
pub struct Context<'a> {
local_waker: &'a LocalWaker,
- executor: &'a mut dyn Executor,
+ spawner: &'a mut dyn Spawn,
}
impl<'a> fmt::Debug for Context<'a> {
}
impl<'a> Context<'a> {
- /// Create a new task `Context` with the provided `local_waker`, `waker`, and `executor`.
+ /// Create a new task `Context` with the provided `local_waker`, `waker`,
+ /// and `spawner`.
#[inline]
- pub fn new(local_waker: &'a LocalWaker, executor: &'a mut dyn Executor) -> Context<'a> {
- Context {
- local_waker,
- executor,
- }
+ pub fn new(
+ local_waker: &'a LocalWaker,
+ spawner: &'a mut dyn Spawn,
+ ) -> Context<'a> {
+ Context { local_waker, spawner }
}
/// Get the `LocalWaker` associated with the current task.
unsafe { &*(self.local_waker as *const LocalWaker as *const Waker) }
}
- /// Get the default executor associated with this task.
+ /// Get the spawner associated with this task.
///
/// This method is useful primarily if you want to explicitly handle
/// spawn failures.
#[inline]
- pub fn executor(&mut self) -> &mut dyn Executor {
- self.executor
+ pub fn spawner(&mut self) -> &mut dyn Spawn {
+ self.spawner
}
- /// Produce a context like the current one, but using the given waker instead.
+ /// Produce a context like the current one, but using the given waker
+ /// instead.
///
/// This advanced method is primarily used when building "internal
/// schedulers" within a task, where you want to provide some customized
/// wakeup logic.
#[inline]
- pub fn with_waker<'b>(&'b mut self, local_waker: &'b LocalWaker) -> Context<'b> {
+ pub fn with_waker<'b>(
+ &'b mut self,
+ local_waker: &'b LocalWaker,
+ ) -> Context<'b> {
Context {
local_waker,
- executor: self.executor,
+ spawner: self.spawner,
}
}
- /// Produce a context like the current one, but using the given executor
+ /// Produce a context like the current one, but using the given spawner
/// instead.
///
/// This advanced method is primarily used when building "internal
/// schedulers" within a task.
#[inline]
- pub fn with_executor<'b, E>(&'b mut self, executor: &'b mut E) -> Context<'b>
- where E: Executor
- {
+ pub fn with_spawner<'b, Sp: Spawn>(
+ &'b mut self,
+ spawner: &'b mut Sp,
+ ) -> Context<'b> {
Context {
local_waker: self.local_waker,
- executor,
+ spawner,
}
}
}
+++ /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.
-
-#![unstable(feature = "futures_api",
- reason = "futures in libcore are unstable",
- issue = "50547")]
-
-use fmt;
-use future::{FutureObj, LocalFutureObj};
-
-/// A task executor.
-///
-/// Futures are polled until completion by tasks, a kind of lightweight
-/// "thread". A *task executor* is responsible for the creation of these tasks
-/// and the coordination of their execution on real operating system threads. In
-/// particular, whenever a task signals that it can make further progress via a
-/// wake-up notification, it is the responsibility of the task executor to put
-/// the task into a queue to continue executing it, i.e. polling the future in
-/// it, later.
-pub trait Executor {
- /// Spawns a new task with the given future. The future will be polled until
- /// completion.
- ///
- /// # Errors
- ///
- /// The executor may be unable to spawn tasks, either because it has
- /// been shut down or is resource-constrained.
- fn spawn_obj(
- &mut self,
- future: FutureObj<'static, ()>,
- ) -> Result<(), SpawnObjError>;
-
- /// Determines whether the executor is able to spawn new tasks.
- ///
- /// # Returns
- ///
- /// An `Ok` return means the executor is *likely* (but not guaranteed)
- /// to accept a subsequent spawn attempt. Likewise, an `Err` return
- /// means that `spawn` is likely, but not guaranteed, to yield an error.
- #[inline]
- fn status(&self) -> Result<(), SpawnErrorKind> {
- Ok(())
- }
-}
-
-/// Provides the reason that an executor was unable to spawn.
-pub struct SpawnErrorKind {
- _hidden: (),
-}
-
-impl fmt::Debug for SpawnErrorKind {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- f.debug_tuple("SpawnErrorKind")
- .field(&"shutdown")
- .finish()
- }
-}
-
-impl SpawnErrorKind {
- /// Spawning is failing because the executor has been shut down.
- pub fn shutdown() -> SpawnErrorKind {
- SpawnErrorKind { _hidden: () }
- }
-
- /// Check whether this error is the `shutdown` error.
- pub fn is_shutdown(&self) -> bool {
- true
- }
-}
-
-/// The result of a failed spawn
-#[derive(Debug)]
-pub struct SpawnObjError {
- /// The kind of error
- pub kind: SpawnErrorKind,
-
- /// The future for which spawning inside a task was attempted
- pub future: FutureObj<'static, ()>,
-}
-
-/// The result of a failed spawn
-#[derive(Debug)]
-pub struct SpawnLocalObjError {
- /// The kind of error
- pub kind: SpawnErrorKind,
-
- /// The future for which spawning inside a task was attempted
- pub future: LocalFutureObj<'static, ()>,
-}
mod context;
pub use self::context::Context;
-mod executor;
-pub use self::executor::{
- Executor, SpawnErrorKind, SpawnObjError, SpawnLocalObjError
-};
+mod spawn;
+pub use self::spawn::{Spawn, SpawnErrorKind, SpawnObjError, SpawnLocalObjError};
mod poll;
pub use self::poll::Poll;
--- /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.
+
+#![unstable(feature = "futures_api",
+ reason = "futures in libcore are unstable",
+ issue = "50547")]
+
+use fmt;
+use future::{FutureObj, LocalFutureObj};
+
+/// Spawns tasks that poll futures to completion onto its associated task
+/// executor.
+///
+/// The term "task" refers to a kind of lightweight "thread". Task executors
+/// are responsible for scheduling the execution of tasks on operating system
+/// threads.
+pub trait Spawn {
+ /// Spawns a new task with the given future. The future will be polled until
+ /// completion.
+ ///
+ /// # Errors
+ ///
+ /// The executor may be unable to spawn tasks, either because it has
+ /// been shut down or is resource-constrained.
+ fn spawn_obj(
+ &mut self,
+ future: FutureObj<'static, ()>,
+ ) -> Result<(), SpawnObjError>;
+
+ /// Determines whether the executor is able to spawn new tasks.
+ ///
+ /// # Returns
+ ///
+ /// An `Ok` return means the executor is *likely* (but not guaranteed)
+ /// to accept a subsequent spawn attempt. Likewise, an `Err` return
+ /// means that `spawn` is likely, but not guaranteed, to yield an error.
+ #[inline]
+ fn status(&self) -> Result<(), SpawnErrorKind> {
+ Ok(())
+ }
+}
+
+/// Provides the reason that an executor was unable to spawn.
+pub struct SpawnErrorKind {
+ _hidden: (),
+}
+
+impl fmt::Debug for SpawnErrorKind {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ f.debug_tuple("SpawnErrorKind")
+ .field(&"shutdown")
+ .finish()
+ }
+}
+
+impl SpawnErrorKind {
+ /// Spawning is failing because the executor has been shut down.
+ pub fn shutdown() -> SpawnErrorKind {
+ SpawnErrorKind { _hidden: () }
+ }
+
+ /// Check whether this error is the `shutdown` error.
+ pub fn is_shutdown(&self) -> bool {
+ true
+ }
+}
+
+/// The result of a failed spawn
+#[derive(Debug)]
+pub struct SpawnObjError {
+ /// The kind of error
+ pub kind: SpawnErrorKind,
+
+ /// The future for which spawning inside a task was attempted
+ pub future: FutureObj<'static, ()>,
+}
+
+/// The result of a failed spawn
+#[derive(Debug)]
+pub struct SpawnLocalObjError {
+ /// The kind of error
+ pub kind: SpawnErrorKind,
+
+ /// The future for which spawning inside a task was attempted
+ pub future: LocalFutureObj<'static, ()>,
+}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(ascii_ctype)]
#![feature(box_syntax)]
#![feature(cell_update)]
-#![feature(core_float)]
#![feature(core_private_bignum)]
#![feature(core_private_diy_float)]
#![feature(dec2flt)]
-#![feature(decode_utf8)]
#![feature(euclidean_division)]
#![feature(exact_size_is_empty)]
#![feature(fixed_size_array)]
-#![feature(float_internals)]
#![feature(flt2dec)]
#![feature(fmt_internals)]
#![feature(hashmap_internals)]
#![feature(refcell_map_split)]
#![feature(refcell_replace_swap)]
#![feature(slice_patterns)]
-#![feature(slice_rotate)]
#![feature(sort_internals)]
#![feature(specialization)]
#![feature(step_trait)]
-Subproject commit b6d23ed45d72918239c0bfac11dc547895e59b81
+Subproject commit 6bdbf5dc937459bd10e6bc4dc52b0adbd8cf4358
#![feature(staged_api)]
#![feature(std_internals)]
#![feature(unwind_attributes)]
-#![cfg_attr(target_env = "msvc", feature(raw))]
#![panic_runtime]
#![feature(panic_runtime)]
[input] CrateName(CrateNum),
[] ItemChildren(DefId),
[] ExternModStmtCnum(DefId),
- [input] GetLangItems,
+ [eval_always] GetLibFeatures,
+ [] DefinedLibFeatures(CrateNum),
+ [eval_always] GetLangItems,
[] DefinedLangItems(CrateNum),
[] MissingLangItems(CrateNum),
[] VisibleParentMap,
```
"##,
+E0635: r##"
+The `#![feature]` attribute specified an unknown feature.
+
+Erroneous code example:
+
+```compile_fail,E0635
+#![feature(nonexistent_rust_feature)] // error: unknown feature
+```
+
+"##,
+
+E0636: r##"
+A `#![feature]` attribute was declared multiple times.
+
+Erroneous code example:
+
+```compile_fail,E0636
+#![allow(stable_features)]
+#![feature(rust1)]
+#![feature(rust1)] // error: the feature `rust1` has already been declared
+```
+
+"##,
+
E0644: r##"
A closure or generator was constructed that references its own type.
E0708, // `async` non-`move` closures with arguments are not currently supported
E0709, // multiple different lifetimes used in arguments of `async fn`
E0710, // an unknown tool name found in scoped lint
+ E0711, // a feature has been declared with conflicting stability attributes
}
Fictive,
}
+#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
+pub enum NonMacroAttrKind {
+ /// Single-segment attribute defined by the language (`#[inline]`)
+ Builtin,
+ /// Multi-segment custom attribute living in a "tool module" (`#[rustfmt::skip]`).
+ Tool,
+ /// Single-segment custom attribute registered by a derive macro (`#[serde(default)]`).
+ DeriveHelper,
+ /// Single-segment custom attribute not registered in any way (`#[my_attr]`).
+ Custom,
+}
+
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub enum Def {
// Type namespace
// Macro namespace
Macro(DefId, MacroKind),
- NonMacroAttr, // e.g. `#[inline]` or `#[rustfmt::skip]`
-
- GlobalAsm(DefId),
+ NonMacroAttr(NonMacroAttrKind), // e.g. `#[inline]` or `#[rustfmt::skip]`
// Both namespaces
Err,
}
}
+impl NonMacroAttrKind {
+ fn descr(self) -> &'static str {
+ match self {
+ NonMacroAttrKind::Builtin => "built-in attribute",
+ NonMacroAttrKind::Tool => "tool attribute",
+ NonMacroAttrKind::DeriveHelper => "derive helper attribute",
+ NonMacroAttrKind::Custom => "custom attribute",
+ }
+ }
+}
+
impl Def {
pub fn def_id(&self) -> DefId {
match *self {
Def::AssociatedTy(id) | Def::TyParam(id) | Def::Struct(id) | Def::StructCtor(id, ..) |
Def::Union(id) | Def::Trait(id) | Def::Method(id) | Def::Const(id) |
Def::AssociatedConst(id) | Def::Macro(id, ..) |
- Def::Existential(id) | Def::AssociatedExistential(id) |
- Def::GlobalAsm(id) | Def::TyForeign(id) => {
+ Def::Existential(id) | Def::AssociatedExistential(id) | Def::TyForeign(id) => {
id
}
Def::PrimTy(..) |
Def::SelfTy(..) |
Def::ToolMod |
- Def::NonMacroAttr |
+ Def::NonMacroAttr(..) |
Def::Err => {
bug!("attempted .def_id() on invalid def: {:?}", self)
}
Def::Label(..) => "label",
Def::SelfTy(..) => "self type",
Def::Macro(.., macro_kind) => macro_kind.descr(),
- Def::GlobalAsm(..) => "global asm",
Def::ToolMod => "tool module",
- Def::NonMacroAttr => "non-macro attribute",
+ Def::NonMacroAttr(attr_kind) => attr_kind.descr(),
Def::Err => "unresolved item",
}
}
fn visit_lifetime(&mut self, lifetime: &'v Lifetime) {
walk_lifetime(self, lifetime)
}
- fn visit_qpath(&mut self, qpath: &'v QPath, id: NodeId, span: Span) {
+ fn visit_qpath(&mut self, qpath: &'v QPath, id: HirId, span: Span) {
walk_qpath(self, qpath, id, span)
}
- fn visit_path(&mut self, path: &'v Path, _id: NodeId) {
+ fn visit_path(&mut self, path: &'v Path, _id: HirId) {
walk_path(self, path)
}
fn visit_path_segment(&mut self, path_span: Span, path_segment: &'v PathSegment) {
where V: Visitor<'v>
{
visitor.visit_id(trait_ref.ref_id);
- visitor.visit_path(&trait_ref.path, trait_ref.ref_id)
+ visitor.visit_path(&trait_ref.path, trait_ref.hir_ref_id)
}
pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
}
ItemKind::Use(ref path, _) => {
visitor.visit_id(item.id);
- visitor.visit_path(path, item.id);
+ visitor.visit_path(path, item.hir_id);
}
ItemKind::Static(ref typ, _, body) |
ItemKind::Const(ref typ, body) => {
visitor.visit_fn_decl(&function_declaration.decl);
}
TyKind::Path(ref qpath) => {
- visitor.visit_qpath(qpath, typ.id, typ.span);
+ visitor.visit_qpath(qpath, typ.hir_id, typ.span);
}
TyKind::Array(ref ty, ref length) => {
visitor.visit_ty(ty);
}
}
-pub fn walk_qpath<'v, V: Visitor<'v>>(visitor: &mut V, qpath: &'v QPath, id: NodeId, span: Span) {
+pub fn walk_qpath<'v, V: Visitor<'v>>(visitor: &mut V, qpath: &'v QPath, id: HirId, span: Span) {
match *qpath {
QPath::Resolved(ref maybe_qself, ref path) => {
if let Some(ref qself) = *maybe_qself {
visitor.visit_id(pattern.id);
match pattern.node {
PatKind::TupleStruct(ref qpath, ref children, _) => {
- visitor.visit_qpath(qpath, pattern.id, pattern.span);
+ visitor.visit_qpath(qpath, pattern.hir_id, pattern.span);
walk_list!(visitor, visit_pat, children);
}
PatKind::Path(ref qpath) => {
- visitor.visit_qpath(qpath, pattern.id, pattern.span);
+ visitor.visit_qpath(qpath, pattern.hir_id, pattern.span);
}
PatKind::Struct(ref qpath, ref fields, _) => {
- visitor.visit_qpath(qpath, pattern.id, pattern.span);
+ visitor.visit_qpath(qpath, pattern.hir_id, pattern.span);
for field in fields {
visitor.visit_id(field.node.id);
visitor.visit_ident(field.node.ident);
visitor.visit_anon_const(count)
}
ExprKind::Struct(ref qpath, ref fields, ref optional_base) => {
- visitor.visit_qpath(qpath, expression.id, expression.span);
+ visitor.visit_qpath(qpath, expression.hir_id, expression.span);
for field in fields {
visitor.visit_id(field.id);
visitor.visit_ident(field.ident);
visitor.visit_expr(index_expression)
}
ExprKind::Path(ref qpath) => {
- visitor.visit_qpath(qpath, expression.id, expression.span);
+ visitor.visit_qpath(qpath, expression.hir_id, expression.span);
}
ExprKind::Break(ref destination, ref opt_expr) => {
if let Some(ref label) = destination.label {
}
pub fn walk_vis<'v, V: Visitor<'v>>(visitor: &mut V, vis: &'v Visibility) {
- if let VisibilityKind::Restricted { ref path, id } = vis.node {
+ if let VisibilityKind::Restricted { ref path, id, hir_id } = vis.node {
visitor.visit_id(id);
- visitor.visit_path(path, id)
+ visitor.visit_path(path, hir_id)
}
}
// Whether or not in-band lifetimes are being collected. This is used to
// indicate whether or not we're in a place where new lifetimes will result
// in in-band lifetime definitions, such a function or an impl header.
- // This will always be false unless the `in_band_lifetimes` feature is
- // enabled.
+ // This will always be false unless the `in_band_lifetimes` or
+ // `impl_header_lifetime_elision` feature is enabled.
is_collecting_in_band_lifetimes: bool,
// Currently in-scope lifetimes defined in impl headers, fn headers, or HRTB.
assert!(self.lifetimes_to_define.is_empty());
let old_anonymous_lifetime_mode = self.anonymous_lifetime_mode;
- self.is_collecting_in_band_lifetimes = self.sess.features_untracked().in_band_lifetimes;
- if self.is_collecting_in_band_lifetimes {
+ if self.sess.features_untracked().impl_header_lifetime_elision {
self.anonymous_lifetime_mode = anonymous_lifetime_mode;
+ self.is_collecting_in_band_lifetimes = true;
+ } else if self.sess.features_untracked().in_band_lifetimes {
+ self.is_collecting_in_band_lifetimes = true;
}
let (in_band_ty_params, res) = f(self);
return;
}
+ if !self.sess.features_untracked().in_band_lifetimes {
+ return;
+ }
+
if self.in_scope_lifetimes.contains(&ident.modern()) {
return;
}
let future_path =
this.std_path(span, &["future", "Future"], Some(future_params), false);
+ let LoweredNodeId { node_id, hir_id } = this.next_id();
let mut bounds = vec![
hir::GenericBound::Trait(
hir::PolyTraitRef {
trait_ref: hir::TraitRef {
path: future_path,
- ref_id: this.next_id().node_id,
+ ref_id: node_id,
+ hir_ref_id: hir_id,
},
bound_generic_params: hir_vec![],
span,
hir::QPath::Resolved(None, path) => path.and_then(|path| path),
qpath => bug!("lower_trait_ref: unexpected QPath `{:?}`", qpath),
};
+ let LoweredNodeId { node_id, hir_id } = self.lower_node_id(p.ref_id);
hir::TraitRef {
path,
- ref_id: self.lower_node_id(p.ref_id).node_id,
+ ref_id: node_id,
+ hir_ref_id: hir_id,
}
}
hir::VisibilityKind::Public => hir::VisibilityKind::Public,
hir::VisibilityKind::Crate(sugar) => hir::VisibilityKind::Crate(sugar),
hir::VisibilityKind::Inherited => hir::VisibilityKind::Inherited,
- hir::VisibilityKind::Restricted { ref path, id: _ } => {
+ hir::VisibilityKind::Restricted { ref path, id: _, hir_id: _ } => {
+ let id = this.next_id();
hir::VisibilityKind::Restricted {
path: path.clone(),
// We are allocating a new NodeId here
- id: this.next_id().node_id,
+ id: id.node_id,
+ hir_id: id.hir_id,
}
}
};
hir::VisibilityKind::Public => hir::VisibilityKind::Public,
hir::VisibilityKind::Crate(sugar) => hir::VisibilityKind::Crate(sugar),
hir::VisibilityKind::Inherited => hir::VisibilityKind::Inherited,
- hir::VisibilityKind::Restricted { ref path, id: _ } => {
+ hir::VisibilityKind::Restricted { ref path, id: _, hir_id: _ } => {
+ let id = this.next_id();
hir::VisibilityKind::Restricted {
path: path.clone(),
// We are allocating a new NodeId here
- id: this.next_id().node_id,
+ id: id.node_id,
+ hir_id: id.hir_id,
}
}
};
let node = match v.node {
VisibilityKind::Public => hir::VisibilityKind::Public,
VisibilityKind::Crate(sugar) => hir::VisibilityKind::Crate(sugar),
- VisibilityKind::Restricted { ref path, id } => hir::VisibilityKind::Restricted {
- path: P(self.lower_path(id, path, ParamMode::Explicit)),
- id: if let Some(owner) = explicit_owner {
- self.lower_node_id_with_owner(id, owner).node_id
+ VisibilityKind::Restricted { ref path, id } => {
+ let lowered_id = if let Some(owner) = explicit_owner {
+ self.lower_node_id_with_owner(id, owner)
} else {
- self.lower_node_id(id).node_id
- },
+ self.lower_node_id(id)
+ };
+ hir::VisibilityKind::Restricted {
+ path: P(self.lower_path(id, path, ParamMode::Explicit)),
+ id: lowered_id.node_id,
+ hir_id: lowered_id.hir_id,
+ }
},
VisibilityKind::Inherited => hir::VisibilityKind::Inherited,
};
trait_ref: hir::TraitRef {
path: path.and_then(|path| path),
ref_id: id.node_id,
+ hir_ref_id: id.hir_id,
},
span,
};
ItemKind::Const(..) => Some(Def::Const(def_id())),
ItemKind::Fn(..) => Some(Def::Fn(def_id())),
ItemKind::Mod(..) => Some(Def::Mod(def_id())),
- ItemKind::GlobalAsm(..) => Some(Def::GlobalAsm(def_id())),
ItemKind::Existential(..) => Some(Def::Existential(def_id())),
ItemKind::Ty(..) => Some(Def::TyAlias(def_id())),
ItemKind::Enum(..) => Some(Def::Enum(def_id())),
ItemKind::ExternCrate(_) |
ItemKind::Use(..) |
ItemKind::ForeignMod(..) |
+ ItemKind::GlobalAsm(..) |
ItemKind::Impl(..) => None,
}
}
pub struct TraitRef {
pub path: Path,
pub ref_id: NodeId,
+ pub hir_ref_id: HirId,
}
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
pub enum VisibilityKind {
Public,
Crate(CrateSugar),
- Restricted { path: P<Path>, id: NodeId },
+ Restricted { path: P<Path>, id: NodeId, hir_id: HirId },
Inherited,
}
impl_stable_hash_for!(struct hir::TraitRef {
// Don't hash the ref_id. It is tracked via the thing it is used to access
ref_id -> _,
+ hir_ref_id -> _,
path,
});
hir::VisibilityKind::Crate(sugar) => {
sugar.hash_stable(hcx, hasher);
}
- hir::VisibilityKind::Restricted { ref path, id } => {
+ hir::VisibilityKind::Restricted { ref path, id, hir_id } => {
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
id.hash_stable(hcx, hasher);
+ hir_id.hash_stable(hcx, hasher);
});
path.hash_stable(hcx, hasher);
}
Fictive
});
+impl_stable_hash_for!(enum hir::def::NonMacroAttrKind {
+ Builtin,
+ Tool,
+ DeriveHelper,
+ Custom,
+});
+
impl_stable_hash_for!(enum hir::def::Def {
Mod(def_id),
Struct(def_id),
Upvar(def_id, index, expr_id),
Label(node_id),
Macro(def_id, macro_kind),
- GlobalAsm(def_id),
ToolMod,
- NonMacroAttr,
+ NonMacroAttr(attr_kind),
Err
});
span
});
+impl_stable_hash_for!(struct ::middle::lib_features::LibFeatures {
+ stable,
+ unstable
+});
+
impl<'a> HashStable<StableHashingContext<'a>> for ::middle::lang_items::LangItem {
fn hash_stable<W: StableHasherResult>(&self,
_: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
// Unfortunately we cannot exhaustively list fields here, since the
// struct is macro generated.
- self.declared_stable_lang_features.hash_stable(hcx, hasher);
+ self.declared_lang_features.hash_stable(hcx, hasher);
self.declared_lib_features.hash_stable(hcx, hasher);
self.walk_feature_fields(|feature_name, value| {
) {
debug!("report_region_errors(): {} errors to start", errors.len());
- if will_later_be_reported_by_nll && self.tcx.use_mir_borrowck() {
+ if will_later_be_reported_by_nll &&
+ // FIXME: `use_mir_borrowck` seems wrong here...
+ self.tcx.use_mir_borrowck() &&
+ // ... this is a band-aid; may be better to explicitly
+ // match on every borrowck_mode variant to guide decision
+ // here.
+ !self.tcx.migrate_borrowck() {
+
// With `#![feature(nll)]`, we want to present a nice user
// experience, so don't even mention the errors from the
// AST checker.
Self { tcx, error: None, regions: Some((span, sub, sup)), tables }
}
+ pub fn try_report_from_nll(&self) -> Option<ErrorReported> {
+ // Due to the improved diagnostics returned by the MIR borrow checker, only a subset of
+ // the nice region errors are required when running under the MIR borrow checker.
+ self.try_report_named_anon_conflict()
+ }
+
pub fn try_report(&self) -> Option<ErrorReported> {
self.try_report_named_anon_conflict()
.or_else(|| self.try_report_anon_anon_conflict())
region_info
);
- let (arg, new_ty, br, is_first, scope_def_id, is_impl_item) = (
+ let (arg, new_ty, new_ty_span, br, is_first, scope_def_id, is_impl_item) = (
anon_arg_info.arg,
anon_arg_info.arg_ty,
+ anon_arg_info.arg_ty_span,
anon_arg_info.bound_region,
anon_arg_info.is_first,
region_info.def_id,
E0621,
"explicit lifetime required in {}",
error_var
- ).span_label(
- arg.pat.span,
- format!("consider changing {} to `{}`", span_label_var, new_ty),
+ ).span_suggestion(
+ new_ty_span,
+ &format!("add explicit lifetime `{}` to {}", named, span_label_var),
+ new_ty.to_string()
)
.span_label(span, format!("lifetime `{}` required", named))
.emit();
pub arg_ty: Ty<'tcx>,
// the ty::BoundRegion corresponding to the anonymous region
pub bound_region: ty::BoundRegion,
+ // arg_ty_span contains span of argument type
+ pub arg_ty_span : Span,
// corresponds to id the argument is the first parameter
// in the declaration
pub is_first: bool,
if let Some(node_id) = hir.as_local_node_id(id) {
if let Some(body_id) = hir.maybe_body_owned_by(node_id) {
let body = hir.body(body_id);
+ let owner_id = hir.body_owner(body_id);
+ let fn_decl = hir.fn_decl(owner_id).unwrap();
if let Some(tables) = self.tables {
body.arguments
.iter()
.enumerate()
.filter_map(|(index, arg)| {
// May return None; sometimes the tables are not yet populated.
+ let ty_hir_id = fn_decl.inputs[index].hir_id;
+ let arg_ty_span = hir.span(hir.hir_to_node_id(ty_hir_id));
let ty = tables.node_id_to_type_opt(arg.hir_id)?;
let mut found_anon_region = false;
let new_arg_ty = self.tcx.fold_regions(&ty, &mut false, |r, _| {
Some(AnonymousArgInfo {
arg: arg,
arg_ty: new_arg_ty,
+ arg_ty_span : arg_ty_span,
bound_region: bound_region,
is_first: is_first,
})
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(drain_filter)]
-#![feature(from_ref)]
-#![feature(fs_read_write)]
#![feature(iterator_find_map)]
#![cfg_attr(windows, feature(libc))]
#![feature(macro_vis_matcher)]
#![feature(step_trait)]
#![feature(integer_atomics)]
#![feature(test)]
+#![cfg_attr(not(stage0), feature(impl_header_lifetime_elision))]
#![feature(in_band_lifetimes)]
#![feature(macro_at_most_once_rep)]
-#![feature(inclusive_range_methods)]
#![feature(crate_in_paths)]
#![recursion_limit="512"]
pub mod exported_symbols;
pub mod free_region;
pub mod intrinsicck;
+ pub mod lib_features;
pub mod lang_items;
pub mod liveness;
pub mod mem_categorization;
declare_lint! {
pub UNUSED_FEATURES,
Warn,
- "unused or unknown features found in crate-level #[feature] directives"
+ "unused features found in crate-level #[feature] directives"
}
declare_lint! {
hir_visit::walk_lifetime(self, lt);
}
- fn visit_path(&mut self, p: &'tcx hir::Path, id: ast::NodeId) {
+ fn visit_path(&mut self, p: &'tcx hir::Path, id: hir::HirId) {
run_lints!(self, check_path, p, id);
hir_visit::walk_path(self, p);
}
fn check_variant(a: &$hir hir::Variant, b: &$hir hir::Generics);
fn check_variant_post(a: &$hir hir::Variant, b: &$hir hir::Generics);
fn check_lifetime(a: &$hir hir::Lifetime);
- fn check_path(a: &$hir hir::Path, b: ast::NodeId);
+ fn check_path(a: &$hir hir::Path, b: hir::HirId);
fn check_attribute(a: &$hir ast::Attribute);
/// Called when entering a syntax node that can have lint attributes such
self.in_pat = false;
}
- fn visit_path(&mut self, path: &'tcx hir::Path, _: ast::NodeId) {
+ fn visit_path(&mut self, path: &'tcx hir::Path, _: hir::HirId) {
self.handle_definition(path.def);
intravisit::walk_path(self, path);
}
--- /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.
+
+// Detecting lib features (i.e. features that are not lang features).
+//
+// These are declared using stability attributes (e.g. `#[stable (..)]`
+// and `#[unstable (..)]`), but are not declared in one single location
+// (unlike lang features), which means we need to collect them instead.
+
+use ty::TyCtxt;
+use syntax::symbol::Symbol;
+use syntax::ast::{Attribute, MetaItem, MetaItemKind};
+use syntax_pos::{Span, DUMMY_SP};
+use hir;
+use hir::itemlikevisit::ItemLikeVisitor;
+use rustc_data_structures::fx::{FxHashSet, FxHashMap};
+use errors::DiagnosticId;
+
+pub struct LibFeatures {
+ // A map from feature to stabilisation version.
+ pub stable: FxHashMap<Symbol, Symbol>,
+ pub unstable: FxHashSet<Symbol>,
+}
+
+impl LibFeatures {
+ fn new() -> LibFeatures {
+ LibFeatures {
+ stable: FxHashMap(),
+ unstable: FxHashSet(),
+ }
+ }
+
+ pub fn to_vec(&self) -> Vec<(Symbol, Option<Symbol>)> {
+ let mut all_features: Vec<_> = self.stable.iter().map(|(f, s)| (*f, Some(*s)))
+ .chain(self.unstable.iter().map(|f| (*f, None)))
+ .collect();
+ all_features.sort_unstable_by_key(|f| f.0.as_str());
+ all_features
+ }
+}
+
+pub struct LibFeatureCollector<'a, 'tcx: 'a> {
+ tcx: TyCtxt<'a, 'tcx, 'tcx>,
+ lib_features: LibFeatures,
+}
+
+impl<'a, 'tcx> LibFeatureCollector<'a, 'tcx> {
+ fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> LibFeatureCollector<'a, 'tcx> {
+ LibFeatureCollector {
+ tcx,
+ lib_features: LibFeatures::new(),
+ }
+ }
+
+ fn extract(&self, attrs: &[Attribute]) -> Vec<(Symbol, Option<Symbol>, Span)> {
+ let stab_attrs = vec!["stable", "unstable", "rustc_const_unstable"];
+ let mut features = vec![];
+
+ for attr in attrs {
+ // Find a stability attribute (i.e. `#[stable (..)]`, `#[unstable (..)]`,
+ // `#[rustc_const_unstable (..)]`).
+ if let Some(stab_attr) = stab_attrs.iter().find(|stab_attr| {
+ attr.check_name(stab_attr)
+ }) {
+ let meta_item = attr.meta();
+ if let Some(MetaItem { node: MetaItemKind::List(ref metas), .. }) = meta_item {
+ let mut feature = None;
+ let mut since = None;
+ for meta in metas {
+ if let Some(mi) = meta.meta_item() {
+ // Find the `feature = ".."` meta-item.
+ match (&*mi.name().as_str(), mi.value_str()) {
+ ("feature", val) => feature = val,
+ ("since", val) => since = val,
+ _ => {}
+ }
+ }
+ }
+ if let Some(feature) = feature {
+ // This additional check for stability is to make sure we
+ // don't emit additional, irrelevant errors for malformed
+ // attributes.
+ if *stab_attr != "stable" || since.is_some() {
+ features.push((feature, since, attr.span));
+ }
+ }
+ // We need to iterate over the other attributes, because
+ // `rustc_const_unstable` is not mutually exclusive with
+ // the other stability attributes, so we can't just `break`
+ // here.
+ }
+ }
+ }
+
+ features
+ }
+
+ fn collect_feature(&mut self, feature: Symbol, since: Option<Symbol>, span: Span) {
+ let already_in_stable = self.lib_features.stable.contains_key(&feature);
+ let already_in_unstable = self.lib_features.unstable.contains(&feature);
+
+ match (since, already_in_stable, already_in_unstable) {
+ (Some(since), _, false) => {
+ if let Some(prev_since) = self.lib_features.stable.get(&feature) {
+ if *prev_since != since {
+ let msg = format!(
+ "feature `{}` is declared stable since {}, \
+ but was previously declared stable since {}",
+ feature,
+ since,
+ prev_since,
+ );
+ self.tcx.sess.struct_span_err_with_code(span, &msg,
+ DiagnosticId::Error("E0711".into())).emit();
+ return;
+ }
+ }
+
+ self.lib_features.stable.insert(feature, since);
+ }
+ (None, false, _) => {
+ self.lib_features.unstable.insert(feature);
+ }
+ (Some(_), _, true) | (None, true, _) => {
+ let msg = format!(
+ "feature `{}` is declared {}, but was previously declared {}",
+ feature,
+ if since.is_some() { "stable"} else { "unstable" },
+ if since.is_none() { "stable"} else { "unstable" },
+ );
+ self.tcx.sess.struct_span_err_with_code(span, &msg,
+ DiagnosticId::Error("E0711".into())).emit();
+ }
+ }
+ }
+
+ fn collect_from_attrs(&mut self, attrs: &[Attribute]) {
+ for (feature, stable, span) in self.extract(attrs) {
+ self.collect_feature(feature, stable, span);
+ }
+ }
+}
+
+impl<'a, 'v, 'tcx> ItemLikeVisitor<'v> for LibFeatureCollector<'a, 'tcx> {
+ fn visit_item(&mut self, item: &hir::Item) {
+ self.collect_from_attrs(&item.attrs);
+ }
+
+ fn visit_trait_item(&mut self, trait_item: &hir::TraitItem) {
+ self.collect_from_attrs(&trait_item.attrs);
+ }
+
+ fn visit_impl_item(&mut self, impl_item: &hir::ImplItem) {
+ self.collect_from_attrs(&impl_item.attrs);
+ }
+}
+
+pub fn collect<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> LibFeatures {
+ let mut collector = LibFeatureCollector::new(tcx);
+ for &cnum in tcx.crates().iter() {
+ for &(feature, since) in tcx.defined_lib_features(cnum).iter() {
+ collector.collect_feature(feature, since, DUMMY_SP);
+ }
+ }
+ collector.collect_from_attrs(&tcx.hir.krate().attrs);
+ tcx.hir.krate().visit_all_item_likes(&mut collector);
+ for exported_macro in &tcx.hir.krate().exported_macros {
+ collector.collect_from_attrs(&exported_macro.attrs);
+ }
+ collector.lib_features
+}
// makes all other generics or inline functions that it references
// reachable as well.
-use hir::CodegenFnAttrs;
+use hir::{CodegenFnAttrs, CodegenFnAttrFlags};
use hir::map as hir_map;
use hir::def::Def;
use hir::def_id::{DefId, CrateNum};
use rustc_target::spec::abi::Abi;
use syntax::ast;
-use syntax::attr;
use hir;
use hir::def_id::LOCAL_CRATE;
use hir::intravisit::{Visitor, NestedVisitorMap};
impl<'a, 'tcx: 'a> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a, 'tcx> {
fn visit_item(&mut self, item: &hir::Item) {
// Anything which has custom linkage gets thrown on the worklist no
- // matter where it is in the crate.
- if attr::contains_name(&item.attrs, "linkage") {
+ // matter where it is in the crate, along with "special std symbols"
+ // which are currently akin to allocator symbols.
+ let def_id = self.tcx.hir.local_def_id(item.id);
+ let codegen_attrs = self.tcx.codegen_fn_attrs(def_id);
+ if codegen_attrs.linkage.is_some() ||
+ codegen_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL) {
self.worklist.push(item.id);
}
self.resolve_lifetime_ref(lifetime_ref);
}
- fn visit_path(&mut self, path: &'tcx hir::Path, _: ast::NodeId) {
+ fn visit_path(&mut self, path: &'tcx hir::Path, _: hir::HirId) {
for (i, segment) in path.segments.iter().enumerate() {
let depth = path.segments.len() - i - 1;
if let Some(ref args) = segment.args {
use hir::def_id::{CrateNum, CRATE_DEF_INDEX, DefId, LOCAL_CRATE};
use ty::{self, TyCtxt};
use middle::privacy::AccessLevels;
-use session::DiagnosticMessageId;
+use session::{DiagnosticMessageId, Session};
use syntax::symbol::Symbol;
use syntax_pos::{Span, MultiSpan};
use syntax::ast;
use syntax::ast::{NodeId, Attribute};
-use syntax::feature_gate::{GateIssue, emit_feature_err, find_lang_feature_accepted_version};
+use syntax::feature_gate::{GateIssue, emit_feature_err};
use syntax::attr::{self, Stability, Deprecation};
use util::nodemap::{FxHashSet, FxHashMap};
intravisit::walk_item(self, item);
}
- fn visit_path(&mut self, path: &'tcx hir::Path, id: ast::NodeId) {
+ fn visit_path(&mut self, path: &'tcx hir::Path, id: hir::HirId) {
+ let id = self.tcx.hir.hir_to_node_id(id);
match path.def {
Def::Local(..) | Def::Upvar(..) |
Def::PrimTy(..) | Def::SelfTy(..) | Def::Err => {}
krate.visit_all_item_likes(&mut missing.as_deep_visitor());
}
- let ref declared_lib_features = tcx.features().declared_lib_features;
- let mut remaining_lib_features: FxHashMap<Symbol, Span>
- = declared_lib_features.clone().into_iter().collect();
- remaining_lib_features.remove(&Symbol::intern("proc_macro"));
-
- for &(ref stable_lang_feature, span) in &tcx.features().declared_stable_lang_features {
- let version = find_lang_feature_accepted_version(&stable_lang_feature.as_str())
- .expect("unexpectedly couldn't find version feature was stabilized");
- tcx.lint_node(lint::builtin::STABLE_FEATURES,
- ast::CRATE_NODE_ID,
- span,
- &format_stable_since_msg(version));
- }
-
- // FIXME(#44232) the `used_features` table no longer exists, so we don't
- // lint about unknown or unused features. We should reenable
- // this one day!
- //
- // let index = tcx.stability();
- // for (used_lib_feature, level) in &index.used_features {
- // remaining_lib_features.remove(used_lib_feature);
- // }
- //
- // for &span in remaining_lib_features.values() {
- // tcx.lint_node(lint::builtin::UNUSED_FEATURES,
- // ast::CRATE_NODE_ID,
- // span,
- // "unused or unknown feature");
- // }
+ let declared_lang_features = &tcx.features().declared_lang_features;
+ let mut lang_features = FxHashSet();
+ for &(feature, span, since) in declared_lang_features {
+ if let Some(since) = since {
+ // Warn if the user has enabled an already-stable lang feature.
+ unnecessary_stable_feature_lint(tcx, span, feature, since);
+ }
+ if lang_features.contains(&feature) {
+ // Warn if the user enables a lang feature multiple times.
+ duplicate_feature_err(tcx.sess, span, feature);
+ }
+ lang_features.insert(feature);
+ }
+
+ let declared_lib_features = &tcx.features().declared_lib_features;
+ let mut remaining_lib_features = FxHashMap();
+ for (feature, span) in declared_lib_features {
+ if remaining_lib_features.contains_key(&feature) {
+ // Warn if the user enables a lib feature multiple times.
+ duplicate_feature_err(tcx.sess, *span, *feature);
+ }
+ remaining_lib_features.insert(feature, span.clone());
+ }
+ // `stdbuild` has special handling for `libc`, so we need to
+ // recognise the feature when building std.
+ // Likewise, libtest is handled specially, so `test` isn't
+ // available as we'd like it to be.
+ // FIXME: only remove `libc` when `stdbuild` is active.
+ // FIXME: remove special casing for `test`.
+ remaining_lib_features.remove(&Symbol::intern("libc"));
+ remaining_lib_features.remove(&Symbol::intern("test"));
+
+ for (feature, stable) in tcx.lib_features().to_vec() {
+ if let Some(since) = stable {
+ if let Some(span) = remaining_lib_features.get(&feature) {
+ // Warn if the user has enabled an already-stable lib feature.
+ unnecessary_stable_feature_lint(tcx, *span, feature, since);
+ }
+ }
+ remaining_lib_features.remove(&feature);
+ }
+
+ for (feature, span) in remaining_lib_features {
+ struct_span_err!(tcx.sess, span, E0635, "unknown feature `{}`", feature).emit();
+ }
+
+ // FIXME(#44232): the `used_features` table no longer exists, so we
+ // don't lint about unused features. We should reenable this one day!
+}
+
+fn unnecessary_stable_feature_lint<'a, 'tcx>(
+ tcx: TyCtxt<'a, 'tcx, 'tcx>,
+ span: Span,
+ feature: Symbol,
+ since: Symbol
+) {
+ tcx.lint_node(lint::builtin::STABLE_FEATURES,
+ ast::CRATE_NODE_ID,
+ span,
+ &format!("the feature `{}` has been stable since {} and no longer requires \
+ an attribute to enable", feature, since));
}
-fn format_stable_since_msg(version: &str) -> String {
- format!("this feature has been stable since {}. Attribute no longer needed", version)
+fn duplicate_feature_err(sess: &Session, span: Span, feature: Symbol) {
+ struct_span_err!(sess, span, E0636, "the feature `{}` has already been declared", feature)
+ .emit();
}
&Err(SelectionError::Unimplemented) => {
if self.is_of_param(pred.skip_binder().trait_ref.substs) {
already_visited.remove(&pred);
- user_computed_preds.insert(ty::Predicate::Trait(pred.clone()));
+ self.add_user_pred(&mut user_computed_preds,
+ ty::Predicate::Trait(pred.clone()));
predicates.push_back(pred);
} else {
debug!(
return Some((new_env, final_user_env));
}
+ // This method is designed to work around the following issue:
+ // When we compute auto trait bounds, we repeatedly call SelectionContext.select,
+ // progressively building a ParamEnv based on the results we get.
+ // However, our usage of SelectionContext differs from its normal use within the compiler,
+ // in that we capture and re-reprocess predicates from Unimplemented errors.
+ //
+ // This can lead to a corner case when dealing with region parameters.
+ // During our selection loop in evaluate_predicates, we might end up with
+ // two trait predicates that differ only in their region parameters:
+ // one containing a HRTB lifetime parameter, and one containing a 'normal'
+ // lifetime parameter. For example:
+ //
+ // T as MyTrait<'a>
+ // T as MyTrait<'static>
+ //
+ // If we put both of these predicates in our computed ParamEnv, we'll
+ // confuse SelectionContext, since it will (correctly) view both as being applicable.
+ //
+ // To solve this, we pick the 'more strict' lifetime bound - i.e. the HRTB
+ // Our end goal is to generate a user-visible description of the conditions
+ // under which a type implements an auto trait. A trait predicate involving
+ // a HRTB means that the type needs to work with any choice of lifetime,
+ // not just one specific lifetime (e.g. 'static).
+ fn add_user_pred<'c>(&self, user_computed_preds: &mut FxHashSet<ty::Predicate<'c>>,
+ new_pred: ty::Predicate<'c>) {
+ let mut should_add_new = true;
+ user_computed_preds.retain(|&old_pred| {
+ match (&new_pred, old_pred) {
+ (&ty::Predicate::Trait(new_trait), ty::Predicate::Trait(old_trait)) => {
+ if new_trait.def_id() == old_trait.def_id() {
+ let new_substs = new_trait.skip_binder().trait_ref.substs;
+ let old_substs = old_trait.skip_binder().trait_ref.substs;
+ if !new_substs.types().eq(old_substs.types()) {
+ // We can't compare lifetimes if the types are different,
+ // so skip checking old_pred
+ return true
+ }
+
+ for (new_region, old_region) in new_substs
+ .regions()
+ .zip(old_substs.regions()) {
+
+ match (new_region, old_region) {
+ // If both predicates have an 'ReLateBound' (a HRTB) in the
+ // same spot, we do nothing
+ (
+ ty::RegionKind::ReLateBound(_, _),
+ ty::RegionKind::ReLateBound(_, _)
+ ) => {},
+
+ (ty::RegionKind::ReLateBound(_, _), _) => {
+ // The new predicate has a HRTB in a spot where the old
+ // predicate does not (if they both had a HRTB, the previous
+ // match arm would have executed).
+ //
+ // The means we want to remove the older predicate from
+ // user_computed_preds, since having both it and the new
+ // predicate in a ParamEnv would confuse SelectionContext
+ // We're currently in the predicate passed to 'retain',
+ // so we return 'false' to remove the old predicate from
+ // user_computed_preds
+ return false;
+ },
+ (_, ty::RegionKind::ReLateBound(_, _)) => {
+ // This is the opposite situation as the previous arm - the
+ // old predicate has a HRTB lifetime in a place where the
+ // new predicate does not. We want to leave the old
+ // predicate in user_computed_preds, and skip adding
+ // new_pred to user_computed_params.
+ should_add_new = false
+ }
+ _ => {}
+ }
+ }
+ }
+ },
+ _ => {}
+ }
+ return true
+ });
+
+ if should_add_new {
+ user_computed_preds.insert(new_pred);
+ }
+ }
+
pub fn region_name(&self, region: Region) -> Option<String> {
match region {
&ty::ReEarlyBound(r) => Some(r.name.to_string()),
let substs = &p.skip_binder().trait_ref.substs;
if self.is_of_param(substs) && !only_projections && is_new_pred {
- computed_preds.insert(predicate);
+ self.add_user_pred(computed_preds, predicate);
}
predicates.push_back(p.clone());
}
// If the projection isn't all type vars, then
// we don't want to add it as a bound
if self.is_of_param(p.skip_binder().projection_ty.substs) && is_new_pred {
- computed_preds.insert(predicate);
+ self.add_user_pred(computed_preds, predicate);
} else {
match poly_project_and_unify_type(select, &obligation.with(p.clone())) {
Err(e) => {
}
}
&ty::Predicate::RegionOutlives(ref binder) => {
- if let Err(_) = select
- .infcx()
- .region_outlives_predicate(&dummy_cause, binder)
- {
+ if select.infcx().region_outlives_predicate(&dummy_cause, binder).is_err() {
return false;
}
}
// Eventually I'll need to implement param-env-aware
// `Γ₁ ⊦ φ₁ => Γ₂ ⊦ φ₂` logic.
let param_env = ty::ParamEnv::empty();
- if let Ok(_) = self.can_sub(param_env, error, implication) {
+ if self.can_sub(param_env, error, implication).is_ok() {
debug!("error_implies: {:?} -> {:?} -> {:?}", cond, error, implication);
return true
}
// variables. Process these constraints.
let mut fulfill_cx = FulfillmentContext::new();
fulfill_cx.register_predicate_obligations(self, result.obligations);
- if let Err(_) = fulfill_cx.select_all_or_error(self) {
+ if fulfill_cx.select_all_or_error(self).is_err() {
self.tcx.sess.delay_span_bug(
span,
"implied_outlives_bounds failed to solve obligations from instantiation"
-> bool
{
assert!(!skol_trait_ref.has_escaping_regions());
- if let Err(_) = self.infcx.at(&obligation.cause, obligation.param_env)
- .sup(ty::Binder::dummy(skol_trait_ref), trait_bound) {
+ if self.infcx.at(&obligation.cause, obligation.param_env)
+ .sup(ty::Binder::dummy(skol_trait_ref), trait_bound).is_err() {
return false;
}
self.sess.consider_optimizing(&cname, msg)
}
+ pub fn lib_features(self) -> Lrc<middle::lib_features::LibFeatures> {
+ self.get_lib_features(LOCAL_CRATE)
+ }
+
pub fn lang_items(self) -> Lrc<middle::lang_items::LanguageItems> {
self.get_lang_items(LOCAL_CRATE)
}
assert_eq!(id, LOCAL_CRATE);
tcx.crate_name
};
+ providers.get_lib_features = |tcx, id| {
+ assert_eq!(id, LOCAL_CRATE);
+ Lrc::new(middle::lib_features::collect(tcx))
+ };
providers.get_lang_items = |tcx, id| {
assert_eq!(id, LOCAL_CRATE);
- // FIXME(#42293) Right now we insert a `with_ignore` node in the dep
- // graph here to ignore the fact that `get_lang_items` below depends on
- // the entire crate. For now this'll prevent false positives of
- // recompiling too much when anything changes.
- //
- // Once red/green incremental compilation lands we should be able to
- // remove this because while the crate changes often the lint level map
- // will change rarely.
- tcx.dep_graph.with_ignore(|| Lrc::new(middle::lang_items::collect(tcx)))
+ Lrc::new(middle::lang_items::collect(tcx))
};
providers.freevars = |tcx, id| tcx.gcx.freevars.get(&id).cloned();
providers.maybe_unused_trait_import = |tcx, id| {
})
}
traits::VtableBuiltin(..) => {
- if let Some(_) = tcx.lang_items().clone_trait() {
+ if tcx.lang_items().clone_trait().is_some() {
Some(Instance {
def: ty::InstanceDef::CloneShim(def_id, trait_ref.self_ty()),
substs: rcvr_substs
}
}
+impl<'tcx> QueryDescription<'tcx> for queries::get_lib_features<'tcx> {
+ fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+ format!("calculating the lib features map")
+ }
+}
+
+impl<'tcx> QueryDescription<'tcx> for queries::defined_lib_features<'tcx> {
+ fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+ format!("calculating the lib features defined in a crate")
+ }
+}
+
impl<'tcx> QueryDescription<'tcx> for queries::get_lang_items<'tcx> {
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
"calculating the lang items map".to_string()
use middle::region;
use middle::resolve_lifetime::{ResolveLifetimes, Region, ObjectLifetimeDefault};
use middle::stability::{self, DeprecationEntry};
+use middle::lib_features::LibFeatures;
use middle::lang_items::{LanguageItems, LangItem};
use middle::exported_symbols::{SymbolExportLevel, ExportedSymbol};
use mir::interpret::ConstEvalResult;
[] fn item_children: ItemChildren(DefId) -> Lrc<Vec<Export>>,
[] fn extern_mod_stmt_cnum: ExternModStmtCnum(DefId) -> Option<CrateNum>,
+ [] fn get_lib_features: get_lib_features_node(CrateNum) -> Lrc<LibFeatures>,
+ [] fn defined_lib_features: DefinedLibFeatures(CrateNum)
+ -> Lrc<Vec<(Symbol, Option<Symbol>)>>,
[] fn get_lang_items: get_lang_items_node(CrateNum) -> Lrc<LanguageItems>,
[] fn defined_lang_items: DefinedLangItems(CrateNum) -> Lrc<Vec<(DefId, usize)>>,
[] fn missing_lang_items: MissingLangItems(CrateNum) -> Lrc<Vec<LangItem>>,
DepConstructor::LinkArgs
}
+fn get_lib_features_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
+ DepConstructor::GetLibFeatures
+}
+
fn get_lang_items_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
DepConstructor::GetLangItems
}
DepKind::CrateName => { force!(crate_name, krate!()); }
DepKind::ItemChildren => { force!(item_children, def_id!()); }
DepKind::ExternModStmtCnum => { force!(extern_mod_stmt_cnum, def_id!()); }
+ DepKind::GetLibFeatures => { force!(get_lib_features, LOCAL_CRATE); }
+ DepKind::DefinedLibFeatures => { force!(defined_lib_features, krate!()); }
DepKind::GetLangItems => { force!(get_lang_items, LOCAL_CRATE); }
DepKind::DefinedLangItems => { force!(defined_lang_items, krate!()); }
DepKind::MissingLangItems => { force!(missing_lang_items, krate!()); }
use syntax::{
ast::{
self, Arg, Attribute, Crate, Expr, FnHeader, Generics, Ident, Item, ItemKind,
- LitKind, Mac, Mod, Mutability, StrStyle, Ty, TyKind, Unsafety, VisibilityKind,
+ Mac, Mod, Mutability, Ty, TyKind, Unsafety, VisibilityKind,
},
attr,
codemap::{
}
fn attrs(&self) -> Vec<Attribute> {
- let key = Symbol::intern("linkage");
- let value = LitKind::Str(Symbol::intern("external"), StrStyle::Cooked);
- let linkage = self.cx.meta_name_value(self.span, key, value);
-
let no_mangle = Symbol::intern("no_mangle");
let no_mangle = self.cx.meta_word(self.span, no_mangle);
let special = Symbol::intern("rustc_std_internal_symbol");
let special = self.cx.meta_word(self.span, special);
vec![
- self.cx.attribute(self.span, linkage),
self.cx.attribute(self.span, no_mangle),
self.cx.attribute(self.span, special),
]
#![allow(non_camel_case_types)]
-#![feature(from_ref)]
#![feature(quote)]
#![recursion_limit="256"]
test = false
[dependencies]
-bitflags = "1.0.1"
cc = "1.0.1"
-flate2 = "1.0"
-jobserver = "0.1.5"
-libc = "0.2"
-log = "0.4"
num_cpus = "1.0"
-rustc = { path = "../librustc" }
rustc-demangle = "0.1.4"
-rustc_allocator = { path = "../librustc_allocator" }
-rustc_apfloat = { path = "../librustc_apfloat" }
-rustc_target = { path = "../librustc_target" }
-rustc_data_structures = { path = "../librustc_data_structures" }
-rustc_errors = { path = "../librustc_errors" }
-rustc_incremental = { path = "../librustc_incremental" }
rustc_llvm = { path = "../librustc_llvm" }
-rustc_platform_intrinsics = { path = "../librustc_platform_intrinsics" }
-rustc_codegen_utils = { path = "../librustc_codegen_utils" }
-rustc_mir = { path = "../librustc_mir" }
-serialize = { path = "../libserialize" }
-syntax = { path = "../libsyntax" }
-syntax_pos = { path = "../libsyntax_pos" }
-tempfile = "3.0"
-
-# not actually used but needed to make sure we enable the same feature set as
-# winapi used in librustc
-env_logger = { version = "0.5", default-features = false }
[features]
-# Used to communicate the feature to `rustc_target` in the same manner that the
-# `rustc` driver script communicate this.
-jemalloc = ["rustc_target/jemalloc"]
-
# This is used to convince Cargo to separately cache builds of `rustc_codegen_llvm`
# when this option is enabled or not. That way we can build two, cache two
# artifacts, and have nice speedy rebuilds.
if tcx.sess.target.target.options.default_hidden_visibility {
llvm::LLVMRustSetVisibility(llfn, llvm::Visibility::Hidden);
}
- if tcx.sess.target.target.options.requires_uwtable {
- attributes::emit_uwtable(llfn, true);
- }
+ if tcx.sess.target.target.options.requires_uwtable {
+ attributes::emit_uwtable(llfn, true);
+ }
let callee = CString::new(kind.fn_name(method.name)).unwrap();
let callee = llvm::LLVMRustGetOrInsertFunction(llmod,
callee.as_ptr(),
ty);
+ llvm::LLVMRustSetVisibility(callee, llvm::Visibility::Hidden);
let llbb = llvm::LLVMAppendBasicBlockInContext(llcx,
llfn,
};
if config.verify_llvm_ir { assert!(addpass("verify")); }
+
+ // Some options cause LLVM bitcode to be emitted, which uses ThinLTOBuffers, so we need
+ // to make sure we run LLVM's NameAnonGlobals pass when emitting bitcode; otherwise
+ // we'll get errors in LLVM.
+ let using_thin_buffers = llvm::LLVMRustThinLTOAvailable() && (config.emit_bc
+ || config.obj_is_bitcode || config.emit_bc_compressed || config.embed_bitcode);
+ let mut have_name_anon_globals_pass = false;
if !config.no_prepopulate_passes {
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
let opt_level = config.opt_level.unwrap_or(llvm::CodeGenOptLevel::None);
let prepare_for_thin_lto = cgcx.lto == Lto::Thin || cgcx.lto == Lto::ThinLocal;
+ have_name_anon_globals_pass = have_name_anon_globals_pass || prepare_for_thin_lto;
+ if using_thin_buffers && !prepare_for_thin_lto {
+ assert!(addpass("name-anon-globals"));
+ have_name_anon_globals_pass = true;
+ }
with_llvm_pmb(llmod, &config, opt_level, prepare_for_thin_lto, &mut |b| {
llvm::LLVMPassManagerBuilderPopulateFunctionPassManager(b, fpm);
llvm::LLVMPassManagerBuilderPopulateModulePassManager(b, mpm);
diag_handler.warn(&format!("unknown pass `{}`, ignoring",
pass));
}
+ if pass == "name-anon-globals" {
+ have_name_anon_globals_pass = true;
+ }
}
for pass in &cgcx.plugin_passes {
`{}` but LLVM does not \
recognize it", pass));
}
+ if pass == "name-anon-globals" {
+ have_name_anon_globals_pass = true;
+ }
+ }
+
+ if using_thin_buffers && !have_name_anon_globals_pass {
+ // As described above, this will probably cause an error in LLVM
+ if config.no_prepopulate_passes {
+ diag_handler.err("The current compilation is going to use thin LTO buffers \
+ without running LLVM's NameAnonGlobals pass. \
+ This will likely cause errors in LLVM. Consider adding \
+ -C passes=name-anon-globals to the compiler command line.");
+ } else {
+ bug!("We are using thin LTO buffers without running the NameAnonGlobals pass. \
+ This will likely cause errors in LLVM and shoud never happen.");
+ }
}
}
rx,
codegen_units.len());
- // Codegen an allocator shim, if any
- let allocator_module = if let Some(kind) = *tcx.sess.allocator_kind.get() {
+ // Codegen an allocator shim, if necessary.
+ //
+ // If the crate doesn't have an `allocator_kind` set then there's definitely
+ // no shim to generate. Otherwise we also check our dependency graph for all
+ // our output crate types. If anything there looks like its a `Dynamic`
+ // linkage, then it's already got an allocator shim and we'll be using that
+ // one instead. If nothing exists then it's our job to generate the
+ // allocator!
+ let any_dynamic_crate = tcx.sess.dependency_formats.borrow()
+ .iter()
+ .any(|(_, list)| {
+ use rustc::middle::dependency_format::Linkage;
+ list.iter().any(|linkage| {
+ match linkage {
+ Linkage::Dynamic => true,
+ _ => false,
+ }
+ })
+ });
+ let allocator_module = if any_dynamic_crate {
+ None
+ } else if let Some(kind) = *tcx.sess.allocator_kind.get() {
unsafe {
let llmod_id = "allocator";
let modules = ModuleLlvm::new(tcx.sess, llmod_id);
cx: &CodegenCx<'ll, '_>,
cv: &'ll Value,
align: Align,
- kind: &str,
+ kind: Option<&str>,
) -> &'ll Value {
unsafe {
- let name = cx.generate_local_symbol_name(kind);
- let gv = declare::define_global(cx, &name[..], val_ty(cv)).unwrap_or_else(||{
- bug!("symbol `{}` is already defined", name);
- });
+ let gv = match kind {
+ Some(kind) if !cx.tcx.sess.fewer_names() => {
+ let name = cx.generate_local_symbol_name(kind);
+ let gv = declare::define_global(cx, &name[..], val_ty(cv)).unwrap_or_else(||{
+ bug!("symbol `{}` is already defined", name);
+ });
+ llvm::LLVMRustSetLinkage(gv, llvm::Linkage::PrivateLinkage);
+ gv
+ },
+ _ => declare::define_private_global(cx, val_ty(cv)),
+ };
llvm::LLVMSetInitializer(gv, cv);
set_global_alignment(cx, gv, align);
- llvm::LLVMRustSetLinkage(gv, llvm::Linkage::PrivateLinkage);
SetUnnamedAddr(gv, true);
gv
}
cx: &CodegenCx<'ll, '_>,
cv: &'ll Value,
align: Align,
- kind: &str,
+ kind: Option<&str>,
) -> &'ll Value {
if let Some(&gv) = cx.const_globals.borrow().get(&cv) {
unsafe {
use std::ffi::CString;
-
/// Declare a global value.
///
/// If there’s a value with the same name already declared, the function will
}
}
+/// Declare a private global
+///
+/// Use this function when you intend to define a global without a name.
+pub fn define_private_global(cx: &CodegenCx<'ll, '_>, ty: &'ll Type) -> &'ll Value {
+ unsafe {
+ llvm::LLVMRustInsertPrivateGlobal(cx.llmod, ty)
+ }
+}
+
/// Declare a Rust function with an intention to define it.
///
/// Use this function when you intend to define a function. This function will
#![feature(crate_visibility_modifier)]
#![feature(custom_attribute)]
#![feature(extern_types)]
-#![feature(fs_read_write)]
#![feature(in_band_lifetimes)]
#![allow(unused_attributes)]
#![feature(libc)]
pub fn LLVMAddGlobal(M: &'a Module, Ty: &'a Type, Name: *const c_char) -> &'a Value;
pub fn LLVMGetNamedGlobal(M: &Module, Name: *const c_char) -> Option<&Value>;
pub fn LLVMRustGetOrInsertGlobal(M: &'a Module, Name: *const c_char, T: &'a Type) -> &'a Value;
+ pub fn LLVMRustInsertPrivateGlobal(M: &'a Module, T: &'a Type) -> &'a Value;
pub fn LLVMGetFirstGlobal(M: &Module) -> Option<&Value>;
pub fn LLVMGetNextGlobal(GlobalVar: &Value) -> Option<&Value>;
pub fn LLVMDeleteGlobal(GlobalVar: &Value);
let vtable_const = C_struct(cx, &components, false);
let align = cx.data_layout().pointer_align;
- let vtable = consts::addr_of(cx, vtable_const, align, "vtable");
+ let vtable = consts::addr_of(cx, vtable_const, align, Some("vtable"));
debuginfo::create_vtable_metadata(cx, ty, vtable);
let file_line_col = consts::addr_of(bx.cx,
file_line_col,
align,
- "panic_bounds_check_loc");
+ Some("panic_bounds_check_loc"));
(lang_items::PanicBoundsCheckFnLangItem,
vec![file_line_col, index, len])
}
let msg_file_line_col = consts::addr_of(bx.cx,
msg_file_line_col,
align,
- "panic_loc");
+ Some("panic_loc"));
(lang_items::PanicFnLangItem,
vec![msg_file_line_col])
}
Some(AllocType::Memory(alloc)) => {
let init = const_alloc_to_llvm(cx, alloc);
if alloc.runtime_mutability == Mutability::Mutable {
- consts::addr_of_mut(cx, init, alloc.align, "byte_str")
+ consts::addr_of_mut(cx, init, alloc.align, None)
} else {
- consts::addr_of(cx, init, alloc.align, "byte_str")
+ consts::addr_of(cx, init, alloc.align, None)
}
}
Some(AllocType::Function(fn_instance)) => {
offset: Size,
) -> PlaceRef<'ll, 'tcx> {
let init = const_alloc_to_llvm(bx.cx, alloc);
- let base_addr = consts::addr_of(bx.cx, init, layout.align, "byte_str");
+ let base_addr = consts::addr_of(bx.cx, init, layout.align, None);
let llval = unsafe { LLVMConstInBoundsGEP(
consts::bitcast(base_addr, Type::i8p(bx.cx)),
html_favicon_url = "https://www.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]
-#![feature(collections_range)]
#![feature(unboxed_closures)]
#![feature(fn_traits)]
#![feature(unsize)]
}
// if we elided some lines, add an ellipsis
- if let Some(_) = lines.next() {
+ if lines.next().is_some() {
buffer.puts(row_num, max_line_num_len - 1, "...", Style::LineNumber);
} else if !show_underline {
draw_col_separator_no_space(&mut buffer, row_num, max_line_num_len + 1);
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]
-#![feature(fs_read_write)]
#![feature(specialization)]
#![recursion_limit="256"]
// We use a HIR visitor to walk the type.
use rustc::hir::intravisit::{self, Visitor};
- use syntax::ast::NodeId;
struct WalkAssocTypes<'a, 'db> where 'db: 'a {
err: &'a mut DiagnosticBuilder<'db>
}
intravisit::NestedVisitorMap::None
}
- fn visit_qpath(&mut self, qpath: &'v hir::QPath, id: NodeId, span: Span) {
+ fn visit_qpath(&mut self, qpath: &'v hir::QPath, id: hir::HirId, span: Span) {
if TypeAliasBounds::is_type_variable_assoc(qpath) {
self.err.span_help(span,
"use fully disambiguated paths (i.e., `<T as Trait>::Assoc`) to refer to \
store.register_renamed("bare_trait_object", "bare_trait_objects");
store.register_renamed("unstable_name_collision", "unstable_name_collisions");
store.register_renamed("unused_doc_comment", "unused_doc_comments");
- store.register_renamed("unknown_features", "unused_features");
+ store.register_removed("unknown_features", "replaced by an error");
store.register_removed("unsigned_negation", "replaced by negate_unsigned feature gate");
store.register_removed("negate_unsigned", "cast a signed value instead");
store.register_removed("raw_pointer_derive", "using derive with raw pointers is ok");
}
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImproperCTypes {
- fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
+ fn check_foreign_item(&mut self, cx: &LateContext, it: &hir::ForeignItem) {
let mut vis = ImproperCTypesVisitor { cx: cx };
- if let hir::ItemKind::ForeignMod(ref nmod) = it.node {
- if nmod.abi != Abi::RustIntrinsic && nmod.abi != Abi::PlatformIntrinsic {
- for ni in &nmod.items {
- match ni.node {
- hir::ForeignItemKind::Fn(ref decl, _, _) => {
- vis.check_foreign_fn(ni.id, decl);
- }
- hir::ForeignItemKind::Static(ref ty, _) => {
- vis.check_foreign_static(ni.id, ty.span);
- }
- hir::ForeignItemKind::Type => ()
- }
+ let abi = cx.tcx.hir.get_foreign_abi(it.id);
+ if abi != Abi::RustIntrinsic && abi != Abi::PlatformIntrinsic {
+ match it.node {
+ hir::ForeignItemKind::Fn(ref decl, _, _) => {
+ vis.check_foreign_fn(it.id, decl);
+ }
+ hir::ForeignItemKind::Static(ref ty, _) => {
+ vis.check_foreign_static(it.id, ty.span);
}
+ hir::ForeignItemKind::Type => ()
}
}
}
cdata.each_child_of_item(def_id.index, |child| result.push(child), tcx.sess);
Lrc::new(result)
}
+ defined_lib_features => { Lrc::new(cdata.get_lib_features()) }
defined_lang_items => { Lrc::new(cdata.get_lang_items()) }
missing_lang_items => { Lrc::new(cdata.get_missing_lang_items()) }
EntryKind::Trait(_) => Def::Trait(did),
EntryKind::Enum(..) => Def::Enum(did),
EntryKind::MacroDef(_) => Def::Macro(did, MacroKind::Bang),
- EntryKind::GlobalAsm => Def::GlobalAsm(did),
EntryKind::ForeignType => Def::TyForeign(did),
EntryKind::ForeignMod |
+ EntryKind::GlobalAsm |
EntryKind::Impl(_) |
EntryKind::Field |
EntryKind::Generator(_) |
self.get_impl_data(id).trait_ref.map(|tr| tr.decode((self, tcx)))
}
+ /// Iterates over all the stability attributes in the given crate.
+ pub fn get_lib_features(&self) -> Vec<(ast::Name, Option<ast::Name>)> {
+ self.root
+ .lib_features
+ .decode(self)
+ .collect()
+ }
+
/// Iterates over the language items in the given crate.
pub fn get_lang_items(&self) -> Vec<(DefId, usize)> {
self.root
());
let dep_bytes = self.position() - i;
+ // Encode the lib features.
+ i = self.position();
+ let lib_features = self.tracked(IsolatedEncoder::encode_lib_features, ());
+ let lib_feature_bytes = self.position() - i;
+
// Encode the language items.
i = self.position();
let lang_items = self.tracked(IsolatedEncoder::encode_lang_items, ());
crate_deps,
dylib_dependency_formats,
+ lib_features,
lang_items,
lang_items_missing,
native_libraries,
println!("metadata stats:");
println!(" dep bytes: {}", dep_bytes);
+ println!(" lib feature bytes: {}", lib_feature_bytes);
println!(" lang item bytes: {}", lang_item_bytes);
println!(" native bytes: {}", native_lib_bytes);
println!(" codemap bytes: {}", codemap_bytes);
self.lazy_seq_ref(deps.iter().map(|&(_, ref dep)| dep))
}
+ fn encode_lib_features(&mut self, _: ()) -> LazySeq<(ast::Name, Option<ast::Name>)> {
+ let tcx = self.tcx;
+ let lib_features = tcx.lib_features();
+ self.lazy_seq(lib_features.to_vec())
+ }
+
fn encode_lang_items(&mut self, _: ()) -> LazySeq<(DefIndex, usize)> {
let tcx = self.tcx;
let lang_items = tcx.lang_items();
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(box_patterns)]
-#![feature(fs_read_write)]
#![feature(libc)]
#![feature(macro_at_most_once_rep)]
#![feature(proc_macro_internals)]
pub crate_deps: LazySeq<CrateDep>,
pub dylib_dependency_formats: LazySeq<Option<LinkagePreference>>,
+ pub lib_features: LazySeq<(Symbol, Option<Symbol>)>,
pub lang_items: LazySeq<(DefIndex, usize)>,
pub lang_items_missing: LazySeq<lang_items::LangItem>,
pub native_libraries: LazySeq<NativeLibrary>,
let tables = self.tcx.typeck_tables_of(id);
let node_id = self.tcx.hir.as_local_node_id(id).unwrap();
let hir_id = self.tcx.hir.node_to_hir_id(node_id);
- if let Some(_) = tables.closure_kind_origins().get(hir_id) {
+ if tables.closure_kind_origins().get(hir_id).is_some() {
false
} else {
true
&including_downcast,
)?;
buf.push_str("[");
- if let Err(_) = self.append_local_to_string(index, buf) {
+ if self.append_local_to_string(index, buf).is_err() {
buf.push_str("..");
}
buf.push_str("]");
+++ /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.
-
-//! Identify those variables whose entire value will eventually be
-//! returned from the fn via the RETURN_PLACE. As an optimization, we
-//! can skip computing liveness results for those variables. The idea
-//! is that the return type of the fn only ever contains free
-//! regions. Therefore, the types of those variables are going to
-//! ultimately be contrained to outlive those free regions -- since
-//! free regions are always live for the entire body, this implies
-//! that the liveness results are not important for those regions.
-//! This is most important in the "fns" that we create to represent static
-//! values, since those are often really quite large, and all regions in them
-//! will ultimately be constrained to be `'static`. Two examples:
-//!
-//! ```
-//! fn foo() -> &'static [u32] { &[] }
-//! static FOO: &[u32] = &[];
-//! ```
-//!
-//! In both these cases, the return value will only have static lifetime.
-//!
-//! NB: The simple logic here relies on the fact that outlives
-//! relations in our analysis don't have locations. Otherwise, we
-//! would have to restrict ourselves to values that are
-//! *unconditionally* returned (which would still cover the "big
-//! static value" case).
-//!
-//! The way that this code works is to use union-find -- we iterate
-//! over the MIR and union together two variables X and Y if all
-//! regions in the value of Y are going to be stored into X -- that
-//! is, if `typeof(X): 'a` requires that `typeof(Y): 'a`. This means
-//! that e.g. we can union together `x` and `y` if we have something
-//! like `x = (y, 22)`, but not something like `x = y.f` (since there
-//! may be regions in the type of `y` that do not appear in the field
-//! `f`).
-
-use rustc::mir::visit::Visitor;
-use rustc::mir::*;
-
-use rustc_data_structures::indexed_vec::Idx;
-use rustc_data_structures::unify as ut;
-
-crate struct EscapingLocals {
- unification_table: ut::UnificationTable<ut::InPlace<AssignedLocal>>,
-}
-
-impl EscapingLocals {
- crate fn compute(mir: &Mir<'tcx>) -> Self {
- let mut visitor = GatherAssignedLocalsVisitor::new();
- visitor.visit_mir(mir);
-
- EscapingLocals {
- unification_table: visitor.unification_table,
- }
- }
-
- /// True if `local` is known to escape into static
- /// memory.
- crate fn escapes_into_return(&mut self, local: Local) -> bool {
- let return_place = AssignedLocal::from(RETURN_PLACE);
- let other_place = AssignedLocal::from(local);
- self.unification_table.unioned(return_place, other_place)
- }
-}
-
-/// The MIR visitor gathering the union-find of the locals used in
-/// assignments.
-struct GatherAssignedLocalsVisitor {
- unification_table: ut::UnificationTable<ut::InPlace<AssignedLocal>>,
-}
-
-#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
-struct AssignedLocal(u32);
-
-impl ut::UnifyKey for AssignedLocal {
- type Value = ();
-
- fn index(&self) -> u32 {
- self.0
- }
-
- fn from_index(i: u32) -> AssignedLocal {
- AssignedLocal(i)
- }
-
- fn tag() -> &'static str {
- "AssignedLocal"
- }
-}
-
-impl From<Local> for AssignedLocal {
- fn from(item: Local) -> Self {
- // newtype_indexes use usize but are u32s.
- assert!(item.index() < ::std::u32::MAX as usize);
- AssignedLocal(item.index() as u32)
- }
-}
-
-impl GatherAssignedLocalsVisitor {
- fn new() -> Self {
- Self {
- unification_table: ut::UnificationTable::new(),
- }
- }
-
- fn union_locals_if_needed(&mut self, lvalue: Option<Local>, rvalue: Option<Local>) {
- if let Some(lvalue) = lvalue {
- if let Some(rvalue) = rvalue {
- if lvalue != rvalue {
- debug!("EscapingLocals: union {:?} and {:?}", lvalue, rvalue);
- self.unification_table
- .union(AssignedLocal::from(lvalue), AssignedLocal::from(rvalue));
- }
- }
- }
- }
-}
-
-// Returns the potential `Local` associated to this `Place` or `PlaceProjection`
-fn find_local_in_place(place: &Place) -> Option<Local> {
- match place {
- Place::Local(local) => Some(*local),
-
- // If you do e.g. `x = a.f` then only *part* of the type of
- // `a` escapes into `x` (the part contained in `f`); if `a`'s
- // type has regions that don't appear in `f`, those might not
- // escape.
- Place::Projection(..) => None,
-
- Place::Static { .. } | Place::Promoted { .. } => None,
- }
-}
-
-// Returns the potential `Local` in this `Operand`.
-fn find_local_in_operand(op: &Operand) -> Option<Local> {
- // Conservatively check a subset of `Operand`s we know our
- // benchmarks track, for example `html5ever`.
- match op {
- Operand::Copy(place) | Operand::Move(place) => find_local_in_place(place),
- Operand::Constant(_) => None,
- }
-}
-
-impl Visitor<'tcx> for GatherAssignedLocalsVisitor {
- fn visit_mir(&mut self, mir: &Mir<'tcx>) {
- // We need as many union-find keys as there are locals
- for _ in 0..mir.local_decls.len() {
- self.unification_table.new_key(());
- }
-
- self.super_mir(mir);
- }
-
- fn visit_assign(
- &mut self,
- block: BasicBlock,
- place: &Place<'tcx>,
- rvalue: &Rvalue<'tcx>,
- location: Location,
- ) {
- let local = find_local_in_place(place);
-
- // Find those cases where there is a `Place` consumed by
- // `rvalue` and we know that all regions in its type will be
- // incorporated into `place`, the `Place` we are assigning to.
- match rvalue {
- // `x = y` is the simplest possible case.
- Rvalue::Use(op) => self.union_locals_if_needed(local, find_local_in_operand(op)),
-
- // `X = &'r P` -- the type of `X` will be `&'r T_P`, where
- // `T_P` is the type of `P`.
- Rvalue::Ref(_, _, place) => {
- // Special case: if you have `X = &*Y` (or `X = &**Y`
- // etc), then the outlives relationships will ensure
- // that all regions in `Y` are constrained by regions
- // in `X` -- this is because the lifetimes of the
- // references we deref through are required to outlive
- // the borrow lifetime `'r` (which appears in `X`).
- //
- // (We don't actually need to check the type of `Y`:
- // since `ProjectionElem::Deref` represents a built-in
- // deref and not an overloaded deref, if the thing we
- // deref through is not a reference, then it must be a
- // `Box` or `*const`, in which case it contains no
- // references.)
- let mut place_ref = place;
- while let Place::Projection(proj) = place_ref {
- if let ProjectionElem::Deref = proj.elem {
- place_ref = &proj.base;
- } else {
- break;
- }
- }
-
- self.union_locals_if_needed(local, find_local_in_place(place_ref))
- }
-
- Rvalue::Cast(kind, op, _) => match kind {
- CastKind::Unsize => {
- // Casting a `&[T; N]` to `&[T]` or `&Foo` to `&Trait` --
- // in both cases, no regions are "lost".
- self.union_locals_if_needed(local, find_local_in_operand(op))
- }
- _ => (),
- },
-
- // Constructing an aggregate like `(x,)` or `Foo { x }`
- // includes the full type of `x`.
- Rvalue::Aggregate(_, ops) => {
- for rvalue in ops.iter().map(find_local_in_operand) {
- self.union_locals_if_needed(local, rvalue);
- }
- }
-
- // For other things, be conservative and do not union.
- _ => (),
- };
-
- self.super_assign(block, place, rvalue, location);
- }
-}
//! liveness code so that it only operates over variables with regions in their
//! types, instead of all variables.
-use borrow_check::nll::escaping_locals::EscapingLocals;
-use rustc::mir::{Local, Mir};
use rustc::ty::TypeFoldable;
use rustc_data_structures::indexed_vec::IndexVec;
+use rustc::mir::{Mir, Local};
use util::liveness::LiveVariableMap;
use rustc_data_structures::indexed_vec::Idx;
crate struct NllLivenessMap {
/// For each local variable, contains either None (if the type has no regions)
/// or Some(i) with a suitable index.
- from_local: IndexVec<Local, Option<LocalWithRegion>>,
-
+ pub from_local: IndexVec<Local, Option<LocalWithRegion>>,
/// For each LocalWithRegion, maps back to the original Local index.
- to_local: IndexVec<LocalWithRegion, Local>,
+ pub to_local: IndexVec<LocalWithRegion, Local>,
+
}
impl LiveVariableMap for NllLivenessMap {
+
fn from_local(&self, local: Local) -> Option<Self::LiveVar> {
self.from_local[local]
}
impl NllLivenessMap {
/// Iterates over the variables in Mir and assigns each Local whose type contains
/// regions a LocalWithRegion index. Returns a map for converting back and forth.
- crate fn compute(mir: &Mir<'tcx>) -> Self {
- let mut escaping_locals = EscapingLocals::compute(mir);
-
+ pub fn compute(mir: &Mir) -> Self {
let mut to_local = IndexVec::default();
- let mut escapes_into_return = 0;
- let mut no_regions = 0;
- let from_local: IndexVec<Local, Option<_>> = mir
+ let from_local: IndexVec<Local,Option<_>> = mir
.local_decls
.iter_enumerated()
.map(|(local, local_decl)| {
- if escaping_locals.escapes_into_return(local) {
- // If the local escapes into the return value,
- // then the return value will force all of the
- // regions in its type to outlive free regions
- // (e.g., `'static`) and hence liveness is not
- // needed. This is particularly important for big
- // statics.
- escapes_into_return += 1;
- None
- } else if local_decl.ty.has_free_regions() {
- let l = to_local.push(local);
- debug!("liveness_map: {:?} = {:?}", local, l);
- Some(l)
- } else {
- no_regions += 1;
- None
+ if local_decl.ty.has_free_regions() {
+ Some(to_local.push(local))
}
+ else {
+ None
+ }
}).collect();
- debug!("liveness_map: {} variables need liveness", to_local.len());
- debug!("liveness_map: {} escapes into return", escapes_into_return);
- debug!("liveness_map: {} no regions", no_regions);
-
- Self {
- from_local,
- to_local,
- }
+ Self { from_local, to_local }
}
}
use util as mir_util;
use util::pretty::{self, ALIGN};
-mod constraints;
mod constraint_generation;
-mod escaping_locals;
pub mod explain_borrow;
mod facts;
mod invalidation;
mod universal_regions;
crate mod liveness_map;
+mod constraints;
+
use self::facts::AllFacts;
use self::region_infer::RegionInferenceContext;
use self::universal_regions::UniversalRegions;
location_table,
borrow_set,
&liveness,
- &liveness_map,
&mut all_facts,
flow_inits,
move_data,
dump_mir_results(
infcx,
&liveness,
- &liveness_map,
MirSource::item(def_id),
&mir,
®ioncx,
fn dump_mir_results<'a, 'gcx, 'tcx>(
infcx: &InferCtxt<'a, 'gcx, 'tcx>,
liveness: &LivenessResults<LocalWithRegion>,
- liveness_map: &NllLivenessMap,
source: MirSource,
mir: &Mir<'tcx>,
regioncx: &RegionInferenceContext,
return;
}
+ let map = &NllLivenessMap::compute(mir);
+
let regular_liveness_per_location: FxHashMap<_, _> = mir
.basic_blocks()
.indices()
let mut results = vec![];
liveness
.regular
- .simulate_block(&mir, bb, liveness_map, |location, local_set| {
+ .simulate_block(&mir, bb, map, |location, local_set| {
results.push((location, local_set.clone()));
});
results
let mut results = vec![];
liveness
.drop
- .simulate_block(&mir, bb, liveness_map, |location, local_set| {
+ .simulate_block(&mir, bb, map, |location, local_set| {
results.push((location, local_set.clone()));
});
results
if let (Some(f), Some(o)) = (self.to_error_region(fr), self.to_error_region(outlived_fr)) {
let tables = infcx.tcx.typeck_tables_of(mir_def_id);
let nice = NiceRegionError::new_from_span(infcx.tcx, span, o, f, Some(tables));
- if let Some(_error_reported) = nice.try_report() {
+ if let Some(_error_reported) = nice.try_report_from_nll() {
return;
}
}
use borrow_check::nll::region_infer::RegionInferenceContext;
use borrow_check::nll::ToRegionVid;
+use borrow_check::nll::universal_regions::DefiningTy;
use rustc::hir;
use rustc::hir::def_id::DefId;
use rustc::infer::InferCtxt;
})
.or_else(|| {
self.give_name_if_anonymous_region_appears_in_output(
- infcx.tcx, mir, fr, counter, diag)
+ infcx, mir, mir_def_id, fr, counter, diag)
})
.unwrap_or_else(|| span_bug!(mir.span, "can't make a name for free region {:?}", fr))
}
},
ty::BoundRegion::BrEnv => {
- let closure_span = tcx.hir.span_if_local(mir_def_id).unwrap();
- let region_name = self.synthesize_region_name(counter);
- diag.span_label(
- closure_span,
- format!("lifetime `{}` represents the closure body", region_name),
- );
- Some(region_name)
+ let mir_node_id = tcx.hir.as_local_node_id(mir_def_id).expect("non-local mir");
+ let def_ty = self.universal_regions.defining_ty;
+
+ if let DefiningTy::Closure(def_id, substs) = def_ty {
+ let args_span = if let hir::ExprKind::Closure(_, _, _, span, _)
+ = tcx.hir.expect_expr(mir_node_id).node
+ {
+ span
+ } else {
+ bug!("Closure is not defined by a closure expr");
+ };
+ let region_name = self.synthesize_region_name(counter);
+ diag.span_label(
+ args_span,
+ format!("lifetime `{}` represents this closure's body", region_name),
+ );
+
+ let closure_kind_ty = substs.closure_kind_ty(def_id, tcx);
+ let note = match closure_kind_ty.to_opt_closure_kind() {
+ Some(ty::ClosureKind::Fn) => {
+ "closure implements `Fn`, so references to captured variables \
+ can't escape the closure"
+ }
+ Some(ty::ClosureKind::FnMut) => {
+ "closure implements `FnMut`, so references to captured variables \
+ can't escape the closure"
+ }
+ Some(ty::ClosureKind::FnOnce) => {
+ bug!("BrEnv in a `FnOnce` closure");
+ }
+ None => bug!("Closure kind not inferred in borrow check"),
+ };
+
+ diag.note(note);
+
+ Some(region_name)
+ } else {
+ // Can't have BrEnv in functions, constants or generators.
+ bug!("BrEnv outside of closure.");
+ }
}
ty::BoundRegion::BrAnon(_) | ty::BoundRegion::BrFresh(_) => None,
/// or be early bound (named, not in argument).
fn give_name_if_anonymous_region_appears_in_output(
&self,
- tcx: TyCtxt<'_, '_, 'tcx>,
+ infcx: &InferCtxt<'_, '_, 'tcx>,
mir: &Mir<'tcx>,
+ mir_def_id: DefId,
fr: RegionVid,
counter: &mut usize,
diag: &mut DiagnosticBuilder<'_>,
) -> Option<InternedString> {
+ let tcx = infcx.tcx;
+
let return_ty = self.universal_regions.unnormalized_output_ty;
debug!(
"give_name_if_anonymous_region_appears_in_output: return_ty = {:?}",
return_ty
);
- if !tcx.any_free_region_meets(&return_ty, |r| r.to_region_vid() == fr) {
+ if !infcx.tcx.any_free_region_meets(&return_ty, |r| r.to_region_vid() == fr) {
return None;
}
- let region_name = self.synthesize_region_name(counter);
+ let type_name = with_highlight_region(fr, *counter, || {
+ infcx.extract_type_name(&return_ty)
+ });
+
+ let mir_node_id = tcx.hir.as_local_node_id(mir_def_id).expect("non-local mir");
+
+ let (return_span, mir_description) = if let hir::ExprKind::Closure(_, _, _, span, gen_move)
+ = tcx.hir.expect_expr(mir_node_id).node
+ {
+ (
+ tcx.sess.codemap().end_point(span),
+ if gen_move.is_some() { " of generator" } else { " of closure" }
+ )
+ } else {
+ // unreachable?
+ (mir.span, "")
+ };
+
diag.span_label(
- mir.span,
- format!("lifetime `{}` appears in return type", region_name),
+ return_span,
+ format!("return type{} is {}", mir_description, type_name),
);
- Some(region_name)
+ // This counter value will already have been used, so this function will increment it
+ // so the next value will be used next and return the region name that would have been
+ // used.
+ Some(self.synthesize_region_name(counter))
}
/// Create a synthetic region named `'1`, incrementing the
}
}
+ /// Invoked when we have some type-test (e.g., `T: 'X`) that we cannot
+ /// prove to be satisfied. If this is a closure, we will attempt to
+ /// "promote" this type-test into our `ClosureRegionRequirements` and
+ /// hence pass it up the creator. To do this, we have to phrase the
+ /// type-test in terms of external free regions, as local free
+ /// regions are not nameable by the closure's creator.
+ ///
+ /// Promotion works as follows: we first check that the type `T`
+ /// contains only regions that the creator knows about. If this is
+ /// true, then -- as a consequence -- we know that all regions in
+ /// the type `T` are free regions that outlive the closure body. If
+ /// false, then promotion fails.
+ ///
+ /// Once we've promoted T, we have to "promote" `'X` to some region
+ /// that is "external" to the closure. Generally speaking, a region
+ /// may be the union of some points in the closure body as well as
+ /// various free lifetimes. We can ignore the points in the closure
+ /// body: if the type T can be expressed in terms of external regions,
+ /// we know it outlives the points in the closure body. That
+ /// just leaves the free regions.
+ ///
+ /// The idea then is to lower the `T: 'X` constraint into multiple
+ /// bounds -- e.g., if `'X` is the union of two free lifetimes,
+ /// `'1` and `'2`, then we would create `T: '1` and `T: '2`.
fn try_promote_type_test<'gcx>(
&self,
infcx: &InferCtxt<'_, 'gcx, 'tcx>,
test: _,
} = type_test;
+
let generic_ty = generic_kind.to_ty(tcx);
let subject = match self.try_promote_type_test_subject(infcx, generic_ty) {
Some(s) => s,
None => return false,
};
- // Find some bounding subject-region R+ that is a super-region
- // of the existing subject-region R. This should be a non-local, universal
- // region, which ensures it can be encoded in a `ClosureOutlivesRequirement`.
- let lower_bound_plus = self.non_local_universal_upper_bound(*lower_bound);
- assert!(self.universal_regions.is_universal_region(lower_bound_plus));
- assert!(
- !self
+ // For each region outlived by lower_bound find a non-local,
+ // universal region (it may be the same region) and add it to
+ // `ClosureOutlivesRequirement`.
+ let r_scc = self.constraint_sccs.scc(*lower_bound);
+ for ur in self.scc_values.universal_regions_outlived_by(r_scc) {
+ let non_local_ub = self.universal_region_relations.non_local_upper_bound(ur);
+
+ assert!(self.universal_regions.is_universal_region(non_local_ub));
+ assert!(
+ !self
.universal_regions
- .is_local_free_region(lower_bound_plus)
- );
+ .is_local_free_region(non_local_ub)
+ );
- propagated_outlives_requirements.push(ClosureOutlivesRequirement {
- subject,
- outlived_free_region: lower_bound_plus,
- blame_span: locations.span(mir),
- });
+ propagated_outlives_requirements.push(ClosureOutlivesRequirement {
+ subject,
+ outlived_free_region: non_local_ub,
+ blame_span: locations.span(mir),
+ });
+ }
true
}
cx: &mut TypeChecker<'_, 'gcx, 'tcx>,
mir: &Mir<'tcx>,
liveness: &LivenessResults<LocalWithRegion>,
- liveness_map: &NllLivenessMap,
flow_inits: &mut FlowAtLocation<MaybeInitializedPlaces<'_, 'gcx, 'tcx>>,
move_data: &MoveData<'tcx>,
) {
cx,
mir,
liveness,
- liveness_map,
flow_inits,
move_data,
drop_data: FxHashMap(),
+ map: &NllLivenessMap::compute(mir),
};
for bb in mir.basic_blocks().indices() {
cx: &'gen mut TypeChecker<'typeck, 'gcx, 'tcx>,
mir: &'gen Mir<'tcx>,
liveness: &'gen LivenessResults<LocalWithRegion>,
- liveness_map: &'gen NllLivenessMap,
flow_inits: &'gen mut FlowAtLocation<MaybeInitializedPlaces<'flow, 'gcx, 'tcx>>,
move_data: &'gen MoveData<'tcx>,
drop_data: FxHashMap<Ty<'tcx>, DropData<'tcx>>,
+ map: &'gen NllLivenessMap,
}
struct DropData<'tcx> {
self.liveness
.regular
- .simulate_block(self.mir, bb, self.liveness_map, |location, live_locals| {
+ .simulate_block(self.mir, bb, self.map, |location, live_locals| {
for live_local in live_locals.iter() {
- let local = self.liveness_map.from_live_var(live_local);
+ let local = self.map.from_live_var(live_local);
let live_local_ty = self.mir.local_decls[local].ty;
Self::push_type_live_constraint(&mut self.cx, live_local_ty, location);
}
let mut all_live_locals: Vec<(Location, Vec<LocalWithRegion>)> = vec![];
self.liveness
.drop
- .simulate_block(self.mir, bb, self.liveness_map, |location, live_locals| {
+ .simulate_block(self.mir, bb, self.map, |location, live_locals| {
all_live_locals.push((location, live_locals.iter().collect()));
});
debug!(
});
}
- let local = self.liveness_map.from_live_var(live_local);
+ let local = self.map.from_live_var(live_local);
let mpi = self.move_data.rev_lookup.find_local(local);
if let Some(initialized_child) = self.flow_inits.has_any_child_of(mpi) {
debug!(
self.move_data.move_paths[initialized_child]
);
- let local = self.liveness_map.from_live_var(live_local);
+ let local = self.map.from_live_var(live_local);
let live_local_ty = self.mir.local_decls[local].ty;
self.add_drop_live_constraint(live_local, live_local_ty, location);
}
use borrow_check::location::LocationTable;
use borrow_check::nll::constraints::{ConstraintSet, OutlivesConstraint};
use borrow_check::nll::facts::AllFacts;
-use borrow_check::nll::liveness_map::NllLivenessMap;
-use borrow_check::nll::region_infer::values::{LivenessValues, RegionValueElements};
+use borrow_check::nll::region_infer::values::{RegionValueElements, LivenessValues};
use borrow_check::nll::region_infer::{ClosureRegionRequirementsExt, TypeTest};
-use borrow_check::nll::type_check::free_region_relations::{
- CreateResult, UniversalRegionRelations,
-};
+use borrow_check::nll::type_check::free_region_relations::{CreateResult, UniversalRegionRelations};
use borrow_check::nll::universal_regions::UniversalRegions;
use borrow_check::nll::LocalWithRegion;
use borrow_check::nll::ToRegionVid;
location_table: &LocationTable,
borrow_set: &BorrowSet<'tcx>,
liveness: &LivenessResults<LocalWithRegion>,
- liveness_map: &NllLivenessMap,
all_facts: &mut Option<AllFacts>,
flow_inits: &mut FlowAtLocation<MaybeInitializedPlaces<'_, 'gcx, 'tcx>>,
move_data: &MoveData<'tcx>,
Some(&mut borrowck_context),
Some(errors_buffer),
|cx| {
- liveness::generate(cx, mir, liveness, liveness_map, flow_inits, move_data);
+ liveness::generate(cx, mir, liveness, flow_inits, move_data);
cx.equate_inputs_and_outputs(
mir,
mir_def_id,
`UnsafeCell`.
"##,
-E0018: r##"
-
-The value of static and constant integers must be known at compile time. You
-can't cast a pointer to an integer because the address of a pointer can
-vary.
-
-For example, if you write:
-
-```compile_fail,E0018
-static MY_STATIC: u32 = 42;
-static MY_STATIC_ADDR: usize = &MY_STATIC as *const _ as usize;
-static WHAT: usize = (MY_STATIC_ADDR^17) + MY_STATIC_ADDR;
-```
-
-Then `MY_STATIC_ADDR` would contain the address of `MY_STATIC`. However,
-the address can change when the program is linked, as well as change
-between different executions due to ASLR, and many linkers would
-not be able to calculate the value of `WHAT`.
-
-On the other hand, static and constant pointers can point either to
-a known numeric address or to the address of a symbol.
-
-```
-static MY_STATIC: u32 = 42;
-static MY_STATIC_ADDR: &'static u32 = &MY_STATIC;
-const CONST_ADDR: *const u8 = 0x5f3759df as *const u8;
-```
-
-This does not pose a problem by itself because they can't be
-accessed directly.
-"##,
-
E0019: r##"
A function call isn't allowed in the const's initialization expression
because the expression's value must be known at compile-time. Erroneous code
```
"##,
-E0395: r##"
-The value assigned to a constant scalar must be known at compile time,
-which is not the case when comparing raw pointers.
-
-Erroneous code example:
-
-```compile_fail,E0395
-static FOO: i32 = 42;
-static BAR: i32 = 42;
-
-static BAZ: bool = { (&FOO as *const i32) == (&BAR as *const i32) };
-// error: raw pointers cannot be compared in statics!
-```
-
-The address assigned by the linker to `FOO` and `BAR` may or may not
-be identical, so the value of `BAZ` can't be determined.
-
-If you want to do the comparison, please do it at run-time.
-
-For example:
-
-```
-static FOO: i32 = 42;
-static BAR: i32 = 42;
-
-let baz: bool = { (&FOO as *const i32) == (&BAR as *const i32) };
-// baz isn't a constant expression so it's ok
-```
-"##,
-
E0161: r##"
A value was moved. However, its size was not known at compile time, and only
values of a known size can be moved.
```
"##,
-E0396: r##"
-The value behind a raw pointer can't be determined at compile-time
-(or even link-time), which means it can't be used in a constant
-expression. Erroneous code example:
-
-```compile_fail,E0396
-const REG_ADDR: *const u8 = 0x5f3759df as *const u8;
-
-const VALUE: u8 = unsafe { *REG_ADDR };
-// error: raw pointers cannot be dereferenced in constants
-```
-
-A possible fix is to dereference your pointer at some point in run-time.
-
-For example:
-
-```
-const REG_ADDR: *const u8 = 0x5f3759df as *const u8;
-
-let reg_value = unsafe { *REG_ADDR };
-```
-"##,
-
E0492: r##"
A borrow of a constant containing interior mutability was attempted. Erroneous
code example:
```
This is because cell types do operations that are not thread-safe. Due to this,
-they don't implement Sync and thus can't be placed in statics. In this
-case, `StaticMutex` would work just fine, but it isn't stable yet:
-https://doc.rust-lang.org/nightly/std/sync/struct.StaticMutex.html
+they don't implement Sync and thus can't be placed in statics.
However, if you still wish to use these types, you can achieve this by an unsafe
wrapper:
#![feature(in_band_lifetimes)]
#![feature(slice_patterns)]
#![feature(slice_sort_by_cached_key)]
-#![feature(from_ref)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(catch_expr)]
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(decl_macro)]
-#![feature(fs_read_write)]
-#![feature(in_band_lifetimes)]
#![feature(macro_vis_matcher)]
#![feature(exhaustive_patterns)]
#![feature(range_contains)]
#![feature(rustc_diagnostic_macros)]
-#![feature(crate_visibility_modifier)]
#![feature(never_type)]
#![feature(specialization)]
#![feature(try_trait)]
use monomorphize::collector::InliningMap;
use rustc::dep_graph::WorkProductId;
+use rustc::hir::CodegenFnAttrFlags;
use rustc::hir::def_id::DefId;
use rustc::hir::map::DefPathData;
use rustc::mir::mono::{Linkage, Visibility};
None => fallback_cgu_name(tcx),
};
- let make_codegen_unit = || {
- CodegenUnit::new(codegen_unit_name.clone())
- };
-
let codegen_unit = codegen_units.entry(codegen_unit_name.clone())
- .or_insert_with(make_codegen_unit);
+ .or_insert_with(|| CodegenUnit::new(codegen_unit_name.clone()));
let mut can_be_internalized = true;
- let default_visibility = |id: DefId, is_generic: bool| {
- if !tcx.sess.target.target.options.default_hidden_visibility {
- return Visibility::Default
- }
-
- // Generic functions never have export level C
- if is_generic {
- return Visibility::Hidden
- }
-
- // Things with export level C don't get instantiated in downstream
- // crates
- if !id.is_local() {
- return Visibility::Hidden
- }
-
- if let Some(&SymbolExportLevel::C) = tcx.reachable_non_generics(id.krate)
- .get(&id) {
- Visibility::Default
- } else {
- Visibility::Hidden
- }
- };
- let (linkage, visibility) = match mono_item.explicit_linkage(tcx) {
- Some(explicit_linkage) => (explicit_linkage, Visibility::Default),
- None => {
- match mono_item {
- MonoItem::Fn(ref instance) => {
- let visibility = match instance.def {
- InstanceDef::Item(def_id) => {
- let is_generic = instance.substs
- .types()
- .next()
- .is_some();
-
- // The `start_fn` lang item is actually a
- // monomorphized instance of a function in the
- // standard library, used for the `main`
- // function. We don't want to export it so we
- // tag it with `Hidden` visibility but this
- // symbol is only referenced from the actual
- // `main` symbol which we unfortunately don't
- // know anything about during
- // partitioning/collection. As a result we
- // forcibly keep this symbol out of the
- // `internalization_candidates` set.
- //
- // FIXME: eventually we don't want to always
- // force this symbol to have hidden
- // visibility, it should indeed be a candidate
- // for internalization, but we have to
- // understand that it's referenced from the
- // `main` symbol we'll generate later.
- if tcx.lang_items().start_fn() == Some(def_id) {
- can_be_internalized = false;
- Visibility::Hidden
- } else if def_id.is_local() {
- if is_generic {
- if export_generics {
- if tcx.is_unreachable_local_definition(def_id) {
- // This instance cannot be used
- // from another crate.
- Visibility::Hidden
- } else {
- // This instance might be useful in
- // a downstream crate.
- can_be_internalized = false;
- default_visibility(def_id, true)
- }
- } else {
- // We are not exporting generics or
- // the definition is not reachable
- // for downstream crates, we can
- // internalize its instantiations.
- Visibility::Hidden
- }
- } else {
- // This isn't a generic function.
- if tcx.is_reachable_non_generic(def_id) {
- can_be_internalized = false;
- debug_assert!(!is_generic);
- default_visibility(def_id, false)
- } else {
- Visibility::Hidden
- }
- }
- } else {
- // This is an upstream DefId.
- if export_generics && is_generic {
- // If it is a upstream monomorphization
- // and we export generics, we must make
- // it available to downstream crates.
- can_be_internalized = false;
- default_visibility(def_id, true)
- } else {
- Visibility::Hidden
- }
- }
- }
- InstanceDef::FnPtrShim(..) |
- InstanceDef::Virtual(..) |
- InstanceDef::Intrinsic(..) |
- InstanceDef::ClosureOnceShim { .. } |
- InstanceDef::DropGlue(..) |
- InstanceDef::CloneShim(..) => {
- Visibility::Hidden
- }
- };
- (Linkage::External, visibility)
- }
- MonoItem::Static(def_id) => {
- let visibility = if tcx.is_reachable_non_generic(def_id) {
- can_be_internalized = false;
- default_visibility(def_id, false)
- } else {
- Visibility::Hidden
- };
- (Linkage::External, visibility)
- }
- MonoItem::GlobalAsm(node_id) => {
- let def_id = tcx.hir.local_def_id(node_id);
- let visibility = if tcx.is_reachable_non_generic(def_id) {
- can_be_internalized = false;
- default_visibility(def_id, false)
- } else {
- Visibility::Hidden
- };
- (Linkage::External, visibility)
- }
- }
- }
- };
+ let (linkage, visibility) = mono_item_linkage_and_visibility(
+ tcx,
+ &mono_item,
+ &mut can_be_internalized,
+ export_generics,
+ );
if visibility == Visibility::Hidden && can_be_internalized {
internalization_candidates.insert(mono_item);
}
}
}
+fn mono_item_linkage_and_visibility(
+ tcx: TyCtxt<'a, 'tcx, 'tcx>,
+ mono_item: &MonoItem<'tcx>,
+ can_be_internalized: &mut bool,
+ export_generics: bool,
+) -> (Linkage, Visibility) {
+ if let Some(explicit_linkage) = mono_item.explicit_linkage(tcx) {
+ return (explicit_linkage, Visibility::Default)
+ }
+ let vis = mono_item_visibility(
+ tcx,
+ mono_item,
+ can_be_internalized,
+ export_generics,
+ );
+ (Linkage::External, vis)
+}
+
+fn mono_item_visibility(
+ tcx: TyCtxt<'a, 'tcx, 'tcx>,
+ mono_item: &MonoItem<'tcx>,
+ can_be_internalized: &mut bool,
+ export_generics: bool,
+) -> Visibility {
+ let instance = match mono_item {
+ // This is pretty complicated, go below
+ MonoItem::Fn(instance) => instance,
+
+ // Misc handling for generics and such, but otherwise
+ MonoItem::Static(def_id) => {
+ return if tcx.is_reachable_non_generic(*def_id) {
+ *can_be_internalized = false;
+ default_visibility(tcx, *def_id, false)
+ } else {
+ Visibility::Hidden
+ };
+ }
+ MonoItem::GlobalAsm(node_id) => {
+ let def_id = tcx.hir.local_def_id(*node_id);
+ return if tcx.is_reachable_non_generic(def_id) {
+ *can_be_internalized = false;
+ default_visibility(tcx, def_id, false)
+ } else {
+ Visibility::Hidden
+ };
+ }
+ };
+
+ let def_id = match instance.def {
+ InstanceDef::Item(def_id) => def_id,
+
+ // These are all compiler glue and such, never exported, always hidden.
+ InstanceDef::FnPtrShim(..) |
+ InstanceDef::Virtual(..) |
+ InstanceDef::Intrinsic(..) |
+ InstanceDef::ClosureOnceShim { .. } |
+ InstanceDef::DropGlue(..) |
+ InstanceDef::CloneShim(..) => {
+ return Visibility::Hidden
+ }
+ };
+
+ // The `start_fn` lang item is actually a monomorphized instance of a
+ // function in the standard library, used for the `main` function. We don't
+ // want to export it so we tag it with `Hidden` visibility but this symbol
+ // is only referenced from the actual `main` symbol which we unfortunately
+ // don't know anything about during partitioning/collection. As a result we
+ // forcibly keep this symbol out of the `internalization_candidates` set.
+ //
+ // FIXME: eventually we don't want to always force this symbol to have
+ // hidden visibility, it should indeed be a candidate for
+ // internalization, but we have to understand that it's referenced
+ // from the `main` symbol we'll generate later.
+ //
+ // This may be fixable with a new `InstanceDef` perhaps? Unsure!
+ if tcx.lang_items().start_fn() == Some(def_id) {
+ *can_be_internalized = false;
+ return Visibility::Hidden
+ }
+
+ let is_generic = instance.substs.types().next().is_some();
+
+ // Upstream `DefId` instances get different handling than local ones
+ if !def_id.is_local() {
+ return if export_generics && is_generic {
+ // If it is a upstream monomorphization
+ // and we export generics, we must make
+ // it available to downstream crates.
+ *can_be_internalized = false;
+ default_visibility(tcx, def_id, true)
+ } else {
+ Visibility::Hidden
+ }
+ }
+
+ if is_generic {
+ if export_generics {
+ if tcx.is_unreachable_local_definition(def_id) {
+ // This instance cannot be used
+ // from another crate.
+ Visibility::Hidden
+ } else {
+ // This instance might be useful in
+ // a downstream crate.
+ *can_be_internalized = false;
+ default_visibility(tcx, def_id, true)
+ }
+ } else {
+ // We are not exporting generics or
+ // the definition is not reachable
+ // for downstream crates, we can
+ // internalize its instantiations.
+ Visibility::Hidden
+ }
+ } else {
+
+ // If this isn't a generic function then we mark this a `Default` if
+ // this is a reachable item, meaning that it's a symbol other crates may
+ // access when they link to us.
+ if tcx.is_reachable_non_generic(def_id) {
+ *can_be_internalized = false;
+ debug_assert!(!is_generic);
+ return default_visibility(tcx, def_id, false)
+ }
+
+ // If this isn't reachable then we're gonna tag this with `Hidden`
+ // visibility. In some situations though we'll want to prevent this
+ // symbol from being internalized.
+ //
+ // There's two categories of items here:
+ //
+ // * First is weak lang items. These are basically mechanisms for
+ // libcore to forward-reference symbols defined later in crates like
+ // the standard library or `#[panic_implementation]` definitions. The
+ // definition of these weak lang items needs to be referenceable by
+ // libcore, so we're no longer a candidate for internalization.
+ // Removal of these functions can't be done by LLVM but rather must be
+ // done by the linker as it's a non-local decision.
+ //
+ // * Second is "std internal symbols". Currently this is primarily used
+ // for allocator symbols. Allocators are a little weird in their
+ // implementation, but the idea is that the compiler, at the last
+ // minute, defines an allocator with an injected object file. The
+ // `alloc` crate references these symbols (`__rust_alloc`) and the
+ // definition doesn't get hooked up until a linked crate artifact is
+ // generated.
+ //
+ // The symbols synthesized by the compiler (`__rust_alloc`) are thin
+ // veneers around the actual implementation, some other symbol which
+ // implements the same ABI. These symbols (things like `__rg_alloc`,
+ // `__rdl_alloc`, `__rde_alloc`, etc), are all tagged with "std
+ // internal symbols".
+ //
+ // The std-internal symbols here **should not show up in a dll as an
+ // exported interface**, so they return `false` from
+ // `is_reachable_non_generic` above and we'll give them `Hidden`
+ // visibility below. Like the weak lang items, though, we can't let
+ // LLVM internalize them as this decision is left up to the linker to
+ // omit them, so prevent them from being internalized.
+ let codegen_fn_attrs = tcx.codegen_fn_attrs(def_id);
+ let std_internal_symbol = codegen_fn_attrs.flags
+ .contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL);
+ if tcx.is_weak_lang_item(def_id) || std_internal_symbol {
+ *can_be_internalized = false;
+ }
+
+ Visibility::Hidden
+ }
+}
+
+fn default_visibility(tcx: TyCtxt, id: DefId, is_generic: bool) -> Visibility {
+ if !tcx.sess.target.target.options.default_hidden_visibility {
+ return Visibility::Default
+ }
+
+ // Generic functions never have export level C
+ if is_generic {
+ return Visibility::Hidden
+ }
+
+ // Things with export level C don't get instantiated in
+ // downstream crates
+ if !id.is_local() {
+ return Visibility::Hidden
+ }
+
+ // C-export level items remain at `Default`, all other internal
+ // items become `Hidden`
+ match tcx.reachable_non_generics(id.krate).get(&id) {
+ Some(SymbolExportLevel::C) => Visibility::Default,
+ _ => Visibility::Hidden,
+ }
+}
+
fn merge_codegen_units<'tcx>(initial_partitioning: &mut PreInliningPartitioning<'tcx>,
target_cgu_count: usize,
crate_name: &str) {
) -> Option<Const<'tcx>> {
let span = source_info.span;
match *rvalue {
- // This branch exists for the sanity type check
- Rvalue::Use(Operand::Constant(ref c)) => {
- assert_eq!(c.ty, place_layout.ty);
- self.eval_constant(c, source_info)
- },
Rvalue::Use(ref op) => {
self.eval_operand(op, source_info)
},
this.super_place(place, context, location);
match proj.elem {
ProjectionElem::Deref => {
- this.add(Qualif::NOT_CONST);
-
- let base_ty = proj.base.ty(this.mir, this.tcx).to_ty(this.tcx);
- if let ty::TyRawPtr(_) = base_ty.sty {
- if this.mode != Mode::Fn {
- let mut err = struct_span_err!(
- this.tcx.sess,
- this.span,
- E0396,
- "raw pointers cannot be dereferenced in {}s",
- this.mode
- );
- err.span_label(this.span,
- "dereference of raw pointer in constant");
- if this.tcx.sess.teach(&err.get_code().unwrap()) {
- err.note(
- "The value behind a raw pointer can't be determined \
- at compile-time (or even link-time), which means it \
- can't be used in a constant expression."
+ if let Mode::Fn = this.mode {
+ this.add(Qualif::NOT_CONST);
+ } else {
+ let base_ty = proj.base.ty(this.mir, this.tcx).to_ty(this.tcx);
+ if let ty::TyRawPtr(_) = base_ty.sty {
+ if !this.tcx.sess.features_untracked().const_raw_ptr_deref {
+ emit_feature_err(
+ &this.tcx.sess.parse_sess, "const_raw_ptr_deref",
+ this.span, GateIssue::Language,
+ &format!(
+ "dereferencing raw pointers in {}s is unstable",
+ this.mode,
+ ),
);
- err.help("A possible fix is to dereference your pointer \
- at some point in run-time.");
}
- err.emit();
}
}
}
ProjectionElem::Field(..) |
ProjectionElem::Index(_) => {
- if this.mode == Mode::Fn {
- let base_ty = proj.base.ty(this.mir, this.tcx).to_ty(this.tcx);
- if let Some(def) = base_ty.ty_adt_def() {
- if def.is_union() {
- this.not_const();
+ let base_ty = proj.base.ty(this.mir, this.tcx).to_ty(this.tcx);
+ if let Some(def) = base_ty.ty_adt_def() {
+ if def.is_union() {
+ match this.mode {
+ Mode::Fn => this.not_const(),
+ Mode::ConstFn => {
+ if !this.tcx.sess.features_untracked().const_fn_union {
+ emit_feature_err(
+ &this.tcx.sess.parse_sess, "const_fn_union",
+ this.span, GateIssue::Language,
+ "unions in const fn are unstable",
+ );
+ }
+ },
+
+ | Mode::Static
+ | Mode::StaticMut
+ | Mode::Const
+ => {},
}
}
}
match (cast_in, cast_out) {
(CastTy::Ptr(_), CastTy::Int(_)) |
(CastTy::FnPtr, CastTy::Int(_)) => {
- self.add(Qualif::NOT_CONST);
- if self.mode != Mode::Fn {
- let mut err = struct_span_err!(
- self.tcx.sess,
- self.span,
- E0018,
- "raw pointers cannot be cast to integers in {}s",
- self.mode
+ if let Mode::Fn = self.mode {
+ self.add(Qualif::NOT_CONST);
+ } else if !self.tcx.sess.features_untracked().const_raw_ptr_to_usize_cast {
+ emit_feature_err(
+ &self.tcx.sess.parse_sess, "const_raw_ptr_to_usize_cast",
+ self.span, GateIssue::Language,
+ &format!(
+ "casting pointers to integers in {}s is unstable",
+ self.mode,
+ ),
);
- if self.tcx.sess.teach(&err.get_code().unwrap()) {
- err.note("\
-The value of static and constant integers must be known at compile time. You can't cast a pointer \
-to an integer because the address of a pointer can vary.
-
-For example, if you write:
-
-```
-static MY_STATIC: u32 = 42;
-static MY_STATIC_ADDR: usize = &MY_STATIC as *const _ as usize;
-static WHAT: usize = (MY_STATIC_ADDR^17) + MY_STATIC_ADDR;
-```
-
-Then `MY_STATIC_ADDR` would contain the address of `MY_STATIC`. However, the address can change \
-when the program is linked, as well as change between different executions due to ASLR, and many \
-linkers would not be able to calculate the value of `WHAT`.
-
-On the other hand, static and constant pointers can point either to a known numeric address or to \
-the address of a symbol.
-
-```
-static MY_STATIC: u32 = 42;
-static MY_STATIC_ADDR: &'static u32 = &MY_STATIC;
-const CONST_ADDR: *const u8 = 0x5f3759df as *const u8;
-```
-
-This does not pose a problem by itself because they can't be accessed directly.");
- }
- err.emit();
}
}
_ => {}
op == BinOp::Ge || op == BinOp::Gt ||
op == BinOp::Offset);
- self.add(Qualif::NOT_CONST);
- if self.mode != Mode::Fn {
- struct_span_err!(
- self.tcx.sess, self.span, E0395,
- "raw pointers cannot be compared in {}s",
- self.mode)
- .span_label(
+ if let Mode::Fn = self.mode {
+ self.add(Qualif::NOT_CONST);
+ } else if !self.tcx.sess.features_untracked().const_compare_raw_pointers {
+ emit_feature_err(
+ &self.tcx.sess.parse_sess,
+ "const_compare_raw_pointers",
self.span,
- "comparing raw pointers in static")
- .emit();
+ GateIssue::Language,
+ &format!("comparing raw pointers inside {}", self.mode),
+ );
}
}
}
self.record("Lifetime", Id::Node(lifetime.id), lifetime);
hir_visit::walk_lifetime(self, lifetime)
}
- fn visit_qpath(&mut self, qpath: &'v hir::QPath, id: NodeId, span: Span) {
+ fn visit_qpath(&mut self, qpath: &'v hir::QPath, id: hir::HirId, span: Span) {
self.record("QPath", Id::None, qpath);
hir_visit::walk_qpath(self, qpath, id, span)
}
- fn visit_path(&mut self, path: &'v hir::Path, _id: NodeId) {
+ fn visit_path(&mut self, path: &'v hir::Path, _id: hir::HirId) {
self.record("Path", Id::None, path);
hir_visit::walk_path(self, path)
}
// we prohibit access to private statics from other crates, this allows to give
// more code internal visibility at link time. (Access to private functions
// is already prohibited by type privacy for function types.)
- fn visit_qpath(&mut self, qpath: &'tcx hir::QPath, id: ast::NodeId, span: Span) {
+ fn visit_qpath(&mut self, qpath: &'tcx hir::QPath, id: hir::HirId, span: Span) {
let def = match *qpath {
hir::QPath::Resolved(_, ref path) => match path.def {
Def::Method(..) | Def::AssociatedConst(..) |
_ => None,
}
hir::QPath::TypeRelative(..) => {
- let hir_id = self.tcx.hir.node_to_hir_id(id);
- self.tables.type_dependent_defs().get(hir_id).cloned()
+ self.tables.type_dependent_defs().get(id).cloned()
}
};
if let Some(def) = def {
pub fn get_macro(&mut self, def: Def) -> Lrc<SyntaxExtension> {
let def_id = match def {
Def::Macro(def_id, ..) => def_id,
- Def::NonMacroAttr => return Lrc::new(SyntaxExtension::NonMacroAttr),
- _ => panic!("Expected Def::Macro(..) or Def::NonMacroAttr"),
+ Def::NonMacroAttr(attr_kind) => return Lrc::new(SyntaxExtension::NonMacroAttr {
+ mark_used: attr_kind == NonMacroAttrKind::Tool,
+ }),
+ _ => panic!("expected `Def::Macro` or `Def::NonMacroAttr`"),
};
if let Some(ext) = self.macro_map.get(&def_id) {
return ext.clone();
self.label_ribs.pop();
}
self.ribs[ValueNS].pop();
- if let Some(_) = anonymous_module {
+ if anonymous_module.is_some() {
self.ribs[TypeNS].pop();
}
debug!("(resolving block) leaving block");
let binding = if let Some(module) = module {
self.resolve_ident_in_module(module, ident, ns, record_used, path_span)
} else if opt_ns == Some(MacroNS) {
- self.resolve_lexical_macro_path_segment(ident, ns, record_used, path_span)
- .map(MacroBinding::binding)
+ assert!(ns == TypeNS);
+ self.resolve_lexical_macro_path_segment(ident, ns, record_used, record_used,
+ false, path_span).map(MacroBinding::binding)
} else {
let record_used_id =
if record_used { crate_lint.node_id().or(Some(CRATE_NODE_ID)) } else { None };
if let Some(next_module) = binding.module() {
module = Some(next_module);
} else if def == Def::ToolMod && i + 1 != path.len() {
- return PathResult::NonModule(PathResolution::new(Def::NonMacroAttr))
+ let def = Def::NonMacroAttr(NonMacroAttrKind::Tool);
+ return PathResult::NonModule(PathResolution::new(def));
} else if def == Def::Err {
return PathResult::NonModule(err_path_resolution());
} else if opt_ns.is_some() && (is_last || maybe_assoc) {
while let Some((in_module, path_segments)) = worklist.pop() {
// abort if the module is already found
- if let Some(_) = result { break; }
+ if result.is_some() { break; }
self.populate_module_if_necessary(in_module);
let result = self.resolve_lexical_macro_path_segment(ident,
MacroNS,
false,
+ false,
+ true,
attr.path.span);
if let Ok(binding) = result {
if let SyntaxExtension::AttrProcMacro(..) = *binding.binding().get_macro(self) {
use resolve_imports::ImportResolver;
use rustc::hir::def_id::{DefId, BUILTIN_MACROS_CRATE, CRATE_DEF_INDEX, DefIndex,
DefIndexAddressSpace};
-use rustc::hir::def::{Def, Export};
+use rustc::hir::def::{Def, Export, NonMacroAttrKind};
use rustc::hir::map::{self, DefCollector};
use rustc::{ty, lint};
use rustc::middle::cstore::CrateStore;
use syntax::ast::{self, Name, Ident};
-use syntax::attr::{self, HasAttrs};
+use syntax::attr;
use syntax::errors::DiagnosticBuilder;
-use syntax::ext::base::{self, Annotatable, Determinacy, MultiModifier, MultiDecorator};
+use syntax::ext::base::{self, Determinacy, MultiModifier, MultiDecorator};
use syntax::ext::base::{MacroKind, SyntaxExtension, Resolver as SyntaxResolver};
-use syntax::ext::expand::{self, AstFragment, AstFragmentKind, Invocation, InvocationKind};
+use syntax::ext::expand::{AstFragment, Invocation, InvocationKind};
use syntax::ext::hygiene::{self, Mark};
-use syntax::ext::placeholders::placeholder;
use syntax::ext::tt::macro_rules;
use syntax::feature_gate::{self, feature_err, emit_feature_err, is_builtin_attr_name, GateIssue};
use syntax::fold::{self, Folder};
None
}
- fn resolve_invoc(&mut self, invoc: &mut Invocation, scope: Mark, force: bool)
+ fn resolve_invoc(&mut self, invoc: &Invocation, scope: Mark, force: bool)
-> Result<Option<Lrc<SyntaxExtension>>, Determinacy> {
let def = match invoc.kind {
InvocationKind::Attr { attr: None, .. } => return Ok(None),
if let Def::Macro(_, MacroKind::ProcMacroStub) = def {
self.report_proc_macro_stub(invoc.span());
return Err(Determinacy::Determined);
- } else if let Def::NonMacroAttr = def {
- if let InvocationKind::Attr { .. } = invoc.kind {
- if !self.session.features_untracked().tool_attributes {
- feature_err(&self.session.parse_sess, "tool_attributes",
- invoc.span(), GateIssue::Language,
- "tool attributes are unstable").emit();
+ } else if let Def::NonMacroAttr(attr_kind) = def {
+ // Note that not only attributes, but anything in macro namespace can result in a
+ // `Def::NonMacroAttr` definition (e.g. `inline!()`), so we must report the error
+ // below for these cases.
+ let is_attr_invoc =
+ if let InvocationKind::Attr { .. } = invoc.kind { true } else { false };
+ let path = invoc.path().expect("no path for non-macro attr");
+ match attr_kind {
+ NonMacroAttrKind::Tool | NonMacroAttrKind::DeriveHelper |
+ NonMacroAttrKind::Custom if is_attr_invoc => {
+ if attr_kind == NonMacroAttrKind::Tool &&
+ !self.session.features_untracked().tool_attributes {
+ feature_err(&self.session.parse_sess, "tool_attributes",
+ invoc.span(), GateIssue::Language,
+ "tool attributes are unstable").emit();
+ }
+ if attr_kind == NonMacroAttrKind::Custom &&
+ !self.session.features_untracked().custom_attribute {
+ let msg = format!("The attribute `{}` is currently unknown to the compiler \
+ and may have meaning added to it in the future", path);
+ feature_err(&self.session.parse_sess, "custom_attribute", invoc.span(),
+ GateIssue::Language, &msg).emit();
+ }
+ return Ok(Some(Lrc::new(SyntaxExtension::NonMacroAttr {
+ mark_used: attr_kind == NonMacroAttrKind::Tool,
+ })));
+ }
+ _ => {
+ self.report_non_macro_attr(path.span, def);
+ return Err(Determinacy::Determined);
}
- return Ok(Some(Lrc::new(SyntaxExtension::NonMacroAttr)));
- } else {
- self.report_non_macro_attr(invoc.path_span());
- return Err(Determinacy::Determined);
}
}
let def_id = def.def_id();
if let Def::Macro(_, MacroKind::ProcMacroStub) = def {
self.report_proc_macro_stub(path.span);
return Err(Determinacy::Determined);
- } else if let Def::NonMacroAttr = def {
- self.report_non_macro_attr(path.span);
+ } else if let Def::NonMacroAttr(..) = def {
+ self.report_non_macro_attr(path.span, def);
return Err(Determinacy::Determined);
}
self.unused_macros.remove(&def.def_id());
"can't use a procedural macro from the same crate that defines it");
}
- fn report_non_macro_attr(&self, span: Span) {
- self.session.span_err(span,
- "expected a macro, found non-macro attribute");
+ fn report_non_macro_attr(&self, span: Span, def: Def) {
+ self.session.span_err(span, &format!("expected a macro, found {}", def.kind_name()));
}
- fn resolve_invoc_to_def(&mut self, invoc: &mut Invocation, scope: Mark, force: bool)
+ fn resolve_invoc_to_def(&mut self, invoc: &Invocation, scope: Mark, force: bool)
-> Result<Def, Determinacy> {
- let (attr, traits, item) = match invoc.kind {
- InvocationKind::Attr { ref mut attr, ref traits, ref mut item } => (attr, traits, item),
+ let (attr, traits) = match invoc.kind {
+ InvocationKind::Attr { ref attr, ref traits, .. } => (attr, traits),
InvocationKind::Bang { ref mac, .. } => {
return self.resolve_macro_to_def(scope, &mac.node.path, MacroKind::Bang, force);
}
}
};
-
let path = attr.as_ref().unwrap().path.clone();
- let mut determinacy = Determinacy::Determined;
- match self.resolve_macro_to_def(scope, &path, MacroKind::Attr, force) {
- Ok(def) => return Ok(def),
- Err(Determinacy::Undetermined) => determinacy = Determinacy::Undetermined,
- Err(Determinacy::Determined) if force => return Err(Determinacy::Determined),
- Err(Determinacy::Determined) => {}
+ let def = self.resolve_macro_to_def(scope, &path, MacroKind::Attr, force);
+ if let Ok(Def::NonMacroAttr(NonMacroAttrKind::Custom)) = def {} else {
+ return def;
}
- // Ok at this point we've determined that the `attr` above doesn't
- // actually resolve at this time, so we may want to report an error.
- // It could be the case, though, that `attr` won't ever resolve! If
- // there's a custom derive that could be used it might declare `attr` as
- // a custom attribute accepted by the derive. In this case we don't want
- // to report this particular invocation as unresolved, but rather we'd
- // want to move on to the next invocation.
+ // At this point we've found that the `attr` is determinately unresolved and thus can be
+ // interpreted as a custom attribute. Normally custom attributes are feature gated, but
+ // it may be a custom attribute whitelisted by a derive macro and they do not require
+ // a feature gate.
//
- // This loop here looks through all of the derive annotations in scope
- // and tries to resolve them. If they themselves successfully resolve
- // *and* the resolve mentions that this attribute's name is a registered
- // custom attribute then we flag this attribute as known and update
- // `invoc` above to point to the next invocation.
- //
- // By then returning `Undetermined` we should continue resolution to
- // resolve the next attribute.
- let attr_name = match path.segments.len() {
- 1 => path.segments[0].ident.name,
- _ => return Err(determinacy),
- };
+ // So here we look through all of the derive annotations in scope and try to resolve them.
+ // If they themselves successfully resolve *and* one of the resolved derive macros
+ // whitelists this attribute's name, then this is a registered attribute and we can convert
+ // it from a "generic custom attrite" into a "known derive helper attribute".
+ enum ConvertToDeriveHelper { Yes, No, DontKnow }
+ let mut convert_to_derive_helper = ConvertToDeriveHelper::No;
+ let attr_name = path.segments[0].ident.name;
for path in traits {
match self.resolve_macro(scope, path, MacroKind::Derive, force) {
Ok(ext) => if let SyntaxExtension::ProcMacroDerive(_, ref inert_attrs, _) = *ext {
if inert_attrs.contains(&attr_name) {
- // FIXME(jseyfried) Avoid `mem::replace` here.
- let dummy_item = placeholder(AstFragmentKind::Items, ast::DUMMY_NODE_ID)
- .make_items().pop().unwrap();
- let dummy_item = Annotatable::Item(dummy_item);
- *item = mem::replace(item, dummy_item).map_attrs(|mut attrs| {
- let inert_attr = attr.take().unwrap();
- attr::mark_known(&inert_attr);
- if self.use_extern_macros {
- *attr = expand::find_attr_invoc(&mut attrs);
- }
- attrs.push(inert_attr);
- attrs
- });
- return Err(Determinacy::Undetermined)
+ convert_to_derive_helper = ConvertToDeriveHelper::Yes;
+ break
}
},
- Err(Determinacy::Undetermined) => determinacy = Determinacy::Undetermined,
+ Err(Determinacy::Undetermined) =>
+ convert_to_derive_helper = ConvertToDeriveHelper::DontKnow,
Err(Determinacy::Determined) => {}
}
}
- Err(determinacy)
+ match convert_to_derive_helper {
+ ConvertToDeriveHelper::Yes => Ok(Def::NonMacroAttr(NonMacroAttrKind::DeriveHelper)),
+ ConvertToDeriveHelper::No => def,
+ ConvertToDeriveHelper::DontKnow => Err(Determinacy::determined(force)),
+ }
}
fn resolve_macro_to_def(&mut self, scope: Mark, path: &ast::Path, kind: MacroKind, force: bool)
"generic arguments in macro path");
});
}
- if kind != MacroKind::Bang && path.segments.len() > 1 && def != Ok(Def::NonMacroAttr) {
+ if kind != MacroKind::Bang && path.segments.len() > 1 &&
+ def != Ok(Def::NonMacroAttr(NonMacroAttrKind::Tool)) {
if !self.session.features_untracked().proc_macro_path_invoc {
emit_feature_err(
&self.session.parse_sess,
let result = if let Some(MacroBinding::Legacy(binding)) = legacy_resolution {
Ok(Def::Macro(binding.def_id, MacroKind::Bang))
} else {
- match self.resolve_lexical_macro_path_segment(path[0], MacroNS, false, span) {
+ match self.resolve_lexical_macro_path_segment(path[0], MacroNS, false, force,
+ kind == MacroKind::Attr, span) {
Ok(binding) => Ok(binding.binding().def_ignoring_ambiguity()),
- Err(Determinacy::Undetermined) if !force => return Err(Determinacy::Undetermined),
- Err(_) => {
+ Err(Determinacy::Undetermined) => return Err(Determinacy::Undetermined),
+ Err(Determinacy::Determined) => {
self.found_unresolved_macro = true;
Err(Determinacy::Determined)
}
mut ident: Ident,
ns: Namespace,
record_used: bool,
+ force: bool,
+ is_attr: bool,
path_span: Span)
-> Result<MacroBinding<'a>, Determinacy> {
// General principles:
// 3. Builtin attributes (closed, controlled).
assert!(ns == TypeNS || ns == MacroNS);
+ assert!(force || !record_used); // `record_used` implies `force`
ident = ident.modern();
// Names from inner scope that can't shadow names from outer scopes, e.g.
}
WhereToResolve::BuiltinAttrs => {
if is_builtin_attr_name(ident.name) {
- let binding = (Def::NonMacroAttr, ty::Visibility::Public,
- ident.span, Mark::root()).to_name_binding(self.arenas);
+ let binding = (Def::NonMacroAttr(NonMacroAttrKind::Builtin),
+ ty::Visibility::Public, ident.span, Mark::root())
+ .to_name_binding(self.arenas);
Ok(MacroBinding::Global(binding))
} else {
Err(Determinacy::Determined)
Err(Determinacy::Determined) => {
continue_search!();
}
- Err(Determinacy::Undetermined) => return Err(Determinacy::Undetermined),
+ Err(Determinacy::Undetermined) => return Err(Determinacy::determined(force)),
}
}
return Ok(previous_result);
}
- if record_used { Err(Determinacy::Determined) } else { Err(Determinacy::Undetermined) }
+ let determinacy = Determinacy::determined(force);
+ if determinacy == Determinacy::Determined && is_attr {
+ // For single-segment attributes interpret determinate "no resolution" as a custom
+ // attribute. (Lexical resolution implies the first segment and is_attr should imply
+ // the last segment, so we are certainly working with a single-segment attribute here.)
+ assert!(ns == MacroNS);
+ let binding = (Def::NonMacroAttr(NonMacroAttrKind::Custom),
+ ty::Visibility::Public, ident.span, Mark::root())
+ .to_name_binding(self.arenas);
+ Ok(MacroBinding::Global(binding))
+ } else {
+ Err(determinacy)
+ }
}
pub fn resolve_legacy_scope(&mut self,
let span = ident.span;
let legacy_scope = &self.invocations[&mark].legacy_scope;
let legacy_resolution = self.resolve_legacy_scope(legacy_scope, ident, true);
- let resolution = self.resolve_lexical_macro_path_segment(ident, MacroNS, true, span);
+ let resolution = self.resolve_lexical_macro_path_segment(ident, MacroNS, true, true,
+ kind == MacroKind::Attr, span);
let check_consistency = |this: &Self, binding: MacroBinding| {
if let Some(def) = def {
impl<'b, W: Write> DumpOutput for WriteOutput<'b, W> {
fn dump(&mut self, result: &Analysis) {
- if let Err(_) = write!(self.output, "{}", as_json(&result)) {
+ if write!(self.output, "{}", as_json(&result)).is_err() {
error!("Error writing output");
}
}
HirDef::SelfTy(..) |
HirDef::Label(..) |
HirDef::Macro(..) |
- HirDef::GlobalAsm(..) |
HirDef::ToolMod |
- HirDef::NonMacroAttr |
+ HirDef::NonMacroAttr(..) |
HirDef::Err => None,
}
}
#![feature(box_syntax)]
#![feature(const_fn)]
-#![feature(fs_read_write)]
-#![feature(inclusive_range)]
#![feature(slice_patterns)]
#[macro_use]
executables: true,
panic_strategy: PanicStrategy::Abort,
relocation_model: "static".to_string(),
+ emit_debug_gdb_scripts: false,
abi_blacklist: vec![
Abi::Cdecl,
Abi::Stdcall,
if let Err(ErrorReported) = compare_synthetic_generics(tcx,
impl_m,
- impl_m_span,
- trait_m,
- trait_item_span) {
+ trait_m) {
return;
}
fn compare_synthetic_generics<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
impl_m: &ty::AssociatedItem,
- _impl_m_span: Span, // FIXME necessary?
- trait_m: &ty::AssociatedItem,
- _trait_item_span: Option<Span>) // FIXME necessary?
+ trait_m: &ty::AssociatedItem)
-> Result<(), ErrorReported> {
// FIXME(chrisvittal) Clean up this function, list of FIXME items:
// 1. Better messages for the span labels
// 2. Explanation as to what is going on
- // 3. Correct the function signature for what we actually use
// If we get here, we already have the same number of generics, so the zip will
// be okay.
let mut error_found = false;
self.span, infer::FnCall, &fty);
if let Some(self_ty) = self_ty {
- if let Err(_) = self.at(&ObligationCause::dummy(), self.param_env)
- .sup(fty.inputs()[0], self_ty)
+ if self.at(&ObligationCause::dummy(), self.param_env)
+ .sup(fty.inputs()[0], self_ty)
+ .is_err()
{
return false
}
}
hir::ExprKind::Continue(destination) => {
- if let Ok(_) = destination.target_id {
+ if destination.target_id.is_ok() {
tcx.types.never
} else {
// There was an error, make typecheck fail
impl<'a, 'tcx> Checker<'a, 'tcx> {
fn check<F>(&self, trait_def_id: Option<DefId>, mut f: F) -> &Self
- where F: FnMut(TyCtxt<'a, 'tcx, 'tcx>, DefId, DefId)
+ where F: FnMut(TyCtxt<'a, 'tcx, 'tcx>, DefId)
{
if Some(self.trait_def_id) == trait_def_id {
for &impl_id in self.tcx.hir.trait_impls(self.trait_def_id) {
let impl_def_id = self.tcx.hir.local_def_id(impl_id);
- f(self.tcx, self.trait_def_id, impl_def_id);
+ f(self.tcx, impl_def_id);
}
}
self
}
}
-fn visit_implementation_of_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- _drop_did: DefId,
- impl_did: DefId) {
+fn visit_implementation_of_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did: DefId) {
match tcx.type_of(impl_did).sty {
ty::TyAdt(..) => {}
_ => {
}
}
-fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- _copy_did: DefId,
- impl_did: DefId) {
+fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did: DefId) {
debug!("visit_implementation_of_copy: impl_did={:?}", impl_did);
let impl_node_id = if let Some(n) = tcx.hir.as_local_node_id(impl_did) {
}
}
-fn visit_implementation_of_coerce_unsized<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- _: DefId,
- impl_did: DefId) {
+fn visit_implementation_of_coerce_unsized<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did: DefId) {
debug!("visit_implementation_of_coerce_unsized: impl_did={:?}",
impl_did);
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(crate_visibility_modifier)]
-#![feature(from_ref)]
#![feature(exhaustive_patterns)]
#![feature(iterator_find_map)]
#![feature(quote)]
let trait_ = hir::TraitRef {
path: get_path_for_type(self.cx.tcx, trait_def_id, hir::def::Def::Trait),
ref_id: ast::DUMMY_NODE_ID,
+ hir_ref_id: hir::DUMMY_HIR_ID,
};
let polarity;
name: name.to_string(),
kind: GenericParamDefKind::Lifetime,
})
- }
- &ty::ReVar(_) | &ty::ReEarlyBound(_) => None,
+ },
+ &ty::ReVar(_) | &ty::ReEarlyBound(_) | &ty::ReStatic => None,
_ => panic!("Unexpected region type {:?}", r),
}
})
trait_def_id,
hir::def::Def::Trait),
ref_id: ast::DUMMY_NODE_ID,
+ hir_ref_id: hir::DUMMY_HIR_ID,
};
let provided_trait_methods =
infcx.tcx.provided_trait_methods(trait_def_id)
&name,
&output_filenames,
|tcx, analysis, _, result| {
- if let Err(_) = result {
+ if result.is_err() {
sess.fatal("Compilation failed, aborting rustdoc");
}
write_header(class, &mut out).unwrap();
let mut classifier = Classifier::new(lexer::StringReader::new(&sess, fm, None), sess.codemap());
- if let Err(_) = classifier.write_source(&mut out) {
+ if classifier.write_source(&mut out).is_err() {
return format!("<pre>{}</pre>", src);
}
data.no_run = true;
}
x if allow_error_code_check && x.starts_with("E") && x.len() == 5 => {
- if let Ok(_) = x[1..].parse::<u32>() {
+ if x[1..].parse::<u32>().is_ok() {
data.error_codes.push(x.to_owned());
seen_rust_tags = !seen_other_tags || seen_rust_tags;
} else {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f,
"<h1 class='fqn'>\
- <span class='in-band'>List of all items</span>\
<span class='out-of-band'>\
<span id='render-detail'>\
<a id=\"toggle-all-docs\" href=\"javascript:void(0)\" title=\"collapse all docs\">\
</a>\
</span>
</span>
+ <span class='in-band'>List of all items</span>\
</h1>")?;
print_entries(f, &self.structs, "Structs", "structs")?;
print_entries(f, &self.enums, "Enums", "enums")?;
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
debug_assert!(!self.item.is_stripped());
// Write the breadcrumb trail header for the top
- write!(fmt, "<h1 class='fqn'><span class='in-band'>")?;
+ write!(fmt, "<h1 class='fqn'><span class='out-of-band'>")?;
+ if let Some(version) = self.item.stable_since() {
+ write!(fmt, "<span class='since' title='Stable since Rust version {0}'>{0}</span>",
+ version)?;
+ }
+ write!(fmt,
+ "<span id='render-detail'>\
+ <a id=\"toggle-all-docs\" href=\"javascript:void(0)\" \
+ title=\"collapse all docs\">\
+ [<span class='inner'>−</span>]\
+ </a>\
+ </span>")?;
+
+ // Write `src` tag
+ //
+ // When this item is part of a `pub use` in a downstream crate, the
+ // [src] link in the downstream documentation will actually come back to
+ // this page, and this link will be auto-clicked. The `id` attribute is
+ // used to find the link to auto-click.
+ if self.cx.shared.include_sources && !self.item.is_primitive() {
+ if let Some(l) = self.src_href() {
+ write!(fmt, "<a class='srclink' href='{}' title='{}'>[src]</a>",
+ l, "goto source code")?;
+ }
+ }
+
+ write!(fmt, "</span>")?; // out-of-band
+ write!(fmt, "<span class='in-band'>")?;
match self.item.inner {
clean::ModuleItem(ref m) => if m.is_crate {
write!(fmt, "Crate ")?;
write!(fmt, "<a class=\"{}\" href=''>{}</a>",
self.item.type_(), self.item.name.as_ref().unwrap())?;
- write!(fmt, "</span>")?; // in-band
- write!(fmt, "<span class='out-of-band'>")?;
- if let Some(version) = self.item.stable_since() {
- write!(fmt, "<span class='since' title='Stable since Rust version {0}'>{0}</span>",
- version)?;
- }
- write!(fmt,
- "<span id='render-detail'>\
- <a id=\"toggle-all-docs\" href=\"javascript:void(0)\" \
- title=\"collapse all docs\">\
- [<span class='inner'>−</span>]\
- </a>\
- </span>")?;
-
- // Write `src` tag
- //
- // When this item is part of a `pub use` in a downstream crate, the
- // [src] link in the downstream documentation will actually come back to
- // this page, and this link will be auto-clicked. The `id` attribute is
- // used to find the link to auto-click.
- if self.cx.shared.include_sources && !self.item.is_primitive() {
- if let Some(l) = self.src_href() {
- write!(fmt, "<a class='srclink' href='{}' title='{}'>[src]</a>",
- l, "goto source code")?;
- }
- }
-
- write!(fmt, "</span></h1>")?; // out-of-band
+ write!(fmt, "</span></h1>")?; // in-band
match self.item.inner {
clean::ModuleItem(ref m) =>
};
autoCollapse(getPageId(), getCurrentValue("rustdoc-collapse") === "true");
+
+ if (window.location.hash && window.location.hash.length > 0) {
+ var hash = getPageId();
+ if (hash !== null) {
+ var elem = document.getElementById(hash);
+ if (elem && elem.offsetParent === null) {
+ console.log(elem, elem.parentNode);
+ if (elem.parentNode && elem.parentNode.previousSibling) {
+ var collapses = elem.parentNode
+ .previousSibling
+ .getElementsByClassName("collapse-toggle");
+ if (collapses.length > 0) {
+ // The element is not visible, we need to make it appear!
+ collapseDocs(collapses[0], "show");
+ }
+ }
+ }
+ }
+ }
}());
// Sets the focus on the search bar at the top of the page
h1.fqn {
border-bottom: 1px dashed;
margin-top: 0;
- position: relative;
+ overflow: auto;
}
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
border-bottom: 1px solid;
}
.content .out-of-band {
+ float: right;
font-size: 23px;
margin: 0px;
padding: 0px;
- text-align: right;
- display: inline-block;
font-weight: normal;
- position: absolute;
- right: 0;
}
h3.impl > .out-of-band {
html_root_url = "https://doc.rust-lang.org/nightly/",
html_playground_url = "https://play.rust-lang.org/")]
-#![feature(ascii_ctype)]
#![feature(rustc_private)]
#![feature(box_patterns)]
#![feature(box_syntax)]
-#![feature(fs_read_write)]
#![feature(iterator_find_map)]
#![feature(set_stdio)]
#![feature(slice_sort_by_cached_key)]
#![feature(test)]
#![feature(vec_remove_item)]
-#![feature(entry_and_modify)]
#![feature(ptr_offset_from)]
#![feature(crate_visibility_modifier)]
#![feature(const_fn)]
// std is implemented with unstable features, many of which are internal
// compiler details that will never be stable
+#![cfg_attr(test, feature(test, update_panic_count))]
#![feature(alloc)]
#![feature(alloc_error_handler)]
#![feature(alloc_system)]
#![feature(align_offset)]
#![feature(arbitrary_self_types)]
#![feature(array_error_internals)]
-#![feature(ascii_ctype)]
#![feature(asm)]
#![feature(attr_literals)]
#![feature(box_syntax)]
#![feature(cfg_target_thread_local)]
#![feature(cfg_target_vendor)]
#![feature(char_error_internals)]
-#![feature(char_internals)]
-#![feature(collections_range)]
#![feature(compiler_builtins_lib)]
#![feature(const_fn)]
+#![feature(const_int_ops)]
+#![feature(const_ip)]
#![feature(core_intrinsics)]
#![feature(dropck_eyepatch)]
#![feature(exact_size_is_empty)]
#![feature(external_doc)]
-#![feature(fs_read_write)]
#![feature(fixed_size_array)]
-#![feature(float_from_str_radix)]
#![feature(fn_traits)]
#![feature(fnbox)]
#![feature(futures_api)]
#![feature(hashmap_internals)]
#![feature(int_error_internals)]
#![feature(integer_atomics)]
-#![feature(into_cow)]
#![feature(lang_items)]
#![feature(libc)]
#![feature(link_args)]
#![feature(needs_panic_runtime)]
#![feature(never_type)]
#![feature(exhaustive_patterns)]
-#![feature(num_bits_bytes)]
-#![feature(old_wrapping)]
#![feature(on_unimplemented)]
-#![feature(oom)]
#![feature(optin_builtin_traits)]
#![feature(panic_internals)]
#![feature(panic_unwind)]
-#![feature(peek)]
#![feature(pin)]
-#![feature(placement_new_protocol)]
#![feature(prelude_import)]
#![feature(ptr_internals)]
-#![feature(rand)]
#![feature(raw)]
#![feature(rustc_attrs)]
+#![feature(rustc_const_unstable)]
#![feature(std_internals)]
#![feature(stdsimd)]
#![feature(shrink_to)]
-#![feature(slice_bytes)]
#![feature(slice_concat_ext)]
#![feature(slice_internals)]
#![feature(slice_patterns)]
#![feature(staged_api)]
#![feature(stmt_expr_attributes)]
-#![feature(str_char)]
#![feature(str_internals)]
-#![feature(str_utf16)]
-#![feature(test, rustc_private)]
+#![feature(rustc_private)]
#![feature(thread_local)]
#![feature(toowned_clone_into)]
#![feature(try_from)]
#![feature(untagged_unions)]
#![feature(unwind_attributes)]
#![feature(use_extern_macros)]
-#![feature(vec_push_all)]
#![feature(doc_cfg)]
#![feature(doc_masked)]
#![feature(doc_spotlight)]
-#![cfg_attr(test, feature(update_panic_count))]
#![cfg_attr(windows, feature(used))]
#![feature(doc_alias)]
#![feature(doc_keyword)]
-#![feature(float_internals)]
#![feature(panic_info_message)]
#![feature(panic_implementation)]
use cmp::Ordering;
use fmt;
use hash;
-use mem;
-use net::{hton, ntoh};
use sys::net::netc as c;
use sys_common::{AsInner, FromInner};
/// let addr = Ipv4Addr::new(127, 0, 0, 1);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
- pub fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
+ #[rustc_const_unstable(feature = "const_ip")]
+ pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
Ipv4Addr {
inner: c::in_addr {
- s_addr: hton(((a as u32) << 24) |
- ((b as u32) << 16) |
- ((c as u32) << 8) |
- (d as u32)),
+ s_addr: u32::to_be(
+ ((a as u32) << 24) |
+ ((b as u32) << 16) |
+ ((c as u32) << 8) |
+ (d as u32)
+ ),
}
}
}
- /// Creates a new IPv4 address with the address pointing to localhost: 127.0.0.1.
+ /// An IPv4 address with the address pointing to localhost: 127.0.0.1.
///
/// # Examples
///
/// #![feature(ip_constructors)]
/// use std::net::Ipv4Addr;
///
- /// let addr = Ipv4Addr::localhost();
+ /// let addr = Ipv4Addr::LOCALHOST;
/// assert_eq!(addr, Ipv4Addr::new(127, 0, 0, 1));
/// ```
#[unstable(feature = "ip_constructors",
reason = "requires greater scrutiny before stabilization",
issue = "44582")]
- pub fn localhost() -> Ipv4Addr {
- Ipv4Addr::new(127, 0, 0, 1)
- }
+ pub const LOCALHOST: Self = Ipv4Addr::new(127, 0, 0, 1);
- /// Creates a new IPv4 address representing an unspecified address: 0.0.0.0
+ /// An IPv4 address representing an unspecified address: 0.0.0.0
///
/// # Examples
///
/// #![feature(ip_constructors)]
/// use std::net::Ipv4Addr;
///
- /// let addr = Ipv4Addr::unspecified();
+ /// let addr = Ipv4Addr::UNSPECIFIED;
/// assert_eq!(addr, Ipv4Addr::new(0, 0, 0, 0));
/// ```
#[unstable(feature = "ip_constructors",
reason = "requires greater scrutiny before stabilization",
issue = "44582")]
- pub fn unspecified() -> Ipv4Addr {
- Ipv4Addr::new(0, 0, 0, 0)
- }
+ pub const UNSPECIFIED: Self = Ipv4Addr::new(0, 0, 0, 0);
+
+ /// An IPv4 address representing the broadcast address: 255.255.255.255
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// #![feature(ip_constructors)]
+ /// use std::net::Ipv4Addr;
+ ///
+ /// let addr = Ipv4Addr::BROADCAST;
+ /// assert_eq!(addr, Ipv4Addr::new(255, 255, 255, 255));
+ /// ```
+ #[unstable(feature = "ip_constructors",
+ reason = "requires greater scrutiny before stabilization",
+ issue = "44582")]
+ pub const BROADCAST: Self = Ipv4Addr::new(255, 255, 255, 255);
/// Returns the four eight-bit integers that make up this address.
///
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn octets(&self) -> [u8; 4] {
- let bits = ntoh(self.inner.s_addr);
+ let bits = u32::from_be(self.inner.s_addr);
[(bits >> 24) as u8, (bits >> 16) as u8, (bits >> 8) as u8, bits as u8]
}
/// ```
#[stable(since = "1.7.0", feature = "ip_17")]
pub fn is_broadcast(&self) -> bool {
- self.octets()[0] == 255 && self.octets()[1] == 255 &&
- self.octets()[2] == 255 && self.octets()[3] == 255
+ self == &Self::BROADCAST
}
/// Returns [`true`] if this address is in a range designated for documentation.
#[stable(feature = "rust1", since = "1.0.0")]
impl Ord for Ipv4Addr {
fn cmp(&self, other: &Ipv4Addr) -> Ordering {
- ntoh(self.inner.s_addr).cmp(&ntoh(other.inner.s_addr))
+ u32::from_be(self.inner.s_addr).cmp(&u32::from_be(other.inner.s_addr))
}
}
/// let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
- pub fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16,
- h: u16) -> Ipv6Addr {
- let mut addr: c::in6_addr = unsafe { mem::zeroed() };
- addr.s6_addr = [(a >> 8) as u8, a as u8,
- (b >> 8) as u8, b as u8,
- (c >> 8) as u8, c as u8,
- (d >> 8) as u8, d as u8,
- (e >> 8) as u8, e as u8,
- (f >> 8) as u8, f as u8,
- (g >> 8) as u8, g as u8,
- (h >> 8) as u8, h as u8];
- Ipv6Addr { inner: addr }
+ #[rustc_const_unstable(feature = "const_ip")]
+ pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16,
+ g: u16, h: u16) -> Ipv6Addr {
+ Ipv6Addr {
+ inner: c::in6_addr {
+ s6_addr: [
+ (a >> 8) as u8, a as u8,
+ (b >> 8) as u8, b as u8,
+ (c >> 8) as u8, c as u8,
+ (d >> 8) as u8, d as u8,
+ (e >> 8) as u8, e as u8,
+ (f >> 8) as u8, f as u8,
+ (g >> 8) as u8, g as u8,
+ (h >> 8) as u8, h as u8
+ ],
+ }
+ }
+
}
- /// Creates a new IPv6 address representing localhost: `::1`.
+ /// An IPv6 address representing localhost: `::1`.
///
/// # Examples
///
/// #![feature(ip_constructors)]
/// use std::net::Ipv6Addr;
///
- /// let addr = Ipv6Addr::localhost();
+ /// let addr = Ipv6Addr::LOCALHOST;
/// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
/// ```
#[unstable(feature = "ip_constructors",
reason = "requires greater scrutiny before stabilization",
issue = "44582")]
- pub fn localhost() -> Ipv6Addr {
- Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)
- }
+ pub const LOCALHOST: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1);
- /// Creates a new IPv6 address representing the unspecified address: `::`
+ /// An IPv6 address representing the unspecified address: `::`
///
/// # Examples
///
/// #![feature(ip_constructors)]
/// use std::net::Ipv6Addr;
///
- /// let addr = Ipv6Addr::unspecified();
+ /// let addr = Ipv6Addr::UNSPECIFIED;
/// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0));
/// ```
#[unstable(feature = "ip_constructors",
reason = "requires greater scrutiny before stabilization",
issue = "44582")]
- pub fn unspecified() -> Ipv6Addr {
- Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)
- }
+ pub const UNSPECIFIED: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0);
/// Returns the eight 16-bit segments that make up this address.
///
#[stable(feature = "ipv6_from_octets", since = "1.9.0")]
impl From<[u8; 16]> for Ipv6Addr {
fn from(octets: [u8; 16]) -> Ipv6Addr {
- let mut inner: c::in6_addr = unsafe { mem::zeroed() };
- inner.s6_addr = octets;
+ let inner = c::in6_addr { s6_addr: octets };
Ipv6Addr::from_inner(inner)
}
}
#[test]
fn ipv4_from_constructors() {
- assert_eq!(Ipv4Addr::localhost(), Ipv4Addr::new(127, 0, 0, 1));
- assert!(Ipv4Addr::localhost().is_loopback());
- assert_eq!(Ipv4Addr::unspecified(), Ipv4Addr::new(0, 0, 0, 0));
- assert!(Ipv4Addr::unspecified().is_unspecified());
+ assert_eq!(Ipv4Addr::LOCALHOST, Ipv4Addr::new(127, 0, 0, 1));
+ assert!(Ipv4Addr::LOCALHOST.is_loopback());
+ assert_eq!(Ipv4Addr::UNSPECIFIED, Ipv4Addr::new(0, 0, 0, 0));
+ assert!(Ipv4Addr::UNSPECIFIED.is_unspecified());
+ assert_eq!(Ipv4Addr::BROADCAST, Ipv4Addr::new(255, 255, 255, 255));
+ assert!(Ipv4Addr::BROADCAST.is_broadcast());
}
#[test]
fn ipv6_from_contructors() {
- assert_eq!(Ipv6Addr::localhost(), Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
- assert!(Ipv6Addr::localhost().is_loopback());
- assert_eq!(Ipv6Addr::unspecified(), Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0));
- assert!(Ipv6Addr::unspecified().is_unspecified());
+ assert_eq!(Ipv6Addr::LOCALHOST, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
+ assert!(Ipv6Addr::LOCALHOST.is_loopback());
+ assert_eq!(Ipv6Addr::UNSPECIFIED, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0));
+ assert!(Ipv6Addr::UNSPECIFIED.is_unspecified());
}
#[test]
// initialization closure panics, the Once enters a "poisoned" state which means
// that all future calls will immediately panic as well.
//
-// So to implement this, one might first reach for a `StaticMutex`, but those
-// unfortunately need to be deallocated (e.g. call `destroy()`) to free memory
-// on all OSes (some of the BSDs allocate memory for mutexes). It also gets a
-// lot harder with poisoning to figure out when the mutex needs to be
-// deallocated because it's not after the closure finishes, but after the first
-// successful closure finishes.
+// So to implement this, one might first reach for a `Mutex`, but those cannot
+// be put into a `static`. It also gets a lot harder with poisoning to figure
+// out when the mutex needs to be deallocated because it's not after the closure
+// finishes, but after the first successful closure finishes.
//
// All in all, this is instead implemented with atomics and lock-free
// operations! Whee! Each `Once` has one word of atomic state, and this state is
}
#[derive(Copy, Clone)]
+#[repr(align(4))]
#[repr(C)]
pub struct in6_addr {
pub s6_addr: [u8; 16],
- __align: [u32; 0],
}
#[derive(Copy, Clone)]
// references, we instead create the mutex with type
// PTHREAD_MUTEX_NORMAL which is guaranteed to deadlock if we try to
// re-lock it from the same thread, thus avoiding undefined behavior.
- //
- // We can't do anything for StaticMutex, but that type is deprecated
- // anyways.
let mut attr: libc::pthread_mutexattr_t = mem::uninitialized();
let r = libc::pthread_mutexattr_init(&mut attr);
debug_assert_eq!(r, 0);
"##,
+E0705: r##"
+A `#![feature]` attribute was declared for a feature that is stable in
+the current edition.
+
+Erroneous code example:
+
+```ignore (limited to a warning during 2018 edition development)
+#![feature(rust_2018_preview)]
+#![feature(raw_identifiers)] // error: the feature `raw_identifiers` is
+ // included in the Rust 2018 edition
+```
+
+"##,
+
}
register_diagnostics! {
/// An enum representing the different kinds of syntax extensions.
pub enum SyntaxExtension {
/// A trivial "extension" that does nothing, only keeps the attribute and marks it as known.
- NonMacroAttr,
+ NonMacroAttr { mark_used: bool },
/// A syntax extension that is attached to an item and creates new items
/// based upon it.
SyntaxExtension::IdentTT(..) |
SyntaxExtension::ProcMacro { .. } =>
MacroKind::Bang,
- SyntaxExtension::NonMacroAttr |
+ SyntaxExtension::NonMacroAttr { .. } |
SyntaxExtension::MultiDecorator(..) |
SyntaxExtension::MultiModifier(..) |
SyntaxExtension::AttrProcMacro(..) =>
SyntaxExtension::AttrProcMacro(.., edition) |
SyntaxExtension::ProcMacroDerive(.., edition) => edition,
// Unstable legacy stuff
- SyntaxExtension::NonMacroAttr |
+ SyntaxExtension::NonMacroAttr { .. } |
SyntaxExtension::IdentTT(..) |
SyntaxExtension::MultiDecorator(..) |
SyntaxExtension::MultiModifier(..) |
fn find_legacy_attr_invoc(&mut self, attrs: &mut Vec<Attribute>, allow_derive: bool)
-> Option<Attribute>;
- fn resolve_invoc(&mut self, invoc: &mut Invocation, scope: Mark, force: bool)
+ fn resolve_invoc(&mut self, invoc: &Invocation, scope: Mark, force: bool)
-> Result<Option<Lrc<SyntaxExtension>>, Determinacy>;
fn resolve_macro(&mut self, scope: Mark, path: &ast::Path, kind: MacroKind, force: bool)
-> Result<Lrc<SyntaxExtension>, Determinacy>;
Undetermined,
}
+impl Determinacy {
+ pub fn determined(determined: bool) -> Determinacy {
+ if determined { Determinacy::Determined } else { Determinacy::Undetermined }
+ }
+}
+
pub struct DummyResolver;
impl Resolver for DummyResolver {
fn resolve_imports(&mut self) {}
fn find_legacy_attr_invoc(&mut self, _attrs: &mut Vec<Attribute>, _allow_derive: bool)
-> Option<Attribute> { None }
- fn resolve_invoc(&mut self, _invoc: &mut Invocation, _scope: Mark, _force: bool)
+ fn resolve_invoc(&mut self, _invoc: &Invocation, _scope: Mark, _force: bool)
-> Result<Option<Lrc<SyntaxExtension>>, Determinacy> {
Err(Determinacy::Determined)
}
}
}
- pub fn path_span(&self) -> Span {
+ pub fn path(&self) -> Option<&Path> {
match self.kind {
- InvocationKind::Bang { ref mac, .. } => mac.node.path.span,
- InvocationKind::Attr { attr: Some(ref attr), .. } => attr.path.span,
- InvocationKind::Attr { attr: None, .. } => DUMMY_SP,
- InvocationKind::Derive { ref path, .. } => path.span,
- }
- }
-
- pub fn attr_id(&self) -> Option<ast::AttrId> {
- match self.kind {
- InvocationKind::Attr { attr: Some(ref attr), .. } => Some(attr.id),
- _ => None,
+ InvocationKind::Bang { ref mac, .. } => Some(&mac.node.path),
+ InvocationKind::Attr { attr: Some(ref attr), .. } => Some(&attr.path),
+ InvocationKind::Attr { attr: None, .. } => None,
+ InvocationKind::Derive { ref path, .. } => Some(path),
}
}
}
let mut undetermined_invocations = Vec::new();
let (mut progress, mut force) = (false, !self.monotonic);
loop {
- let mut invoc = if let Some(invoc) = invocations.pop() {
+ let invoc = if let Some(invoc) = invocations.pop() {
invoc
} else {
self.resolve_imports();
let scope =
if self.monotonic { invoc.expansion_data.mark } else { orig_expansion_data.mark };
- let attr_id_before = invoc.attr_id();
- let ext = match self.cx.resolver.resolve_invoc(&mut invoc, scope, force) {
+ let ext = match self.cx.resolver.resolve_invoc(&invoc, scope, force) {
Ok(ext) => Some(ext),
Err(Determinacy::Determined) => None,
Err(Determinacy::Undetermined) => {
- // Sometimes attributes which we thought were invocations
- // end up being custom attributes for custom derives. If
- // that's the case our `invoc` will have changed out from
- // under us. If this is the case we're making progress so we
- // want to flag it as such, and we test this by looking if
- // the `attr_id()` method has been changing over time.
- if invoc.attr_id() != attr_id_before {
- progress = true;
- }
undetermined_invocations.push(invoc);
continue
}
}
fn expand_invoc(&mut self, invoc: Invocation, ext: &SyntaxExtension) -> Option<AstFragment> {
+ if invoc.fragment_kind == AstFragmentKind::ForeignItems &&
+ !self.cx.ecfg.macros_in_extern_enabled() {
+ if let SyntaxExtension::NonMacroAttr { .. } = *ext {} else {
+ emit_feature_err(&self.cx.parse_sess, "macros_in_extern",
+ invoc.span(), GateIssue::Language,
+ "macro invocations in `extern {}` blocks are experimental");
+ }
+ }
+
let result = match invoc.kind {
InvocationKind::Bang { .. } => self.expand_bang_invoc(invoc, ext)?,
InvocationKind::Attr { .. } => self.expand_attr_invoc(invoc, ext)?,
_ => unreachable!(),
};
- attr::mark_used(&attr);
+ if let NonMacroAttr { mark_used: false } = *ext {} else {
+ // Macro attrs are always used when expanded,
+ // non-macro attrs are considered used when the field says so.
+ attr::mark_used(&attr);
+ }
invoc.expansion_data.mark.set_expn_info(ExpnInfo {
call_site: attr.span,
def_site: None,
});
match *ext {
- NonMacroAttr => {
+ NonMacroAttr { .. } => {
attr::mark_known(&attr);
let item = item.map_attrs(|mut attrs| { attrs.push(attr); attrs });
Some(invoc.fragment_kind.expect_from_annotatables(iter::once(item)))
}
MultiDecorator(..) | MultiModifier(..) |
- AttrProcMacro(..) | SyntaxExtension::NonMacroAttr => {
+ AttrProcMacro(..) | SyntaxExtension::NonMacroAttr { .. } => {
self.cx.span_err(path.span,
&format!("`{}` can only be used in attributes", path));
self.cx.trace_macros_diag();
foreign_item: ast::ForeignItem) -> SmallVector<ast::ForeignItem> {
let (attr, traits, foreign_item) = self.classify_item(foreign_item);
- let explain = if self.cx.ecfg.use_extern_macros_enabled() {
- feature_gate::EXPLAIN_PROC_MACROS_IN_EXTERN
- } else {
- feature_gate::EXPLAIN_MACROS_IN_EXTERN
- };
-
- if attr.is_some() || !traits.is_empty() {
- if !self.cx.ecfg.macros_in_extern_enabled() {
- if let Some(ref attr) = attr {
- emit_feature_err(&self.cx.parse_sess, "macros_in_extern", attr.span,
- GateIssue::Language, explain);
- }
- }
-
+ if attr.is_some() || !traits.is_empty() {
let item = Annotatable::ForeignItem(P(foreign_item));
return self.collect_attr(attr, traits, item, AstFragmentKind::ForeignItems)
.make_foreign_items();
if let ast::ForeignItemKind::Macro(mac) = foreign_item.node {
self.check_attributes(&foreign_item.attrs);
-
- if !self.cx.ecfg.macros_in_extern_enabled() {
- emit_feature_err(&self.cx.parse_sess, "macros_in_extern", foreign_item.span,
- GateIssue::Language, explain);
- }
-
return self.collect_bang(mac, foreign_item.span, AstFragmentKind::ForeignItems)
.make_foreign_items();
}
}
let best_fail_msg = parse_failure_msg(best_fail_tok.expect("ran no matchers"));
- cx.span_err(best_fail_spot.substitute_dummy(sp), &best_fail_msg);
+ let mut err = cx.struct_span_err(best_fail_spot.substitute_dummy(sp), &best_fail_msg);
+
+ // Check whether there's a missing comma in this macro call, like `println!("{}" a);`
+ if let Some((arg, comma_span)) = arg.add_comma() {
+ for lhs in lhses { // try each arm's matchers
+ let lhs_tt = match *lhs {
+ quoted::TokenTree::Delimited(_, ref delim) => &delim.tts[..],
+ _ => cx.span_bug(sp, "malformed macro lhs")
+ };
+ match TokenTree::parse(cx, lhs_tt, arg.clone()) {
+ Success(_) => {
+ if comma_span == DUMMY_SP {
+ err.note("you might be missing a comma");
+ } else {
+ err.span_suggestion_short(
+ comma_span,
+ "missing comma here",
+ ",".to_string(),
+ );
+ }
+ }
+ _ => {}
+ }
+ }
+ }
+ err.emit();
cx.trace_macros_diag();
DummyResult::any(sp)
}
use self::AttributeType::*;
use self::AttributeGate::*;
+use rustc_data_structures::fx::FxHashMap;
use rustc_target::spec::abi::Abi;
use ast::{self, NodeId, PatKind, RangeEnd};
use attr;
use codemap::Spanned;
use edition::{ALL_EDITIONS, Edition};
use syntax_pos::{Span, DUMMY_SP};
-use errors::{DiagnosticBuilder, Handler, FatalError};
+use errors::{DiagnosticBuilder, Handler};
use visit::{self, FnKind, Visitor};
use parse::ParseSess;
use symbol::{keywords, Symbol};
/// A set of features to be used by later passes.
#[derive(Clone)]
pub struct Features {
- /// `#![feature]` attrs for stable language features, for error reporting
- pub declared_stable_lang_features: Vec<(Symbol, Span)>,
+ /// `#![feature]` attrs for language features, for error reporting
+ pub declared_lang_features: Vec<(Symbol, Span, Option<Symbol>)>,
/// `#![feature]` attrs for non-language (library) features
pub declared_lib_features: Vec<(Symbol, Span)>,
$(pub $feature: bool),+
impl Features {
pub fn new() -> Features {
Features {
- declared_stable_lang_features: Vec::new(),
+ declared_lang_features: Vec::new(),
declared_lib_features: Vec::new(),
$($feature: false),+
}
}
pub fn use_extern_macros(&self) -> bool {
- // The `decl_macro` and `tool_attributes` features imply `use_extern_macros`.
- self.use_extern_macros || self.decl_macro || self.tool_attributes
+ // A number of "advanced" macro features enable
+ // macro modularization (`use_extern_macros`) implicitly.
+ self.use_extern_macros || self.decl_macro ||
+ self.tool_attributes || self.custom_attribute ||
+ self.macros_in_extern || self.proc_macro_path_invoc ||
+ self.proc_macro_mod || self.proc_macro_expr ||
+ self.proc_macro_non_items || self.proc_macro_gen ||
+ self.stmt_expr_attributes
}
}
};
(active, linkage, "1.0.0", Some(29603), None),
(active, quote, "1.0.0", Some(29601), None),
-
// rustc internal
(active, rustc_diagnostic_macros, "1.0.0", None, None),
(active, rustc_const_unstable, "1.0.0", None, None),
// Allows let bindings and destructuring in `const fn` functions and constants.
(active, const_let, "1.22.1", Some(48821), None),
+ // Allows accessing fields of unions inside const fn
+ (active, const_fn_union, "1.27.0", Some(51909), None),
+
+ // Allows casting raw pointers to `usize` during const eval
+ (active, const_raw_ptr_to_usize_cast, "1.27.0", Some(51910), None),
+
+ // Allows dereferencing raw pointers during const eval
+ (active, const_raw_ptr_deref, "1.27.0", Some(51911), None),
+
+ // Allows comparing raw pointers during const eval
+ (active, const_compare_raw_pointers, "1.27.0", Some(53020), None),
+
// Allows using #[prelude_import] on glob `use` items.
//
// rustc internal
// `extern "x86-interrupt" fn()`
(active, abi_x86_interrupt, "1.17.0", Some(40180), None),
-
// Allows the `catch {...}` expression
- (active, catch_expr, "1.17.0", Some(31436), Some(Edition::Edition2018)),
+ (active, catch_expr, "1.17.0", Some(31436), None),
// Used to preserve symbols (see llvm.used)
(active, used, "1.18.0", Some(40289), None),
(active, crate_in_paths, "1.23.0", Some(45477), Some(Edition::Edition2018)),
// In-band lifetime bindings (e.g. `fn foo(x: &'a u8) -> &'a u8`)
- (active, in_band_lifetimes, "1.23.0", Some(44524), Some(Edition::Edition2018)),
+ (active, in_band_lifetimes, "1.23.0", Some(44524), None),
// generic associated types (RFC 1598)
(active, generic_associated_types, "1.23.0", Some(44265), None),
(active, alloc_error_handler, "1.29.0", Some(51540), None),
(active, abi_amdgpu_kernel, "1.29.0", Some(51575), None),
+
+ // impl<I:Iterator> Iterator for &mut Iterator
+ // impl Debug for Foo<'_>
+ (active, impl_header_lifetime_elision, "1.30.0", Some(15872), Some(Edition::Edition2018)),
);
declare_features! (
}
pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
- BUILTIN_ATTRIBUTES.iter().any(|&(builtin_name, _, _)| attr.check_name(builtin_name)) ||
+ BUILTIN_ATTRIBUTES.iter().any(|&(builtin_name, _, _)| attr.path == builtin_name) ||
attr.name().as_str().starts_with("rustc_")
}
cx.check_attribute(attr, true);
}
-pub fn find_lang_feature_accepted_version(feature: &str) -> Option<&'static str> {
- ACCEPTED_FEATURES.iter().find(|t| t.0 == feature).map(|t| t.1)
-}
-
fn find_lang_feature_issue(feature: &str) -> Option<u32> {
if let Some(info) = ACTIVE_FEATURES.iter().find(|t| t.0 == feature) {
let issue = info.2;
pub const EXPLAIN_MACRO_AT_MOST_ONCE_REP: &'static str =
"using the `?` macro Kleene operator for \"at most one\" repetition is unstable";
-pub const EXPLAIN_MACROS_IN_EXTERN: &'static str =
- "macro invocations in `extern {}` blocks are experimental.";
-
-// mention proc-macros when enabled
-pub const EXPLAIN_PROC_MACROS_IN_EXTERN: &'static str =
- "macro and proc-macro invocations in `extern {}` blocks are experimental.";
-
struct PostExpansionVisitor<'a> {
context: &'a Context<'a>,
}
}
let mut features = Features::new();
+ let mut edition_enabled_features = FxHashMap();
- let mut feature_checker = FeatureChecker::default();
-
- for &(.., f_edition, set) in ACTIVE_FEATURES.iter() {
+ for &(name, .., f_edition, set) in ACTIVE_FEATURES.iter() {
if let Some(f_edition) = f_edition {
if f_edition <= crate_edition {
set(&mut features, DUMMY_SP);
+ edition_enabled_features.insert(Symbol::intern(name), crate_edition);
}
}
}
continue
};
- if let Some((.., set)) = ACTIVE_FEATURES.iter().find(|f| name == f.0) {
- set(&mut features, mi.span);
- feature_checker.collect(&features, mi.span);
- continue
- }
-
- let removed = REMOVED_FEATURES.iter().find(|f| name == f.0);
- let stable_removed = STABLE_REMOVED_FEATURES.iter().find(|f| name == f.0);
- if let Some((.., reason)) = removed.or(stable_removed) {
- feature_removed(span_handler, mi.span, *reason);
- continue
- }
-
- if ACCEPTED_FEATURES.iter().any(|f| name == f.0) {
- features.declared_stable_lang_features.push((name, mi.span));
- continue
- }
-
if let Some(edition) = ALL_EDITIONS.iter().find(|e| name == e.feature_name()) {
if *edition <= crate_edition {
continue
}
- for &(.., f_edition, set) in ACTIVE_FEATURES.iter() {
+ for &(name, .., f_edition, set) in ACTIVE_FEATURES.iter() {
if let Some(f_edition) = f_edition {
- if *edition >= f_edition {
+ if f_edition <= *edition {
// FIXME(Manishearth) there is currently no way to set
// lib features by edition
set(&mut features, DUMMY_SP);
+ edition_enabled_features.insert(Symbol::intern(name), *edition);
}
}
}
continue
}
- features.declared_lib_features.push((name, mi.span));
- }
- }
-
- feature_checker.check(span_handler);
-
- features
-}
+ if let Some((.., set)) = ACTIVE_FEATURES.iter().find(|f| name == f.0) {
+ if let Some(edition) = edition_enabled_features.get(&name) {
+ struct_span_warn!(
+ span_handler,
+ mi.span,
+ E0705,
+ "the feature `{}` is included in the Rust {} edition",
+ name,
+ edition,
+ ).emit();
+ } else {
+ set(&mut features, mi.span);
+ features.declared_lang_features.push((name, mi.span, None));
+ }
+ continue
+ }
-/// A collector for mutually exclusive and interdependent features and their flag spans.
-#[derive(Default)]
-struct FeatureChecker {
- use_extern_macros: Option<Span>,
- custom_attribute: Option<Span>,
-}
+ let removed = REMOVED_FEATURES.iter().find(|f| name == f.0);
+ let stable_removed = STABLE_REMOVED_FEATURES.iter().find(|f| name == f.0);
+ if let Some((.., reason)) = removed.or(stable_removed) {
+ feature_removed(span_handler, mi.span, *reason);
+ continue
+ }
-impl FeatureChecker {
- // If this method turns out to be a hotspot due to branching,
- // the branching can be eliminated by modifying `set!()` to set these spans
- // only for the features that need to be checked for mutual exclusion.
- fn collect(&mut self, features: &Features, span: Span) {
- if features.use_extern_macros() {
- // If self.use_extern_macros is None, set to Some(span)
- self.use_extern_macros = self.use_extern_macros.or(Some(span));
- }
+ if let Some((_, since, ..)) = ACCEPTED_FEATURES.iter().find(|f| name == f.0) {
+ let since = Some(Symbol::intern(since));
+ features.declared_lang_features.push((name, mi.span, since));
+ continue
+ }
- if features.custom_attribute {
- self.custom_attribute = self.custom_attribute.or(Some(span));
+ features.declared_lib_features.push((name, mi.span));
}
}
- fn check(self, handler: &Handler) {
- if let (Some(pm_span), Some(ca_span)) = (self.use_extern_macros, self.custom_attribute) {
- handler.struct_span_err(pm_span, "Cannot use `#![feature(use_extern_macros)]` and \
- `#![feature(custom_attribute)] at the same time")
- .span_note(ca_span, "`#![feature(custom_attribute)]` declared here")
- .emit();
-
- FatalError.raise();
- }
- }
+ features
}
pub fn check_crate(krate: &ast::Crate,
html_root_url = "https://doc.rust-lang.org/nightly/",
test(attr(deny(warnings))))]
-#![feature(const_atomic_usize_new)]
#![feature(crate_visibility_modifier)]
#![feature(macro_at_most_once_rep)]
#![feature(rustc_attrs)]
BinOp(Minus) => true,
Ident(ident, false) if ident.name == keywords::True.name() => true,
Ident(ident, false) if ident.name == keywords::False.name() => true,
+ Interpolated(ref nt) => match nt.0 {
+ NtLiteral(..) => true,
+ _ => false,
+ },
_ => false,
}
}
let mut idents_iter = idents.iter().peekable();
while let Some(ident) = idents_iter.next() {
path_name.push_str(&ident.as_str());
- if let Some(_) = idents_iter.peek() {
+ if idents_iter.peek().is_some() {
path_name.push_str("::")
}
}
kind: TokenStreamKind,
}
+impl TokenStream {
+ /// Given a `TokenStream` with a `Stream` of only two arguments, return a new `TokenStream`
+ /// separating the two arguments with a comma for diagnostic suggestions.
+ pub(crate) fn add_comma(&self) -> Option<(TokenStream, Span)> {
+ // Used to suggest if a user writes `println!("{}" a);`
+ if let TokenStreamKind::Stream(ref slice) = self.kind {
+ if slice.len() == 2 {
+ let comma_span = match slice[0] {
+ TokenStream { kind: TokenStreamKind::Tree(TokenTree::Token(sp, _)) } |
+ TokenStream { kind: TokenStreamKind::Tree(TokenTree::Delimited(sp, _)) } => {
+ sp.shrink_to_hi()
+ }
+ _ => DUMMY_SP,
+ };
+ let comma = TokenStream {
+ kind: TokenStreamKind::Tree(TokenTree::Token(comma_span, token::Comma)),
+ };
+ let slice = RcSlice::new(vec![slice[0].clone(), comma, slice[1].clone()]);
+ return Some((TokenStream { kind: TokenStreamKind::Stream(slice) }, comma_span));
+ }
+ }
+ None
+ }
+}
+
#[derive(Clone, Debug)]
enum TokenStreamKind {
Empty,
}
};
- if let Some(_) = exprs.next() {
+ if exprs.next().is_some() {
cx.span_err(sp, "env! takes 1 or 2 arguments");
return DummyResult::expr(sp);
}
let mut named = false;
while p.token != token::Eof {
if !p.eat(&token::Comma) {
- ecx.span_err(sp, "expected token: `,`");
+ ecx.span_err(p.span, "expected token: `,`");
return None;
}
if p.token == token::Eof {
# Certain parts of libc are conditionally compiled differently than when used
# outside rustc. See https://github.com/rust-lang/libc/search?l=Rust&q=stdbuild&type=&utf8=%E2%9C%93.
stdbuild = []
-default = ["stdbuild"]
+default = ["stdbuild", "align"]
+align = []
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/DiagnosticPrinter.h"
+#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Object/Archive.h"
#include "llvm/Object/ObjectFile.h"
return wrap(unwrap(M)->getOrInsertGlobal(Name, unwrap(Ty)));
}
+extern "C" LLVMValueRef
+LLVMRustInsertPrivateGlobal(LLVMModuleRef M, LLVMTypeRef Ty) {
+ return wrap(new GlobalVariable(*unwrap(M),
+ unwrap(Ty),
+ false,
+ GlobalValue::PrivateLinkage,
+ nullptr));
+}
+
extern "C" LLVMTypeRef LLVMRustMetadataTypeInContext(LLVMContextRef C) {
return wrap(Type::getMetadataTy(*unwrap(C)));
}
// CHECK: @STATIC = {{.*}}, align 4
// This checks the constants from inline_enum_const
-// CHECK: @byte_str.{{[0-9]+}} = {{.*}}, align 2
+// CHECK: @{{[0-9]+}} = {{.*}}, align 2
// This checks the constants from {low,high}_align_const, they share the same
// constant, but the alignment differs, so the higher one should be used
-// CHECK: [[LOW_HIGH:@byte_str.[0-9]+]] = {{.*}}, align 4
+// CHECK: [[LOW_HIGH:@[0-9]+]] = {{.*}}, align 4
#[derive(Copy, Clone)]
include!("aux_mod.rs");
// Here we check that the expansion of the file!() macro is mapped.
-// CHECK: @byte_str.1 = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }>, align 1
+// CHECK: @0 = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }>, align 1
pub static FILE_PATH: &'static str = file!();
fn main() {
#![feature(staged_api)]
-#![stable(feature = "unit_test", since = "0.0.0")]
+#![stable(feature = "unit_test", since = "1.0.0")]
-#[stable(feature = "unit_test", since = "0.0.0")]
+#[stable(feature = "unit_test", since = "1.0.0")]
pub use m::{Record, Trait, Tuple};
mod m {
#[derive(Default)]
- #[stable(feature = "unit_test", since = "0.0.0")]
+ #[stable(feature = "unit_test", since = "1.0.0")]
pub struct Record {
- #[stable(feature = "unit_test", since = "0.0.0")]
+ #[stable(feature = "unit_test", since = "1.0.0")]
pub a_stable_pub: i32,
#[unstable(feature = "unstable_declared", issue = "38412")]
pub a_unstable_declared_pub: i32,
pub(crate) b_crate: i32,
#[unstable(feature = "unstable_declared", issue = "38412")] // SILLY
pub(in m) c_mod: i32,
- #[stable(feature = "unit_test", since = "0.0.0")] // SILLY
+ #[stable(feature = "unit_test", since = "1.0.0")] // SILLY
d_priv: i32
}
#[derive(Default)]
#[stable(feature = "unit_test", since = "1.0.0")]
pub struct Tuple(
- #[stable(feature = "unit_test", since = "0.0.0")]
+ #[stable(feature = "unit_test", since = "1.0.0")]
pub i32,
#[unstable(feature = "unstable_declared", issue = "38412")]
pub i32,
}
- #[stable(feature = "unit_test", since = "0.0.0")]
+ #[stable(feature = "unit_test", since = "1.0.0")]
pub trait Trait {
- #[stable(feature = "unit_test", since = "0.0.0")]
+ #[stable(feature = "unit_test", since = "1.0.0")]
type Type;
- #[stable(feature = "unit_test", since = "0.0.0")]
+ #[stable(feature = "unit_test", since = "1.0.0")]
fn stable_trait_method(&self) -> Self::Type;
#[unstable(feature = "unstable_undeclared", issue = "38412")]
fn unstable_undeclared_trait_method(&self) -> Self::Type;
fn unstable_declared_trait_method(&self) -> Self::Type;
}
- #[stable(feature = "unit_test", since = "0.0.0")]
+ #[stable(feature = "unit_test", since = "1.0.0")]
impl Trait for Record {
type Type = i32;
fn stable_trait_method(&self) -> i32 { self.d_priv }
fn unstable_declared_trait_method(&self) -> i32 { self.d_priv }
}
- #[stable(feature = "unit_test", since = "0.0.0")]
+ #[stable(feature = "unit_test", since = "1.0.0")]
impl Trait for Tuple {
type Type = i32;
fn stable_trait_method(&self) -> i32 { self.3 }
pub fn unstable_undeclared(&self) -> i32 { self.d_priv }
#[unstable(feature = "unstable_declared", issue = "38412")]
pub fn unstable_declared(&self) -> i32 { self.d_priv }
- #[stable(feature = "unit_test", since = "0.0.0")]
+ #[stable(feature = "unit_test", since = "1.0.0")]
pub fn stable(&self) -> i32 { self.d_priv }
#[unstable(feature = "unstable_undeclared", issue = "38412")] // SILLY
pub(crate) fn pub_crate(&self) -> i32 { self.d_priv }
#[unstable(feature = "unstable_declared", issue = "38412")] // SILLY
pub(in m) fn pub_mod(&self) -> i32 { self.d_priv }
- #[stable(feature = "unit_test", since = "0.0.0")] // SILLY
+ #[stable(feature = "unit_test", since = "1.0.0")] // SILLY
fn private(&self) -> i32 { self.d_priv }
}
pub fn unstable_undeclared(&self) -> i32 { self.0 }
#[unstable(feature = "unstable_declared", issue = "38412")]
pub fn unstable_declared(&self) -> i32 { self.0 }
- #[stable(feature = "unit_test", since = "0.0.0")]
+ #[stable(feature = "unit_test", since = "1.0.0")]
pub fn stable(&self) -> i32 { self.0 }
pub(crate) fn pub_crate(&self) -> i32 { self.0 }
//! Attributes producing expressions in invalid locations
-#![feature(use_extern_macros, stmt_expr_attributes, proc_macro_expr)]
+#![feature(stmt_expr_attributes, proc_macro_expr)]
extern crate attr_stmt_expr;
use attr_stmt_expr::{duplicate, no_output};
// aux-build:attr-stmt-expr.rs
// ignore-stage1
-#![feature(use_extern_macros, proc_macro_expr)]
+#![feature(proc_macro_expr)]
extern crate attr_stmt_expr;
use attr_stmt_expr::{expect_let, expect_print_stmt, expect_expr, expect_print_expr};
#![feature(use_extern_macros)]
#![emit_unchanged]
-//~^ ERROR: cannot find attribute macro `emit_unchanged` in this scope
+//~^ ERROR attribute `emit_unchanged` is currently unknown to the compiler
extern crate issue_41211;
use issue_41211::emit_unchanged;
// aux-build:issue_50493.rs
// ignore-stage1
-#![feature(proc_macro)]
-
#[macro_use]
extern crate issue_50493;
// aux-build:bang_proc_macro2.rs
// ignore-stage1
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
#![allow(unused_macros)]
extern crate bang_proc_macro2;
#[link(name = "rust_test_helpers", kind = "static")]
extern {
#[no_output]
- //~^ ERROR macro and proc-macro invocations in `extern {}` blocks are experimental.
+ //~^ ERROR macro invocations in `extern {}` blocks are experimental
fn some_definitely_unknown_symbol_which_should_be_removed();
#[nop_attr]
- //~^ ERROR macro and proc-macro invocations in `extern {}` blocks are experimental.
+ //~^ ERROR macro invocations in `extern {}` blocks are experimental
fn rust_get_test_int() -> isize;
emit_input!(fn rust_dbg_extern_identity_u32(arg: u32) -> u32;);
- //~^ ERROR macro and proc-macro invocations in `extern {}` blocks are experimental.
+ //~^ ERROR macro invocations in `extern {}` blocks are experimental
}
+++ /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:attr_proc_macro.rs
-// ignore-tidy-linelength
-
-#![feature(use_extern_macros, custom_attribute)]
-//~^ ERROR Cannot use `#![feature(use_extern_macros)]` and `#![feature(custom_attribute)] at the same time
-
-extern crate attr_proc_macro;
-use attr_proc_macro::attr_proc_macro;
-
-#[attr_proc_macro]
-fn foo() {}
-
-fn main() {
- foo();
-}
// gate-test-proc_macro_mod
// gate-test-proc_macro_gen
-#![feature(use_extern_macros, stmt_expr_attributes)]
+#![feature(stmt_expr_attributes)]
extern crate proc_macro_gates as foo;
// aux-build:proc-macro-gates.rs
-#![feature(use_extern_macros, stmt_expr_attributes)]
+#![feature(stmt_expr_attributes)]
extern crate proc_macro_gates as foo;
// except according to those terms.
#![crate_name="inherited_stability"]
#![crate_type = "lib"]
-#![unstable(feature = "test_feature", issue = "0")]
+#![unstable(feature = "unstable_test_feature", issue = "0")]
#![feature(staged_api)]
pub fn unstable() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub mod stable_mod {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn unstable() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub fn stable() {}
}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub mod unstable_mod {
- #[stable(feature = "test_feature", since = "1.0.0")]
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Stable {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
fn unstable(&self);
#[stable(feature = "rust1", since = "1.0.0")]
#![crate_name="lint_output_format"]
#![crate_type = "lib"]
#![feature(staged_api)]
-#![unstable(feature = "test_feature", issue = "0")]
+#![unstable(feature = "unstable_test_feature", issue = "0")]
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn foo() -> usize {
20
}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn bar() -> usize {
40
}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn baz() -> usize {
30
}
#![feature(associated_type_defaults)]
#![stable(feature = "lint_stability", since = "1.0.0")]
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated() {}
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated_text() {}
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "99.99.99", reason = "text")]
pub fn deprecated_future() {}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated_unstable() {}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated_unstable_text() {}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn unstable() {}
-#[unstable(feature = "test_feature", reason = "text", issue = "0")]
+#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
pub fn unstable_text() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub struct MethodTester;
impl MethodTester {
- #[stable(feature = "test_feature", since = "1.0.0")]
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn method_deprecated(&self) {}
- #[stable(feature = "test_feature", since = "1.0.0")]
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn method_deprecated_text(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn method_deprecated_unstable(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn method_deprecated_unstable_text(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn method_unstable(&self) {}
- #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
pub fn method_unstable_text(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
pub fn method_stable_text(&self) {}
}
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
pub trait Trait {
- #[stable(feature = "test_feature", since = "1.0.0")]
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn trait_deprecated(&self) {}
- #[stable(feature = "test_feature", since = "1.0.0")]
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn trait_deprecated_text(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn trait_deprecated_unstable(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn trait_deprecated_unstable_text(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
fn trait_unstable(&self) {}
- #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
fn trait_unstable_text(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
fn trait_stable_text(&self) {}
}
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
pub trait TraitWithAssociatedTypes {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
type TypeUnstable = u8;
- #[stable(feature = "test_feature", since = "1.0.0")]
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
type TypeDeprecated = u8;
}
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
impl Trait for MethodTester {}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub trait UnstableTrait { fn dummy(&self) { } }
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub trait DeprecatedTrait {
- #[stable(feature = "test_feature", since = "1.0.0")] fn dummy(&self) { }
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] fn dummy(&self) { }
}
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedUnstableStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
}
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub enum UnstableEnum {}
#[stable(feature = "rust1", since = "1.0.0")]
pub enum StableEnum {}
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedUnitStruct;
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedUnstableUnitStruct;
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableUnitStruct;
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableUnitStruct;
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
pub enum Enum {
- #[stable(feature = "test_feature", since = "1.0.0")]
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
DeprecatedVariant,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
DeprecatedUnstableVariant,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
UnstableVariant,
#[stable(feature = "rust1", since = "1.0.0")]
StableVariant,
}
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[macro_export]
macro_rules! macro_test {
() => (deprecated());
}
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[macro_export]
macro_rules! macro_test_arg {
($func:expr) => ($func);
}
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[macro_export]
macro_rules! macro_test_arg_nested {
($func:ident) => (macro_test_arg!($func()));
pub struct Stable {
#[stable(feature = "rust1", since = "1.0.0")]
pub inherit: u8, // it's a lie (stable doesn't inherit)
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub override1: u8,
#[rustc_deprecated(since = "1.0.0", reason = "text")]
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub override2: u8,
}
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Stable2(#[stable(feature = "rust1", since = "1.0.0")] pub u8,
- #[unstable(feature = "test_feature", issue = "0")] pub u8,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")] pub u8,
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")] pub u8);
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct Unstable {
pub inherit: u8,
#[stable(feature = "rust1", since = "1.0.0")]
pub override1: u8,
#[rustc_deprecated(since = "1.0.0", reason = "text")]
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub override2: u8,
}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct Unstable2(pub u8,
#[stable(feature = "rust1", since = "1.0.0")] pub u8,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")] pub u8);
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct Deprecated {
pub inherit: u8,
#[stable(feature = "rust1", since = "1.0.0")]
pub override1: u8,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub override2: u8,
}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct Deprecated2(pub u8,
#[stable(feature = "rust1", since = "1.0.0")] pub u8,
- #[unstable(feature = "test_feature", issue = "0")] pub u8);
+ #[unstable(feature = "unstable_test_feature", issue = "0")] pub u8);
// except according to those terms.
#![feature(staged_api)]
-#![stable(feature = "foo", since = "1.2.0")]
+#![stable(feature = "stable_test_feature", since = "1.2.0")]
-#[unstable(feature = "foo", issue = "1")]
+#[unstable(feature = "unstable_test_feature", issue = "1")]
pub fn unstable() {}
-#[unstable(feature = "foo", reason = "message", issue = "2")]
+#[unstable(feature = "unstable_test_feature", reason = "message", issue = "2")]
pub fn unstable_msg() {}
// compile-flags:--cfg foo
-#![cfg_attr(foo, unstable(feature = "test_feature", issue = "0"))]
+#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "0"))]
#![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))]
#![feature(staged_api)]
// except according to those terms.
#![feature(staged_api)]
-#![stable(feature = "unit_test", since = "0.0.0")]
+#![stable(feature = "unit_test", since = "1.0.0")]
#[unstable(feature = "unstable_macros", issue = "0")]
#[macro_export]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// gate-test-const_raw_ptr_to_usize_cast
+
fn main() {
- const X: u32 = main as u32; //~ ERROR E0018
+ const X: u32 = main as u32; //~ ERROR casting pointers to integers in constants is unstable
const Y: u32 = 0;
- const Z: u32 = &Y as *const u32 as u32; //~ ERROR E0018
+ const Z: u32 = &Y as *const u32 as u32; //~ ERROR is unstable
}
#![feature(staged_api)]
-#![stable(feature = "test_feature", since = "1.0.0")]
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
#[deprecated]
fn main() { } //~ERROR `#[deprecated]` cannot be used in staged api
// aux-build:stability_cfg2.rs
-#![feature(test_feature)]
+#![feature(unstable_test_feature)]
#![deny(non_snake_case)] // To trigger a hard error
// Shouldn't generate a warning about unstable features
extern crate lint_stability;
-use lint_stability::{unstable, deprecated}; //~ ERROR use of unstable library feature 'test_feature'
+use lint_stability::{unstable, deprecated};
+//~^ ERROR use of unstable library feature 'unstable_test_feature'
fn main() {
}
extern crate lint_stability;
-use lint_stability::UnstableEnum::{}; //~ ERROR use of unstable library feature 'test_feature'
+use lint_stability::UnstableEnum::{};
+//~^ ERROR use of unstable library feature 'unstable_test_feature'
use lint_stability::StableEnum::{}; // OK
fn main() {}
#![allow(renamed_and_removed_lints)]
-#[deny(unknown_features)]
+#[deny(single_use_lifetime)]
#[deny(unused)]
fn main() { let unused = (); } //~ ERROR unused
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// compile-flags:-D unknown_features
+// compile-flags:-D bare_trait_object
-// error-pattern:lint `unknown_features` has been renamed to `unused_features`
-// error-pattern:requested on the command line with `-D unknown_features`
+// error-pattern:lint `bare_trait_object` has been renamed to `bare_trait_objects`
+// error-pattern:requested on the command line with `-D bare_trait_object`
// error-pattern:unused
#[deny(unused)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#[deny(unknown_features)] //~ WARN lint `unknown_features` has been renamed to `unused_features`
+#[deny(bare_trait_object)]
+//~^ WARN lint `bare_trait_object` has been renamed to `bare_trait_objects`
#[deny(unused)]
fn main() { let unused = (); } //~ ERROR unused
<Foo>::trait_unstable(&foo); //~ ERROR use of unstable library feature
foo.method_unstable_text();
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
Foo::method_unstable_text(&foo);
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
<Foo>::method_unstable_text(&foo);
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
foo.trait_unstable_text();
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
<Foo>::trait_unstable_text(&foo);
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
stable();
foo.method_stable();
foo.trait_unstable(); //~ ERROR use of unstable library feature
<Foo>::trait_unstable(&foo); //~ ERROR use of unstable library feature
foo.trait_unstable_text();
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
<Foo>::trait_unstable_text(&foo);
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
foo.trait_stable();
Trait::trait_stable(&foo);
<Foo>::trait_stable(&foo);
//~^ ERROR use of unstable library feature
foo.trait_unstable(); //~ ERROR use of unstable library feature
foo.trait_unstable_text();
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
foo.trait_stable();
}
}
mod this_crate {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated() {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated_text() {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn unstable() {}
- #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
pub fn unstable_text() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub struct MethodTester;
impl MethodTester {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn method_deprecated(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn method_deprecated_text(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn method_unstable(&self) {}
- #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
pub fn method_unstable_text(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
}
pub trait Trait {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn trait_deprecated(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn trait_deprecated_text(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
fn trait_unstable(&self) {}
- #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
fn trait_unstable_text(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
impl Trait for MethodTester {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
}
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedUnitStruct;
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableUnitStruct;
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableUnitStruct;
pub enum Enum {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
DeprecatedVariant,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
UnstableVariant,
#[stable(feature = "rust1", since = "1.0.0")]
StableVariant,
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedTupleStruct(isize);
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableTupleStruct(isize);
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableTupleStruct(isize);
foo.trait_stable();
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn test_fn_body() {
fn fn_in_body() {}
}
impl MethodTester {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn test_method_body(&self) {
fn fn_in_body() {}
}
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub trait DeprecatedTrait {
fn dummy(&self) { }
#![warn(deprecated)]
#![allow(dead_code, unused_extern_crates)]
-#![feature(staged_api, test_feature, rustc_attrs)]
+#![feature(staged_api, unstable_test_feature, rustc_attrs)]
#![stable(feature = "rust1", since = "1.0.0")]
}
mod this_crate {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated() {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated_text() {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn unstable() {}
- #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
pub fn unstable_text() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub struct MethodTester;
impl MethodTester {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn method_deprecated(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn method_deprecated_text(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn method_unstable(&self) {}
- #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
pub fn method_unstable_text(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
}
pub trait Trait {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn trait_deprecated(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn trait_deprecated_text(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
fn trait_unstable(&self) {}
- #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
fn trait_unstable_text(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
impl Trait for MethodTester {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
}
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedUnitStruct;
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableUnitStruct;
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableUnitStruct;
pub enum Enum {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
DeprecatedVariant,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
UnstableVariant,
#[stable(feature = "rust1", since = "1.0.0")]
StableVariant,
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedTupleStruct(isize);
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableTupleStruct(isize);
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableTupleStruct(isize);
foo.trait_stable();
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn test_fn_body() {
fn fn_in_body() {}
}
impl MethodTester {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn test_method_body(&self) {
fn fn_in_body() {}
}
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub trait DeprecatedTrait {
fn dummy(&self) { }
// except according to those terms.
// aux-build:lint_stability_fields.rs
+
#![deny(deprecated)]
#![allow(dead_code)]
-#![feature(staged_api, test_feature)]
+#![feature(staged_api, unstable_test_feature)]
#![stable(feature = "rust1", since = "1.0.0")]
#[stable(feature = "rust1", since = "1.0.0")]
struct Stable {
inherit: u8,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
override1: u8,
#[rustc_deprecated(since = "1.0.0", reason = "text")]
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
override2: u8,
}
#[stable(feature = "rust1", since = "1.0.0")]
struct Stable2(u8,
#[stable(feature = "rust1", since = "1.0.0")] u8,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
struct Unstable {
inherit: u8,
#[stable(feature = "rust1", since = "1.0.0")]
override1: u8,
#[rustc_deprecated(since = "1.0.0", reason = "text")]
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
override2: u8,
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
struct Unstable2(u8,
#[stable(feature = "rust1", since = "1.0.0")] u8,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
struct Deprecated {
inherit: u8,
#[stable(feature = "rust1", since = "1.0.0")]
override1: u8,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
override2: u8,
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
struct Deprecated2(u8,
#[stable(feature = "rust1", since = "1.0.0")] u8,
- #[unstable(feature = "test_feature", issue = "0")] u8);
+ #[unstable(feature = "unstable_test_feature", issue = "0")] u8);
pub fn foo() {
let x = Stable {
#[stable(feature = "rust1", since = "1.0.0")]
struct Stable {
inherit: u8,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
override1: u8,
#[rustc_deprecated(since = "1.0.0", reason = "text")]
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
override2: u8,
}
#[stable(feature = "rust1", since = "1.0.0")]
struct Stable2(u8,
#[stable(feature = "rust1", since = "1.0.0")] u8,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
struct Unstable {
inherit: u8,
#[stable(feature = "rust1", since = "1.0.0")]
override1: u8,
#[rustc_deprecated(since = "1.0.0", reason = "text")]
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
override2: u8,
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
struct Unstable2(u8,
#[stable(feature = "rust1", since = "1.0.0")] u8,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
struct Deprecated {
inherit: u8,
#[stable(feature = "rust1", since = "1.0.0")]
override1: u8,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
override2: u8,
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
struct Deprecated2(u8,
#[stable(feature = "rust1", since = "1.0.0")] u8,
- #[unstable(feature = "test_feature", issue = "0")] u8);
+ #[unstable(feature = "unstable_test_feature", issue = "0")] u8);
pub fn foo() {
let x = Stable {
<Foo as Trait>::trait_unstable(&foo); //~ ERROR use of unstable library feature
unstable_text();
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
Trait::trait_unstable_text(&foo);
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
<Foo as Trait>::trait_unstable_text(&foo);
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
stable();
foo.method_stable();
Trait::trait_unstable(&foo); //~ ERROR use of unstable library feature
<Foo as Trait>::trait_unstable(&foo); //~ ERROR use of unstable library feature
Trait::trait_unstable_text(&foo);
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
<Foo as Trait>::trait_unstable_text(&foo);
- //~^ ERROR use of unstable library feature 'test_feature': text
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': text
foo.trait_stable();
Trait::trait_stable(&foo);
<Foo>::trait_stable(&foo);
}
mod this_crate {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated() {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated_text() {}
#[rustc_deprecated(since = "99.99.99", reason = "text")]
pub fn deprecated_future() {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn unstable() {}
- #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
pub fn unstable_text() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub struct MethodTester;
impl MethodTester {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn method_deprecated(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn method_deprecated_text(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn method_unstable(&self) {}
- #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
pub fn method_unstable_text(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
}
pub trait Trait {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn trait_deprecated(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn trait_deprecated_text(&self) {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
fn trait_unstable(&self) {}
- #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
fn trait_unstable_text(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
impl Trait for MethodTester {}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
}
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableStruct {
- #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedUnitStruct;
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableUnitStruct;
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableUnitStruct;
pub enum Enum {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
DeprecatedVariant,
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
UnstableVariant,
#[stable(feature = "rust1", since = "1.0.0")]
StableVariant,
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub struct DeprecatedTupleStruct(isize);
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
pub struct UnstableTupleStruct(isize);
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableTupleStruct(isize);
foo.trait_stable();
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn test_fn_body() {
fn fn_in_body() {}
}
impl MethodTester {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn test_method_body(&self) {
fn fn_in_body() {}
}
}
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub trait DeprecatedTrait {
fn dummy(&self) { }
// Tests the default for the unused_features lint
+#![allow(stable_features)]
// FIXME(#44232) we should warn that this isn't used.
-#![feature(this_is_not_a_feature)]
+#![feature(rust1)]
#![feature(rustc_attrs)]
#![warn(unused_features)]
+#![allow(stable_features)]
// FIXME(#44232) we should warn that this isn't used.
-#![feature(this_is_not_a_feature)]
+#![feature(rust1)]
#![feature(rustc_attrs)]
// gate-test-use_extern_macros
-#![feature(proc_macro_path_invoc)]
-
fn main() {
globnar::brotz!(); //~ ERROR non-ident macro paths are experimental
- #[derive(foo::Bar)] struct T; //~ ERROR non-ident macro paths are experimental
- ::foo!(); //~ ERROR non-ident macro paths are experimental
}
#[link(name = "rust_test_helpers", kind = "static")]
extern {
returns_isize!(rust_get_test_int);
- //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+ //~^ ERROR macro invocations in `extern {}` blocks are experimental
takes_u32_returns_u32!(rust_dbg_extern_identity_u32);
- //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+ //~^ ERROR macro invocations in `extern {}` blocks are experimental
emits_nothing!();
- //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+ //~^ ERROR macro invocations in `extern {}` blocks are experimental
}
#![crate_type="lib"]
#![feature(staged_api)]
-#![stable(feature = "test_feature", since = "1.0.0")]
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
pub fn unmarked() {
//~^ ERROR This node does not have a stability attribute
()
}
-#[unstable(feature = "foo", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub mod foo {
// #[unstable] is inherited
pub fn unmarked() {}
}
-#[stable(feature = "bar", since="1.0.0")]
+#[stable(feature = "stable_test_feature", since="1.0.0")]
pub mod bar {
// #[stable] is not inherited
pub fn unmarked() {}
fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
foo(x, y)
- //~^ ERROR lifetime mismatch [E0623]
+ //~^ ERROR unsatisfied lifetime constraints
//~| WARNING not reporting region error due to nll
}
fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) {
Foo { x, y };
- //~^ ERROR lifetime mismatch [E0623]
+ //~^ ERROR unsatisfied lifetime constraints
//~| WARNING not reporting region error due to nll
}
// edition:2018
-#![feature(extern_absolute_paths)]
-
use xcrate::S; //~ ERROR can't find crate for `xcrate`
fn main() {}
// edition:2018
-#![feature(extern_absolute_paths)]
-
fn main() {
let s = ::xcrate::S; //~ ERROR can't find crate for `xcrate`
}
// edition:2018
-#![feature(extern_absolute_paths)]
-
use ycrate; //~ ERROR can't find crate for `ycrate`
fn main() {}
// aux-build:xcrate.rs
// edition:2018
-#![feature(crate_in_paths)]
-#![feature(extern_absolute_paths)]
-
use crate; //~ ERROR unresolved import `crate`
//~^ NOTE crate root imports need to be explicitly named: `use crate as name;`
use *; //~ ERROR unresolved import `*`
// except according to those terms.
// aux-build:stability_attribute_issue.rs
+// ignore-tidy-linelength
#![deny(deprecated)]
use stability_attribute_issue::*;
fn main() {
- unstable(); //~ ERROR use of unstable library feature 'foo' (see issue #1)
- unstable_msg(); //~ ERROR use of unstable library feature 'foo': message (see issue #2)
+ unstable();
+ //~^ ERROR use of unstable library feature 'unstable_test_feature' (see issue #1)
+ unstable_msg();
+ //~^ ERROR use of unstable library feature 'unstable_test_feature': message (see issue #2)
}
#![feature(staged_api)]
-#![stable(feature = "test_feature", since = "1.0.0")]
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
#[stable(feature = "a", feature = "b", since = "1.0.0")] //~ ERROR multiple 'feature' items
fn f1() { }
#![feature(staged_api)]
-#![stable(feature = "test_feature", since = "1.0.0")]
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
#[macro_export]
macro_rules! mac { //~ ERROR This node does not have a stability attribute
#![stable(feature = "rust1", since = "1.0.0")]
mod bogus_attribute_types_1 {
- #[stable(feature = "a", since = "a", reason)] //~ ERROR unknown meta item 'reason' [E0541]
+ #[stable(feature = "a", since = "b", reason)] //~ ERROR unknown meta item 'reason' [E0541]
fn f1() { }
#[stable(feature = "a", since)] //~ ERROR incorrect meta item [E0539]
#[unstable] //~ ERROR incorrect stability attribute type [E0548]
fn f1() { }
- #[unstable = "a"] //~ ERROR incorrect stability attribute type [E0548]
+ #[unstable = "b"] //~ ERROR incorrect stability attribute type [E0548]
fn f2() { }
#[stable] //~ ERROR incorrect stability attribute type [E0548]
#[unstable(issue = "0")] //~ ERROR missing 'feature' [E0546]
fn f1() { }
- #[unstable(feature = "a")] //~ ERROR missing 'issue' [E0547]
+ #[unstable(feature = "b")] //~ ERROR missing 'issue' [E0547]
fn f2() { }
#[stable(since = "a")] //~ ERROR missing 'feature' [E0546]
fn f2() { }
}
-#[unstable(feature = "a", issue = "0")]
+#[unstable(feature = "b", issue = "0")]
#[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544]
fn multiple1() { }
-#[unstable(feature = "a", issue = "0")]
-#[unstable(feature = "a", issue = "0")] //~ ERROR multiple stability levels [E0544]
+#[unstable(feature = "b", issue = "0")]
+#[unstable(feature = "b", issue = "0")] //~ ERROR multiple stability levels [E0544]
fn multiple2() { }
#[stable(feature = "a", since = "b")]
#[stable(feature = "a", since = "b")]
#[rustc_deprecated(since = "b", reason = "text")]
#[rustc_deprecated(since = "b", reason = "text")]
-#[rustc_const_unstable(feature = "a")]
-#[rustc_const_unstable(feature = "b")]
+#[rustc_const_unstable(feature = "c")]
+#[rustc_const_unstable(feature = "d")]
pub const fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes [E0540]
//~^ ERROR Invalid stability or deprecation version found
//~| ERROR multiple rustc_const_unstable attributes
#![deny(stable_features)]
-#![feature(test_accepted_feature)] //~ ERROR this feature has been stable since 1.0.0
+#![feature(test_accepted_feature)]
+//~^ ERROR the feature `test_accepted_feature` has been stable since 1.0.0
-// FIXME(#44232) we should error that this isn't used.
#![feature(rust1)]
+//~^ ERROR the feature `rust1` has been stable since 1.0.0
fn main() {
let _foo: Vec<()> = Vec::new();
#[attr]
fn a() {}
- #[attr]
+ #[attr] //~ ERROR attributes on expressions are experimental
{
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(use_extern_macros, proc_macro_path_invoc)]
+#![feature(proc_macro_path_invoc)]
#[foo::bar] //~ ERROR failed to resolve. Use of undeclared type or module `foo`
fn main() {}
#![allow(dead_code, unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
#![omit_gdb_pretty_printer_section]
-#![feature(static_mutex)]
// This test makes sure that the compiler doesn't crash when trying to assign
// debug locations to const-expressions.
#[align = 8]
fn f() { }
- #[vec(1, 2, 3)]
+ #[vector(1, 2, 3)]
fn g() { }
}
// error-pattern:meep
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn f(_a: isize, _b: isize, _c: Box<isize>) {
// error-pattern:panicked at 'Box<Any>'
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn main() {
// error-pattern:greetings from the panic handler
-#![feature(panic_handler)]
-
use std::panic;
fn main() {
// error-pattern:thread 'main' panicked at 'foobar'
-#![feature(panic_handler)]
-
use std::panic;
fn main() {
// error-pattern:thread 'main' panicked at 'foobar'
-#![feature(panic_handler)]
-
use std::panic;
fn main() {
#![crate_type = "lib"]
#![feature(staged_api)]
-#![unstable(feature = "test_feature", issue = "0")]
+#![unstable(feature = "unstable_test_feature", issue = "0")]
-pub fn baz() { }
+pub fn baz() {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(test_feature)]
+#![feature(unstable_test_feature)]
extern crate bar;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(libc, exit_status)]
+#![feature(libc)]
extern crate libc;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(extern_absolute_paths)]
-
use krate2::hello;
fn main() {
+++ /dev/null
--include ../tools.mk
-
-# check that the compile generated symbols for strings, binaries,
-# vtables, etc. have semisane names (e.g. `str.1234`); it's relatively
-# easy to accidentally modify the compiler internals to make them
-# become things like `str"str"(1234)`.
-
-OUT=$(TMPDIR)/lib.s
-
-all:
- $(RUSTC) lib.rs --emit=asm --crate-type=staticlib
- # just check for symbol declarations with the names we're expecting.
- $(CGREP) -e 'str\.[0-9]+:' 'byte_str\.[0-9]+:' 'vtable\.[0-9]+' < $(OUT)
+++ /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.
-
-pub static X: &'static str = "foobarbaz";
-pub static Y: &'static [u8] = include_bytes!("lib.rs");
-
-trait Foo { fn dummy(&self) { } }
-impl Foo for usize {}
-
-#[no_mangle]
-pub extern "C" fn dummy() {
- // force the vtable to be created
- let _x = &1usize as &Foo;
-}
// except according to those terms.
#![crate_type = "cdylib"]
-#![feature(wasm_custom_section)]
#![deny(warnings)]
extern crate foo;
// except according to those terms.
#![crate_type = "rlib"]
-#![feature(wasm_custom_section)]
#![deny(warnings)]
#[link_section = "foo"]
--- /dev/null
+-include ../../run-make-fulldeps/tools.mk
+
+ifeq ($(TARGET),wasm32-unknown-unknown)
+all:
+ $(RUSTC) foo.rs --target wasm32-unknown-unknown
+ $(NODE) verify-exported-symbols.js $(TMPDIR)/foo.wasm
+ $(RUSTC) foo.rs --target wasm32-unknown-unknown -O
+ $(NODE) verify-exported-symbols.js $(TMPDIR)/foo.wasm
+ $(RUSTC) bar.rs --target wasm32-unknown-unknown
+ $(NODE) verify-exported-symbols.js $(TMPDIR)/bar.wasm
+ $(RUSTC) bar.rs --target wasm32-unknown-unknown -O
+ $(NODE) verify-exported-symbols.js $(TMPDIR)/bar.wasm
+else
+all:
+endif
+
--- /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(panic_implementation, alloc_error_handler)]
+#![crate_type = "cdylib"]
+#![no_std]
+
+use core::alloc::*;
+
+struct B;
+
+unsafe impl GlobalAlloc for B {
+ unsafe fn alloc(&self, x: Layout) -> *mut u8 {
+ 1 as *mut u8
+ }
+
+ unsafe fn dealloc(&self, ptr: *mut u8, x: Layout) {
+ }
+}
+
+#[global_allocator]
+static A: B = B;
+
+#[no_mangle]
+pub extern fn foo(a: u32) -> u32 {
+ assert_eq!(a, 3);
+ a * 2
+}
+
+#[alloc_error_handler]
+fn a(_: core::alloc::Layout) -> ! {
+ loop {}
+}
+
+#[panic_implementation]
+fn b(_: &core::panic::PanicInfo) -> ! {
+ loop {}
+}
--- /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.
+
+#![crate_type = "cdylib"]
+
+#[no_mangle]
+pub extern fn foo() {
+ println!("foo");
+ panic!("test");
+}
--- /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.
+
+const fs = require('fs');
+const process = require('process');
+const assert = require('assert');
+const buffer = fs.readFileSync(process.argv[2]);
+
+let m = new WebAssembly.Module(buffer);
+let list = WebAssembly.Module.exports(m);
+console.log('exports', list);
+
+let bad = false;
+for (let i = 0; i < list.length; i++) {
+ const e = list[i];
+ if (e.name == "foo" || e.kind != "function")
+ continue;
+
+ console.log('unexpected exported symbol:', e.name);
+ bad = true;
+}
+
+if (bad)
+ process.exit(1);
// no-prefer-dynamic
#![crate_type = "proc-macro"]
-#![feature(proc_macro, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
extern crate proc_macro;
// no-prefer-dynamic
#![crate_type = "proc-macro"]
-#![feature(use_extern_macros, proc_macro_non_items, proc_macro_quote)]
+#![feature(proc_macro_non_items, proc_macro_quote)]
extern crate proc_macro;
// no-prefer-dynamic
#![crate_type = "proc-macro"]
-#![feature(proc_macro, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
extern crate proc_macro;
// ignore-cross-compile
-#![feature(rustc_private, path)]
-#![feature(core)]
+#![feature(rustc_private)]
extern crate getopts;
extern crate rustc;
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(rustc_private)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(rand, rustc_private)]
+#![feature(rustc_private)]
extern crate serialize;
// aux-build:cond_plugin.rs
// ignore-stage1
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
extern crate cond_plugin;
// aux-build:hello_macro.rs
// ignore-stage1
-#![feature(use_extern_macros, proc_macro_non_items, proc_macro_gen)]
+#![feature(proc_macro_non_items, proc_macro_gen)]
extern crate hello_macro;
// See https://github.com/rust-lang/rust/issues/34793 for more information.
// Make sure we don't optimize anything away:
-// compile-flags: -C no-prepopulate-passes
+// compile-flags: -C no-prepopulate-passes -Cpasses=name-anon-globals
// Expand something exponentially
macro_rules! go_bacterial {
// aux-build:attr-stmt-expr.rs
// ignore-stage1
-#![feature(use_extern_macros, stmt_expr_attributes, proc_macro_stmt, proc_macro_expr)]
+#![feature(stmt_expr_attributes, proc_macro_expr)]
extern crate attr_stmt_expr;
use attr_stmt_expr::{expect_let, expect_print_stmt, expect_expr, expect_print_expr,
// no-prefer-dynamic
-#![feature(proc_macro_non_items, proc_macro_quote, use_extern_macros)]
+#![feature(proc_macro_non_items, proc_macro_quote)]
#![crate_type = "proc-macro"]
extern crate proc_macro;
// no-prefer-dynamic
-#![feature(use_extern_macros, proc_macro_quote, proc_macro_non_items)]
+#![feature(proc_macro_quote, proc_macro_non_items)]
#![crate_type = "proc-macro"]
extern crate proc_macro as proc_macro_renamed; // This does not break `quote!`
// aux-build:bang-macro.rs
// ignore-stage1
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
extern crate bang_macro;
use bang_macro::rewrite;
// aux-build:call-site.rs
// ignore-stage1
-#![feature(proc_macro_non_items, use_extern_macros)]
+#![feature(proc_macro_non_items)]
extern crate call_site;
use call_site::*;
// aux-build:count_compound_ops.rs
// ignore-stage1
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
extern crate count_compound_ops;
use count_compound_ops::count_compound_ops;
// aux-build:derive-b.rs
// ignore-stage1
-#![feature(use_extern_macros, proc_macro_path_invoc)]
+#![feature(proc_macro_path_invoc)]
extern crate derive_b;
// aux-build:hygiene_example.rs
// ignore-stage1
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
extern crate hygiene_example;
use hygiene_example::hello;
// ignore-stage1
// ignore-wasm32
-#![feature(use_extern_macros, macros_in_extern)]
+#![feature(macros_in_extern)]
extern crate test_macros;
// ignore-stage1
// ignore-cross-compile
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
extern crate proc_macro_def;
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct pair<A,B> {
// no-prefer-dynamic
-#![feature(heap_api, allocator_api)]
+#![feature(allocator_api)]
#![crate_type = "rlib"]
use std::alloc::{GlobalAlloc, System, Layout};
// aux-build:helper.rs
// no-prefer-dynamic
-#![feature(heap_api, allocator_api)]
+#![feature(allocator_api)]
extern crate custom;
extern crate custom_as_global;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn pairwise_sub(mut t: Box<DoubleEndedIterator<Item=isize>>) -> isize {
// pretty-expanded FIXME #23616
-#![feature(core)]
-
use std::slice;
trait Bound {}
use std::future::FutureObj;
use std::task::{
Context, Poll, Wake,
- Executor, SpawnObjError,
+ Spawn, SpawnObjError,
local_waker_from_nonlocal,
};
}
}
-struct NoopExecutor;
-impl Executor for NoopExecutor {
+struct NoopSpawner;
+impl Spawn for NoopSpawner {
fn spawn_obj(&mut self, _: FutureObj<'static, ()>) -> Result<(), SpawnObjError> {
Ok(())
}
let mut fut = PinBox::new(f(9));
let counter = Arc::new(Counter { wakes: AtomicUsize::new(0) });
let waker = local_waker_from_nonlocal(counter.clone());
- let executor = &mut NoopExecutor;
- let cx = &mut Context::new(&waker, executor);
+ let spawner = &mut NoopSpawner;
+ let cx = &mut Context::new(&waker, spawner);
assert_eq!(0, counter.wakes.load(atomic::Ordering::SeqCst));
assert_eq!(Poll::Pending, fut.as_pin_mut().poll(cx));
-#![allow(unknown_features)]
-#![feature(bogus)]
+#![allow(stable_features)]
+#![feature(rust1)]
pub fn main() { }
// ignore-license
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait double {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait double {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait double {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait double {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait double {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait Foo {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::cell::RefCell;
// edition:2018
-#![feature(raw_identifiers)]
-
#[macro_export]
macro_rules! produces_async {
() => (pub fn async() {})
#![crate_name="a"]
#![crate_type = "lib"]
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub trait i<T>
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(core)]
-
pub mod testtypes {
use std::any::TypeId;
#![crate_type = "lib"]
-#![allow(unknown_features)]
#![feature(box_syntax)]
static mut COUNT: u64 = 1;
#![crate_type = "lib"]
-#![allow(unknown_features)]
#![feature(box_syntax)]
static mut COUNT: u64 = 1;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(core)]
-
use std::any::{Any, TypeId};
pub struct A;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(core)]
-
use std::any::{Any, TypeId};
pub struct A;
// except according to those terms.
#![feature(staged_api)]
-#![stable(feature = "unit_test", since = "0.0.0")]
+#![stable(feature = "unit_test", since = "1.0.0")]
#[unstable(feature = "unstable_macros", issue = "0")]
#[macro_export]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn borrow<F>(x: &isize, f: F) where F: FnOnce(&isize) {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct A { a: isize, b: Box<isize> }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::mem::swap;
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct A { a: isize, b: Box<isize> }
// ignore-wasm32-bare no libc to test with
-#![feature(libc, std_misc)]
+#![feature(libc)]
extern crate libc;
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn foo(x: &mut Box<u8>) {
// aux-build:cci_borrow_lib.rs
-#![allow(unknown_features)]
#![feature(box_syntax)]
extern crate cci_borrow_lib;
// pretty-expanded FIXME #23616
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
fn child2(_s: String) { }
// aux-build:cci_class_cast.rs
-#![allow(unknown_features)]
#![feature(box_syntax)]
extern crate cci_class_cast;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::fmt;
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax, os)]
use std::os;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
// This test verifies that temporaries created for `while`'s and `if`
// conditions are dropped after the condition is evaluated.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Temporary;
// ignore-emscripten no threads support
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::thread;
// ignore-emscripten no threads support
-#![allow(unknown_features)]
-#![feature(box_syntax, std_misc)]
+#![feature(box_syntax)]
use std::thread;
// storing closure data (as we used to do), the u64 would
// overwrite the u16.
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Pair<A,B> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::cell::RefCell;
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
use std::sync::mpsc::{channel, Sender};
// memory, which makes for some *confusing* logs. That's why these are here
// instead of in std.
-#![feature(libc, std_misc, duration)]
+#![feature(libc, duration)]
extern crate libc;
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
// This is a regression test that the metadata for the
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::cell::Cell;
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(core)]
-
pub trait DeclaredTrait {
type Type;
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::default::Default;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![feature(hash_default)]
-
use std::hash::{Hash, SipHasher, Hasher};
use std::mem::size_of;
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
enum t { foo(Box<isize>), }
// Test that destructor on a struct runs successfully after the struct
// is boxed and converted to an object.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
static mut value: usize = 0;
// ignore-emscripten no threads support
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::thread;
// Test that overloaded index expressions with DST result types
// work and don't ICE.
-
-#![feature(core)]
-
use std::ops::Index;
use std::fmt::Debug;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Fat<T: ?Sized> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Fat<T: ?Sized> {
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unsized_tuple_coercion)]
// edition:2018
// aux-build:edition-kw-macro-2015.rs
-#![feature(raw_identifiers)]
-
#[macro_use]
extern crate edition_kw_macro_2015;
// edition:2018
// aux-build:edition-kw-macro-2018.rs
-#![feature(raw_identifiers)]
-
#[macro_use]
extern crate edition_kw_macro_2018;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
/*!
// ignore-cloudabi no environment variables present
// ignore-emscripten env vars don't work?
-#![feature(path)]
-
use std::env::*;
use std::path::PathBuf;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
#[derive(Copy, Clone)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait Foo {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
static tau: f64 = 2.0*3.14159265358979323;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn test_generic<T, F>(expected: Box<T>, eq: F) where T: Clone, F: FnOnce(Box<T>, Box<T>) -> bool {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn test_generic<T, F>(expected: T, eq: F) where T: Clone, F: FnOnce(T, T) -> bool {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() { let x: Box<_> = { box 100 }; assert_eq!(*x, 100); }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
-
// Tests for if as expressions returning boxed types
fn test_box() {
let rs: Box<_> = if true { box 100 } else { box 101 };
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn test_generic<T: Clone, F>(expected: Box<T>, eq: F) where F: FnOnce(Box<T>, Box<T>) -> bool {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn test_generic<T: Clone, F>(expected: T, eq: F) where F: FnOnce(T, T) -> bool {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
// Tests for match as expressions resulting in boxed types
// ignore-emscripten no threads support
-#![feature(libc, std_misc)]
+#![feature(libc)]
extern crate libc;
use std::thread;
// ignore-wasm32-bare no libc to test ffi with
-#![feature(std_misc, libc)]
+#![feature(libc)]
extern crate libc;
use std::ffi::CString;
// Issue 4691: Ensure that functional-struct-updates operates
// correctly and moves rather than copy when appropriate.
-
-#![allow(unknown_features)]
#![feature(box_syntax, core)]
struct ncint { v: isize }
// Test that we do not leak when the arg pattern must drop part of the
// argument (in this case, the `y` field).
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Foo {
// boxes. Make sure that we don't free the box as we match the
// pattern.
-
-#![allow(unknown_features)]
#![feature(box_patterns)]
#![feature(box_syntax)]
use std::task::{
Context, Poll,
Wake, Waker, LocalWaker,
- Executor, SpawnObjError,
+ Spawn, SpawnObjError,
local_waker, local_waker_from_nonlocal,
};
}
}
-struct NoopExecutor;
+struct NoopSpawner;
-impl Executor for NoopExecutor {
+impl Spawn for NoopSpawner {
fn spawn_obj(&mut self, _: FutureObj<'static, ()>) -> Result<(), SpawnObjError> {
Ok(())
}
cx.waker().wake();
cx.waker().wake();
cx.local_waker().wake();
- cx.executor().spawn_obj(PinBox::new(MyFuture).into()).unwrap();
+ cx.spawner().spawn_obj(PinBox::new(MyFuture).into()).unwrap();
Poll::Ready(())
}
}
nonlocal_wakes: AtomicUsize::new(0),
});
let waker = unsafe { local_waker(counter.clone()) };
- let executor = &mut NoopExecutor;
- let cx = &mut Context::new(&waker, executor);
+ let spawner = &mut NoopSpawner;
+ let cx = &mut Context::new(&waker, spawner);
assert_eq!(Poll::Ready(()), PinMut::new(&mut MyFuture).poll(cx));
assert_eq!(1, counter.local_wakes.load(atomic::Ordering::SeqCst));
assert_eq!(2, counter.nonlocal_wakes.load(atomic::Ordering::SeqCst));
nonlocal_wakes: AtomicUsize::new(0),
});
let waker: LocalWaker = local_waker_from_nonlocal(counter.clone());
- let executor = &mut NoopExecutor;
- let cx = &mut Context::new(&waker, executor);
+ let spawner = &mut NoopSpawner;
+ let cx = &mut Context::new(&waker, spawner);
assert_eq!(Poll::Ready(()), PinMut::new(&mut MyFuture).poll(cx));
assert_eq!(0, counter.local_wakes.load(atomic::Ordering::SeqCst));
assert_eq!(3, counter.nonlocal_wakes.load(atomic::Ordering::SeqCst));
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn id<T:Send>(t: T) -> T { return t; }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Recbox<T> {x: Box<T>}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![feature(core)]
-
use std::ops::Add;
extern "C" fn foo<T: Add>(a: T, b: T) -> T::Output { a + b }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn f<T>(x: Box<T>) -> Box<T> { return x; }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait Foo<T> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
enum list<T> { cons(Box<T>, Box<list<T>>), nil, }
#![allow(dead_assignment)]
#![allow(unused_variables)]
-#![allow(unknown_features)]
#![feature(box_syntax)]
enum option<T> { some(Box<T>), none, }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Triple<T> { x: T, y: T, z: T }
// ignore-emscripten No support for threads
-#![allow(unknown_features)]
-#![feature(std_misc)]
-
/**
A somewhat reduced test case to expose some Valgrind issues.
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
-
// Test that `Fn(isize) -> isize + 'static` parses as `(Fn(isize) -> isize) +
// 'static` and not `Fn(isize) -> (isize + 'static)`. The latter would
// cause a compilation error. Issue #18772.
// pretty-expanded FIXME #23616
// ignore-emscripten no threads support
-#![feature(intrinsics, std_misc)]
+#![feature(intrinsics)]
use std::thread;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(intrinsics)]
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn work(_: Box<isize>) {}
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct DroppableStruct;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_patterns)]
#![feature(box_syntax)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(libc, std_misc)]
+#![feature(libc)]
extern crate libc;
// ignore-cloudabi no processes
// ignore-emscripten no processes
-#![feature(io, process_capture)]
-
use std::env;
use std::io::prelude::*;
use std::io;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct StrWrap {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
#[derive(Clone)]
// ignore-cloudabi no processes
// ignore-emscripten no processes
-#![feature(io, process_capture)]
-
use std::env;
use std::io::prelude::*;
use std::io;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn match_on_local() {
// If `Index` used an associated type for its output, this test would
// work more smoothly.
-
-#![feature(core)]
-
use std::ops::Index;
struct Mat<T> { data: Vec<T>, cols: usize, }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
#[derive(PartialEq, Debug)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
-
struct Parser<'a, I, O> {
parse: Box<FnMut(I) -> Result<O, String> + 'a>
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unboxed_closures, fn_traits)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(box_patterns)]
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
-#![feature(box_syntax, io)]
+#![feature(box_syntax)]
use std::io::{self, Write};
// pretty-expanded FIXME #23616
-#![feature(core)]
-
trait Str { fn foo(&self) {} }
impl Str for str {}
impl<'a, S: ?Sized> Str for &'a S where S: Str {}
// ignore-cloudabi no processes
// ignore-emscripten no processes
-#![feature(std_misc, os)]
+#![feature(os)]
#[cfg(unix)]
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(std_misc)]
-
use std::thread;
fn _foo() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(core)]
-
extern crate core;
use core::marker::Sync;
// pretty-expanded FIXME #23616
-#![feature(core)]
-
// This used to cause an ICE because the retslot for the "return" had the wrong type
fn testcase<'a>() -> Box<Iterator<Item=usize> + 'a> {
return Box::new((0..3).map(|i| { return i; }));
// pretty-expanded FIXME #23616
// ignore-cloudabi no std::fs
-#![feature(fs, net)]
-
use std::{fs, net};
fn assert_both<T: Send + Sync>() {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait clam<A> {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Font {
// except according to those terms.
//
-#![feature(std_misc)]
-
pub type Task = isize;
// tjc: I don't know why
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait hax {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait hax {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
//type t = { a: isize };
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
#[derive(Copy, Clone)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::cell::RefCell;
// that are already linked in. Using WriterUtil allows us to use the write_line
// method.
-#![feature(core)]
-
use std::fmt;
use std::iter::repeat;
use std::slice;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
-#![feature(std_misc)]
-
use std::thread;
use std::sync::mpsc::Sender;
// Issue Name: pub method preceded by attribute can't be parsed
// Abstract: Visibility parsing failed when compiler parsing
-#![feature(core)]
-
use std::f64;
#[derive(Copy, Clone)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait T {
// Need -Cno-prepopulate-passes to really disable inlining, otherwise the faulty
// code gets optimized out:
-// compile-flags: -Cno-prepopulate-passes
+// compile-flags: -Cno-prepopulate-passes -Cpasses=name-anon-globals
extern crate issue_38226_aux;
// pretty-expanded FIXME #23616
#![allow(path_statements)]
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// pretty-expanded FIXME #23616
-#![feature(io)]
-
use std::io;
pub fn main() {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct T { a: Box<isize> }
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub trait EventLoop {
--- /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(macro_literal_matcher)]
+
+macro_rules! a {
+ ($i:literal) => { "right" };
+ ($i:tt) => { "wrong" };
+}
+
+macro_rules! b {
+ ($i:literal) => { a!($i) };
+}
+
+fn main() {
+ assert_eq!(b!(0), "right");
+}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Dog {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Element;
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub struct Foo {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub enum Thing {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_patterns)]
#![feature(box_syntax)]
*/
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {}
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
use std::sync::mpsc::{channel, Receiver};
// ignore-pretty unreported
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub trait bomb { fn boom(&self, _: Ident); }
// except according to those terms.
#![allow(unnecessary_allocation)]
-#![allow(unknown_features)]
#![feature(box_syntax)]
// Tests for a previous bug that occurred due to an interaction
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
use std::sync::mpsc::{channel, Sender};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(std_misc)]
-
use std::thread;
fn user(_i: isize) {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait repeat<A> { fn get(&self) -> A; }
// Make sure #1399 stays fixed
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct A { a: Box<isize> }
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn leaky<T>(_t: T) { }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn f() {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
enum list { cons(isize, Box<list>), nil, }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Pair { a: Box<isize>, b: Box<isize> }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_patterns)]
#![feature(box_syntax)]
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn foo(x: Option<Box<isize>>, b: bool) -> isize {
// Test method calls with self as an argument (cross-crate)
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
// aux-build:method_self_arg1.rs
// Test method calls with self as an argument (cross-crate)
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
// aux-build:method_self_arg2.rs
// Test method calls with self as an argument
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
static mut COUNT: u64 = 1;
// Test method calls with self as an argument
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
static mut COUNT: usize = 1;
// codegen the call as `Foo::foo(&x)` and let the specific impl get
// chosen later.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait Foo {
// pretty-expanded FIXME #23616
-#![feature(core)]
-
trait A {
fn foo(self);
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
#[derive(Clone)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct X { x: isize, y: isize, z: isize }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct X { x: isize, y: isize, z: isize }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
#[derive(Clone)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Triple {a: isize, b: isize, c: isize}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Triple { a: isize, b: isize, c: isize }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn test(foo: Box<Vec<isize>> ) { assert_eq!((*foo)[0], 10); }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn test(foo: Box<Vec<isize>>) { assert_eq!((*foo)[0], 10); }
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn f(mut y: Box<isize>) {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn f(x: Box<isize>) {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
// Iota-reduction is a rule in the Calculus of (Co-)Inductive Constructions,
// Testing creating two vtables with the same self type, but different
// traits.
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::any::Any;
// closed over do not contain managed values, and thus the boxes do
// not have headers.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
// closed over contain managed values. This implies that the boxes
// will have headers that must be skipped over.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait FooTrait {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(core)]
-
use std::cmp;
use std::ops;
#![allow(dead_assignment)]
#![allow(unused_variables)]
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct A { a: isize, b: isize }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax, core)]
use std::cell::RefCell;
// Test overloading of the `[]` operator. In particular test that it
// takes its argument *by reference*.
-
-#![feature(core)]
-
use std::ops::Index;
struct AssociationList<K,V> {
// Test overloaded indexing combined with autoderef.
-
-#![allow(unknown_features)]
#![feature(box_syntax, core)]
use std::ops::{Index, IndexMut};
// Test using overloaded indexing when the "map" is stored in a
// field. This caused problems at some point.
-
-#![feature(core)]
-
use std::ops::Index;
struct Foo {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![feature(core)]
-
use std::ops::{Index, IndexMut};
struct Foo {
// ignore-emscripten no threads support
-#![feature(panic_handler, std_panic)]
+#![feature(std_panic)]
use std::sync::atomic::{AtomicUsize, Ordering};
use std::panic;
// <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(panic_handler, std_panic)]
// ignore-emscripten no threads support
+#![feature(std_panic)]
+
use std::panic;
use std::thread;
// <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(panic_handler, std_panic)]
+#![feature(std_panic)]
// ignore-emscripten no threads support
// ignore-emscripten no threads support
-#![feature(panic_handler)]
-
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
use std::panic;
use std::thread;
// no-prefer-dynamic
// ignore-cloudabi no processes
// ignore-emscripten no processes
+// ignore-macos
extern crate exit_success_if_unwind;
// no-prefer-dynamic
// ignore-cloudabi no processes
// ignore-emscripten no processes
+// ignore-macos
use std::process::Command;
use std::env;
// compile-flags:-C panic=abort
// no-prefer-dynamic
+// ignore-macos
#![feature(panic_abort)]
extern crate panic_abort;
-fn main() {
-}
+fn main() {}
// ignore-bitrig
// compile-flags: -C codegen_units=2
-#![feature(core)]
#![feature(iter_arith)]
mod a {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn sums_to(v: Vec<isize> , sum: isize) -> bool {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait get {
// Ideally this would be revised to use no_std, but for now it serves
// well enough to reproduce (and illustrate) the bug from #16687.
-#![feature(heap_api, allocator_api)]
+#![feature(allocator_api)]
use std::alloc::{Global, Alloc, Layout, handle_alloc_error};
use std::ptr::{self, NonNull};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn foo(x: &usize) -> usize {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn foo(x: &usize) -> usize {
// A test where we (successfully) close over a reference into
// an object.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait SomeTrait { fn get(&self) -> isize; }
// Test lifetimes are linked properly when we create dependent region pointers.
// Issue #3148.
-
-#![allow(unknown_features)]
#![feature(box_patterns)]
#![feature(box_syntax)]
// Tests that you can use an early-bound lifetime parameter as
// on of the generic parameters in a trait.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait Trait<'a> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn foo(x: &usize) -> &usize { x }
#![allow(dead_assignment)]
#![allow(unused_variables)]
-#![allow(unknown_features)]
// Should pass region checking.
fn ok(f: Box<FnMut(&usize)>) {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn borrow<T>(x: &T) -> &T {x}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Point {x: isize, y: isize}
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// changes were caught. However, those uses in the compiler could
// easily get changed or refactored away in the future.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Ctxt<'tcx> {
// aux-build:xcrate.rs
// edition:2018
-#![feature(extern_absolute_paths)]
-
use xcrate::Z;
fn f() {
// edition:2018
// compile-flags: --test
-#![feature(extern_absolute_paths)]
-
#[test]
-fn test() {
-}
+fn test() {}
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct Foo;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct X {
// Ensure assigning an owned or managed variable to itself works. In particular,
// that we do not glue_drop before we glue_take (#3290).
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::rc::Rc;
// pretty-expanded FIXME #23616
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
use std::sync::mpsc::channel;
// ignore-emscripten no threads support
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::thread;
// Test slicing sugar.
-
-#![feature(core)]
-
extern crate core;
use core::ops::{Index, IndexMut, Range, RangeTo, RangeFrom, RangeFull};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-// this is for the wrapping_add call below.
-#![feature(core)]
-
-/*!
- * Tests the range assertion wraparound case when reading discriminants.
- */
+// Tests the range assertion wraparound case when reading discriminants.
#[repr(u8)]
#[derive(Copy, Clone)]
// pretty-expanded FIXME #23616
-#![feature(static_mutex, static_rwlock, static_condvar)]
-#![feature(semaphore)]
-
use std::sync;
fn assert_both<T: Sync + Send>() {}
// except according to those terms.
#![allow(warnings)]
-#![feature(drain, collections_bound, btree_range, vecmap)]
+#![feature(drain, collections_bound, btree_range)]
use std::collections::BinaryHeap;
use std::collections::{BTreeMap, BTreeSet};
#![allow(warnings)]
#![feature(iter_empty)]
#![feature(iter_once)]
-#![feature(iter_unfold)]
#![feature(str_escape)]
use std::iter::{empty, once, repeat};
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
use std::sync::mpsc::{channel, Sender};
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
pub fn main() { test00(); }
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
use std::sync::mpsc::{channel, Sender};
// pretty-expanded FIXME #23616
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::sync::mpsc::{channel, Sender};
use std::thread;
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
pub fn main() { test00(); }
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::sync::mpsc::{channel, Sender};
use std::thread;
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::sync::mpsc::{channel, Sender};
use std::thread;
// ignore-emscripten no threads support
// pretty-expanded FIXME #23616
-#![feature(std_misc)]
-
use std::sync::mpsc::{channel, Sender};
use std::thread;
// ignore-emscripten no threads support
// pretty-expanded FIXME #23616
-#![feature(std_misc)]
-
// Issue #922
// This test is specifically about spawning temporary closures.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(std_misc)]
-
// ignore-emscripten no threads support
use std::thread;
// ignore-emscripten no threads support
-#![feature(std_misc)]
#![allow(dead_assignment)]
use std::sync::mpsc::{channel, Sender};
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
use std::sync::mpsc::{channel, Sender};
// ignore-emscripten no threads support
// pretty-expanded FIXME #23616
-#![feature(std_misc)]
-
use std::thread;
pub fn main() {
// ignore-emscripten no threads support
-#![allow(unknown_features)]
-#![feature(box_syntax, std_misc)]
+#![feature(box_syntax)]
use std::thread;
use std::sync::mpsc::channel;
// ignore-emscripten no threads support
-#![feature(std_misc)]
-
use std::thread;
pub fn main() {
// and shared between threads as long as all types fulfill Send.
// ignore-emscripten no threads support
-#![allow(unknown_features)]
-#![feature(box_syntax, std_misc)]
+
+#![feature(box_syntax)]
use std::sync::Arc;
use std::sync::mpsc::channel;
// pretty-expanded FIXME #23616
-#![feature(core)]
-
trait U {}
trait T<X: U> { fn get(self) -> X; }
// pretty-expanded FIXME #23616
-#![feature(core)]
-
use std::cmp::PartialOrd;
pub trait NumCast: Sized {
// test for #8664
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::marker;
// blanket impl for T:Copy coexists with an impl for Box<T>, because
// Box does not impl Copy.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
trait Get {
// Test that type IDs correctly account for higher-rank lifetimes
// Also acts as a regression test for an ICE (issue #19791)
-
-#![feature(core)]
-
use std::any::{Any, TypeId};
struct Struct<'a>(&'a ());
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn p_foo<T>(_pinned: T) { }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
// Example from lkuper's intern talk, August 2012 -- now with static
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
// Example from lkuper's intern talk, August 2012.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
#[derive(Copy, Clone)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::ops::FnMut;
// Test that the call operator autoderefs when calling to an object type.
-#![allow(unknown_features)]
-
use std::ops::FnMut;
fn make_adder(x: isize) -> Box<FnMut(isize)->isize + 'static> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
-
use std::ops::FnMut;
fn make_adder(x: isize) -> Box<FnMut(isize)->isize + 'static> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct X {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
#![allow(dead_assignment)]
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
-
fn f<T>(t: T) -> T {
let t1 = t;
t1
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct J { j: isize }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_patterns)]
#![feature(box_syntax)]
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn f(i: Box<isize>) {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn f(i: &mut Box<isize>) {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn f(i: Box<isize>) {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn f() -> Box<isize> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
fn test1() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::cmp::PartialEq;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
#![allow(unused_variables)]
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub trait EventLoop { fn foo(&self) {} }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_patterns)]
#![feature(box_syntax)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
enum bar { u(Box<isize>), w(isize), }
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_patterns)]
#![feature(box_syntax)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
struct X { x: isize }
// ignore-emscripten no threads support
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::sync::mpsc::{channel, Sender};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::sync::mpsc::channel;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::mem::swap;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(unknown_features)]
#![feature(box_syntax)]
// Test sized-ness checking in substitution.
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// pretty-expanded FIXME #23616
#![allow(path_statements)]
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main()
// ignore-emscripten no threads support
-#![allow(unknown_features)]
#![feature(box_syntax)]
use std::thread;
// <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(core, str_char)]
use std::str;
// us from approximating the lifetimes of `field1` and `field2` to a
// common intersection.
-
#![allow(dead_code)]
-#![feature(core)]
struct List<'l> {
field1: &'l i32,
// Test that vec is now covariant in its argument type.
-
#![allow(dead_code)]
-#![feature(core)]
fn foo<'a,'b>(v1: Vec<&'a i32>, v2: Vec<&'b i32>) -> i32 {
bar(v1, v2).cloned().unwrap_or(0) // only type checks if we can intersect 'a and 'b
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() {
// pretty-expanded FIXME #23616
-#![allow(unknown_features)]
#![feature(box_syntax)]
pub fn main() { let _quux: Box<Vec<usize>> = box Vec::new(); }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(std_misc)]
-
pub type HANDLE = usize;
pub type DWORD = u32;
pub type SIZE_T = u32;
// except according to those terms.
#![feature(optin_builtin_traits)]
-#![feature(core)]
pub mod bar {
use std::marker;
// Just check if we don't get an ICE for the _S type.
-#![feature(const_size_of)]
-
use std::cell::Cell;
use std::mem;
--- /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.
+
+use std::marker::PhantomData;
+
+pub mod traits {
+ pub trait Owned<'a> {
+ type Reader;
+ }
+}
+
+// @has issue_51236/struct.Owned.html
+// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<T> Send for \
+// Owned<T> where <T as Owned<'static>>::Reader: Send"
+pub struct Owned<T> where T: for<'a> ::traits::Owned<'a> {
+ marker: PhantomData<<T as ::traits::Owned<'static>>::Reader>,
+}
--- /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.
+
+pub trait OwnedTrait<'a> {
+ type Reader;
+}
+
+// @has static_region/struct.Owned.html
+// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<T> Send for \
+// Owned<T> where <T as OwnedTrait<'static>>::Reader: Send"
+pub struct Owned<T> where T: OwnedTrait<'static> {
+ marker: <T as OwnedTrait<'static>>::Reader,
+}
// force-host
// no-prefer-dynamic
-#![feature(proc_macro)]
+
#![crate_type = "proc-macro"]
extern crate proc_macro;
// force-host
// no-prefer-dynamic
-#![feature(proc_macro)]
+
#![crate_type = "proc-macro"]
extern crate proc_macro;
// no-prefer-dynamic
-#![feature(proc_macro)]
#![crate_type = "proc-macro"]
extern crate proc_macro;
// aux-build:lifetimes.rs
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
extern crate lifetimes;
// run-pass
// no-prefer-dynamic
-#![feature(proc_macro)]
#![crate_type = "proc-macro"]
extern crate proc_macro;
// aux-build:generate-mod.rs
-#![feature(use_extern_macros, proc_macro_gen, proc_macro_path_invoc)]
+#![feature(proc_macro_gen, proc_macro_path_invoc)]
extern crate generate_mod;
// no-prefer-dynamic
#![crate_type = "proc-macro"]
-#![feature(proc_macro)]
extern crate proc_macro;
error: `#[proc_macro]` attribute does not take any arguments
- --> $DIR/invalid-attributes.rs:20:1
+ --> $DIR/invalid-attributes.rs:19:1
|
LL | #[proc_macro = "test"] //~ ERROR: does not take any arguments
| ^^^^^^^^^^^^^^^^^^^^^^
error: `#[proc_macro]` attribute does not take any arguments
- --> $DIR/invalid-attributes.rs:23:1
+ --> $DIR/invalid-attributes.rs:22:1
|
LL | #[proc_macro()] //~ ERROR: does not take any arguments
| ^^^^^^^^^^^^^^^
error: `#[proc_macro]` attribute does not take any arguments
- --> $DIR/invalid-attributes.rs:26:1
+ --> $DIR/invalid-attributes.rs:25:1
|
LL | #[proc_macro(x)] //~ ERROR: does not take any arguments
| ^^^^^^^^^^^^^^^^
error: `#[proc_macro_attribute]` attribute does not take any arguments
- --> $DIR/invalid-attributes.rs:29:1
+ --> $DIR/invalid-attributes.rs:28:1
|
LL | #[proc_macro_attribute = "test"] //~ ERROR: does not take any arguments
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[proc_macro_attribute]` attribute does not take any arguments
- --> $DIR/invalid-attributes.rs:32:1
+ --> $DIR/invalid-attributes.rs:31:1
|
LL | #[proc_macro_attribute()] //~ ERROR: does not take any arguments
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[proc_macro_attribute]` attribute does not take any arguments
- --> $DIR/invalid-attributes.rs:35:1
+ --> $DIR/invalid-attributes.rs:34:1
|
LL | #[proc_macro_attribute(x)] //~ ERROR: does not take any arguments
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
// no-prefer-dynamic
-#![feature(proc_macro, decl_macro)]
+#![feature(decl_macro)]
#![crate_type = "proc-macro"]
extern crate proc_macro;
// no-prefer-dynamic
-#![feature(proc_macro)]
#![crate_type = "proc-macro"]
extern crate proc_macro;
error: functions tagged with `#[proc_macro]` must currently reside in the root of the crate
- --> $DIR/non-root.rs:21:5
+ --> $DIR/non-root.rs:20:5
|
LL | pub fn foo(arg: TokenStream) -> TokenStream { arg }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// aux-build:three-equals.rs
// ignore-stage1
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
extern crate three_equals;
// aux-build:attr_proc_macro.rs
// aux-build:bang_proc_macro.rs
-#![feature(use_extern_macros)]
+#![feature(custom_attribute)]
#[macro_use]
extern crate derive_foo;
//~^ ERROR cannot find
struct Foo;
-#[attr_proc_macra]
-//~^ ERROR cannot find
+#[attr_proc_macra] // OK, interpreted as a custom attribute
struct Bar;
-#[FooWithLongNan]
-//~^ ERROR cannot find
+#[FooWithLongNan] // OK, interpreted as a custom attribute
struct Asdf;
#[derive(Dlone)]
LL | #[derive(FooWithLongNan)]
| ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
-error: cannot find attribute macro `attr_proc_macra` in this scope
- --> $DIR/resolve-error.rs:40:3
- |
-LL | #[attr_proc_macra]
- | ^^^^^^^^^^^^^^^ help: try: `attr_proc_macro`
-
-error: cannot find attribute macro `FooWithLongNan` in this scope
- --> $DIR/resolve-error.rs:44:3
- |
-LL | #[FooWithLongNan]
- | ^^^^^^^^^^^^^^
-
error: cannot find derive macro `Dlone` in this scope
- --> $DIR/resolve-error.rs:48:10
+ --> $DIR/resolve-error.rs:46:10
|
LL | #[derive(Dlone)]
| ^^^^^ help: try: `Clone`
error: cannot find derive macro `Dlona` in this scope
- --> $DIR/resolve-error.rs:52:10
+ --> $DIR/resolve-error.rs:50:10
|
LL | #[derive(Dlona)]
| ^^^^^ help: try: `Clona`
error: cannot find derive macro `attr_proc_macra` in this scope
- --> $DIR/resolve-error.rs:56:10
+ --> $DIR/resolve-error.rs:54:10
|
LL | #[derive(attr_proc_macra)]
| ^^^^^^^^^^^^^^^
error: cannot find macro `FooWithLongNama!` in this scope
- --> $DIR/resolve-error.rs:61:5
+ --> $DIR/resolve-error.rs:59:5
|
LL | FooWithLongNama!();
| ^^^^^^^^^^^^^^^ help: you could try the macro: `FooWithLongNam`
error: cannot find macro `attr_proc_macra!` in this scope
- --> $DIR/resolve-error.rs:64:5
+ --> $DIR/resolve-error.rs:62:5
|
LL | attr_proc_macra!();
| ^^^^^^^^^^^^^^^ help: you could try the macro: `attr_proc_mac`
error: cannot find macro `Dlona!` in this scope
- --> $DIR/resolve-error.rs:67:5
+ --> $DIR/resolve-error.rs:65:5
|
LL | Dlona!();
| ^^^^^
error: cannot find macro `bang_proc_macrp!` in this scope
- --> $DIR/resolve-error.rs:70:5
+ --> $DIR/resolve-error.rs:68:5
|
LL | bang_proc_macrp!();
| ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro`
-error: aborting due to 10 previous errors
+error: aborting due to 8 previous errors
--- /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(rust_2018_preview)]
+#![feature(raw_identifiers)]
+//~^ WARN the feature `raw_identifiers` is included in the Rust 2018 edition
+
+fn main() {
+ let foo = 0;
+ let bar = r#foo;
+}
--- /dev/null
+warning[E0705]: the feature `raw_identifiers` is included in the Rust 2018 edition
+ --> $DIR/E0705.rs:14:12
+ |
+LL | #![feature(raw_identifiers)]
+ | ^^^^^^^^^^^^^^^
+
// edition:2018
-#![feature(raw_identifiers)]
#![allow(async_idents)]
#[macro_export]
#![crate_name="lint_output_format"]
#![crate_type = "lib"]
#![feature(staged_api)]
-#![unstable(feature = "test_feature", issue = "0")]
+#![unstable(feature = "unstable_test_feature", issue = "0")]
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn foo() -> usize {
20
}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn bar() -> usize {
40
}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
pub fn baz() -> usize {
30
}
//! (#14132).
#![crate_name = "a"]
-#![feature(core)]
macro_rules! three {
() => { 3 }
--- /dev/null
+error: borrowed data cannot be stored outside of its closure
+ --> $DIR/issue-45983.rs:36:27
+ |
+LL | let x = None;
+ | - borrowed data cannot be stored into here...
+LL | give_any(|y| x = Some(y));
+ | --- ^ cannot be stored outside of its closure
+ | |
+ | ...because it cannot outlive this closure
+
+error: aborting due to previous error
+
--- /dev/null
+error: borrowed data cannot be stored outside of its closure
+ --> $DIR/issue-45983.rs:36:27
+ |
+LL | let x = None;
+ | - borrowed data cannot be stored into here...
+LL | give_any(|y| x = Some(y));
+ | --- ^ cannot be stored outside of its closure
+ | |
+ | ...because it cannot outlive this closure
+
+error: aborting due to previous error
+
warning: not reporting region error due to nll
- --> $DIR/issue-45983.rs:17:27
+ --> $DIR/issue-45983.rs:36:27
|
LL | give_any(|y| x = Some(y));
| ^
error: borrowed data escapes outside of closure
- --> $DIR/issue-45983.rs:17:18
+ --> $DIR/issue-45983.rs:36:18
|
LL | let x = None;
| - `x` is declared here, outside of the closure body
| `y` is a reference that is only valid in the closure body
error[E0594]: cannot assign to `x`, as it is not declared as mutable
- --> $DIR/issue-45983.rs:17:18
+ --> $DIR/issue-45983.rs:36:18
|
LL | let x = None;
| - help: consider changing this to be mutable: `mut x`
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// As documented in Issue #45983, this test is evaluating the quality
+// of our diagnostics on erroneous code using higher-ranked closures.
+//
+// However, as documented on Issue #53026, this test also became a
+// prime example of our need to test the NLL migration mode
+// *separately* from the existing test suites that focus solely on
+// AST-borrwock and NLL.
+
+// revisions: ast migrate nll
+
+// Since we are testing nll (and migration) explicitly as a separate
+// revisions, dont worry about the --compare-mode=nll on this test.
+
+// ignore-compare-mode-nll
+
+//[ast]compile-flags: -Z borrowck=ast
+//[migrate]compile-flags: -Z borrowck=migrate -Z two-phase-borrows
+//[nll]compile-flags: -Z borrowck=mir -Z two-phase-borrows
+
fn give_any<F: for<'r> FnOnce(&'r ())>(f: F) {
f(&());
}
fn main() {
let x = None;
give_any(|y| x = Some(y));
- //~^ ERROR borrowed data cannot be stored outside of its closure
+ //[ast]~^ ERROR borrowed data cannot be stored outside of its closure
+ //[migrate]~^^ ERROR borrowed data cannot be stored outside of its closure
+ //[nll]~^^^ WARN not reporting region error due to nll
+ //[nll]~| ERROR borrowed data escapes outside of closure
+ //[nll]~| ERROR cannot assign to `x`, as it is not declared as mutable
}
+++ /dev/null
-error: borrowed data cannot be stored outside of its closure
- --> $DIR/issue-45983.rs:17:27
- |
-LL | let x = None;
- | - borrowed data cannot be stored into here...
-LL | give_any(|y| x = Some(y));
- | --- ^ cannot be stored outside of its closure
- | |
- | ...because it cannot outlive this closure
-
-error: aborting due to previous error
-
--- /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.
+
+// Regression test for a bug in #52713: this was an optimization for
+// computing liveness that wound up accidentally causing the program
+// below to be accepted.
+
+#![feature(nll)]
+
+fn foo<'a>(x: &'a mut u32) -> u32 {
+ let mut x = 22;
+ let y = &x;
+ if false {
+ return x;
+ }
+
+ x += 1; //~ ERROR
+ println!("{}", y);
+ return 0;
+}
+
+fn main() { }
--- /dev/null
+error[E0506]: cannot assign to `x` because it is borrowed
+ --> $DIR/issue-52713-bug.rs:24:5
+ |
+LL | let y = &x;
+ | -- borrow of `x` occurs here
+...
+LL | x += 1; //~ ERROR
+ | ^^^^^^ assignment to borrowed `x` occurs here
+LL | println!("{}", y);
+ | - borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0506`.
error[E0597]: borrowed value does not live long enough
--> $DIR/promote-ref-mut-in-let-issue-46557.rs:15:21
|
-LL | let ref mut x = 1234543; //~ ERROR
- | ^^^^^^^ temporary value does not live long enough
-LL | x
-LL | }
- | - temporary value only lives until here
- |
- = note: borrowed value must be valid for the static lifetime...
+LL | fn gimme_static_mut_let() -> &'static mut u32 {
+ | _______________________________________________-
+LL | | let ref mut x = 1234543; //~ ERROR
+ | | ^^^^^^^ temporary value does not live long enough
+LL | | x
+LL | | }
+ | | -
+ | | |
+ | |_temporary value only lives until here
+ | borrow later used here
error[E0597]: borrowed value does not live long enough
--> $DIR/promote-ref-mut-in-let-issue-46557.rs:20:25
|
-LL | let (ref mut x, ) = (1234543, ); //~ ERROR
- | ^^^^^^^^^^^ temporary value does not live long enough
-LL | x
-LL | }
- | - temporary value only lives until here
- |
- = note: borrowed value must be valid for the static lifetime...
+LL | fn gimme_static_mut_let_nested() -> &'static mut u32 {
+ | ______________________________________________________-
+LL | | let (ref mut x, ) = (1234543, ); //~ ERROR
+ | | ^^^^^^^^^^^ temporary value does not live long enough
+LL | | x
+LL | | }
+ | | -
+ | | |
+ | |_temporary value only lives until here
+ | borrow later used here
error[E0597]: borrowed value does not live long enough
--> $DIR/promote-ref-mut-in-let-issue-46557.rs:25:11
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: expected token: `,`
- --> $DIR/bad-format-args.rs:13:5
+ --> $DIR/bad-format-args.rs:13:16
|
LL | format!("" 1); //~ ERROR expected token: `,`
- | ^^^^^^^^^^^^^^
- |
- = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+ | ^
error: expected token: `,`
- --> $DIR/bad-format-args.rs:14:5
+ --> $DIR/bad-format-args.rs:14:19
|
LL | format!("", 1 1); //~ ERROR expected token: `,`
- | ^^^^^^^^^^^^^^^^^
- |
- = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+ | ^
error: aborting due to 3 previous errors
// Check that you can't dereference raw pointers in constants.
fn main() {
- static C: u64 = unsafe {*(0xdeadbeef as *const u64)}; //~ ERROR E0396
+ static C: u64 = unsafe {*(0xdeadbeef as *const u64)};
+ //~^ ERROR dereferencing raw pointers in statics is unstable
println!("{}", C);
}
-error[E0396]: raw pointers cannot be dereferenced in statics
+error[E0658]: dereferencing raw pointers in statics is unstable (see issue #51911)
--> $DIR/const-deref-ptr.rs:14:29
|
-LL | static C: u64 = unsafe {*(0xdeadbeef as *const u64)}; //~ ERROR E0396
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer in constant
+LL | static C: u64 = unsafe {*(0xdeadbeef as *const u64)};
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0396`.
+For more information about this error, try `rustc --explain E0658`.
--- /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(const_raw_ptr_to_usize_cast, const_compare_raw_pointers, const_raw_ptr_deref)]
+
+fn main() {}
+
+// unconst and bad, will thus error in miri
+const X: bool = &1 as *const i32 == &2 as *const i32; //~ ERROR cannot be used
+// unconst and fine
+const X2: bool = 42 as *const i32 == 43 as *const i32;
+// unconst and fine
+const Y: usize = 42usize as *const i32 as usize + 1;
+// unconst and bad, will thus error in miri
+const Y2: usize = &1 as *const i32 as usize + 1; //~ ERROR cannot be used
+// unconst and fine
+const Z: i32 = unsafe { *(&1 as *const i32) };
+// unconst and bad, will thus error in miri
+const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR cannot be used
+const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR cannot be used
--- /dev/null
+error: this constant cannot be used
+ --> $DIR/const_raw_ptr_ops.rs:16:1
+ |
+LL | const X: bool = &1 as *const i32 == &2 as *const i32; //~ ERROR cannot be used
+ | ^^^^^^^^^^^^^^^^------------------------------------^
+ | |
+ | "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
+ |
+ = note: #[deny(const_err)] on by default
+
+error: this constant cannot be used
+ --> $DIR/const_raw_ptr_ops.rs:22:1
+ |
+LL | const Y2: usize = &1 as *const i32 as usize + 1; //~ ERROR cannot be used
+ | ^^^^^^^^^^^^^^^^^^-----------------------------^
+ | |
+ | "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
+
+error: this constant cannot be used
+ --> $DIR/const_raw_ptr_ops.rs:26:1
+ |
+LL | const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR cannot be used
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------^^^
+ | |
+ | tried to access memory with alignment 2, but alignment 4 is required
+
+error: this constant cannot be used
+ --> $DIR/const_raw_ptr_ops.rs:27:1
+ |
+LL | const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR cannot be used
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------^^^
+ | |
+ | a memory access tried to interpret some bytes as a pointer
+
+error: aborting due to 4 previous errors
+
// compile-pass
// run-pass
+#![feature(const_fn_union)]
+
union Transmute<T: Copy, U: Copy> {
t: T,
u: U,
--- /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(const_fn)]
+
+fn main() {}
+
+union Foo {
+ u: u32,
+ i: i32,
+}
+
+const unsafe fn foo(u: u32) -> i32 {
+ Foo { u }.i //~ ERROR unions in const fn are unstable
+}
--- /dev/null
+error[E0658]: unions in const fn are unstable (see issue #51909)
+ --> $DIR/feature-gate-const_fn_union.rs:21:5
+ |
+LL | Foo { u }.i //~ ERROR unions in const fn are unstable
+ | ^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn_union)] to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
--- /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
+
+macro_rules! m {
+ () => {{
+ fn f(_: impl Sized) {}
+ f
+ }}
+}
+
+fn main() {
+ fn f() -> impl Sized {};
+ m!()(f());
+}
// that pointer comparison is disallowed, not that parts of a pointer are accessed as raw
// bytes.
let _: [u8; 0] = [4; { //~ ERROR could not evaluate repeat length
- match &1 as *const i32 as usize { //~ ERROR raw pointers cannot be cast to integers
+ match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants
0 => 42, //~ ERROR constant contains unimplemented expression type
//~^ NOTE "pointer arithmetic or comparison" needs an rfc before being allowed
n => n,
-error[E0018]: raw pointers cannot be cast to integers in constants
+error[E0658]: casting pointers to integers in constants is unstable (see issue #51910)
--> $DIR/match-test-ptr-null.rs:16:15
|
-LL | match &1 as *const i32 as usize { //~ ERROR raw pointers cannot be cast to integers
+LL | match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants
| ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable
error[E0019]: constant contains unimplemented expression type
--> $DIR/match-test-ptr-null.rs:17:13
|
LL | let _: [u8; 0] = [4; { //~ ERROR could not evaluate repeat length
| __________________________^
-LL | | match &1 as *const i32 as usize { //~ ERROR raw pointers cannot be cast to integers
+LL | | match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants
LL | | 0 => 42, //~ ERROR constant contains unimplemented expression type
| | - "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
LL | | //~^ NOTE "pointer arithmetic or comparison" needs an rfc before being allowed
error: aborting due to 3 previous errors
-Some errors occurred: E0018, E0019, E0080.
-For more information about an error, try `rustc --explain E0018`.
+Some errors occurred: E0019, E0080, E0658.
+For more information about an error, try `rustc --explain E0019`.
// compile-pass
-#![feature(const_fn)]
+#![feature(const_fn, const_fn_union)]
#![deny(const_err)]
--- /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(const_raw_ptr_to_usize_cast, const_compare_raw_pointers, const_raw_ptr_deref)]
+
+fn main() {
+ let x: &'static bool = &(42 as *const i32 == 43 as *const i32);
+ //~^ ERROR does not live long enough
+ let y: &'static usize = &(&1 as *const i32 as usize + 1); //~ ERROR does not live long enough
+ let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough
+}
--- /dev/null
+error[E0597]: borrowed value does not live long enough
+ --> $DIR/promoted_raw_ptr_ops.rs:14:29
+ |
+LL | let x: &'static bool = &(42 as *const i32 == 43 as *const i32);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
+...
+LL | }
+ | - temporary value only lives until here
+ |
+ = note: borrowed value must be valid for the static lifetime...
+
+error[E0597]: borrowed value does not live long enough
+ --> $DIR/promoted_raw_ptr_ops.rs:16:30
+ |
+LL | let y: &'static usize = &(&1 as *const i32 as usize + 1); //~ ERROR does not live long enough
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
+LL | let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough
+LL | }
+ | - temporary value only lives until here
+ |
+ = note: borrowed value must be valid for the static lifetime...
+
+error[E0597]: borrowed value does not live long enough
+ --> $DIR/promoted_raw_ptr_ops.rs:17:28
+ |
+LL | let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
+LL | }
+ | - temporary value only lives until here
+ |
+ = note: borrowed value must be valid for the static lifetime...
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0597`.
//compile-pass
+#![feature(const_fn_union)]
+
fn main() {}
static FOO: u32 = 42;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![feature(const_fn_union)]
+
fn main() {
let n: Int = 40;
match n {
error[E0030]: lower range bound must be less than or equal to upper
- --> $DIR/ref_to_int_match.rs:15:9
+ --> $DIR/ref_to_int_match.rs:17:9
|
LL | 10..=BAR => {}, //~ ERROR lower range bound must be less than or equal to upper
| ^^ lower bound larger than upper bound
--- /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.
+
+// Unresolved multi-segment attributes are not treated as custom.
+
+#![feature(custom_attribute, proc_macro_path_invoc)]
+
+mod existent {}
+
+#[existent::nonexistent] //~ ERROR failed to resolve. Could not find `nonexistent` in `existent`
+fn main() {}
--- /dev/null
+error[E0433]: failed to resolve. Could not find `nonexistent` in `existent`
+ --> $DIR/custom-attribute-multisegment.rs:17:13
+ |
+LL | #[existent::nonexistent] //~ ERROR failed to resolve. Could not find `nonexistent` in `existent`
+ | ^^^^^^^^^^^ Could not find `nonexistent` in `existent`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0433`.
// aux-build:edition-kw-macro-2015.rs
// compile-pass
-#![feature(raw_identifiers)]
#![allow(async_idents)]
#[macro_use]
// edition:2018
// aux-build:edition-kw-macro-2015.rs
-#![feature(raw_identifiers)]
-
#[macro_use]
extern crate edition_kw_macro_2015;
error: expected identifier, found reserved keyword `async`
- --> $DIR/edition-keywords-2018-2015-parsing.rs:20:13
+ --> $DIR/edition-keywords-2018-2015-parsing.rs:18:13
|
LL | let mut async = 1; //~ ERROR expected identifier, found reserved keyword `async`
| ^^^^^ expected identifier, found reserved keyword
error: expected identifier, found reserved keyword `async`
- --> $DIR/edition-keywords-2018-2015-parsing.rs:30:13
+ --> $DIR/edition-keywords-2018-2015-parsing.rs:28:13
|
LL | module::async(); //~ ERROR expected identifier, found reserved keyword `async`
| ^^^^^ expected identifier, found reserved keyword
error: no rules expected the token `r#async`
- --> $DIR/edition-keywords-2018-2015-parsing.rs:24:31
+ --> $DIR/edition-keywords-2018-2015-parsing.rs:22:31
|
LL | r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`
| ^^^^^^^
error: no rules expected the token `async`
- --> $DIR/edition-keywords-2018-2015-parsing.rs:25:35
+ --> $DIR/edition-keywords-2018-2015-parsing.rs:23:35
|
LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
| ^^^^^
// edition:2018
// aux-build:edition-kw-macro-2018.rs
-#![feature(raw_identifiers)]
-
#[macro_use]
extern crate edition_kw_macro_2018;
error: expected identifier, found reserved keyword `async`
- --> $DIR/edition-keywords-2018-2018-expansion.rs:20:5
+ --> $DIR/edition-keywords-2018-2018-expansion.rs:18:5
|
LL | produces_async! {} //~ ERROR expected identifier, found reserved keyword `async`
| ^^^^^^^^^^^^^^^^^^ expected identifier, found reserved keyword
// edition:2018
// aux-build:edition-kw-macro-2018.rs
-#![feature(raw_identifiers)]
-
#[macro_use]
extern crate edition_kw_macro_2018;
error: expected identifier, found reserved keyword `async`
- --> $DIR/edition-keywords-2018-2018-parsing.rs:20:13
+ --> $DIR/edition-keywords-2018-2018-parsing.rs:18:13
|
LL | let mut async = 1; //~ ERROR expected identifier, found reserved keyword `async`
| ^^^^^ expected identifier, found reserved keyword
error: expected identifier, found reserved keyword `async`
- --> $DIR/edition-keywords-2018-2018-parsing.rs:30:13
+ --> $DIR/edition-keywords-2018-2018-parsing.rs:28:13
|
LL | module::async(); //~ ERROR expected identifier, found reserved keyword `async`
| ^^^^^ expected identifier, found reserved keyword
error: no rules expected the token `r#async`
- --> $DIR/edition-keywords-2018-2018-parsing.rs:24:31
+ --> $DIR/edition-keywords-2018-2018-parsing.rs:22:31
|
LL | r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`
| ^^^^^^^
error: no rules expected the token `async`
- --> $DIR/edition-keywords-2018-2018-parsing.rs:25:35
+ --> $DIR/edition-keywords-2018-2018-parsing.rs:23:35
|
LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
| ^^^^^
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// gate-test-const_compare_raw_pointers
+
static FOO: i32 = 42;
static BAR: i32 = 42;
-static BAZ: bool = { (&FOO as *const i32) == (&BAR as *const i32) }; //~ ERROR E0395
+static BAZ: bool = { (&FOO as *const i32) == (&BAR as *const i32) }; //~ ERROR issue #53020
fn main() {
}
-error[E0395]: raw pointers cannot be compared in statics
- --> $DIR/E0395.rs:14:22
+error[E0658]: comparing raw pointers inside static (see issue #53020)
+ --> $DIR/E0395.rs:16:22
|
-LL | static BAZ: bool = { (&FOO as *const i32) == (&BAR as *const i32) }; //~ ERROR E0395
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comparing raw pointers in static
+LL | static BAZ: bool = { (&FOO as *const i32) == (&BAR as *const i32) }; //~ ERROR issue #53020
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_compare_raw_pointers)] to the crate attributes to enable
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0395`.
+For more information about this error, try `rustc --explain E0658`.
--- /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.
+
+#![feature(const_raw_ptr_deref)]
+
+const REG_ADDR: *const u8 = 0x5f3759df as *const u8;
+
+const VALUE: u8 = unsafe { *REG_ADDR };
+//~^ ERROR this constant cannot be used
+
+fn main() {
+}
--- /dev/null
+error: this constant cannot be used
+ --> $DIR/E0396-fixed.rs:15:1
+ |
+LL | const VALUE: u8 = unsafe { *REG_ADDR };
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^---------^^^
+ | |
+ | a memory access tried to interpret some bytes as a pointer
+ |
+ = note: #[deny(const_err)] on by default
+
+error: aborting due to previous error
+
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// gate-test-const_raw_ptr_deref
+
const REG_ADDR: *const u8 = 0x5f3759df as *const u8;
-const VALUE: u8 = unsafe { *REG_ADDR }; //~ ERROR E0396
+const VALUE: u8 = unsafe { *REG_ADDR };
+//~^ ERROR dereferencing raw pointers in constants is unstable
fn main() {
}
-error[E0396]: raw pointers cannot be dereferenced in constants
- --> $DIR/E0396.rs:13:28
+error[E0658]: dereferencing raw pointers in constants is unstable (see issue #51911)
+ --> $DIR/E0396.rs:15:28
|
-LL | const VALUE: u8 = unsafe { *REG_ADDR }; //~ ERROR E0396
- | ^^^^^^^^^ dereference of raw pointer in constant
+LL | const VALUE: u8 = unsafe { *REG_ADDR };
+ | ^^^^^^^^^
+ |
+ = help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0396`.
+For more information about this error, try `rustc --explain E0658`.
--> $DIR/E0621-does-not-trigger-for-closures.rs:25:26
|
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
- | ----------^^^^^-----------------
- | | | |
- | | | requires that `'1` must outlive `'2`
- | | has type `&'1 i32`
- | lifetime `'2` appears in return type
+ | -- ^^^^^ requires that `'1` must outlive `'2`
+ | ||
+ | |return type of closure is &'2 i32
+ | has type `&'1 i32`
error: aborting due to previous error
--- /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.
+
+#![allow(warnings)]
+
+// Make sure this related feature didn't accidentally enable this
+#![feature(in_band_lifetimes)]
+
+trait MyTrait<'a> { }
+
+impl MyTrait<'a> for &u32 { }
+//~^ ERROR missing lifetime specifier
+
+struct MyStruct;
+trait MarkerTrait {}
+
+impl MarkerTrait for &'_ MyStruct { }
+//~^ ERROR missing lifetime specifier
+
+fn main() {}
--- /dev/null
+error[E0106]: missing lifetime specifier
+ --> $DIR/feature-gate-impl_header_lifetime_elision-with-in_band.rs:18:22
+ |
+LL | impl MyTrait<'a> for &u32 { }
+ | ^ expected lifetime parameter
+
+error[E0106]: missing lifetime specifier
+ --> $DIR/feature-gate-impl_header_lifetime_elision-with-in_band.rs:24:23
+ |
+LL | impl MarkerTrait for &'_ MyStruct { }
+ | ^^ expected lifetime parameter
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
--- /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.
+
+#![allow(warnings)]
+
+trait MyTrait<'a> { }
+
+impl<'a> MyTrait<'a> for &u32 { }
+//~^ ERROR missing lifetime specifier
+
+impl<'a> MyTrait<'_> for &'a f32 { }
+//~^ ERROR missing lifetime specifier
+
+fn main() {}
--- /dev/null
+error[E0106]: missing lifetime specifier
+ --> $DIR/feature-gate-impl_header_lifetime_elision.rs:15:26
+ |
+LL | impl<'a> MyTrait<'a> for &u32 { }
+ | ^ expected lifetime parameter
+
+error[E0106]: missing lifetime specifier
+ --> $DIR/feature-gate-impl_header_lifetime_elision.rs:18:18
+ |
+LL | impl<'a> MyTrait<'_> for &'a f32 { }
+ | ^^ expected lifetime parameter
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
+++ /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.
-
-#![allow(warnings)]
-
-trait MyTrait<'a> { }
-
-impl<'a> MyTrait<'a> for &u32 { }
-//~^ ERROR missing lifetime specifier
-
-impl<'a> MyTrait<'_> for &'a f32 { }
-//~^ ERROR missing lifetime specifier
-
-fn main() {}
+++ /dev/null
-error[E0106]: missing lifetime specifier
- --> $DIR/feature-gate-in_band_lifetimes-impl.rs:15:26
- |
-LL | impl<'a> MyTrait<'a> for &u32 { }
- | ^ expected lifetime parameter
-
-error[E0106]: missing lifetime specifier
- --> $DIR/feature-gate-in_band_lifetimes-impl.rs:18:18
- |
-LL | impl<'a> MyTrait<'_> for &'a f32 { }
- | ^^ expected lifetime parameter
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0106`.
#![allow(warnings)]
+// Make sure this related feature didn't accidentally enable this
+#![feature(impl_header_lifetime_elision)]
+
fn foo(x: &'x u8) -> &'x u8 { x }
//~^ ERROR use of undeclared lifetime name
//~^^ ERROR use of undeclared lifetime name
error[E0261]: use of undeclared lifetime name `'x`
- --> $DIR/feature-gate-in_band_lifetimes.rs:13:12
+ --> $DIR/feature-gate-in_band_lifetimes.rs:16:12
|
LL | fn foo(x: &'x u8) -> &'x u8 { x }
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'x`
- --> $DIR/feature-gate-in_band_lifetimes.rs:13:23
+ --> $DIR/feature-gate-in_band_lifetimes.rs:16:23
|
LL | fn foo(x: &'x u8) -> &'x u8 { x }
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/feature-gate-in_band_lifetimes.rs:25:12
+ --> $DIR/feature-gate-in_band_lifetimes.rs:28:12
|
LL | impl<'a> X<'b> {
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/feature-gate-in_band_lifetimes.rs:27:27
+ --> $DIR/feature-gate-in_band_lifetimes.rs:30:27
|
LL | fn inner_2(&self) -> &'b u8 {
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/feature-gate-in_band_lifetimes.rs:33:8
+ --> $DIR/feature-gate-in_band_lifetimes.rs:36:8
|
LL | impl X<'b> {
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/feature-gate-in_band_lifetimes.rs:35:27
+ --> $DIR/feature-gate-in_band_lifetimes.rs:38:27
|
LL | fn inner_3(&self) -> &'b u8 {
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'a`
- --> $DIR/feature-gate-in_band_lifetimes.rs:43:9
+ --> $DIR/feature-gate-in_band_lifetimes.rs:46:9
|
LL | impl Y<&'a u8> {
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'a`
- --> $DIR/feature-gate-in_band_lifetimes.rs:45:25
+ --> $DIR/feature-gate-in_band_lifetimes.rs:48:25
|
LL | fn inner(&self) -> &'a u8 {
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/feature-gate-in_band_lifetimes.rs:53:27
+ --> $DIR/feature-gate-in_band_lifetimes.rs:56:27
|
LL | fn any_lifetime() -> &'b u8;
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/feature-gate-in_band_lifetimes.rs:55:27
+ --> $DIR/feature-gate-in_band_lifetimes.rs:58:27
|
LL | fn borrowed_lifetime(&'b self) -> &'b u8;
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/feature-gate-in_band_lifetimes.rs:55:40
+ --> $DIR/feature-gate-in_band_lifetimes.rs:58:40
|
LL | fn borrowed_lifetime(&'b self) -> &'b u8;
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'a`
- --> $DIR/feature-gate-in_band_lifetimes.rs:60:14
+ --> $DIR/feature-gate-in_band_lifetimes.rs:63:14
|
LL | impl MyTrait<'a> for Y<&'a u8> {
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'a`
- --> $DIR/feature-gate-in_band_lifetimes.rs:60:25
+ --> $DIR/feature-gate-in_band_lifetimes.rs:63:25
|
LL | impl MyTrait<'a> for Y<&'a u8> {
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'a`
- --> $DIR/feature-gate-in_band_lifetimes.rs:63:31
+ --> $DIR/feature-gate-in_band_lifetimes.rs:66:31
|
LL | fn my_lifetime(&self) -> &'a u8 { self.0 }
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/feature-gate-in_band_lifetimes.rs:65:27
+ --> $DIR/feature-gate-in_band_lifetimes.rs:68:27
|
LL | fn any_lifetime() -> &'b u8 { &0 }
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/feature-gate-in_band_lifetimes.rs:67:27
+ --> $DIR/feature-gate-in_band_lifetimes.rs:70:27
|
LL | fn borrowed_lifetime(&'b self) -> &'b u8 { &*self.0 }
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/feature-gate-in_band_lifetimes.rs:67:40
+ --> $DIR/feature-gate-in_band_lifetimes.rs:70:40
|
LL | fn borrowed_lifetime(&'b self) -> &'b u8 { &*self.0 }
| ^^ undeclared lifetime
#[link(name = "rust_test_helpers", kind = "static")]
extern {
returns_isize!(rust_get_test_int);
- //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+ //~^ ERROR macro invocations in `extern {}` blocks are experimental
takes_u32_returns_u32!(rust_dbg_extern_identity_u32);
- //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+ //~^ ERROR macro invocations in `extern {}` blocks are experimental
emits_nothing!();
- //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+ //~^ ERROR macro invocations in `extern {}` blocks are experimental
}
-error[E0658]: macro and proc-macro invocations in `extern {}` blocks are experimental. (see issue #49476)
+error[E0658]: macro invocations in `extern {}` blocks are experimental (see issue #49476)
--> $DIR/feature-gate-macros_in_extern.rs:29:5
|
LL | returns_isize!(rust_get_test_int);
|
= help: add #![feature(macros_in_extern)] to the crate attributes to enable
-error[E0658]: macro and proc-macro invocations in `extern {}` blocks are experimental. (see issue #49476)
+error[E0658]: macro invocations in `extern {}` blocks are experimental (see issue #49476)
--> $DIR/feature-gate-macros_in_extern.rs:31:5
|
LL | takes_u32_returns_u32!(rust_dbg_extern_identity_u32);
|
= help: add #![feature(macros_in_extern)] to the crate attributes to enable
-error[E0658]: macro and proc-macro invocations in `extern {}` blocks are experimental. (see issue #49476)
+error[E0658]: macro invocations in `extern {}` blocks are experimental (see issue #49476)
--> $DIR/feature-gate-macros_in_extern.rs:33:5
|
LL | emits_nothing!();
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// compile-flags: -C no-prepopulate-passes
+// compile-flags: -C no-prepopulate-passes -Cpasses=name-anon-globals
#![crate_type = "lib"]
--- /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.
+
+#![allow(stable_features)]
+
+#![feature(rust1)]
+#![feature(rust1)] //~ ERROR the feature `rust1` has already been declared
+
+#![feature(if_let)]
+#![feature(if_let)] //~ ERROR the feature `if_let` has already been declared
+
+fn main() {}
--- /dev/null
+error[E0636]: the feature `if_let` has already been declared
+ --> $DIR/duplicate-features.rs:17:12
+ |
+LL | #![feature(if_let)] //~ ERROR the feature `if_let` has already been declared
+ | ^^^^^^
+
+error[E0636]: the feature `rust1` has already been declared
+ --> $DIR/duplicate-features.rs:14:12
+ |
+LL | #![feature(rust1)] //~ ERROR the feature `rust1` has already been declared
+ | ^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0636`.
#![feature(rustc_attrs)] // For `rustc_error`; see note below.
#![warn(unused_attributes, unknown_lints)]
#![allow(dead_code)]
+#![allow(stable_features)]
// UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES
// For #![crate_id], see issue #43142. (I cannot bear to enshrine current behavior in a test)
// FIXME(#44232) we should warn that this isn't used.
-#![feature ( x0600)]
+#![feature ( rust1)]
// For #![no_start], see issue #43144. (I cannot bear to enshrine current behavior in a test)
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:49:33
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:50:33
|
LL | #![warn (x5400)] //~ WARN unknown lint: `x5400`
| ^^^^^
| ^^^^^^^^^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:50:33
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:51:33
|
LL | #![allow (x5300)] //~ WARN unknown lint: `x5300`
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:51:33
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:52:33
|
LL | #![forbid (x5200)] //~ WARN unknown lint: `x5200`
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:52:33
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:33
|
LL | #![deny (x5100)] //~ WARN unknown lint: `x5100`
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:114:8
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:115:8
|
LL | #[warn(x5400)]
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:117:25
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:118:25
|
LL | mod inner { #![warn(x5400)] }
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:120:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:121:12
|
LL | #[warn(x5400)] fn f() { }
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:123:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:124:12
|
LL | #[warn(x5400)] struct S;
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:126:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:127:12
|
LL | #[warn(x5400)] type T = S;
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:129:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:130:12
|
LL | #[warn(x5400)] impl S { }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:133:9
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:134:9
|
LL | #[allow(x5300)]
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:136:26
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:137:26
|
LL | mod inner { #![allow(x5300)] }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:139:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:140:13
|
LL | #[allow(x5300)] fn f() { }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:142:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:143:13
|
LL | #[allow(x5300)] struct S;
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:145:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:146:13
|
LL | #[allow(x5300)] type T = S;
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:148:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:149:13
|
LL | #[allow(x5300)] impl S { }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:152:10
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:153:10
|
LL | #[forbid(x5200)]
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:155:27
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:156:27
|
LL | mod inner { #![forbid(x5200)] }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:158:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:159:14
|
LL | #[forbid(x5200)] fn f() { }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:161:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:162:14
|
LL | #[forbid(x5200)] struct S;
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:164:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:165:14
|
LL | #[forbid(x5200)] type T = S;
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:167:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:168:14
|
LL | #[forbid(x5200)] impl S { }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:171:8
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:172:8
|
LL | #[deny(x5100)]
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:174:25
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:175:25
|
LL | mod inner { #![deny(x5100)] }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:177:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:178:12
|
LL | #[deny(x5100)] fn f() { }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:180:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:181:12
|
LL | #[deny(x5100)] struct S;
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:183:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:184:12
|
LL | #[deny(x5100)] type T = S;
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:186:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:187:12
|
LL | #[deny(x5100)] impl S { }
| ^^^^^
warning: macro_escape is a deprecated synonym for macro_use
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:500:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:501:1
|
LL | #[macro_escape]
| ^^^^^^^^^^^^^^^
warning: macro_escape is a deprecated synonym for macro_use
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:503:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:504:17
|
LL | mod inner { #![macro_escape] }
| ^^^^^^^^^^^^^^^^
= help: consider an outer attribute, #[macro_use] mod ...
warning: `repr` attribute isn't configurable with a literal
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:316:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:317:17
|
LL | mod inner { #![repr="3900"] }
| ^^^^^^^^^^^^^^^ needs a hint
= note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
warning: `repr` attribute isn't configurable with a literal
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:320:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:321:5
|
LL | #[repr = "3900"] fn f() { }
| ^^^^^^^^^^^^^^^^ needs a hint
= note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
warning: `repr` attribute isn't configurable with a literal
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:326:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:327:5
|
LL | #[repr = "3900"] type T = S;
| ^^^^^^^^^^^^^^^^ needs a hint
= note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
warning: `repr` attribute isn't configurable with a literal
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:330:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:331:5
|
LL | #[repr = "3900"] impl S { }
| ^^^^^^^^^^^^^^^^ needs a hint
= note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
warning: `repr` attribute isn't configurable with a literal
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:312:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:313:1
|
LL | #[repr = "3900"]
| ^^^^^^^^^^^^^^^^ needs a hint
= note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
warning: `repr` attribute isn't configurable with a literal
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:62:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:63:1
|
LL | #![repr = "3900"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ needs a hint
= note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:194:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:195:5
|
LL | #[macro_use] fn f() { }
| ^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:197:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:198:5
|
LL | #[macro_use] struct S;
| ^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:200:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:201:5
|
LL | #[macro_use] type T = S;
| ^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:203:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:5
|
LL | #[macro_use] impl S { }
| ^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:210:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:211:17
|
LL | mod inner { #![macro_export="4800"] }
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:213:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:214:5
|
LL | #[macro_export = "4800"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:216:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:217:5
|
LL | #[macro_export = "4800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:219:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:220:5
|
LL | #[macro_export = "4800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:222:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:223:5
|
LL | #[macro_export = "4800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:207:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:208:1
|
LL | #[macro_export = "4800"]
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:229:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:230:17
|
LL | mod inner { #![plugin_registrar="4700"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:234:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:235:5
|
LL | #[plugin_registrar = "4700"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:237:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:238:5
|
LL | #[plugin_registrar = "4700"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:240:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5
|
LL | #[plugin_registrar = "4700"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:226:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:227:1
|
LL | #[plugin_registrar = "4700"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:247:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:248:17
|
LL | mod inner { #![main="4300"] }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:252:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:253:5
|
LL | #[main = "4400"] struct S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:255:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:256:5
|
LL | #[main = "4400"] type T = S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:258:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:259:5
|
LL | #[main = "4400"] impl S { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:244:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:245:1
|
LL | #[main = "4400"]
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:265:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:266:17
|
LL | mod inner { #![start="4300"] }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:270:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:271:5
|
LL | #[start = "4300"] struct S;
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:273:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:274:5
|
LL | #[start = "4300"] type T = S;
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:276:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:277:5
|
LL | #[start = "4300"] impl S { }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:262:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:263:1
|
LL | #[start = "4300"]
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:316:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:317:17
|
LL | mod inner { #![repr="3900"] }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:320:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:321:5
|
LL | #[repr = "3900"] fn f() { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:326:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:327:5
|
LL | #[repr = "3900"] type T = S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:330:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:331:5
|
LL | #[repr = "3900"] impl S { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:312:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:313:1
|
LL | #[repr = "3900"]
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:339:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:340:5
|
LL | #[path = "3800"] fn f() { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:342:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:343:5
|
LL | #[path = "3800"] struct S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:345:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:346:5
|
LL | #[path = "3800"] type T = S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:348:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:349:5
|
LL | #[path = "3800"] impl S { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:356:17
|
LL | mod inner { #![abi="3700"] }
| ^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:358:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:359:5
|
LL | #[abi = "3700"] fn f() { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:362:5
|
LL | #[abi = "3700"] struct S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:364:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:365:5
|
LL | #[abi = "3700"] type T = S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:368:5
|
LL | #[abi = "3700"] impl S { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:352:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:353:1
|
LL | #[abi = "3700"]
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:374:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:375:17
|
LL | mod inner { #![automatically_derived="3600"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:377:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:378:5
|
LL | #[automatically_derived = "3600"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:381:5
|
LL | #[automatically_derived = "3600"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:383:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:384:5
|
LL | #[automatically_derived = "3600"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:386:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:387:5
|
LL | #[automatically_derived = "3600"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:371:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:372:1
|
LL | #[automatically_derived = "3600"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: function is marked #[no_mangle], but not exported
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:27
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:395: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:407:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:17
|
LL | mod inner { #![no_link="3400"] }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:410:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:5
|
LL | #[no_link = "3400"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:413:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:5
|
LL | #[no_link = "3400"] struct S;
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:416:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:5
|
LL | #[no_link = "3400"]type T = S;
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:419:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:5
|
LL | #[no_link = "3400"] impl S { }
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:404:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:405:1
|
LL | #[no_link = "3400"]
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:427:17
|
LL | mod inner { #![should_panic="3200"] }
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:429:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:430:5
|
LL | #[should_panic = "3200"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:433:5
|
LL | #[should_panic = "3200"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:435:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:436:5
|
LL | #[should_panic = "3200"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:439:5
|
LL | #[should_panic = "3200"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:423:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:424:1
|
LL | #[should_panic = "3200"]
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:445:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:446:17
|
LL | mod inner { #![ignore="3100"] }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:448:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:449:5
|
LL | #[ignore = "3100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:451:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:452:5
|
LL | #[ignore = "3100"] struct S;
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:454:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:455:5
|
LL | #[ignore = "3100"] type T = S;
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:5
|
LL | #[ignore = "3100"] impl S { }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:442:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:443:1
|
LL | #[ignore = "3100"]
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:464:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:17
|
LL | mod inner { #![no_implicit_prelude="3000"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:467:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:468:5
|
LL | #[no_implicit_prelude = "3000"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:471:5
|
LL | #[no_implicit_prelude = "3000"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:5
|
LL | #[no_implicit_prelude = "3000"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:477:5
|
LL | #[no_implicit_prelude = "3000"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:461:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:1
|
LL | #[no_implicit_prelude = "3000"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:483:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:484:17
|
LL | mod inner { #![reexport_test_harness_main="2900"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:486:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:487:5
|
LL | #[reexport_test_harness_main = "2900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:489:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:490:5
|
LL | #[reexport_test_harness_main = "2900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:492:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:493:5
|
LL | #[reexport_test_harness_main = "2900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:495:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:496:5
|
LL | #[reexport_test_harness_main = "2900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:481:1
|
LL | #[reexport_test_harness_main = "2900"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:506:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:507:5
|
LL | #[macro_escape] fn f() { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:509:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:510:5
|
LL | #[macro_escape] struct S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:513:5
|
LL | #[macro_escape] type T = S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:515:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:516:5
|
LL | #[macro_escape] impl S { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:523:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:524: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:523:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:524:17
|
LL | mod inner { #![no_std="2600"] }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:527:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:528: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:527:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:528:5
|
LL | #[no_std = "2600"] fn f() { }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:531:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532: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:531:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532:5
|
LL | #[no_std = "2600"] struct S;
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:535:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:536: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:535:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:536:5
|
LL | #[no_std = "2600"] type T = S;
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:539:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:540: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:539:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:540:5
|
LL | #[no_std = "2600"] impl S { }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:519:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:520: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:519:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:520:1
|
LL | #[no_std = "2600"]
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:678:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679: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:678:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:17
|
LL | mod inner { #![crate_name="0900"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:682:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683: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:682:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:5
|
LL | #[crate_name = "0900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:686:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687: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:686:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:5
|
LL | #[crate_name = "0900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:690:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691: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:690:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5
|
LL | #[crate_name = "0900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:694:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695: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:694:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5
|
LL | #[crate_name = "0900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675: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:674:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:1
|
LL | #[crate_name = "0900"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704: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:703:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:17
|
LL | mod inner { #![crate_type="0800"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708: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:707:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:5
|
LL | #[crate_type = "0800"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:711:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712: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:711:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:5
|
LL | #[crate_type = "0800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:715:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716: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:715:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5
|
LL | #[crate_type = "0800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:719:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720: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:719:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
|
LL | #[crate_type = "0800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700: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:699:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:1
|
LL | #[crate_type = "0800"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:17
|
LL | mod inner { #![feature(x0600)] }
| ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:17
|
LL | mod inner { #![feature(x0600)] }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:732:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733: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:732:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5
|
LL | #[feature(x0600)] fn f() { }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:736:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737: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:736:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:5
|
LL | #[feature(x0600)] struct S;
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:740:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741: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:740:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741:5
|
LL | #[feature(x0600)] type T = S;
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745: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:744:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5
|
LL | #[feature(x0600)] impl S { }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725: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:724:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:1
|
LL | #[feature(x0600)]
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755: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:754:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:17
|
LL | mod inner { #![no_main="0400"] }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:758:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759: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:758:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5
|
LL | #[no_main = "0400"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:762:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763: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:762:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:5
|
LL | #[no_main = "0400"] struct S;
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:766:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:767: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:766:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:767:5
|
LL | #[no_main = "0400"] type T = S;
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:770:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:771: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:770:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:771:5
|
LL | #[no_main = "0400"] impl S { }
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751: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:750:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:1
|
LL | #[no_main = "0400"]
| ^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793: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:792:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:17
|
LL | mod inner { #![recursion_limit="0200"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:797: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:796:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:797:5
|
LL | #[recursion_limit="0200"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:800:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801: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:800:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:5
|
LL | #[recursion_limit="0200"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:804:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805: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:804:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:5
|
LL | #[recursion_limit="0200"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:808:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809: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:808:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809:5
|
LL | #[recursion_limit="0200"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789: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:788:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:1
|
LL | #[recursion_limit="0200"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818: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:817:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:17
|
LL | mod inner { #![type_length_limit="0100"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:821:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:822: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:821:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:5
|
LL | #[type_length_limit="0100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:825:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826: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:825:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:5
|
LL | #[type_length_limit="0100"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:829:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830: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:829:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:5
|
LL | #[type_length_limit="0100"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:833:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834: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:833:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834:5
|
LL | #[type_length_limit="0100"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:813:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814: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:813:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:1
|
LL | #[type_length_limit="0100"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:54:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:1
|
LL | #![macro_export = "4800"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:56:1
|
LL | #![plugin_registrar = "4700"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:58:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1
|
LL | #![main = "x4400"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1
|
LL | #![start = "x4300"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:62:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:63:1
|
LL | #![repr = "3900"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:65:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:66:1
|
LL | #![path = "3800"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:66:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:67:1
|
LL | #![abi = "3700"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:67:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:68:1
|
LL | #![automatically_derived = "3600"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:69:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:70:1
|
LL | #![no_link = "3400"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:71:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:72:1
|
LL | #![should_panic = "3200"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:72:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:73:1
|
LL | #![ignore = "3100"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:78:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:79:1
|
LL | #![proc_macro_derive = "2500"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: compilation successful
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:844:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:845:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | println!("Hello World");
--- /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.
+
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
+
+#![feature(staged_api)]
+
+#[stable(feature = "foo", since = "1.0.0")]
+fn foo_stable_1_0_0() {}
+
+#[stable(feature = "foo", since = "1.29.0")]
+//~^ ERROR feature `foo` is declared stable since 1.29.0
+fn foo_stable_1_29_0() {}
+
+#[unstable(feature = "foo", issue = "0")]
+//~^ ERROR feature `foo` is declared unstable
+fn foo_unstable() {}
+
+fn main() {}
--- /dev/null
+error[E0711]: feature `foo` is declared stable since 1.29.0, but was previously declared stable since 1.0.0
+ --> $DIR/stability-attribute-consistency.rs:18:1
+ |
+LL | #[stable(feature = "foo", since = "1.29.0")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0711]: feature `foo` is declared unstable, but was previously declared stable
+ --> $DIR/stability-attribute-consistency.rs:22:1
+ |
+LL | #[unstable(feature = "foo", issue = "0")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0711`.
--- /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(unknown_rust_feature)] //~ ERROR unknown feature
+
+fn main() {}
--- /dev/null
+error[E0635]: unknown feature `unknown_rust_feature`
+ --> $DIR/unknown-feature.rs:11:12
+ |
+LL | #![feature(unknown_rust_feature)] //~ ERROR unknown feature
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0635`.
--- /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.
+
+// Test that we do not yet support elision in associated types, even
+// when there is just one name we could take from the impl header.
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait {
+ type Output;
+}
+
+impl MyTrait for &i32 {
+ type Output = &i32;
+ //~^ ERROR missing lifetime specifier
+}
+
+impl MyTrait for &u32 {
+ type Output = &'_ i32;
+ //~^ ERROR missing lifetime specifier
+}
+
+// This is what you have to do:
+impl<'a> MyTrait for &'a f32 {
+ type Output = &'a f32;
+}
+
+fn main() { }
--- /dev/null
+error[E0106]: missing lifetime specifier
+ --> $DIR/assoc-type.rs:23:19
+ |
+LL | type Output = &i32;
+ | ^ expected lifetime parameter
+
+error[E0106]: missing lifetime specifier
+ --> $DIR/assoc-type.rs:28:20
+ |
+LL | type Output = &'_ i32;
+ | ^^ expected lifetime parameter
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
--- /dev/null
+warning: not reporting region error due to nll
+ --> $DIR/dyn-trait.rs:32:16
+ |
+LL | static_val(x); //~ ERROR cannot infer
+ | ^
+
+error: borrowed data escapes outside of function
+ --> $DIR/dyn-trait.rs:32:5
+ |
+LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
+ | - `x` is a reference that is only valid in the function body
+LL | static_val(x); //~ ERROR cannot infer
+ | ^^^^^^^^^^^^^ `x` escapes the function body 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.
+
+// Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
+// 'b> MyTrait<'a> for &'b i32`.
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+use std::fmt::Debug;
+
+// Equivalent to `Box<dyn Debug + 'static>`:
+trait StaticTrait { }
+impl StaticTrait for Box<dyn Debug> { }
+
+// Equivalent to `Box<dyn Debug + 'static>`:
+trait NotStaticTrait { }
+impl NotStaticTrait for Box<dyn Debug + '_> { }
+
+fn static_val<T: StaticTrait>(_: T) {
+}
+
+fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
+ static_val(x); //~ ERROR cannot infer
+}
+
+fn not_static_val<T: NotStaticTrait>(_: T) {
+}
+
+fn with_dyn_debug_not_static<'a>(x: Box<dyn Debug + 'a>) {
+ not_static_val(x); // OK
+}
+
+fn main() {
+}
--- /dev/null
+error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
+ --> $DIR/dyn-trait.rs:32:16
+ |
+LL | static_val(x); //~ ERROR cannot infer
+ | ^
+ |
+note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 31:26...
+ --> $DIR/dyn-trait.rs:31:26
+ |
+LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
+ | ^^
+ = note: ...so that the expression is assignable:
+ expected std::boxed::Box<dyn std::fmt::Debug>
+ found std::boxed::Box<(dyn std::fmt::Debug + 'a)>
+ = note: but, the lifetime must be valid for the static lifetime...
+ = note: ...so that the types are compatible:
+ expected StaticTrait
+ found StaticTrait
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0495`.
--- /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.
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait { }
+
+struct Foo<'a> { x: &'a u32 }
+
+impl MyTrait for Foo {
+ //~^ ERROR missing lifetime specifier
+}
+
+fn main() {}
--- /dev/null
+error[E0106]: missing lifetime specifier
+ --> $DIR/path-elided.rs:18:18
+ |
+LL | impl MyTrait for Foo {
+ | ^^^ expected lifetime parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0106`.
--- /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.
+
+// Test that `impl MyTrait for Foo<'_>` works.
+
+// run-pass
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait { }
+
+struct Foo<'a> { x: &'a u32 }
+
+impl MyTrait for Foo<'_> {
+}
+
+fn impls_my_trait<T: MyTrait>() { }
+
+fn impls_my_trait_val<T: MyTrait>(_: T) {
+ impls_my_trait::<T>();
+}
+
+fn random_where_clause()
+where for<'a> Foo<'a>: MyTrait { }
+
+fn main() {
+ let x = 22;
+ let f = Foo { x: &x };
+
+ // This type is `Foo<'x>` for a local lifetime `'x`; so the impl
+ // must apply to any lifetime to apply to this.
+ impls_my_trait_val(f);
+
+ impls_my_trait::<Foo<'static>>();
+
+ random_where_clause();
+}
--- /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.
+
+// Test that `impl MyTrait for &i32` works and is equivalent to any lifetime.
+
+// run-pass
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait { }
+
+impl MyTrait for &i32 {
+}
+
+fn impls_my_trait<T: MyTrait>() { }
+
+fn impls_my_trait_val<T: MyTrait>(_: T) {
+ impls_my_trait::<T>();
+}
+
+fn random_where_clause()
+where for<'a> &'a i32: MyTrait { }
+
+fn main() {
+ let x = 22;
+ let f = &x;
+
+ impls_my_trait_val(f);
+
+ impls_my_trait::<&'static i32>();
+
+ random_where_clause();
+}
--- /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.
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait<'a> { }
+
+impl MyTrait for u32 {
+ //~^ ERROR missing lifetime specifier
+}
+
+fn main() {}
--- /dev/null
+error[E0106]: missing lifetime specifier
+ --> $DIR/trait-elided.rs:16:6
+ |
+LL | impl MyTrait for u32 {
+ | ^^^^^^^ expected lifetime parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0106`.
--- /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.
+
+// Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
+// 'b> MyTrait<'a> for &'b i32`.
+//
+// run-pass
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait<'a> { }
+
+// This is equivalent to `MyTrait<'a> for &'b i32`, which is proven by
+// the code below.
+impl MyTrait<'_> for &i32 {
+}
+
+// When called, T will be `&'x i32` for some `'x`, so since we can
+// prove that `&'x i32: for<'a> MyTrait<'a>, then we know that the
+// lifetime parameter above is disconnected.
+fn impls_my_trait<T: for<'a> MyTrait<'a>>() { }
+
+fn impls_my_trait_val<T: for<'a> MyTrait<'a>>(_: T) {
+ impls_my_trait::<T>();
+}
+
+fn random_where_clause()
+where for<'a, 'b> &'a i32: MyTrait<'b> { }
+
+fn main() {
+ let x = 22;
+ let f = &x;
+ impls_my_trait_val(f);
+
+ impls_my_trait::<&'static i32>();
+
+ random_where_clause();
+}
// aux-build:two_macros.rs
-#![feature(item_like_imports, use_extern_macros)]
+#![feature(use_extern_macros)]
extern crate two_macros; // two identity macros `m` and `n`
+++ /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.
-
-// Test that we do not yet support elision in associated types, even
-// when there is just one name we could take from the impl header.
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait {
- type Output;
-}
-
-impl MyTrait for &i32 {
- type Output = &i32;
- //~^ ERROR missing lifetime specifier
-}
-
-impl MyTrait for &u32 {
- type Output = &'_ i32;
- //~^ ERROR missing lifetime specifier
-}
-
-// This is what you have to do:
-impl MyTrait for &'a f32 {
- type Output = &'a f32;
-}
-
-fn main() { }
+++ /dev/null
-error[E0106]: missing lifetime specifier
- --> $DIR/assoc-type.rs:23:19
- |
-LL | type Output = &i32;
- | ^ expected lifetime parameter
-
-error[E0106]: missing lifetime specifier
- --> $DIR/assoc-type.rs:28:20
- |
-LL | type Output = &'_ i32;
- | ^^ expected lifetime parameter
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0106`.
+++ /dev/null
-warning: not reporting region error due to nll
- --> $DIR/dyn-trait.rs:32:16
- |
-LL | static_val(x); //~ ERROR cannot infer
- | ^
-
-error: borrowed data escapes outside of function
- --> $DIR/dyn-trait.rs:32:5
- |
-LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
- | - `x` is a reference that is only valid in the function body
-LL | static_val(x); //~ ERROR cannot infer
- | ^^^^^^^^^^^^^ `x` escapes the function body 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.
-
-// Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
-// 'b> MyTrait<'a> for &'b i32`.
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-use std::fmt::Debug;
-
-// Equivalent to `Box<dyn Debug + 'static>`:
-trait StaticTrait { }
-impl StaticTrait for Box<dyn Debug> { }
-
-// Equivalent to `Box<dyn Debug + 'static>`:
-trait NotStaticTrait { }
-impl NotStaticTrait for Box<dyn Debug + '_> { }
-
-fn static_val<T: StaticTrait>(_: T) {
-}
-
-fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
- static_val(x); //~ ERROR cannot infer
-}
-
-fn not_static_val<T: NotStaticTrait>(_: T) {
-}
-
-fn with_dyn_debug_not_static<'a>(x: Box<dyn Debug + 'a>) {
- not_static_val(x); // OK
-}
-
-fn main() {
-}
+++ /dev/null
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
- --> $DIR/dyn-trait.rs:32:16
- |
-LL | static_val(x); //~ ERROR cannot infer
- | ^
- |
-note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 31:26...
- --> $DIR/dyn-trait.rs:31:26
- |
-LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
- | ^^
- = note: ...so that the expression is assignable:
- expected std::boxed::Box<dyn std::fmt::Debug>
- found std::boxed::Box<(dyn std::fmt::Debug + 'a)>
- = note: but, the lifetime must be valid for the static lifetime...
- = note: ...so that the types are compatible:
- expected StaticTrait
- found StaticTrait
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
+++ /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.
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait { }
-
-struct Foo<'a> { x: &'a u32 }
-
-impl MyTrait for Foo {
- //~^ ERROR missing lifetime specifier
-}
-
-fn main() {}
+++ /dev/null
-error[E0106]: missing lifetime specifier
- --> $DIR/path-elided.rs:18:18
- |
-LL | impl MyTrait for Foo {
- | ^^^ expected lifetime parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0106`.
+++ /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.
-
-// Test that `impl MyTrait for Foo<'_>` works.
-
-// run-pass
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait { }
-
-struct Foo<'a> { x: &'a u32 }
-
-impl MyTrait for Foo<'_> {
-}
-
-fn impls_my_trait<T: MyTrait>() { }
-
-fn impls_my_trait_val<T: MyTrait>(_: T) {
- impls_my_trait::<T>();
-}
-
-fn random_where_clause()
-where for<'a> Foo<'a>: MyTrait { }
-
-fn main() {
- let x = 22;
- let f = Foo { x: &x };
-
- // This type is `Foo<'x>` for a local lifetime `'x`; so the impl
- // must apply to any lifetime to apply to this.
- impls_my_trait_val(f);
-
- impls_my_trait::<Foo<'static>>();
-
- random_where_clause();
-}
+++ /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.
-
-// Test that `impl MyTrait for &i32` works and is equivalent to any lifetime.
-
-// run-pass
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait { }
-
-impl MyTrait for &i32 {
-}
-
-fn impls_my_trait<T: MyTrait>() { }
-
-fn impls_my_trait_val<T: MyTrait>(_: T) {
- impls_my_trait::<T>();
-}
-
-fn random_where_clause()
-where for<'a> &'a i32: MyTrait { }
-
-fn main() {
- let x = 22;
- let f = &x;
-
- impls_my_trait_val(f);
-
- impls_my_trait::<&'static i32>();
-
- random_where_clause();
-}
+++ /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.
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait<'a> { }
-
-impl MyTrait for u32 {
- //~^ ERROR missing lifetime specifier
-}
-
-fn main() {}
+++ /dev/null
-error[E0106]: missing lifetime specifier
- --> $DIR/trait-elided.rs:16:6
- |
-LL | impl MyTrait for u32 {
- | ^^^^^^^ expected lifetime parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0106`.
+++ /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.
-
-// Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
-// 'b> MyTrait<'a> for &'b i32`.
-//
-// run-pass
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait<'a> { }
-
-// This is equivalent to `MyTrait<'a> for &'b i32`, which is proven by
-// the code below.
-impl MyTrait<'_> for &i32 {
-}
-
-// When called, T will be `&'x i32` for some `'x`, so since we can
-// prove that `&'x i32: for<'a> MyTrait<'a>, then we know that the
-// lifetime parameter above is disconnected.
-fn impls_my_trait<T: for<'a> MyTrait<'a>>() { }
-
-fn impls_my_trait_val<T: for<'a> MyTrait<'a>>(_: T) {
- impls_my_trait::<T>();
-}
-
-fn random_where_clause()
-where for<'a, 'b> &'a i32: MyTrait<'b> { }
-
-fn main() {
- let x = 22;
- let f = &x;
- impls_my_trait_val(f);
-
- impls_my_trait::<&'static i32>();
-
- random_where_clause();
-}
--> $DIR/mismatched.rs:14:42
|
LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
- | - ^ lifetime `'a` required
- | |
- | consider changing the type of `y` to `&'a u32`
+ | ---- ^ lifetime `'a` required
+ | |
+ | help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/mismatched.rs:16:46
|
LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
- | ------- ------- ^ ...but data from `y` is returned here
- | |
- | this parameter and the return type are declared with different lifetimes...
+ | -- -- ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
+ | | |
+ | | lifetime `'b` defined here
+ | lifetime `'a` defined here
error: aborting due to 2 previous errors
-Some errors occurred: E0621, E0623.
-For more information about an error, try `rustc --explain E0621`.
+For more information about this error, try `rustc --explain E0621`.
--> $DIR/mismatched.rs:14:42
|
LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
- | - ^ lifetime `'a` required
- | |
- | consider changing the type of `y` to `&'a u32`
+ | ---- ^ lifetime `'a` required
+ | |
+ | help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
error[E0623]: lifetime mismatch
--> $DIR/mismatched.rs:16:46
--> $DIR/mismatched_trait.rs:16:9
|
LL | fn baz(&self, x: &'a u32, y: &u32) -> &'a u32 {
- | - consider changing the type of `y` to `&'a u32`
+ | ---- help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
LL | y //~ ERROR explicit lifetime required
| ^ lifetime `'a` required
--> $DIR/mismatched_trait.rs:16:9
|
LL | fn baz(&self, x: &'a u32, y: &u32) -> &'a u32 {
- | - consider changing the type of `y` to `&'a u32`
+ | ---- help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
LL | y //~ ERROR explicit lifetime required
| ^ lifetime `'a` required
fn main() {
concat!(test!());
- //~^ ERROR expected a macro, found non-macro attribute
+ //~^ ERROR expected a macro, found built-in attribute
}
-error: expected a macro, found non-macro attribute
+error: expected a macro, found built-in attribute
--> $DIR/issue-11692-2.rs:12:13
|
LL | concat!(test!());
--> $DIR/issue-13058.rs:24:26
|
LL | fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
- | ---- consider changing the type of `cont` to `&'r T`
+ | -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T`
LL | {
LL | let cont_iter = cont.iter();
| ^^^^ lifetime `'r` required
--> $DIR/issue-14285.rs:22:7
|
LL | fn foo<'a>(a: &Foo) -> B<'a> {
- | - consider changing the type of `a` to `&'a (dyn Foo + 'a)`
+ | ---- help: add explicit lifetime `'a` to the type of `a`: `&'a (dyn Foo + 'a)`
LL | B(a) //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621]
| ^ lifetime `'a` required
--> $DIR/issue-14285.rs:22:5
|
LL | fn foo<'a>(a: &Foo) -> B<'a> {
- | - consider changing the type of `a` to `&'a (dyn Foo + 'a)`
+ | ---- help: add explicit lifetime `'a` to the type of `a`: `&'a (dyn Foo + 'a)`
LL | B(a) //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621]
| ^^^^ lifetime `'a` required
--> $DIR/issue-15034.rs:27:25
|
LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
- | ----- consider changing the type of `lexer` to `&'a mut Lexer<'a>`
+ | ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`
LL | Parser { lexer: lexer }
| ^^^^^ lifetime `'a` required
--> $DIR/issue-15034.rs:27:25
|
LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
- | ----- consider changing the type of `lexer` to `&'a mut Lexer<'a>`
+ | ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`
LL | Parser { lexer: lexer }
| ^^^^^ lifetime `'a` required
--> $DIR/issue-16922.rs:14:5
|
LL | fn foo<T: Any>(value: &T) -> Box<Any> {
- | ----- consider changing the type of `value` to `&'static T`
+ | -- help: add explicit lifetime `'static` to the type of `value`: `&'static T`
LL | Box::new(value) as Box<Any>
| ^^^^^^^^^^^^^^^ lifetime `'static` required
--> $DIR/issue-16922.rs:14:5
|
LL | fn foo<T: Any>(value: &T) -> Box<Any> {
- | ----- consider changing the type of `value` to `&'static T`
+ | -- help: add explicit lifetime `'static` to the type of `value`: `&'static T`
LL | Box::new(value) as Box<Any>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
#![feature(staged_api)]
#![deny(deprecated)]
-#![unstable(feature = "test_feature", issue = "0")]
+#![unstable(feature = "unstable_test_feature", issue = "0")]
struct Foo;
impl Foo {
- #[unstable(feature = "test_feature", issue = "0")]
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
fn foo(self) {}
}
// except according to those terms.
static X: usize = 0 as *const usize as usize;
-//~^ ERROR: raw pointers cannot be cast to integers in statics
+//~^ ERROR: casting pointers to integers in statics is unstable
fn main() {
assert_eq!(X, 0);
-error[E0018]: raw pointers cannot be cast to integers in statics
+error[E0658]: casting pointers to integers in statics is unstable (see issue #51910)
--> $DIR/issue-17458.rs:11:19
|
LL | static X: usize = 0 as *const usize as usize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0018`.
+For more information about this error, try `rustc --explain E0658`.
fn main() {
const X: u32 = 1;
- const Y: usize = &X as *const u32 as usize; //~ ERROR E0018
+ const Y: usize = &X as *const u32 as usize; //~ ERROR is unstable
println!("{}", Y);
}
-error[E0018]: raw pointers cannot be cast to integers in constants
+error[E0658]: casting pointers to integers in constants is unstable (see issue #51910)
--> $DIR/issue-18294.rs:13:22
|
-LL | const Y: usize = &X as *const u32 as usize; //~ ERROR E0018
+LL | const Y: usize = &X as *const u32 as usize; //~ ERROR is unstable
| ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0018`.
+For more information about this error, try `rustc --explain E0658`.
fn id<T>(t: T) -> T { t }
fn main() {
const A: bool = id::<u8> as *const () < id::<u16> as *const ();
- //~^ ERROR raw pointers cannot be compared in constants [E0395]
+ //~^ ERROR comparing raw pointers inside constant
println!("{}", A);
}
-error[E0395]: raw pointers cannot be compared in constants
+error[E0658]: comparing raw pointers inside constant (see issue #53020)
--> $DIR/issue-25826.rs:13:21
|
LL | const A: bool = id::<u8> as *const () < id::<u16> as *const ();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comparing raw pointers in static
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_compare_raw_pointers)] to the crate attributes to enable
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0395`.
+For more information about this error, try `rustc --explain E0658`.
--> $DIR/issue-3154.rs:16:15
|
LL | fn thing<'a,Q>(x: &Q) -> thing<'a,Q> {
- | - consider changing the type of `x` to `&'a Q`
+ | -- help: add explicit lifetime `'a` to the type of `x`: `&'a Q`
LL | thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621]
| ^ lifetime `'a` required
--> $DIR/issue-3154.rs:16:5
|
LL | fn thing<'a,Q>(x: &Q) -> thing<'a,Q> {
- | - consider changing the type of `x` to `&'a Q`
+ | -- help: add explicit lifetime `'a` to the type of `x`: `&'a Q`
LL | thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621]
| ^^^^^^^^^^^^^ lifetime `'a` required
--> $DIR/issue-40288-2.rs:17:9
|
LL | fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
- | - consider changing the type of `y` to `&'a T`
+ | -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
...
LL | slice[0] = y;
| ^^^^^^^^^^^^ lifetime `'a` required
--> $DIR/issue-40288-2.rs:32:9
|
LL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
- | - consider changing the type of `y` to `&'a T`
+ | -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
...
LL | dst.head = y;
| ^^^^^^^^^^^^ lifetime `'a` required
--> $DIR/issue-40288-2.rs:19:5
|
LL | fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
- | - consider changing the type of `y` to `&'a T`
+ | -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
...
LL | out[0]
| ^^^^^^ lifetime `'a` required
--> $DIR/issue-40288-2.rs:34:5
|
LL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
- | - consider changing the type of `y` to `&'a T`
+ | -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
...
LL | out.head
| ^^^^^^^^ lifetime `'a` required
error: unsatisfied lifetime constraints
--> $DIR/issue-40510-1.rs:18:9
|
-LL | || {
- | _____-
- | |_____|
- | ||
-LL | || &mut x
- | || ^^^^^^ return requires that `'1` must outlive `'2`
-LL | || };
- | || -
- | ||_____|
- | |______lifetime `'1` represents the closure body
- | lifetime `'2` appears in return type
+LL | || {
+ | --
+ | ||
+ | |return type of closure is &'2 mut std::boxed::Box<()>
+ | lifetime `'1` represents this closure's body
+LL | &mut x
+ | ^^^^^^ return requires that `'1` must outlive `'2`
+ |
+ = note: closure implements `FnMut`, so references to captured variables can't escape the closure
error: aborting due to previous error
error: unsatisfied lifetime constraints
--> $DIR/issue-40510-3.rs:18:9
|
-LL | || {
- | _____-
- | |_____|
- | ||
-LL | || || {
- | ||_________^
-LL | ||| x.push(())
-LL | ||| }
- | |||_________^ requires that `'1` must outlive `'2`
-LL | || };
- | || -
- | ||_____|
- | |______lifetime `'1` represents the closure body
- | lifetime `'2` appears in return type
+LL | || {
+ | --
+ | ||
+ | |return type of closure is [closure@$DIR/issue-40510-3.rs:18:9: 20:10 x:&'2 mut std::vec::Vec<()>]
+ | lifetime `'1` represents this closure's body
+LL | / || {
+LL | | x.push(())
+LL | | }
+ | |_________^ requires that `'1` must outlive `'2`
+ |
+ = note: closure implements `FnMut`, so references to captured variables can't escape the closure
error: aborting due to previous error
--> $DIR/issue-46983.rs:14:5
|
LL | fn foo(x: &u32) -> &'static u32 {
- | - consider changing the type of `x` to `&'static u32`
+ | ---- help: add explicit lifetime `'static` to the type of `x`: `&'static u32`
LL | &*x
| ^^^ lifetime `'static` required
error: unsatisfied lifetime constraints
--> $DIR/issue-49824.rs:22:9
|
-LL | || {
- | _____-
- | |_____|
- | ||
-LL | || || {
- | ||_________^
-LL | ||| let _y = &mut x;
-LL | ||| }
- | |||_________^ requires that `'1` must outlive `'2`
-LL | || };
- | || -
- | ||_____|
- | |______lifetime `'1` represents the closure body
- | lifetime `'2` appears in return type
+LL | || {
+ | --
+ | ||
+ | |return type of closure is [closure@$DIR/issue-49824.rs:22:9: 24:10 x:&'2 mut i32]
+ | lifetime `'1` represents this closure's body
+LL | / || {
+LL | | let _y = &mut x;
+LL | | }
+ | |_________^ requires that `'1` must outlive `'2`
+ |
+ = note: closure implements `FnMut`, so references to captured variables can't escape the closure
error: aborting due to previous error
// except according to those terms.
fn main() {
- let _ = [0; (&0 as *const i32) as usize]; //~ ERROR raw pointers cannot be cast
+ let _ = [0; (&0 as *const i32) as usize]; //~ ERROR casting pointers to integers in constants
}
-error[E0018]: raw pointers cannot be cast to integers in constants
+error[E0658]: casting pointers to integers in constants is unstable (see issue #51910)
--> $DIR/issue-52023-array-size-pointer-cast.rs:12:17
|
-LL | let _ = [0; (&0 as *const i32) as usize]; //~ ERROR raw pointers cannot be cast
+LL | let _ = [0; (&0 as *const i32) as usize]; //~ ERROR casting pointers to integers in constants
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0018`.
+For more information about this error, try `rustc --explain E0658`.
--> $DIR/42701_one_named_and_one_anonymous.rs:16:5
|
LL | fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
- | - consider changing the type of `x` to `&'a i32`
+ | ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
LL | / if true {
LL | | let p: &i32 = &a.field;
LL | | &*p
--> $DIR/42701_one_named_and_one_anonymous.rs:20:9
|
LL | fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
- | - consider changing the type of `x` to `&'a i32`
+ | ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
...
LL | &*x //~ ERROR explicit lifetime
| ^^^ lifetime `'a` required
--> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:18:15
|
LL | fn bar(&self, other: Foo) -> Foo<'a> {
- | ----- consider changing the type of `other` to `Foo<'a>`
+ | --- help: add explicit lifetime `'a` to the type of `other`: `Foo<'a>`
LL | match *self {
| ^^^^^ lifetime `'a` required
--> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:21:21
|
LL | fn bar(&self, other: Foo) -> Foo<'a> {
- | ----- consider changing the type of `other` to `Foo<'a>`
+ | --- help: add explicit lifetime `'a` to the type of `other`: `Foo<'a>`
...
LL | other //~ ERROR explicit lifetime
| ^^^^^ lifetime `'a` required
--> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:8
|
LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
- | - consider changing the type of `x` to `&'a i32`
+ | ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
| ^^^^^ lifetime `'a` required
--> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:16
|
LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
- | - consider changing the type of `x` to `&'a i32`
+ | ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
| ^ lifetime `'a` required
--> $DIR/ex1-return-one-existing-name-if-else-3.rs:11:16
|
LL | fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
- | ----^-
- | | |
- | | lifetime `'a` required
- | consider changing type to `(&'a i32, &'a i32)`
+ | ^ --------------- help: add explicit lifetime `'a` to type: `(&'a i32, &'a i32)`
+ | |
+ | lifetime `'a` required
error: aborting due to previous error
--> $DIR/ex1-return-one-existing-name-if-else-3.rs:12:27
|
LL | fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
- | ------ consider changing type to `(&'a i32, &'a i32)`
+ | --------------- help: add explicit lifetime `'a` to type: `(&'a i32, &'a i32)`
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
| ^ lifetime `'a` required
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:7
|
LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
- | - consider changing the type of `x` to `&'a i32`
+ | ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
| ^^^^^ lifetime `'a` required
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:15
|
LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
- | - consider changing the type of `x` to `&'a i32`
+ | ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
| ^ lifetime `'a` required
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:5
|
LL | fn foo<'a>(&'a self, x: &i32) -> &i32 {
- | - consider changing the type of `x` to `&'a i32`
+ | ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
LL |
LL | if true { &self.field } else { x } //~ ERROR explicit lifetime
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:36
|
LL | fn foo<'a>(&'a self, x: &i32) -> &i32 {
- | - consider changing the type of `x` to `&'a i32`
+ | ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
LL |
LL | if true { &self.field } else { x } //~ ERROR explicit lifetime
| ^ lifetime `'a` required
LL | if x > y { x } else { y } //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:21:12
|
LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
- | ---- -------
- | |
- | this parameter and the return type are declared with different lifetimes...
+ | -- - let's call the lifetime of this reference `'1`
+ | |
+ | lifetime `'a` defined here
LL |
LL | if x > y { x } else { y } //~ ERROR lifetime mismatch
- | ^^^^^ ...but data from `x` is returned here
+ | ^^^^^ requires that `'1` must outlive `'a`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
--> $DIR/ex1-return-one-existing-name-if-else.rs:12:8
|
LL | fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
- | - consider changing the type of `y` to `&'a i32`
+ | ---- help: add explicit lifetime `'a` to the type of `y`: `&'a i32`
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
| ^^^^^ lifetime `'a` required
--> $DIR/ex1-return-one-existing-name-if-else.rs:12:27
|
LL | fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
- | - consider changing the type of `y` to `&'a i32`
+ | ---- help: add explicit lifetime `'a` to the type of `y`: `&'a i32`
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
| ^ lifetime `'a` required
LL | x //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:18:5
|
LL | fn foo<'a>(&self, x: &'a i32) -> &i32 {
- | ------- ----
- | |
- | this parameter and the return type are declared with different lifetimes...
+ | -- - let's call the lifetime of this reference `'1`
+ | |
+ | lifetime `'a` defined here
LL |
LL | x //~ ERROR lifetime mismatch
- | ^ ...but data from `x` is returned here
+ | ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | if true { x } else { self } //~ ERROR lifetime mismatch
| ^^^^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex1-return-one-existing-name-self-is-anon.rs:18:9
|
LL | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
- | ----- -------
- | |
- | this parameter and the return type are declared with different lifetimes...
+ | -- - let's call the lifetime of this reference `'1`
+ | |
+ | lifetime `'a` defined here
LL |
LL | if true { x } else { self } //~ ERROR lifetime mismatch
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `self` is returned here
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'a`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
--> $DIR/ex2a-push-one-existing-name-2.rs:16:5
|
LL | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
- | - consider changing the type of `x` to `Ref<'a, i32>`
+ | -------- help: add explicit lifetime `'a` to the type of `x`: `Ref<'a, i32>`
LL | y.push(x); //~ ERROR explicit lifetime
| ^^^^^^^^^ lifetime `'a` required
--> $DIR/ex2a-push-one-existing-name-2.rs:16:12
|
LL | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
- | - consider changing the type of `x` to `Ref<'a, i32>`
+ | -------- help: add explicit lifetime `'a` to the type of `x`: `Ref<'a, i32>`
LL | y.push(x); //~ ERROR explicit lifetime
| ^ lifetime `'a` required
--> $DIR/ex2a-push-one-existing-name-early-bound.rs:17:12
|
LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
- | - consider changing the type of `y` to `&'a T`
+ | -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
...
LL | x.push(y); //~ ERROR explicit lifetime required
| ^ lifetime `'a` required
--> $DIR/ex2a-push-one-existing-name.rs:16:5
|
LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
- | - consider changing the type of `y` to `Ref<'a, i32>`
+ | -------- help: add explicit lifetime `'a` to the type of `y`: `Ref<'a, i32>`
LL | x.push(y); //~ ERROR explicit lifetime
| ^^^^^^^^^ lifetime `'a` required
--> $DIR/ex2a-push-one-existing-name.rs:16:12
|
LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
- | - consider changing the type of `y` to `Ref<'a, i32>`
+ | -------- help: add explicit lifetime `'a` to the type of `y`: `Ref<'a, i32>`
LL | x.push(y); //~ ERROR explicit lifetime
| ^ lifetime `'a` required
LL | x.push(y); //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex2b-push-no-existing-names.rs:16:5
|
LL | fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
- | -------- -------- these two types are declared with different lifetimes...
+ | -------- -------- lifetime `'1` appears in this type
+ | |
+ | lifetime `'2` appears in this type
LL | x.push(y); //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^^^ argument requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | let z = Ref { data: y.data };
| ^^^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex2c-push-inference-variable.rs:17:5
|
LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
- | ------------ ------------ these two types are declared with different lifetimes...
+ | -- -- lifetime `'c` defined here
+ | |
+ | lifetime `'b` defined here
LL | let z = Ref { data: y.data };
LL | x.push(z); //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^^^ argument requires that `'c` must outlive `'b`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | let b = Ref { data: y.data };
| ^^^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex2d-push-inference-variable-2.rs:18:5
|
LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
- | ------------ ------------ these two types are declared with different lifetimes...
+ | -- -- lifetime `'c` defined here
+ | |
+ | lifetime `'b` defined here
...
LL | a.push(b);
- | ^^^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^^^ argument requires that `'c` must outlive `'b`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | let b = Ref { data: y.data };
| ^^^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex2e-push-inference-variable-3.rs:18:5
|
LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
- | ------------ ------------ these two types are declared with different lifetimes...
+ | -- -- lifetime `'c` defined here
+ | |
+ | lifetime `'b` defined here
...
LL | Vec::push(a, b);
- | ^^^^^^^^^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^^^^^^^^^ argument requires that `'c` must outlive `'b`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | *v = x; //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-2.rs:12:5
|
LL | fn foo(&mut (ref mut v, w): &mut (&u8, &u8), x: &u8) {
- | --- --- these two types are declared with different lifetimes...
+ | - - let's call the lifetime of this reference `'1`
+ | |
+ | let's call the lifetime of this reference `'2`
LL | *v = x; //~ ERROR lifetime mismatch
- | ^^^^^^ ...but data from `x` flows here
+ | ^^^^^^ requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | z.push((x,y)); //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-3.rs:12:5
|
LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
- | --- --- these two types are declared with different lifetimes...
+ | - - let's call the lifetime of this reference `'1`
+ | |
+ | let's call the lifetime of this reference `'2`
LL | z.push((x,y)); //~ ERROR lifetime mismatch
- | ^^^^^^^^^^^^^ ...but data flows into `z` here
+ | ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-3.rs:12:5
|
LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
- | --- --- these two types are declared with different lifetimes...
+ | - - let's call the lifetime of this reference `'1`
+ | |
+ | let's call the lifetime of this reference `'2`
LL | z.push((x,y)); //~ ERROR lifetime mismatch
- | ^^^^^^^^^^^^^ ...but data flows into `z` here
+ | ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0623`.
LL | x.b = y.b; //~ ERROR lifetime mismatch
| ^^^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:16:5
|
LL | fn foo(mut x: Ref, y: Ref) {
- | --- --- these two types are declared with different lifetimes...
+ | --- --- lifetime `'1` appears in this type
+ | |
+ | lifetime `'2` appears in this type
LL | x.b = y.b; //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^^^ requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | x.a = x.b; //~ ERROR lifetime mismatch
| ^^^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:16:5
|
LL | fn foo(mut x: Ref) {
| ---
| |
- | this type is declared with multiple lifetimes...
+ | lifetime `'1` appears in this type
+ | lifetime `'2` appears in this type
LL | x.a = x.b; //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data with one lifetime flows into the other here
+ | ^^^^^^^^^ requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | x.a = x.b; //~ ERROR lifetime mismatch
| ^^^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-both-are-structs-4.rs:16:5
|
LL | fn foo(mut x: Ref) {
| ---
| |
- | this type is declared with multiple lifetimes...
+ | lifetime `'1` appears in this type
+ | lifetime `'2` appears in this type
LL | x.a = x.b; //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data with one lifetime flows into the other here
+ | ^^^^^^^^^ requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | x.push(y); //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:18:5
|
LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>)
- | ------- ------- these two types are declared with different lifetimes...
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
...
LL | x.push(y); //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^^^ argument requires that `'b` must outlive `'a`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | x.push(y); //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:15:5
|
LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>) {
- | ------- ------- these two types are declared with different lifetimes...
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
LL | x.push(y); //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^^^ argument requires that `'b` must outlive `'a`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | x.push(y); //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-both-are-structs.rs:15:5
|
LL | fn foo(mut x: Vec<Ref>, y: Ref) {
- | --- --- these two types are declared with different lifetimes...
+ | --- --- lifetime `'1` appears in this type
+ | |
+ | lifetime `'2` appears in this type
LL | x.push(y); //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^^^ argument requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | x.push(y); //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-latebound-regions.rs:12:5
|
LL | fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) {
- | ------ ------ these two types are declared with different lifetimes...
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
LL | x.push(y); //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^^^ argument requires that `'b` must outlive `'a`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | y = x.b; //~ ERROR lifetime mismatch
| ^^^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:5
|
LL | fn foo(mut x: Ref, y: &u32) {
- | --- ----
+ | --- - let's call the lifetime of this reference `'2`
| |
- | these two types are declared with different lifetimes...
+ | lifetime `'1` appears in this type
LL | y = x.b; //~ ERROR lifetime mismatch
- | ^^^^^^^ ...but data from `x` flows into `y` here
+ | ^^^^^^^ requires that `'1` must outlive `'2`
error[E0384]: cannot assign to immutable argument `y`
--> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:5
error: aborting due to 2 previous errors
-Some errors occurred: E0384, E0623.
-For more information about an error, try `rustc --explain E0384`.
+For more information about this error, try `rustc --explain E0384`.
LL | y.b = x; //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:14:5
|
LL | fn foo(mut y: Ref, x: &u32) {
- | --- ---- these two types are declared with different lifetimes...
+ | --- - let's call the lifetime of this reference `'1`
+ | |
+ | lifetime `'2` appears in this type
LL | y.b = x; //~ ERROR lifetime mismatch
- | ^^^^^^^ ...but data from `x` flows into `y` here
+ | ^^^^^^^ requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | y.b = x; //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:14:5
|
LL | fn foo(mut y: Ref, x: &u32) {
- | --- ---- these two types are declared with different lifetimes...
+ | --- - let's call the lifetime of this reference `'1`
+ | |
+ | lifetime `'2` appears in this type
LL | y.b = x; //~ ERROR lifetime mismatch
- | ^^^^^^^ ...but data from `x` flows into `y` here
+ | ^^^^^^^ requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | x.b = y; //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-one-is-struct.rs:17:5
|
LL | fn foo(mut x: Ref, y: &u32) {
- | --- ---- these two types are declared with different lifetimes...
+ | --- - let's call the lifetime of this reference `'1`
+ | |
+ | lifetime `'2` appears in this type
LL | x.b = y; //~ ERROR lifetime mismatch
- | ^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^ requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | x //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:17:5
|
LL | fn foo<'a>(&self, x: &i32) -> &i32 {
- | ---- ----
- | |
- | this parameter and the return type are declared with different lifetimes...
+ | - - let's call the lifetime of this reference `'1`
+ | |
+ | let's call the lifetime of this reference `'2`
LL | x //~ ERROR lifetime mismatch
- | ^ ...but data from `x` is returned here
+ | ^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | if true { x } else { self } //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-self-is-anon.rs:17:9
|
LL | fn foo<'a>(&self, x: &Foo) -> &Foo {
- | ---- ----
- | |
- | this parameter and the return type are declared with different lifetimes...
+ | - - let's call the lifetime of this reference `'1`
+ | |
+ | let's call the lifetime of this reference `'2`
LL | if true { x } else { self } //~ ERROR lifetime mismatch
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `x` is returned here
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | y.push(z); //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
--> $DIR/ex3-both-anon-regions-using-fn-items.rs:11:3
|
LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
- | --- --- these two types are declared with different lifetimes...
+ | - help: consider changing this to be mutable: `mut y`
LL | y.push(z); //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data from `z` flows into `y` here
+ | ^ cannot borrow as mutable
-error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-using-fn-items.rs:11:3
|
LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
- | - help: consider changing this to be mutable: `mut y`
+ | - - let's call the lifetime of this reference `'1`
+ | |
+ | let's call the lifetime of this reference `'2`
LL | y.push(z); //~ ERROR lifetime mismatch
- | ^ cannot borrow as mutable
+ | ^^^^^^^^^ argument requires that `'1` must outlive `'2`
error: aborting due to 2 previous errors
-Some errors occurred: E0596, E0623.
-For more information about an error, try `rustc --explain E0596`.
+For more information about this error, try `rustc --explain E0596`.
LL | x.push(y); //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-using-impl-items.rs:15:9
|
LL | fn foo(x: &mut Vec<&u8>, y: &u8) {
- | --- --- these two types are declared with different lifetimes...
+ | - - let's call the lifetime of this reference `'1`
+ | |
+ | let's call the lifetime of this reference `'2`
LL | x.push(y); //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^^^ argument requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | y.push(z); //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
--> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
|
LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
- | --- --- these two types are declared with different lifetimes...
+ | - help: consider changing this to be mutable: `mut y`
LL | y.push(z); //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data from `z` flows into `y` here
+ | ^ cannot borrow as mutable
-error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
|
LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
- | - help: consider changing this to be mutable: `mut y`
+ | - - let's call the lifetime of this reference `'1`
+ | |
+ | let's call the lifetime of this reference `'2`
LL | y.push(z); //~ ERROR lifetime mismatch
- | ^ cannot borrow as mutable
+ | ^^^^^^^^^ argument requires that `'1` must outlive `'2`
error: aborting due to 2 previous errors
-Some errors occurred: E0596, E0623.
-For more information about an error, try `rustc --explain E0596`.
+For more information about this error, try `rustc --explain E0596`.
LL | x.push(y); //~ ERROR lifetime mismatch
| ^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions.rs:12:5
|
LL | fn foo(x: &mut Vec<&u8>, y: &u8) {
- | --- --- these two types are declared with different lifetimes...
+ | - - let's call the lifetime of this reference `'1`
+ | |
+ | let's call the lifetime of this reference `'2`
LL | x.push(y); //~ ERROR lifetime mismatch
- | ^^^^^^^^^ ...but data from `y` flows into `x` here
+ | ^^^^^^^^^ argument requires that `'1` must outlive `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
pub fn good15(p: TransparentLifetime);
pub fn good16(p: TransparentUnit<ZeroSize>);
pub fn good17(p: TransparentCustomZst);
+ #[allow(improper_ctypes)]
+ pub fn good18(_: &String);
+}
+
+#[allow(improper_ctypes)]
+extern {
+ pub fn good19(_: &String);
}
#[cfg(not(target_arch = "wasm32"))]
// aux-build:lint_output_format.rs
-// FIXME(#44232) we should warn that this isn't used.
-#![feature(foo)]
-
-#![feature(test_feature)]
+#![feature(unstable_test_feature)]
#![feature(rustc_attrs)]
extern crate lint_output_format;
warning: use of deprecated item 'lint_output_format::foo': text
- --> $DIR/lint-output-format-2.rs:20:26
+ --> $DIR/lint-output-format-2.rs:17:26
|
LL | use lint_output_format::{foo, bar};
| ^^^
= note: #[warn(deprecated)] on by default
warning: use of deprecated item 'lint_output_format::foo': text
- --> $DIR/lint-output-format-2.rs:25:14
+ --> $DIR/lint-output-format-2.rs:22:14
|
LL | let _x = foo();
| ^^^
error: compilation successful
- --> $DIR/lint-output-format-2.rs:24:1
+ --> $DIR/lint-output-format-2.rs:21:1
|
LL | / fn main() { //~ ERROR: compilation successful
LL | | let _x = foo();
#![feature(use_extern_macros)]
-#[derive(inline)] //~ ERROR expected a macro, found non-macro attribute
+#[derive(inline)] //~ ERROR expected a macro, found built-in attribute
struct S;
fn main() {
- inline!(); //~ ERROR expected a macro, found non-macro attribute
+ inline!(); //~ ERROR expected a macro, found built-in attribute
}
-error: expected a macro, found non-macro attribute
+error: expected a macro, found built-in attribute
--> $DIR/macro-path-prelude-fail-3.rs:13:10
|
-LL | #[derive(inline)] //~ ERROR expected a macro, found non-macro attribute
+LL | #[derive(inline)] //~ ERROR expected a macro, found built-in attribute
| ^^^^^^
-error: expected a macro, found non-macro attribute
+error: expected a macro, found built-in attribute
--> $DIR/macro-path-prelude-fail-3.rs:17:5
|
-LL | inline!(); //~ ERROR expected a macro, found non-macro attribute
+LL | inline!(); //~ ERROR expected a macro, found built-in attribute
| ^^^^^^
error: aborting due to 2 previous errors
--- /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.
+
+macro_rules! foo {
+ ($a:ident, $b:ident) => ()
+}
+
+fn main() {
+ println!("{}" a);
+ //~^ ERROR expected token: `,`
+ foo!(a b);
+ //~^ ERROR no rules expected the token `b`
+}
--- /dev/null
+error: expected token: `,`
+ --> $DIR/missing-comma.rs:16:19
+ |
+LL | println!("{}" a);
+ | ^
+
+error: no rules expected the token `b`
+ --> $DIR/missing-comma.rs:18:12
+ |
+LL | foo!(a b);
+ | -^
+ | |
+ | help: missing comma here
+
+error: aborting due to 2 previous errors
+
#[rustc_regions]
fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
- //~^ ERROR lifetime mismatch
+ //~^ ERROR unsatisfied lifetime constraints
// Only works if 'x: 'y:
demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| _______________________________________________^
-LL | | //~^ ERROR lifetime mismatch
+LL | | //~^ ERROR unsatisfied lifetime constraints
LL | |
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
= note: number of external vids: 5
= note: where '_#1r: '_#2r
-error[E0623]: lifetime mismatch
- --> $DIR/propagate-approximated-ref.rs:53:5
- |
-LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
- | ------- -------
- | |
- | these two types are declared with different lifetimes...
-LL | / establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | | //~^ ERROR lifetime mismatch
-LL | |
-LL | | // Only works if 'x: 'y:
-LL | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
-LL | | });
- | |______^ ...but data from `cell_a` flows into `cell_b` here
-
note: No external requirements
--> $DIR/propagate-approximated-ref.rs:52:1
|
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | | //~^ ERROR lifetime mismatch
+LL | | //~^ ERROR unsatisfied lifetime constraints
LL | |
... |
LL | | });
|
= note: defining type: DefId(0/0:6 ~ propagate_approximated_ref[317d]::supply[0]) with substs []
+error: unsatisfied lifetime constraints
+ --> $DIR/propagate-approximated-ref.rs:53:5
+ |
+LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+LL | / establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
+LL | | //~^ ERROR unsatisfied lifetime constraints
+LL | |
+LL | | // Only works if 'x: 'y:
+LL | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
+LL | | });
+ | |______^ argument requires that `'a` must outlive `'b`
+
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
#[rustc_regions]
fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
- //~^ ERROR lifetime mismatch
+ //~^ ERROR unsatisfied lifetime constraints
// Only works if 'x: 'y:
demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
|
LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
| _____________________________________________^
-LL | | //~^ ERROR lifetime mismatch
+LL | | //~^ ERROR unsatisfied lifetime constraints
LL | |
LL | | // Only works if 'x: 'y:
LL | | demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
= note: number of external vids: 5
= note: where '_#1r: '_#2r
-error[E0623]: lifetime mismatch
- --> $DIR/propagate-approximated-val.rs:46:5
- |
-LL | fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
- | ------- -------
- | |
- | these two types are declared with different lifetimes...
-LL | / establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-LL | | //~^ ERROR lifetime mismatch
-LL | |
-LL | | // Only works if 'x: 'y:
-LL | | demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
-LL | | });
- | |______^ ...but data from `cell_a` flows into `cell_b` here
-
note: No external requirements
--> $DIR/propagate-approximated-val.rs:45:1
|
LL | / fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
LL | | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-LL | | //~^ ERROR lifetime mismatch
+LL | | //~^ ERROR unsatisfied lifetime constraints
LL | |
... |
LL | | });
|
= note: defining type: DefId(0/0:6 ~ propagate_approximated_val[317d]::test[0]) with substs []
+error: unsatisfied lifetime constraints
+ --> $DIR/propagate-approximated-val.rs:46:5
+ |
+LL | fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+LL | / establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
+LL | | //~^ ERROR unsatisfied lifetime constraints
+LL | |
+LL | | // Only works if 'x: 'y:
+LL | | demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
+LL | | });
+ | |______^ argument requires that `'a` must outlive `'b`
+
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
--> $DIR/region-lbr-anon-does-not-outlive-static.rs:19:5
|
LL | fn foo(x: &u32) -> &'static u32 {
- | - consider changing the type of `x` to `&ReStatic u32`
+ | ---- help: add explicit lifetime `ReStatic` to the type of `x`: `&ReStatic u32`
LL | &*x
| ^^^ lifetime `ReStatic` required
fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
&*x
//~^ WARN not reporting region error due to nll
- //~| ERROR lifetime mismatch
+ //~| ERROR unsatisfied lifetime constraints
}
fn main() { }
LL | &*x
| ^^^
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/region-lbr1-does-not-outlive-ebr2.rs:19:5
|
LL | fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
- | ------- -------
- | |
- | this parameter and the return type are declared with different lifetimes...
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
LL | &*x
- | ^^^ ...but data from `x` is returned here
+ | ^^^ requires that `'a` must outlive `'b`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
LL | Some(v) => {
LL | map.set(String::new()); // Both AST and MIR error here
| ^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
- |
-note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 41:1...
- --> $DIR/get_default.rs:41:1
- |
-LL | / fn err(map: &mut Map) -> &String {
-LL | | loop {
-LL | | match map.get() {
-LL | | Some(v) => {
-... |
-LL | | }
-LL | | }
- | |_^
+...
+LL | return v;
+ | - borrow later used here
error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
--> $DIR/get_default.rs:51:17
LL | Some(v) => {
LL | map.set(String::new()); // Both AST and MIR error here
| ^^^ mutable borrow occurs here
- |
-note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 41:1...
- --> $DIR/get_default.rs:41:1
- |
-LL | / fn err(map: &mut Map) -> &String {
-LL | | loop {
-LL | | match map.get() {
-LL | | Some(v) => {
-... |
-LL | | }
-LL | | }
- | |_^
+...
+LL | return v;
+ | - borrow later used here
error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
--> $DIR/get_default.rs:51:17
--> $DIR/guarantor-issue-46974.rs:25:5
|
LL | fn bar(s: &Box<(i32,)>) -> &'static i32 {
- | - consider changing the type of `s` to `&'static std::boxed::Box<(i32,)>`
+ | ------------ help: add explicit lifetime `'static` to the type of `s`: `&'static std::boxed::Box<(i32,)>`
LL | // FIXME(#46983): error message should be better
LL | &s.0 //~ ERROR explicit lifetime required in the type of `s` [E0621]
| ^^^^ lifetime `'static` required
--> $DIR/issue-48238.rs:21:13
|
LL | move || use_val(&orig); //~ ERROR
- | --------^^^^^^^^^^^^^^
- | | |
- | | argument requires that `'1` must outlive `'2`
- | lifetime `'1` represents the closure body
- | lifetime `'2` appears in return type
+ | ------- ^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+ | | |
+ | | return type of closure is &'2 u8
+ | lifetime `'1` represents this closure's body
+ |
+ = note: closure implements `Fn`, so references to captured variables can't escape the closure
error: aborting due to previous error
}
fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
- let x = move || { //~ ERROR lifetime mismatch
+ let x = move || { //~ ERROR unsatisfied lifetime constraints
let value: &'a u32 = value;
data.push(value);
};
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
--> $DIR/issue-52113.rs:43:9
|
LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
- | -------------------- ------- these two types are declared with different lifetimes...
-LL | let x = move || { //~ ERROR lifetime mismatch
- | ^ ...but data from `value` flows into `data` here
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+LL | let x = move || { //~ ERROR unsatisfied lifetime constraints
+ | ^ requires that `'a` must outlive `'b`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0623`.
--- /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(nll)]
+
+use std::ops::Deref;
+
+pub struct TypeFieldIterator<'a, T: 'a> {
+ _t: &'a T,
+}
+
+pub struct Type<Id, T> {
+ _types: Vec<(Id, T)>,
+}
+
+impl<'a, Id: 'a, T> Iterator for TypeFieldIterator<'a, T>
+where T: Deref<Target = Type<Id, T>> {
+ type Item = &'a (Id, T);
+
+ fn next(&mut self) -> Option<&'a (Id, T)> {
+ || self.next();
+ None
+ }
+}
+
+fn main() { }
error[E0597]: borrowed value does not live long enough
--> $DIR/return-ref-mut-issue-46557.rs:17:21
|
-LL | let ref mut x = 1234543; //~ ERROR borrowed value does not live long enough [E0597]
- | ^^^^^^^ temporary value does not live long enough
-LL | x
-LL | }
- | - temporary value only lives until here
- |
- = note: borrowed value must be valid for the static lifetime...
+LL | fn gimme_static_mut() -> &'static mut u32 {
+ | ___________________________________________-
+LL | | let ref mut x = 1234543; //~ ERROR borrowed value does not live long enough [E0597]
+ | | ^^^^^^^ temporary value does not live long enough
+LL | | x
+LL | | }
+ | | -
+ | | |
+ | |_temporary value only lives until here
+ | borrow later used here
error: aborting due to previous error
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/impl-trait-captures.rs:21:5
|
-LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
- | - consider changing the type of `x` to `&ReEarlyBound(0, 'a) T`
LL | x
| ^ lifetime `ReEarlyBound(0, 'a)` required
+help: add explicit lifetime `ReEarlyBound(0, 'a)` to the type of `x`
+ |
+LL | fn foo<'a, T>(x: &ReEarlyBound(0, 'a) T) -> impl Foo<'a> {
+ | ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
// If macro modularization (`use_extern_macros`) is not enabled,
// then tool attributes are treated as custom attributes.
-// compile-pass
-
-#![feature(custom_attribute)]
-
-#[rustfmt::bar]
+#[rustfmt::bar] //~ ERROR attribute `rustfmt::bar` is currently unknown to the compiler
fn main() {}
--- /dev/null
+error[E0658]: The attribute `rustfmt::bar` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
+ --> $DIR/tool-attributes-disabled-2.rs:14:1
+ |
+LL | #[rustfmt::bar] //~ ERROR attribute `rustfmt::bar` is currently unknown to the compiler
+ | ^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(tool_attributes)]
+#![feature(tool_attributes, custom_attribute)]
type A = rustfmt; //~ ERROR expected type, found tool module `rustfmt`
-type B = rustfmt::skip; //~ ERROR expected type, found non-macro attribute `rustfmt::skip`
+type B = rustfmt::skip; //~ ERROR expected type, found tool attribute `rustfmt::skip`
#[derive(rustfmt)] //~ ERROR cannot find derive macro `rustfmt` in this scope
struct S;
-#[rustfmt] //~ ERROR cannot find attribute macro `rustfmt` in this scope
+#[rustfmt] // OK, interpreted as a custom attribute
fn check() {}
#[rustfmt::skip] // OK
rustfmt; //~ ERROR expected value, found tool module `rustfmt`
rustfmt!(); //~ ERROR cannot find macro `rustfmt!` in this scope
- rustfmt::skip; //~ ERROR expected value, found non-macro attribute `rustfmt::skip`
+ rustfmt::skip; //~ ERROR expected value, found tool attribute `rustfmt::skip`
}
LL | #[derive(rustfmt)] //~ ERROR cannot find derive macro `rustfmt` in this scope
| ^^^^^^^
-error: cannot find attribute macro `rustfmt` in this scope
- --> $DIR/tool-attributes-misplaced-1.rs:19:3
- |
-LL | #[rustfmt] //~ ERROR cannot find attribute macro `rustfmt` in this scope
- | ^^^^^^^
-
error: cannot find macro `rustfmt!` in this scope
--> $DIR/tool-attributes-misplaced-1.rs:25:5
|
LL | type A = rustfmt; //~ ERROR expected type, found tool module `rustfmt`
| ^^^^^^^ not a type
-error[E0573]: expected type, found non-macro attribute `rustfmt::skip`
+error[E0573]: expected type, found tool attribute `rustfmt::skip`
--> $DIR/tool-attributes-misplaced-1.rs:14:10
|
-LL | type B = rustfmt::skip; //~ ERROR expected type, found non-macro attribute `rustfmt::skip`
+LL | type B = rustfmt::skip; //~ ERROR expected type, found tool attribute `rustfmt::skip`
| ^^^^^^^^^^^^^ not a type
error[E0423]: expected value, found tool module `rustfmt`
LL | rustfmt; //~ ERROR expected value, found tool module `rustfmt`
| ^^^^^^^ not a value
-error[E0423]: expected value, found non-macro attribute `rustfmt::skip`
+error[E0423]: expected value, found tool attribute `rustfmt::skip`
--> $DIR/tool-attributes-misplaced-1.rs:27:5
|
-LL | rustfmt::skip; //~ ERROR expected value, found non-macro attribute `rustfmt::skip`
+LL | rustfmt::skip; //~ ERROR expected value, found tool attribute `rustfmt::skip`
| ^^^^^^^^^^^^^ not a value
-error: aborting due to 7 previous errors
+error: aborting due to 6 previous errors
Some errors occurred: E0423, E0573.
For more information about an error, try `rustc --explain E0423`.
#![feature(tool_attributes)]
-#[derive(rustfmt::skip)] //~ ERROR expected a macro, found non-macro attribute
+#[derive(rustfmt::skip)] //~ ERROR expected a macro, found tool attribute
struct S;
fn main() {
- rustfmt::skip!(); //~ ERROR expected a macro, found non-macro attribute
+ rustfmt::skip!(); //~ ERROR expected a macro, found tool attribute
}
-error: expected a macro, found non-macro attribute
+error: expected a macro, found tool attribute
--> $DIR/tool-attributes-misplaced-2.rs:13:10
|
-LL | #[derive(rustfmt::skip)] //~ ERROR expected a macro, found non-macro attribute
+LL | #[derive(rustfmt::skip)] //~ ERROR expected a macro, found tool attribute
| ^^^^^^^^^^^^^
-error: expected a macro, found non-macro attribute
+error: expected a macro, found tool attribute
--> $DIR/tool-attributes-misplaced-2.rs:17:5
|
-LL | rustfmt::skip!(); //~ ERROR expected a macro, found non-macro attribute
+LL | rustfmt::skip!(); //~ ERROR expected a macro, found tool attribute
| ^^^^^^^^^^^^^
error: aborting due to 2 previous errors
// except according to those terms.
// compile-pass
+#![feature(const_fn_union)]
union U {
a: usize,
-Subproject commit 7e5e4c1e7e80ed689a49101569dde2c19753dc8d
+Subproject commit 99a087bea59c8f808b5485c6113edf9ce774e94a
#![crate_name = "compiletest"]
#![feature(test)]
-#![feature(slice_rotate)]
#![deny(warnings)]
extern crate diff;
-Subproject commit 6d72813199d24838636389c7025ce95c427692f7
+Subproject commit c51e3ff2f07f84f26f57fcb51808b1ec7cbe45a6
-Subproject commit da17b689595ddc863b02eb1ba6831c87cefc1e21
+Subproject commit 5c9a2b6c13d3b6f8d3f9c02b130bb4b54fd489fb
//! Check license of third-party deps by inspecting src/vendor
-use std::collections::{BTreeSet, HashSet};
+use std::collections::{BTreeSet, HashSet, HashMap};
use std::fs::File;
use std::io::Read;
use std::path::Path;
}
*bad = true;
}
+
+ check_crate_duplicate(&resolve, bad);
}
fn check_license(path: &Path) -> bool {
unapproved
}
+
+fn check_crate_duplicate(resolve: &Resolve, bad: &mut bool) {
+ const FORBIDDEN_TO_HAVE_DUPLICATES: &[&str] = &[
+ // These two crates take quite a long time to build, let's not let two
+ // versions of them accidentally sneak into our dependency graph to
+ // ensure we keep our CI times under control
+ // "cargo", // FIXME(#53005)
+ // "rustc-ap-syntax", // FIXME(#53006)
+ ];
+ let mut name_to_id = HashMap::new();
+ for node in resolve.nodes.iter() {
+ name_to_id.entry(node.id.split_whitespace().next().unwrap())
+ .or_insert(Vec::new())
+ .push(&node.id);
+ }
+
+ for name in FORBIDDEN_TO_HAVE_DUPLICATES {
+ if name_to_id[name].len() <= 1 {
+ continue
+ }
+ println!("crate `{}` is duplicated in `Cargo.lock`", name);
+ for id in name_to_id[name].iter() {
+ println!(" * {}", id);
+ }
+ *bad = true;
+ }
+}
pub tracking_issue: Option<u32>,
}
-impl Feature {
- fn check_match(&self, other: &Feature)-> Result<(), Vec<&'static str>> {
- let mut mismatches = Vec::new();
- if self.level != other.level {
- mismatches.push("stability level");
- }
- if self.level == Status::Stable || other.level == Status::Stable {
- // As long as a feature is unstable, the since field tracks
- // when the given part of the feature has been implemented.
- // Mismatches are tolerable as features evolve and functionality
- // gets added.
- // Once a feature is stable, the since field tracks the first version
- // it was part of the stable distribution, and mismatches are disallowed.
- if self.since != other.since {
- mismatches.push("since");
- }
- }
- if self.tracking_issue != other.tracking_issue {
- mismatches.push("tracking issue");
- }
- if mismatches.is_empty() {
- Ok(())
- } else {
- Err(mismatches)
- }
- }
-}
-
pub type Features = HashMap<String, Feature>;
pub fn check(path: &Path, bad: &mut bool, quiet: bool) {
Ok((name, f)) => {
let mut check_features = |f: &Feature, list: &Features, display: &str| {
if let Some(ref s) = list.get(name) {
- if let Err(m) = (&f).check_match(s) {
+ if f.tracking_issue != s.tracking_issue {
tidy_error!(bad,
- "{}:{}: mismatches to {} in: {:?}",
+ "{}:{}: mismatches the `issue` in {}",
file.display(),
line,
- display,
- &m);
+ display);
}
}
};