fast_finish: true
include:
# Images used in testing PR and try-build should be run first.
- - env: IMAGE=x86_64-gnu-llvm-3.9 RUST_BACKTRACE=1
+ - env: IMAGE=x86_64-gnu-llvm-5.0 RUST_BACKTRACE=1
if: type = pull_request OR branch = auto
- env: IMAGE=dist-x86_64-linux DEPLOY=1
most popular channel is [#rust], a venue for general discussion about
Rust. And a good place to ask for help would be [#rust-beginners].
-Also, the [rustc guide] might be a good place to start if you want to
-find out how various parts of the compiler work.
+The [rustc guide] might be a good place to start if you want to find out how
+various parts of the compiler work.
+
+Also, you may find the [rustdocs for the compiler itself][rustdocs] useful.
[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
[#rust]: irc://irc.mozilla.org/rust
[#rust-beginners]: irc://irc.mozilla.org/rust-beginners
[rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/about-this-guide.html
+[rustdocs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/
## License
[license]: #license
+Version 1.28.0 (2018-08-02)
+===========================
+
+Language
+--------
+- [The `#[repr(transparent)]` attribute is now stable.][51562] This attribute
+ allows a Rust newtype wrapper (`struct NewType<T>(T);`) to be represented as
+ the inner type across Foreign Function Interface (FFI) boundaries.
+- [The keywords `pure`, `sizeof`, `alignof`, and `offsetof` have been unreserved
+ and can now be used as identifiers.][51196]
+- [The `GlobalAlloc` trait and `#[global_allocator]` attribute are now
+ stable.][51241] This will allow users to specify a global allocator for
+ their program.
+- [Unit test functions marked with the `#[test]` attribute can now return
+ `Result<(), E: Debug>` in addition to `()`.][51298]
+- [The `lifetime` specifier for `macro_rules!` is now stable.][50385] This
+ allows macros to easily target lifetimes.
+
+Compiler
+--------
+- [The `s` and `z` optimisation levels are now stable.][50265] These optimisations
+ prioritise making smaller binary sizes. `z` is the same as `s` with the
+ exception that it does not vectorise loops, which typically results in an even
+ smaller binary.
+- [The short error format is now stable.][49546] Specified with
+ `--error-format=short` this option will provide a more compressed output of
+ rust error messages.
+- [Added a lint warning when you have duplicated `macro_export`s.][50143]
+- [Reduced the number of allocations in the macro parser.][50855] This can
+ improve compile times of macro heavy crates on average by 5%.
+
+Libraries
+---------
+- [Implemented `Default` for `&mut str`.][51306]
+- [Implemented `From<bool>` for all integer and unsigned number types.][50554]
+- [Implemented `Extend` for `()`.][50234]
+- [The `Debug` implementation of `time::Duration` should now be more easily
+ human readable.][50364] Previously a `Duration` of one second would printed as
+ `Duration { secs: 1, nanos: 0 }` and will now be printed as `1s`.
+- [Implemented `From<&String>` for `Cow<str>`, `From<&Vec<T>>` for `Cow<[T]>`,
+ `From<Cow<CStr>>` for `CString`, `From<CString>, From<CStr>, From<&CString>`
+ for `Cow<CStr>`, `From<OsString>, From<OsStr>, From<&OsString>` for
+ `Cow<OsStr>`, `From<&PathBuf>` for `Cow<Path>`, and `From<Cow<Path>>`
+ for `PathBuf`.][50170]
+- [Implemented `Shl` and `Shr` for `Wrapping<u128>`
+ and `Wrapping<i128>`.][50465]
+- [`DirEntry::metadata` now uses `fstatat` instead of `lstat` when
+ possible.][51050] This can provide up to a 40% speed increase.
+- [Improved error messages when using `format!`.][50610]
+
+Stabilized APIs
+---------------
+- [`Iterator::step_by`]
+- [`Path::ancestors`]
+- [`btree_map::Entry::or_default`]
+- [`fmt::Alignment`]
+- [`hash_map::Entry::or_default`]
+- [`iter::repeat_with`]
+- [`num::NonZeroUsize`]
+- [`num::NonZeroU128`]
+- [`num::NonZeroU16`]
+- [`num::NonZeroU32`]
+- [`num::NonZeroU64`]
+- [`num::NonZeroU8`]
+- [`ops::RangeBounds`]
+- [`slice::SliceIndex`]
+- [`slice::from_mut`]
+- [`slice::from_ref`]
+- [`{Any + Send + Sync}::downcast_mut`]
+- [`{Any + Send + Sync}::downcast_ref`]
+- [`{Any + Send + Sync}::is`]
+
+Cargo
+-----
+- [Cargo will now no longer allow you to publish crates with build scripts that
+ modify the `src` directory.][cargo/5584] The `src` directory in a crate should be
+ considered to be immutable.
+
+Misc
+----
+- [The `suggestion_applicability` field in `rustc`'s json output is now
+ stable.][50486] This will allow dev tools to check whether a code suggestion
+ would apply to them.
+
+Compatibility Notes
+-------------------
+- [Rust will no longer consider trait objects with duplicated constraints to
+ have implementations.][51276] For example the below code will now fail
+ to compile.
+ ```rust
+ trait Trait {}
+
+ impl Trait + Send {
+ fn test(&self) { println!("one"); } //~ ERROR duplicate definitions with name `test`
+ }
+
+ impl Trait + Send + Send {
+ fn test(&self) { println!("two"); }
+ }
+ ```
+
+[49546]: https://github.com/rust-lang/rust/pull/49546/
+[50143]: https://github.com/rust-lang/rust/pull/50143/
+[50170]: https://github.com/rust-lang/rust/pull/50170/
+[50234]: https://github.com/rust-lang/rust/pull/50234/
+[50265]: https://github.com/rust-lang/rust/pull/50265/
+[50364]: https://github.com/rust-lang/rust/pull/50364/
+[50385]: https://github.com/rust-lang/rust/pull/50385/
+[50465]: https://github.com/rust-lang/rust/pull/50465/
+[50486]: https://github.com/rust-lang/rust/pull/50486/
+[50554]: https://github.com/rust-lang/rust/pull/50554/
+[50610]: https://github.com/rust-lang/rust/pull/50610/
+[50855]: https://github.com/rust-lang/rust/pull/50855/
+[51050]: https://github.com/rust-lang/rust/pull/51050/
+[51196]: https://github.com/rust-lang/rust/pull/51196/
+[51200]: https://github.com/rust-lang/rust/pull/51200/
+[51241]: https://github.com/rust-lang/rust/pull/51241/
+[51276]: https://github.com/rust-lang/rust/pull/51276/
+[51298]: https://github.com/rust-lang/rust/pull/51298/
+[51306]: https://github.com/rust-lang/rust/pull/51306/
+[51562]: https://github.com/rust-lang/rust/pull/51562/
+[cargo/5584]: https://github.com/rust-lang/cargo/pull/5584/
+[`Iterator::step_by`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.step_by
+[`Path::ancestors`]: https://doc.rust-lang.org/std/path/struct.Path.html#method.ancestors
+[`btree_map::Entry::or_default`]: https://doc.rust-lang.org/std/collections/btree_map/enum.Entry.html#method.or_default
+[`fmt::Alignment`]: https://doc.rust-lang.org/std/fmt/enum.Alignment.html
+[`hash_map::Entry::or_default`]: https://doc.rust-lang.org/std/collections/btree_map/enum.Entry.html#method.or_default
+[`iter::repeat_with`]: https://doc.rust-lang.org/std/iter/fn.repeat_with.html
+[`num::NonZeroUsize`]: https://doc.rust-lang.org/std/num/struct.NonZeroUsize.html
+[`num::NonZeroU128`]: https://doc.rust-lang.org/std/num/struct.NonZeroU128.html
+[`num::NonZeroU16`]: https://doc.rust-lang.org/std/num/struct.NonZeroU16.html
+[`num::NonZeroU32`]: https://doc.rust-lang.org/std/num/struct.NonZeroU32.html
+[`num::NonZeroU64`]: https://doc.rust-lang.org/std/num/struct.NonZeroU64.html
+[`num::NonZeroU8`]: https://doc.rust-lang.org/std/num/struct.NonZeroU8.html
+[`ops::RangeBounds`]: https://doc.rust-lang.org/std/ops/trait.RangeBounds.html
+[`slice::SliceIndex`]: https://doc.rust-lang.org/std/slice/trait.SliceIndex.html
+[`slice::from_mut`]: https://doc.rust-lang.org/std/slice/fn.from_mut.html
+[`slice::from_ref`]: https://doc.rust-lang.org/std/slice/fn.from_ref.html
+[`{Any + Send + Sync}::downcast_mut`]: https://doc.rust-lang.org/std/any/trait.Any.html#method.downcast_mut-2
+[`{Any + Send + Sync}::downcast_ref`]: https://doc.rust-lang.org/std/any/trait.Any.html#method.downcast_ref-2
+[`{Any + Send + Sync}::is`]: https://doc.rust-lang.org/std/any/trait.Any.html#method.is-2
+
+
Version 1.27.0 (2018-06-21)
==========================
- [Closures now implement `Copy` and/or `Clone` if all captured variables
implement either or both traits.][49299]
- [The inclusive range syntax e.g. `for x in 0..=10` is now stable.][47813]
-- [Stablise `'_`. The underscore lifetime can be used anywhere where a
+- [The `'_` lifetime is now stable. The underscore lifetime can be used anywhere where a
lifetime can be elided.][49458]
- [`impl Trait` is now stable allowing you to have abstract types in returns
or in function parameters.][49255] e.g. `fn foo() -> impl Iterator<Item=u8>` or
Language
--------
-- [Stabilised `#[repr(align(x))]`.][47006] [RFC 1358]
+- [The `#[repr(align(x))]` attribute is now stable.][47006] [RFC 1358]
- [You can now use nested groups of imports.][47948]
e.g. `use std::{fs::File, io::Read, path::{Path, PathBuf}};`
- [You can now have `|` at the start of a match arm.][47947] e.g.
# Print backtrace on internal compiler errors during bootstrap
#backtrace-on-ice = false
+# Whether to verify generated LLVM IR
+#verify-llvm-ir = false
+
# =============================================================================
# Options for specific targets
#
[[package]]
name = "aho-corasick"
-version = "0.6.4"
+version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
version = "0.0.0"
dependencies = [
"build_helper 0.1.0",
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.0.0",
"core 0.0.0",
"libc 0.0.0",
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "html5ever 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tendril 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "ar"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "arena"
version = "0.0.0"
[[package]]
name = "assert_cli"
-version = "0.6.0"
+version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"environment 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "atty"
-version = "0.2.8"
+version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "backtrace"
-version = "0.3.6"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "backtrace-sys 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)",
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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)",
+ "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)",
]
[[package]]
name = "backtrace-sys"
-version = "0.1.22"
+version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "bitflags"
-version = "1.0.1"
+version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
version = "0.0.0"
dependencies = [
"build_helper 0.1.0",
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "cmake 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cmake 0.1.31 (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)",
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
name = "build-manifest"
version = "0.1.0"
dependencies = [
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "byteorder"
-version = "1.2.2"
+version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cargo"
version = "0.30.0"
dependencies = [
- "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"crates-io 0.18.0",
"crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"crypto-hash 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"curl 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "filetime 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"git2-curl 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "hex 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"home 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "ignore 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "ignore 0.4.2 (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.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (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.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.7.4 (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)",
- "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
"shell-escape 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "tar 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tar 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cargo_metadata"
-version = "0.5.4"
+version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "cc"
-version = "1.0.15"
+version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cfg-if"
-version = "0.1.2"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
[[package]]
name = "chrono"
-version = "0.4.1"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
- "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "clap"
-version = "2.31.2"
+version = "2.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.0.211"
dependencies = [
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "backtrace 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy-mini-macro-test 0.2.0",
"clippy_lints 0.0.211",
- "compiletest_rs 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiletest_rs 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
"derive-new 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "clippy_lints"
-version = "0.0.205"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+version = "0.0.211"
+source = "git+https://github.com/rust-lang-nursery/rust-clippy?rev=6c70013f93a18c1ca7990efa8b1464acc6e18ce7#6c70013f93a18c1ca7990efa8b1464acc6e18ce7"
dependencies = [
- "cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
"if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
name = "clippy_lints"
version = "0.0.211"
dependencies = [
- "cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
"if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cmake"
-version = "0.1.30"
+version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "compiler_builtins"
version = "0.0.0"
dependencies = [
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
]
version = "0.0.0"
dependencies = [
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.5.10 (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)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (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)",
"miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"rustfix 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "compiletest_rs"
-version = "0.3.9"
+version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "filetime 0.1.15 (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.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (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)",
"miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (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.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
dependencies = [
"curl 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "hex 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl 0.10.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
dependencies = [
"curl-sys 0.4.5 (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.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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.28 (registry+https://github.com/rust-lang/crates.io-index)",
- "schannel 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "socket2 0.3.5 (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)",
+ "socket2 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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.28 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (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)",
+ "vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-[[package]]
-name = "debug_unreachable"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "deglob"
version = "0.1.0"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "elasticlunr-rs"
-version = "2.2.0"
+version = "2.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 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)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
"strum 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "strum_macros 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "strum_macros 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "endian-type"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "enum_primitive"
version = "0.1.1"
[[package]]
name = "env_logger"
-version = "0.5.8"
+version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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)",
"termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "backtrace 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "backtrace 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "filetime"
-version = "0.1.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "filetime"
-version = "0.2.0"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.37 (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)",
+ "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "fst"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "futf"
-version = "0.1.3"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "debug_unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "new_debug_unreachable 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "futures"
-version = "0.1.20"
+version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
[[package]]
name = "git2"
-version = "0.7.1"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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)",
+ "libgit2-sys 0.7.4 (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)",
- "openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"curl 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "globset"
-version = "0.3.0"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "aho-corasick 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "handlebars"
-version = "0.32.0"
+version = "0.32.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pest_derive 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "hex"
-version = "0.3.1"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
dependencies = [
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"userenv-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "html5ever"
-version = "0.22.0"
+version = "0.22.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"markup5ever 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
dependencies = [
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "ignore"
-version = "0.4.1"
+version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "globset 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "globset 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "installer"
version = "0.0.0"
dependencies = [
- "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "tar 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tar 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "xz2 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "xz2 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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)",
]
[[package]]
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "8.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
+ "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "languageserver-types"
-version = "0.41.0"
+version = "0.43.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "lazy_static"
-version = "1.0.0"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
[[package]]
name = "libc"
-version = "0.2.40"
+version = "0.2.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libgit2-sys"
-version = "0.7.1"
+version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "cmake 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (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.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "libssh2-sys 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libssh2-sys 0.2.7 (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.28 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.3.9 (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)",
]
[[package]]
name = "libssh2-sys"
-version = "0.2.6"
+version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cmake 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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)",
"libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.3.9 (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)",
+ "vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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)",
]
[[package]]
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "log"
-version = "0.4.1"
+version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "log_settings"
-version = "0.1.1"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "lzma-sys"
-version = "0.1.9"
+version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (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)",
+ "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "string_cache 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_codegen 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "string_cache 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "string_cache_codegen 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tendril 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ammonia 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "chrono 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "elasticlunr-rs 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "elasticlunr-rs 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "handlebars 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"open 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
"shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.6 (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.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "memmap"
+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)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "socket2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "socket2 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "miri"
version = "0.1.0"
dependencies = [
- "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "compiletest_rs 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiletest_rs 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.1.0"
[[package]]
-name = "nibble_vec"
-version = "0.0.4"
+name = "new_debug_unreachable"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "nodrop"
[[package]]
name = "num-integer"
-version = "0.1.36"
+version = "0.1.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-traits"
-version = "0.2.2"
+version = "0.2.5"
source = "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.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "openssl"
-version = "0.10.6"
+version = "0.10.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "openssl-sys"
-version = "0.9.28"
+version = "0.9.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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)",
]
[[package]]
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
+[[package]]
+name = "ordslice"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
[[package]]
name = "owning_ref"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "stable_deref_trait 1.0.0 (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]]
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "phf"
-version = "0.7.21"
+version = "0.7.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "phf_codegen"
-version = "0.7.21"
+version = "0.7.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_generator 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "phf_generator"
-version = "0.7.21"
+version = "0.7.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "phf_shared"
-version = "0.7.21"
+version = "0.7.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "pkg-config"
-version = "0.3.9"
+version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"datafrog 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "proc-macro2"
-version = "0.3.6"
+version = "0.3.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
name = "profiler_builtins"
version = "0.0.0"
dependencies = [
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.0.0",
"core 0.0.0",
]
[[package]]
name = "quick-error"
-version = "1.2.1"
+version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
[[package]]
name = "quote"
-version = "0.5.1"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "quote"
+version = "0.6.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "2.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_errors 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "radix_trie"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "endian-type 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "nibble_vec 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand"
-version = "0.3.22"
-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.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "rand"
version = "0.4.2"
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.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
source = "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.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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 = "redox_syscall"
-version = "0.1.37"
+version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "regex"
-version = "0.2.10"
+version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "aho-corasick 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex-syntax 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex"
-version = "1.0.0"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "aho-corasick 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex-syntax"
-version = "0.5.5"
+version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "regex-syntax"
-version = "0.6.0"
+version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rls"
-version = "0.128.0"
+version = "0.129.0"
dependencies = [
"cargo 0.30.0",
- "cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "clippy_lints 0.0.205 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clippy_lints 0.0.211 (git+https://github.com/rust-lang-nursery/rust-clippy?rev=6c70013f93a18c1ca7990efa8b1464acc6e18ce7)",
+ "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
"json 0.11.13 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-core 8.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "languageserver-types 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "languageserver-types 0.43.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (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.0.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rls-analysis 0.13.0 (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-blacklist 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-data 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-rustc 0.4.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.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustfmt-nightly 0.8.2 (git+https://github.com/rust-lang-nursery/rustfmt?rev=f3906267)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustfmt-nightly 0.8.2",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rls-analysis"
-version = "0.13.0"
+version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"derive-new 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "radix_trie 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "fst 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-data 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
dependencies = [
"rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustbook"
version = "0.1.0"
dependencies = [
- "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"mdbook 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.0.0"
dependencies = [
"arena 0.0.0",
- "backtrace 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"chalk-engine 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"fmt_macros 0.0.0",
"graphviz 0.0.0",
"jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (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)",
"polonius-engine 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"proc_macro 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
"rustc_target 0.0.0",
- "scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serialize 0.0.0",
"syntax 0.0.0",
"syntax_pos 0.0.0",
[[package]]
name = "rustc-ap-arena"
-version = "149.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc-ap-rustc_data_structures 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-arena"
-version = "164.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc-ap-rustc_data_structures 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-rustc_cratesio_shim"
-version = "149.0.0"
+version = "182.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-rustc_cratesio_shim"
-version = "164.0.0"
+version = "182.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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)",
]
[[package]]
name = "rustc-ap-rustc_data_structures"
-version = "149.0.0"
+version = "182.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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.1 (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 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 149.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)",
- "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-rustc_data_structures"
-version = "164.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "ena 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_cratesio_shim 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 182.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.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-rustc_errors"
-version = "149.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 149.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)",
+ "stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-rustc_errors"
-version = "164.0.0"
+version = "182.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 182.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 = "149.0.0"
+version = "182.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "rustc-ap-rustc_target"
-version = "164.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-serialize"
-version = "149.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "rustc-ap-serialize"
-version = "164.0.0"
+version = "182.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc-ap-syntax"
-version = "149.0.0"
+version = "182.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_errors 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-syntax"
-version = "164.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_errors 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_errors 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_target 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 182.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 = "149.0.0"
+version = "182.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "rustc-ap-arena 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-syntax_pos"
-version = "164.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc-ap-arena 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-arena 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 182.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-demangle"
-version = "0.1.7"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
source = "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.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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_allocator"
version = "0.0.0"
dependencies = [
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_errors 0.0.0",
"rustc_target 0.0.0",
name = "rustc_apfloat"
version = "0.0.0"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_cratesio_shim 0.0.0",
]
"alloc 0.0.0",
"alloc_system 0.0.0",
"build_helper 0.1.0",
- "cmake 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.0.0",
"core 0.0.0",
]
version = "0.0.0"
dependencies = [
"graphviz 0.0.0",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
name = "rustc_codegen_llvm"
version = "0.0.0"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (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.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (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.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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",
name = "rustc_codegen_utils"
version = "0.0.0"
dependencies = [
- "ar 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_incremental 0.0.0",
name = "rustc_cratesio_shim"
version = "0.0.0"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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)",
]
[[package]]
name = "rustc_data_structures"
version = "0.0.0"
dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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.1 (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-hash 1.0.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)",
"rustc_cratesio_shim 0.0.0",
"serialize 0.0.0",
- "stable_deref_trait 1.0.0 (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_driver"
version = "0.0.0"
dependencies = [
- "ar 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"arena 0.0.0",
- "env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"graphviz 0.0.0",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_allocator 0.0.0",
"rustc_target 0.0.0",
"rustc_traits 0.0.0",
"rustc_typeck 0.0.0",
- "scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serialize 0.0.0",
"syntax 0.0.0",
"syntax_ext 0.0.0",
name = "rustc_errors"
version = "0.0.0"
dependencies = [
- "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_data_structures 0.0.0",
"serialize 0.0.0",
"syntax_pos 0.0.0",
version = "0.0.0"
dependencies = [
"graphviz 0.0.0",
- "log 0.4.1 (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)",
"rustc 0.0.0",
"rustc_data_structures 0.0.0",
name = "rustc_lint"
version = "0.0.0"
dependencies = [
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_mir 0.0.0",
"rustc_target 0.0.0",
name = "rustc_llvm"
version = "0.0.0"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"build_helper 0.1.0",
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_cratesio_shim 0.0.0",
]
"alloc 0.0.0",
"alloc_system 0.0.0",
"build_helper 0.1.0",
- "cmake 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.0.0",
"core 0.0.0",
]
version = "0.0.0"
dependencies = [
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"proc_macro 0.0.0",
"rustc 0.0.0",
"rustc_data_structures 0.0.0",
version = "0.0.0"
dependencies = [
"arena 0.0.0",
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"graphviz 0.0.0",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log_settings 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log_settings 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"polonius-engine 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_apfloat 0.0.0",
"alloc 0.0.0",
"alloc_system 0.0.0",
"build_helper 0.1.0",
- "cmake 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.0.0",
"core 0.0.0",
]
name = "rustc_passes"
version = "0.0.0"
dependencies = [
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
version = "0.0.0"
dependencies = [
"arena 0.0.0",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
name = "rustc_save_analysis"
version = "0.0.0"
dependencies = [
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-data 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
name = "rustc_target"
version = "0.0.0"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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_cratesio_shim 0.0.0",
"serialize 0.0.0",
]
name = "rustc_traits"
version = "0.0.0"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"chalk-engine 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"graphviz 0.0.0",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_data_structures 0.0.0",
"syntax 0.0.0",
"alloc 0.0.0",
"alloc_system 0.0.0",
"build_helper 0.1.0",
- "cmake 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.0.0",
"core 0.0.0",
]
version = "0.0.0"
dependencies = [
"arena 0.0.0",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustfmt-nightly"
version = "0.8.2"
-source = "git+https://github.com/rust-lang-nursery/rustfmt?rev=f3906267#f390626778c1bbb13911556d585850eb2fa67923"
dependencies = [
- "cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "assert_cli 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
"derive-new 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"isatty 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (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 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustfmt-nightly"
-version = "0.8.2"
-dependencies = [
- "assert_cli 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "derive-new 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "isatty 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "schannel"
-version = "0.1.12"
+version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "scoped-tls"
-version = "0.1.1"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "serde"
-version = "1.0.40"
+version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde_derive"
-version = "1.0.40"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive_internals 0.23.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "serde_derive_internals"
-version = "0.23.1"
+version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_json"
-version = "1.0.15"
+version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "smallvec"
-version = "0.6.0"
+version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "socket2"
-version = "0.3.5"
+version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (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)",
+ "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)",
]
[[package]]
name = "stable_deref_trait"
-version = "1.0.0"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
"alloc_jemalloc 0.0.0",
"alloc_system 0.0.0",
"build_helper 0.1.0",
- "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
"compiler_builtins 0.0.0",
"core 0.0.0",
"libc 0.0.0",
[[package]]
name = "string_cache"
-version = "0.7.1"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "debug_unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "new_debug_unreachable 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)",
"precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "string_cache_codegen 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "string_cache_codegen"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_generator 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "strum_macros"
-version = "0.9.0"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "syn"
-version = "0.13.1"
+version = "0.13.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "syn"
+version = "0.14.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
name = "syntax"
version = "0.0.0"
dependencies = [
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "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_data_structures 0.0.0",
"rustc_errors 0.0.0",
"rustc_target 0.0.0",
- "scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serialize 0.0.0",
"syntax_pos 0.0.0",
]
version = "0.0.0"
dependencies = [
"arena 0.0.0",
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_data_structures 0.0.0",
- "scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serialize 0.0.0",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_pos 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_errors 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "tar"
-version = "0.4.15"
+version = "0.4.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "filetime 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.37 (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)",
+ "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"xattr 0.2.1 (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.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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.37 (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)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "futf 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "futf 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"utf-8 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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)",
]
[[package]]
name = "textwrap"
-version = "0.9.0"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
name = "tidy"
version = "0.1.0"
dependencies = [
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "time"
-version = "0.1.39"
+version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (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)",
]
[[package]]
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
dependencies = [
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"is-match 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicode-normalization"
-version = "0.1.5"
+version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unicode-segmentation"
-version = "1.2.0"
+version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-[[package]]
-name = "unreachable"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "unreachable"
version = "1.0.0"
name = "unstable-book-gen"
version = "0.1.0"
dependencies = [
- "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"tidy 0.1.0",
]
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "vcpkg"
-version = "0.2.3"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "vec_map"
-version = "0.8.0"
+version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "winapi"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "xz2"
-version = "0.1.4"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "lzma-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lzma-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
-"checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"
+"checksum aho-corasick 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f0ba20154ea1f47ce2793322f049c5646cc6d0fa9759d5f333f286e507bf8080"
"checksum ammonia 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd4c682378117e4186a492b2252b9537990e1617f44aed9788b9a1149de45477"
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
-"checksum ar 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "35c7a5669cb64f085739387e1308b74e6d44022464b7f1b63bbd4ceb6379ec31"
"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"
-"checksum assert_cli 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5da59dbd8df54562665b925b427221ceda9b771408cb8a6cbd2125d3b001330b"
-"checksum atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "af80143d6f7608d746df1520709e5d141c96f240b0e62b0aa41bdfb53374d9d4"
-"checksum backtrace 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbe525f66f42d207968308ee86bc2dd60aa5fab535b22e616323a173d097d8e"
-"checksum backtrace-sys 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5fd343a2466c4603f76f38de264bc0526cffc7fa38ba52fb9f13237eccc1ced2"
+"checksum assert_cli 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98589b0e465a6c510d95fceebd365bb79bedece7f6e18a480897f2015f85ec51"
+"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1"
+"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a"
+"checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e"
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
-"checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf"
+"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789"
"checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32"
-"checksum byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "73b5bdfe7ee3ad0b99c9801d58807a9dbc9e09196365b0203853b99889ab3c87"
-"checksum cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ebd6272a2ca4fd39dbabbd6611eb03df45c2259b3b80b39a9ff8fbdcf42a4b3"
-"checksum cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0ebb87d1116151416c0cf66a0e3fb6430cccd120fd6300794b4dfaa050ac40ba"
-"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
+"checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9"
+"checksum cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1efca0b863ca03ed4c109fb1c55e0bc4bbeb221d3e103d86251046b06a526bd0"
+"checksum cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "49ec142f5768efb5b7622aebc3fdbdbb8950a4b9ba996393cb76ef7466e8747d"
+"checksum cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efe5c877e17a9c717a0bf3613b2709f723202c4e4675cc8f12926ded29bcb17e"
"checksum chalk-engine 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a146c19172c7eea48ea55a7123ac95da786639bc665097f1e14034ee5f1d8699"
"checksum chalk-macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "295635afd6853aa9f20baeb7f0204862440c0fe994c5a253d5f479dac41d047e"
-"checksum chrono 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ba5f60682a4c264e7f8d77b82e7788938a76befdf949d4a98026d19099c9d873"
-"checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536"
-"checksum clippy_lints 0.0.205 (registry+https://github.com/rust-lang/crates.io-index)" = "1dcb837d7510bf9e4e3b6f470c450c6d25e61116db5503a6f565bb6283860622"
-"checksum cmake 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "5cf678ceebedde428000cb3a34465cf3606d1a48da17014948a916deac39da7c"
+"checksum chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6962c635d530328acc53ac6a955e83093fedc91c5809dfac1fa60fa470830a37"
+"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
+"checksum clippy_lints 0.0.211 (git+https://github.com/rust-lang-nursery/rust-clippy?rev=6c70013f93a18c1ca7990efa8b1464acc6e18ce7)" = "<none>"
+"checksum cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "95470235c31c726d72bf2e1f421adc1e65b9d561bf5529612cbe1a72da1467b3"
"checksum colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0aa3473e85a3161b59845d6096b289bb577874cafeaf75ea1b1beaa6572c7fc"
"checksum commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007"
"checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2"
-"checksum compiletest_rs 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "608d9d3ccc45b63bf337d2ff5e65def5a5a52c187122232509f6b72707f61b1b"
+"checksum compiletest_rs 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "04cea0fe8b8aaca8143af607ad69076866c9f08b83c4b7faca0e993e5486831b"
"checksum core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7caa6cb9e76ddddbea09a03266d6b3bc98cd41e9fb9b017c473e7cca593ec25"
"checksum core-foundation-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b2a53cce0ddcf7e7e1f998738d757d5a3bf08bf799a180e50ebe50d298f52f5a"
"checksum crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "24ce9782d4d5c53674646a6a4c1863a21a8fc0cb649b3c94dfc16e45071dea19"
"checksum curl 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "aaf20bbe084f285f215eef2165feed70d6b75ba29cad24469badb853a4a287d0"
"checksum curl-sys 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "71c63a540a9ee4e15e56c3ed9b11a2f121239b9f6d7b7fe30f616e048148df9a"
"checksum datafrog 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d724bf4ffe77cdceeecd461009b5f8d9e23c5d645d68bedb4586bf43e7e142"
-"checksum debug_unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9a032eac705ca39214d169f83e3d3da290af06d8d1d344d1baad2fd002dca4b3"
"checksum derive-new 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ceed73957c449214f8440eec8ad7fa282b67dc9eacbb24a3085b15d60397a17a"
"checksum diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3c2b69f912779fbb121ceb775d74d51e915af17aaebc38d28a592843a2dd0a3a"
"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
"checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab"
"checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0"
-"checksum elasticlunr-rs 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4511b63d69dd5d31e8e29aed2c132c413f87acea8035d0584801feaab9dd1f0f"
+"checksum elasticlunr-rs 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4837d77a1e157489a3933b743fd774ae75074e0e390b2b7f071530048a0d87ee"
"checksum ena 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "88dc8393b3c7352f94092497f6b52019643e493b6b890eb417cdb7c46117e621"
-"checksum endian-type 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d"
"checksum enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180"
-"checksum env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "be27f8ea102a7182093a80d98f0b78623b580eda8791cbe8e2345fe6e57567a6"
+"checksum env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0e6e40ebb0e66918a37b38c7acab4e10d299e0463fe2af5d29b9cc86710cfd2a"
"checksum environment 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f4b14e20978669064c33b4c1e0fb4083412e40fe56cbea2eae80fd7591503ee"
"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3"
"checksum failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "934799b6c1de475a012a02dab0ace1ace43789ee4b99bcfbf1a2e3e8ced5de82"
"checksum failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cdda555bb90c9bb67a3b670a0f42de8e73f5981524123ad8578aafec8ddb8b"
-"checksum filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "714653f3e34871534de23771ac7b26e999651a0a228f47beb324dfdf1dd4b10f"
-"checksum filetime 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08530a39af0bd442c40aabb9e854f442a83bd2403feb1ed58fbe982dec2385f3"
+"checksum filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "da4b9849e77b13195302c174324b5ba73eec9b236b24c221a61000daefb95c5f"
"checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33"
"checksum flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fac2277e84e5e858483756647a9d0aa8d9a2b7cba517fd84325a0aaa69a0909"
"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
"checksum fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213"
+"checksum fst 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d94485a00b1827b861dd9d1a2cc9764f9044d4c535514c0760a5a2012ef3399f"
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
-"checksum futf 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "51f93f3de6ba1794dcd5810b3546d004600a59a98266487c8407bc4b24e398f3"
-"checksum futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5a3176836efa0b37f0e321b86672dfada1564aeb516fbed67b7c24050a0263"
+"checksum futf 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7c9c1ce3fa9336301af935ab852c437817d14cd33690446569392e65170aac3b"
+"checksum futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "1a70b146671de62ec8c8ed572219ca5d594d9b06c0b364d5e67b722fc559b48c"
"checksum getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "b900c08c1939860ce8b54dc6a89e26e00c04c380fd0e09796799bd7f12861e05"
-"checksum git2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f41c0035c37ec11ed3f1e1946a76070b0c740393687e9a9c7612f6a709036b3"
+"checksum git2 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "910a2df52d2354e4eb27aa12f3803ea86bf461a93e17028908ec0e356572aa7b"
"checksum git2-curl 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b502f6b1b467957403d168f0039e0c46fa6a1220efa2adaef25d5b267b5fe024"
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
-"checksum globset 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e96ab92362c06811385ae9a34d2698e8a1160745e0c78fbb434a44c8de3fabc"
-"checksum handlebars 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07af2ff31f66f39a5c8b8b8a5dc02734a453110146763e3a2323f4931a915a76"
-"checksum hex 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "459d3cf58137bb02ad4adeef5036377ff59f066dbb82517b7192e3a5462a2abc"
+"checksum globset 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "142754da2c9b3722affd909f9e27f2a6700a7a303f362971e0a74c652005a43d"
+"checksum handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d89ec99d1594f285d4590fc32bac5f75cdab383f1123d504d27862c644a807dd"
+"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
"checksum home 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8f94f6fbdc000a6eba0c8cf08632b2091bb59141d36ac321a2a96d6365e5e4dc"
-"checksum html5ever 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e579ac8647178ab915d400d7d22938bda5cd351c6c62e1c294d56884ccfc75fe"
+"checksum html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b04478cf718862650a0bf66acaf8f2f8c906fbc703f35c916c1f4211b069a364"
"checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e"
"checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d"
"checksum if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "61bb90bdd39e3af69b0172dfc6130f6cd6332bf040fbb9bdd4401d37adbd48b8"
-"checksum ignore 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "245bea0ba52531a3739cb8ba99f8689eda13d7faf8c36b6a73ce4421aab42588"
+"checksum ignore 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "787a5940ab88e0f2f3b2cad3687060bddcf67520f3b761abc31065c9c495d088"
"checksum is-match 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7e5b386aef33a1c677be65237cb9d32c3f3ef56bd035949710c4bb13083eb053"
"checksum isatty 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6c324313540cd4d7ba008d43dc6606a32a5579f13cc17b2804c13096f0a5c522"
"checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450"
"checksum json 0.11.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9ad0485404155f45cce53a40d4b2d6ac356418300daed05273d9e26f91c390be"
"checksum jsonrpc-core 8.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ddf83704f4e79979a424d1082dd2c1e52683058056c9280efa19ac5f6bc9033c"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
-"checksum languageserver-types 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "017cf5ade4be5ebeb06277ccd281c268dbd2e0801128d3992b4b4057f34dd432"
+"checksum languageserver-types 0.43.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dedb2c8010c9c7530b205fd16ed24a158c3a46634cb0fc61528b17cbbb55df1a"
"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
-"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d"
+"checksum lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e6412c5e2ad9584b0b8e979393122026cdd6d2a80b933f890dcd694ddbe73739"
"checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef"
-"checksum libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "6fd41f331ac7c5b8ac259b8bf82c75c0fb2e469bbf37d2becbba9a6a2221965b"
-"checksum libgit2-sys 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1ecbd6428006c321c29b6c8a895f0d90152f1cf4fd8faab69fc436a3d9594f63"
-"checksum libssh2-sys 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0db4ec23611747ef772db1c4d650f8bd762f07b461727ec998f953c614024b75"
+"checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1"
+"checksum libgit2-sys 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7adce4cc6db027611f537837a7c404319b6314dae49c5db80ad5332229894751"
+"checksum libssh2-sys 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5afcb36f9a2012ab8d3a9ba5186ee2d1c4587acf199cb47879a73c5fe1b731a4"
"checksum libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "87f737ad6cc6fd6eefe3d9dc5412f1573865bded441300904d2f42269e140f16"
"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
-"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2"
-"checksum log_settings 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3d382732ea0fbc09790c4899db3255bdea0fc78b54bf234bd18a63bb603915b6"
-"checksum lzma-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c1b93b78f89e8737dac81837fc8f5521ac162abcba902e1a3db949d55346d1da"
+"checksum log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "61bd98ae7f7b754bc53dca7d44b604f733c6bba044ea6f41bc8d89272d8161d2"
+"checksum log_settings 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19af41f0565d7c19b2058153ad0b42d4d5ce89ec4dbf06ed6741114a8b63e7cd"
+"checksum lzma-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d1eaa027402541975218bb0eec67d6b0412f6233af96e0d096d31dbdfd22e614"
"checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
"checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43"
"checksum markup5ever 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfedc97d5a503e96816d10fedcd5b42f760b2e525ce2f7ec71f6a41780548475"
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376"
"checksum mdbook 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "90b5a8d7e341ceee5db3882a06078d42661ddcfa2b3687319cc5da76ec4e782f"
"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d"
+"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
"checksum minifier 0.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "78cb57f9a385530d60f2d67f6e108050b478b7a0ffd0bb9c350803e1356535dd"
"checksum miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "609ce024854aeb19a0ef7567d348aaa5a746b32fb72e336df7fcc16869d7e2b4"
"checksum miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9224c91f82b3c47cf53dcf78dfaa20d6888fbcc5d272d5f2fcdf8a697f3c987d"
-"checksum nibble_vec 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa"
+"checksum new_debug_unreachable 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0cdc457076c78ab54d5e0d6fa7c47981757f1e34dc39ff92787f217dede586c4"
"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
-"checksum num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f8d26da319fb45674985c78f1d1caf99aa4941f785d384a2ae36d0740bc3e2fe"
+"checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea"
"checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31"
-"checksum num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dee092fcdf725aee04dd7da1d21debff559237d49ef1cb3e69bcb8ece44c7364"
+"checksum num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe"
"checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30"
"checksum open 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c281318d992e4432cfa799969467003d05921582a7489a8325e37f8a450d5113"
-"checksum openssl 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)" = "63246f69962e8d5ef865f82a65241d6483c8a2905a1801e2f7feb5d187d51320"
+"checksum openssl 0.10.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ed18a0f40ec4e9a8a81f8865033d823b7195d16a0a5721e10963ee1b0c2980ca"
"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
-"checksum openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)" = "0bbd90640b148b46305c1691eed6039b5c8509bed16991e3562a01eeb76902a3"
+"checksum openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)" = "d8abc04833dcedef24221a91852931df2f63e3369ae003134e70aff3645775cc"
"checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063"
+"checksum ordslice 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd20eec3dbe4376829cb7d80ae6ac45e0a766831dca50202ff2d40db46a8a024"
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
"checksum parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4d05f1349491390b1730afba60bb20d55761bef489a954546b58b4b34e1e2ac"
"checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa"
"checksum pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0fce5d8b5cc33983fc74f78ad552b5522ab41442c4ca91606e4236eb4b5ceefc"
"checksum pest_derive 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ab94faafeb93f4c5e3ce81ca0e5a779529a602ad5d09ae6d21996bfb8b6a52bf"
"checksum petgraph 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "8b30dc85588cd02b9b76f5e386535db546d21dc68506cff2abebee0b6445e8e4"
-"checksum phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "cb325642290f28ee14d8c6201159949a872f220c62af6e110a56ea914fbe42fc"
-"checksum phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d62594c0bb54c464f633175d502038177e90309daf2e0158be42ed5f023ce88f"
-"checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03"
-"checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2"
-"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903"
+"checksum phf 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "7d37a244c75a9748e049225155f56dbcb98fe71b192fd25fd23cb914b5ad62f2"
+"checksum phf_codegen 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "4e4048fe7dd7a06b8127ecd6d3803149126e9b33c7558879846da3a63f734f2b"
+"checksum phf_generator 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "05a079dd052e7b674d21cb31cbb6c05efd56a2cd2827db7692e2f1a507ebd998"
+"checksum phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "c2261d544c2bb6aa3b10022b0be371b9c7c64f762ef28c6f5d4f1ef6d97b5930"
+"checksum pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "110d5ee3593dbb73f56294327fe5668bcc997897097cbc76b51e7aed3f52452f"
"checksum polonius-engine 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b6b0a7f5f4278b991ffd14abce1d01b013121ad297460237ef0a2f08d43201"
"checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
"checksum pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a029430f0d744bc3d15dd474d591bed2402b645d024583082b9f63bb936dac6"
-"checksum proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "49b6a521dc81b643e9a51e0d1cf05df46d5a2f3c0280ea72bcb68276ba64a118"
+"checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7"
+"checksum proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "effdb53b25cdad54f8f48843d67398f7ef2e14f12c1b4cb4effc549a6462a4d6"
"checksum pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d6fdf85cda6cadfae5428a54661d431330b312bc767ddbc57adbedc24da66e32"
-"checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4"
+"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0"
"checksum quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45"
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
-"checksum quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0ff51282f28dc1b53fd154298feaa2e77c5ea0dba68e1fd8b03b72fbe13d2a"
+"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.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "e713729f45f12df5c5e182d39506766f76c09133fb661d3622e0ddf8078911c2"
-"checksum radix_trie 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "03d0d770481e8af620ca61d3d304bf014f965d7f78e923dc58545e6a545070a9"
-"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1"
"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5"
"checksum rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80e811e76f1dbf68abf87a759083d34600017fc4e10b6bd5ad84a700f9dba4b1"
"checksum rayon-core 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d24ad214285a7729b174ed6d3bcfcb80177807f959d95fafd5bfc5c4f201ac8"
-"checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd"
+"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
-"checksum regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "aec3f58d903a7d2a9dc2bf0e41a746f4530e0cab6b615494e058f67a3ef947fb"
-"checksum regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75ecf88252dce580404a22444fc7d626c01815debba56a7f4f536772a5ff19d3"
-"checksum regex-syntax 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "bd90079345f4a4c3409214734ae220fd773c6f2e8a543d07370c6c1c369cfbfb"
-"checksum regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f1ac0f60d675cc6cf13a20ec076568254472551051ad5dd050364d70671bf6b"
+"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384"
+"checksum regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13c93d55961981ba9226a213b385216f83ab43bd6ac53ab16b2eeb47e337cf4e"
+"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7"
+"checksum regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05b06a75f5217880fc5e905952a42750bf44787e56a6c6d6852ed0992f5e1d54"
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
-"checksum rls-analysis 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da9794cd1f80f2cb888c00641a32f9855d0226c954ee31cef145784914c7142e"
+"checksum rls-analysis 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96f84d303dcbe1c1bdd41b10867d3399c38fbdac32c4e3645cdb6dbd7f82db1d"
"checksum rls-blacklist 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a9cc2545ccb7e05b355bfe047b8039a6ec12270d5f3c996b766b340a50f7d2"
"checksum rls-data 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3dd20763e1c60ae8945384c8a8fa4ac44f8afa7b0a817511f5e8927e5d24f988"
"checksum rls-rustc 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2c8c09117ae2887baaa4b17fe1cb572f9b22e4d2c6a5cda04093d8b366b0be99"
"checksum rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d7c7046dc6a92f2ae02ed302746db4382e75131b9ce20ce967259f6b5867a6a"
"checksum rls-vfs 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "be231e1e559c315bc60ced5ad2cc2d7a9c208ed7d4e2c126500149836fda19bb"
-"checksum rustc-ap-arena 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e794b25832224eea9252ebfa9f94ab7070d0a60c977793112c611501cb56b48d"
-"checksum rustc-ap-arena 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6f0687e373d86505f31faeaee87d2be552843a830a0a20e252e76337b9596161"
-"checksum rustc-ap-rustc_cratesio_shim 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a78241b2ecb82ebb9221b4b7d37c024ff1f2e43f1b099f38a997f030fc7894b0"
-"checksum rustc-ap-rustc_cratesio_shim 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7ab5b83e209f3bcdb3c058a996d54b67db58eed5496bd114a781d9faa021aba7"
-"checksum rustc-ap-rustc_data_structures 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5529c3927f32b0b56d1f6449a34f2218dc2160c6a6dde0cf47954d83a9a45764"
-"checksum rustc-ap-rustc_data_structures 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4bb330c149e9b133d4707718a7981d65ce4eb14f2d59cb487761aa922fefb206"
-"checksum rustc-ap-rustc_errors 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb1fef44a7d63f5d204c981adb26a14e85fe7ee5962050a4f664df6f425f9b48"
-"checksum rustc-ap-rustc_errors 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e19ae6a813d5cdd12b8b95cea71438bf8a5fa3505bea1e7d68d438a8ac5ae7b"
-"checksum rustc-ap-rustc_target 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a3939a9f7bf063536dd646894ca43b1378ec6a56ac5b2698cc6ba0b42bfadbdc"
-"checksum rustc-ap-rustc_target 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "867d4a6bc1b62d373fc6ec72632d5cbd36f3cb1f4e51282d0c7b4e771b393031"
-"checksum rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "692169d0bac8a4547f9778039460799e162664477a1eaec15d31507705f8c736"
-"checksum rustc-ap-serialize 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e095f23598f115432ffef263201e030626f454d183cf425ef68fcca984f6594b"
-"checksum rustc-ap-syntax 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "22e93ee3817b007d56b5c5b151e6cd7c7063455a1facaf9e0ca01f9d9365b716"
-"checksum rustc-ap-syntax 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab8f97532dabc3713ac3e8d11a85f1a5b154486e79a0c2643d62078f0f948ce2"
-"checksum rustc-ap-syntax_pos 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fe5d24a137d6e202cd6eb96cb74f8cb4a2b257c42b74dd624e136b4e19f0a47d"
-"checksum rustc-ap-syntax_pos 164.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e098adae207a4b8d470bc5e9565904cfe65dca799ba4c9efc872e7436eb5a67"
-"checksum rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11fb43a206a04116ffd7cfcf9bcb941f8eb6cc7ff667272246b0a1c74259a3cb"
+"checksum rustc-ap-arena 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f7bd7aabbf60986181924ddad8c5bee830cf83213ed8553f715145d050e42d0c"
+"checksum rustc-ap-rustc_cratesio_shim 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1bc122961e39834268cb45baf75995eaca376b78146efce962b27de71b3e8b7"
+"checksum rustc-ap-rustc_data_structures 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6c2ed8ee3a204499534a1ea22a8eb6c87c0c39dd139197d4a0f913b8e12a4c2"
+"checksum rustc-ap-rustc_errors 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d35753d6c9159f49c74f800b0d00707db09863a7554679e1b701c7eeeb5a611c"
+"checksum rustc-ap-rustc_target 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f1b3da32f4862d4722e6f699e92ffa8b556166752fbdbbd64cc7d9ddd8db0e8"
+"checksum rustc-ap-serialize 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "182579d9dc2e46e232de4cdd1a56ec352a55440a86e7389a6109dae73f2a392b"
+"checksum rustc-ap-syntax 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c890882969e05d73cb97695a64e32b526830c7f197a708feb376e8684d16abb2"
+"checksum rustc-ap-syntax_pos 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6c779602d2e364440d28f8cb3c1fa13dcf11a546b96c5eab2bc7554869e2aca4"
+"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"
"checksum rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40f06724db71e18d68b3b946fdf890ca8c921d9edccc1404fdfdb537b0d12649"
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
"checksum rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a54aa04a10c68c1c4eacb4337fd883b435997ede17a9385784b990777686b09a"
"checksum rustfix 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9da3cf9b79dc889a2c9879643f26d7a53e37e9361c7566b7d2787d5ace0d8396"
-"checksum rustfmt-nightly 0.8.2 (git+https://github.com/rust-lang-nursery/rustfmt?rev=f3906267)" = "<none>"
"checksum same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cfb6eded0b06a0b512c8ddbcf04089138c9b4362c2f696f3c3d76039d68f3637"
-"checksum schannel 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "85fd9df495640643ad2d00443b3d78aae69802ad488debab4f1dd52fc1806ade"
-"checksum scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8674d439c964889e2476f474a3bf198cc9e199e77499960893bac5de7e9218a4"
+"checksum schannel 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "dc1fabf2a7b6483a141426e1afd09ad543520a77ac49bd03c286e7696ccfd77f"
+"checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28"
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
-"checksum serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "29465552c9b767d0cb44be3ddf4c3214be15d34975a7750f6cf4f409835f0248"
-"checksum serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "fb88f3c93214390ed9ef3ad15ce303c36684a915a97a30883ac6ca261bf67dc7"
-"checksum serde_derive_internals 0.23.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9d30c4596450fd7bbda79ef15559683f9a79ac0193ea819db90000d7e1cae794"
+"checksum serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)" = "210e5a3b159c566d7527e9b22e44be73f2e0fcc330bb78fef4dbccb56d2e74c8"
+"checksum serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)" = "dd724d68017ae3a7e63600ee4b2fdb3cad2158ffd1821d44aff4580f63e2b593"
"checksum serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "190e9765dcedb56be63b6e0993a006c7e3b071a016a304736e4a315dc01fb142"
-"checksum serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7bf1cbb1387028a13739cb018ee0d9b3db534f22ca3c84a5904f7eadfde14e75"
+"checksum serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)" = "84b8035cabe9b35878adec8ac5fe03d5f6bc97ff6edd7ccb96b44c1276ba390e"
"checksum shell-escape 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "170a13e64f2a51b77a45702ba77287f5c6829375b04a69cf2222acd17d0cfab9"
"checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
"checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537"
-"checksum smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44db0ecb22921ef790d17ae13a3f6d15784183ff5f2a01aa32098c7498d2b4b9"
-"checksum socket2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ff606e0486e88f5fc6cfeb3966e434fb409abbc7a3ab495238f70a1ca97f789d"
-"checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b"
-"checksum string_cache 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39cb4173bcbd1319da31faa5468a7e3870683d7a237150b0b0aaafd546f6ad12"
-"checksum string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "479cde50c3539481f33906a387f2bd17c8e87cb848c35b6021d41fb81ff9b4d7"
+"checksum smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "312a7df010092e73d6bbaf141957e868d4f30efd2bfd9bb1028ad91abec58514"
+"checksum socket2 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "962a516af4d3a7c272cb3a1d50a8cc4e5b41802e4ad54cfb7bee8ba61d37d703"
+"checksum stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffbc596e092fe5f598b12ef46cc03754085ac2f4d8c739ad61c4ae266cc3b3fa"
+"checksum string_cache 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25d70109977172b127fe834e5449e5ab1740b9ba49fa18a2020f509174f25423"
+"checksum string_cache_codegen 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "35293b05cf1494e8ddd042a7df6756bf18d07f42d234f32e71dce8a7aabb0191"
"checksum string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1884d1bc09741d466d9b14e6d37ac89d6909cbcac41dd9ae982d4d063bbedfc"
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
"checksum strum 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "099e21b5dd6dd07b5adcf8c4b723a7c0b7efd7a9359bf963d58c0caae8532545"
-"checksum strum_macros 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0dd9bd569e88028750e3ae5c25616b8278ac16a8e61aba4339195c72396d49e1"
+"checksum strum_macros 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1292d85e688e4696ecb69b2db2648994fb8af266974e89be53cefdf003861a5d"
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
-"checksum syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "91b52877572087400e83d24b9178488541e3d535259e04ff17a63df1e5ceff59"
+"checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b"
+"checksum syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2beff8ebc3658f07512a413866875adddd20f4fd47b2a4e6c9da65cd281baaea"
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
"checksum synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a761d12e6d8dcb4dcf952a7a89b475e3a9d69e4a69307e01a470977642914bd"
"checksum syntex_errors 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9e52bffe6202cfb67587784cf23e0ec5bf26d331eef4922a16d5c42e12aa1e9b"
"checksum syntex_pos 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)" = "955ef4b16af4c468e4680d1497f873ff288f557d338180649e18f915af5e15ac"
"checksum syntex_syntax 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)" = "76a302e717e348aa372ff577791c3832395650073b8d8432f8b3cb170b34afde"
-"checksum tar 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)" = "6af6b94659f9a571bf769a5b71f54079393585ee0bfdd71b691be22d7d6b1d18"
+"checksum tar 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)" = "e8f41ca4a5689f06998f0247fcb60da6c760f1950cc9df2a10d71575ad0b062a"
"checksum tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47776f63b85777d984a50ce49d6b9e58826b6a3766a449fc95bc66cd5663c15b"
"checksum tendril 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9de21546595a0873061940d994bbbc5c35f024ae4fd61ec5c5b159115684f508"
"checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1"
"checksum term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5e6b677dd1e8214ea1ef4297f85dbcbed8e8cdddb561040cc998ca2551c37561"
"checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83"
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
-"checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
+"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6"
"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
-"checksum time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "a15375f1df02096fb3317256ce2cee6a1f42fc84ea5ad5fc8c421cfe40c73098"
+"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b"
"checksum toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a0263c6c02c4db6c8f7681f9fd35e90de799ebd4cfdeab77a38f4ff6b3d8c0d9"
"checksum toml-query 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6854664bfc6df0360c695480836ee90e2d0c965f06db291d10be9344792d43e8"
"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d"
"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
-"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f"
-"checksum unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8083c594e02b8ae1654ae26f0ade5158b119bd88ad0e8227a5d8fcd72407946"
+"checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25"
+"checksum unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1"
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
"checksum unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb"
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
-"checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91"
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
"checksum url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f808aadd8cfec6ef90e4a14eb46f24511824d1ac596b9682703c87056c8678b7"
"checksum url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea"
"checksum userenv-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d28ea36bbd9192d75bd9fa9b39f96ddb986eaee824adae5d53b6e51919b2f3"
"checksum utf-8 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1262dfab4c30d5cb7c07026be00ee343a6cf5027fdc0104a9160f354e5db75c"
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
-"checksum vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7ed0f6789c8a85ca41bbc1c9d175422116a9869bd1cf31bb08e1493ecce60380"
-"checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"
+"checksum vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cbe533e138811704c0e3cbde65a818b35d3240409b4346256c5ede403e082474"
+"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "63636bd0eb3d00ccb8b9036381b526efac53caf112b7783b730ab3f8e44da369"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
-"checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3"
+"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
"checksum wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb06499a3a4d44302791052df005d5232b927ed1a9658146d842165c4de7767"
"checksum xattr 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "abb373b92de38a4301d66bec009929b4fb83120ea1c4a401be89dbe0b9777443"
-"checksum xz2 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "98df591c3504d014dd791d998123ed00a476c7e26dc6b2e873cb55c6ac9e59fa"
+"checksum xz2 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "df8bf41d3030c3577c9458fd6640a05afbf43b150d0b531b16bd77d3f794f27a"
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992"
[patch."https://github.com/rust-lang/cargo"]
cargo = { path = "tools/cargo" }
-[patch.crates-io]
+[patch."https://github.com/rust-lang-nursery/rustfmt"]
# Similar to Cargo above we want the RLS to use a vendored version of `rustfmt`
# that we're shipping as well (to ensure that the rustfmt in RLS and the
-# `rustfmt` executable are the same exact vesion). Unlike Cargo, however, the
-# RLS depends on `rustfmt` from crates.io, so we put this in a `[patch]` section
-# for crates.io
+# `rustfmt` executable are the same exact version).
rustfmt-nightly = { path = "tools/rustfmt" }
+
+[patch."https://github.com/rust-lang-nursery/rust-clippy"]
+clippy = { path = "tools/clippy" }
[dependencies]
build_helper = { path = "../build_helper" }
cmake = "0.1.23"
-filetime = "0.1"
+filetime = "0.2"
num_cpus = "1.0"
getopts = "0.2"
cc = "1.0.1"
cmd.arg("--cfg").arg("parallel_queries");
}
+ if env::var_os("RUSTC_VERIFY_LLVM_IR").is_some() {
+ cmd.arg("-Z").arg("verify-llvm-ir");
+ }
+
let color = match env::var("RUSTC_COLOR") {
Ok(s) => usize::from_str(&s).expect("RUSTC_COLOR should be an integer"),
Err(_) => 0,
let want_rustdoc = self.doc_tests != DocTests::No;
+ // We synthetically interpret a stage0 compiler used to build tools as a
+ // "raw" compiler in that it's the exact snapshot we download. Normally
+ // the stage0 build means it uses libraries build by the stage0
+ // compiler, but for tools we just use the precompiled libraries that
+ // we've downloaded
+ let use_snapshot = mode == Mode::ToolBootstrap;
+ assert!(!use_snapshot || stage == 0);
+
+ let maybe_sysroot = self.sysroot(compiler);
+ let sysroot = if use_snapshot {
+ self.rustc_snapshot_sysroot()
+ } else {
+ &maybe_sysroot
+ };
+ let libdir = sysroot.join(libdir(&compiler.host));
+
// Customize the compiler we're running. Specify the compiler to cargo
// as our shim and then pass it some various options used to configure
// how the actual compiler itself is called.
"RUSTC_DEBUG_ASSERTIONS",
self.config.rust_debug_assertions.to_string(),
)
- .env("RUSTC_SYSROOT", self.sysroot(compiler))
- .env("RUSTC_LIBDIR", self.rustc_libdir(compiler))
+ .env("RUSTC_SYSROOT", &sysroot)
+ .env("RUSTC_LIBDIR", &libdir)
.env("RUSTC_RPATH", self.config.rust_rpath.to_string())
.env("RUSTDOC", self.out.join("bootstrap/debug/rustdoc"))
.env(
cargo.env("RUSTC_ERROR_FORMAT", error_format);
}
if cmd != "build" && cmd != "check" && want_rustdoc {
- cargo.env("RUSTDOC_LIBDIR", self.sysroot_libdir(compiler, self.config.build));
+ cargo.env("RUSTDOC_LIBDIR", &libdir);
}
if mode.is_tool() {
cargo.env("RUSTC_BACKTRACE_ON_ICE", "1");
}
+ if self.config.rust_verify_llvm_ir {
+ cargo.env("RUSTC_VERIFY_LLVM_IR", "1");
+ }
+
cargo.env("RUSTC_VERBOSE", format!("{}", self.verbosity));
// in std, we want to avoid denying warnings for stage 0 as that makes cfg's painful.
/// Cargo's output path for rustdoc in a given stage, compiled by a particular
/// compiler for the specified target.
pub fn rustdoc_stamp(builder: &Builder, compiler: Compiler, target: Interned<String>) -> PathBuf {
- builder.cargo_out(compiler, Mode::ToolRustc, target).join(".rustdoc-check.stamp")
+ builder.cargo_out(compiler, Mode::ToolRustc, target)
+ .join(".rustdoc-check.stamp")
}
pub rust_dist_src: bool,
pub rust_codegen_backends: Vec<Interned<String>>,
pub rust_codegen_backends_dir: String,
+ pub rust_verify_llvm_ir: bool,
pub build: Interned<String>,
pub hosts: Vec<Interned<String>>,
llvm_tools: Option<bool>,
deny_warnings: Option<bool>,
backtrace_on_ice: Option<bool>,
+ verify_llvm_ir: Option<bool>,
}
/// TOML representation of how each build target is configured.
config.save_toolstates = rust.save_toolstates.clone().map(PathBuf::from);
set(&mut config.deny_warnings, rust.deny_warnings.or(flags.warnings));
set(&mut config.backtrace_on_ice, rust.backtrace_on_ice);
+ set(&mut config.rust_verify_llvm_ir, rust.verify_llvm_ir);
if let Some(ref backends) = rust.codegen_backends {
config.rust_codegen_backends = backends.iter()
builder.copy_to_folder(&src, &target_bin_dir);
}
+ // Warn windows-gnu users that the bundled GCC cannot compile C files
+ builder.create(
+ &target_bin_dir.join("GCC-WARNING.txt"),
+ "gcc.exe contained in this folder cannot be used for compiling C files - it is only\
+ used as a linker. In order to be able to compile projects containing C code use\
+ the GCC provided by MinGW or Cygwin."
+ );
+
//Copy platform libs to platform-specific lib directory
let target_lib_dir = plat_root.join("lib").join("rustlib").join(target_triple).join("lib");
fs::create_dir_all(&target_lib_dir).expect("creating target_lib_dir failed");
if !has_cargo_vendor {
let mut cmd = builder.cargo(
builder.compiler(0, builder.config.build),
- Mode::ToolRustc,
+ Mode::ToolBootstrap,
builder.config.build,
"install"
);
let tmp = tmpdir(builder);
let image = tmp.join("clippy-image");
drop(fs::remove_dir_all(&image));
- t!(fs::create_dir_all(&image));
+ builder.create_dir(&image);
// Prepare the image directory
// We expect clippy to build, because we've exited this step above if tool
compiler: builder.compiler(stage, builder.config.build),
target, extra_features: Vec::new()
}).or_else(|| { println!("Unable to build clippy, skipping dist"); None })?;
+ let cargoclippy = builder.ensure(tool::CargoClippy {
+ compiler: builder.compiler(stage, builder.config.build),
+ target, extra_features: Vec::new()
+ }).or_else(|| { println!("Unable to build cargo clippy, skipping dist"); None })?;
builder.install(&clippy, &image.join("bin"), 0o755);
+ builder.install(&cargoclippy, &image.join("bin"), 0o755);
let doc = image.join("share/doc/clippy");
builder.install(&src.join("README.md"), &doc, 0o644);
builder.install(&src.join("LICENSE"), &doc, 0o644);
builder.ensure(tool::Rustdoc { host: compiler.host });
// Symlink compiler docs to the output directory of rustdoc documentation.
- let out_dir = builder.stage_out(compiler, Mode::ToolRustc).join(target).join("doc");
+ let out_dir = builder.stage_out(compiler, Mode::ToolRustc)
+ .join(target)
+ .join("doc");
t!(fs::create_dir_all(&out_dir));
builder.clear_if_dirty(&out, &rustdoc);
t!(symlink_dir_force(&builder.config, &out, &out_dir));
// Build cargo command.
let mut cargo = prepare_tool_cargo(
- builder, compiler, Mode::ToolRustc, target, "doc", "src/tools/rustdoc");
+ builder,
+ compiler,
+ Mode::ToolRustc,
+ target,
+ "doc",
+ "src/tools/rustdoc",
+ );
cargo.env("RUSTDOCFLAGS", "--document-private-items");
builder.run(&mut cargo);
#![deny(warnings)]
#![feature(core_intrinsics)]
+#![feature(drain_filter)]
#[macro_use]
extern crate build_helper;
#[cfg(windows)]
mod job;
-#[cfg(unix)]
+#[cfg(all(unix, not(target_os = "haiku")))]
mod job {
use libc;
}
}
-#[cfg(not(any(unix, windows)))]
+#[cfg(any(target_os = "haiku", not(any(unix, windows))))]
mod job {
pub unsafe fn setup(_build: &mut ::Build) {
}
/// Build codegen libraries, placing output in the "stageN-codegen" directory
Codegen,
- /// Build some tools, placing output in the "stageN-tools" directory.
+ /// Build some tools, placing output in the "stageN-tools" directory. The
+ /// "other" here is for miscellaneous sets of tools that are built using the
+ /// bootstrap compiler in its entirety (target libraries and all).
+ /// Typically these tools compile with stable Rust.
+ ToolBootstrap,
+
+ /// Compile a tool which uses all libraries we compile (up to rustc).
+ /// Doesn't use the stage0 compiler libraries like "other", and includes
+ /// tools like rustdoc, cargo, rls, etc.
ToolStd,
- ToolTest,
ToolRustc,
}
impl Mode {
pub fn is_tool(&self) -> bool {
match self {
- Mode::ToolStd | Mode::ToolTest | Mode::ToolRustc => true,
+ Mode::ToolBootstrap | Mode::ToolRustc | Mode::ToolStd => true,
_ => false
}
}
Mode::Test => "-test",
Mode::Codegen => "-rustc",
Mode::Rustc => "-rustc",
- Mode::ToolStd | Mode::ToolTest | Mode::ToolRustc => "-tools",
+ Mode::ToolBootstrap => "-bootstrap-tools",
+ Mode::ToolStd => "-tools",
+ Mode::ToolRustc => "-tools",
};
self.out.join(&*compiler.host)
.join(format!("stage{}{}", compiler.stage, suffix))
/// Returns the libdir of the snapshot compiler.
fn rustc_snapshot_libdir(&self) -> PathBuf {
+ self.rustc_snapshot_sysroot().join(libdir(&self.config.build))
+ }
+
+ /// Returns the sysroot of the snapshot compiler.
+ fn rustc_snapshot_sysroot(&self) -> &Path {
self.initial_rustc.parent().unwrap().parent().unwrap()
- .join(libdir(&self.config.build))
}
/// Runs a command, printing out nice contextual information if it fails.
let version = output(cmd.arg("--version"));
let mut parts = version.split('.').take(2)
.filter_map(|s| s.parse::<u32>().ok());
- if let (Some(major), Some(minor)) = (parts.next(), parts.next()) {
- if major > 3 || (major == 3 && minor >= 9) {
+ if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
+ if major >= 5 {
return
}
}
- panic!("\n\nbad LLVM version: {}, need >=3.9\n\n", version)
+ panic!("\n\nbad LLVM version: {}, need >=5.0\n\n", version)
}
fn configure_cmake(builder: &Builder,
"powerpc-unknown-netbsd" => "BSD-generic32",
"powerpc64-unknown-linux-gnu" => "linux-ppc64",
"powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
+ "powerpc64le-unknown-linux-musl" => "linux-ppc64le",
"s390x-unknown-linux-gnu" => "linux64-s390x",
"sparc-unknown-linux-gnu" => "linux-sparcv9",
"sparc64-unknown-linux-gnu" => "linux64-sparcv9",
builder.info(&format!("REMOTE copy libs to emulator ({})", target));
t!(fs::create_dir_all(builder.out.join("tmp")));
- let server = builder.ensure(tool::RemoteTestServer { compiler, target });
+ let server = builder.ensure(tool::RemoteTestServer {
+ compiler: compiler.with_stage(0),
+ target,
+ });
// Spawn the emulator and wait for it to come online
let tool = builder.tool_exe(Tool::RemoteTestClient);
use std::iter;
use std::path::PathBuf;
use std::process::{Command, exit};
+use std::collections::HashSet;
use Mode;
use Compiler;
let is_ext_tool = self.is_ext_tool;
match self.mode {
- Mode::ToolStd => builder.ensure(compile::Std { compiler, target }),
- Mode::ToolTest => builder.ensure(compile::Test { compiler, target }),
- Mode::ToolRustc => builder.ensure(compile::Rustc { compiler, target }),
+ Mode::ToolRustc => {
+ builder.ensure(compile::Rustc { compiler, target })
+ }
+ Mode::ToolStd => {
+ builder.ensure(compile::Std { compiler, target })
+ }
+ Mode::ToolBootstrap => {} // uses downloaded stage0 compiler libs
_ => panic!("unexpected Mode for tool build")
}
let mut duplicates = Vec::new();
let is_expected = compile::stream_cargo(builder, &mut cargo, &mut |msg| {
// Only care about big things like the RLS/Cargo for now
- if tool != "rls" && tool != "cargo" && tool != "clippy-driver" {
- return
+ match tool {
+ | "rls"
+ | "cargo"
+ | "clippy-driver"
+ => {}
+
+ _ => return,
}
let (id, features, filenames) = match msg {
compile::CargoMessage::CompilerArtifact {
typically means that something was recompiled because \
a transitive dependency has different features activated \
than in a previous build:\n");
+ println!("the following dependencies are duplicated although they \
+ have the same features enabled:");
+ for (id, cur, prev) in duplicates.drain_filter(|(_, cur, prev)| cur.2 == prev.2) {
+ println!(" {}", id);
+ // same features
+ println!(" `{}` ({:?})\n `{}` ({:?})", cur.0, cur.1, prev.0, prev.1);
+ }
+ println!("the following dependencies have different features:");
for (id, cur, prev) in duplicates {
println!(" {}", id);
- println!(" `{}` enabled features {:?} at {:?}",
- cur.0, cur.2, cur.1);
- println!(" `{}` enabled features {:?} at {:?}",
- prev.0, prev.2, prev.1);
+ let cur_features: HashSet<_> = cur.2.into_iter().collect();
+ let prev_features: HashSet<_> = prev.2.into_iter().collect();
+ println!(" `{}` additionally enabled features {:?} at {:?}",
+ cur.0, &cur_features - &prev_features, cur.1);
+ println!(" `{}` additionally enabled features {:?} at {:?}",
+ prev.0, &prev_features - &cur_features, prev.1);
}
println!("");
panic!("tools should not compile multiple copies of the same crate");
}
tool!(
- Rustbook, "src/tools/rustbook", "rustbook", Mode::ToolRustc;
+ Rustbook, "src/tools/rustbook", "rustbook", Mode::ToolBootstrap;
ErrorIndex, "src/tools/error_index_generator", "error_index_generator", Mode::ToolRustc;
- UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen", Mode::ToolStd;
- Tidy, "src/tools/tidy", "tidy", Mode::ToolStd;
- Linkchecker, "src/tools/linkchecker", "linkchecker", Mode::ToolStd;
- CargoTest, "src/tools/cargotest", "cargotest", Mode::ToolStd;
- Compiletest, "src/tools/compiletest", "compiletest", Mode::ToolTest, llvm_tools = true;
- BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::ToolStd;
- RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::ToolStd;
- RustInstaller, "src/tools/rust-installer", "fabricate", Mode::ToolStd;
- RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes", Mode::ToolStd;
+ UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen", Mode::ToolBootstrap;
+ Tidy, "src/tools/tidy", "tidy", Mode::ToolBootstrap;
+ Linkchecker, "src/tools/linkchecker", "linkchecker", Mode::ToolBootstrap;
+ CargoTest, "src/tools/cargotest", "cargotest", Mode::ToolBootstrap;
+ Compiletest, "src/tools/compiletest", "compiletest", Mode::ToolBootstrap, llvm_tools = true;
+ BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::ToolBootstrap;
+ RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::ToolBootstrap;
+ RustInstaller, "src/tools/rust-installer", "fabricate", Mode::ToolBootstrap;
+ RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes", Mode::ToolBootstrap;
);
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
tool_extended!((self, builder),
Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", {};
+ CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", {
+ // Clippy depends on procedural macros (serde), which requires a full host
+ // compiler to be available, so we need to depend on that.
+ builder.ensure(compile::Rustc {
+ compiler: self.compiler,
+ target: builder.config.build,
+ });
+ };
Clippy, clippy, "src/tools/clippy", "clippy-driver", {
// Clippy depends on procedural macros (serde), which requires a full host
// compiler to be available, so we need to depend on that.
};
Miri, miri, "src/tools/miri", "miri", {};
Rls, rls, "src/tools/rls", "rls", {
+ let clippy = builder.ensure(Clippy {
+ compiler: self.compiler,
+ target: self.target,
+ extra_features: Vec::new(),
+ });
+ if clippy.is_some() {
+ self.extra_features.push("clippy".to_owned());
+ }
builder.ensure(native::Openssl {
target: self.target,
});
fn prepare_tool_cmd(&self, compiler: Compiler, tool: Tool, cmd: &mut Command) {
let host = &compiler.host;
let mut lib_paths: Vec<PathBuf> = vec![
- PathBuf::from(&self.sysroot_libdir(compiler, compiler.host)),
+ if compiler.stage == 0 {
+ self.build.rustc_snapshot_libdir()
+ } else {
+ PathBuf::from(&self.sysroot_libdir(compiler, compiler.host))
+ },
self.cargo_out(compiler, tool.get_mode(), *host).join("deps"),
];
export CFLAGS="-fPIC $CFLAGS"
-MUSL=musl-1.1.18
+# FIXME: remove the patch when upate to 1.1.20
+MUSL=musl-1.1.19
# may have been downloaded in a previous run
if [ ! -d $MUSL ]; then
curl https://www.musl-libc.org/releases/$MUSL.tar.gz | tar xzf -
+ # Patch to fix https://github.com/rust-lang/rust/issues/48967
+ cd $MUSL && \
+ curl "https://git.musl-libc.org/cgit/musl/patch/?id=610c5a8524c3d6cd3ac5a5f1231422e7648a3791" |\
+ patch -p1 && \
+ cd -
fi
cd $MUSL
+++ /dev/null
-FROM ubuntu:16.04
-
-RUN apt-get update && apt-get install -y --no-install-recommends \
- g++ \
- make \
- file \
- curl \
- ca-certificates \
- python2.7 \
- git \
- cmake \
- sudo \
- gdb \
- llvm-3.9-tools \
- libedit-dev \
- zlib1g-dev \
- xz-utils
-
-COPY scripts/sccache.sh /scripts/
-RUN sh /scripts/sccache.sh
-
-# using llvm-link-shared due to libffi issues -- see #34486
-ENV RUST_CONFIGURE_ARGS \
- --build=x86_64-unknown-linux-gnu \
- --llvm-root=/usr/lib/llvm-3.9 \
- --enable-llvm-link-shared
-ENV RUST_CHECK_TARGET check
--- /dev/null
+FROM ubuntu:16.04
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ g++ \
+ make \
+ file \
+ curl \
+ ca-certificates \
+ python2.7 \
+ git \
+ cmake \
+ sudo \
+ gdb \
+ llvm-5.0-tools \
+ libedit-dev \
+ zlib1g-dev \
+ xz-utils
+
+COPY scripts/sccache.sh /scripts/
+RUN sh /scripts/sccache.sh
+
+# using llvm-link-shared due to libffi issues -- see #34486
+ENV RUST_CONFIGURE_ARGS \
+ --build=x86_64-unknown-linux-gnu \
+ --llvm-root=/usr/lib/llvm-5.0 \
+ --enable-llvm-link-shared
+ENV RUST_CHECK_TARGET check
--- /dev/null
+# `tool_lints`
+
+The tracking issue for this feature is: [#44690]
+
+[#44690]: https://github.com/rust-lang/rust/issues/44690
+
+------------------------
+
+Tool lints let you use scoped lints, to `allow`, `warn`, `deny` or `forbid` lints of
+certain tools.
+
+Currently `clippy` is the only available lint tool.
+
+It is recommended for lint tools to implement the scoped lints like this:
+
+- `#[_(TOOL_NAME::lintname)]`: for lint names
+- `#[_(TOOL_NAME::lintgroup)]`: for groups of lints
+- `#[_(TOOL_NAME::all)]`: for (almost[^1]) all lints
+
+## An example
+
+```rust
+#![feature(tool_lints)]
+
+#![warn(clippy::pedantic)]
+
+#[allow(clippy::filter_map)]
+fn main() {
+ let v = vec![0; 10];
+ let _ = v.into_iter().filter(|&x| x < 1).map(|x| x + 1).collect::<Vec<_>>();
+ println!("No filter_map()!");
+}
+```
+
+[^1]: Some defined lint groups can be excluded here.
}
}
-impl Box<Any> {
+impl Box<dyn Any> {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
/// Attempt to downcast the box to a concrete type.
/// print_if_string(Box::new(0i8));
/// }
/// ```
- pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
+ pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<dyn Any>> {
if self.is::<T>() {
unsafe {
- let raw: *mut Any = Box::into_raw(self);
+ let raw: *mut dyn Any = Box::into_raw(self);
Ok(Box::from_raw(raw as *mut T))
}
} else {
}
}
-impl Box<Any + Send> {
+impl Box<dyn Any + Send> {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
/// Attempt to downcast the box to a concrete type.
/// print_if_string(Box::new(0i8));
/// }
/// ```
- pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any + Send>> {
- <Box<Any>>::downcast(self).map_err(|s| unsafe {
+ pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<dyn Any + Send>> {
+ <Box<dyn Any>>::downcast(self).map_err(|s| unsafe {
// reapply the Send marker
- Box::from_raw(Box::into_raw(s) as *mut (Any + Send))
+ Box::from_raw(Box::into_raw(s) as *mut (dyn Any + Send))
})
}
}
#[unstable(feature = "fnbox",
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
-impl<'a, A, R> FnOnce<A> for Box<FnBox<A, Output = R> + 'a> {
+impl<'a, A, R> FnOnce<A> for Box<dyn FnBox<A, Output = R> + 'a> {
type Output = R;
extern "rust-call" fn call_once(self, args: A) -> R {
#[unstable(feature = "fnbox",
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
-impl<'a, A, R> FnOnce<A> for Box<FnBox<A, Output = R> + Send + 'a> {
+impl<'a, A, R> FnOnce<A> for Box<dyn FnBox<A, Output = R> + Send + 'a> {
type Output = R;
extern "rust-call" fn call_once(self, args: A) -> R {
#[test]
fn any_move() {
- let a = Box::new(8) as Box<Any>;
- let b = Box::new(Test) as Box<Any>;
+ let a = Box::new(8) as Box<dyn Any>;
+ let b = Box::new(Test) as Box<dyn Any>;
match a.downcast::<i32>() {
Ok(a) => {
Err(..) => panic!(),
}
- let a = Box::new(8) as Box<Any>;
- let b = Box::new(Test) as Box<Any>;
+ let a = Box::new(8) as Box<dyn Any>;
+ let b = Box::new(Test) as Box<dyn Any>;
assert!(a.downcast::<Box<Test>>().is_err());
assert!(b.downcast::<Box<i32>>().is_err());
#[test]
fn test_show() {
- let a = Box::new(8) as Box<Any>;
- let b = Box::new(Test) as Box<Any>;
+ let a = Box::new(8) as Box<dyn Any>;
+ let b = Box::new(Test) as Box<dyn Any>;
let a_str = format!("{:?}", a);
let b_str = format!("{:?}", b);
assert_eq!(a_str, "Any");
static EIGHT: usize = 8;
static TEST: Test = Test;
- let a = &EIGHT as &Any;
- let b = &TEST as &Any;
+ let a = &EIGHT as &dyn Any;
+ let b = &TEST as &dyn Any;
let s = format!("{:?}", a);
assert_eq!(s, "Any");
let s = format!("{:?}", b);
}
}
- let x: Box<Foo> = Box::new(Bar(17));
+ let x: Box<dyn Foo> = Box::new(Bar(17));
let p = Box::into_raw(x);
unsafe {
assert_eq!(17, (*p).get());
(*p).set(19);
- let y: Box<Foo> = Box::from_raw(p);
+ let y: Box<dyn Foo> = Box::from_raw(p);
assert_eq!(19, y.get());
}
}
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
#![no_std]
#![needs_allocator]
+#![deny(bare_trait_objects)]
#![deny(missing_debug_implementations)]
#![cfg_attr(test, allow(deprecated))] // rand
#[cfg(test)]
mod boxed_test;
pub mod collections;
-#[cfg(target_has_atomic = "ptr")]
+#[cfg(any(
+ all(stage0, target_has_atomic = "ptr"),
+ all(not(stage0), target_has_atomic = "ptr", target_has_atomic = "cas")
+))]
pub mod sync;
pub mod rc;
pub mod raw_vec;
-
+pub mod prelude;
pub mod borrow;
pub mod fmt;
pub mod slice;
--- /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.
+
+//! The alloc Prelude
+//!
+//! The purpose of this module is to alleviate imports of commonly-used
+//! items of the `alloc` crate by adding a glob import to the top of modules:
+//!
+//! ```
+//! # #![allow(unused_imports)]
+//! # #![feature(alloc)]
+//! extern crate alloc;
+//! use alloc::prelude::*;
+//! ```
+
+#![unstable(feature = "alloc", issue = "27783")]
+
+#[unstable(feature = "alloc", issue = "27783")] pub use borrow::ToOwned;
+#[unstable(feature = "alloc", issue = "27783")] pub use boxed::Box;
+#[unstable(feature = "alloc", issue = "27783")] pub use slice::SliceConcatExt;
+#[unstable(feature = "alloc", issue = "27783")] pub use string::{String, ToString};
+#[unstable(feature = "alloc", issue = "27783")] pub use vec::Vec;
use core::intrinsics::abort;
use core::marker;
use core::marker::{Unsize, PhantomData};
-use core::mem::{self, align_of_val, forget, size_of_val, uninitialized};
+use core::mem::{self, align_of_val, forget, size_of_val};
use core::ops::Deref;
use core::ops::CoerceUnsized;
use core::ptr::{self, NonNull};
}
}
-impl Rc<Any> {
+impl Rc<dyn Any> {
#[inline]
- #[unstable(feature = "rc_downcast", issue = "44608")]
+ #[stable(feature = "rc_downcast", since = "1.29.0")]
/// Attempt to downcast the `Rc<Any>` to a concrete type.
///
/// # Examples
///
/// ```
- /// #![feature(rc_downcast)]
/// use std::any::Any;
/// use std::rc::Rc;
///
/// print_if_string(Rc::new(0i8));
/// }
/// ```
- pub fn downcast<T: Any>(self) -> Result<Rc<T>, Rc<Any>> {
+ pub fn downcast<T: Any>(self) -> Result<Rc<T>, Rc<dyn Any>> {
if (*self).is::<T>() {
let ptr = self.ptr.cast::<RcBox<T>>();
forget(self);
/// [`None`]: ../../std/option/enum.Option.html#variant.None
#[stable(feature = "rc_weak", since = "1.4.0")]
pub struct Weak<T: ?Sized> {
+ // This is a `NonNull` to allow optimizing the size of this type in enums,
+ // but it is not necessarily a valid pointer.
+ // `Weak::new` sets this to a dangling pointer so that it doesn’t need
+ // to allocate space on the heap.
ptr: NonNull<RcBox<T>>,
}
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {}
impl<T> Weak<T> {
- /// Constructs a new `Weak<T>`, allocating memory for `T` without initializing
- /// it. Calling [`upgrade`] on the return value always gives [`None`].
+ /// Constructs a new `Weak<T>`, without allocating any memory.
+ /// Calling [`upgrade`] on the return value always gives [`None`].
///
/// [`upgrade`]: struct.Weak.html#method.upgrade
/// [`None`]: ../../std/option/enum.Option.html
/// ```
#[stable(feature = "downgraded_weak", since = "1.10.0")]
pub fn new() -> Weak<T> {
- unsafe {
- Weak {
- ptr: Box::into_raw_non_null(box RcBox {
- strong: Cell::new(0),
- weak: Cell::new(1),
- value: uninitialized(),
- }),
- }
+ Weak {
+ ptr: NonNull::dangling(),
}
}
}
+pub(crate) fn is_dangling<T: ?Sized>(ptr: NonNull<T>) -> bool {
+ let address = ptr.as_ptr() as *mut () as usize;
+ let align = align_of_val(unsafe { ptr.as_ref() });
+ address == align
+}
+
impl<T: ?Sized> Weak<T> {
/// Attempts to upgrade the `Weak` pointer to an [`Rc`], extending
/// the lifetime of the value if successful.
/// ```
#[stable(feature = "rc_weak", since = "1.4.0")]
pub fn upgrade(&self) -> Option<Rc<T>> {
- if self.strong() == 0 {
+ let inner = self.inner()?;
+ if inner.strong() == 0 {
None
} else {
- self.inc_strong();
+ inner.inc_strong();
Some(Rc { ptr: self.ptr, phantom: PhantomData })
}
}
+
+ /// Return `None` when the pointer is dangling and there is no allocated `RcBox`,
+ /// i.e. this `Weak` was created by `Weak::new`
+ #[inline]
+ fn inner(&self) -> Option<&RcBox<T>> {
+ if is_dangling(self.ptr) {
+ None
+ } else {
+ Some(unsafe { self.ptr.as_ref() })
+ }
+ }
}
#[stable(feature = "rc_weak", since = "1.4.0")]
/// assert!(other_weak_foo.upgrade().is_none());
/// ```
fn drop(&mut self) {
- unsafe {
- self.dec_weak();
+ if let Some(inner) = self.inner() {
+ inner.dec_weak();
// the weak count starts at 1, and will only go to zero if all
// the strong pointers have disappeared.
- if self.weak() == 0 {
- Global.dealloc(self.ptr.cast(), Layout::for_value(self.ptr.as_ref()));
+ if inner.weak() == 0 {
+ unsafe {
+ Global.dealloc(self.ptr.cast(), Layout::for_value(self.ptr.as_ref()));
+ }
}
}
}
/// ```
#[inline]
fn clone(&self) -> Weak<T> {
- self.inc_weak();
+ if let Some(inner) = self.inner() {
+ inner.inc_weak()
+ }
Weak { ptr: self.ptr }
}
}
}
}
-// NOTE: We checked_add here to deal with mem::forget safety. In particular
+// NOTE: We checked_add here to deal with mem::forget safely. In particular
// if you mem::forget Rcs (or Weaks), the ref-count can overflow, and then
// you can free the allocation while outstanding Rcs (or Weaks) exist.
// We abort because this is such a degenerate scenario that we don't care about
}
}
-impl<T: ?Sized> RcBoxPtr<T> for Weak<T> {
+impl<T: ?Sized> RcBoxPtr<T> for RcBox<T> {
#[inline(always)]
fn inner(&self) -> &RcBox<T> {
- unsafe {
- self.ptr.as_ref()
- }
+ self
}
}
assert_eq!(unsafe { &*ptr }, "foo");
assert_eq!(rc, rc2);
- let rc: Rc<Display> = Rc::new(123);
+ let rc: Rc<dyn Display> = Rc::new(123);
let ptr = Rc::into_raw(rc.clone());
let rc2 = unsafe { Rc::from_raw(ptr) };
use std::fmt::Display;
use std::string::ToString;
- let b: Box<Display> = box 123;
- let r: Rc<Display> = Rc::from(b);
+ let b: Box<dyn Display> = box 123;
+ let r: Rc<dyn Display> = Rc::from(b);
assert_eq!(r.to_string(), "123");
}
fn test_from_box_trait_zero_sized() {
use std::fmt::Debug;
- let b: Box<Debug> = box ();
- let r: Rc<Debug> = Rc::from(b);
+ let b: Box<dyn Debug> = box ();
+ let r: Rc<dyn Debug> = Rc::from(b);
assert_eq!(format!("{:?}", r), "()");
}
fn test_downcast() {
use std::any::Any;
- let r1: Rc<Any> = Rc::new(i32::max_value());
- let r2: Rc<Any> = Rc::new("abc");
+ let r1: Rc<dyn Any> = Rc::new(i32::max_value());
+ let r2: Rc<dyn Any> = Rc::new("abc");
assert!(r1.clone().downcast::<u32>().is_err());
use alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
use boxed::Box;
+use rc::is_dangling;
use string::String;
use vec::Vec;
/// necessarily) at _exactly_ `MAX_REFCOUNT + 1` references.
const MAX_REFCOUNT: usize = (isize::MAX) as usize;
-/// A sentinel value that is used for the pointer of `Weak::new()`.
-const WEAK_EMPTY: usize = 1;
-
/// A thread-safe reference-counting pointer. 'Arc' stands for 'Atomically
/// Reference Counted'.
///
#[stable(feature = "arc_weak", since = "1.4.0")]
pub struct Weak<T: ?Sized> {
// This is a `NonNull` to allow optimizing the size of this type in enums,
- // but it is actually not truly "non-null". A `Weak::new()` will set this
- // to a sentinel value, instead of needing to allocate some space in the
- // heap.
+ // but it is not necessarily a valid pointer.
+ // `Weak::new` sets this to a dangling pointer so that it doesn’t need
+ // to allocate space on the heap.
ptr: NonNull<ArcInner<T>>,
}
// holder.
//
// The acquire label here ensures a happens-before relationship with any
- // writes to `strong` prior to decrements of the `weak` count (via drop,
- // which uses Release).
+ // writes to `strong` (in particular in `Weak::upgrade`) prior to decrements
+ // of the `weak` count (via `Weak::drop`, which uses release). If the upgraded
+ // weak ref was never dropped, the CAS here will fail so we do not care to synchronize.
if self.inner().weak.compare_exchange(1, usize::MAX, Acquire, Relaxed).is_ok() {
- // Due to the previous acquire read, this will observe any writes to
- // `strong` that were due to upgrading weak pointers; only strong
- // clones remain, which require that the strong count is > 1 anyway.
- let unique = self.inner().strong.load(Relaxed) == 1;
+ // This needs to be an `Acquire` to synchronize with the decrement of the `strong`
+ // counter in `drop` -- the only access that happens when any but the last reference
+ // is being dropped.
+ let unique = self.inner().strong.load(Acquire) == 1;
// The release write here synchronizes with a read in `downgrade`,
// effectively preventing the above read of `strong` from happening
}
}
-impl Arc<Any + Send + Sync> {
+impl Arc<dyn Any + Send + Sync> {
#[inline]
- #[unstable(feature = "rc_downcast", issue = "44608")]
- /// Attempt to downcast the `Arc<Any + Send + Sync>` to a concrete type.
+ #[stable(feature = "rc_downcast", since = "1.29.0")]
+ /// Attempt to downcast the `Arc<dyn Any + Send + Sync>` to a concrete type.
///
/// # Examples
///
/// ```
- /// #![feature(rc_downcast)]
/// use std::any::Any;
/// use std::sync::Arc;
///
- /// fn print_if_string(value: Arc<Any + Send + Sync>) {
+ /// fn print_if_string(value: Arc<dyn Any + Send + Sync>) {
/// if let Ok(string) = value.downcast::<String>() {
/// println!("String ({}): {}", string.len(), string);
/// }
/// ```
#[stable(feature = "downgraded_weak", since = "1.10.0")]
pub fn new() -> Weak<T> {
- unsafe {
- Weak {
- ptr: NonNull::new_unchecked(WEAK_EMPTY as *mut _),
- }
+ Weak {
+ ptr: NonNull::dangling(),
}
}
}
pub fn upgrade(&self) -> Option<Arc<T>> {
// We use a CAS loop to increment the strong count instead of a
// fetch_add because once the count hits 0 it must never be above 0.
- let inner = if self.ptr.as_ptr() as *const u8 as usize == WEAK_EMPTY {
- return None;
- } else {
- unsafe { self.ptr.as_ref() }
- };
+ let inner = self.inner()?;
// Relaxed load because any write of 0 that we can observe
// leaves the field in a permanently zero state (so a
}
}
}
+
+ /// Return `None` when the pointer is dangling and there is no allocated `ArcInner`,
+ /// i.e. this `Weak` was created by `Weak::new`
+ #[inline]
+ fn inner(&self) -> Option<&ArcInner<T>> {
+ if is_dangling(self.ptr) {
+ None
+ } else {
+ Some(unsafe { self.ptr.as_ref() })
+ }
+ }
}
#[stable(feature = "arc_weak", since = "1.4.0")]
/// ```
#[inline]
fn clone(&self) -> Weak<T> {
- let inner = if self.ptr.as_ptr() as *const u8 as usize == WEAK_EMPTY {
- return Weak { ptr: self.ptr };
+ let inner = if let Some(inner) = self.inner() {
+ inner
} else {
- unsafe { self.ptr.as_ref() }
+ return Weak { ptr: self.ptr };
};
// See comments in Arc::clone() for why this is relaxed. This can use a
// fetch_add (ignoring the lock) because the weak count is only locked
// weak count can only be locked if there was precisely one weak ref,
// meaning that drop could only subsequently run ON that remaining weak
// ref, which can only happen after the lock is released.
- let inner = if self.ptr.as_ptr() as *const u8 as usize == WEAK_EMPTY {
- return;
+ let inner = if let Some(inner) = self.inner() {
+ inner
} else {
- unsafe { self.ptr.as_ref() }
+ return
};
if inner.weak.fetch_sub(1, Release) == 1 {
assert_eq!(unsafe { &*ptr }, "foo");
assert_eq!(arc, arc2);
- let arc: Arc<Display> = Arc::new(123);
+ let arc: Arc<dyn Display> = Arc::new(123);
let ptr = Arc::into_raw(arc.clone());
let arc2 = unsafe { Arc::from_raw(ptr) };
use std::fmt::Display;
use std::string::ToString;
- let b: Box<Display> = box 123;
- let r: Arc<Display> = Arc::from(b);
+ let b: Box<dyn Display> = box 123;
+ let r: Arc<dyn Display> = Arc::from(b);
assert_eq!(r.to_string(), "123");
}
fn test_from_box_trait_zero_sized() {
use std::fmt::Debug;
- let b: Box<Debug> = box ();
- let r: Arc<Debug> = Arc::from(b);
+ let b: Box<dyn Debug> = box ();
+ let r: Arc<dyn Debug> = Arc::from(b);
assert_eq!(format!("{:?}", r), "()");
}
fn test_downcast() {
use std::any::Any;
- let r1: Arc<Any + Send + Sync> = Arc::new(i32::max_value());
- let r2: Arc<Any + Send + Sync> = Arc::new("abc");
+ let r1: Arc<dyn Any + Send + Sync> = Arc::new(i32::max_value());
+ let r2: Arc<dyn Any + Send + Sync> = Arc::new("abc");
assert!(r1.clone().downcast::<u32>().is_err());
pub use core::task::*;
-#[cfg(target_has_atomic = "ptr")]
+#[cfg(any(
+ all(stage0, target_has_atomic = "ptr"),
+ all(not(stage0), target_has_atomic = "ptr", target_has_atomic = "cas")
+))]
pub use self::if_arc::*;
-#[cfg(target_has_atomic = "ptr")]
+#[cfg(any(
+ all(stage0, target_has_atomic = "ptr"),
+ all(not(stage0), target_has_atomic = "ptr", target_has_atomic = "cas")
+))]
mod if_arc {
use super::*;
use core::marker::PhantomData;
}
}
- #[cfg(target_has_atomic = "ptr")]
+ #[cfg(any(
+ all(stage0, target_has_atomic = "ptr"),
+ all(not(stage0), target_has_atomic = "ptr", target_has_atomic = "cas")
+ ))]
struct ArcWrapped<T>(PhantomData<T>);
unsafe impl<T: Wake + 'static> UnsafeWake for ArcWrapped<T> {
--- /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::any::Any;
+use std::sync::{Arc, Weak};
+
+#[test]
+fn uninhabited() {
+ enum Void {}
+ let mut a = Weak::<Void>::new();
+ a = a.clone();
+ assert!(a.upgrade().is_none());
+
+ let mut a: Weak<Any> = a; // Unsizing
+ a = a.clone();
+ assert!(a.upgrade().is_none());
+}
+
+#[test]
+fn slice() {
+ let a: Arc<[u32; 3]> = Arc::new([3, 2, 1]);
+ let a: Arc<[u32]> = a; // Unsizing
+ let b: Arc<[u32]> = Arc::from(&[3, 2, 1][..]); // Conversion
+ assert_eq!(a, b);
+
+ // Exercise is_dangling() with a DST
+ let mut a = Arc::downgrade(&a);
+ a = a.clone();
+ assert!(a.upgrade().is_some());
+}
+
+#[test]
+fn trait_object() {
+ let a: Arc<u32> = Arc::new(4);
+ let a: Arc<Any> = a; // Unsizing
+
+ // Exercise is_dangling() with a DST
+ let mut a = Arc::downgrade(&a);
+ a = a.clone();
+ assert!(a.upgrade().is_some());
+
+ let mut b = Weak::<u32>::new();
+ b = b.clone();
+ assert!(b.upgrade().is_none());
+ let mut b: Weak<Any> = b; // Unsizing
+ b = b.clone();
+ assert!(b.upgrade().is_none());
+}
use std::hash::{Hash, Hasher};
use std::collections::hash_map::DefaultHasher;
+mod arc;
mod binary_heap;
mod btree;
mod cow_str;
mod fmt;
mod heap;
mod linked_list;
+mod rc;
mod slice;
mod str;
mod string;
--- /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::any::Any;
+use std::rc::{Rc, Weak};
+
+#[test]
+fn uninhabited() {
+ enum Void {}
+ let mut a = Weak::<Void>::new();
+ a = a.clone();
+ assert!(a.upgrade().is_none());
+
+ let mut a: Weak<Any> = a; // Unsizing
+ a = a.clone();
+ assert!(a.upgrade().is_none());
+}
+
+#[test]
+fn slice() {
+ let a: Rc<[u32; 3]> = Rc::new([3, 2, 1]);
+ let a: Rc<[u32]> = a; // Unsizing
+ let b: Rc<[u32]> = Rc::from(&[3, 2, 1][..]); // Conversion
+ assert_eq!(a, b);
+
+ // Exercise is_dangling() with a DST
+ let mut a = Rc::downgrade(&a);
+ a = a.clone();
+ assert!(a.upgrade().is_some());
+}
+
+#[test]
+fn trait_object() {
+ let a: Rc<u32> = Rc::new(4);
+ let a: Rc<Any> = a; // Unsizing
+
+ // Exercise is_dangling() with a DST
+ let mut a = Rc::downgrade(&a);
+ a = a.clone();
+ assert!(a.upgrade().is_some());
+
+ let mut b = Weak::<u32>::new();
+ b = b.clone();
+ assert!(b.upgrade().is_none());
+ let mut b: Weak<Any> = b; // Unsizing
+ b = b.clone();
+ assert!(b.upgrade().is_none());
+}
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn swap_remove(&mut self, index: usize) -> T {
- let length = self.len();
- self.swap(index, length - 1);
- self.pop().unwrap()
+ unsafe {
+ // We replace self[index] with the last element. Note that if the
+ // bounds check on hole succeeds there must be a last element (which
+ // can be self[index] itself).
+ let hole: *mut T = &mut self[index];
+ let last = ptr::read(self.get_unchecked(self.len - 1));
+ self.len -= 1;
+ ptr::replace(hole, last)
+ }
}
/// Inserts an element at position `index` within the vector, shifting all
-Subproject commit 4cfd7101eb549169cdaeda5313f7c39415b9d736
+Subproject commit 86bf357a14cacb4a4169455e729d409b5ecc1da0
/// use specific allocators with looser requirements.)
#[stable(feature = "alloc_layout", since = "1.28.0")]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+#[cfg_attr(not(stage0), lang = "alloc_layout")]
pub struct Layout {
// size of the requested block of memory, measured in bytes.
size_: usize,
///
/// While `TypeId` implements `Hash`, `PartialOrd`, and `Ord`, it is worth
/// noting that the hashes and ordering will vary between Rust releases. Beware
-/// of relying on them outside of your code!
+/// of relying on them inside of your code!
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct TypeId {
/// Creates an iterator starting at the same point, but stepping by
/// the given amount at each iteration.
///
- /// Note that it will always return the first element of the iterator,
+ /// Note 1: The first element of the iterator will always be returned,
/// regardless of the step given.
///
+ /// Note 2: The time at which ignored elements are pulled is not fixed.
+ /// `StepBy` behaves like the sequence `next(), nth(step-1), nth(step-1), …`,
+ /// but is also free to behave like the sequence
+ /// `advance_n_and_return_first(step), advance_n_and_return_first(step), …`
+ /// Which way is used may change for some iterators for performance reasons.
+ /// The second way will advance the iterator earlier and may consume more items.
+ ///
+ /// `advance_n_and_return_first` is the equivalent of:
+ /// ```
+ /// fn advance_n_and_return_first<I>(iter: &mut I, total_step: usize) -> Option<I::Item>
+ /// where
+ /// I: Iterator,
+ /// {
+ /// let next = iter.next();
+ /// if total_step > 1 {
+ /// iter.nth(total_step-2);
+ /// }
+ /// next
+ /// }
+ /// ```
+ ///
/// # Panics
///
/// The method will panic if the given step is `0`.
#![feature(const_slice_len)]
#![feature(const_str_as_bytes)]
#![feature(const_str_len)]
-#![cfg_attr(stage0, feature(repr_transparent))]
#[prelude_import]
#[allow(unused)]
#[stable(feature = "rust1", since = "1.0.0")]
#[lang = "sized"]
#[rustc_on_unimplemented(
- message="the size for value values of type `{Self}` cannot be known at compilation time",
+ message="the size for values of type `{Self}` cannot be known at compilation time",
label="doesn't have a size known at compile-time",
note="to learn more, visit <https://doc.rust-lang.org/book/second-edition/\
ch19-04-advanced-types.html#dynamically-sized-types--sized>",
/// 2. Round up the current size to the nearest multiple of the next field's [alignment].
///
/// Finally, round the size of the struct to the nearest multiple of its [alignment].
+/// The alignment of the struct is usually the largest alignment of all its
+/// fields; this can be changed with the use of `repr(align(N))`.
///
/// Unlike `C`, zero sized structs are not rounded up to one byte in size.
///
/// // The size of the second field is 2, so add 2 to the size. Size is 4.
/// // The alignment of the third field is 1, so add 0 to the size for padding. Size is 4.
/// // The size of the third field is 1, so add 1 to the size. Size is 5.
-/// // Finally, the alignment of the struct is 2, so add 1 to the size for padding. Size is 6.
+/// // Finally, the alignment of the struct is 2 (because the largest alignment amongst its
+/// // fields is 2), so add 1 to the size for padding. Size is 6.
/// assert_eq!(6, mem::size_of::<FieldStruct>());
///
/// #[repr(C)]
// except according to those terms.
/*!
-Almost direct (but slightly optimized) Rust translation of Figure 3 of [1].
+Almost direct (but slightly optimized) Rust translation of Figure 3 of \[1\].
-[1] Burger, R. G. and Dybvig, R. K. 1996. Printing floating-point numbers
+\[1\] Burger, R. G. and Dybvig, R. K. 1996. Printing floating-point numbers
quickly and accurately. SIGPLAN Not. 31, 5 (May. 1996), 108-116.
*/
// except according to those terms.
/*!
-Rust adaptation of Grisu3 algorithm described in [1]. It uses about
+Rust adaptation of Grisu3 algorithm described in \[1\]. It uses about
1KB of precomputed table, and in turn, it's very quick for most inputs.
-[1] Florian Loitsch. 2010. Printing floating-point numbers quickly and
+\[1\] Florian Loitsch. 2010. Printing floating-point numbers quickly and
accurately with integers. SIGPLAN Not. 45, 6 (June 2010), 233-243.
*/
/// use std::panic;
///
/// panic::set_hook(Box::new(|panic_info| {
-/// println!("panic occurred: {:?}", panic_info.payload().downcast_ref::<&str>().unwrap());
+/// if let Some(s) = panic_info.payload().downcast_ref::<&str>() {
+/// println!("panic occurred: {:?}", s);
+/// } else {
+/// println!("panic occurred");
+/// }
/// }));
///
/// panic!("Normal panic");
/// let src = [1, 2, 3, 4];
/// let mut dst = [0, 0];
///
+ /// // Because the slices have to be the same length,
+ /// // we slice the source slice from four elements
+ /// // to two. It will panic if we don't do this.
/// dst.clone_from_slice(&src[2..]);
///
/// assert_eq!(src, [1, 2, 3, 4]);
/// let src = [1, 2, 3, 4];
/// let mut dst = [0, 0];
///
+ /// // Because the slices have to be the same length,
+ /// // we slice the source slice from four elements
+ /// // to two. It will panic if we don't do this.
/// dst.copy_from_slice(&src[2..]);
///
/// assert_eq!(src, [1, 2, 3, 4]);
/// [`bool`]: ../../../std/primitive.bool.html
#[cfg(target_has_atomic = "8")]
#[stable(feature = "rust1", since = "1.0.0")]
+#[repr(transparent)]
pub struct AtomicBool {
v: UnsafeCell<u8>,
}
/// This type has the same in-memory representation as a `*mut T`.
#[cfg(target_has_atomic = "ptr")]
#[stable(feature = "rust1", since = "1.0.0")]
+#[repr(transparent)]
pub struct AtomicPtr<T> {
p: UnsafeCell<*mut T>,
}
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn swap(&self, val: bool, order: Ordering) -> bool {
unsafe { atomic_swap(self.v.get(), val as u8, order) != 0 }
}
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn compare_and_swap(&self, current: bool, new: bool, order: Ordering) -> bool {
match self.compare_exchange(current, new, order, strongest_failure_ordering(order)) {
Ok(x) => x,
/// ```
#[inline]
#[stable(feature = "extended_compare_and_swap", since = "1.10.0")]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn compare_exchange(&self,
current: bool,
new: bool,
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn fetch_and(&self, val: bool, order: Ordering) -> bool {
unsafe { atomic_and(self.v.get(), val as u8, order) != 0 }
}
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn fetch_nand(&self, val: bool, order: Ordering) -> bool {
// We can't use atomic_nand here because it can result in a bool with
// an invalid value. This happens because the atomic operation is done
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn fetch_or(&self, val: bool, order: Ordering) -> bool {
unsafe { atomic_or(self.v.get(), val as u8, order) != 0 }
}
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn fetch_xor(&self, val: bool, order: Ordering) -> bool {
unsafe { atomic_xor(self.v.get(), val as u8, order) != 0 }
}
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn swap(&self, ptr: *mut T, order: Ordering) -> *mut T {
unsafe { atomic_swap(self.p.get() as *mut usize, ptr as usize, order) as *mut T }
}
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn compare_and_swap(&self, current: *mut T, new: *mut T, order: Ordering) -> *mut T {
match self.compare_exchange(current, new, order, strongest_failure_ordering(order)) {
Ok(x) => x,
/// ```
#[inline]
#[stable(feature = "extended_compare_and_swap", since = "1.10.0")]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn compare_exchange(&self,
current: *mut T,
new: *mut T,
///
/// [module-level documentation]: index.html
#[$stable]
+ #[repr(transparent)]
pub struct $atomic_type {
v: UnsafeCell<$int_type>,
}
```"),
#[inline]
#[$stable]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn swap(&self, val: $int_type, order: Ordering) -> $int_type {
unsafe { atomic_swap(self.v.get(), val, order) }
}
```"),
#[inline]
#[$stable]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn compare_and_swap(&self,
current: $int_type,
new: $int_type,
```"),
#[inline]
#[$stable_cxchg]
+ #[cfg(any(stage0, target_has_atomic = "cas"))]
pub fn compare_exchange(&self,
current: $int_type,
new: $int_type,
}
#[inline]
+#[cfg(any(stage0, target_has_atomic = "cas"))]
fn strongest_failure_ordering(order: Ordering) -> Ordering {
match order {
Release => Relaxed,
}
#[inline]
+#[cfg(any(stage0, target_has_atomic = "cas"))]
unsafe fn atomic_swap<T>(dst: *mut T, val: T, order: Ordering) -> T {
match order {
Acquire => intrinsics::atomic_xchg_acq(dst, val),
}
#[inline]
+#[cfg(any(stage0, target_has_atomic = "cas"))]
unsafe fn atomic_compare_exchange<T>(dst: *mut T,
old: T,
new: T,
pub struct EHContext<'a> {
pub ip: usize, // Current instruction pointer
pub func_start: usize, // Address of the current function
- pub get_text_start: &'a Fn() -> usize, // Get address of the code section
- pub get_data_start: &'a Fn() -> usize, // Get address of the data section
+ pub get_text_start: &'a dyn Fn() -> usize, // Get address of the code section
+ pub get_data_start: &'a dyn Fn() -> usize, // Get address of the data section
}
pub enum EHAction {
ptr::null_mut()
}
-pub unsafe fn cleanup(ptr: *mut u8) -> Box<Any + Send> {
+pub unsafe fn cleanup(ptr: *mut u8) -> Box<dyn Any + Send> {
assert!(!ptr.is_null());
let ex = ptr::read(ptr as *mut _);
__cxa_free_exception(ptr as *mut _);
ex
}
-pub unsafe fn panic(data: Box<Any + Send>) -> u32 {
+pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
let sz = mem::size_of_val(&data);
let exception = __cxa_allocate_exception(sz);
if exception == ptr::null_mut() {
return uw::_URC_FATAL_PHASE1_ERROR as u32;
}
- let exception = exception as *mut Box<Any + Send>;
+ let exception = exception as *mut Box<dyn Any + Send>;
ptr::write(exception, data);
__cxa_throw(exception as *mut _, ptr::null_mut(), ptr::null_mut());
#[repr(C)]
struct Exception {
_uwe: uw::_Unwind_Exception,
- cause: Option<Box<Any + Send>>,
+ cause: Option<Box<dyn Any + Send>>,
}
-pub unsafe fn panic(data: Box<Any + Send>) -> u32 {
+pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
let exception = Box::new(Exception {
_uwe: uw::_Unwind_Exception {
exception_class: rust_exception_class(),
ptr::null_mut()
}
-pub unsafe fn cleanup(ptr: *mut u8) -> Box<Any + Send> {
+pub unsafe fn cleanup(ptr: *mut u8) -> Box<dyn Any + Send> {
let my_ep = ptr as *mut Exception;
let cause = (*my_ep).cause.take();
uw::_Unwind_DeleteException(ptr as *mut _);
//! More documentation about each implementation can be found in the respective
//! module.
+#![deny(bare_trait_objects)]
#![no_std]
#![unstable(feature = "panic_unwind", issue = "32837")]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
#[no_mangle]
#[unwind(allowed)]
pub unsafe extern "C" fn __rust_start_panic(payload: usize) -> u32 {
- let payload = payload as *mut &mut BoxMeUp;
+ let payload = payload as *mut &mut dyn BoxMeUp;
imp::panic(Box::from_raw((*payload).box_me_up()))
}
//! throwing. Note that throwing an exception into Rust is undefined behavior
//! anyway, so this should be fine.
//! * We've got some data to transmit across the unwinding boundary,
-//! specifically a `Box<Any + Send>`. Like with Dwarf exceptions
+//! specifically a `Box<dyn Any + Send>`. Like with Dwarf exceptions
//! these two pointers are stored as a payload in the exception itself. On
//! MSVC, however, there's no need for an extra heap allocation because the
//! call stack is preserved while filter functions are being executed. This
name: imp::NAME2,
};
-pub unsafe fn panic(data: Box<Any + Send>) -> u32 {
+pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
use core::intrinsics::atomic_store;
// _CxxThrowException executes entirely on this stack frame, so there's no
[0; 2]
}
-pub unsafe fn cleanup(payload: [u64; 2]) -> Box<Any + Send> {
+pub unsafe fn cleanup(payload: [u64; 2]) -> Box<dyn Any + Send> {
mem::transmute(raw::TraitObject {
data: payload[0] as *mut _,
vtable: payload[1] as *mut _,
#[repr(C)]
struct PanicData {
- data: Box<Any + Send>,
+ data: Box<dyn Any + Send>,
}
-pub unsafe fn panic(data: Box<Any + Send>) -> u32 {
+pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
let panic_ctx = Box::new(PanicData { data: data });
let params = [Box::into_raw(panic_ctx) as c::ULONG_PTR];
c::RaiseException(RUST_PANIC,
ptr::null_mut()
}
-pub unsafe fn cleanup(ptr: *mut u8) -> Box<Any + Send> {
+pub unsafe fn cleanup(ptr: *mut u8) -> Box<dyn Any + Send> {
let panic_ctx = Box::from_raw(ptr as *mut PanicData);
return panic_ctx.data;
}
0 as *mut u8
}
-pub unsafe fn cleanup(_ptr: *mut u8) -> Box<Any + Send> {
+pub unsafe fn cleanup(_ptr: *mut u8) -> Box<dyn Any + Send> {
intrinsics::abort()
}
-pub unsafe fn panic(_data: Box<Any + Send>) -> u32 {
+pub unsafe fn panic(_data: Box<dyn Any + Send>) -> u32 {
intrinsics::abort()
}
use syntax::parse::token::{self, Token};
use syntax::tokenstream;
use syntax_pos::{BytePos, Loc, DUMMY_SP};
- use syntax_pos::hygiene::{Mark, SyntaxContext, Transparency};
+ use syntax_pos::hygiene::{SyntaxContext, Transparency};
use super::{TokenStream, LexError, Span};
// No way to determine def location for a proc macro right now, so use call location.
let location = cx.current_expansion.mark.expn_info().unwrap().call_site;
- // Opaque mark was already created by expansion, now create its transparent twin.
- // We can't use the call-site span literally here, even if it appears to provide
- // correct name resolution, because it has all the `ExpnInfo` wrong, so the edition
- // checks, lint macro checks, macro backtraces will all break.
- let opaque_mark = cx.current_expansion.mark;
- let transparent_mark = Mark::fresh_cloned(opaque_mark);
- transparent_mark.set_transparency(Transparency::Transparent);
-
- let to_span = |mark| Span(location.with_ctxt(SyntaxContext::empty().apply_mark(mark)));
+ let to_span = |transparency| Span(location.with_ctxt(
+ SyntaxContext::empty().apply_mark_with_transparency(cx.current_expansion.mark,
+ transparency))
+ );
p.set(ProcMacroSess {
parse_sess: cx.parse_sess,
data: ProcMacroData {
- def_site: to_span(opaque_mark),
- call_site: to_span(transparent_mark),
+ def_site: to_span(Transparency::Opaque),
+ call_site: to_span(Transparency::Transparent),
},
});
f()
[] InstanceDefSizeEstimate { instance_def: InstanceDef<'tcx> },
- [] WasmCustomSections(CrateNum),
-
[input] Features,
[] ProgramClausesFor(DefId),
E0707, // multiple elided lifetimes used in arguments of `async fn`
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
}
impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
/// Check any attribute.
fn check_attributes(&self, item: &hir::Item, target: Target) {
- if target == Target::Fn {
+ if target == Target::Fn || target == Target::Const {
self.tcx.codegen_fn_attrs(self.tcx.hir.local_def_id(item.id));
} else if let Some(a) = item.attrs.iter().find(|a| a.check_name("target_feature")) {
self.tcx.sess.struct_span_err(a.span, "attribute should be applied to a function")
if target != Target::Const {
self.tcx.sess.span_err(attr.span, "only allowed on consts");
}
-
- if attr.value_str().is_none() {
- self.tcx.sess.span_err(attr.span, "must be of the form \
- #[wasm_custom_section = \"foo\"]");
- }
}
}
MacroNS,
}
+impl Namespace {
+ pub fn descr(self) -> &'static str {
+ match self {
+ TypeNS => "type",
+ ValueNS => "value",
+ MacroNS => "macro",
+ }
+ }
+}
+
/// Just a helper ‒ separate structure for each namespace.
#[derive(Copy, Clone, Default, Debug)]
pub struct PerNS<T> {
// Use to assign ids to hir nodes that do not directly correspond to an ast node
sess: &'a Session,
- cstore: &'a CrateStore,
+ cstore: &'a dyn CrateStore,
- resolver: &'a mut Resolver,
+ resolver: &'a mut dyn Resolver,
/// The items being lowered are collected here.
items: BTreeMap<NodeId, hir::Item>,
pub fn lower_crate(
sess: &Session,
- cstore: &CrateStore,
+ cstore: &dyn CrateStore,
dep_graph: &DepGraph,
krate: &Crate,
- resolver: &mut Resolver,
+ resolver: &mut dyn Resolver,
) -> hir::Crate {
// We're constructing the HIR here; we don't care what we will
// read, since we haven't even constructed the *input* to
/// The definition table containing node definitions.
/// It holds the DefPathTable for local DefIds/DefPaths and it also stores a
/// mapping from NodeIds to local DefIds.
+#[derive(Clone)]
pub struct Definitions {
table: DefPathTable,
node_to_def_index: NodeMap<DefIndex>,
/// If `Mark` is an ID of some macro expansion,
/// then `DefId` is the normal module (`mod`) in which the expanded macro was defined.
parent_modules_of_macro_defs: FxHashMap<Mark, DefId>,
- /// Item with a given `DefIndex` was defined during opaque macro expansion with ID `Mark`.
- /// It can actually be defined during transparent macro expansions inside that opaque expansion,
- /// but transparent expansions are ignored here.
- opaque_expansions_that_defined: FxHashMap<DefIndex, Mark>,
+ /// Item with a given `DefIndex` was defined during macro expansion with ID `Mark`.
+ expansions_that_defined: FxHashMap<DefIndex, Mark>,
next_disambiguator: FxHashMap<(DefIndex, DefPathData), u32>,
def_index_to_span: FxHashMap<DefIndex, Span>,
}
-// Unfortunately we have to provide a manual impl of Clone because of the
-// fixed-sized array field.
-impl Clone for Definitions {
- fn clone(&self) -> Self {
- Definitions {
- table: self.table.clone(),
- node_to_def_index: self.node_to_def_index.clone(),
- def_index_to_node: [
- self.def_index_to_node[0].clone(),
- self.def_index_to_node[1].clone(),
- ],
- node_to_hir_id: self.node_to_hir_id.clone(),
- parent_modules_of_macro_defs: self.parent_modules_of_macro_defs.clone(),
- opaque_expansions_that_defined: self.opaque_expansions_that_defined.clone(),
- next_disambiguator: self.next_disambiguator.clone(),
- def_index_to_span: self.def_index_to_span.clone(),
- }
- }
-}
-
/// A unique identifier that we can use to lookup a definition
/// precisely. It combines the index of the definition's parent (if
/// any) with a `DisambiguatedDefPathData`.
def_index_to_node: [vec![], vec![]],
node_to_hir_id: IndexVec::new(),
parent_modules_of_macro_defs: FxHashMap(),
- opaque_expansions_that_defined: FxHashMap(),
+ expansions_that_defined: FxHashMap(),
next_disambiguator: FxHashMap(),
def_index_to_span: FxHashMap(),
}
self.node_to_def_index.insert(node_id, index);
}
- let expansion = expansion.modern();
if expansion != Mark::root() {
- self.opaque_expansions_that_defined.insert(index, expansion);
+ self.expansions_that_defined.insert(index, expansion);
}
// The span is added if it isn't dummy
self.node_to_hir_id = mapping;
}
- pub fn opaque_expansion_that_defined(&self, index: DefIndex) -> Mark {
- self.opaque_expansions_that_defined.get(&index).cloned().unwrap_or(Mark::root())
+ pub fn expansion_that_defined(&self, index: DefIndex) -> Mark {
+ self.expansions_that_defined.get(&index).cloned().unwrap_or(Mark::root())
}
pub fn parent_module_of_macro_def(&self, mark: Mark) -> DefId {
Type(Ty),
}
+impl GenericArg {
+ pub fn span(&self) -> Span {
+ match self {
+ GenericArg::Lifetime(l) => l.span,
+ GenericArg::Type(t) => t.span,
+ }
+ }
+}
+
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub struct GenericArgs {
/// The generic arguments for this path segment.
pub export_name: Option<Symbol>,
pub target_features: Vec<Symbol>,
pub linkage: Option<Linkage>,
+ pub wasm_custom_section: Option<Symbol>,
}
bitflags! {
export_name: None,
target_features: vec![],
linkage: None,
+ wasm_custom_section: None,
}
}
export_name,
target_features,
linkage,
+ wasm_custom_section,
});
impl<'hir> HashStable<StableHashingContext<'hir>> for hir::CodegenFnAttrFlags
internal,
is_user_variable
});
-impl_stable_hash_for!(struct mir::UpvarDecl { debug_name, by_ref, mutability });
+impl_stable_hash_for!(struct mir::UpvarDecl { debug_name, var_hir_id, by_ref, mutability });
impl_stable_hash_for!(struct mir::BasicBlockData<'tcx> { statements, terminator, is_cleanup });
-impl_stable_hash_for!(struct mir::UnsafetyViolation { source_info, description, kind });
+impl_stable_hash_for!(struct mir::UnsafetyViolation { source_info, description, details, kind });
impl_stable_hash_for!(struct mir::UnsafetyCheckResult { violations, unsafe_blocks });
impl<'a> HashStable<StableHashingContext<'a>>
RemainderByZero |
DivisionByZero |
GeneratorResumedAfterReturn |
- GeneratorResumedAfterPanic => {}
+ GeneratorResumedAfterPanic |
+ InfiniteLoop => {}
ReferencedConstant(ref err) => err.hash_stable(hcx, hasher),
MachineError(ref err) => err.hash_stable(hcx, hasher),
FunctionPointerTyMismatch(a, b) => {
fn print_help_message() {
println!("\
-Z print-region-graph by default prints a region constraint graph for every \n\
-function body, to the path `/tmp/constraints.nodeXXX.dot`, where the XXX is \n\
+function body, to the path `constraints.nodeXXX.dot`, where the XXX is \n\
replaced with the node id of the function under analysis. \n\
\n\
To select one particular function body, set `RUST_REGION_GRAPH_NODE=XXX`, \n\
where XXX is the node id desired. \n\
\n\
To generate output to some path other than the default \n\
-`/tmp/constraints.nodeXXX.dot`, set `RUST_REGION_GRAPH=/path/desired.dot`; \n\
+`constraints.nodeXXX.dot`, set `RUST_REGION_GRAPH=/path/desired.dot`; \n\
occurrences of the character `%` in the requested path will be replaced with\n\
the node id of the function under analysis. \n\
\n\
}
Ok(other_path) => other_path,
- Err(_) => "/tmp/constraints.node%.dot".to_string(),
+ Err(_) => "constraints.node%.dot".to_string(),
};
if output_template.is_empty() {
//!
//! This API is completely unstable and subject to change.
+#![deny(bare_trait_objects)]
+
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]
pub mod ppaux;
pub mod nodemap;
pub mod fs;
+ pub mod time_graph;
}
// A private module so that macro-expanded idents like
"checks the object safety of where clauses"
}
+declare_lint! {
+ pub PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
+ Warn,
+ "detects proc macro derives using inaccessible names from parent modules"
+}
+
/// Does nothing as a lint pass, but registers some `Lint`s
/// which are used by other parts of the compiler.
#[derive(Copy, Clone)]
DUPLICATE_MACRO_EXPORTS,
INTRA_DOC_LINK_RESOLUTION_FAILURE,
WHERE_CLAUSES_OBJECT_SAFETY,
+ PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
)
}
}
BareTraitObject(Span, /* is_global */ bool),
AbsPathWithModule(Span),
DuplicatedMacroExports(ast::Ident, Span, Span),
+ ProcMacroDeriveResolutionFallback(Span),
}
impl BuiltinLintDiagnostics {
db.span_label(later_span, format!("`{}` already exported", ident));
db.span_note(earlier_span, "previous macro export is now shadowed");
}
+ BuiltinLintDiagnostics::ProcMacroDeriveResolutionFallback(span) => {
+ db.span_label(span, "names from parent modules are not \
+ accessible without an explicit import");
+ }
}
}
}
use syntax::ast;
use syntax::attr;
use syntax::codemap::MultiSpan;
+use syntax::feature_gate;
use syntax::symbol::Symbol;
use util::nodemap::FxHashMap;
// Ensure that we never exceed the `--cap-lints` argument.
level = cmp::min(level, self.lint_cap);
+ if let Some(driver_level) = sess.driver_lint_caps.get(&LintId::of(lint)) {
+ // Ensure that we never exceed driver level.
+ level = cmp::min(*driver_level, level);
+ }
+
return (level, src)
}
continue
}
};
+ if let Some(lint_tool) = word.is_scoped() {
+ if !self.sess.features_untracked().tool_lints {
+ feature_gate::emit_feature_err(&sess.parse_sess,
+ "tool_lints",
+ word.span,
+ feature_gate::GateIssue::Language,
+ &format!("scoped lint `{}` is experimental",
+ word.ident));
+ }
+
+ if !attr::is_known_lint_tool(lint_tool) {
+ span_err!(
+ sess,
+ lint_tool.span,
+ E0710,
+ "an unknown tool name found in scoped lint: `{}`",
+ word.ident
+ );
+ }
+
+ continue
+ }
let name = word.name();
match store.check_lint_name(&name.as_str()) {
CheckLintNameResult::Ok(ids) => {
fn metadata_encoding_version(&self) -> &[u8];
}
-pub type CrateStoreDyn = CrateStore + sync::Sync;
+pub type CrateStoreDyn = dyn CrateStore + sync::Sync;
// FIXME: find a better place for this?
pub fn validate_crate_name(sess: Option<&Session>, s: &str, sp: Option<Span>) {
fn has_allow_dead_code_or_lang_attr(tcx: TyCtxt,
id: ast::NodeId,
attrs: &[ast::Attribute]) -> bool {
- if attr::contains_name(attrs, "lang") || attr::contains_name(attrs, "panic_implementation") {
+ if attr::contains_name(attrs, "lang") {
+ return true;
+ }
+
+ // (To be) stable attribute for #[lang = "panic_impl"]
+ if attr::contains_name(attrs, "panic_implementation") {
+ return true;
+ }
+
+ // (To be) stable attribute for #[lang = "oom"]
+ if attr::contains_name(attrs, "alloc_error_handler") {
return true;
}
}
} else if attribute.check_name("panic_implementation") {
return Some((Symbol::intern("panic_impl"), attribute.span))
+ } else if attribute.check_name("alloc_error_handler") {
+ return Some((Symbol::intern("oom"), attribute.span))
}
}
BoxFreeFnLangItem, "box_free", box_free_fn;
DropInPlaceFnLangItem, "drop_in_place", drop_in_place_fn;
OomLangItem, "oom", oom;
+ AllocLayoutLangItem, "alloc_layout", alloc_layout;
StartFnLangItem, "start", start_fn;
ref ty => span_bug!(pat.span, "tuple pattern unexpected type {:?}", ty),
};
for (i, subpat) in subpats.iter().enumerate_and_adjust(expected_len, ddpos) {
- let subpat_ty = self.pat_ty_unadjusted(&subpat)?; // see (*2)
+ let subpat_ty = self.pat_ty_adjusted(&subpat)?; // see (*2)
let interior = InteriorField(FieldIndex(i, Name::intern(&i.to_string())));
let subcmt = Rc::new(self.cat_imm_interior(pat, cmt.clone(), subpat_ty, interior));
self.cat_pattern_(subcmt, &subpat, op)?;
if lang_items::$item == lang_items::PanicImplLangItem {
tcx.sess.err(&format!("`#[panic_implementation]` function required, \
but not found"));
+ } else if lang_items::$item == lang_items::OomLangItem {
+ tcx.sess.err(&format!("`#[alloc_error_handler]` function required, \
+ but not found"));
} else {
tcx.sess.err(&format!("language item required, but not found: `{}`",
stringify!($name)));
ReferencedConstant(Lrc<ConstEvalErr<'tcx>>),
GeneratorResumedAfterReturn,
GeneratorResumedAfterPanic,
+ InfiniteLoop,
}
pub type EvalResult<'tcx, T = ()> = Result<T, EvalError<'tcx>>;
RemainderByZero => "attempt to calculate the remainder with a divisor of zero",
GeneratorResumedAfterReturn => "generator resumed after completion",
GeneratorResumedAfterPanic => "generator resumed after panicking",
+ InfiniteLoop =>
+ "duplicate interpreter state observed here, const evaluation will never terminate",
}
}
}
use std::sync::atomic::{AtomicU32, Ordering};
use std::num::NonZeroU32;
-#[derive(Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)]
+#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
pub enum Lock {
NoLock,
WriteLock(DynamicLifetime),
use super::{EvalResult, Pointer, PointerArithmetic, Allocation};
-/// Represents a constant value in Rust. ByVal and ScalarPair are optimizations which
+/// Represents a constant value in Rust. Scalar and ScalarPair are optimizations which
/// matches Value's optimizations for easy conversions between these two types
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, RustcEncodable, RustcDecodable, Hash)]
pub enum ConstValue<'tcx> {
/// A `Value` represents a single self-contained Rust value.
///
/// A `Value` can either refer to a block of memory inside an allocation (`ByRef`) or to a primitve
-/// value held directly, outside of any allocation (`ByVal`). For `ByRef`-values, we remember
+/// value held directly, outside of any allocation (`Scalar`). For `ByRef`-values, we remember
/// whether the pointer is supposed to be aligned or not (also see Place).
///
/// For optimization of a few very common cases, there is also a representation for a pair of
use graphviz::IntoCow;
use hir::def::CtorKind;
use hir::def_id::DefId;
-use hir::{self, InlineAsm};
+use hir::{self, HirId, InlineAsm};
use middle::region;
use mir::interpret::{EvalErrorKind, Scalar, Value};
use mir::visit::MirVisitable;
Set(T),
}
+impl<T> ClearCrossCrate<T> {
+ pub fn assert_crate_local(self) -> T {
+ match self {
+ ClearCrossCrate::Clear => bug!("unwrapping cross-crate data"),
+ ClearCrossCrate::Set(v) => v,
+ }
+ }
+}
+
impl<T: serialize::Encodable> serialize::UseSpecializedEncodable for ClearCrossCrate<T> {}
impl<T: serialize::Decodable> serialize::UseSpecializedDecodable for ClearCrossCrate<T> {}
pub struct UpvarDecl {
pub debug_name: Name,
+ /// `HirId` of the captured variable
+ pub var_hir_id: ClearCrossCrate<HirId>,
+
/// If true, the capture is behind a reference.
pub by_ref: bool,
}
// This is generic so that it can be reused by miri
-#[derive(Clone, RustcEncodable, RustcDecodable)]
+#[derive(Clone, Hash, PartialEq, Eq, RustcEncodable, RustcDecodable)]
pub struct ValidationOperand<'tcx, T> {
pub place: T,
pub ty: Ty<'tcx>,
pub struct UnsafetyViolation {
pub source_info: SourceInfo,
pub description: InternedString,
+ pub details: InternedString,
pub kind: UnsafetyViolationKind,
}
Fn(Instance<'tcx>),
Static(DefId),
GlobalAsm(NodeId),
+ CustomSection(DefId),
}
impl<'tcx> MonoItem<'tcx> {
},
// Conservatively estimate the size of a static declaration
// or assembly to be 1.
- MonoItem::Static(_) | MonoItem::GlobalAsm(_) => 1,
+ MonoItem::Static(_) |
+ MonoItem::GlobalAsm(_) |
+ MonoItem::CustomSection(_) => 1,
}
}
}
MonoItem::Fn(ref instance) => {
instance.hash_stable(hcx, hasher);
}
- MonoItem::Static(def_id) => {
+ MonoItem::Static(def_id) |
+ MonoItem::CustomSection(def_id) => {
def_id.hash_stable(hcx, hasher);
}
MonoItem::GlobalAsm(node_id) => {
#[derive(Clone, PartialEq, Hash)]
pub enum CrossLangLto {
LinkerPlugin(PathBuf),
- NoLink,
+ LinkerPluginAuto,
Disabled
}
impl CrossLangLto {
- pub fn embed_bitcode(&self) -> bool {
+ pub fn enabled(&self) -> bool {
match *self {
CrossLangLto::LinkerPlugin(_) |
- CrossLangLto::NoLink => true,
+ CrossLangLto::LinkerPluginAuto => true,
CrossLangLto::Disabled => false,
}
}
let mut bool_arg = None;
if parse_opt_bool(&mut bool_arg, v) {
*slot = if bool_arg.unwrap() {
- CrossLangLto::NoLink
+ CrossLangLto::LinkerPluginAuto
} else {
CrossLangLto::Disabled
};
}
*slot = match v {
- None |
- Some("no-link") => CrossLangLto::NoLink,
+ None => CrossLangLto::LinkerPluginAuto,
Some(path) => CrossLangLto::LinkerPlugin(PathBuf::from(path)),
};
true
"gather codegen statistics"),
asm_comments: bool = (false, parse_bool, [TRACKED],
"generate comments into the assembly (may change behavior)"),
- no_verify: bool = (false, parse_bool, [TRACKED],
- "skip LLVM verification"),
+ verify_llvm_ir: bool = (false, parse_bool, [TRACKED],
+ "verify LLVM IR"),
borrowck_stats: bool = (false, parse_bool, [UNTRACKED],
"gather borrowck statistics"),
no_landing_pads: bool = (false, parse_bool, [TRACKED],
let vendor = &sess.target.target.target_vendor;
let min_atomic_width = sess.target.target.min_atomic_width();
let max_atomic_width = sess.target.target.max_atomic_width();
+ let atomic_cas = sess.target.target.options.atomic_cas;
let mut ret = HashSet::new();
// Target bindings.
}
}
}
+ if atomic_cas {
+ ret.insert((Symbol::intern("target_has_atomic"), Some(Symbol::intern("cas"))));
+ }
if sess.opts.debug_assertions {
ret.insert((Symbol::intern("debug_assertions"), None));
}
.collect::<ast::CrateConfig>()
}
+pub fn get_cmd_lint_options(matches: &getopts::Matches,
+ error_format: ErrorOutputType)
+ -> (Vec<(String, lint::Level)>, bool, Option<lint::Level>) {
+ let mut lint_opts = vec![];
+ let mut describe_lints = false;
+
+ for &level in &[lint::Allow, lint::Warn, lint::Deny, lint::Forbid] {
+ for lint_name in matches.opt_strs(level.as_str()) {
+ if lint_name == "help" {
+ describe_lints = true;
+ } else {
+ lint_opts.push((lint_name.replace("-", "_"), level));
+ }
+ }
+ }
+
+ let lint_cap = matches.opt_str("cap-lints").map(|cap| {
+ lint::Level::from_str(&cap)
+ .unwrap_or_else(|| early_error(error_format, &format!("unknown lint level: `{}`", cap)))
+ });
+ (lint_opts, describe_lints, lint_cap)
+}
+
pub fn build_session_options_and_crate_config(
matches: &getopts::Matches,
) -> (Options, ast::CrateConfig) {
early_error(
ErrorOutputType::default(),
&format!(
- "Edition {} is unstable an only\
+ "Edition {} is unstable and only \
available for nightly builds of rustc.",
edition,
)
let crate_types = parse_crate_types_from_list(unparsed_crate_types)
.unwrap_or_else(|e| early_error(error_format, &e[..]));
- let mut lint_opts = vec![];
- let mut describe_lints = false;
-
- for &level in &[lint::Allow, lint::Warn, lint::Deny, lint::Forbid] {
- for lint_name in matches.opt_strs(level.as_str()) {
- if lint_name == "help" {
- describe_lints = true;
- } else {
- lint_opts.push((lint_name.replace("-", "_"), level));
- }
- }
- }
-
- let lint_cap = matches.opt_str("cap-lints").map(|cap| {
- lint::Level::from_str(&cap)
- .unwrap_or_else(|| early_error(error_format, &format!("unknown lint level: `{}`", cap)))
- });
+ let (lint_opts, describe_lints, lint_cap) = get_cmd_lint_options(matches, error_format);
let mut debugging_opts = build_debugging_options(matches, error_format);
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
opts = reference.clone();
- opts.debugging_opts.no_verify = true;
+ opts.debugging_opts.verify_llvm_ir = true;
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
opts = reference.clone();
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
opts = reference.clone();
- opts.debugging_opts.cross_lang_lto = CrossLangLto::NoLink;
+ opts.debugging_opts.cross_lang_lto = CrossLangLto::LinkerPluginAuto;
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
}
use session::search_paths::PathKind;
use session::config::{OutputType};
use ty::tls;
-use util::nodemap::{FxHashSet};
+use util::nodemap::{FxHashMap, FxHashSet};
use util::common::{duration_to_secs_str, ErrorReported};
use util::common::ProfileQueriesMsg;
/// Metadata about the allocators for the current crate being compiled
pub has_global_allocator: Once<bool>,
+
+ /// Cap lint level specified by a driver specifically.
+ pub driver_lint_caps: FxHashMap<lint::LintId, lint::Level>,
}
pub struct PerfStats {
pub fn asm_comments(&self) -> bool {
self.opts.debugging_opts.asm_comments
}
- pub fn no_verify(&self) -> bool {
- self.opts.debugging_opts.no_verify
+ pub fn verify_llvm_ir(&self) -> bool {
+ self.opts.debugging_opts.verify_llvm_ir
}
pub fn borrowck_stats(&self) -> bool {
self.opts.debugging_opts.borrowck_stats
(*GLOBAL_JOBSERVER).clone()
},
has_global_allocator: Once::new(),
+ driver_lint_caps: FxHashMap(),
};
sess
}
}
- /// Attempts to select obligations using `selcx`. If `only_new_obligations` is true, then it
- /// only attempts to select obligations that haven't been seen before.
+ /// Attempts to select obligations using `selcx`.
fn select(&mut self, selcx: &mut SelectionContext<'a, 'gcx, 'tcx>)
-> Result<(),Vec<FulfillmentError<'tcx>>> {
debug!("select(obligation-forest-size={})", self.predicates.len());
!self.sess.opts.debugging_opts.disable_ast_check_for_mutation_in_guard
}
+ /// If true, we should use the AST-based borrowck (we may *also* use
+ /// the MIR-based borrowck).
+ pub fn use_ast_borrowck(self) -> bool {
+ self.borrowck_mode().use_ast()
+ }
+
/// If true, we should use the MIR-based borrowck (we may *also* use
/// the AST-based borrowck).
pub fn use_mir_borrowck(self) -> bool {
value.fold_with(&mut RegionFolder::new(self, skipped_regions, &mut f))
}
- pub fn for_each_free_region<T,F>(self,
- value: &T,
- callback: F)
- where F: FnMut(ty::Region<'tcx>),
- T: TypeFoldable<'tcx>,
- {
- value.visit_with(&mut RegionVisitor {
+ /// Invoke `callback` on every region appearing free in `value`.
+ pub fn for_each_free_region(
+ self,
+ value: &impl TypeFoldable<'tcx>,
+ mut callback: impl FnMut(ty::Region<'tcx>),
+ ) {
+ self.any_free_region_meets(value, |r| {
+ callback(r);
+ false
+ });
+ }
+
+ /// True if `callback` returns true for every region appearing free in `value`.
+ pub fn all_free_regions_meet(
+ self,
+ value: &impl TypeFoldable<'tcx>,
+ mut callback: impl FnMut(ty::Region<'tcx>) -> bool,
+ ) -> bool {
+ !self.any_free_region_meets(value, |r| !callback(r))
+ }
+
+ /// True if `callback` returns true for some region appearing free in `value`.
+ pub fn any_free_region_meets(
+ self,
+ value: &impl TypeFoldable<'tcx>,
+ callback: impl FnMut(ty::Region<'tcx>) -> bool,
+ ) -> bool {
+ return value.visit_with(&mut RegionVisitor {
outer_index: ty::INNERMOST,
callback
});
}
impl<'tcx, F> TypeVisitor<'tcx> for RegionVisitor<F>
- where F : FnMut(ty::Region<'tcx>)
+ where F: FnMut(ty::Region<'tcx>) -> bool
{
fn visit_binder<T: TypeFoldable<'tcx>>(&mut self, t: &Binder<T>) -> bool {
self.outer_index.shift_in(1);
- t.skip_binder().visit_with(self);
+ let result = t.skip_binder().visit_with(self);
self.outer_index.shift_out(1);
-
- false // keep visiting
+ result
}
fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool {
match *r {
ty::ReLateBound(debruijn, _) if debruijn < self.outer_index => {
- /* ignore bound regions */
+ false // ignore bound regions, keep visiting
}
_ => (self.callback)(r),
}
+ }
- false // keep visiting
+ fn visit_ty(&mut self, ty: Ty<'tcx>) -> bool {
+ // We're only interested in types involving regions
+ if ty.flags.intersects(TypeFlags::HAS_FREE_REGIONS) {
+ ty.super_visit_with(self)
+ } else {
+ false // keep visiting
+ }
}
}
}
let mut abi = Abi::Aggregate { sized: true };
if tag.value.size(dl) == size {
abi = Abi::Scalar(tag.clone());
- } else if !tag.is_bool() {
- // HACK(nox): Blindly using ScalarPair for all tagged enums
- // where applicable leads to Option<u8> being handled as {i1, i8},
- // which later confuses SROA and some loop optimisations,
- // ultimately leading to the repeat-trusted-len test
- // failing. We make the trade-off of using ScalarPair only
- // for types where the tag isn't a boolean.
+ } else {
+ // Try to use a ScalarPair for all tagged enums.
let mut common_prim = None;
for (field_layouts, layout_variant) in variants.iter().zip(&layout_variants) {
let offsets = match layout_variant.fields {
pub fn adjust_ident(self, mut ident: Ident, scope: DefId, block: NodeId) -> (Ident, DefId) {
ident = ident.modern();
let target_expansion = match scope.krate {
- LOCAL_CRATE => self.hir.definitions().opaque_expansion_that_defined(scope.index),
+ LOCAL_CRATE => self.hir.definitions().expansion_that_defined(scope.index),
_ => Mark::root(),
};
let scope = match ident.span.adjust(target_expansion) {
}
}
-impl<'tcx> QueryDescription<'tcx> for queries::wasm_custom_sections<'tcx> {
- fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
- format!("custom wasm sections for a crate")
- }
-}
-
impl<'tcx> QueryDescription<'tcx> for queries::generics_of<'tcx> {
#[inline]
fn cache_on_disk(def_id: Self::Key) -> bool {
ty::ParamEnv<'tcx>
) -> Clauses<'tcx>,
- [] fn wasm_custom_sections: WasmCustomSections(CrateNum) -> Lrc<Vec<DefId>>,
[] fn wasm_import_module_map: WasmImportModuleMap(CrateNum)
-> Lrc<FxHashMap<DefId, String>>,
}
DepKind::Features => { force!(features_query, LOCAL_CRATE); }
DepKind::ProgramClausesFor => { force!(program_clauses_for, def_id!()); }
- DepKind::WasmCustomSections => { force!(wasm_custom_sections, krate!()); }
DepKind::WasmImportModuleMap => { force!(wasm_import_module_map, krate!()); }
DepKind::ForeignModules => { force!(foreign_modules, krate!()); }
RemainderByZero => RemainderByZero,
GeneratorResumedAfterReturn => GeneratorResumedAfterReturn,
GeneratorResumedAfterPanic => GeneratorResumedAfterPanic,
+ InfiniteLoop => InfiniteLoop,
})
}
}
--- /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.
+
+use std::collections::HashMap;
+use std::fs::File;
+use std::io::prelude::*;
+use std::marker::PhantomData;
+use std::mem;
+use std::sync::{Arc, Mutex};
+use std::time::Instant;
+
+const OUTPUT_WIDTH_IN_PX: u64 = 1000;
+const TIME_LINE_HEIGHT_IN_PX: u64 = 20;
+const TIME_LINE_HEIGHT_STRIDE_IN_PX: usize = 30;
+
+#[derive(Clone)]
+struct Timing {
+ start: Instant,
+ end: Instant,
+ work_package_kind: WorkPackageKind,
+ name: String,
+ events: Vec<(String, Instant)>,
+}
+
+#[derive(Clone, Copy, Hash, Eq, PartialEq, Debug)]
+pub struct TimelineId(pub usize);
+
+#[derive(Clone)]
+struct PerThread {
+ timings: Vec<Timing>,
+ open_work_package: Option<(Instant, WorkPackageKind, String)>,
+}
+
+#[derive(Clone)]
+pub struct TimeGraph {
+ data: Arc<Mutex<HashMap<TimelineId, PerThread>>>,
+}
+
+#[derive(Clone, Copy)]
+pub struct WorkPackageKind(pub &'static [&'static str]);
+
+pub struct Timeline {
+ token: Option<RaiiToken>,
+}
+
+struct RaiiToken {
+ graph: TimeGraph,
+ timeline: TimelineId,
+ events: Vec<(String, Instant)>,
+ // The token must not be Send:
+ _marker: PhantomData<*const ()>
+}
+
+
+impl Drop for RaiiToken {
+ fn drop(&mut self) {
+ self.graph.end(self.timeline, mem::replace(&mut self.events, Vec::new()));
+ }
+}
+
+impl TimeGraph {
+ pub fn new() -> TimeGraph {
+ TimeGraph {
+ data: Arc::new(Mutex::new(HashMap::new()))
+ }
+ }
+
+ pub fn start(&self,
+ timeline: TimelineId,
+ work_package_kind: WorkPackageKind,
+ name: &str) -> Timeline {
+ {
+ let mut table = self.data.lock().unwrap();
+
+ let data = table.entry(timeline).or_insert(PerThread {
+ timings: Vec::new(),
+ open_work_package: None,
+ });
+
+ assert!(data.open_work_package.is_none());
+ data.open_work_package = Some((Instant::now(), work_package_kind, name.to_string()));
+ }
+
+ Timeline {
+ token: Some(RaiiToken {
+ graph: self.clone(),
+ timeline,
+ events: Vec::new(),
+ _marker: PhantomData,
+ }),
+ }
+ }
+
+ fn end(&self, timeline: TimelineId, events: Vec<(String, Instant)>) {
+ let end = Instant::now();
+
+ let mut table = self.data.lock().unwrap();
+ let data = table.get_mut(&timeline).unwrap();
+
+ if let Some((start, work_package_kind, name)) = data.open_work_package.take() {
+ data.timings.push(Timing {
+ start,
+ end,
+ work_package_kind,
+ name,
+ events,
+ });
+ } else {
+ bug!("end timing without start?")
+ }
+ }
+
+ pub fn dump(&self, output_filename: &str) {
+ let table = self.data.lock().unwrap();
+
+ for data in table.values() {
+ assert!(data.open_work_package.is_none());
+ }
+
+ let mut threads: Vec<PerThread> =
+ table.values().map(|data| data.clone()).collect();
+
+ threads.sort_by_key(|timeline| timeline.timings[0].start);
+
+ let earliest_instant = threads[0].timings[0].start;
+ let latest_instant = threads.iter()
+ .map(|timeline| timeline.timings
+ .last()
+ .unwrap()
+ .end)
+ .max()
+ .unwrap();
+ let max_distance = distance(earliest_instant, latest_instant);
+
+ let mut file = File::create(format!("{}.html", output_filename)).unwrap();
+
+ writeln!(file, "
+ <html>
+ <head>
+ <style>
+ #threads a {{
+ position: absolute;
+ overflow: hidden;
+ }}
+ #threads {{
+ height: {total_height}px;
+ width: {width}px;
+ }}
+
+ .timeline {{
+ display: none;
+ width: {width}px;
+ position: relative;
+ }}
+
+ .timeline:target {{
+ display: block;
+ }}
+
+ .event {{
+ position: absolute;
+ }}
+ </style>
+ </head>
+ <body>
+ <div id='threads'>
+ ",
+ total_height = threads.len() * TIME_LINE_HEIGHT_STRIDE_IN_PX,
+ width = OUTPUT_WIDTH_IN_PX,
+ ).unwrap();
+
+ let mut color = 0;
+ for (line_index, thread) in threads.iter().enumerate() {
+ let line_top = line_index * TIME_LINE_HEIGHT_STRIDE_IN_PX;
+
+ for span in &thread.timings {
+ let start = distance(earliest_instant, span.start);
+ let end = distance(earliest_instant, span.end);
+
+ let start = normalize(start, max_distance, OUTPUT_WIDTH_IN_PX);
+ let end = normalize(end, max_distance, OUTPUT_WIDTH_IN_PX);
+
+ let colors = span.work_package_kind.0;
+
+ writeln!(file, "<a href='#timing{}'
+ style='top:{}px; \
+ left:{}px; \
+ width:{}px; \
+ height:{}px; \
+ background:{};'>{}</a>",
+ color,
+ line_top,
+ start,
+ end - start,
+ TIME_LINE_HEIGHT_IN_PX,
+ colors[color % colors.len()],
+ span.name,
+ ).unwrap();
+
+ color += 1;
+ }
+ }
+
+ writeln!(file, "
+ </div>
+ ").unwrap();
+
+ let mut idx = 0;
+ for thread in threads.iter() {
+ for timing in &thread.timings {
+ let colors = timing.work_package_kind.0;
+ let height = TIME_LINE_HEIGHT_STRIDE_IN_PX * timing.events.len();
+ writeln!(file, "<div class='timeline'
+ id='timing{}'
+ style='background:{};height:{}px;'>",
+ idx,
+ colors[idx % colors.len()],
+ height).unwrap();
+ idx += 1;
+ let max = distance(timing.start, timing.end);
+ for (i, &(ref event, time)) in timing.events.iter().enumerate() {
+ let i = i as u64;
+ let time = distance(timing.start, time);
+ let at = normalize(time, max, OUTPUT_WIDTH_IN_PX);
+ writeln!(file, "<span class='event'
+ style='left:{}px;\
+ top:{}px;'>{}</span>",
+ at,
+ TIME_LINE_HEIGHT_IN_PX * i,
+ event).unwrap();
+ }
+ writeln!(file, "</div>").unwrap();
+ }
+ }
+
+ writeln!(file, "
+ </body>
+ </html>
+ ").unwrap();
+ }
+}
+
+impl Timeline {
+ pub fn noop() -> Timeline {
+ Timeline { token: None }
+ }
+
+ /// Record an event which happened at this moment on this timeline.
+ ///
+ /// Events are displayed in the eventual HTML output where you can click on
+ /// a particular timeline and it'll expand to all of the events that
+ /// happened on that timeline. This can then be used to drill into a
+ /// particular timeline and see what events are happening and taking the
+ /// most time.
+ pub fn record(&mut self, name: &str) {
+ if let Some(ref mut token) = self.token {
+ token.events.push((name.to_string(), Instant::now()));
+ }
+ }
+}
+
+fn distance(zero: Instant, x: Instant) -> u64 {
+
+ let duration = x.duration_since(zero);
+ (duration.as_secs() * 1_000_000_000 + duration.subsec_nanos() as u64) // / div
+}
+
+fn normalize(distance: u64, max: u64, max_pixels: u64) -> u64 {
+ (max_pixels * distance) / max
+}
+
pub fn modify(
sess: &ParseSess,
- resolver: &mut Resolver,
+ resolver: &mut dyn Resolver,
krate: Crate,
crate_name: String,
handler: &rustc_errors::Handler,
found: bool,
handler: &'a rustc_errors::Handler,
sess: &'a ParseSess,
- resolver: &'a mut Resolver,
+ resolver: &'a mut dyn Resolver,
crate_name: Option<String>,
// For now, we disallow `global_allocator` in submodules because hygiene is hard. Keep track of
&self,
ty: &AllocatorTy,
args: &mut Vec<Arg>,
- ident: &mut FnMut() -> Ident,
+ ident: &mut dyn FnMut() -> Ident,
) -> P<Expr> {
match *ty {
AllocatorTy::Layout => {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![deny(bare_trait_objects)]
#![feature(rustc_private)]
#[macro_use] extern crate log;
fn borrowck<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, owner_def_id: DefId)
-> Lrc<BorrowCheckResult>
{
+ assert!(tcx.use_ast_borrowck());
+
debug!("borrowck(body_owner_def_id={:?})", owner_def_id);
let owner_id = tcx.hir.as_local_node_id(owner_def_id).unwrap();
let node_id = scope.node_id(self.tcx, &self.region_scope_tree);
match self.tcx.hir.find(node_id) {
Some(hir_map::NodeStmt(_)) => {
- db.note("consider using a `let` binding to increase its lifetime");
+ if *sub_scope != ty::ReStatic {
+ db.note("consider using a `let` binding to increase its lifetime");
+ }
+
}
_ => {}
}
fn new_vtable(cx: &CodegenCx<'a, 'tcx>,
sig: ty::FnSig<'tcx>,
extra_args: &[Ty<'tcx>]) -> Self;
- fn unadjusted(cx: &CodegenCx<'a, 'tcx>,
- sig: ty::FnSig<'tcx>,
- extra_args: &[Ty<'tcx>]) -> Self;
+ fn new_internal(
+ cx: &CodegenCx<'a, 'tcx>,
+ sig: ty::FnSig<'tcx>,
+ extra_args: &[Ty<'tcx>],
+ mk_arg_type: impl Fn(Ty<'tcx>, Option<usize>) -> ArgType<'tcx, Ty<'tcx>>,
+ ) -> Self;
fn adjust_for_abi(&mut self,
cx: &CodegenCx<'a, 'tcx>,
abi: Abi);
fn new(cx: &CodegenCx<'a, 'tcx>,
sig: ty::FnSig<'tcx>,
extra_args: &[Ty<'tcx>]) -> Self {
- let mut fn_ty = FnType::unadjusted(cx, sig, extra_args);
- fn_ty.adjust_for_abi(cx, sig.abi);
- fn_ty
+ FnType::new_internal(cx, sig, extra_args, |ty, _| {
+ ArgType::new(cx.layout_of(ty))
+ })
}
fn new_vtable(cx: &CodegenCx<'a, 'tcx>,
sig: ty::FnSig<'tcx>,
extra_args: &[Ty<'tcx>]) -> Self {
- let mut fn_ty = FnType::unadjusted(cx, sig, extra_args);
- // Don't pass the vtable, it's not an argument of the virtual fn.
- {
- let self_arg = &mut fn_ty.args[0];
- match self_arg.mode {
- PassMode::Pair(data_ptr, _) => {
- self_arg.mode = PassMode::Direct(data_ptr);
- }
- _ => bug!("FnType::new_vtable: non-pair self {:?}", self_arg)
- }
-
- let pointee = self_arg.layout.ty.builtin_deref(true)
- .unwrap_or_else(|| {
- bug!("FnType::new_vtable: non-pointer self {:?}", self_arg)
- }).ty;
- let fat_ptr_ty = cx.tcx.mk_mut_ptr(pointee);
- self_arg.layout = cx.layout_of(fat_ptr_ty).field(cx, 0);
- }
- fn_ty.adjust_for_abi(cx, sig.abi);
- fn_ty
+ FnType::new_internal(cx, sig, extra_args, |ty, arg_idx| {
+ let mut layout = cx.layout_of(ty);
+ // Don't pass the vtable, it's not an argument of the virtual fn.
+ // Instead, pass just the (thin pointer) first field of `*dyn Trait`.
+ if arg_idx == Some(0) {
+ // FIXME(eddyb) `layout.field(cx, 0)` is not enough because e.g.
+ // `Box<dyn Trait>` has a few newtype wrappers around the raw
+ // pointer, so we'd have to "dig down" to find `*dyn Trait`.
+ let pointee = layout.ty.builtin_deref(true)
+ .unwrap_or_else(|| {
+ bug!("FnType::new_vtable: non-pointer self {:?}", layout)
+ }).ty;
+ let fat_ptr_ty = cx.tcx.mk_mut_ptr(pointee);
+ layout = cx.layout_of(fat_ptr_ty).field(cx, 0);
+ }
+ ArgType::new(layout)
+ })
}
- fn unadjusted(cx: &CodegenCx<'a, 'tcx>,
- sig: ty::FnSig<'tcx>,
- extra_args: &[Ty<'tcx>]) -> Self {
- debug!("FnType::unadjusted({:?}, {:?})", sig, extra_args);
+ fn new_internal(
+ cx: &CodegenCx<'a, 'tcx>,
+ sig: ty::FnSig<'tcx>,
+ extra_args: &[Ty<'tcx>],
+ mk_arg_type: impl Fn(Ty<'tcx>, Option<usize>) -> ArgType<'tcx, Ty<'tcx>>,
+ ) -> Self {
+ debug!("FnType::new_internal({:?}, {:?})", sig, extra_args);
use self::Abi::*;
let conv = match cx.sess().target.target.adjust_abi(sig.abi) {
}
};
- let arg_of = |ty: Ty<'tcx>, is_return: bool| {
- let mut arg = ArgType::new(cx.layout_of(ty));
+ let arg_of = |ty: Ty<'tcx>, arg_idx: Option<usize>| {
+ let is_return = arg_idx.is_none();
+ let mut arg = mk_arg_type(ty, arg_idx);
if arg.layout.is_zst() {
// For some forsaken reason, x86_64-pc-windows-gnu
// doesn't ignore zero-sized struct arguments.
arg
};
- FnType {
- ret: arg_of(sig.output(), true),
- args: inputs.iter().chain(extra_args.iter()).map(|ty| {
- arg_of(ty, false)
+ let mut fn_ty = FnType {
+ ret: arg_of(sig.output(), None),
+ args: inputs.iter().chain(extra_args).enumerate().map(|(i, ty)| {
+ arg_of(ty, Some(i))
}).collect(),
variadic: sig.variadic,
conv,
- }
+ };
+ fn_ty.adjust_for_abi(cx, sig.abi);
+ fn_ty
}
fn adjust_for_abi(&mut self,
PassMode::Ignore => continue,
PassMode::Direct(_) => arg.layout.immediate_llvm_type(cx),
PassMode::Pair(..) => {
- llargument_tys.push(arg.layout.scalar_pair_element_llvm_type(cx, 0));
- llargument_tys.push(arg.layout.scalar_pair_element_llvm_type(cx, 1));
+ llargument_tys.push(arg.layout.scalar_pair_element_llvm_type(cx, 0, true));
+ llargument_tys.push(arg.layout.scalar_pair_element_llvm_type(cx, 1, true));
continue;
}
PassMode::Cast(cast) => cast.llvm_type(cx),
layout::Int(..) if !scalar.is_bool() => {
let range = scalar.valid_range_exclusive(bx.cx);
if range.start != range.end {
- // FIXME(nox): This causes very weird type errors about
- // SHL operators in constants in stage 2 with LLVM 3.9.
- if unsafe { llvm::LLVMRustVersionMajor() >= 4 } {
- bx.range_metadata(callsite, range);
- }
+ bx.range_metadata(callsite, range);
}
}
_ => {}
use std::ffi::{CStr, CString};
-use rustc::hir::{self, CodegenFnAttrFlags};
+use rustc::hir::CodegenFnAttrFlags;
use rustc::hir::def_id::{DefId, LOCAL_CRATE};
-use rustc::hir::itemlikevisit::ItemLikeVisitor;
use rustc::session::Session;
use rustc::session::config::Sanitizer;
use rustc::ty::TyCtxt;
}
};
- providers.wasm_custom_sections = |tcx, cnum| {
- assert_eq!(cnum, LOCAL_CRATE);
- let mut finder = WasmSectionFinder { tcx, list: Vec::new() };
- tcx.hir.krate().visit_all_item_likes(&mut finder);
- Lrc::new(finder.list)
- };
-
provide_extern(providers);
}
-struct WasmSectionFinder<'a, 'tcx: 'a> {
- tcx: TyCtxt<'a, 'tcx, 'tcx>,
- list: Vec<DefId>,
-}
-
-impl<'a, 'tcx: 'a> ItemLikeVisitor<'tcx> for WasmSectionFinder<'a, 'tcx> {
- fn visit_item(&mut self, i: &'tcx hir::Item) {
- match i.node {
- hir::ItemConst(..) => {}
- _ => return,
- }
- if i.attrs.iter().any(|i| i.check_name("wasm_custom_section")) {
- self.list.push(self.tcx.hir.local_def_id(i.id));
- }
- }
-
- fn visit_trait_item(&mut self, _: &'tcx hir::TraitItem) {}
-
- fn visit_impl_item(&mut self, _: &'tcx hir::ImplItem) {}
-}
-
pub fn provide_extern(providers: &mut Providers) {
providers.wasm_import_module_map = |tcx, cnum| {
let mut ret = FxHashMap();
},
Archive {
archive: ArchiveRO,
- skip: Box<FnMut(&str) -> bool>,
+ skip: Box<dyn FnMut(&str) -> bool>,
},
}
use rustc::util::fs::fix_windows_verbatim_for_gcc;
use rustc::hir::def_id::CrateNum;
use tempfile::{Builder as TempFileBuilder, TempDir};
-use rustc_target::spec::{PanicStrategy, RelroLevel, LinkerFlavor, TargetTriple};
+use rustc_target::spec::{PanicStrategy, RelroLevel, LinkerFlavor};
use rustc_data_structures::fx::FxHashSet;
use context::get_reloc_model;
use llvm;
pub(crate) fn each_linked_rlib(sess: &Session,
info: &CrateInfo,
- f: &mut FnMut(CrateNum, &Path)) -> Result<(), String> {
+ f: &mut dyn FnMut(CrateNum, &Path)) -> Result<(), String> {
let crates = info.used_crates_static.iter();
let fmts = sess.dependency_formats.borrow();
let fmts = fmts.get(&config::CrateTypeExecutable)
if sess.target.target.options.is_like_msvc && linker_not_found {
sess.note_without_error("the msvc targets depend on the msvc linker \
but `link.exe` was not found");
- sess.note_without_error("please ensure that VS 2013 or VS 2015 was installed \
- with the Visual C++ option");
+ sess.note_without_error("please ensure that VS 2013, VS 2015 or VS 2017 \
+ was installed with the Visual C++ option");
}
sess.abort_if_errors();
}
}
}
- if sess.opts.target_triple == TargetTriple::from_triple("wasm32-unknown-unknown") {
+ if sess.opts.target_triple.triple() == "wasm32-unknown-unknown" {
wasm::rewrite_imports(&out_filename, &codegen_results.crate_info.wasm_imports);
- wasm::add_custom_sections(&out_filename,
- &codegen_results.crate_info.wasm_custom_sections);
}
}
}
}
-fn link_args(cmd: &mut Linker,
+fn link_args(cmd: &mut dyn Linker,
sess: &Session,
crate_type: config::CrateType,
tmpdir: &Path,
// Also note that the native libraries linked here are only the ones located
// in the current crate. Upstream crates with native library dependencies
// may have their native library pulled in above.
-fn add_local_native_libraries(cmd: &mut Linker,
+fn add_local_native_libraries(cmd: &mut dyn Linker,
sess: &Session,
codegen_results: &CodegenResults) {
sess.target_filesearch(PathKind::All).for_each_lib_search_path(|path, k| {
// Rust crates are not considered at all when creating an rlib output. All
// dependencies will be linked when producing the final output (instead of
// the intermediate rlib version)
-fn add_upstream_rust_crates(cmd: &mut Linker,
+fn add_upstream_rust_crates(cmd: &mut dyn Linker,
sess: &Session,
codegen_results: &CodegenResults,
crate_type: config::CrateType,
// it's packed in a .rlib, it contains stuff that are not objects that will
// make the linker error. So we must remove those bits from the .rlib before
// linking it.
- fn link_sanitizer_runtime(cmd: &mut Linker,
+ fn link_sanitizer_runtime(cmd: &mut dyn Linker,
sess: &Session,
codegen_results: &CodegenResults,
tmpdir: &Path,
// (aka we're making an executable), we can just pass the rlib blindly to
// the linker (fast) because it's fine if it's not actually included as
// we're at the end of the dependency chain.
- fn add_static_crate(cmd: &mut Linker,
+ fn add_static_crate(cmd: &mut dyn Linker,
sess: &Session,
codegen_results: &CodegenResults,
tmpdir: &Path,
}
// Same thing as above, but for dynamic crates instead of static crates.
- fn add_dynamic_crate(cmd: &mut Linker, sess: &Session, cratepath: &Path) {
+ fn add_dynamic_crate(cmd: &mut dyn Linker, sess: &Session, cratepath: &Path) {
// If we're performing LTO, then it should have been previously required
// that all upstream rust dependencies were available in an rlib format.
assert!(!is_full_lto_enabled(sess));
// generic function calls a native function, then the generic function must
// be instantiated in the target crate, meaning that the native symbol must
// also be resolved in the target crate.
-fn add_upstream_native_libraries(cmd: &mut Linker,
+fn add_upstream_native_libraries(cmd: &mut dyn Linker,
sess: &Session,
codegen_results: &CodegenResults,
crate_type: config::CrateType) {
pub fn to_linker<'a>(&'a self,
cmd: Command,
- sess: &'a Session) -> Box<Linker+'a> {
+ sess: &'a Session) -> Box<dyn Linker+'a> {
match sess.linker_flavor() {
LinkerFlavor::Lld(LldFlavor::Link) |
LinkerFlavor::Msvc => {
cmd,
sess,
info: self
- }) as Box<Linker>
+ }) as Box<dyn Linker>
}
LinkerFlavor::Em => {
Box::new(EmLinker {
cmd,
sess,
info: self
- }) as Box<Linker>
+ }) as Box<dyn Linker>
}
LinkerFlavor::Gcc => {
Box::new(GccLinker {
info: self,
hinted_static: false,
is_ld: false,
- }) as Box<Linker>
+ }) as Box<dyn Linker>
}
LinkerFlavor::Lld(LldFlavor::Ld) |
info: self,
hinted_static: false,
is_ld: true,
- }) as Box<Linker>
+ }) as Box<dyn Linker>
}
LinkerFlavor::Lld(LldFlavor::Wasm) => {
Box::new(WasmLd {
cmd,
- }) as Box<Linker>
+ sess,
+ }) as Box<dyn Linker>
}
}
}
self.hinted_static = false;
}
}
+
+ fn push_cross_lang_lto_args(&mut self, plugin_path: Option<&OsStr>) {
+ if let Some(plugin_path) = plugin_path {
+ let mut arg = OsString::from("-plugin=");
+ arg.push(plugin_path);
+ self.linker_arg(&arg);
+ }
+
+ let opt_level = match self.sess.opts.optimize {
+ config::OptLevel::No => "O0",
+ config::OptLevel::Less => "O1",
+ config::OptLevel::Default => "O2",
+ config::OptLevel::Aggressive => "O3",
+ config::OptLevel::Size => "Os",
+ config::OptLevel::SizeMin => "Oz",
+ };
+
+ self.linker_arg(&format!("-plugin-opt={}", opt_level));
+ self.linker_arg(&format!("-plugin-opt=mcpu={}", self.sess.target_cpu()));
+
+ match self.sess.opts.cg.lto {
+ config::Lto::Thin |
+ config::Lto::ThinLocal => {
+ self.linker_arg(&format!("-plugin-opt=thin"));
+ }
+ config::Lto::Fat |
+ config::Lto::Yes |
+ config::Lto::No => {
+ // default to regular LTO
+ }
+ }
+ }
}
impl<'a> Linker for GccLinker<'a> {
fn cross_lang_lto(&mut self) {
match self.sess.opts.debugging_opts.cross_lang_lto {
- CrossLangLto::Disabled |
- CrossLangLto::NoLink => {
+ CrossLangLto::Disabled => {
// Nothing to do
}
+ CrossLangLto::LinkerPluginAuto => {
+ self.push_cross_lang_lto_args(None);
+ }
CrossLangLto::LinkerPlugin(ref path) => {
- self.linker_arg(&format!("-plugin={}", path.display()));
-
- let opt_level = match self.sess.opts.optimize {
- config::OptLevel::No => "O0",
- config::OptLevel::Less => "O1",
- config::OptLevel::Default => "O2",
- config::OptLevel::Aggressive => "O3",
- config::OptLevel::Size => "Os",
- config::OptLevel::SizeMin => "Oz",
- };
-
- self.linker_arg(&format!("-plugin-opt={}", opt_level));
- self.linker_arg(&format!("-plugin-opt=mcpu={}", self.sess.target_cpu()));
-
- match self.sess.opts.cg.lto {
- config::Lto::Thin |
- config::Lto::ThinLocal => {
- self.linker_arg(&format!("-plugin-opt=thin"));
- }
- config::Lto::Fat |
- config::Lto::Yes |
- config::Lto::No => {
- // default to regular LTO
- }
- }
+ self.push_cross_lang_lto_args(Some(path.as_os_str()));
}
}
}
symbols
}
-pub struct WasmLd {
+pub struct WasmLd<'a> {
cmd: Command,
+ sess: &'a Session,
}
-impl Linker for WasmLd {
+impl<'a> Linker for WasmLd<'a> {
fn link_dylib(&mut self, lib: &str) {
self.cmd.arg("-l").arg(lib);
}
}
fn gc_sections(&mut self, _keep_metadata: bool) {
+ self.cmd.arg("--gc-sections");
}
fn optimize(&mut self) {
+ self.cmd.arg(match self.sess.opts.optimize {
+ OptLevel::No => "-O0",
+ OptLevel::Less => "-O1",
+ OptLevel::Default => "-O2",
+ OptLevel::Aggressive => "-O3",
+ // Currently LLD doesn't support `Os` and `Oz`, so pass through `O2`
+ // instead.
+ OptLevel::Size => "-O2",
+ OptLevel::SizeMin => "-O2"
+ });
}
fn pgo_gen(&mut self) {
// this isn't yet the bottleneck of compilation at all anyway.
self.cmd.arg("--no-threads");
+ // By default LLD only gives us one page of stack (64k) which is a
+ // little small. Default to a larger stack closer to other PC platforms
+ // (1MB) and users can always inject their own link-args to override this.
self.cmd.arg("-z").arg("stack-size=1048576");
+ // By default LLD's memory layout is:
+ //
+ // 1. First, a blank page
+ // 2. Next, all static data
+ // 3. Finally, the main stack (which grows down)
+ //
+ // This has the unfortunate consequence that on stack overflows you
+ // corrupt static data and can cause some exceedingly weird bugs. To
+ // help detect this a little sooner we instead request that the stack is
+ // placed before static data.
+ //
+ // This means that we'll generate slightly larger binaries as references
+ // to static data will take more bytes in the ULEB128 encoding, but
+ // stack overflow will be guaranteed to trap as it underflows instead of
+ // corrupting static data.
+ self.cmd.arg("--stack-first");
+
// FIXME we probably shouldn't pass this but instead pass an explicit
// whitelist of symbols we'll allow to be undefined. Unfortunately
// though we can't handle symbols like `log10` that LLVM injects at a
unsafe {
let pm = llvm::LLVMCreatePassManager();
llvm::LLVMRustAddAnalysisPasses(tm, pm, llmod);
- let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr() as *const _);
- assert!(!pass.is_null());
- llvm::LLVMRustAddPass(pm, pass);
+
+ if config.verify_llvm_ir {
+ let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr() as *const _);
+ assert!(!pass.is_null());
+ llvm::LLVMRustAddPass(pm, pass);
+ }
// When optimizing for LTO we don't actually pass in `-O0`, but we force
// it to always happen at least with `-O1`.
}
});
- let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr() as *const _);
- assert!(!pass.is_null());
- llvm::LLVMRustAddPass(pm, pass);
+ if config.verify_llvm_ir {
+ let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr() as *const _);
+ assert!(!pass.is_null());
+ llvm::LLVMRustAddPass(pm, pass);
+ }
time_ext(cgcx.time_passes, None, "LTO passes", ||
llvm::LLVMRunPassManager(pm, llmod));
pub is_like_osx: bool,
pub has_rpath: bool,
pub linker_is_gnu: bool,
- pub get_install_prefix_lib_path: &'a mut FnMut() -> PathBuf,
+ pub get_install_prefix_lib_path: &'a mut dyn FnMut() -> PathBuf,
}
pub fn get_rpath_flags(config: &mut RPathConfig) -> Vec<String> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use std::collections::BTreeMap;
use std::fs;
use std::path::Path;
use std::str;
const WASM_EXTERNAL_KIND_MEMORY: u8 = 2;
const WASM_EXTERNAL_KIND_GLOBAL: u8 = 3;
-/// Append all the custom sections listed in `sections` to the wasm binary
-/// specified at `path`.
-///
-/// LLVM 6 which we're using right now doesn't have the ability to create custom
-/// sections in wasm files nor does LLD have the ability to merge these sections
-/// into one larger section when linking. It's expected that this will
-/// eventually get implemented, however!
-///
-/// Until that time though this is a custom implementation in rustc to append
-/// all sections to a wasm file to the finished product that LLD produces.
-///
-/// Support for this is landing in LLVM in https://reviews.llvm.org/D43097,
-/// although after that support will need to be in LLD as well.
-pub fn add_custom_sections(path: &Path, sections: &BTreeMap<String, Vec<u8>>) {
- if sections.len() == 0 {
- return
- }
-
- let wasm = fs::read(path).expect("failed to read wasm output");
-
- // see https://webassembly.github.io/spec/core/binary/modules.html#custom-section
- let mut wasm = WasmEncoder { data: wasm };
- for (section, bytes) in sections {
- // write the `id` identifier, 0 for a custom section
- wasm.byte(0);
-
- // figure out how long our name descriptor will be
- let mut name = WasmEncoder::new();
- name.str(section);
-
- // write the length of the payload followed by all its contents
- wasm.u32((bytes.len() + name.data.len()) as u32);
- wasm.data.extend_from_slice(&name.data);
- wasm.data.extend_from_slice(bytes);
- }
-
- fs::write(path, &wasm.data).expect("failed to write wasm output");
-}
-
/// Rewrite the module imports are listed from in a wasm module given the field
/// name to module name mapping in `import_map`.
///
///
/// Support for this was added to LLVM in
/// https://github.com/llvm-mirror/llvm/commit/0f32e1365, although support still
-/// needs to be added (AFAIK at the time of this writing) to LLD
+/// needs to be added, tracked at https://bugs.llvm.org/show_bug.cgi?id=37168
pub fn rewrite_imports(path: &Path, import_map: &FxHashMap<String, String>) {
if import_map.len() == 0 {
return
// that `is_pie_binary` is false. When we discover LLVM target features
// `sess.crate_types` is uninitialized so we cannot access it.
pub fn target_machine_factory(sess: &Session, find_features: bool)
- -> Arc<Fn() -> Result<TargetMachineRef, String> + Send + Sync>
+ -> Arc<dyn Fn() -> Result<TargetMachineRef, String> + Send + Sync>
{
let reloc_model = get_reloc_model(sess);
emit_obj: bool,
// Miscellaneous flags. These are mostly copied from command-line
// options.
- no_verify: bool,
+ pub verify_llvm_ir: bool,
no_prepopulate_passes: bool,
no_builtins: bool,
time_passes: bool,
embed_bitcode_marker: false,
no_integrated_as: false,
- no_verify: false,
+ verify_llvm_ir: false,
no_prepopulate_passes: false,
no_builtins: false,
time_passes: false,
}
fn set_flags(&mut self, sess: &Session, no_builtins: bool) {
- self.no_verify = sess.no_verify();
+ self.verify_llvm_ir = sess.verify_llvm_ir();
self.no_prepopulate_passes = sess.opts.cg.no_prepopulate_passes;
self.no_builtins = no_builtins || sess.target.target.options.no_builtins;
self.time_passes = sess.time_passes();
self.inline_threshold = sess.opts.cg.inline_threshold;
- self.obj_is_bitcode = sess.target.target.options.obj_is_bitcode;
+ self.obj_is_bitcode = sess.target.target.options.obj_is_bitcode ||
+ sess.opts.debugging_opts.cross_lang_lto.enabled();
let embed_bitcode = sess.target.target.options.embed_bitcode ||
- sess.opts.debugging_opts.embed_bitcode ||
- sess.opts.debugging_opts.cross_lang_lto.embed_bitcode();
+ sess.opts.debugging_opts.embed_bitcode;
if embed_bitcode {
match sess.opts.optimize {
config::OptLevel::No |
regular_module_config: Arc<ModuleConfig>,
metadata_module_config: Arc<ModuleConfig>,
allocator_module_config: Arc<ModuleConfig>,
- pub tm_factory: Arc<Fn() -> Result<TargetMachineRef, String> + Send + Sync>,
+ pub tm_factory: Arc<dyn Fn() -> Result<TargetMachineRef, String> + Send + Sync>,
pub msvc_imps_needed: bool,
pub target_pointer_width: String,
debuginfo: config::DebugInfoLevel,
// compiling incrementally
pub incr_comp_session_dir: Option<PathBuf>,
// Channel back to the main control thread to send messages to
- coordinator_send: Sender<Box<Any + Send>>,
+ coordinator_send: Sender<Box<dyn Any + Send>>,
// A reference to the TimeGraph so we can register timings. None means that
// measuring is disabled.
time_graph: Option<TimeGraph>,
true
};
- if !config.no_verify { assert!(addpass("verify")); }
+ if config.verify_llvm_ir { assert!(addpass("verify")); }
if !config.no_prepopulate_passes {
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
time_graph: Option<TimeGraph>,
link: LinkMeta,
metadata: EncodedMetadata,
- coordinator_receive: Receiver<Box<Any + Send>>,
+ coordinator_receive: Receiver<Box<dyn Any + Send>>,
total_cgus: usize)
-> OngoingCodegen {
let sess = tcx.sess;
// Don't run LTO passes when cross-lang LTO is enabled. The linker
// will do that for us in this case.
let needs_lto = needs_lto &&
- !cgcx.opts.debugging_opts.cross_lang_lto.embed_bitcode();
+ !cgcx.opts.debugging_opts.cross_lang_lto.enabled();
if needs_lto {
Ok(WorkItemResult::NeedsLTO(module))
crate_info: &CrateInfo,
shared_emitter: SharedEmitter,
codegen_worker_send: Sender<Message>,
- coordinator_receive: Receiver<Box<Any + Send>>,
+ coordinator_receive: Receiver<Box<dyn Any + Send>>,
total_cgus: usize,
jobserver: Client,
time_graph: Option<TimeGraph>,
// Set up a destructor which will fire off a message that we're done as
// we exit.
struct Bomb {
- coordinator_send: Sender<Box<Any + Send>>,
+ coordinator_send: Sender<Box<dyn Any + Send>>,
result: Option<WorkItemResult>,
worker_id: usize,
}
config: &ModuleConfig,
opt_level: llvm::CodeGenOptLevel,
prepare_for_thin_lto: bool,
- f: &mut FnMut(llvm::PassManagerBuilderRef)) {
+ f: &mut dyn FnMut(llvm::PassManagerBuilderRef)) {
use std::ptr;
// Create the PassManagerBuilder for LLVM. We configure it with
linker_info: LinkerInfo,
crate_info: CrateInfo,
time_graph: Option<TimeGraph>,
- coordinator_send: Sender<Box<Any + Send>>,
+ coordinator_send: Sender<Box<dyn Any + Send>>,
codegen_worker_receive: Receiver<Message>,
shared_emitter_main: SharedEmitterMain,
future: thread::JoinHandle<Result<CompiledModules, ()>>,
use back::write::{self, OngoingCodegen, create_target_machine};
use llvm::{ContextRef, ModuleRef, ValueRef, Vector, get_param};
use llvm;
+use libc::c_uint;
use metadata;
use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use rustc::middle::lang_items::StartFnLangItem;
use callee;
use common::{C_bool, C_bytes_in_context, C_i32, C_usize};
use rustc_mir::monomorphize::collector::{self, MonoItemCollectionMode};
+use rustc_mir::monomorphize::item::DefPathBasedNames;
use common::{self, C_struct_in_context, C_array, val_ty};
use consts;
use context::{self, CodegenCx};
use monomorphize::partitioning::{self, PartitioningStrategy, CodegenUnit, CodegenUnitExt};
use rustc_codegen_utils::symbol_names_test;
use time_graph;
-use mono_item::{MonoItem, BaseMonoItemExt, MonoItemExt, DefPathBasedNames};
+use mono_item::{MonoItem, BaseMonoItemExt, MonoItemExt};
use type_::Type;
use type_of::LayoutLlvmExt;
use rustc::util::nodemap::{FxHashMap, FxHashSet, DefIdSet};
use CrateInfo;
use rustc_data_structures::sync::Lrc;
-use rustc_target::spec::TargetTriple;
use std::any::Any;
-use std::collections::BTreeMap;
use std::ffi::CString;
use std::str;
use std::sync::Arc;
use mir::operand::OperandValue;
-pub use rustc_codegen_utils::check_for_rustc_errors_attr;
+use rustc_codegen_utils::check_for_rustc_errors_attr;
pub struct StatRecorder<'a, 'tcx: 'a> {
cx: &'a CodegenCx<'a, 'tcx>,
}
let (lldata, llextra) = result.unwrap();
// HACK(eddyb) have to bitcast pointers until LLVM removes pointee types.
- (bx.bitcast(lldata, dst_layout.scalar_pair_element_llvm_type(bx.cx, 0)),
- bx.bitcast(llextra, dst_layout.scalar_pair_element_llvm_type(bx.cx, 1)))
+ (bx.bitcast(lldata, dst_layout.scalar_pair_element_llvm_type(bx.cx, 0, true)),
+ bx.bitcast(llextra, dst_layout.scalar_pair_element_llvm_type(bx.cx, 1, true)))
}
_ => bug!("unsize_thin_ptr: called on bad types"),
}
pub fn to_immediate(bx: &Builder, val: ValueRef, layout: layout::TyLayout) -> ValueRef {
if let layout::Abi::Scalar(ref scalar) = layout.abi {
- if scalar.is_bool() {
- return bx.trunc(val, Type::i1(bx.cx));
- }
+ return to_immediate_scalar(bx, val, scalar);
+ }
+ val
+}
+
+pub fn to_immediate_scalar(bx: &Builder, val: ValueRef, scalar: &layout::Scalar) -> ValueRef {
+ if scalar.is_bool() {
+ return bx.trunc(val, Type::i1(bx.cx));
}
val
}
}
pub fn codegen_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- rx: mpsc::Receiver<Box<Any + Send>>)
+ rx: mpsc::Receiver<Box<dyn Any + Send>>)
-> OngoingCodegen {
check_for_rustc_errors_attr(tcx);
used_crates_dynamic: cstore::used_crates(tcx, LinkagePreference::RequireDynamic),
used_crates_static: cstore::used_crates(tcx, LinkagePreference::RequireStatic),
used_crate_source: FxHashMap(),
- wasm_custom_sections: BTreeMap::new(),
wasm_imports: FxHashMap(),
lang_item_to_crate: FxHashMap(),
missing_lang_items: FxHashMap(),
let load_wasm_items = tcx.sess.crate_types.borrow()
.iter()
.any(|c| *c != config::CrateTypeRlib) &&
- tcx.sess.opts.target_triple == TargetTriple::from_triple("wasm32-unknown-unknown");
+ tcx.sess.opts.target_triple.triple() == "wasm32-unknown-unknown";
if load_wasm_items {
- info!("attempting to load all wasm sections");
- for &id in tcx.wasm_custom_sections(LOCAL_CRATE).iter() {
- let (name, contents) = fetch_wasm_section(tcx, id);
- info.wasm_custom_sections.entry(name)
- .or_insert(Vec::new())
- .extend(contents);
- }
info.load_wasm_imports(tcx, LOCAL_CRATE);
}
info.is_no_builtins.insert(cnum);
}
if load_wasm_items {
- for &id in tcx.wasm_custom_sections(cnum).iter() {
- let (name, contents) = fetch_wasm_section(tcx, id);
- info.wasm_custom_sections.entry(name)
- .or_insert(Vec::new())
- .extend(contents);
- }
info.load_wasm_imports(tcx, cnum);
}
let missing = tcx.missing_lang_items(cnum);
}
}
-fn fetch_wasm_section(tcx: TyCtxt, id: DefId) -> (String, Vec<u8>) {
+pub fn define_custom_section(cx: &CodegenCx, def_id: DefId) {
use rustc::mir::interpret::GlobalId;
- info!("loading wasm section {:?}", id);
+ assert!(cx.tcx.sess.opts.target_triple.triple().starts_with("wasm32"));
- let section = tcx.get_attrs(id)
- .iter()
- .find(|a| a.check_name("wasm_custom_section"))
- .expect("missing #[wasm_custom_section] attribute")
- .value_str()
- .expect("malformed #[wasm_custom_section] attribute");
+ info!("loading wasm section {:?}", def_id);
- let instance = ty::Instance::mono(tcx, id);
+ let section = cx.tcx.codegen_fn_attrs(def_id).wasm_custom_section.unwrap();
+
+ let instance = ty::Instance::mono(cx.tcx, def_id);
let cid = GlobalId {
instance,
promoted: None
};
let param_env = ty::ParamEnv::reveal_all();
- let val = tcx.const_eval(param_env.and(cid)).unwrap();
- let alloc = tcx.const_value_to_allocation(val);
- (section.to_string(), alloc.bytes.clone())
+ let val = cx.tcx.const_eval(param_env.and(cid)).unwrap();
+ let alloc = cx.tcx.const_value_to_allocation(val);
+
+ unsafe {
+ let section = llvm::LLVMMDStringInContext(
+ cx.llcx,
+ section.as_str().as_ptr() as *const _,
+ section.as_str().len() as c_uint,
+ );
+ let alloc = llvm::LLVMMDStringInContext(
+ cx.llcx,
+ alloc.bytes.as_ptr() as *const _,
+ alloc.bytes.len() as c_uint,
+ );
+ let data = [section, alloc];
+ let meta = llvm::LLVMMDNodeInContext(cx.llcx, data.as_ptr(), 2);
+ llvm::LLVMAddNamedMetadataOperand(
+ cx.llmod,
+ "wasm.custom_sections\0".as_ptr() as *const _,
+ meta,
+ );
+ }
}
}
pub fn nswsub(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
- self.count_insn("nwsub");
+ self.count_insn("nswsub");
unsafe {
llvm::LLVMBuildNSWSub(self.llbuilder, lhs, rhs, noname())
}
}
pub fn fsub(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
- self.count_insn("sub");
+ self.count_insn("fsub");
unsafe {
llvm::LLVMBuildFSub(self.llbuilder, lhs, rhs, noname())
}
}
pub fn fsub_fast(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
- self.count_insn("sub");
+ self.count_insn("fsub");
unsafe {
let instr = llvm::LLVMBuildFSub(self.llbuilder, lhs, rhs, noname());
llvm::LLVMRustSetHasUnsafeAlgebra(instr);
}
pub fn add_incoming_to_phi(&self, phi: ValueRef, val: ValueRef, bb: BasicBlockRef) {
+ self.count_insn("addincoming");
unsafe {
llvm::LLVMAddIncoming(phi, &val, &bb, 1 as c_uint);
}
name: &str,
inputs: Vec<Ty<'tcx>>,
output: Ty<'tcx>,
- codegen: &mut for<'b> FnMut(Builder<'b, 'tcx>))
+ codegen: &mut dyn for<'b> FnMut(Builder<'b, 'tcx>))
-> ValueRef {
let rust_fn_ty = cx.tcx.mk_fn_ptr(ty::Binder::bind(cx.tcx.mk_fn_sig(
inputs.into_iter(),
//
// This function is only generated once and is then cached.
fn get_rust_try_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
- codegen: &mut for<'b> FnMut(Builder<'b, 'tcx>))
+ codegen: &mut dyn for<'b> FnMut(Builder<'b, 'tcx>))
-> ValueRef {
if let Some(llfn) = cx.rust_try_fn.get() {
return llfn;
#![feature(custom_attribute)]
#![feature(fs_read_write)]
#![allow(unused_attributes)]
+#![deny(bare_trait_objects)]
#![feature(libc)]
#![feature(quote)]
#![feature(range_contains)]
use std::any::Any;
use std::path::PathBuf;
use std::sync::mpsc;
-use std::collections::BTreeMap;
use rustc_data_structures::sync::Lrc;
use rustc::dep_graph::DepGraph;
use rustc::session::{Session, CompileIncomplete};
use rustc::session::config::{OutputFilenames, OutputType, PrintRequest};
use rustc::ty::{self, TyCtxt};
+use rustc::util::time_graph;
use rustc::util::nodemap::{FxHashSet, FxHashMap};
use rustc_mir::monomorphize;
use rustc_codegen_utils::codegen_backend::CodegenBackend;
pub mod symbol_export;
pub mod write;
mod rpath;
- mod wasm;
+ pub mod wasm;
}
mod abi;
mod metadata;
mod meth;
mod mir;
-mod time_graph;
mod mono_item;
mod type_;
mod type_of;
impl !Sync for LlvmCodegenBackend {}
impl LlvmCodegenBackend {
- pub fn new() -> Box<CodegenBackend> {
+ pub fn new() -> Box<dyn CodegenBackend> {
box LlvmCodegenBackend(())
}
}
target_features(sess)
}
- fn metadata_loader(&self) -> Box<MetadataLoader + Sync> {
+ fn metadata_loader(&self) -> Box<dyn MetadataLoader + Sync> {
box metadata::LlvmMetadataLoader
}
fn codegen_crate<'a, 'tcx>(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- rx: mpsc::Receiver<Box<Any + Send>>
- ) -> Box<Any> {
+ rx: mpsc::Receiver<Box<dyn Any + Send>>
+ ) -> Box<dyn Any> {
box base::codegen_crate(tcx, rx)
}
fn join_codegen_and_link(
&self,
- ongoing_codegen: Box<Any>,
+ ongoing_codegen: Box<dyn Any>,
sess: &Session,
dep_graph: &DepGraph,
outputs: &OutputFilenames,
/// This is the entrypoint for a hot plugged rustc_codegen_llvm
#[no_mangle]
-pub fn __rustc_codegen_backend() -> Box<CodegenBackend> {
+pub fn __rustc_codegen_backend() -> Box<dyn CodegenBackend> {
LlvmCodegenBackend::new()
}
crate_info: CrateInfo,
}
-// Misc info we load from metadata to persist beyond the tcx
+/// Misc info we load from metadata to persist beyond the tcx
struct CrateInfo {
panic_runtime: Option<CrateNum>,
compiler_builtins: Option<CrateNum>,
used_crate_source: FxHashMap<CrateNum, Lrc<CrateSource>>,
used_crates_static: Vec<(CrateNum, LibSource)>,
used_crates_dynamic: Vec<(CrateNum, LibSource)>,
- wasm_custom_sections: BTreeMap<String, Vec<u8>>,
wasm_imports: FxHashMap<String, String>,
lang_item_to_crate: FxHashMap<LangItem, CrateNum>,
missing_lang_items: FxHashMap<CrateNum, Vec<LangItem>>,
// array, leading to crashes.
const ARM_WHITELIST: &[(&str, Option<&str>)] = &[
+ ("mclass", Some("arm_target_feature")),
("neon", Some("arm_target_feature")),
("v7", Some("arm_target_feature")),
("vfp2", Some("arm_target_feature")),
use common::{CodegenCx, Funclet};
use debuginfo::{self, declare_local, VariableAccess, VariableKind, FunctionDebugContext};
use monomorphize::Instance;
-use abi::{ArgAttribute, ArgTypeExt, FnType, FnTypeExt, PassMode};
+use abi::{ArgTypeExt, FnType, FnTypeExt, PassMode};
use type_::Type;
use syntax_pos::{DUMMY_SP, NO_EXPANSION, BytePos, Span};
None
};
- let deref_op = unsafe {
- [llvm::LLVMRustDIBuilderCreateOpDeref()]
- };
-
mir.args_iter().enumerate().map(|(arg_index, local)| {
let arg_decl = &mir.local_decls[local];
if arg_index > 0 || mir.upvar_decls.is_empty() {
// The Rust ABI passes indirect variables using a pointer and a manual copy, so we
// need to insert a deref here, but the C ABI uses a pointer and a copy using the
- // byval attribute, for which LLVM does the deref itself, so we must not add it.
- // Starting with D31439 in LLVM 5, it *always* does the deref itself.
- let mut variable_access = VariableAccess::DirectVariable {
+ // byval attribute, for which LLVM always does the deref itself,
+ // so we must not add it.
+ let variable_access = VariableAccess::DirectVariable {
alloca: place.llval
};
- if unsafe { llvm::LLVMRustVersionMajor() < 5 } {
- if let PassMode::Indirect(ref attrs) = arg.mode {
- if !attrs.contains(ArgAttribute::ByVal) {
- variable_access = VariableAccess::IndirectVariable {
- alloca: place.llval,
- address_operations: &deref_op,
- };
- }
- }
- }
declare_local(
bx,
use rustc_data_structures::sync::Lrc;
use base;
-use common::{self, CodegenCx, C_null, C_undef, C_usize};
+use common::{CodegenCx, C_null, C_undef, C_usize};
use builder::{Builder, MemFlags};
use value::Value;
use type_of::LayoutLlvmExt;
bx.cx,
a,
a_scalar,
- layout.scalar_pair_element_llvm_type(bx.cx, 0),
+ layout.scalar_pair_element_llvm_type(bx.cx, 0, true),
);
let b_llval = scalar_to_llvm(
bx.cx,
b,
b_scalar,
- layout.scalar_pair_element_llvm_type(bx.cx, 1),
+ layout.scalar_pair_element_llvm_type(bx.cx, 1, true),
);
OperandValue::Pair(a_llval, b_llval)
},
self, llty);
// Reconstruct the immediate aggregate.
let mut llpair = C_undef(llty);
- llpair = bx.insert_value(llpair, a, 0);
- llpair = bx.insert_value(llpair, b, 1);
+ llpair = bx.insert_value(llpair, base::from_immediate(bx, a), 0);
+ llpair = bx.insert_value(llpair, base::from_immediate(bx, b), 1);
llpair
} else {
self.immediate()
llval: ValueRef,
layout: TyLayout<'tcx>)
-> OperandRef<'tcx> {
- let val = if layout.is_llvm_scalar_pair() {
+ let val = if let layout::Abi::ScalarPair(ref a, ref b) = layout.abi {
debug!("Operand::from_immediate_or_packed_pair: unpacking {:?} @ {:?}",
llval, layout);
// Deconstruct the immediate aggregate.
- OperandValue::Pair(bx.extract_value(llval, 0),
- bx.extract_value(llval, 1))
+ let a_llval = base::to_immediate_scalar(bx, bx.extract_value(llval, 0), a);
+ let b_llval = base::to_immediate_scalar(bx, bx.extract_value(llval, 1), b);
+ OperandValue::Pair(a_llval, b_llval)
} else {
OperandValue::Immediate(llval)
};
*llval = bx.bitcast(*llval, field.immediate_llvm_type(bx.cx));
}
OperandValue::Pair(ref mut a, ref mut b) => {
- *a = bx.bitcast(*a, field.scalar_pair_element_llvm_type(bx.cx, 0));
- *b = bx.bitcast(*b, field.scalar_pair_element_llvm_type(bx.cx, 1));
+ *a = bx.bitcast(*a, field.scalar_pair_element_llvm_type(bx.cx, 0, true));
+ *b = bx.bitcast(*b, field.scalar_pair_element_llvm_type(bx.cx, 1, true));
}
OperandValue::Ref(..) => bug!()
}
}
OperandValue::Pair(a, b) => {
for (i, &x) in [a, b].iter().enumerate() {
- let mut llptr = bx.struct_gep(dest.llval, i as u64);
- // Make sure to always store i1 as i8.
- if common::val_ty(x) == Type::i1(bx.cx) {
- llptr = bx.pointercast(llptr, Type::i8p(bx.cx));
- }
+ let llptr = bx.struct_gep(dest.llval, i as u64);
let val = base::from_immediate(bx, x);
bx.store_with_flags(val, llptr, dest.align, flags);
}
OperandValue::Immediate(base::to_immediate(bx, llval, self.layout))
} else if let layout::Abi::ScalarPair(ref a, ref b) = self.layout.abi {
let load = |i, scalar: &layout::Scalar| {
- let mut llptr = bx.struct_gep(self.llval, i as u64);
- // Make sure to always load i1 as i8.
- if scalar.is_bool() {
- llptr = bx.pointercast(llptr, Type::i8p(bx.cx));
- }
+ let llptr = bx.struct_gep(self.llval, i as u64);
let load = bx.load(llptr, self.align);
scalar_load_metadata(load, scalar);
if scalar.is_bool() {
// HACK(eddyb) have to bitcast pointers
// until LLVM removes pointee types.
let lldata = bx.pointercast(lldata,
- cast.scalar_pair_element_llvm_type(bx.cx, 0));
+ cast.scalar_pair_element_llvm_type(bx.cx, 0, true));
OperandValue::Pair(lldata, llextra)
}
OperandValue::Immediate(lldata) => {
if let OperandValue::Pair(data_ptr, meta) = operand.val {
if cast.is_llvm_scalar_pair() {
let data_cast = bx.pointercast(data_ptr,
- cast.scalar_pair_element_llvm_type(bx.cx, 0));
+ cast.scalar_pair_element_llvm_type(bx.cx, 0, true));
OperandValue::Pair(data_cast, meta)
} else { // cast to thin-ptr
// Cast of fat-ptr to thin-ptr is an extraction of data-ptr and
pub use rustc::mir::mono::MonoItem;
-pub use rustc_mir::monomorphize::item::*;
pub use rustc_mir::monomorphize::item::MonoItemExt as BaseMonoItemExt;
pub trait MonoItemExt<'a, 'tcx>: fmt::Debug + BaseMonoItemExt<'a, 'tcx> {
span_bug!(item.span, "Mismatch between hir::Item type and MonoItem type")
}
}
+ MonoItem::CustomSection(def_id) => {
+ base::define_custom_section(cx, def_id);
+ }
MonoItem::Fn(instance) => {
base::codegen_instance(&cx, instance);
}
MonoItem::Fn(instance) => {
predefine_fn(cx, instance, linkage, visibility, &symbol_name);
}
+ MonoItem::CustomSection(..) => {}
MonoItem::GlobalAsm(..) => {}
}
MonoItem::Static(id) => {
format!("Static({:?})", id)
}
+ MonoItem::CustomSection(id) => {
+ format!("CustomSection({:?})", id)
+ }
MonoItem::GlobalAsm(id) => {
format!("GlobalAsm({:?})", id)
}
+++ /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.
-
-use std::collections::HashMap;
-use std::fs::File;
-use std::io::prelude::*;
-use std::marker::PhantomData;
-use std::mem;
-use std::sync::{Arc, Mutex};
-use std::time::Instant;
-
-const OUTPUT_WIDTH_IN_PX: u64 = 1000;
-const TIME_LINE_HEIGHT_IN_PX: u64 = 20;
-const TIME_LINE_HEIGHT_STRIDE_IN_PX: usize = 30;
-
-#[derive(Clone)]
-struct Timing {
- start: Instant,
- end: Instant,
- work_package_kind: WorkPackageKind,
- name: String,
- events: Vec<(String, Instant)>,
-}
-
-#[derive(Clone, Copy, Hash, Eq, PartialEq, Debug)]
-pub struct TimelineId(pub usize);
-
-#[derive(Clone)]
-struct PerThread {
- timings: Vec<Timing>,
- open_work_package: Option<(Instant, WorkPackageKind, String)>,
-}
-
-#[derive(Clone)]
-pub struct TimeGraph {
- data: Arc<Mutex<HashMap<TimelineId, PerThread>>>,
-}
-
-#[derive(Clone, Copy)]
-pub struct WorkPackageKind(pub &'static [&'static str]);
-
-pub struct Timeline {
- token: Option<RaiiToken>,
-}
-
-struct RaiiToken {
- graph: TimeGraph,
- timeline: TimelineId,
- events: Vec<(String, Instant)>,
- // The token must not be Send:
- _marker: PhantomData<*const ()>
-}
-
-
-impl Drop for RaiiToken {
- fn drop(&mut self) {
- self.graph.end(self.timeline, mem::replace(&mut self.events, Vec::new()));
- }
-}
-
-impl TimeGraph {
- pub fn new() -> TimeGraph {
- TimeGraph {
- data: Arc::new(Mutex::new(HashMap::new()))
- }
- }
-
- pub fn start(&self,
- timeline: TimelineId,
- work_package_kind: WorkPackageKind,
- name: &str) -> Timeline {
- {
- let mut table = self.data.lock().unwrap();
-
- let data = table.entry(timeline).or_insert(PerThread {
- timings: Vec::new(),
- open_work_package: None,
- });
-
- assert!(data.open_work_package.is_none());
- data.open_work_package = Some((Instant::now(), work_package_kind, name.to_string()));
- }
-
- Timeline {
- token: Some(RaiiToken {
- graph: self.clone(),
- timeline,
- events: Vec::new(),
- _marker: PhantomData,
- }),
- }
- }
-
- fn end(&self, timeline: TimelineId, events: Vec<(String, Instant)>) {
- let end = Instant::now();
-
- let mut table = self.data.lock().unwrap();
- let data = table.get_mut(&timeline).unwrap();
-
- if let Some((start, work_package_kind, name)) = data.open_work_package.take() {
- data.timings.push(Timing {
- start,
- end,
- work_package_kind,
- name,
- events,
- });
- } else {
- bug!("end timing without start?")
- }
- }
-
- pub fn dump(&self, output_filename: &str) {
- let table = self.data.lock().unwrap();
-
- for data in table.values() {
- assert!(data.open_work_package.is_none());
- }
-
- let mut threads: Vec<PerThread> =
- table.values().map(|data| data.clone()).collect();
-
- threads.sort_by_key(|timeline| timeline.timings[0].start);
-
- let earliest_instant = threads[0].timings[0].start;
- let latest_instant = threads.iter()
- .map(|timeline| timeline.timings
- .last()
- .unwrap()
- .end)
- .max()
- .unwrap();
- let max_distance = distance(earliest_instant, latest_instant);
-
- let mut file = File::create(format!("{}.html", output_filename)).unwrap();
-
- writeln!(file, "
- <html>
- <head>
- <style>
- #threads a {{
- position: absolute;
- overflow: hidden;
- }}
- #threads {{
- height: {total_height}px;
- width: {width}px;
- }}
-
- .timeline {{
- display: none;
- width: {width}px;
- position: relative;
- }}
-
- .timeline:target {{
- display: block;
- }}
-
- .event {{
- position: absolute;
- }}
- </style>
- </head>
- <body>
- <div id='threads'>
- ",
- total_height = threads.len() * TIME_LINE_HEIGHT_STRIDE_IN_PX,
- width = OUTPUT_WIDTH_IN_PX,
- ).unwrap();
-
- let mut color = 0;
- for (line_index, thread) in threads.iter().enumerate() {
- let line_top = line_index * TIME_LINE_HEIGHT_STRIDE_IN_PX;
-
- for span in &thread.timings {
- let start = distance(earliest_instant, span.start);
- let end = distance(earliest_instant, span.end);
-
- let start = normalize(start, max_distance, OUTPUT_WIDTH_IN_PX);
- let end = normalize(end, max_distance, OUTPUT_WIDTH_IN_PX);
-
- let colors = span.work_package_kind.0;
-
- writeln!(file, "<a href='#timing{}'
- style='top:{}px; \
- left:{}px; \
- width:{}px; \
- height:{}px; \
- background:{};'>{}</a>",
- color,
- line_top,
- start,
- end - start,
- TIME_LINE_HEIGHT_IN_PX,
- colors[color % colors.len()],
- span.name,
- ).unwrap();
-
- color += 1;
- }
- }
-
- writeln!(file, "
- </div>
- ").unwrap();
-
- let mut idx = 0;
- for thread in threads.iter() {
- for timing in &thread.timings {
- let colors = timing.work_package_kind.0;
- let height = TIME_LINE_HEIGHT_STRIDE_IN_PX * timing.events.len();
- writeln!(file, "<div class='timeline'
- id='timing{}'
- style='background:{};height:{}px;'>",
- idx,
- colors[idx % colors.len()],
- height).unwrap();
- idx += 1;
- let max = distance(timing.start, timing.end);
- for (i, &(ref event, time)) in timing.events.iter().enumerate() {
- let i = i as u64;
- let time = distance(timing.start, time);
- let at = normalize(time, max, OUTPUT_WIDTH_IN_PX);
- writeln!(file, "<span class='event'
- style='left:{}px;\
- top:{}px;'>{}</span>",
- at,
- TIME_LINE_HEIGHT_IN_PX * i,
- event).unwrap();
- }
- writeln!(file, "</div>").unwrap();
- }
- }
-
- writeln!(file, "
- </body>
- </html>
- ").unwrap();
- }
-}
-
-impl Timeline {
- pub fn noop() -> Timeline {
- Timeline { token: None }
- }
-
- /// Record an event which happened at this moment on this timeline.
- ///
- /// Events are displayed in the eventual HTML output where you can click on
- /// a particular timeline and it'll expand to all of the events that
- /// happened on that timeline. This can then be used to drill into a
- /// particular timeline and see what events are happening and taking the
- /// most time.
- pub fn record(&mut self, name: &str) {
- if let Some(ref mut token) = self.token {
- token.events.push((name.to_string(), Instant::now()));
- }
- }
-}
-
-fn distance(zero: Instant, x: Instant) -> u64 {
-
- let duration = x.duration_since(zero);
- (duration.as_secs() * 1_000_000_000 + duration.subsec_nanos() as u64) // / div
-}
-
-fn normalize(distance: u64, max: u64, max_pixels: u64) -> u64 {
- (max_pixels * distance) / max
-}
-
use rustc::ty::layout::{self, Align, LayoutOf, Size, TyLayout};
use rustc_target::spec::PanicStrategy;
use rustc_target::abi::FloatTy;
-use mono_item::DefPathBasedNames;
+use rustc_mir::monomorphize::item::DefPathBasedNames;
use type_::Type;
use std::fmt::Write;
}
layout::Abi::ScalarPair(..) => {
return Type::struct_(cx, &[
- layout.scalar_pair_element_llvm_type(cx, 0),
- layout.scalar_pair_element_llvm_type(cx, 1),
+ layout.scalar_pair_element_llvm_type(cx, 0, false),
+ layout.scalar_pair_element_llvm_type(cx, 1, false),
], false);
}
layout::Abi::Uninhabited |
fn scalar_llvm_type_at<'a>(&self, cx: &CodegenCx<'a, 'tcx>,
scalar: &layout::Scalar, offset: Size) -> Type;
fn scalar_pair_element_llvm_type<'a>(&self, cx: &CodegenCx<'a, 'tcx>,
- index: usize) -> Type;
+ index: usize, immediate: bool) -> Type;
fn llvm_field_index(&self, index: usize) -> u64;
fn pointee_info_at<'a>(&self, cx: &CodegenCx<'a, 'tcx>, offset: Size)
-> Option<PointeeInfo>;
}
fn scalar_pair_element_llvm_type<'a>(&self, cx: &CodegenCx<'a, 'tcx>,
- index: usize) -> Type {
+ index: usize, immediate: bool) -> Type {
// HACK(eddyb) special-case fat pointers until LLVM removes
// pointee types, to avoid bitcasting every `OperandRef::deref`.
match self.ty.sty {
}
ty::TyAdt(def, _) if def.is_box() => {
let ptr_ty = cx.tcx.mk_mut_ptr(self.ty.boxed_ty());
- return cx.layout_of(ptr_ty).scalar_pair_element_llvm_type(cx, index);
+ return cx.layout_of(ptr_ty).scalar_pair_element_llvm_type(cx, index, immediate);
}
_ => {}
}
};
let scalar = [a, b][index];
- // Make sure to return the same type `immediate_llvm_type` would,
- // to avoid dealing with two types and the associated conversions.
- // This means that `(bool, bool)` is represented as `{i1, i1}`,
- // both in memory and as an immediate, while `bool` is typically
- // `i8` in memory and only `i1` when immediate. While we need to
- // load/store `bool` as `i8` to avoid crippling LLVM optimizations,
- // `i1` in a LLVM aggregate is valid and mostly equivalent to `i8`.
- if scalar.is_bool() {
+ // Make sure to return the same type `immediate_llvm_type` would when
+ // dealing with an immediate pair. This means that `(bool, bool)` is
+ // effectively represented as `{i8, i8}` in memory and two `i1`s as an
+ // immediate, just like `bool` is typically `i8` in memory and only `i1`
+ // when immediate. We need to load/store `bool` as `i8` to avoid
+ // crippling LLVM optimizations or triggering other LLVM bugs with `i1`.
+ if immediate && scalar.is_bool() {
return Type::i1(cx);
}
test = false
[dependencies]
-ar = "0.3.0"
flate2 = "1.0"
log = "0.4"
#![feature(box_syntax)]
use std::any::Any;
-use std::io::prelude::*;
-use std::io::{self, Cursor};
+use std::io::{self, Write};
use std::fs::File;
use std::path::Path;
-use std::sync::mpsc;
+use std::sync::{mpsc, Arc};
use rustc_data_structures::owning_ref::OwningRef;
use rustc_data_structures::sync::Lrc;
-use ar::{Archive, Builder, Header};
use flate2::Compression;
use flate2::write::DeflateEncoder;
fn print_version(&self) {}
fn diagnostics(&self) -> &[(&'static str, &'static str)] { &[] }
- fn metadata_loader(&self) -> Box<MetadataLoader + Sync>;
+ fn metadata_loader(&self) -> Box<dyn MetadataLoader + Sync>;
fn provide(&self, _providers: &mut Providers);
fn provide_extern(&self, _providers: &mut Providers);
fn codegen_crate<'a, 'tcx>(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- rx: mpsc::Receiver<Box<Any + Send>>
- ) -> Box<Any>;
+ rx: mpsc::Receiver<Box<dyn Any + Send>>
+ ) -> Box<dyn Any>;
- /// This is called on the returned `Box<Any>` from `codegen_backend`
+ /// This is called on the returned `Box<dyn Any>` from `codegen_backend`
///
/// # Panics
///
- /// Panics when the passed `Box<Any>` was not returned by `codegen_backend`.
+ /// Panics when the passed `Box<dyn Any>` was not returned by `codegen_backend`.
fn join_codegen_and_link(
&self,
- ongoing_codegen: Box<Any>,
+ ongoing_codegen: Box<dyn Any>,
sess: &Session,
dep_graph: &DepGraph,
outputs: &OutputFilenames,
) -> Result<(), CompileIncomplete>;
}
-pub struct DummyCodegenBackend;
-
-impl CodegenBackend for DummyCodegenBackend {
- fn metadata_loader(&self) -> Box<MetadataLoader + Sync> {
- box DummyMetadataLoader(())
- }
-
- fn provide(&self, _providers: &mut Providers) {
- bug!("DummyCodegenBackend::provide");
- }
-
- fn provide_extern(&self, _providers: &mut Providers) {
- bug!("DummyCodegenBackend::provide_extern");
- }
-
- fn codegen_crate<'a, 'tcx>(
- &self,
- _tcx: TyCtxt<'a, 'tcx, 'tcx>,
- _rx: mpsc::Receiver<Box<Any + Send>>
- ) -> Box<Any> {
- bug!("DummyCodegenBackend::codegen_backend");
- }
-
- fn join_codegen_and_link(
- &self,
- _ongoing_codegen: Box<Any>,
- _sess: &Session,
- _dep_graph: &DepGraph,
- _outputs: &OutputFilenames,
- ) -> Result<(), CompileIncomplete> {
- bug!("DummyCodegenBackend::join_codegen_and_link");
- }
-}
-
-pub struct DummyMetadataLoader(());
-
-impl MetadataLoader for DummyMetadataLoader {
- fn get_rlib_metadata(
- &self,
- _target: &Target,
- _filename: &Path
- ) -> Result<MetadataRef, String> {
- bug!("DummyMetadataLoader::get_rlib_metadata");
- }
-
- fn get_dylib_metadata(
- &self,
- _target: &Target,
- _filename: &Path
- ) -> Result<MetadataRef, String> {
- bug!("DummyMetadataLoader::get_dylib_metadata");
- }
-}
-
pub struct NoLlvmMetadataLoader;
impl MetadataLoader for NoLlvmMetadataLoader {
fn get_rlib_metadata(&self, _: &Target, filename: &Path) -> Result<MetadataRef, String> {
- let file = File::open(filename)
+ let mut file = File::open(filename)
.map_err(|e| format!("metadata file open err: {:?}", e))?;
- let mut archive = Archive::new(file);
- while let Some(entry_result) = archive.next_entry() {
- let mut entry = entry_result
- .map_err(|e| format!("metadata section read err: {:?}", e))?;
- if entry.header().identifier() == "rust.metadata.bin" {
- let mut buf = Vec::new();
- io::copy(&mut entry, &mut buf).unwrap();
- let buf: OwningRef<Vec<u8>, [u8]> = OwningRef::new(buf).into();
- return Ok(rustc_erase_owner!(buf.map_owner_box()));
- }
- }
-
- Err("Couldn't find metadata section".to_string())
+ let mut buf = Vec::new();
+ io::copy(&mut file, &mut buf).unwrap();
+ let buf: OwningRef<Vec<u8>, [u8]> = OwningRef::new(buf).into();
+ return Ok(rustc_erase_owner!(buf.map_owner_box()));
}
- fn get_dylib_metadata(
- &self,
- _target: &Target,
- _filename: &Path,
- ) -> Result<MetadataRef, String> {
- // FIXME: Support reading dylibs from llvm enabled rustc
- self.get_rlib_metadata(_target, _filename)
+ fn get_dylib_metadata(&self, target: &Target, filename: &Path) -> Result<MetadataRef, String> {
+ self.get_rlib_metadata(target, filename)
}
}
}
impl MetadataOnlyCodegenBackend {
- pub fn new() -> Box<CodegenBackend> {
+ pub fn new() -> Box<dyn CodegenBackend> {
box MetadataOnlyCodegenBackend(())
}
}
}
}
- fn metadata_loader(&self) -> Box<MetadataLoader + Sync> {
+ fn metadata_loader(&self) -> Box<dyn MetadataLoader + Sync> {
box NoLlvmMetadataLoader
}
providers.target_features_whitelist = |_tcx, _cnum| {
Lrc::new(FxHashMap()) // Just a dummy
};
+ providers.is_reachable_non_generic = |_tcx, _defid| true;
+ providers.exported_symbols = |_tcx, _crate| Arc::new(Vec::new());
+ }
+ fn provide_extern(&self, providers: &mut Providers) {
+ providers.is_reachable_non_generic = |_tcx, _defid| true;
}
- fn provide_extern(&self, _providers: &mut Providers) {}
fn codegen_crate<'a, 'tcx>(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- _rx: mpsc::Receiver<Box<Any + Send>>
- ) -> Box<Any> {
+ _rx: mpsc::Receiver<Box<dyn Any + Send>>
+ ) -> Box<dyn Any> {
use rustc_mir::monomorphize::item::MonoItem;
::check_for_rustc_errors_attr(tcx);
collector::MonoItemCollectionMode::Eager
).0.iter()
);
- ::rustc::middle::dependency_format::calculate(tcx);
+ // FIXME: Fix this
+ // ::rustc::middle::dependency_format::calculate(tcx);
let _ = tcx.link_args(LOCAL_CRATE);
let _ = tcx.native_libraries(LOCAL_CRATE);
for mono_item in
fn join_codegen_and_link(
&self,
- ongoing_codegen: Box<Any>,
+ ongoing_codegen: Box<dyn Any>,
sess: &Session,
_dep_graph: &DepGraph,
outputs: &OutputFilenames,
) -> Result<(), CompileIncomplete> {
let ongoing_codegen = ongoing_codegen.downcast::<OngoingCodegen>()
- .expect("Expected MetadataOnlyCodegenBackend's OngoingCodegen, found Box<Any>");
+ .expect("Expected MetadataOnlyCodegenBackend's OngoingCodegen, found Box<dyn Any>");
for &crate_type in sess.opts.crate_types.iter() {
if crate_type != CrateType::CrateTypeRlib && crate_type != CrateType::CrateTypeDylib {
continue;
} else {
&ongoing_codegen.metadata.raw_data
};
- let mut builder = Builder::new(File::create(&output_name).unwrap());
- let header = Header::new("rust.metadata.bin".to_string(), metadata.len() as u64);
- builder.append(&header, Cursor::new(metadata)).unwrap();
+ let mut file = File::create(&output_name).unwrap();
+ file.write_all(metadata).unwrap();
}
sess.abort_if_errors();
#![feature(box_syntax)]
#![feature(custom_attribute)]
#![allow(unused_attributes)]
+#![deny(bare_trait_objects)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![recursion_limit="256"]
-extern crate ar;
extern crate flate2;
#[macro_use]
extern crate log;
extern crate syntax_pos;
#[macro_use] extern crate rustc_data_structures;
-pub extern crate rustc as __rustc;
-
use rustc::ty::TyCtxt;
pub mod link;
//!
//! This API is completely unstable and subject to change.
+#![deny(bare_trait_objects)]
+
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://www.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]
unsafe impl<O, T: ?Sized> Sync for OwningRefMut<O, T>
where O: Sync, for<'a> (&'a mut T): Sync {}
-impl Debug for Erased {
+impl Debug for dyn Erased {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "<Erased>",)
}
pub type RwLockWriteGuardRefMut<'a, T, U = T> = OwningRef<RwLockWriteGuard<'a, T>, U>;
unsafe impl<'a, T: 'a> IntoErased<'a> for Box<T> {
- type Erased = Box<Erased + 'a>;
+ type Erased = Box<dyn Erased + 'a>;
fn into_erased(self) -> Self::Erased {
self
}
}
unsafe impl<'a, T: 'a> IntoErased<'a> for Rc<T> {
- type Erased = Rc<Erased + 'a>;
+ type Erased = Rc<dyn Erased + 'a>;
fn into_erased(self) -> Self::Erased {
self
}
}
unsafe impl<'a, T: 'a> IntoErased<'a> for Arc<T> {
- type Erased = Arc<Erased + 'a>;
+ type Erased = Arc<dyn Erased + 'a>;
fn into_erased(self) -> Self::Erased {
self
}
}
unsafe impl<'a, T: Send + 'a> IntoErasedSend<'a> for Box<T> {
- type Erased = Box<Erased + Send + 'a>;
+ type Erased = Box<dyn Erased + Send + 'a>;
fn into_erased_send(self) -> Self::Erased {
self
}
}
unsafe impl<'a, T: Send + 'a> IntoErasedSendSync<'a> for Box<T> {
- type Erased = Box<Erased + Sync + Send + 'a>;
+ type Erased = Box<dyn Erased + Sync + Send + 'a>;
fn into_erased_send_sync(self) -> Self::Erased {
- let result: Box<Erased + Send + 'a> = self;
+ let result: Box<dyn Erased + Send + 'a> = self;
// This is safe since Erased can always implement Sync
// Only the destructor is available and it takes &mut self
unsafe {
}
unsafe impl<'a, T: Send + Sync + 'a> IntoErasedSendSync<'a> for Arc<T> {
- type Erased = Arc<Erased + Send + Sync + 'a>;
+ type Erased = Arc<dyn Erased + Send + Sync + 'a>;
fn into_erased_send_sync(self) -> Self::Erased {
self
}
}
/// Typedef of a owning reference that uses an erased `Box` as the owner.
-pub type ErasedBoxRef<U> = OwningRef<Box<Erased>, U>;
+pub type ErasedBoxRef<U> = OwningRef<Box<dyn Erased>, U>;
/// Typedef of a owning reference that uses an erased `Rc` as the owner.
-pub type ErasedRcRef<U> = OwningRef<Rc<Erased>, U>;
+pub type ErasedRcRef<U> = OwningRef<Rc<dyn Erased>, U>;
/// Typedef of a owning reference that uses an erased `Arc` as the owner.
-pub type ErasedArcRef<U> = OwningRef<Arc<Erased>, U>;
+pub type ErasedArcRef<U> = OwningRef<Arc<dyn Erased>, U>;
/// Typedef of a mutable owning reference that uses an erased `Box` as the owner.
-pub type ErasedBoxRefMut<U> = OwningRefMut<Box<Erased>, U>;
+pub type ErasedBoxRefMut<U> = OwningRefMut<Box<dyn Erased>, U>;
#[cfg(test)]
mod tests {
let c: OwningRef<Rc<Vec<u8>>, [u8]> = unsafe {a.map_owner(Rc::new)};
let d: OwningRef<Rc<Box<[u8]>>, [u8]> = unsafe {b.map_owner(Rc::new)};
- let e: OwningRef<Rc<Erased>, [u8]> = c.erase_owner();
- let f: OwningRef<Rc<Erased>, [u8]> = d.erase_owner();
+ let e: OwningRef<Rc<dyn Erased>, [u8]> = c.erase_owner();
+ let f: OwningRef<Rc<dyn Erased>, [u8]> = d.erase_owner();
let _g = e.clone();
let _h = f.clone();
let c: OwningRef<Box<Vec<u8>>, [u8]> = a.map_owner_box();
let d: OwningRef<Box<Box<[u8]>>, [u8]> = b.map_owner_box();
- let _e: OwningRef<Box<Erased>, [u8]> = c.erase_owner();
- let _f: OwningRef<Box<Erased>, [u8]> = d.erase_owner();
+ let _e: OwningRef<Box<dyn Erased>, [u8]> = c.erase_owner();
+ let _f: OwningRef<Box<dyn Erased>, [u8]> = d.erase_owner();
}
#[test]
use std::any::Any;
let x = Box::new(123_i32);
- let y: Box<Any> = x;
+ let y: Box<dyn Any> = x;
OwningRef::new(y).try_map(|x| x.downcast_ref::<i32>().ok_or(())).is_ok();
}
use std::any::Any;
let x = Box::new(123_i32);
- let y: Box<Any> = x;
+ let y: Box<dyn Any> = x;
OwningRef::new(y).try_map(|x| x.downcast_ref::<i32>().ok_or(())).is_err();
}
let c: OwningRefMut<Box<Vec<u8>>, [u8]> = unsafe {a.map_owner(Box::new)};
let d: OwningRefMut<Box<Box<[u8]>>, [u8]> = unsafe {b.map_owner(Box::new)};
- let _e: OwningRefMut<Box<Erased>, [u8]> = c.erase_owner();
- let _f: OwningRefMut<Box<Erased>, [u8]> = d.erase_owner();
+ let _e: OwningRefMut<Box<dyn Erased>, [u8]> = c.erase_owner();
+ let _f: OwningRefMut<Box<dyn Erased>, [u8]> = d.erase_owner();
}
#[test]
let c: OwningRefMut<Box<Vec<u8>>, [u8]> = a.map_owner_box();
let d: OwningRefMut<Box<Box<[u8]>>, [u8]> = b.map_owner_box();
- let _e: OwningRefMut<Box<Erased>, [u8]> = c.erase_owner();
- let _f: OwningRefMut<Box<Erased>, [u8]> = d.erase_owner();
+ let _e: OwningRefMut<Box<dyn Erased>, [u8]> = c.erase_owner();
+ let _f: OwningRefMut<Box<dyn Erased>, [u8]> = d.erase_owner();
}
#[test]
use std::any::Any;
let x = Box::new(123_i32);
- let y: Box<Any> = x;
+ let y: Box<dyn Any> = x;
OwningRefMut::new(y).try_map_mut(|x| x.downcast_mut::<i32>().ok_or(())).is_ok();
}
use std::any::Any;
let x = Box::new(123_i32);
- let y: Box<Any> = x;
+ let y: Box<dyn Any> = x;
OwningRefMut::new(y).try_map_mut(|x| x.downcast_mut::<i32>().ok_or(())).is_err();
}
use std::any::Any;
let x = Box::new(123_i32);
- let y: Box<Any> = x;
+ let y: Box<dyn Any> = x;
OwningRefMut::new(y).try_map(|x| x.downcast_ref::<i32>().ok_or(())).is_ok();
}
use std::any::Any;
let x = Box::new(123_i32);
- let y: Box<Any> = x;
+ let y: Box<dyn Any> = x;
OwningRefMut::new(y).try_map(|x| x.downcast_ref::<i32>().ok_or(())).is_err();
}
t.into_iter()
}
- pub type MetadataRef = OwningRef<Box<Erased>, [u8]>;
+ pub type MetadataRef = OwningRef<Box<dyn Erased>, [u8]>;
pub use std::rc::Rc as Lrc;
pub use std::rc::Weak as Weak;
t.into_par_iter()
}
- pub type MetadataRef = OwningRef<Box<Erased + Send + Sync>, [u8]>;
+ pub type MetadataRef = OwningRef<Box<dyn Erased + Send + Sync>, [u8]>;
/// This makes locks panic if they are already held.
/// It is only useful when you are running in a single thread
syntax = { path = "../libsyntax" }
syntax_ext = { path = "../libsyntax_ext" }
syntax_pos = { path = "../libsyntax_pos" }
-
-ar = "0.3.0"
middle::liveness::check_crate(tcx)
});
- time(sess, "borrow checking", || borrowck::check_crate(tcx));
+ time(sess, "borrow checking", || {
+ if tcx.use_ast_borrowck() {
+ borrowck::check_crate(tcx);
+ }
+ });
time(sess,
"MIR borrow checking",
// Temporarily have stack size set to 16MB to deal with nom-using crates failing
const STACK_SIZE: usize = 16 * 1024 * 1024; // 16MB
- #[cfg(unix)]
+ #[cfg(all(unix,not(target_os = "haiku")))]
let spawn_thread = unsafe {
// Fetch the current resource limits
let mut rlim = libc::rlimit {
#[cfg(windows)]
let spawn_thread = false;
+ #[cfg(target_os = "haiku")]
+ let spawn_thread = unsafe {
+ // Haiku does not have setrlimit implemented for the stack size.
+ // By default it does have the 16 MB stack limit, but we check this in
+ // case the minimum STACK_SIZE changes or Haiku's defaults change.
+ let mut rlim = libc::rlimit {
+ rlim_cur: 0,
+ rlim_max: 0,
+ };
+ if libc::getrlimit(libc::RLIMIT_STACK, &mut rlim) != 0 {
+ let err = io::Error::last_os_error();
+ error!("in_rustc_thread: error calling getrlimit: {}", err);
+ true
+ } else if rlim.rlim_cur >= STACK_SIZE {
+ false
+ } else {
+ true
+ }
+ };
+
#[cfg(not(any(windows,unix)))]
let spawn_thread = true;
}
declare_lint! {
- MISSING_DOCS,
+ pub MISSING_DOCS,
Allow,
"detects missing documentation for public members"
}
use lint::FutureIncompatibleInfo;
mod bad_style;
-mod builtin;
+pub mod builtin;
mod types;
mod unused;
reference: "issue #50589 <https://github.com/rust-lang/rust/issues/50589>",
edition: None,
},
+ FutureIncompatibleInfo {
+ id: LintId::of(PROC_MACRO_DERIVE_RESOLUTION_FALLBACK),
+ reference: "issue #50504 <https://github.com/rust-lang/rust/issues/50504>",
+ edition: None,
+ },
]);
// Register renamed and removed lints
Ok(f) => f,
Err(err) => self.sess.span_fatal(span, &err),
};
- mem::transmute::<*mut u8, fn(&mut Registry)>(sym)
+ mem::transmute::<*mut u8, fn(&mut dyn Registry)>(sym)
};
struct MyRegistrar {
fn inject_dependency_if(&self,
krate: CrateNum,
what: &str,
- needs_dep: &Fn(&cstore::CrateMetadata) -> bool) {
+ needs_dep: &dyn Fn(&cstore::CrateMetadata) -> bool) {
// don't perform this validation if the session has errors, as one of
// those errors may indicate a circular dependency which could cause
// this to stack overflow.
metas: RwLock<IndexVec<CrateNum, Option<Lrc<CrateMetadata>>>>,
/// Map from NodeId's of local extern crate statements to crate numbers
extern_mod_crate_map: Lock<NodeMap<CrateNum>>,
- pub metadata_loader: Box<MetadataLoader + Sync>,
+ pub metadata_loader: Box<dyn MetadataLoader + Sync>,
}
impl CStore {
- pub fn new(metadata_loader: Box<MetadataLoader + Sync>) -> CStore {
+ pub fn new(metadata_loader: Box<dyn MetadataLoader + Sync>) -> CStore {
CStore {
// We add an empty entry for LOCAL_CRATE (which maps to zero) in
// order to make array indices in `metas` match with the
Arc::new(cdata.exported_symbols(tcx))
}
-
- wasm_custom_sections => { Lrc::new(cdata.wasm_custom_sections()) }
}
pub fn provide<'tcx>(providers: &mut Providers<'tcx>) {
}
impl CrateStore for cstore::CStore {
- fn crate_data_as_rc_any(&self, krate: CrateNum) -> Lrc<Any> {
+ fn crate_data_as_rc_any(&self, krate: CrateNum) -> Lrc<dyn Any> {
self.get_crate_data(krate)
}
- fn metadata_loader(&self) -> &MetadataLoader {
+ fn metadata_loader(&self) -> &dyn MetadataLoader {
&*self.metadata_loader
}
}
pub fn list_crate_metadata(&self,
- out: &mut io::Write) -> io::Result<()> {
+ out: &mut dyn io::Write) -> io::Result<()> {
write!(out, "=External Dependencies=\n")?;
let root = self.get_root();
for (i, dep) in root.crate_deps
}
}
- pub fn wasm_custom_sections(&self) -> Vec<DefId> {
- let sections = self.root
- .wasm_custom_sections
- .decode(self)
- .map(|def_index| self.local_def_id(def_index))
- .collect::<Vec<_>>();
- info!("loaded wasm sections {:?}", sections);
- return sections
- }
-
pub fn get_macro(&self, id: DefIndex) -> (InternedString, MacroDef) {
let entry = self.entry(id);
match entry.kind {
&exported_symbols);
let exported_symbols_bytes = self.position() - i;
- // encode wasm custom sections
- let wasm_custom_sections = self.tcx.wasm_custom_sections(LOCAL_CRATE);
- let wasm_custom_sections = self.tracked(
- IsolatedEncoder::encode_wasm_custom_sections,
- &wasm_custom_sections);
-
let tcx = self.tcx;
// Encode the items.
def_path_table,
impls,
exported_symbols,
- wasm_custom_sections,
interpret_alloc_index,
index,
});
}
}
- fn encode_wasm_custom_sections(&mut self, statics: &[DefId]) -> LazySeq<DefIndex> {
- info!("encoding custom wasm section constants {:?}", statics);
- self.lazy_seq(statics.iter().map(|id| id.index))
- }
-
fn encode_dylib_dependency_formats(&mut self, _: ()) -> LazySeq<Option<LinkagePreference>> {
match self.tcx.sess.dependency_formats.borrow().get(&config::CrateTypeDylib) {
Some(arr) => {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![deny(bare_trait_objects)]
+
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]
pub rejected_via_filename: Vec<CrateMismatch>,
pub should_match_name: bool,
pub is_proc_macro: Option<bool>,
- pub metadata_loader: &'a MetadataLoader,
+ pub metadata_loader: &'a dyn MetadataLoader,
}
pub struct CratePaths {
fn get_metadata_section(target: &Target,
flavor: CrateFlavor,
filename: &Path,
- loader: &MetadataLoader)
+ loader: &dyn MetadataLoader)
-> Result<MetadataBlob, String> {
let start = Instant::now();
let ret = get_metadata_section_imp(target, flavor, filename, loader);
fn get_metadata_section_imp(target: &Target,
flavor: CrateFlavor,
filename: &Path,
- loader: &MetadataLoader)
+ loader: &dyn MetadataLoader)
-> Result<MetadataBlob, String> {
if !filename.exists() {
return Err(format!("no such file: '{}'", filename.display()));
// A diagnostic function for dumping crate metadata to an output stream
pub fn list_file_metadata(target: &Target,
path: &Path,
- loader: &MetadataLoader,
- out: &mut io::Write)
+ loader: &dyn MetadataLoader,
+ out: &mut dyn io::Write)
-> io::Result<()> {
let filename = path.file_name().unwrap().to_str().unwrap();
let flavor = if filename.ends_with(".rlib") {
pub def_path_table: Lazy<hir::map::definitions::DefPathTable>,
pub impls: LazySeq<TraitImpls>,
pub exported_symbols: EncodedExportedSymbols,
- pub wasm_custom_sections: LazySeq<DefIndex>,
pub interpret_alloc_index: LazySeq<u32>,
pub index: LazySeq<index::Index>,
}
}
-/// Every two-phase borrow has *exactly one* use (or else it is not a
-/// proper two-phase borrow under our current definition). However, not
-/// all uses are actually ones that activate the reservation.. In
-/// particular, a shared borrow of a `&mut` does not activate the
-/// reservation.
+/// Location where a two phase borrow is activated, if a borrow
+/// is in fact a two phase borrow.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
-crate enum TwoPhaseUse {
- MutActivate,
- SharedUse,
+crate enum TwoPhaseActivation {
+ NotTwoPhase,
+ NotActivated,
+ ActivatedAt(Location),
}
#[derive(Debug)]
/// Location where the borrow reservation starts.
/// In many cases, this will be equal to the activation location but not always.
crate reserve_location: Location,
- /// Location where the borrow is activated. None if this is not a
- /// 2-phase borrow.
- crate activation_location: Option<(TwoPhaseUse, Location)>,
+ /// Location where the borrow is activated.
+ crate activation_location: TwoPhaseActivation,
/// What kind of borrow this is
crate kind: mir::BorrowKind,
/// The region for which this borrow is live
visitor.visit_basic_block_data(block, block_data);
}
- // Double check: We should have found an activation for every pending
- // activation.
- assert_eq!(
- visitor
- .pending_activations
- .iter()
- .find(|&(_local, &borrow_index)| visitor.idx_vec[borrow_index]
- .activation_location
- .is_none()),
- None,
- "never found an activation for this borrow!",
- );
-
BorrowSet {
borrows: visitor.idx_vec,
location_map: visitor.location_map,
kind,
region,
reserve_location: location,
- activation_location: None,
+ activation_location: TwoPhaseActivation::NotTwoPhase,
borrowed_place: borrowed_place.clone(),
assigned_place: assigned_place.clone(),
};
return;
}
- if let Some(other_activation) = borrow_data.activation_location {
+ if let TwoPhaseActivation::ActivatedAt(other_location) =
+ borrow_data.activation_location {
span_bug!(
self.mir.source_info(location).span,
"found two uses for 2-phase borrow temporary {:?}: \
{:?} and {:?}",
temp,
location,
- other_activation,
+ other_location,
);
}
// Otherwise, this is the unique later use
// that we expect.
-
- let two_phase_use;
-
- match context {
+ borrow_data.activation_location = match context {
// The use of TMP in a shared borrow does not
// count as an actual activation.
PlaceContext::Borrow { kind: mir::BorrowKind::Shared, .. } => {
- two_phase_use = TwoPhaseUse::SharedUse;
+ TwoPhaseActivation::NotActivated
}
_ => {
- two_phase_use = TwoPhaseUse::MutActivate;
+ // Double check: This borrow is indeed a two-phase borrow (that is,
+ // we are 'transitioning' from `NotActivated` to `ActivatedAt`) and
+ // we've not found any other activations (checked above).
+ assert_eq!(
+ borrow_data.activation_location,
+ TwoPhaseActivation::NotActivated,
+ "never found an activation for this borrow!",
+ );
+
self.activation_map
.entry(location)
.or_insert(Vec::new())
.push(borrow_index);
+ TwoPhaseActivation::ActivatedAt(location)
}
- }
-
- borrow_data.activation_location = Some((two_phase_use, location));
+ };
}
None => {}
);
};
+ // Consider the borrow not activated to start. When we find an activation, we'll update
+ // this field.
+ let borrow_data = &mut self.idx_vec[borrow_index];
+ borrow_data.activation_location = TwoPhaseActivation::NotActivated;
+
// Insert `temp` into the list of pending activations. From
// now on, we'll be on the lookout for a use of it. Note that
// we are guaranteed that this use will come after the
let mut return_early;
// Return early if we are not supposed to use MIR borrow checker for this function.
- return_early = !tcx.has_attr(def_id, "rustc_mir_borrowck") && !tcx.use_mir_borrowck();
+ return_early = !tcx.has_attr(def_id, "rustc_mir") && !tcx.use_mir_borrowck();
if tcx.is_struct_constructor(def_id) {
// We are not borrow checking the automatically generated struct constructors
input_mir: &Mir<'gcx>,
def_id: DefId,
) -> BorrowCheckResult<'gcx> {
+ debug!("do_mir_borrowck(def_id = {:?})", def_id);
+
let tcx = infcx.tcx;
let attributes = tcx.get_attrs(def_id);
let param_env = tcx.param_env(def_id);
}
}
- BorrowCheckResult {
+ let result = BorrowCheckResult {
closure_requirements: opt_closure_req,
used_mut_upvars: mbcx.used_mut_upvars,
- }
+ };
+
+ debug!("do_mir_borrowck: result = {:#?}", result);
+
+ result
}
#[allow(dead_code)]
// highlighted text will always be `&<expr>` and
// thus can transform to `&mut` by slicing off
// first ASCII character and prepending "&mut ".
- let borrowed_expr = src[1..].to_string();
- return (assignment_rhs_span, format!("&mut {}", borrowed_expr));
+ if src.starts_with('&') {
+ let borrowed_expr = src[1..].to_string();
+ return (assignment_rhs_span, format!("&mut {}", borrowed_expr));
+ }
}
}
+++ /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.
-
-use std::fmt;
-use borrow_check::nll::region_infer::{ConstraintIndex, RegionInferenceContext};
-use borrow_check::nll::region_infer::values::ToElementIndex;
-use borrow_check::nll::type_check::Locations;
-use rustc::hir::def_id::DefId;
-use rustc::infer::InferCtxt;
-use rustc::infer::error_reporting::nice_region_error::NiceRegionError;
-use rustc::mir::{self, Location, Mir, Place, StatementKind, TerminatorKind, Rvalue};
-use rustc::ty::RegionVid;
-use rustc_data_structures::fx::{FxHashMap, FxHashSet};
-use rustc_data_structures::indexed_vec::IndexVec;
-use syntax_pos::Span;
-
-/// Constraints that are considered interesting can be categorized to
-/// determine why they are interesting. Order of variants indicates
-/// sort order of the category, thereby influencing diagnostic output.
-#[derive(Debug, Eq, PartialEq, PartialOrd, Ord)]
-enum ConstraintCategory {
- Cast,
- Assignment,
- Return,
- CallArgument,
- Other,
- Boring,
-}
-
-impl fmt::Display for ConstraintCategory {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- match self {
- ConstraintCategory::Assignment => write!(f, "assignment"),
- ConstraintCategory::Return => write!(f, "return"),
- ConstraintCategory::Cast => write!(f, "cast"),
- ConstraintCategory::CallArgument => write!(f, "argument"),
- _ => write!(f, "free region"),
- }
- }
-}
-
-impl<'tcx> RegionInferenceContext<'tcx> {
- /// When reporting an error, it is useful to be able to determine which constraints influenced
- /// the region being reported as an error. This function finds all of the paths from the
- /// constraint.
- fn find_constraint_paths_from_region(
- &self,
- r0: RegionVid
- ) -> Vec<Vec<ConstraintIndex>> {
- let constraints = self.constraints.clone();
-
- // Mapping of regions to the previous region and constraint index that led to it.
- let mut previous = FxHashMap();
- // Regions yet to be visited.
- let mut next = vec! [ r0 ];
- // Regions that have been visited.
- let mut visited = FxHashSet();
- // Ends of paths.
- let mut end_regions = FxHashSet();
-
- // When we've still got points to visit...
- while let Some(current) = next.pop() {
- // ...take the next point...
- debug!("find_constraint_paths_from_region: current={:?} visited={:?} next={:?}",
- current, visited, next);
- // ...but make sure not to visit this point again...
- visited.insert(current);
-
- // ...find the edges containing it...
- let mut upcoming = Vec::new();
- for (index, constraint) in constraints.iter_enumerated() {
- if constraint.sub == current {
- // ...add the regions that join us with to the path we've taken...
- debug!("find_constraint_paths_from_region: index={:?} constraint={:?}",
- index, constraint);
- let next_region = constraint.sup.clone();
-
- // ...unless we've visited it since this was added...
- if visited.contains(&next_region) {
- debug!("find_constraint_paths_from_region: skipping as visited");
- continue;
- }
-
- previous.insert(next_region, (index, Some(current)));
- upcoming.push(next_region);
- }
- }
-
- if upcoming.is_empty() {
- // If we didn't find any edges then this is the end of a path...
- debug!("find_constraint_paths_from_region: new end region current={:?}", current);
- end_regions.insert(current);
- } else {
- // ...but, if we did find edges, then add these to the regions yet to visit.
- debug!("find_constraint_paths_from_region: extend next upcoming={:?}", upcoming);
- next.extend(upcoming);
- }
-
- }
-
- // Now we've visited each point, compute the final paths.
- let mut paths: Vec<Vec<ConstraintIndex>> = Vec::new();
- debug!("find_constraint_paths_from_region: end_regions={:?}", end_regions);
- for end_region in end_regions {
- debug!("find_constraint_paths_from_region: end_region={:?}", end_region);
-
- // Get the constraint and region that led to this end point.
- // We can unwrap as we know if end_point was in the vector that it
- // must also be in our previous map.
- let (mut index, mut region) = previous.get(&end_region).unwrap();
- debug!("find_constraint_paths_from_region: index={:?} region={:?}", index, region);
-
- // Keep track of the indices.
- let mut path: Vec<ConstraintIndex> = vec![index];
-
- while region.is_some() && region != Some(r0) {
- let p = previous.get(®ion.unwrap()).unwrap();
- index = p.0;
- region = p.1;
-
- debug!("find_constraint_paths_from_region: index={:?} region={:?}", index, region);
- path.push(index);
- }
-
- // Add to our paths.
- paths.push(path);
- }
-
- debug!("find_constraint_paths_from_region: paths={:?}", paths);
- paths
- }
-
- /// This function will return true if a constraint is interesting and false if a constraint
- /// is not. It is useful in filtering constraint paths to only interesting points.
- fn constraint_is_interesting(&self, index: &ConstraintIndex) -> bool {
- self.constraints.get(*index).filter(|constraint| {
- debug!("constraint_is_interesting: locations={:?} constraint={:?}",
- constraint.locations, constraint);
- if let Locations::Interesting(_) = constraint.locations { true } else { false }
- }).is_some()
- }
-
- /// This function classifies a constraint from a location.
- fn classify_constraint(&self, index: &ConstraintIndex,
- mir: &Mir<'tcx>) -> Option<(ConstraintCategory, Span)> {
- let constraint = self.constraints.get(*index)?;
- let span = constraint.locations.span(mir);
- let location = constraint.locations.from_location()?;
-
- if !self.constraint_is_interesting(index) {
- return Some((ConstraintCategory::Boring, span));
- }
-
- let data = &mir[location.block];
- let category = if location.statement_index == data.statements.len() {
- if let Some(ref terminator) = data.terminator {
- match terminator.kind {
- TerminatorKind::DropAndReplace { .. } => ConstraintCategory::Assignment,
- TerminatorKind::Call { .. } => ConstraintCategory::CallArgument,
- _ => ConstraintCategory::Other,
- }
- } else {
- ConstraintCategory::Other
- }
- } else {
- let statement = &data.statements[location.statement_index];
- match statement.kind {
- StatementKind::Assign(ref place, ref rvalue) => {
- if *place == Place::Local(mir::RETURN_PLACE) {
- ConstraintCategory::Return
- } else {
- match rvalue {
- Rvalue::Cast(..) => ConstraintCategory::Cast,
- Rvalue::Use(..) => ConstraintCategory::Assignment,
- _ => ConstraintCategory::Other,
- }
- }
- },
- _ => ConstraintCategory::Other,
- }
- };
-
- Some((category, span))
- }
-
- /// Report an error because the universal region `fr` was required to outlive
- /// `outlived_fr` but it is not known to do so. For example:
- ///
- /// ```
- /// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
- /// ```
- ///
- /// Here we would be invoked with `fr = 'a` and `outlived_fr = `'b`.
- pub(super) fn report_error(
- &self,
- mir: &Mir<'tcx>,
- infcx: &InferCtxt<'_, '_, 'tcx>,
- mir_def_id: DefId,
- fr: RegionVid,
- outlived_fr: RegionVid,
- blame_span: Span,
- ) {
- // Obviously uncool error reporting.
-
- let fr_name = self.to_error_region(fr);
- let outlived_fr_name = self.to_error_region(outlived_fr);
-
- if let (Some(f), Some(o)) = (fr_name, outlived_fr_name) {
- let tables = infcx.tcx.typeck_tables_of(mir_def_id);
- let nice = NiceRegionError::new_from_span(infcx.tcx, blame_span, o, f, Some(tables));
- if let Some(_error_reported) = nice.try_report() {
- return;
- }
- }
-
- let fr_string = match fr_name {
- Some(r) => format!("free region `{}`", r),
- None => format!("free region `{:?}`", fr),
- };
-
- let outlived_fr_string = match outlived_fr_name {
- Some(r) => format!("free region `{}`", r),
- None => format!("free region `{:?}`", outlived_fr),
- };
-
- let constraints = self.find_constraint_paths_from_region(fr.clone());
- let path = constraints.iter().min_by_key(|p| p.len()).unwrap();
- debug!("report_error: shortest_path={:?}", path);
-
- let mut categorized_path = path.iter().filter_map(|index| {
- self.classify_constraint(index, mir)
- }).collect::<Vec<(ConstraintCategory, Span)>>();
- debug!("report_error: categorized_path={:?}", categorized_path);
-
- categorized_path.sort_by(|p0, p1| p0.0.cmp(&p1.0));
- debug!("report_error: sorted_path={:?}", categorized_path);
-
- if let Some((category, span)) = &categorized_path.first() {
- let mut diag = infcx.tcx.sess.struct_span_err(
- *span, &format!("{} requires that data must outlive {}",
- category, outlived_fr_string),
- );
-
- diag.emit();
- } else {
- let mut diag = infcx.tcx.sess.struct_span_err(
- blame_span,
- &format!("{} does not outlive {}", fr_string, outlived_fr_string,),
- );
-
- diag.emit();
- }
- }
-
- // Find some constraint `X: Y` where:
- // - `fr1: X` transitively
- // - and `Y` is live at `elem`
- crate fn find_constraint(&self, fr1: RegionVid, elem: Location) -> RegionVid {
- let index = self.blame_constraint(fr1, elem);
- self.constraints[index].sub
- }
-
- /// Tries to finds a good span to blame for the fact that `fr1`
- /// contains `fr2`.
- pub(super) fn blame_constraint(&self, fr1: RegionVid,
- elem: impl ToElementIndex) -> ConstraintIndex {
- // Find everything that influenced final value of `fr`.
- let influenced_fr1 = self.dependencies(fr1);
-
- // Try to find some outlives constraint `'X: fr2` where `'X`
- // influenced `fr1`. Blame that.
- //
- // NB, this is a pretty bad choice most of the time. In
- // particular, the connection between `'X` and `fr1` may not
- // be obvious to the user -- not to mention the naive notion
- // of dependencies, which doesn't account for the locations of
- // contraints at all. But it will do for now.
- let relevant_constraint = self.constraints
- .iter_enumerated()
- .filter_map(|(i, constraint)| {
- if !self.liveness_constraints.contains(constraint.sub, elem) {
- None
- } else {
- influenced_fr1[constraint.sup]
- .map(|distance| (distance, i))
- }
- })
- .min() // constraining fr1 with fewer hops *ought* to be more obvious
- .map(|(_dist, i)| i);
-
- relevant_constraint.unwrap_or_else(|| {
- bug!(
- "could not find any constraint to blame for {:?}: {:?}",
- fr1,
- elem,
- );
- })
- }
-
- /// Finds all regions whose values `'a` may depend on in some way.
- /// For each region, returns either `None` (does not influence
- /// `'a`) or `Some(d)` which indicates that it influences `'a`
- /// with distinct `d` (minimum number of edges that must be
- /// traversed).
- ///
- /// Used during error reporting, extremely naive and inefficient.
- fn dependencies(&self, r0: RegionVid) -> IndexVec<RegionVid, Option<usize>> {
- let mut result_set = IndexVec::from_elem(None, &self.definitions);
- let mut changed = true;
- result_set[r0] = Some(0); // distance 0 from `r0`
-
- while changed {
- changed = false;
- for constraint in &*self.constraints {
- if let Some(n) = result_set[constraint.sup] {
- let m = n + 1;
- if result_set[constraint.sub]
- .map(|distance| m < distance)
- .unwrap_or(true)
- {
- result_set[constraint.sub] = Some(m);
- changed = true;
- }
- }
- }
- }
-
- result_set
- }
-}
--- /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.
+
+use borrow_check::nll::region_infer::values::ToElementIndex;
+use borrow_check::nll::region_infer::{ConstraintIndex, RegionInferenceContext};
+use borrow_check::nll::type_check::Locations;
+use rustc::hir::def_id::DefId;
+use rustc::infer::error_reporting::nice_region_error::NiceRegionError;
+use rustc::infer::InferCtxt;
+use rustc::mir::{self, Location, Mir, Place, Rvalue, StatementKind, TerminatorKind};
+use rustc::ty::RegionVid;
+use rustc_data_structures::fx::FxHashSet;
+use rustc_data_structures::indexed_vec::IndexVec;
+use std::fmt;
+use syntax_pos::Span;
+
+mod region_name;
+
+/// Constraints that are considered interesting can be categorized to
+/// determine why they are interesting. Order of variants indicates
+/// sort order of the category, thereby influencing diagnostic output.
+#[derive(Debug, Eq, PartialEq, PartialOrd, Ord)]
+enum ConstraintCategory {
+ Cast,
+ Assignment,
+ Return,
+ CallArgument,
+ Other,
+ Boring,
+}
+
+impl fmt::Display for ConstraintCategory {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ match self {
+ ConstraintCategory::Assignment => write!(f, "assignment"),
+ ConstraintCategory::Return => write!(f, "return"),
+ ConstraintCategory::Cast => write!(f, "cast"),
+ ConstraintCategory::CallArgument => write!(f, "argument"),
+ _ => write!(f, "free region"),
+ }
+ }
+}
+
+impl<'tcx> RegionInferenceContext<'tcx> {
+ /// Walks the graph of constraints (where `'a: 'b` is considered
+ /// an edge `'b -> 'a`) to find all paths from `from_region` to
+ /// `to_region`. The paths are accumulated into the vector
+ /// `results`. The paths are stored as a series of
+ /// `ConstraintIndex` values -- in other words, a list of *edges*.
+ ///
+ /// # Parameters
+ ///
+ /// - `from_region`
+ /// When reporting an error, it is useful to be able to determine
+ /// which constraints influenced the region being reported as an
+ /// error. This function finds all of the paths from the
+ /// constraint.
+ fn find_constraint_paths_between_regions(
+ &self,
+ from_region: RegionVid,
+ target_test: impl Fn(RegionVid) -> bool,
+ ) -> Vec<Vec<ConstraintIndex>> {
+ let mut results = vec![];
+ self.find_constraint_paths_between_regions_helper(
+ from_region,
+ from_region,
+ &target_test,
+ &mut FxHashSet::default(),
+ &mut vec![],
+ &mut results,
+ );
+ results
+ }
+
+ /// Helper for `find_constraint_paths_between_regions`.
+ fn find_constraint_paths_between_regions_helper(
+ &self,
+ from_region: RegionVid,
+ current_region: RegionVid,
+ target_test: &impl Fn(RegionVid) -> bool,
+ visited: &mut FxHashSet<RegionVid>,
+ stack: &mut Vec<ConstraintIndex>,
+ results: &mut Vec<Vec<ConstraintIndex>>,
+ ) {
+ let dependency_map = self.dependency_map.as_ref().unwrap();
+
+ // Check if we already visited this region.
+ if !visited.insert(current_region) {
+ return;
+ }
+
+ // Check if we reached the region we were looking for.
+ if target_test(current_region) {
+ if !stack.is_empty() {
+ assert_eq!(self.constraints[stack[0]].sub, from_region);
+ results.push(stack.clone());
+ }
+ return;
+ }
+
+ self.constraints
+ .each_affected_by_dirty(dependency_map[current_region], |constraint| {
+ assert_eq!(self.constraints[constraint].sub, current_region);
+ stack.push(constraint);
+ self.find_constraint_paths_between_regions_helper(
+ from_region,
+ self.constraints[constraint].sup,
+ target_test,
+ visited,
+ stack,
+ results,
+ );
+ stack.pop();
+ });
+ }
+
+ /// This function will return true if a constraint is interesting and false if a constraint
+ /// is not. It is useful in filtering constraint paths to only interesting points.
+ fn constraint_is_interesting(&self, index: ConstraintIndex) -> bool {
+ let constraint = self.constraints[index];
+ debug!(
+ "constraint_is_interesting: locations={:?} constraint={:?}",
+ constraint.locations, constraint
+ );
+ if let Locations::Interesting(_) = constraint.locations {
+ true
+ } else {
+ false
+ }
+ }
+
+ /// This function classifies a constraint from a location.
+ fn classify_constraint(
+ &self,
+ index: ConstraintIndex,
+ mir: &Mir<'tcx>,
+ ) -> (ConstraintCategory, Span) {
+ let constraint = self.constraints[index];
+ let span = constraint.locations.span(mir);
+ let location = constraint.locations.from_location().unwrap_or(Location::START);
+
+ if !self.constraint_is_interesting(index) {
+ return (ConstraintCategory::Boring, span);
+ }
+
+ let data = &mir[location.block];
+ let category = if location.statement_index == data.statements.len() {
+ if let Some(ref terminator) = data.terminator {
+ match terminator.kind {
+ TerminatorKind::DropAndReplace { .. } => ConstraintCategory::Assignment,
+ TerminatorKind::Call { .. } => ConstraintCategory::CallArgument,
+ _ => ConstraintCategory::Other,
+ }
+ } else {
+ ConstraintCategory::Other
+ }
+ } else {
+ let statement = &data.statements[location.statement_index];
+ match statement.kind {
+ StatementKind::Assign(ref place, ref rvalue) => {
+ if *place == Place::Local(mir::RETURN_PLACE) {
+ ConstraintCategory::Return
+ } else {
+ match rvalue {
+ Rvalue::Cast(..) => ConstraintCategory::Cast,
+ Rvalue::Use(..) => ConstraintCategory::Assignment,
+ _ => ConstraintCategory::Other,
+ }
+ }
+ }
+ _ => ConstraintCategory::Other,
+ }
+ };
+
+ (category, span)
+ }
+
+ /// Report an error because the universal region `fr` was required to outlive
+ /// `outlived_fr` but it is not known to do so. For example:
+ ///
+ /// ```
+ /// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
+ /// ```
+ ///
+ /// Here we would be invoked with `fr = 'a` and `outlived_fr = `'b`.
+ pub(super) fn report_error(
+ &self,
+ mir: &Mir<'tcx>,
+ infcx: &InferCtxt<'_, '_, 'tcx>,
+ mir_def_id: DefId,
+ fr: RegionVid,
+ outlived_fr: RegionVid,
+ blame_span: Span,
+ ) {
+ debug!("report_error(fr={:?}, outlived_fr={:?})", fr, outlived_fr);
+
+ 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, blame_span, o, f, Some(tables));
+ if let Some(_error_reported) = nice.try_report() {
+ return;
+ }
+ }
+
+ // Find all paths
+ let constraint_paths = self.find_constraint_paths_between_regions(outlived_fr, |r| r == fr);
+ debug!("report_error: constraint_paths={:#?}", constraint_paths);
+
+ // Find the shortest such path.
+ let path = constraint_paths.iter().min_by_key(|p| p.len()).unwrap();
+ debug!("report_error: shortest_path={:?}", path);
+
+ // Classify each of the constraints along the path.
+ let mut categorized_path: Vec<(ConstraintCategory, Span)> = path.iter()
+ .map(|&index| self.classify_constraint(index, mir))
+ .collect();
+ debug!("report_error: categorized_path={:?}", categorized_path);
+
+ // Find what appears to be the most interesting path to report to the user.
+ categorized_path.sort_by(|p0, p1| p0.0.cmp(&p1.0));
+ debug!("report_error: sorted_path={:?}", categorized_path);
+
+ // Get a span
+ let (category, span) = categorized_path.first().unwrap();
+ let diag = &mut infcx.tcx.sess.struct_span_err(
+ *span,
+ &format!("unsatisfied lifetime constraints"), // FIXME
+ );
+
+ // Figure out how we can refer
+ let counter = &mut 1;
+ let fr_name = self.give_region_a_name(infcx.tcx, mir, mir_def_id, fr, counter, diag);
+ let outlived_fr_name = self.give_region_a_name(
+ infcx.tcx,
+ mir,
+ mir_def_id,
+ outlived_fr,
+ counter,
+ diag,
+ );
+
+ diag.span_label(
+ *span,
+ format!(
+ "{} requires that `{}` must outlive `{}`",
+ category, fr_name, outlived_fr_name,
+ ),
+ );
+
+ diag.emit();
+ }
+
+ // Find some constraint `X: Y` where:
+ // - `fr1: X` transitively
+ // - and `Y` is live at `elem`
+ crate fn find_constraint(&self, fr1: RegionVid, elem: Location) -> RegionVid {
+ let index = self.blame_constraint(fr1, elem);
+ self.constraints[index].sub
+ }
+
+ /// Tries to finds a good span to blame for the fact that `fr1`
+ /// contains `fr2`.
+ pub(super) fn blame_constraint(
+ &self,
+ fr1: RegionVid,
+ elem: impl ToElementIndex,
+ ) -> ConstraintIndex {
+ // Find everything that influenced final value of `fr`.
+ let influenced_fr1 = self.dependencies(fr1);
+
+ // Try to find some outlives constraint `'X: fr2` where `'X`
+ // influenced `fr1`. Blame that.
+ //
+ // NB, this is a pretty bad choice most of the time. In
+ // particular, the connection between `'X` and `fr1` may not
+ // be obvious to the user -- not to mention the naive notion
+ // of dependencies, which doesn't account for the locations of
+ // contraints at all. But it will do for now.
+ let relevant_constraint = self.constraints
+ .iter_enumerated()
+ .filter_map(|(i, constraint)| {
+ if !self.liveness_constraints.contains(constraint.sub, elem) {
+ None
+ } else {
+ influenced_fr1[constraint.sup]
+ .map(|distance| (distance, i))
+ }
+ })
+ .min() // constraining fr1 with fewer hops *ought* to be more obvious
+ .map(|(_dist, i)| i);
+
+ relevant_constraint.unwrap_or_else(|| {
+ bug!(
+ "could not find any constraint to blame for {:?}: {:?}",
+ fr1,
+ elem,
+ );
+ })
+ }
+
+ /// Finds all regions whose values `'a` may depend on in some way.
+ /// For each region, returns either `None` (does not influence
+ /// `'a`) or `Some(d)` which indicates that it influences `'a`
+ /// with distinct `d` (minimum number of edges that must be
+ /// traversed).
+ ///
+ /// Used during error reporting, extremely naive and inefficient.
+ fn dependencies(&self, r0: RegionVid) -> IndexVec<RegionVid, Option<usize>> {
+ let mut result_set = IndexVec::from_elem(None, &self.definitions);
+ let mut changed = true;
+ result_set[r0] = Some(0); // distance 0 from `r0`
+
+ while changed {
+ changed = false;
+ for constraint in &*self.constraints {
+ if let Some(n) = result_set[constraint.sup] {
+ let m = n + 1;
+ if result_set[constraint.sub]
+ .map(|distance| m < distance)
+ .unwrap_or(true)
+ {
+ result_set[constraint.sub] = Some(m);
+ changed = true;
+ }
+ }
+ }
+ }
+
+ result_set
+ }
+}
--- /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.
+
+use borrow_check::nll::region_infer::RegionInferenceContext;
+use borrow_check::nll::ToRegionVid;
+use rustc::hir;
+use rustc::hir::def_id::DefId;
+use rustc::mir::{Local, Mir};
+use rustc::ty::subst::{Substs, UnpackedKind};
+use rustc::ty::{self, RegionVid, Ty, TyCtxt};
+use rustc_data_structures::indexed_vec::Idx;
+use rustc_errors::DiagnosticBuilder;
+use syntax::ast::Name;
+use syntax::symbol::keywords;
+use syntax_pos::symbol::InternedString;
+
+impl<'tcx> RegionInferenceContext<'tcx> {
+ /// Maps from an internal MIR region vid to something that we can
+ /// report to the user. In some cases, the region vids will map
+ /// directly to lifetimes that the user has a name for (e.g.,
+ /// `'static`). But frequently they will not, in which case we
+ /// have to find some way to identify the lifetime to the user. To
+ /// that end, this function takes a "diagnostic" so that it can
+ /// create auxiliary notes as needed.
+ ///
+ /// Example (function arguments):
+ ///
+ /// Suppose we are trying to give a name to the lifetime of the
+ /// reference `x`:
+ ///
+ /// ```
+ /// fn foo(x: &u32) { .. }
+ /// ```
+ ///
+ /// This function would create a label like this:
+ ///
+ /// ```
+ /// | fn foo(x: &u32) { .. }
+ /// ------- fully elaborated type of `x` is `&'1 u32`
+ /// ```
+ ///
+ /// and then return the name `'1` for us to use.
+ crate fn give_region_a_name(
+ &self,
+ tcx: TyCtxt<'_, '_, 'tcx>,
+ mir: &Mir<'tcx>,
+ mir_def_id: DefId,
+ fr: RegionVid,
+ counter: &mut usize,
+ diag: &mut DiagnosticBuilder,
+ ) -> InternedString {
+ debug!("give_region_a_name(fr={:?}, counter={})", fr, counter);
+
+ assert!(self.universal_regions.is_universal_region(fr));
+
+ self.give_name_from_error_region(tcx, mir_def_id, fr, counter, diag)
+ .or_else(|| {
+ self.give_name_if_anonymous_region_appears_in_arguments(
+ tcx, mir, mir_def_id, fr, counter, diag,
+ )
+ })
+ .or_else(|| {
+ self.give_name_if_anonymous_region_appears_in_upvars(tcx, mir, fr, counter, diag)
+ })
+ .or_else(|| {
+ self.give_name_if_anonymous_region_appears_in_output(tcx, mir, fr, counter, diag)
+ })
+ .unwrap_or_else(|| span_bug!(mir.span, "can't make a name for free region {:?}", fr))
+ }
+
+ /// Check for the case where `fr` maps to something that the
+ /// *user* has a name for. In that case, we'll be able to map
+ /// `fr` to a `Region<'tcx>`, and that region will be one of
+ /// named variants.
+ fn give_name_from_error_region(
+ &self,
+ tcx: TyCtxt<'_, '_, 'tcx>,
+ mir_def_id: DefId,
+ fr: RegionVid,
+ counter: &mut usize,
+ diag: &mut DiagnosticBuilder<'_>,
+ ) -> Option<InternedString> {
+ let error_region = self.to_error_region(fr)?;
+ debug!("give_region_a_name: error_region = {:?}", error_region);
+ match error_region {
+ ty::ReEarlyBound(ebr) => Some(ebr.name),
+
+ ty::ReStatic => Some(keywords::StaticLifetime.name().as_interned_str()),
+
+ ty::ReFree(free_region) => match free_region.bound_region {
+ ty::BoundRegion::BrNamed(_, name) => Some(name),
+
+ 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)
+ }
+
+ ty::BoundRegion::BrAnon(_) | ty::BoundRegion::BrFresh(_) => None,
+ },
+
+ ty::ReLateBound(..)
+ | ty::ReScope(..)
+ | ty::ReVar(..)
+ | ty::ReSkolemized(..)
+ | ty::ReEmpty
+ | ty::ReErased
+ | ty::ReClosureBound(..)
+ | ty::ReCanonical(..) => None,
+ }
+ }
+
+ /// Find an argument that contains `fr` and label it with a fully
+ /// elaborated type, returning something like `'1`. Result looks
+ /// like:
+ ///
+ /// ```
+ /// | fn foo(x: &u32) { .. }
+ /// ------- fully elaborated type of `x` is `&'1 u32`
+ /// ```
+ fn give_name_if_anonymous_region_appears_in_arguments(
+ &self,
+ tcx: TyCtxt<'_, '_, 'tcx>,
+ mir: &Mir<'tcx>,
+ mir_def_id: DefId,
+ fr: RegionVid,
+ counter: &mut usize,
+ diag: &mut DiagnosticBuilder<'_>,
+ ) -> Option<InternedString> {
+ let implicit_inputs = self.universal_regions.defining_ty.implicit_inputs();
+ let argument_index = self
+ .universal_regions
+ .unnormalized_input_tys
+ .iter()
+ .skip(implicit_inputs)
+ .position(|arg_ty| {
+ debug!(
+ "give_name_if_anonymous_region_appears_in_arguments: arg_ty = {:?}",
+ arg_ty
+ );
+ tcx.any_free_region_meets(arg_ty, |r| r.to_region_vid() == fr)
+ })?;
+
+ debug!(
+ "give_name_if_anonymous_region_appears_in_arguments: \
+ found {:?} in argument {} which has type {:?}",
+ fr, argument_index, self.universal_regions.unnormalized_input_tys[argument_index],
+ );
+
+ let arg_ty =
+ self.universal_regions.unnormalized_input_tys[implicit_inputs + argument_index];
+ if let Some(region_name) = self.give_name_if_we_can_match_hir_ty_from_argument(
+ tcx,
+ mir_def_id,
+ fr,
+ arg_ty,
+ argument_index,
+ counter,
+ diag,
+ ) {
+ return Some(region_name);
+ }
+
+ let region_name = self.synthesize_region_name(counter);
+
+ let argument_local = Local::new(argument_index + implicit_inputs + 1);
+ let argument_span = mir.local_decls[argument_local].source_info.span;
+ diag.span_label(
+ argument_span,
+ format!("lifetime `{}` appears in this argument", region_name,),
+ );
+
+ Some(region_name)
+ }
+
+ fn give_name_if_we_can_match_hir_ty_from_argument(
+ &self,
+ tcx: TyCtxt<'_, '_, 'tcx>,
+ mir_def_id: DefId,
+ needle_fr: RegionVid,
+ argument_ty: Ty<'tcx>,
+ argument_index: usize,
+ counter: &mut usize,
+ diag: &mut DiagnosticBuilder<'_>,
+ ) -> Option<InternedString> {
+ let mir_node_id = tcx.hir.as_local_node_id(mir_def_id)?;
+ let fn_decl = tcx.hir.fn_decl(mir_node_id)?;
+ let argument_hir_ty: &hir::Ty = &fn_decl.inputs[argument_index];
+ match argument_hir_ty.node {
+ // This indicates a variable with no type annotation, like
+ // `|x|`... in that case, we can't highlight the type but
+ // must highlight the variable.
+ hir::TyInfer => None,
+
+ _ => self.give_name_if_we_can_match_hir_ty(
+ tcx,
+ needle_fr,
+ argument_ty,
+ argument_hir_ty,
+ counter,
+ diag,
+ ),
+ }
+ }
+
+ /// Attempts to highlight the specific part of a type annotation
+ /// that contains the anonymous reference we want to give a name
+ /// to. For example, we might produce an annotation like this:
+ ///
+ /// ```
+ /// | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
+ /// | - let's call the lifetime of this reference `'1`
+ /// ```
+ ///
+ /// the way this works is that we match up `argument_ty`, which is
+ /// a `Ty<'tcx>` (the internal form of the type) with
+ /// `argument_hir_ty`, a `hir::Ty` (the syntax of the type
+ /// annotation). We are descending through the types stepwise,
+ /// looking in to find the region `needle_fr` in the internal
+ /// type. Once we find that, we can use the span of the `hir::Ty`
+ /// to add the highlight.
+ ///
+ /// This is a somewhat imperfect process, so long the way we also
+ /// keep track of the **closest** type we've found. If we fail to
+ /// find the exact `&` or `'_` to highlight, then we may fall back
+ /// to highlighting that closest type instead.
+ fn give_name_if_we_can_match_hir_ty(
+ &self,
+ tcx: TyCtxt<'_, '_, 'tcx>,
+ needle_fr: RegionVid,
+ argument_ty: Ty<'tcx>,
+ argument_hir_ty: &hir::Ty,
+ counter: &mut usize,
+ diag: &mut DiagnosticBuilder<'_>,
+ ) -> Option<InternedString> {
+ let search_stack: &mut Vec<(Ty<'tcx>, &hir::Ty)> = &mut Vec::new();
+
+ search_stack.push((argument_ty, argument_hir_ty));
+
+ let mut closest_match: &hir::Ty = argument_hir_ty;
+
+ while let Some((ty, hir_ty)) = search_stack.pop() {
+ // While we search, also track the closet match.
+ if tcx.any_free_region_meets(&ty, |r| r.to_region_vid() == needle_fr) {
+ closest_match = hir_ty;
+ }
+
+ match (&ty.sty, &hir_ty.node) {
+ // Check if the `argument_ty` is `&'X ..` where `'X`
+ // is the region we are looking for -- if so, and we have a `&T`
+ // on the RHS, then we want to highlight the `&` like so:
+ //
+ // &
+ // - let's call the lifetime of this reference `'1`
+ (ty::TyRef(region, referent_ty, _), hir::TyRptr(_lifetime, referent_hir_ty)) => {
+ if region.to_region_vid() == needle_fr {
+ let region_name = self.synthesize_region_name(counter);
+
+ // Just grab the first character, the `&`.
+ let codemap = tcx.sess.codemap();
+ let ampersand_span = codemap.start_point(hir_ty.span);
+
+ diag.span_label(
+ ampersand_span,
+ format!(
+ "let's call the lifetime of this reference `{}`",
+ region_name
+ ),
+ );
+
+ return Some(region_name);
+ }
+
+ // Otherwise, let's descend into the referent types.
+ search_stack.push((referent_ty, &referent_hir_ty.ty));
+ }
+
+ // Match up something like `Foo<'1>`
+ (ty::TyAdt(_adt_def, substs), hir::TyPath(hir::QPath::Resolved(None, path))) => {
+ if let Some(last_segment) = path.segments.last() {
+ if let Some(name) = self.match_adt_and_segment(
+ substs,
+ needle_fr,
+ last_segment,
+ counter,
+ diag,
+ search_stack,
+ ) {
+ return Some(name);
+ }
+ }
+ }
+
+ // The following cases don't have lifetimes, so we
+ // just worry about trying to match up the rustc type
+ // with the HIR types:
+ (ty::TyTuple(elem_tys), hir::TyTup(elem_hir_tys)) => {
+ search_stack.extend(elem_tys.iter().cloned().zip(elem_hir_tys));
+ }
+
+ (ty::TySlice(elem_ty), hir::TySlice(elem_hir_ty))
+ | (ty::TyArray(elem_ty, _), hir::TyArray(elem_hir_ty, _)) => {
+ search_stack.push((elem_ty, elem_hir_ty));
+ }
+
+ (ty::TyRawPtr(mut_ty), hir::TyPtr(mut_hir_ty)) => {
+ search_stack.push((mut_ty.ty, &mut_hir_ty.ty));
+ }
+
+ _ => {
+ // FIXME there are other cases that we could trace
+ }
+ }
+ }
+
+ let region_name = self.synthesize_region_name(counter);
+ diag.span_label(
+ closest_match.span,
+ format!("lifetime `{}` appears in this type", region_name),
+ );
+
+ return Some(region_name);
+ }
+
+ /// We've found an enum/struct/union type with the substitutions
+ /// `substs` and -- in the HIR -- a path type with the final
+ /// segment `last_segment`. Try to find a `'_` to highlight in
+ /// the generic args (or, if not, to produce new zipped pairs of
+ /// types+hir to search through).
+ fn match_adt_and_segment<'hir>(
+ &self,
+ substs: &'tcx Substs<'tcx>,
+ needle_fr: RegionVid,
+ last_segment: &'hir hir::PathSegment,
+ counter: &mut usize,
+ diag: &mut DiagnosticBuilder<'_>,
+ search_stack: &mut Vec<(Ty<'tcx>, &'hir hir::Ty)>,
+ ) -> Option<InternedString> {
+ // Did the user give explicit arguments? (e.g., `Foo<..>`)
+ let args = last_segment.args.as_ref()?;
+ let lifetime = self.try_match_adt_and_generic_args(substs, needle_fr, args, search_stack)?;
+ match lifetime.name {
+ hir::LifetimeName::Param(_)
+ | hir::LifetimeName::Static
+ | hir::LifetimeName::Underscore => {
+ let region_name = self.synthesize_region_name(counter);
+ let ampersand_span = lifetime.span;
+ diag.span_label(ampersand_span, format!("let's call this `{}`", region_name));
+ return Some(region_name);
+ }
+
+ hir::LifetimeName::Implicit => {
+ // In this case, the user left off the lifetime; so
+ // they wrote something like:
+ //
+ // ```
+ // x: Foo<T>
+ // ```
+ //
+ // where the fully elaborated form is `Foo<'_, '1,
+ // T>`. We don't consider this a match; instead we let
+ // the "fully elaborated" type fallback above handle
+ // it.
+ return None;
+ }
+ }
+ }
+
+ /// We've found an enum/struct/union type with the substitutions
+ /// `substs` and -- in the HIR -- a path with the generic
+ /// arguments `args`. If `needle_fr` appears in the args, return
+ /// the `hir::Lifetime` that corresponds to it. If not, push onto
+ /// `search_stack` the types+hir to search through.
+ fn try_match_adt_and_generic_args<'hir>(
+ &self,
+ substs: &'tcx Substs<'tcx>,
+ needle_fr: RegionVid,
+ args: &'hir hir::GenericArgs,
+ search_stack: &mut Vec<(Ty<'tcx>, &'hir hir::Ty)>,
+ ) -> Option<&'hir hir::Lifetime> {
+ for (kind, hir_arg) in substs.iter().zip(&args.args) {
+ match (kind.unpack(), hir_arg) {
+ (UnpackedKind::Lifetime(r), hir::GenericArg::Lifetime(lt)) => {
+ if r.to_region_vid() == needle_fr {
+ return Some(lt);
+ }
+ }
+
+ (UnpackedKind::Type(ty), hir::GenericArg::Type(hir_ty)) => {
+ search_stack.push((ty, hir_ty));
+ }
+
+ (UnpackedKind::Lifetime(_), _) | (UnpackedKind::Type(_), _) => {
+ // I *think* that HIR lowering should ensure this
+ // doesn't happen, even in erroneous
+ // programs. Else we should use delay-span-bug.
+ span_bug!(
+ hir_arg.span(),
+ "unmatched subst and hir arg: found {:?} vs {:?}",
+ kind,
+ hir_arg,
+ );
+ }
+ }
+ }
+
+ None
+ }
+
+ /// Find a closure upvar that contains `fr` and label it with a
+ /// fully elaborated type, returning something like `'1`. Result
+ /// looks like:
+ ///
+ /// ```
+ /// | let x = Some(&22);
+ /// - fully elaborated type of `x` is `Option<&'1 u32>`
+ /// ```
+ fn give_name_if_anonymous_region_appears_in_upvars(
+ &self,
+ tcx: TyCtxt<'_, '_, 'tcx>,
+ mir: &Mir<'tcx>,
+ fr: RegionVid,
+ counter: &mut usize,
+ diag: &mut DiagnosticBuilder<'_>,
+ ) -> Option<InternedString> {
+ let upvar_index = self
+ .universal_regions
+ .defining_ty
+ .upvar_tys(tcx)
+ .position(|upvar_ty| {
+ debug!(
+ "give_name_if_anonymous_region_appears_in_upvars: upvar_ty = {:?}",
+ upvar_ty,
+ );
+ tcx.any_free_region_meets(&upvar_ty, |r| r.to_region_vid() == fr)
+ })?;
+
+ let upvar_ty = self
+ .universal_regions
+ .defining_ty
+ .upvar_tys(tcx)
+ .nth(upvar_index);
+
+ debug!(
+ "give_name_if_anonymous_region_appears_in_upvars: \
+ found {:?} in upvar {} which has type {:?}",
+ fr, upvar_index, upvar_ty,
+ );
+
+ let region_name = self.synthesize_region_name(counter);
+
+ let upvar_hir_id = mir.upvar_decls[upvar_index].var_hir_id.assert_crate_local();
+ let upvar_node_id = tcx.hir.hir_to_node_id(upvar_hir_id);
+ let upvar_span = tcx.hir.span(upvar_node_id);
+ let upvar_name = tcx.hir.name(upvar_node_id);
+ diag.span_label(
+ upvar_span,
+ format!(
+ "lifetime `{}` appears in the type of `{}`",
+ region_name, upvar_name,
+ ),
+ );
+
+ Some(region_name)
+ }
+
+ /// Check for arguments appearing in the (closure) return type. It
+ /// must be a closure since, in a free fn, such an argument would
+ /// have to either also appear in an argument (if using elision)
+ /// or be early bound (named, not in argument).
+ fn give_name_if_anonymous_region_appears_in_output(
+ &self,
+ tcx: TyCtxt<'_, '_, 'tcx>,
+ mir: &Mir<'tcx>,
+ fr: RegionVid,
+ counter: &mut usize,
+ diag: &mut DiagnosticBuilder<'_>,
+ ) -> Option<InternedString> {
+ 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) {
+ return None;
+ }
+
+ let region_name = self.synthesize_region_name(counter);
+ diag.span_label(
+ mir.span,
+ format!("lifetime `{}` appears in return type", region_name),
+ );
+
+ Some(region_name)
+ }
+
+ /// Create a synthetic region named `'1`, incrementing the
+ /// counter.
+ fn synthesize_region_name(&self, counter: &mut usize) -> InternedString {
+ let c = *counter;
+ *counter += 1;
+
+ Name::intern(&format!("'{:?}", c)).as_interned_str()
+ }
+}
fn init_universal_regions(&mut self) {
// Update the names (if any)
for (external_name, variable) in self.universal_regions.named_universal_regions() {
+ debug!(
+ "init_universal_regions: region {:?} has external name {:?}",
+ variable,
+ external_name
+ );
self.definitions[variable].external_name = Some(external_name);
}
//! The code in this file doesn't *do anything* with those results; it
//! just returns them for other code to use.
-use rustc::hir::{self, BodyOwnerKind, HirId};
+use either::Either;
use rustc::hir::def_id::DefId;
-use rustc::infer::{InferCtxt, NLLRegionVariableOrigin};
-use rustc::infer::region_constraints::GenericKind;
+use rustc::hir::{self, BodyOwnerKind, HirId};
use rustc::infer::outlives::bounds::{self, OutlivesBound};
use rustc::infer::outlives::free_region_map::FreeRegionRelations;
-use rustc::ty::{self, RegionVid, Ty, TyCtxt, ClosureSubsts, GeneratorSubsts};
+use rustc::infer::region_constraints::GenericKind;
+use rustc::infer::{InferCtxt, NLLRegionVariableOrigin};
use rustc::ty::fold::TypeFoldable;
use rustc::ty::subst::Substs;
+use rustc::ty::{self, ClosureSubsts, GeneratorSubsts, RegionVid, Ty, TyCtxt};
use rustc::util::nodemap::FxHashMap;
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
use rustc_data_structures::transitive_relation::TransitiveRelation;
Const(DefId, &'tcx Substs<'tcx>),
}
+impl<'tcx> DefiningTy<'tcx> {
+ /// Returns a list of all the upvar types for this MIR. If this is
+ /// not a closure or generator, there are no upvars, and hence it
+ /// will be an empty list. The order of types in this list will
+ /// match up with the `upvar_decls` field of `Mir`.
+ pub fn upvar_tys(self, tcx: TyCtxt<'_, '_, 'tcx>) -> impl Iterator<Item = Ty<'tcx>> + 'tcx {
+ match self {
+ DefiningTy::Closure(def_id, substs) => Either::Left(substs.upvar_tys(def_id, tcx)),
+ DefiningTy::Generator(def_id, substs, _) => {
+ Either::Right(Either::Left(substs.upvar_tys(def_id, tcx)))
+ }
+ DefiningTy::FnDef(..) | DefiningTy::Const(..) => {
+ Either::Right(Either::Right(iter::empty()))
+ }
+ }
+ }
+
+ /// Number of implicit inputs -- notably the "environment"
+ /// parameter for closures -- that appear in MIR but not in the
+ /// user's code.
+ pub fn implicit_inputs(self) -> usize {
+ match self {
+ DefiningTy::Closure(..) | DefiningTy::Generator(..) => 1,
+ DefiningTy::FnDef(..) | DefiningTy::Const(..) => 0,
+ }
+ }
+}
+
#[derive(Debug)]
struct UniversalRegionIndices<'tcx> {
/// For those regions that may appear in the parameter environment
debug!(
"build: global regions = {}..{}",
- FIRST_GLOBAL_INDEX,
- first_extern_index
+ FIRST_GLOBAL_INDEX, first_extern_index
);
debug!(
"build: extern regions = {}..{}",
- first_extern_index,
- first_local_index
+ first_extern_index, first_local_index
);
debug!(
"build: local regions = {}..{}",
- first_local_index,
- num_universals
+ first_local_index, num_universals
);
let yield_ty = match defining_ty {
tables.node_id_to_type(self.mir_hir_id)
};
+ debug!("defining_ty (pre-replacement): {:?}", defining_ty);
+
let defining_ty = self.infcx
.replace_free_regions_with_nll_infer_vars(FR, &defining_ty);
- match defining_ty.sty {
+ match defining_ty.sty {
ty::TyClosure(def_id, substs) => DefiningTy::Closure(def_id, substs),
ty::TyGenerator(def_id, substs, movability) => {
DefiningTy::Generator(def_id, substs, movability)
let closure_base_def_id = tcx.closure_base_def_id(self.mir_def_id);
let identity_substs = Substs::identity_for_item(gcx, closure_base_def_id);
let fr_substs = match defining_ty {
- DefiningTy::Closure(_, ClosureSubsts { ref substs }) |
- DefiningTy::Generator(_, GeneratorSubsts { ref substs }, _) => {
+ DefiningTy::Closure(_, ClosureSubsts { ref substs })
+ | DefiningTy::Generator(_, GeneratorSubsts { ref substs }, _) => {
// In the case of closures, we rely on the fact that
// the first N elements in the ClosureSubsts are
// inherited from the `closure_base_def_id`.
fn relate_universal_regions(&mut self, fr_a: RegionVid, fr_b: RegionVid) {
debug!(
"relate_universal_regions: fr_a={:?} outlives fr_b={:?}",
- fr_a,
- fr_b
+ fr_a, fr_b
);
self.outlives.add(fr_a, fr_b);
self.inverse_outlives.add(fr_b, fr_a);
{
debug!(
"replace_bound_regions_with_nll_infer_vars(value={:?}, all_outlive_scope={:?})",
- value,
- all_outlive_scope,
+ value, all_outlive_scope,
);
let (value, _map) = self.tcx.replace_late_bound_regions(value, |br| {
let liberated_region = self.tcx.mk_region(ty::ReFree(ty::FreeRegion {
}));
let region_vid = self.next_nll_region_var(origin);
indices.insert_late_bound_region(liberated_region, region_vid.to_region_vid());
- debug!("liberated_region={:?} => {:?}", liberated_region, region_vid);
+ debug!(
+ "liberated_region={:?} => {:?}",
+ liberated_region, region_vid
+ );
region_vid
});
value
/// in later and instantiate the late-bound regions, and then we
/// insert the `ReFree` version of those into the map as
/// well. These are used for error reporting.
- fn insert_late_bound_region(&mut self, r: ty::Region<'tcx>,
- vid: ty::RegionVid)
- {
+ fn insert_late_bound_region(&mut self, r: ty::Region<'tcx>, vid: ty::RegionVid) {
+ debug!("insert_late_bound_region({:?}, {:?})", r, vid);
self.indices.insert(r, vid);
}
if let ty::ReVar(..) = r {
r.to_region_vid()
} else {
- *self.indices.get(&r).unwrap_or_else(|| {
- bug!("cannot convert `{:?}` to a region vid", r)
- })
+ *self.indices
+ .get(&r)
+ .unwrap_or_else(|| bug!("cannot convert `{:?}` to a region vid", r))
}
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use borrow_check::borrow_set::{BorrowSet, BorrowData, TwoPhaseUse};
+use borrow_check::borrow_set::{BorrowSet, BorrowData, TwoPhaseActivation};
use borrow_check::places_conflict;
use borrow_check::Context;
use borrow_check::ShallowOrDeep;
let activation_location = match borrow_data.activation_location {
// If this is not a 2-phase borrow, it is always active.
- None => return true,
+ TwoPhaseActivation::NotTwoPhase => return true,
// And if the unique 2-phase use is not an activation, then it is *never* active.
- Some((TwoPhaseUse::SharedUse, _)) => return false,
- // Otherwise, we derive info from the activation point `v`:
- Some((TwoPhaseUse::MutActivate, v)) => v,
+ TwoPhaseActivation::NotActivated => return false,
+ // Otherwise, we derive info from the activation point `loc`:
+ TwoPhaseActivation::ActivatedAt(loc) => loc,
};
// Otherwise, it is active for every location *except* in between
use rustc::mir::{Mir, Place};
use rustc::mir::{Projection, ProjectionElem};
use rustc::ty::{self, TyCtxt};
+use std::cmp::max;
pub(super) fn places_conflict<'gcx, 'tcx>(
tcx: TyCtxt<'_, 'gcx, 'tcx>,
| (ProjectionElem::Index(..), ProjectionElem::ConstantIndex { .. })
| (ProjectionElem::Index(..), ProjectionElem::Subslice { .. })
| (ProjectionElem::ConstantIndex { .. }, ProjectionElem::Index(..))
- | (ProjectionElem::ConstantIndex { .. }, ProjectionElem::ConstantIndex { .. })
- | (ProjectionElem::ConstantIndex { .. }, ProjectionElem::Subslice { .. })
- | (ProjectionElem::Subslice { .. }, ProjectionElem::Index(..))
- | (ProjectionElem::Subslice { .. }, ProjectionElem::ConstantIndex { .. })
- | (ProjectionElem::Subslice { .. }, ProjectionElem::Subslice { .. }) => {
+ | (ProjectionElem::Subslice { .. }, ProjectionElem::Index(..)) => {
// Array indexes (`a[0]` vs. `a[i]`). These can either be disjoint
// (if the indexes differ) or equal (if they are the same), so this
// is the recursive case that gives "equal *or* disjoint" its meaning.
- //
- // Note that by construction, MIR at borrowck can't subdivide
- // `Subslice` accesses (e.g. `a[2..3][i]` will never be present) - they
- // are only present in slice patterns, and we "merge together" nested
- // slice patterns. That means we don't have to think about these. It's
- // probably a good idea to assert this somewhere, but I'm too lazy.
- //
- // FIXME(#8636) we might want to return Disjoint if
- // both projections are constant and disjoint.
- debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY");
+ debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-INDEX");
Overlap::EqualOrDisjoint
}
-
+ (ProjectionElem::ConstantIndex { offset: o1, min_length: _, from_end: false },
+ ProjectionElem::ConstantIndex { offset: o2, min_length: _, from_end: false })
+ | (ProjectionElem::ConstantIndex { offset: o1, min_length: _, from_end: true },
+ ProjectionElem::ConstantIndex {
+ offset: o2, min_length: _, from_end: true }) => {
+ if o1 == o2 {
+ debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX");
+ Overlap::EqualOrDisjoint
+ } else {
+ debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX");
+ Overlap::Disjoint
+ }
+ }
+ (ProjectionElem::ConstantIndex {
+ offset: offset_from_begin, min_length: min_length1, from_end: false },
+ ProjectionElem::ConstantIndex {
+ offset: offset_from_end, min_length: min_length2, from_end: true })
+ | (ProjectionElem::ConstantIndex {
+ offset: offset_from_end, min_length: min_length1, from_end: true },
+ ProjectionElem::ConstantIndex {
+ offset: offset_from_begin, min_length: min_length2, from_end: false }) => {
+ // both patterns matched so it must be at least the greater of the two
+ let min_length = max(min_length1, min_length2);
+ // `offset_from_end` can be in range `[1..min_length]`, 1 indicates the last
+ // element (like -1 in Python) and `min_length` the first.
+ // Therefore, `min_length - offset_from_end` gives the minimal possible
+ // offset from the beginning
+ if *offset_from_begin >= min_length - offset_from_end {
+ debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-FE");
+ Overlap::EqualOrDisjoint
+ } else {
+ debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-FE");
+ Overlap::Disjoint
+ }
+ }
+ (ProjectionElem::ConstantIndex { offset, min_length: _, from_end: false },
+ ProjectionElem::Subslice {from, .. })
+ | (ProjectionElem::Subslice {from, .. },
+ ProjectionElem::ConstantIndex { offset, min_length: _, from_end: false }) => {
+ if offset >= from {
+ debug!(
+ "place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-SUBSLICE");
+ Overlap::EqualOrDisjoint
+ } else {
+ debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-SUBSLICE");
+ Overlap::Disjoint
+ }
+ }
+ (ProjectionElem::ConstantIndex { offset, min_length: _, from_end: true },
+ ProjectionElem::Subslice {from: _, to })
+ | (ProjectionElem::Subslice {from: _, to },
+ ProjectionElem::ConstantIndex { offset, min_length: _, from_end: true }) => {
+ if offset > to {
+ debug!("place_element_conflict: \
+ DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-SUBSLICE-FE");
+ Overlap::EqualOrDisjoint
+ } else {
+ debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-SUBSLICE-FE");
+ Overlap::Disjoint
+ }
+ }
+ (ProjectionElem::Subslice { .. }, ProjectionElem::Subslice { .. }) => {
+ debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-SUBSLICES");
+ Overlap::EqualOrDisjoint
+ }
(ProjectionElem::Deref, _)
| (ProjectionElem::Field(..), _)
| (ProjectionElem::Index(..), _)
};
let mut decl = UpvarDecl {
debug_name: keywords::Invalid.name(),
+ var_hir_id: ClearCrossCrate::Set(var_hir_id),
by_ref,
mutability: Mutability::Not,
};
use rustc::ty::{self, TyCtxt};
use rustc::mir::{self, Mir, BasicBlock, BasicBlockData, Location, Statement, Terminator};
+use rustc::mir::traversal;
use rustc::session::Session;
use std::borrow::Borrow;
fn analyze_results(&mut self, flow_uninit: &mut Self::FlowState) {
let flow = flow_uninit;
- for bb in self.mir().basic_blocks().indices() {
+ for (bb, _) in traversal::reverse_postorder(self.mir()) {
flow.reset_to_entry_of(bb);
self.process_basic_block(bb, flow);
}
Ok((value, ptr, layout.ty))
}
+#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub struct CompileTimeEvaluator;
impl<'tcx> Into<EvalError<'tcx>> for ConstEvalError {
use std::fmt::Write;
+use std::hash::{Hash, Hasher};
use std::mem;
use rustc::hir::def_id::DefId;
use rustc::ty::subst::{Subst, Substs};
use rustc::ty::{self, Ty, TyCtxt, TypeAndMut};
use rustc::ty::query::TyCtxtAt;
+use rustc_data_structures::fx::{FxHashSet, FxHasher};
use rustc_data_structures::indexed_vec::{IndexVec, Idx};
use rustc::mir::interpret::{
FrameInfo, GlobalId, Value, Scalar,
/// The maximum number of stack frames allowed
pub(crate) stack_limit: usize,
- /// The maximum number of terminators that may be evaluated.
- /// This prevents infinite loops and huge computations from freezing up const eval.
- /// Remove once halting problem is solved.
- pub(crate) terminators_remaining: usize,
+ /// When this value is negative, it indicates the number of interpreter
+ /// steps *until* the loop detector is enabled. When it is positive, it is
+ /// the number of steps after the detector has been enabled modulo the loop
+ /// detector period.
+ pub(crate) steps_since_detector_enabled: isize,
+
+ pub(crate) loop_detector: InfiniteLoopDetector<'a, 'mir, 'tcx, M>,
}
/// A stack frame.
+#[derive(Clone)]
pub struct Frame<'mir, 'tcx: 'mir> {
////////////////////////////////////////////////////////////////////////////////
// Function and callsite information
pub stmt: usize,
}
+impl<'mir, 'tcx: 'mir> Eq for Frame<'mir, 'tcx> {}
+
+impl<'mir, 'tcx: 'mir> PartialEq for Frame<'mir, 'tcx> {
+ fn eq(&self, other: &Self) -> bool {
+ let Frame {
+ mir: _,
+ instance,
+ span: _,
+ return_to_block,
+ return_place,
+ locals,
+ block,
+ stmt,
+ } = self;
+
+ // Some of these are constant during evaluation, but are included
+ // anyways for correctness.
+ *instance == other.instance
+ && *return_to_block == other.return_to_block
+ && *return_place == other.return_place
+ && *locals == other.locals
+ && *block == other.block
+ && *stmt == other.stmt
+ }
+}
+
+impl<'mir, 'tcx: 'mir> Hash for Frame<'mir, 'tcx> {
+ fn hash<H: Hasher>(&self, state: &mut H) {
+ let Frame {
+ mir: _,
+ instance,
+ span: _,
+ return_to_block,
+ return_place,
+ locals,
+ block,
+ stmt,
+ } = self;
+
+ instance.hash(state);
+ return_to_block.hash(state);
+ return_place.hash(state);
+ locals.hash(state);
+ block.hash(state);
+ stmt.hash(state);
+ }
+}
+
+/// The virtual machine state during const-evaluation at a given point in time.
+type EvalSnapshot<'a, 'mir, 'tcx, M>
+ = (M, Vec<Frame<'mir, 'tcx>>, Memory<'a, 'mir, 'tcx, M>);
+
+pub(crate) struct InfiniteLoopDetector<'a, 'mir, 'tcx: 'a + 'mir, M: Machine<'mir, 'tcx>> {
+ /// The set of all `EvalSnapshot` *hashes* observed by this detector.
+ ///
+ /// When a collision occurs in this table, we store the full snapshot in
+ /// `snapshots`.
+ hashes: FxHashSet<u64>,
+
+ /// The set of all `EvalSnapshot`s observed by this detector.
+ ///
+ /// An `EvalSnapshot` will only be fully cloned once it has caused a
+ /// collision in `hashes`. As a result, the detector must observe at least
+ /// *two* full cycles of an infinite loop before it triggers.
+ snapshots: FxHashSet<EvalSnapshot<'a, 'mir, 'tcx, M>>,
+}
+
+impl<'a, 'mir, 'tcx, M> Default for InfiniteLoopDetector<'a, 'mir, 'tcx, M>
+ where M: Machine<'mir, 'tcx>,
+ 'tcx: 'a + 'mir,
+{
+ fn default() -> Self {
+ InfiniteLoopDetector {
+ hashes: FxHashSet::default(),
+ snapshots: FxHashSet::default(),
+ }
+ }
+}
+
+impl<'a, 'mir, 'tcx, M> InfiniteLoopDetector<'a, 'mir, 'tcx, M>
+ where M: Machine<'mir, 'tcx>,
+ 'tcx: 'a + 'mir,
+{
+ /// Returns `true` if the loop detector has not yet observed a snapshot.
+ pub fn is_empty(&self) -> bool {
+ self.hashes.is_empty()
+ }
+
+ pub fn observe_and_analyze(
+ &mut self,
+ machine: &M,
+ stack: &Vec<Frame<'mir, 'tcx>>,
+ memory: &Memory<'a, 'mir, 'tcx, M>,
+ ) -> EvalResult<'tcx, ()> {
+ let snapshot = (machine, stack, memory);
+
+ let mut fx = FxHasher::default();
+ snapshot.hash(&mut fx);
+ let hash = fx.finish();
+
+ if self.hashes.insert(hash) {
+ // No collision
+ return Ok(())
+ }
+
+ if self.snapshots.insert((machine.clone(), stack.clone(), memory.clone())) {
+ // Spurious collision or first cycle
+ return Ok(())
+ }
+
+ // Second cycle
+ Err(EvalErrorKind::InfiniteLoop.into())
+ }
+}
+
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
pub enum StackPopCleanup {
/// The stackframe existed to compute the initial value of a static/constant, make sure it
}
}
-const MAX_TERMINATORS: usize = 1_000_000;
+const STEPS_UNTIL_DETECTOR_ENABLED: isize = 1_000_000;
impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
pub fn new(
memory: Memory::new(tcx, memory_data),
stack: Vec::new(),
stack_limit: tcx.sess.const_eval_stack_frame_limit,
- terminators_remaining: MAX_TERMINATORS,
+ loop_detector: Default::default(),
+ steps_since_detector_enabled: -STEPS_UNTIL_DETECTOR_ENABLED,
}
}
pub(crate) fn with_fresh_body<F: FnOnce(&mut Self) -> R, R>(&mut self, f: F) -> R {
let stack = mem::replace(&mut self.stack, Vec::new());
- let terminators_remaining = mem::replace(&mut self.terminators_remaining, MAX_TERMINATORS);
+ let steps = mem::replace(&mut self.steps_since_detector_enabled, -STEPS_UNTIL_DETECTOR_ENABLED);
let r = f(self);
self.stack = stack;
- self.terminators_remaining = terminators_remaining;
+ self.steps_since_detector_enabled = steps;
r
}
}
Aggregate(ref kind, ref operands) => {
- self.inc_step_counter_and_check_limit(operands.len());
-
let (dest, active_field_index) = match **kind {
mir::AggregateKind::Adt(adt_def, variant_index, _, active_field_index) => {
self.write_discriminant_value(dest_ty, dest, variant_index)?;
//! This separation exists to ensure that no fancy miri features like
//! interpreting common C functions leak into CTFE.
+use std::hash::Hash;
+
use rustc::mir::interpret::{AllocId, EvalResult, Scalar, Pointer, AccessKind, GlobalId};
use super::{EvalContext, Place, ValTy, Memory};
/// Methods of this trait signifies a point where CTFE evaluation would fail
/// and some use case dependent behaviour can instead be applied
-pub trait Machine<'mir, 'tcx>: Sized {
+pub trait Machine<'mir, 'tcx>: Clone + Eq + Hash {
/// Additional data that can be accessed via the Memory
- type MemoryData;
+ type MemoryData: Clone + Eq + Hash;
/// Additional memory kinds a machine wishes to distinguish from the builtin ones
type MemoryKinds: ::std::fmt::Debug + PartialEq + Copy + Clone;
use std::collections::VecDeque;
+use std::hash::{Hash, Hasher};
use std::ptr;
use rustc::hir::def_id::DefId;
use rustc::mir::interpret::{Pointer, AllocId, Allocation, AccessKind, Value,
EvalResult, Scalar, EvalErrorKind, GlobalId, AllocType};
pub use rustc::mir::interpret::{write_target_uint, write_target_int, read_target_uint};
-use rustc_data_structures::fx::{FxHashSet, FxHashMap};
+use rustc_data_structures::fx::{FxHashSet, FxHashMap, FxHasher};
use syntax::ast::Mutability;
// Allocations and pointers
////////////////////////////////////////////////////////////////////////////////
-#[derive(Debug, PartialEq, Copy, Clone)]
+#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum MemoryKind<T> {
/// Error if deallocated except during a stack pop
Stack,
// Top-level interpreter memory
////////////////////////////////////////////////////////////////////////////////
+#[derive(Clone)]
pub struct Memory<'a, 'mir, 'tcx: 'a + 'mir, M: Machine<'mir, 'tcx>> {
/// Additional data required by the Machine
pub data: M::MemoryData,
pub tcx: TyCtxtAt<'a, 'tcx, 'tcx>,
}
+impl<'a, 'mir, 'tcx, M> Eq for Memory<'a, 'mir, 'tcx, M>
+ where M: Machine<'mir, 'tcx>,
+ 'tcx: 'a + 'mir,
+{}
+
+impl<'a, 'mir, 'tcx, M> PartialEq for Memory<'a, 'mir, 'tcx, M>
+ where M: Machine<'mir, 'tcx>,
+ 'tcx: 'a + 'mir,
+{
+ fn eq(&self, other: &Self) -> bool {
+ let Memory {
+ data,
+ alloc_kind,
+ alloc_map,
+ cur_frame,
+ tcx: _,
+ } = self;
+
+ *data == other.data
+ && *alloc_kind == other.alloc_kind
+ && *alloc_map == other.alloc_map
+ && *cur_frame == other.cur_frame
+ }
+}
+
+impl<'a, 'mir, 'tcx, M> Hash for Memory<'a, 'mir, 'tcx, M>
+ where M: Machine<'mir, 'tcx>,
+ 'tcx: 'a + 'mir,
+{
+ fn hash<H: Hasher>(&self, state: &mut H) {
+ let Memory {
+ data,
+ alloc_kind: _,
+ alloc_map: _,
+ cur_frame,
+ tcx: _,
+ } = self;
+
+ data.hash(state);
+ cur_frame.hash(state);
+
+ // We ignore some fields which don't change between evaluation steps.
+
+ // Since HashMaps which contain the same items may have different
+ // iteration orders, we use a commutative operation (in this case
+ // addition, but XOR would also work), to combine the hash of each
+ // `Allocation`.
+ self.allocations()
+ .map(|allocs| {
+ let mut h = FxHasher::default();
+ allocs.hash(&mut h);
+ h.finish()
+ })
+ .fold(0u64, |hash, x| hash.wrapping_add(x))
+ .hash(state);
+ }
+}
+
impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
pub fn new(tcx: TyCtxtAt<'a, 'tcx, 'tcx>, data: M::MemoryData) -> Self {
Memory {
for i in 0..size.bytes() {
let defined = undef_mask.get(src.offset + Size::from_bytes(i));
-
+
for j in 0..repeat {
dest_allocation.undef_mask.set(
dest.offset + Size::from_bytes(i + (size.bytes() * j)),
use super::{EvalContext, Machine, ValTy};
use interpret::memory::HasMemory;
-#[derive(Copy, Clone, Debug)]
+#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub enum Place {
/// A place referring to a value allocated in the `Memory` system.
Ptr {
Local { frame: usize, local: mir::Local },
}
-#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub enum PlaceExtra {
None,
Length(u64),
use super::{EvalContext, Machine};
impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
- pub fn inc_step_counter_and_check_limit(&mut self, n: usize) {
- self.terminators_remaining = self.terminators_remaining.saturating_sub(n);
- if self.terminators_remaining == 0 {
+ pub fn inc_step_counter_and_detect_loops(&mut self) -> EvalResult<'tcx, ()> {
+ /// The number of steps between loop detector snapshots.
+ /// Should be a power of two for performance reasons.
+ const DETECTOR_SNAPSHOT_PERIOD: isize = 256;
+
+ {
+ let steps = &mut self.steps_since_detector_enabled;
+
+ *steps += 1;
+ if *steps < 0 {
+ return Ok(());
+ }
+
+ *steps %= DETECTOR_SNAPSHOT_PERIOD;
+ if *steps != 0 {
+ return Ok(());
+ }
+ }
+
+ if self.loop_detector.is_empty() {
+ // First run of the loop detector
+
// FIXME(#49980): make this warning a lint
- self.tcx.sess.span_warn(self.frame().span, "Constant evaluating a complex constant, this might take some time");
- self.terminators_remaining = 1_000_000;
+ self.tcx.sess.span_warn(self.frame().span,
+ "Constant evaluating a complex constant, this might take some time");
}
+
+ self.loop_detector.observe_and_analyze(&self.machine, &self.stack, &self.memory)
}
/// Returns true as long as there are more things to do.
return Ok(true);
}
- self.inc_step_counter_and_check_limit(1);
+ self.inc_step_counter_and_detect_loops()?;
let terminator = basic_block.terminator();
assert_eq!(old_frames, self.cur_frame());
};
let param_env = ty::ParamEnv::reveal_all();
- match tcx.const_eval(param_env.and(cid)) {
- Ok(val) => collect_const(tcx, val, instance.substs, &mut neighbors),
- Err(err) => {
- let span = tcx.def_span(def_id);
- err.report_as_error(
- tcx.at(span),
- "could not evaluate static initializer",
- );
- }
+ if let Ok(val) = tcx.const_eval(param_env.and(cid)) {
+ collect_const(tcx, val, instance.substs, &mut neighbors);
}
}
MonoItem::Fn(instance) => {
MonoItem::GlobalAsm(..) => {
recursion_depth_reset = None;
}
+ MonoItem::CustomSection(..) => {
+ recursion_depth_reset = None;
+ }
}
record_accesses(tcx, starting_point, &neighbors[..], inlining_map);
hir::ItemConst(..) => {
// const items only generate mono items if they are
// actually used somewhere. Just declaring them is insufficient.
+
+ let def_id = self.tcx.hir.local_def_id(item.id);
+ if self.tcx.sess.opts.target_triple.triple().starts_with("wasm32") &&
+ self.tcx.codegen_fn_attrs(def_id).wasm_custom_section.is_some()
+ {
+ self.output.push(MonoItem::CustomSection(def_id));
+ }
}
hir::ItemFn(..) => {
let def_id = self.tcx.hir.local_def_id(item.id);
instance.substs.types().next().is_some()
}
MonoItem::Static(..) |
+ MonoItem::CustomSection(..) |
MonoItem::GlobalAsm(..) => false,
}
}
MonoItem::Static(def_id) => {
tcx.symbol_name(Instance::mono(tcx, def_id))
}
+ MonoItem::CustomSection(def_id) => {
+ tcx.symbol_name(Instance::mono(tcx, def_id))
+ }
MonoItem::GlobalAsm(node_id) => {
let def_id = tcx.hir.local_def_id(node_id);
ty::SymbolName {
}
}
}
- MonoItem::Static(..) => {
- InstantiationMode::GloballyShared { may_conflict: false }
- }
+ MonoItem::Static(..) |
+ MonoItem::CustomSection(..) |
MonoItem::GlobalAsm(..) => {
InstantiationMode::GloballyShared { may_conflict: false }
}
let def_id = match *self.as_mono_item() {
MonoItem::Fn(ref instance) => instance.def_id(),
MonoItem::Static(def_id) => def_id,
+ MonoItem::CustomSection(..) => return None,
MonoItem::GlobalAsm(..) => return None,
};
let (def_id, substs) = match *self.as_mono_item() {
MonoItem::Fn(ref instance) => (instance.def_id(), instance.substs),
MonoItem::Static(def_id) => (def_id, Substs::empty()),
+ MonoItem::CustomSection(..) => return true,
// global asm never has predicates
MonoItem::GlobalAsm(..) => return true
};
let instance = Instance::new(def_id, tcx.intern_substs(&[]));
to_string_internal(tcx, "static ", instance)
},
+ MonoItem::CustomSection(def_id) => {
+ let instance = Instance::new(def_id, tcx.intern_substs(&[]));
+ to_string_internal(tcx, "custom-section ", instance)
+ },
MonoItem::GlobalAsm(..) => {
"global_asm".to_string()
}
MonoItem::Static(def_id) => {
tcx.hir.as_local_node_id(def_id)
}
+ MonoItem::CustomSection(def_id) => {
+ tcx.hir.as_local_node_id(def_id)
+ }
MonoItem::GlobalAsm(node_id) => {
Some(node_id)
}
}
}
}
- MonoItem::Static(def_id) => {
+ MonoItem::Static(def_id) |
+ MonoItem::CustomSection(def_id) => {
tcx.hir.as_local_node_id(def_id)
}
MonoItem::GlobalAsm(node_id) => {
};
(Linkage::External, visibility)
}
+ MonoItem::CustomSection(..) => {
+ (Linkage::External, Visibility::Hidden)
+ }
MonoItem::GlobalAsm(node_id) => {
let def_id = tcx.hir.local_def_id(node_id);
let visibility = if tcx.is_reachable_non_generic(def_id) {
Some(def_id)
}
MonoItem::Static(def_id) => Some(def_id),
+ MonoItem::CustomSection(def_id) => Some(def_id),
MonoItem::GlobalAsm(node_id) => Some(tcx.hir.local_def_id(node_id)),
}
}
let func_ty = func.ty(self.mir, self.tcx);
let sig = func_ty.fn_sig(self.tcx);
if let hir::Unsafety::Unsafe = sig.unsafety() {
- self.require_unsafe("call to unsafe function")
+ self.require_unsafe("call to unsafe function",
+ "consult the function's documentation for information on how to avoid \
+ undefined behavior")
}
}
}
}
StatementKind::InlineAsm { .. } => {
- self.require_unsafe("use of inline assembly")
+ self.require_unsafe("use of inline assembly",
+ "inline assembly is entirely unchecked and can cause undefined behavior")
},
}
self.super_statement(block, statement, location);
self.register_violations(&[UnsafetyViolation {
source_info,
description: Symbol::intern("borrow of packed field").as_interned_str(),
+ details:
+ Symbol::intern("fields of packed structs might be misaligned: \
+ dereferencing a misaligned pointer or even just creating a \
+ misaligned reference is undefined behavior")
+ .as_interned_str(),
kind: UnsafetyViolationKind::BorrowPacked(lint_root)
}], &[]);
}
let base_ty = base.ty(self.mir, self.tcx).to_ty(self.tcx);
match base_ty.sty {
ty::TyRawPtr(..) => {
- self.require_unsafe("dereference of raw pointer")
+ self.require_unsafe("dereference of raw pointer",
+ "raw pointers may be NULL, dangling or unaligned; they can violate \
+ aliasing rules and cause data races: all of these are undefined \
+ behavior")
}
ty::TyAdt(adt, _) => {
if adt.is_union() {
if elem_ty.moves_by_default(self.tcx, self.param_env,
self.source_info.span) {
self.require_unsafe(
- "assignment to non-`Copy` union field")
+ "assignment to non-`Copy` union field",
+ "the previous content of the field will be dropped, which \
+ causes undefined behavior if the field was not properly \
+ initialized")
} else {
// write to non-move union, safe
}
} else {
- self.require_unsafe("access to union field")
+ self.require_unsafe("access to union field",
+ "the field may not be properly initialized: using \
+ uninitialized data will cause undefined behavior")
}
}
}
}
&Place::Static(box Static { def_id, ty: _ }) => {
if self.tcx.is_static(def_id) == Some(hir::Mutability::MutMutable) {
- self.require_unsafe("use of mutable static");
+ self.require_unsafe("use of mutable static",
+ "mutable statics can be mutated by multiple threads: aliasing violations \
+ or data races will cause undefined behavior");
} else if self.tcx.is_foreign_item(def_id) {
let source_info = self.source_info;
let lint_root =
self.register_violations(&[UnsafetyViolation {
source_info,
description: Symbol::intern("use of extern static").as_interned_str(),
+ details:
+ Symbol::intern("extern statics are not controlled by the Rust type \
+ system: invalid data, aliasing violations or data \
+ races will cause undefined behavior")
+ .as_interned_str(),
kind: UnsafetyViolationKind::ExternStatic(lint_root)
}], &[]);
}
impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
fn require_unsafe(&mut self,
- description: &'static str)
+ description: &'static str,
+ details: &'static str)
{
let source_info = self.source_info;
self.register_violations(&[UnsafetyViolation {
source_info,
description: Symbol::intern(description).as_interned_str(),
+ details: Symbol::intern(details).as_interned_str(),
kind: UnsafetyViolationKind::General,
}], &[]);
}
} = tcx.unsafety_check_result(def_id);
for &UnsafetyViolation {
- source_info, description, kind
+ source_info, description, details, kind
} in violations.iter() {
// Report an error.
match kind {
UnsafetyViolationKind::General => {
struct_span_err!(
tcx.sess, source_info.span, E0133,
- "{} requires unsafe function or block", description)
+ "{} is unsafe and requires unsafe function or block", description)
.span_label(source_info.span, &description.as_str()[..])
+ .note(&details.as_str()[..])
.emit();
}
UnsafetyViolationKind::ExternStatic(lint_node_id) => {
- tcx.lint_node(SAFE_EXTERN_STATICS,
+ tcx.lint_node_note(SAFE_EXTERN_STATICS,
lint_node_id,
source_info.span,
- &format!("{} requires unsafe function or \
- block (error E0133)", &description.as_str()[..]));
+ &format!("{} is unsafe and requires unsafe function or block \
+ (error E0133)", &description.as_str()[..]),
+ &details.as_str()[..]);
}
UnsafetyViolationKind::BorrowPacked(lint_node_id) => {
if let Some(impl_def_id) = builtin_derive_def_id(tcx, def_id) {
tcx.unsafe_derive_on_repr_packed(impl_def_id);
} else {
- tcx.lint_node(SAFE_PACKED_BORROWS,
+ tcx.lint_node_note(SAFE_PACKED_BORROWS,
lint_node_id,
source_info.span,
- &format!("{} requires unsafe function or \
- block (error E0133)", &description.as_str()[..]));
+ &format!("{} is unsafe and requires unsafe function or block \
+ (error E0133)", &description.as_str()[..]),
+ &details.as_str()[..]);
}
}
}
// (Mir-)Borrowck uses `mir_validated`, so we have to force it to
// execute before we can steal.
let _ = tcx.mir_borrowck(def_id);
- let _ = tcx.borrowck(def_id);
+
+ if tcx.use_ast_borrowck() {
+ let _ = tcx.borrowck(def_id);
+ }
let mut mir = tcx.mir_validated(def_id).steal();
run_passes![tcx, mir, def_id, 2;
src: MirSource, mir: &mut Mir<'tcx>) {
let def_id = src.def_id;
let id = tcx.hir.as_local_node_id(def_id).unwrap();
- if !tcx.has_attr(def_id, "rustc_mir_borrowck") {
+ if !tcx.has_attr(def_id, "rustc_mir") {
debug!("skipping rustc_peek::SanityCheck on {}", tcx.item_path_str(def_id));
return;
} else {
use syntax::ast;
use syntax::attr;
use syntax_pos::{Span, DUMMY_SP};
-use rustc::hir::intravisit::{self, Visitor, NestedVisitorMap};
pub fn provide(providers: &mut Providers) {
*providers = Providers {
assert!(def_id.is_local());
let node_id = tcx.hir.as_local_node_id(def_id)
- .expect("rvalue_promotable_map invoked with non-local def-id");
+ .expect("rvalue_promotable_map invoked with non-local def-id");
let body_id = tcx.hir.body_owned_by(node_id);
let body_hir_id = tcx.hir.node_to_hir_id(body_id.node_id);
tcx.rvalue_promotable_map(def_id).contains(&body_hir_id.local_id)
// `def_id` should be a `Body` owner
let node_id = tcx.hir.as_local_node_id(def_id)
- .expect("rvalue_promotable_map invoked with non-local def-id");
+ .expect("rvalue_promotable_map invoked with non-local def-id");
let body_id = tcx.hir.body_owned_by(node_id);
visitor.visit_nested_body(body_id);
// Returns true iff all the values of the type are promotable.
fn type_has_only_promotable_values(&mut self, ty: Ty<'gcx>) -> bool {
ty.is_freeze(self.tcx, self.param_env, DUMMY_SP) &&
- !ty.needs_drop(self.tcx, self.param_env)
+ !ty.needs_drop(self.tcx, self.param_env)
}
fn handle_const_fn_call(&mut self, def_id: DefId, ret_ty: Ty<'gcx>, span: Span) {
if let Some(&attr::Stability {
rustc_const_unstable: Some(attr::RustcConstUnstable {
- feature: ref feature_name
- }),
- .. }) = self.tcx.lookup_stability(def_id) {
+ feature: ref feature_name
+ }),
+ .. }) = self.tcx.lookup_stability(def_id) {
self.promotable &=
// feature-gate is enabled,
self.tcx.features()
.iter()
.any(|&(ref sym, _)| sym == feature_name) ||
- // this comes from a crate with the feature-gate enabled,
- !def_id.is_local() ||
+ // this comes from a crate with the feature-gate enabled,
+ !def_id.is_local() ||
- // this comes from a macro that has #[allow_internal_unstable]
- span.allows_unstable();
+ // this comes from a macro that has #[allow_internal_unstable]
+ span.allows_unstable();
}
}
}
}
-impl<'a, 'tcx> Visitor<'tcx> for CheckCrateVisitor<'a, 'tcx> {
- fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
- // note that we *do* visit nested bodies, because we override `visit_nested_body` below
- NestedVisitorMap::None
- }
-
+impl<'a, 'tcx> CheckCrateVisitor<'a, 'tcx> {
fn visit_nested_body(&mut self, body_id: hir::BodyId) {
let item_id = self.tcx.hir.body_owner(body_id);
let item_def_id = self.tcx.hir.local_def_id(item_id);
euv::ExprUseVisitor::new(self, tcx, param_env, ®ion_scope_tree, self.tables, None)
.consume_body(body);
- self.visit_body(body);
-
+ self.visit_expr(&body.value);
self.in_fn = outer_in_fn;
self.tables = outer_tables;
self.param_env = outer_param_env;
fn visit_stmt(&mut self, stmt: &'tcx hir::Stmt) {
match stmt.node {
- hir::StmtDecl(ref decl, _) => {
+ hir::StmtDecl(ref decl, _node_id) => {
match &decl.node {
hir::DeclLocal(local) => {
self.promotable = false;
-
if self.remove_mut_rvalue_borrow(&local.pat) {
if let Some(init) = &local.init {
self.mut_rvalue_borrows.insert(init.id);
}
}
+
+ match local.init {
+ Some(ref expr) => self.visit_expr(&expr),
+ None => {},
+ }
}
// Item statements are allowed
hir::DeclItem(_) => {}
}
}
- hir::StmtExpr(..) |
- hir::StmtSemi(..) => {
+ hir::StmtExpr(ref box_expr, _node_id) |
+ hir::StmtSemi(ref box_expr, _node_id) => {
+ self.visit_expr(box_expr);
self.promotable = false;
}
}
- intravisit::walk_stmt(self, stmt);
}
fn visit_expr(&mut self, ex: &'tcx hir::Expr) {
check_expr(self, ex, node_ty);
check_adjustments(self, ex);
- if let hir::ExprMatch(ref discr, ref arms, _) = ex.node {
- // Compute the most demanding borrow from all the arms'
- // patterns and set that on the discriminator.
- let mut mut_borrow = false;
- for pat in arms.iter().flat_map(|arm| &arm.pats) {
- mut_borrow = self.remove_mut_rvalue_borrow(pat);
- }
- if mut_borrow {
- self.mut_rvalue_borrows.insert(discr.id);
- }
- }
-
- intravisit::walk_expr(self, ex);
-
// Handle borrows on (or inside the autorefs of) this expression.
if self.mut_rvalue_borrows.remove(&ex.id) {
self.promotable = false;
}
self.promotable &= outer;
}
+
+ fn visit_block(&mut self, block: &'tcx hir::Block) {
+ for index in block.stmts.iter() {
+ self.visit_stmt(index)
+ }
+ match block.expr {
+ Some(ref box_expr) => { self.visit_expr(&*box_expr) },
+ None => {},
+ }
+ }
}
/// This function is used to enforce the constraints on
/// every nested expression. If the expression is not part
/// of a const/static item, it is qualified for promotion
/// instead of producing errors.
-fn check_expr<'a, 'tcx>(v: &mut CheckCrateVisitor<'a, 'tcx>, e: &hir::Expr, node_ty: Ty<'tcx>) {
+fn check_expr<'a, 'tcx>(
+ v: &mut CheckCrateVisitor<'a, 'tcx>,
+ e: &'tcx hir::Expr, node_ty: Ty<'tcx>) {
match node_ty.sty {
ty::TyAdt(def, _) if def.has_dtor(v.tcx) => {
v.promotable = false;
}
match e.node {
- hir::ExprUnary(..) |
- hir::ExprBinary(..) |
- hir::ExprIndex(..) if v.tables.is_method_call(e) => {
+ hir::ExprBox(ref expr) => {
+ v.visit_expr(&expr);
v.promotable = false;
}
- hir::ExprBox(_) => {
- v.promotable = false;
- }
- hir::ExprUnary(op, _) => {
+ hir::ExprUnary(op, ref expr) => {
+ if v.tables.is_method_call(e) {
+ v.promotable = false;
+ }
if op == hir::UnDeref {
v.promotable = false;
}
+ v.visit_expr(expr);
}
- hir::ExprBinary(op, ref lhs, _) => {
+ hir::ExprBinary(op, ref lhs, ref rhs) => {
+ if v.tables.is_method_call(e) {
+ v.promotable = false;
+ }
+ v.visit_expr(lhs);
+ v.visit_expr(rhs);
match v.tables.node_id_to_type(lhs.hir_id).sty {
ty::TyRawPtr(_) => {
assert!(op.node == hir::BiEq || op.node == hir::BiNe ||
- op.node == hir::BiLe || op.node == hir::BiLt ||
- op.node == hir::BiGe || op.node == hir::BiGt);
+ op.node == hir::BiLe || op.node == hir::BiLt ||
+ op.node == hir::BiGe || op.node == hir::BiGt);
v.promotable = false;
}
}
}
hir::ExprCast(ref from, _) => {
+ v.visit_expr(from);
debug!("Checking const cast(id={})", from.id);
match v.tables.cast_kinds().get(from.hir_id) {
None => v.tcx.sess.delay_span_bug(e.span, "no kind for cast"),
}
}
}
- hir::ExprCall(ref callee, _) => {
+ hir::ExprCall(ref callee, ref hirvec) => {
+ v.visit_expr(callee);
+ for index in hirvec.iter() {
+ v.visit_expr(index)
+ }
let mut callee = &**callee;
loop {
callee = match callee.node {
_ => v.promotable = false
}
}
- hir::ExprMethodCall(..) => {
+ hir::ExprMethodCall(ref _pathsegment, ref _span, ref hirvec) => {
+ for index in hirvec.iter() {
+ v.visit_expr(index)
+ }
if let Some(def) = v.tables.type_dependent_defs().get(e.hir_id) {
let def_id = def.def_id();
match v.tcx.associated_item(def_id).container {
v.tcx.sess.delay_span_bug(e.span, "no type-dependent def for method call");
}
}
- hir::ExprStruct(..) => {
+ hir::ExprStruct(ref _qpath, ref hirvec, ref option_expr) => {
+ for index in hirvec.iter() {
+ v.visit_expr(&index.expr);
+ }
+ match *option_expr {
+ Some(ref expr) => { v.visit_expr(&expr) },
+ None => {},
+ }
if let ty::TyAdt(adt, ..) = v.tables.expr_ty(e).sty {
// unsafe_cell_type doesn't necessarily exist with no_core
if Some(adt.did) == v.tcx.lang_items().unsafe_cell_type() {
}
}
- hir::ExprLit(_) |
- hir::ExprAddrOf(..) |
- hir::ExprRepeat(..) => {}
+ hir::ExprLit(_) => {}
- hir::ExprClosure(..) => {
+ hir::ExprAddrOf(_, ref expr) |
+ hir::ExprRepeat(ref expr, _) => {
+ v.visit_expr(expr);
+ }
+
+ hir::ExprClosure(_capture_clause, ref _box_fn_decl,
+ body_id, _span, _option_generator_movability) => {
+ v.visit_nested_body(body_id);
// Paths in constant contexts cannot refer to local variables,
// as there are none, and thus closures can't have upvars there.
if v.tcx.with_freevars(e.id, |fv| !fv.is_empty()) {
}
}
- hir::ExprField(ref expr, _) => {
+ hir::ExprField(ref expr, _ident) => {
+ v.visit_expr(expr);
if let Some(def) = v.tables.expr_ty(expr).ty_adt_def() {
if def.is_union() {
v.promotable = false
}
}
- hir::ExprBlock(..) |
- hir::ExprIndex(..) |
- hir::ExprArray(_) |
- hir::ExprType(..) |
- hir::ExprTup(..) => {}
+ hir::ExprBlock(ref box_block, ref _option_label) => {
+ v.visit_block(box_block);
+ }
+
+ hir::ExprIndex(ref lhs, ref rhs) => {
+ if v.tables.is_method_call(e) {
+ v.promotable = false;
+ }
+ v.visit_expr(lhs);
+ v.visit_expr(rhs);
+ }
+
+ hir::ExprArray(ref hirvec) => {
+ for index in hirvec.iter() {
+ v.visit_expr(index)
+ }
+ }
+
+ hir::ExprType(ref expr, ref _ty) => {
+ v.visit_expr(expr);
+ }
+
+ hir::ExprTup(ref hirvec) => {
+ for index in hirvec.iter() {
+ v.visit_expr(index)
+ }
+ }
+
// Conditional control flow (possible to implement).
- hir::ExprMatch(..) |
- hir::ExprIf(..) |
+ hir::ExprMatch(ref expr, ref hirvec_arm, ref _match_source) => {
+ // Compute the most demanding borrow from all the arms'
+ // patterns and set that on the discriminator.
+ let mut mut_borrow = false;
+ for pat in hirvec_arm.iter().flat_map(|arm| &arm.pats) {
+ mut_borrow = v.remove_mut_rvalue_borrow(pat);
+ }
+ if mut_borrow {
+ v.mut_rvalue_borrows.insert(expr.id);
+ }
+
+ v.visit_expr(expr);
+ for index in hirvec_arm.iter() {
+ v.visit_expr(&*index.body);
+ match index.guard {
+ Some(ref expr) => v.visit_expr(&expr),
+ None => {},
+ }
+ }
+ v.promotable = false;
+ }
+
+ hir::ExprIf(ref lhs, ref rhs, ref option_expr) => {
+ v.visit_expr(lhs);
+ v.visit_expr(rhs);
+ match option_expr {
+ Some(ref expr) => v.visit_expr(&expr),
+ None => {},
+ }
+ v.promotable = false;
+ }
// Loops (not very meaningful in constants).
- hir::ExprWhile(..) |
- hir::ExprLoop(..) |
+ hir::ExprWhile(ref expr, ref box_block, ref _option_label) => {
+ v.visit_expr(expr);
+ v.visit_block(box_block);
+ v.promotable = false;
+ }
+
+ hir::ExprLoop(ref box_block, ref _option_label, ref _loop_source) => {
+ v.visit_block(box_block);
+ v.promotable = false;
+ }
// More control flow (also not very meaningful).
- hir::ExprBreak(..) |
- hir::ExprContinue(_) |
- hir::ExprRet(_) |
+ hir::ExprBreak(_, ref option_expr) | hir::ExprRet(ref option_expr) => {
+ match *option_expr {
+ Some(ref expr) => { v.visit_expr(&expr) },
+ None => {},
+ }
+ v.promotable = false;
+ }
+
+ hir::ExprContinue(_) => {
+ v.promotable = false;
+ }
// Generator expressions
- hir::ExprYield(_) |
+ hir::ExprYield(ref expr) => {
+ v.visit_expr(&expr);
+ v.promotable = false;
+ }
// Expressions with side-effects.
- hir::ExprAssign(..) |
- hir::ExprAssignOp(..) |
- hir::ExprInlineAsm(..) => {
+ hir::ExprAssignOp(_, ref lhs, ref rhs) | hir::ExprAssign(ref lhs, ref rhs) => {
+ v.visit_expr(lhs);
+ v.visit_expr(rhs);
+ v.promotable = false;
+ }
+
+ hir::ExprInlineAsm(ref _inline_asm, ref hirvec_lhs, ref hirvec_rhs) => {
+ for index in hirvec_lhs.iter() {
+ v.visit_expr(index)
+ }
+ for index in hirvec_rhs.iter() {
+ v.visit_expr(index)
+ }
v.promotable = false;
}
}
```
Please verify you didn't misspell the type/module's name or that you didn't
-forgot to import it:
+forget to import it:
```
use syntax::visit::{self, FnKind, Visitor};
use syntax::attr;
-use syntax::ast::{Arm, IsAsync, BindingMode, Block, Crate, Expr, ExprKind};
+use syntax::ast::{CRATE_NODE_ID, Arm, IsAsync, BindingMode, Block, Crate, Expr, ExprKind};
use syntax::ast::{FnDecl, ForeignItem, ForeignItemKind, GenericParamKind, Generics};
use syntax::ast::{Item, ItemKind, ImplItem, ImplItemKind};
use syntax::ast::{Label, Local, Mutability, Pat, PatKind, Path};
ident.span = ident.span.modern();
loop {
- module = unwrap_or!(self.hygienic_lexical_parent(module, &mut ident.span), break);
+ let (opt_module, poisoned) = if record_used {
+ self.hygienic_lexical_parent_with_compatibility_fallback(module, &mut ident.span)
+ } else {
+ (self.hygienic_lexical_parent(module, &mut ident.span), false)
+ };
+ module = unwrap_or!(opt_module, break);
let orig_current_module = self.current_module;
self.current_module = module; // Lexical resolutions can never be a privacy error.
let result = self.resolve_ident_in_module_unadjusted(
self.current_module = orig_current_module;
match result {
- Ok(binding) => return Some(LexicalScopeBinding::Item(binding)),
+ Ok(binding) => {
+ if poisoned {
+ self.session.buffer_lint_with_diagnostic(
+ lint::builtin::PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
+ CRATE_NODE_ID, ident.span,
+ &format!("cannot find {} `{}` in this scope", ns.descr(), ident),
+ lint::builtin::BuiltinLintDiagnostics::
+ ProcMacroDeriveResolutionFallback(ident.span),
+ );
+ }
+ return Some(LexicalScopeBinding::Item(binding))
+ }
+ _ if poisoned => break,
Err(Undetermined) => return None,
Err(Determined) => {}
}
None
}
- fn hygienic_lexical_parent(&mut self, mut module: Module<'a>, span: &mut Span)
+ fn hygienic_lexical_parent(&mut self, module: Module<'a>, span: &mut Span)
-> Option<Module<'a>> {
if !module.expansion.is_descendant_of(span.ctxt().outer()) {
return Some(self.macro_def_scope(span.remove_mark()));
return Some(module.parent.unwrap());
}
- let mut module_expansion = module.expansion.modern(); // for backward compatibility
- while let Some(parent) = module.parent {
- let parent_expansion = parent.expansion.modern();
- if module_expansion.is_descendant_of(parent_expansion) &&
- parent_expansion != module_expansion {
- return if parent_expansion.is_descendant_of(span.ctxt().outer()) {
- Some(parent)
- } else {
- None
- };
+ None
+ }
+
+ fn hygienic_lexical_parent_with_compatibility_fallback(
+ &mut self, module: Module<'a>, span: &mut Span) -> (Option<Module<'a>>, /* poisoned */ bool
+ ) {
+ if let module @ Some(..) = self.hygienic_lexical_parent(module, span) {
+ return (module, false);
+ }
+
+ // We need to support the next case under a deprecation warning
+ // ```
+ // struct MyStruct;
+ // ---- begin: this comes from a proc macro derive
+ // mod implementation_details {
+ // // Note that `MyStruct` is not in scope here.
+ // impl SomeTrait for MyStruct { ... }
+ // }
+ // ---- end
+ // ```
+ // So we have to fall back to the module's parent during lexical resolution in this case.
+ if let Some(parent) = module.parent {
+ // Inner module is inside the macro, parent module is outside of the macro.
+ if module.expansion != parent.expansion &&
+ module.expansion.is_descendant_of(parent.expansion) {
+ // The macro is a proc macro derive
+ if module.expansion.looks_like_proc_macro_derive() {
+ if parent.expansion.is_descendant_of(span.ctxt().outer()) {
+ return (module.parent, true);
+ }
+ }
}
- module = parent;
- module_expansion = parent_expansion;
}
- None
+ (None, false)
}
fn resolve_ident_in_module(&mut self,
let mut iter = ctxt.marks().into_iter().rev().peekable();
let mut result = None;
// Find the last modern mark from the end if it exists.
- while let Some(&mark) = iter.peek() {
- if mark.transparency() == Transparency::Opaque {
+ while let Some(&(mark, transparency)) = iter.peek() {
+ if transparency == Transparency::Opaque {
result = Some(mark);
iter.next();
} else {
}
}
// Then find the last legacy mark from the end if it exists.
- for mark in iter {
- if mark.transparency() == Transparency::SemiTransparent {
+ for (mark, transparency) in iter {
+ if transparency == Transparency::SemiTransparent {
result = Some(mark);
} else {
break;
let mut search_module = self.current_module;
loop {
self.get_traits_in_module_containing_item(ident, ns, search_module, &mut found_traits);
- search_module =
- unwrap_or!(self.hygienic_lexical_parent(search_module, &mut ident.span), break);
+ search_module = unwrap_or!(
+ self.hygienic_lexical_parent(search_module, &mut ident.span), break
+ );
}
if let Some(prelude) = self.prelude {
if ident.name == lookup_name && ns == namespace {
if filter_fn(name_binding.def()) {
// create the path
- let mut segms = path_segments.clone();
+ let mut segms = if self.session.rust_2018() && !in_module_is_extern {
+ // crate-local absolute paths start with `crate::` in edition 2018
+ // FIXME: may also be stabilized for Rust 2015 (Issues #45477, #44660)
+ let mut full_segms = vec![
+ ast::PathSegment::from_ident(keywords::Crate.ident())
+ ];
+ full_segms.extend(path_segments.clone());
+ full_segms
+ } else {
+ path_segments.clone()
+ };
+
segms.push(ast::PathSegment::from_ident(ident));
let path = Path {
span: name_binding.span,
(TypeNS, _) => "type",
};
- let namespace = match ns {
- ValueNS => "value",
- MacroNS => "macro",
- TypeNS => "type",
- };
-
let msg = format!("the name `{}` is defined multiple times", name);
let mut err = match (old_binding.is_extern_crate(), new_binding.is_extern_crate()) {
err.note(&format!("`{}` must be defined only once in the {} namespace of this {}",
name,
- namespace,
+ ns.descr(),
container));
err.span_label(span, format!("`{}` re{} here", name, new_participle));
use syntax::ext::base::{self, Annotatable, Determinacy, MultiModifier, MultiDecorator};
use syntax::ext::base::{MacroKind, SyntaxExtension, Resolver as SyntaxResolver};
use syntax::ext::expand::{self, AstFragment, AstFragmentKind, Invocation, InvocationKind};
-use syntax::ext::hygiene::{self, Mark, Transparency};
+use syntax::ext::hygiene::{self, Mark};
use syntax::ext::placeholders::placeholder;
use syntax::ext::tt::macro_rules;
use syntax::feature_gate::{self, emit_feature_err, GateIssue};
self.unused_macros.remove(&def_id);
let ext = self.get_macro(def);
- if ext.is_modern() {
- let transparency =
- if ext.is_transparent() { Transparency::Transparent } else { Transparency::Opaque };
- invoc.expansion_data.mark.set_transparency(transparency);
- } else if def_id.krate == BUILTIN_MACROS_CRATE {
- invoc.expansion_data.mark.set_is_builtin(true);
- }
+ invoc.expansion_data.mark.set_default_transparency(ext.default_transparency());
+ invoc.expansion_data.mark.set_is_builtin(def_id.krate == BUILTIN_MACROS_CRATE);
Ok(Some(ext))
}
("powerpc-unknown-linux-gnuspe", powerpc_unknown_linux_gnuspe),
("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu),
("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu),
+ ("powerpc64le-unknown-linux-musl", powerpc64le_unknown_linux_musl),
("s390x-unknown-linux-gnu", s390x_unknown_linux_gnu),
("sparc-unknown-linux-gnu", sparc_unknown_linux_gnu),
("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu),
/// Don't use this field; instead use the `.max_atomic_width()` method.
pub max_atomic_width: Option<u64>,
+ /// Whether the target supports atomic CAS operations natively
+ pub atomic_cas: bool,
+
/// Panic strategy: "unwind" or "abort"
pub panic_strategy: PanicStrategy,
no_integrated_as: false,
min_atomic_width: None,
max_atomic_width: None,
+ atomic_cas: true,
panic_strategy: PanicStrategy::Unwind,
abi_blacklist: vec![],
crt_static_allows_dylibs: false,
key!(no_integrated_as, bool);
key!(max_atomic_width, Option<u64>);
key!(min_atomic_width, Option<u64>);
+ key!(atomic_cas, bool);
try!(key!(panic_strategy, PanicStrategy));
key!(crt_static_allows_dylibs, bool);
key!(crt_static_default, bool);
target_option_val!(no_integrated_as);
target_option_val!(min_atomic_width);
target_option_val!(max_atomic_width);
+ target_option_val!(atomic_cas);
target_option_val!(panic_strategy);
target_option_val!(crt_static_allows_dylibs);
target_option_val!(crt_static_default);
linker: Some("msp430-elf-gcc".to_string()),
no_integrated_as: true,
- // There are no atomic instructions available in the MSP430
+ // There are no atomic CAS instructions available in the MSP430
// instruction set
- max_atomic_width: Some(0),
+ max_atomic_width: Some(16),
+ atomic_cas: false,
// Because these devices have very little resources having an
// unwinder is too onerous so we default to "abort" because the
--- /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 spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_musl_base::opts();
+ base.cpu = "ppc64le".to_string();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.max_atomic_width = Some(64);
+
+ // see #36994
+ base.exe_allocation_crate = None;
+
+ Ok(Target {
+ llvm_target: "powerpc64le-unknown-linux-musl".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-n32:64".to_string(),
+ arch: "powerpc64".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
// The ARMv6-M architecture doesn't support unaligned loads/stores so we disable them
// with +strict-align.
features: "+strict-align".to_string(),
- // There are no atomic instructions available in the instruction set of the ARMv6-M
+ // There are no atomic CAS instructions available in the instruction set of the ARMv6-M
// architecture
- max_atomic_width: Some(0),
+ atomic_cas: false,
.. super::thumb_base::opts()
}
})
.. Default::default()
};
Ok(Target {
- llvm_target: "wasm32-unknown-unknown-wasm".to_string(),
+ llvm_target: "wasm32-unknown-unknown".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
target_c_int_width: "32".to_string(),
base.max_atomic_width = Some(64);
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
base.stack_probes = true;
+ // This option is required to build executables on Haiku x86_64
+ base.position_independent_executables = true;
Ok(Target {
llvm_target: "x86_64-unknown-haiku".to_string(),
use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc::hir::map::definitions::DefPathData;
use rustc::hir::{self, ImplPolarity};
-use rustc::traits::{Clause, Clauses, DomainGoal, Goal, PolyDomainGoal, ProgramClause,
- WhereClause, FromEnv, WellFormed};
+use rustc::traits::{
+ Clause, Clauses, DomainGoal, FromEnv, Goal, PolyDomainGoal, ProgramClause, WellFormed,
+ WhereClause,
+};
use rustc::ty::query::Providers;
use rustc::ty::{self, Slice, TyCtxt};
use rustc_data_structures::fx::FxHashSet;
Predicate::RegionOutlives(predicate) => predicate.lower(),
Predicate::TypeOutlives(predicate) => predicate.lower(),
Predicate::Projection(predicate) => predicate.lower(),
- Predicate::WellFormed(ty) => ty::Binder::dummy(
- DomainGoal::WellFormed(WellFormed::Ty(*ty))
- ),
- Predicate::ObjectSafe(..) |
- Predicate::ClosureKind(..) |
- Predicate::Subtype(..) |
- Predicate::ConstEvaluatable(..) => {
- unimplemented!()
+ Predicate::WellFormed(ty) => {
+ ty::Binder::dummy(DomainGoal::WellFormed(WellFormed::Ty(*ty)))
}
+ Predicate::ObjectSafe(..)
+ | Predicate::ClosureKind(..)
+ | Predicate::Subtype(..)
+ | Predicate::ConstEvaluatable(..) => unimplemented!(),
}
}
}
-/// Transforms an existing goal into a FromEnv goal.
-///
-/// Used for lowered where clauses (see rustc guide).
+/// Used for implied bounds related rules (see rustc guide).
trait IntoFromEnvGoal {
+ /// Transforms an existing goal into a `FromEnv` goal.
fn into_from_env_goal(self) -> Self;
}
+/// Used for well-formedness related rules (see rustc guide).
+trait IntoWellFormedGoal {
+ /// Transforms an existing goal into a `WellFormed` goal.
+ fn into_well_formed_goal(self) -> Self;
+}
+
impl<'tcx> IntoFromEnvGoal for DomainGoal<'tcx> {
fn into_from_env_goal(self) -> DomainGoal<'tcx> {
use self::WhereClause::*;
match self {
- DomainGoal::Holds(Implemented(trait_ref)) => DomainGoal::FromEnv(
- FromEnv::Trait(trait_ref)
- ),
+ DomainGoal::Holds(Implemented(trait_ref)) => {
+ DomainGoal::FromEnv(FromEnv::Trait(trait_ref))
+ }
+ other => other,
+ }
+ }
+}
+
+impl<'tcx> IntoWellFormedGoal for DomainGoal<'tcx> {
+ fn into_well_formed_goal(self) -> DomainGoal<'tcx> {
+ use self::WhereClause::*;
+
+ match self {
+ DomainGoal::Holds(Implemented(trait_ref)) => {
+ DomainGoal::WellFormed(WellFormed::Trait(trait_ref))
+ }
other => other,
}
}
// `Implemented(Self: Trait<P1..Pn>)`
let impl_trait: DomainGoal = trait_pred.lower();
- // `FromEnv(Self: Trait<P1..Pn>)`
+ // `FromEnv(Self: Trait<P1..Pn>)`
let from_env_goal = impl_trait.into_from_env_goal().into_goal();
let hypotheses = tcx.intern_goals(&[from_env_goal]);
let clauses = iter::once(Clause::ForAll(ty::Binder::dummy(implemented_from_env)));
+ let where_clauses = &tcx.predicates_defined_on(def_id).predicates;
+
// Rule Implied-Bound-From-Trait
//
// For each where clause WC:
// ```
// `FromEnv(WC) :- FromEnv(Self: Trait<P1..Pn>)`, for each where clause WC
- let where_clauses = &tcx.predicates_defined_on(def_id).predicates;
let implied_bound_clauses = where_clauses
.into_iter()
.map(|wc| wc.lower())
goal: goal.into_from_env_goal(),
hypotheses,
}))
-
.map(Clause::ForAll);
- tcx.mk_clauses(clauses.chain(implied_bound_clauses))
+ // Rule WellFormed-TraitRef
+ //
+ // Here `WC` denotes the set of all where clauses:
+ // ```
+ // forall<Self, P1..Pn> {
+ // WellFormed(Self: Trait<P1..Pn>) :- Implemented(Self: Trait<P1..Pn>) && WellFormed(WC)
+ // }
+ // ```
+
+ // `Implemented(Self: Trait<P1..Pn>) && WellFormed(WC)`
+ let wf_conditions = iter::once(ty::Binder::dummy(trait_pred.lower()))
+ .chain(
+ where_clauses
+ .into_iter()
+ .map(|wc| wc.lower())
+ .map(|wc| wc.map_bound(|goal| goal.into_well_formed_goal()))
+ );
+
+ // `WellFormed(Self: Trait<P1..Pn>) :- Implemented(Self: Trait<P1..Pn>) && WellFormed(WC)`
+ let wf_clause = ProgramClause {
+ goal: DomainGoal::WellFormed(WellFormed::Trait(trait_pred)),
+ hypotheses: tcx.mk_goals(
+ wf_conditions.map(|wc| Goal::from_poly_domain_goal(wc, tcx)),
+ ),
+ };
+ let wf_clause = iter::once(Clause::ForAll(ty::Binder::dummy(wf_clause)));
+
+ tcx.mk_clauses(
+ clauses
+ .chain(implied_bound_clauses)
+ .chain(wf_clause)
+ )
}
fn program_clauses_for_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Clauses<'tcx> {
tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId,
) -> Clauses<'tcx> {
-
// Rule WellFormed-Type
//
// `struct Ty<P1..Pn> where WC1, ..., WCm`
let well_formed = ProgramClause {
goal: DomainGoal::WellFormed(WellFormed::Ty(ty)),
hypotheses: tcx.mk_goals(
- where_clauses.iter().cloned().map(|wc| Goal::from_poly_domain_goal(wc, tcx))
+ where_clauses
+ .iter()
+ .cloned()
+ .map(|wc| Goal::from_poly_domain_goal(wc, tcx)),
),
};
}
if let Some(clauses) = clauses {
- let mut err = self.tcx
+ let mut err = self
+ .tcx
.sess
.struct_span_err(attr.span, "program clause dump");
fcx.tcx.sess.err("language item required, but not found: `panic_info`");
}
}
+ }
+
+ // Check that a function marked as `#[alloc_error_handler]` has signature `fn(Layout) -> !`
+ if let Some(alloc_error_handler_did) = fcx.tcx.lang_items().oom() {
+ if alloc_error_handler_did == fcx.tcx.hir.local_def_id(fn_id) {
+ if let Some(alloc_layout_did) = fcx.tcx.lang_items().alloc_layout() {
+ if declared_ret_ty.sty != ty::TyNever {
+ fcx.tcx.sess.span_err(
+ decl.output.span(),
+ "return type should be `!`",
+ );
+ }
+
+ let inputs = fn_sig.inputs();
+ let span = fcx.tcx.hir.span(fn_id);
+ if inputs.len() == 1 {
+ let arg_is_alloc_layout = match inputs[0].sty {
+ ty::TyAdt(ref adt, _) => {
+ adt.did == alloc_layout_did
+ },
+ _ => false,
+ };
+
+ if !arg_is_alloc_layout {
+ fcx.tcx.sess.span_err(
+ decl.inputs[0].span,
+ "argument should be `Layout`",
+ );
+ }
+ if let Node::NodeItem(item) = fcx.tcx.hir.get(fn_id) {
+ if let Item_::ItemFn(_, _, ref generics, _) = item.node {
+ if !generics.params.is_empty() {
+ fcx.tcx.sess.span_err(
+ span,
+ "`#[alloc_error_handler]` function should have no type \
+ parameters",
+ );
+ }
+ }
+ }
+ } else {
+ fcx.tcx.sess.span_err(span, "function should have one argument");
+ }
+ } else {
+ fcx.tcx.sess.err("language item required, but not found: `alloc_layout`");
+ }
+ }
}
(fcx, gen_ty)
// a variation on try that just returns unit
macro_rules! ignore_err {
- ($e:expr) => (match $e { Ok(e) => e, Err(_) => return () })
+ ($e:expr) => (match $e { Ok(e) => e, Err(_) => {
+ debug!("ignoring mem-categorization error!");
+ return ()
+ }})
}
///////////////////////////////////////////////////////////////////////////
debug!("link_pattern(discr_cmt={:?}, root_pat={:?})",
discr_cmt,
root_pat);
- let _ = self.with_mc(|mc| {
+ ignore_err!(self.with_mc(|mc| {
mc.cat_pattern(discr_cmt, root_pat, |sub_cmt, sub_pat| {
match sub_pat.node {
// `ref x` pattern
_ => {}
}
})
- });
+ }));
}
/// Link lifetime of borrowed pointer resulting from autoref to lifetimes in the value being
if let Some(val) = attr.value_str() {
codegen_fn_attrs.linkage = Some(linkage_by_name(tcx, id, &val.as_str()));
}
+ } else if attr.check_name("wasm_custom_section") {
+ match attr.value_str() {
+ Some(name) => codegen_fn_attrs.wasm_custom_section = Some(name),
+ None => {
+ tcx.sess.span_err(attr.span, "must be of the form \
+ #[wasm_custom_section = \"foo\"]");
+ }
+ }
}
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use rustc::hir;
-use rustc::hir::def_id::{CrateNum, DefId};
-use rustc::hir::itemlikevisit::ItemLikeVisitor;
-use rustc::ty::{self, TyCtxt};
+use rustc::hir::def_id::DefId;
+use rustc::ty::{self, OutlivesPredicate, TyCtxt};
use util::nodemap::FxHashMap;
use super::utils::*;
-pub fn explicit_predicates<'tcx>(
- tcx: TyCtxt<'_, 'tcx, 'tcx>,
- crate_num: CrateNum,
-) -> FxHashMap<DefId, RequiredPredicates<'tcx>> {
- let mut predicates = FxHashMap::default();
-
- // iterate over the entire crate
- tcx.hir.krate().visit_all_item_likes(&mut ExplicitVisitor {
- tcx: tcx,
- explicit_predicates: &mut predicates,
- crate_num: crate_num,
- });
-
- predicates
+#[derive(Debug)]
+pub struct ExplicitPredicatesMap<'tcx> {
+ map: FxHashMap<DefId, RequiredPredicates<'tcx>>,
}
-pub struct ExplicitVisitor<'cx, 'tcx: 'cx> {
- tcx: TyCtxt<'cx, 'tcx, 'tcx>,
- explicit_predicates: &'cx mut FxHashMap<DefId, RequiredPredicates<'tcx>>,
- crate_num: CrateNum,
-}
+impl<'tcx> ExplicitPredicatesMap<'tcx> {
+ pub fn new() -> ExplicitPredicatesMap<'tcx> {
+ ExplicitPredicatesMap {
+ map: FxHashMap::default(),
+ }
+ }
-impl<'cx, 'tcx> ItemLikeVisitor<'tcx> for ExplicitVisitor<'cx, 'tcx> {
- fn visit_item(&mut self, item: &'tcx hir::Item) {
- let def_id = DefId {
- krate: self.crate_num,
- index: item.hir_id.owner,
- };
+ pub fn explicit_predicates_of(
+ &mut self,
+ tcx: TyCtxt<'_, 'tcx, 'tcx>,
+ def_id: DefId,
+ ) -> &RequiredPredicates<'tcx> {
+ self.map.entry(def_id).or_insert_with(|| {
+ let predicates = if def_id.is_local() {
+ tcx.explicit_predicates_of(def_id).predicates
+ } else {
+ tcx.predicates_of(def_id).predicates
+ };
+ let mut required_predicates = RequiredPredicates::default();
- let mut required_predicates = RequiredPredicates::default();
- let local_explicit_predicate = self.tcx.explicit_predicates_of(def_id).predicates;
+ // process predicates and convert to `RequiredPredicates` entry, see below
+ for pred in predicates.into_iter() {
+ match pred {
+ ty::Predicate::TypeOutlives(predicate) => {
+ let OutlivesPredicate(ref ty, ref reg) = predicate.skip_binder();
+ insert_outlives_predicate(tcx, (*ty).into(), reg, &mut required_predicates)
+ }
- for pred in local_explicit_predicate.into_iter() {
- match pred {
- ty::Predicate::TypeOutlives(predicate) => {
- let ty::OutlivesPredicate(ref ty, ref reg) = predicate.skip_binder();
- insert_outlives_predicate(self.tcx, (*ty).into(), reg, &mut required_predicates)
- }
+ ty::Predicate::RegionOutlives(predicate) => {
+ let OutlivesPredicate(ref reg1, ref reg2) = predicate.skip_binder();
+ insert_outlives_predicate(
+ tcx,
+ (*reg1).into(),
+ reg2,
+ &mut required_predicates,
+ )
+ }
- ty::Predicate::RegionOutlives(predicate) => {
- let ty::OutlivesPredicate(ref reg1, ref reg2) = predicate.skip_binder();
- insert_outlives_predicate(
- self.tcx,
- (*reg1).into(),
- reg2,
- &mut required_predicates,
- )
+ ty::Predicate::Trait(..)
+ | ty::Predicate::Projection(..)
+ | ty::Predicate::WellFormed(..)
+ | ty::Predicate::ObjectSafe(..)
+ | ty::Predicate::ClosureKind(..)
+ | ty::Predicate::Subtype(..)
+ | ty::Predicate::ConstEvaluatable(..) => (),
}
-
- ty::Predicate::Trait(..)
- | ty::Predicate::Projection(..)
- | ty::Predicate::WellFormed(..)
- | ty::Predicate::ObjectSafe(..)
- | ty::Predicate::ClosureKind(..)
- | ty::Predicate::Subtype(..)
- | ty::Predicate::ConstEvaluatable(..) => (),
}
- }
- self.explicit_predicates.insert(def_id, required_predicates);
+ required_predicates
+ })
}
-
- fn visit_trait_item(&mut self, _trait_item: &'tcx hir::TraitItem) {}
-
- fn visit_impl_item(&mut self, _impl_item: &'tcx hir::ImplItem) {}
}
use rustc::ty::{self, Ty, TyCtxt};
use rustc::util::nodemap::FxHashMap;
+use super::explicit::ExplicitPredicatesMap;
use super::utils::*;
/// Infer predicates for the items in the crate.
/// now be filled with inferred predicates.
pub fn infer_predicates<'tcx>(
tcx: TyCtxt<'_, 'tcx, 'tcx>,
- explicit_map: &FxHashMap<DefId, RequiredPredicates<'tcx>>,
+ explicit_map: &mut ExplicitPredicatesMap<'tcx>,
) -> FxHashMap<DefId, RequiredPredicates<'tcx>> {
debug!("infer_predicates");
tcx: TyCtxt<'cx, 'tcx, 'tcx>,
global_inferred_outlives: &'cx mut FxHashMap<DefId, RequiredPredicates<'tcx>>,
predicates_added: &'cx mut bool,
- explicit_map: &'cx FxHashMap<DefId, RequiredPredicates<'tcx>>,
+ explicit_map: &'cx mut ExplicitPredicatesMap<'tcx>,
}
impl<'cx, 'tcx> ItemLikeVisitor<'tcx> for InferVisitor<'cx, 'tcx> {
field_ty,
self.global_inferred_outlives,
&mut item_required_predicates,
- self.explicit_map,
+ &mut self.explicit_map,
);
}
}
field_ty: Ty<'tcx>,
global_inferred_outlives: &FxHashMap<DefId, RequiredPredicates<'tcx>>,
required_predicates: &mut RequiredPredicates<'tcx>,
- explicit_map: &FxHashMap<DefId, RequiredPredicates<'tcx>>,
+ explicit_map: &mut ExplicitPredicatesMap<'tcx>,
) {
for ty in field_ty.walk() {
match ty.sty {
def_id: &DefId,
substs: &[Kind<'tcx>],
required_predicates: &mut RequiredPredicates<'tcx>,
- explicit_map: &FxHashMap<DefId, RequiredPredicates<'tcx>>,
+ explicit_map: &mut ExplicitPredicatesMap<'tcx>,
ignore_self_ty: bool,
) {
debug!("def_id = {:?}", &def_id);
debug!("substs = {:?}", &substs);
debug!("explicit_map = {:?}", explicit_map);
debug!("required_predicates = {:?}", required_predicates);
- if let Some(explicit_predicates) = explicit_map.get(def_id) {
- for outlives_predicate in explicit_predicates.iter() {
- debug!("outlives_predicate = {:?}", &outlives_predicate);
+ let explicit_predicates = explicit_map.explicit_predicates_of(tcx, *def_id);
- // Careful: If we are inferring the effects of a `dyn Trait<..>`
- // type, then when we look up the predicates for `Trait`,
- // we may find some that reference `Self`. e.g., perhaps the
- // definition of `Trait` was:
- //
- // ```
- // trait Trait<'a, T> where Self: 'a { .. }
- // ```
- //
- // we want to ignore such predicates here, because
- // there is no type parameter for them to affect. Consider
- // a struct containing `dyn Trait`:
- //
- // ```
- // struct MyStruct<'x, X> { field: Box<dyn Trait<'x, X>> }
- // ```
- //
- // The `where Self: 'a` predicate refers to the *existential, hidden type*
- // that is represented by the `dyn Trait`, not to the `X` type parameter
- // (or any other generic parameter) declared on `MyStruct`.
- //
- // Note that we do this check for self **before** applying `substs`. In the
- // case that `substs` come from a `dyn Trait` type, our caller will have
- // included `Self = dyn Trait<'x, X>` as the value for `Self`. If we were
- // to apply the substs, and not filter this predicate, we might then falsely
- // conclude that e.g. `X: 'x` was a reasonable inferred requirement.
- if let UnpackedKind::Type(ty) = outlives_predicate.0.unpack() {
- if ty.is_self() && ignore_self_ty {
- debug!("skipping self ty = {:?}", &ty);
- continue;
- }
- }
+ for outlives_predicate in explicit_predicates.iter() {
+ debug!("outlives_predicate = {:?}", &outlives_predicate);
- let predicate = outlives_predicate.subst(tcx, substs);
- debug!("predicate = {:?}", &predicate);
- insert_outlives_predicate(tcx, predicate.0.into(), predicate.1, required_predicates);
+ // Careful: If we are inferring the effects of a `dyn Trait<..>`
+ // type, then when we look up the predicates for `Trait`,
+ // we may find some that reference `Self`. e.g., perhaps the
+ // definition of `Trait` was:
+ //
+ // ```
+ // trait Trait<'a, T> where Self: 'a { .. }
+ // ```
+ //
+ // we want to ignore such predicates here, because
+ // there is no type parameter for them to affect. Consider
+ // a struct containing `dyn Trait`:
+ //
+ // ```
+ // struct MyStruct<'x, X> { field: Box<dyn Trait<'x, X>> }
+ // ```
+ //
+ // The `where Self: 'a` predicate refers to the *existential, hidden type*
+ // that is represented by the `dyn Trait`, not to the `X` type parameter
+ // (or any other generic parameter) declared on `MyStruct`.
+ //
+ // Note that we do this check for self **before** applying `substs`. In the
+ // case that `substs` come from a `dyn Trait` type, our caller will have
+ // included `Self = dyn Trait<'x, X>` as the value for `Self`. If we were
+ // to apply the substs, and not filter this predicate, we might then falsely
+ // conclude that e.g. `X: 'x` was a reasonable inferred requirement.
+ if let UnpackedKind::Type(ty) = outlives_predicate.0.unpack() {
+ if ty.is_self() && ignore_self_ty {
+ debug!("skipping self ty = {:?}", &ty);
+ continue;
+ }
}
+
+ let predicate = outlives_predicate.subst(tcx, substs);
+ debug!("predicate = {:?}", &predicate);
+ insert_outlives_predicate(tcx, predicate.0.into(), predicate.1, required_predicates);
}
+ // }
}
tcx: TyCtxt<'_, 'tcx, 'tcx>,
crate_num: CrateNum,
) -> Lrc<CratePredicatesMap<'tcx>> {
+ assert_eq!(crate_num, LOCAL_CRATE);
+
// Compute a map from each struct/enum/union S to the **explicit**
// outlives predicates (`T: 'a`, `'a: 'b`) that the user wrote.
// Typically there won't be many of these, except in older code where
// for the type.
// Compute the inferred predicates
- let exp = explicit::explicit_predicates(tcx, crate_num);
- let global_inferred_outlives = implicit_infer::infer_predicates(tcx, &exp);
+ let mut exp_map = explicit::ExplicitPredicatesMap::new();
+
+ let global_inferred_outlives = implicit_infer::infer_predicates(tcx, &mut exp_map);
// Convert the inferred predicates into the "collected" form the
// global data structure expects.
force_unstable_if_unmarked: bool,
edition: Edition,
cg: CodegenOptions,
- error_format: ErrorOutputType) -> (clean::Crate, RenderInfo)
+ error_format: ErrorOutputType,
+ cmd_lints: Vec<(String, lint::Level)>,
+ lint_cap: Option<lint::Level>,
+ describe_lints: bool) -> (clean::Crate, RenderInfo)
{
// Parse, resolve, and typecheck the given crate.
let intra_link_resolution_failure_name = lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE.name;
let warnings_lint_name = lint::builtin::WARNINGS.name;
+ let missing_docs = rustc_lint::builtin::MISSING_DOCS.name;
+
+ // In addition to those specific lints, we also need to whitelist those given through
+ // command line, otherwise they'll get ignored and we don't want that.
+ let mut whitelisted_lints = vec![warnings_lint_name.to_owned(),
+ intra_link_resolution_failure_name.to_owned(),
+ missing_docs.to_owned()];
+
+ for (lint, _) in &cmd_lints {
+ whitelisted_lints.push(lint.clone());
+ }
+
let lints = lint::builtin::HardwiredLints.get_lints()
.into_iter()
.chain(rustc_lint::SoftLints.get_lints().into_iter())
Some((lint.name_lower(), lint::Allow))
}
})
+ .chain(cmd_lints.into_iter())
.collect::<Vec<_>>();
let host_triple = TargetTriple::from_triple(config::host_triple());
} else {
vec![]
},
- lint_cap: Some(lint::Forbid),
+ lint_cap: Some(lint_cap.unwrap_or_else(|| lint::Forbid)),
cg,
externs,
target_triple: triple.unwrap_or(host_triple),
},
error_format,
edition,
+ describe_lints,
..config::basic_options()
};
driver::spawn_thread_pool(sessopts, move |sessopts| {
let mut sess = session::build_session_(
sessopts, cpath, diagnostic_handler, codemap,
);
+
+ lint::builtin::HardwiredLints.get_lints()
+ .into_iter()
+ .chain(rustc_lint::SoftLints.get_lints().into_iter())
+ .filter_map(|lint| {
+ // We don't want to whitelist *all* lints so let's
+ // ignore those ones.
+ if whitelisted_lints.iter().any(|l| &lint.name == l) {
+ None
+ } else {
+ Some(lint)
+ }
+ })
+ .for_each(|l| {
+ sess.driver_lint_caps.insert(lint::LintId::of(l),
+ lint::Allow);
+ });
+
let codegen_backend = rustc_driver::get_codegen_backend(&sess);
let cstore = Rc::new(CStore::new(codegen_backend.metadata_loader()));
rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess));
&sess);
let resolver = RefCell::new(resolver);
-
abort_on_err(driver::phase_3_run_analysis_passes(&*codegen_backend,
control,
&sess,
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+use std::mem;
+
use clean::*;
pub enum FoldItem {
}
fn fold_crate(&mut self, mut c: Crate) -> Crate {
- c.module = c.module.and_then(|module| self.fold_item(module));
+ c.module = c.module.take().and_then(|module| self.fold_item(module));
- c.external_traits = c.external_traits.into_iter().map(|(k, mut v)| {
+ let traits = mem::replace(&mut c.external_traits, Default::default());
+ c.external_traits.extend(traits.into_iter().map(|(k, mut v)| {
v.items = v.items.into_iter().filter_map(|i| self.fold_item(i)).collect();
(k, v)
- }).collect();
+ }));
c
}
}
}
}
+fn check_if_allowed_tag(t: &Tag) -> bool {
+ match *t {
+ Tag::Paragraph
+ | Tag::CodeBlock(_)
+ | Tag::Item
+ | Tag::Emphasis
+ | Tag::Strong
+ | Tag::Code
+ | Tag::Link(_, _)
+ | Tag::BlockQuote => true,
+ _ => false,
+ }
+}
+
impl<'a, I: Iterator<Item = Event<'a>>> Iterator for SummaryLine<'a, I> {
type Item = Event<'a>;
self.started = true;
}
let event = self.inner.next();
- match event {
- Some(Event::Start(..)) => self.depth += 1,
- Some(Event::End(..)) => self.depth -= 1,
- _ => {}
+ let mut is_start = true;
+ let is_allowed_tag = match event {
+ Some(Event::Start(ref c)) => {
+ self.depth += 1;
+ check_if_allowed_tag(c)
+ }
+ Some(Event::End(ref c)) => {
+ self.depth -= 1;
+ is_start = false;
+ check_if_allowed_tag(c)
+ }
+ _ => true,
+ };
+ if is_allowed_tag == false {
+ if is_start {
+ Some(Event::Start(Tag::Paragraph))
+ } else {
+ Some(Event::End(Tag::Paragraph))
+ }
+ } else {
+ event
}
- event
}
}
}
};
- let p = Parser::new_with_broken_link_callback(md, Options::empty(),
- Some(&replacer));
+ let p = Parser::new_with_broken_link_callback(md, Options::empty(), Some(&replacer));
let mut s = String::new();
fn to_json(&self) -> Json {
match self.name {
Some(ref name) => {
- let mut data = BTreeMap::new();
- data.insert("n".to_owned(), name.to_json());
+ let mut data = Vec::with_capacity(2);
+ data.push(name.to_json());
if let Some(ref generics) = self.generics {
- data.insert("g".to_owned(), generics.to_json());
+ data.push(generics.to_json());
}
- Json::Object(data)
- },
+ Json::Array(data)
+ }
None => Json::Null
}
}
if self.inputs.iter().chain(self.output.iter()).any(|ref i| i.name.is_none()) {
Json::Null
} else {
- let mut data = BTreeMap::new();
- if !self.inputs.is_empty() {
- data.insert("i".to_owned(), self.inputs.to_json());
- }
+ let mut data = Vec::with_capacity(2);
+ data.push(self.inputs.to_json());
if let Some(ref output) = self.output {
- data.insert("o".to_owned(), output.to_json());
+ data.push(output.to_json());
}
- Json::Object(data)
+ Json::Array(data)
}
}
}
// with rustdoc running in parallel.
all_indexes.sort();
let mut w = try_err!(File::create(&dst), &dst);
- try_err!(writeln!(&mut w, "var searchIndex = {{}};"), &dst);
+ try_err!(writeln!(&mut w, "var N = null;var searchIndex = {{}};"), &dst);
for index in &all_indexes {
- try_err!(writeln!(&mut w, "{}", *index), &dst);
+ try_err!(write_minify_replacer(&mut w, &*index, enable_minification,
+ &[(minifier::js::Keyword::Null, "N")]),
+ &dst);
}
try_err!(writeln!(&mut w, "initSearch(searchIndex);"), &dst);
}
}
+fn write_minify_replacer<W: Write>(dst: &mut W,
+ contents: &str,
+ enable_minification: bool,
+ keywords_to_replace: &[(minifier::js::Keyword, &str)])
+ -> io::Result<()> {
+ if enable_minification {
+ writeln!(dst, "{}",
+ minifier::js::minify_and_replace_keywords(contents, keywords_to_replace))
+ } else {
+ writeln!(dst, "{}", contents)
+ }
+}
+
/// Takes a path to a source file and cleans the path to it. This canonicalizes
/// things like ".." to components which preserve the "top down" hierarchy of a
/// static HTML tree. Each component in the cleaned path will be passed as an
settings: vec![
("item-declarations", "Auto-hide item declarations.", true),
("item-attributes", "Auto-hide item attributes.", true),
+ ("trait-implementations", "Auto-hide trait implementations documentation",
+ true),
("go-to-only-result", "Directly go to item in search if there is only one result",
false),
],
var currentResults, index, searchIndex;
var MAX_LEV_DISTANCE = 3;
var MAX_RESULTS = 200;
+ var GENERICS_DATA = 1;
+ var NAME = 0;
+ var INPUTS_DATA = 0;
+ var OUTPUT_DATA = 1;
var params = getQueryStringParams();
// Populate search bar with query string search term when provided,
// match as well.
var lev_distance = MAX_LEV_DISTANCE + 1;
if (val.generics.length > 0) {
- if (obj.g && obj.g.length >= val.generics.length) {
- var elems = obj.g.slice(0);
+ if (obj.length > GENERICS_DATA &&
+ obj[GENERICS_DATA].length >= val.generics.length) {
+ var elems = obj[GENERICS_DATA].slice(0);
var total = 0;
var done = 0;
// We need to find the type that matches the most to remove it in order
// Check for type name and type generics (if any).
function checkType(obj, val, literalSearch) {
var lev_distance = MAX_LEV_DISTANCE + 1;
- if (obj.n === val.name) {
+ if (obj[NAME] === val.name) {
if (literalSearch === true) {
if (val.generics && val.generics.length !== 0) {
- if (obj.g && obj.length >= val.generics.length) {
- var elems = obj.g.slice(0);
+ if (obj.length > GENERICS_DATA &&
+ obj[GENERICS_DATA].length >= val.generics.length) {
+ var elems = obj[GENERICS_DATA].slice(0);
var allFound = true;
var x;
}
// If the type has generics but don't match, then it won't return at this point.
// Otherwise, `checkGenerics` will return 0 and it'll return.
- if (obj.g && obj.g.length !== 0) {
+ if (obj.length > GENERICS_DATA && obj[GENERICS_DATA].length !== 0) {
var tmp_lev = checkGenerics(obj, val);
if (tmp_lev <= MAX_LEV_DISTANCE) {
return tmp_lev;
}
// Names didn't match so let's check if one of the generic types could.
if (literalSearch === true) {
- if (obj.g && obj.g.length > 0) {
- for (var x = 0; x < obj.g.length; ++x) {
- if (obj.g[x] === val.name) {
+ if (obj.length > GENERICS_DATA && obj[GENERICS_DATA].length > 0) {
+ for (var x = 0; x < obj[GENERICS_DATA].length; ++x) {
+ if (obj[GENERICS_DATA][x] === val.name) {
return true;
}
}
}
return false;
}
- var lev_distance = Math.min(levenshtein(obj.n, val.name), lev_distance);
+ var lev_distance = Math.min(levenshtein(obj[NAME], val.name),
+ lev_distance);
if (lev_distance <= MAX_LEV_DISTANCE) {
lev_distance = Math.min(checkGenerics(obj, val), lev_distance);
- } else if (obj.g && obj.g.length > 0) {
+ } else if (obj.length > GENERICS_DATA && obj[GENERICS_DATA].length > 0) {
// We can check if the type we're looking for is inside the generics!
- for (var x = 0; x < obj.g.length; ++x) {
- lev_distance = Math.min(levenshtein(obj.g[x], val.name),
+ for (var x = 0; x < obj[GENERICS_DATA].length; ++x) {
+ lev_distance = Math.min(levenshtein(obj[GENERICS_DATA][x], val.name),
lev_distance);
}
}
function findArg(obj, val, literalSearch) {
var lev_distance = MAX_LEV_DISTANCE + 1;
- if (obj && obj.type && obj.type.i && obj.type.i.length > 0) {
- for (var i = 0; i < obj.type.i.length; i++) {
- var tmp = checkType(obj.type.i[i], val, literalSearch);
+ if (obj && obj.type && obj.type[INPUTS_DATA] &&
+ obj.type[INPUTS_DATA].length > 0) {
+ for (var i = 0; i < obj.type[INPUTS_DATA].length; i++) {
+ var tmp = checkType(obj.type[INPUTS_DATA][i], val, literalSearch);
if (literalSearch === true && tmp === true) {
return true;
}
function checkReturned(obj, val, literalSearch) {
var lev_distance = MAX_LEV_DISTANCE + 1;
- if (obj && obj.type && obj.type.o) {
- var tmp = checkType(obj.type.o, val, literalSearch);
+ if (obj && obj.type && obj.type.length > OUTPUT_DATA) {
+ var tmp = checkType(obj.type[OUTPUT_DATA], val, literalSearch);
if (literalSearch === true && tmp === true) {
return true;
}
var fullId = generateId(ty);
// allow searching for void (no output) functions as well
- var typeOutput = type.o ? type.o.name : "";
+ var typeOutput = type.length > OUTPUT_DATA ? type[OUTPUT_DATA].name : "";
var returned = checkReturned(ty, output, true);
if (output.name === "*" || returned === true) {
var in_args = false;
if (collapse) {
toggleAllDocs(pageId, true);
}
- onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
- // inherent impl ids are like 'impl' or impl-<number>'.
- // they will never be hidden by default.
- var n = e.parentNode;
- if (n.id.match(/^impl(?:-\d+)?$/) === null) {
- // Automatically minimize all non-inherent impls
- if (collapse || hasClass(n, 'impl')) {
- collapseDocs(e, "hide", pageId);
+ if (getCurrentValue('rustdoc-trait-implementations') !== "false") {
+ onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
+ // inherent impl ids are like 'impl' or impl-<number>'.
+ // they will never be hidden by default.
+ var n = e.parentNode;
+ if (n.id.match(/^impl(?:-\d+)?$/) === null) {
+ // Automatically minimize all non-inherent impls
+ if (collapse || hasClass(n, 'impl')) {
+ collapseDocs(e, "hide", pageId);
+ }
}
- }
- });
+ });
+ }
}
var x = document.getElementById('toggle-all-docs');
.content .highlighted {
color: #eee !important;
- background-color: #333;
+ background-color: #616161;
}
.content .highlighted a, .content .highlighted span { color: #eee !important; }
.content .highlighted.trait { background-color: #013191; }
use rustc::session::config::{ErrorOutputType, RustcOptGroup, Externs, CodegenOptions};
use rustc::session::config::{nightly_options, build_codegen_options};
use rustc_target::spec::TargetTriple;
+use rustc::session::config::get_cmd_lint_options;
#[macro_use]
pub mod externalfiles;
"disable-minification",
"Disable minification applied on JS files")
}),
+ unstable("warn", |o| {
+ o.optmulti("W", "warn", "Set lint warnings", "OPT")
+ }),
+ unstable("allow", |o| {
+ o.optmulti("A", "allow", "Set lint allowed", "OPT")
+ }),
+ unstable("deny", |o| {
+ o.optmulti("D", "deny", "Set lint denied", "OPT")
+ }),
+ unstable("forbid", |o| {
+ o.optmulti("F", "forbid", "Set lint forbidden", "OPT")
+ }),
+ unstable("cap-lints", |o| {
+ o.optmulti(
+ "",
+ "cap-lints",
+ "Set the most restrictive lint level. \
+ More restrictive lints are capped at this \
+ level. By default, it is at `forbid` level.",
+ "LEVEL",
+ )
+ }),
]
}
*x == "force-unstable-if-unmarked"
});
+ let (lint_opts, describe_lints, lint_cap) = get_cmd_lint_options(matches, error_format);
+
let (tx, rx) = channel();
rustc_driver::monitor(move || syntax::with_globals(move || {
let (mut krate, renderinfo) =
core::run_core(paths, cfgs, externs, Input::File(cratefile), triple, maybe_sysroot,
display_warnings, crate_name.clone(),
- force_unstable_if_unmarked, edition, cg, error_format);
+ force_unstable_if_unmarked, edition, cg, error_format,
+ lint_opts, lint_cap, describe_lints);
info!("finished with rustc");
});
true
}
- hir_map::NodeStructCtor(_) if !glob => {
- // struct constructors always show up alongside their struct definitions, we've
- // already processed that so just discard this
- true
- }
_ => false,
};
self.view_item_stack.remove(&def_node_id);
hir::ItemUse(ref path, kind) => {
let is_glob = kind == hir::UseKind::Glob;
+ // struct and variant constructors always show up alongside their definitions, we've
+ // already processed them so just discard these.
+ match path.def {
+ Def::StructCtor(..) | Def::VariantCtor(..) => return,
+ _ => {}
+ }
+
// If there was a private module in the current path then don't bother inlining
// anything as it will probably be stripped anyway.
if item.vis.node.is_pub() && self.inside_public_path {
#[cfg(not(test))]
#[doc(hidden)]
-#[lang = "oom"]
+#[cfg_attr(stage0, lang = "oom")]
+#[cfg_attr(not(stage0), alloc_error_handler)]
#[unstable(feature = "alloc_internals", issue = "0")]
-pub extern fn rust_oom(layout: Layout) -> ! {
+pub fn rust_oom(layout: Layout) -> ! {
let hook = HOOK.load(Ordering::SeqCst);
let hook: fn(Layout) = if hook.is_null() {
default_alloc_error_hook
if !target.contains("apple-ios") &&
!target.contains("solaris") &&
!target.contains("redox") &&
- !target.contains("android") {
+ !target.contains("android") &&
+ !target.contains("haiku") {
build.define("HAVE_DL_ITERATE_PHDR", "1");
}
build.define("_GNU_SOURCE", "1");
///
/// # Unix
///
-/// Returns the value of the 'HOME' environment variable if it is set
-/// and not equal to the empty string. Otherwise, it tries to determine the
-/// home directory by invoking the `getpwuid_r` function on the UID of the
-/// current user.
+/// - Returns the value of the 'HOME' environment variable if it is set
+/// (including to an empty string).
+/// - Otherwise, it tries to determine the home directory by invoking the `getpwuid_r` function
+/// using the UID of the current user. An empty home directory field returned from the
+/// `getpwuid_r` function is considered to be a valid value.
+/// - Returns `None` if the current user has no entry in the /etc/passwd file.
///
/// # Windows
///
-/// Returns the value of the 'HOME' environment variable if it is
-/// set and not equal to the empty string. Otherwise, returns the value of the
-/// 'USERPROFILE' environment variable if it is set and not equal to the empty
-/// string. If both do not exist, [`GetUserProfileDirectory`][msdn] is used to
-/// return the appropriate path.
+/// - Returns the value of the 'HOME' environment variable if it is set
+/// (including to an empty string).
+/// - Otherwise, returns the value of the 'USERPROFILE' environment variable if it is set
+/// (including to an empty string).
+/// - If both do not exist, [`GetUserProfileDirectory`][msdn] is used to return the path.
///
/// [msdn]: https://msdn.microsoft.com/en-us/library/windows/desktop/bb762280(v=vs.85).aspx
///
/// use std::env;
///
/// match env::home_dir() {
-/// Some(path) => println!("{}", path.display()),
+/// Some(path) => println!("Your home directory, probably: {}", path.display()),
/// None => println!("Impossible to get your home dir!"),
/// }
/// ```
+#[rustc_deprecated(since = "1.29.0",
+ reason = "This function's behavior is unexpected and probably not what you want. \
+ Consider using the home_dir function from crates.io/crates/dirs instead.")]
#[stable(feature = "env", since = "1.0.0")]
pub fn home_dir() -> Option<PathBuf> {
os_imp::home_dir()
/// use std::fs::File;
///
/// fn main() -> std::io::Result<()> {
- /// let mut f = File::open("foo.txt")?;
- /// # Ok(())
- /// # }
+ /// let mut f = File::open("foo.txt")?;
+ /// Ok(())
+ /// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn open<P: AsRef<Path>>(path: P) -> io::Result<File> {
// std is implemented with unstable features, many of which are internal
// compiler details that will never be stable
#![feature(alloc)]
-#![feature(allocator_api)]
+#![feature(alloc_error_handler)]
#![feature(alloc_system)]
+#![feature(allocator_api)]
#![feature(allocator_internals)]
#![feature(allow_internal_unsafe)]
#![feature(allow_internal_unstable)]
//!
//! See the [module-level documentation](../index.html) for more.
+
+
#![stable(feature = "rust1", since = "1.0.0")]
// Re-exported core operators
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use marker::{Copy, Send, Sized, Sync};
+#[doc(no_inline)]
+pub use marker::{Copy, Send, Sized, Sync};
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use ops::{Drop, Fn, FnMut, FnOnce};
+#[doc(no_inline)]
+pub use ops::{Drop, Fn, FnMut, FnOnce};
// Re-exported functions
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use mem::drop;
+#[doc(no_inline)]
+pub use mem::drop;
// Re-exported types and traits
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use boxed::Box;
+#[doc(no_inline)]
+pub use clone::Clone;
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use borrow::ToOwned;
+#[doc(no_inline)]
+pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use clone::Clone;
+#[doc(no_inline)]
+pub use convert::{AsRef, AsMut, Into, From};
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
+#[doc(no_inline)]
+pub use default::Default;
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use convert::{AsRef, AsMut, Into, From};
+#[doc(no_inline)]
+pub use iter::{Iterator, Extend, IntoIterator};
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use default::Default;
+#[doc(no_inline)]
+pub use iter::{DoubleEndedIterator, ExactSizeIterator};
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use iter::{Iterator, Extend, IntoIterator};
+#[doc(no_inline)]
+pub use option::Option::{self, Some, None};
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use iter::{DoubleEndedIterator, ExactSizeIterator};
+#[doc(no_inline)]
+pub use result::Result::{self, Ok, Err};
+
+
+// The file so far is equivalent to src/libcore/prelude/v1.rs,
+// and below to src/liballoc/prelude.rs.
+// Those files are duplicated rather than using glob imports
+// because we want docs to show these re-exports as pointing to within `std`.
+
+
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use option::Option::{self, Some, None};
+#[doc(no_inline)]
+pub use boxed::Box;
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use result::Result::{self, Ok, Err};
+#[doc(no_inline)]
+pub use borrow::ToOwned;
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use slice::SliceConcatExt;
+#[doc(no_inline)]
+pub use slice::SliceConcatExt;
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use string::{String, ToString};
+#[doc(no_inline)]
+pub use string::{String, ToString};
#[stable(feature = "rust1", since = "1.0.0")]
-#[doc(no_inline)] pub use vec::Vec;
+#[doc(no_inline)]
+pub use vec::Vec;
// Helper struct used to clean up after a closure call with a `Drop`
// implementation to also run on panic.
-struct Finish {
+struct Finish<'a> {
panicked: bool,
- me: &'static Once,
+ me: &'a Once,
}
impl Once {
///
/// [poison]: struct.Mutex.html#poisoning
#[stable(feature = "rust1", since = "1.0.0")]
- pub fn call_once<F>(&'static self, f: F) where F: FnOnce() {
+ pub fn call_once<F>(&self, f: F) where F: FnOnce() {
// Fast path, just see if we've completed initialization.
if self.state.load(Ordering::SeqCst) == COMPLETE {
return
/// INIT.call_once(|| {});
/// ```
#[unstable(feature = "once_poison", issue = "33577")]
- pub fn call_once_force<F>(&'static self, f: F) where F: FnOnce(&OnceState) {
+ pub fn call_once_force<F>(&self, f: F) where F: FnOnce(&OnceState) {
// same as above, just with a different parameter to `call_inner`.
if self.state.load(Ordering::SeqCst) == COMPLETE {
return
// currently no way to take an `FnOnce` and call it via virtual dispatch
// without some allocation overhead.
#[cold]
- fn call_inner(&'static self,
+ fn call_inner(&self,
ignore_poisoning: bool,
init: &mut FnMut(bool)) {
let mut state = self.state.load(Ordering::SeqCst);
}
}
-impl Drop for Finish {
+impl<'a> Drop for Finish<'a> {
fn drop(&mut self) {
// Swap out our state with however we finished. We should only ever see
// an old state which was RUNNING.
pub mod ffi;
pub mod fs;
pub mod io;
+pub mod net;
pub mod process;
pub mod thread;
--- /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.
+
+#![unstable(feature = "unix_socket_redox", reason = "new feature", issue="51553")]
+
+//! Unix-specific networking functionality
+
+use fmt;
+use io::{self, Error, ErrorKind, Initializer};
+use net::Shutdown;
+use os::unix::io::{RawFd, AsRawFd, FromRawFd, IntoRawFd};
+use path::Path;
+use time::Duration;
+use sys::{cvt, fd::FileDesc, syscall};
+
+/// An address associated with a Unix socket.
+///
+/// # Examples
+///
+/// ```
+/// use std::os::unix::net::UnixListener;
+///
+/// let socket = match UnixListener::bind("/tmp/sock") {
+/// Ok(sock) => sock,
+/// Err(e) => {
+/// println!("Couldn't bind: {:?}", e);
+/// return
+/// }
+/// };
+/// let addr = socket.local_addr().expect("Couldn't get local address");
+/// ```
+#[derive(Clone)]
+pub struct SocketAddr(());
+
+impl SocketAddr {
+ /// Returns the contents of this address if it is a `pathname` address.
+ ///
+ /// # Examples
+ ///
+ /// With a pathname:
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixListener;
+ /// use std::path::Path;
+ ///
+ /// let socket = UnixListener::bind("/tmp/sock").unwrap();
+ /// let addr = socket.local_addr().expect("Couldn't get local address");
+ /// assert_eq!(addr.as_pathname(), Some(Path::new("/tmp/sock")));
+ /// ```
+ ///
+ /// Without a pathname:
+ ///
+ /// ```
+ /// use std::os::unix::net::UnixDatagram;
+ ///
+ /// let socket = UnixDatagram::unbound().unwrap();
+ /// let addr = socket.local_addr().expect("Couldn't get local address");
+ /// assert_eq!(addr.as_pathname(), None);
+ /// ```
+ pub fn as_pathname(&self) -> Option<&Path> {
+ None
+ }
+
+ /// Returns true if and only if the address is unnamed.
+ ///
+ /// # Examples
+ ///
+ /// A named address:
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixListener;
+ ///
+ /// let socket = UnixListener::bind("/tmp/sock").unwrap();
+ /// let addr = socket.local_addr().expect("Couldn't get local address");
+ /// assert_eq!(addr.is_unnamed(), false);
+ /// ```
+ ///
+ /// An unnamed address:
+ ///
+ /// ```
+ /// use std::os::unix::net::UnixDatagram;
+ ///
+ /// let socket = UnixDatagram::unbound().unwrap();
+ /// let addr = socket.local_addr().expect("Couldn't get local address");
+ /// assert_eq!(addr.is_unnamed(), true);
+ /// ```
+ pub fn is_unnamed(&self) -> bool {
+ false
+ }
+}
+impl fmt::Debug for SocketAddr {
+ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+ write!(fmt, "SocketAddr")
+ }
+}
+
+/// A Unix stream socket.
+///
+/// # Examples
+///
+/// ```no_run
+/// use std::os::unix::net::UnixStream;
+/// use std::io::prelude::*;
+///
+/// let mut stream = UnixStream::connect("/path/to/my/socket").unwrap();
+/// stream.write_all(b"hello world").unwrap();
+/// let mut response = String::new();
+/// stream.read_to_string(&mut response).unwrap();
+/// println!("{}", response);
+/// ```
+pub struct UnixStream(FileDesc);
+
+impl fmt::Debug for UnixStream {
+ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+ let mut builder = fmt.debug_struct("UnixStream");
+ builder.field("fd", &self.0.raw());
+ if let Ok(addr) = self.local_addr() {
+ builder.field("local", &addr);
+ }
+ if let Ok(addr) = self.peer_addr() {
+ builder.field("peer", &addr);
+ }
+ builder.finish()
+ }
+}
+
+impl UnixStream {
+ /// Connects to the socket named by `path`.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ ///
+ /// let socket = match UnixStream::connect("/tmp/sock") {
+ /// Ok(sock) => sock,
+ /// Err(e) => {
+ /// println!("Couldn't connect: {:?}", e);
+ /// return
+ /// }
+ /// };
+ /// ```
+ pub fn connect<P: AsRef<Path>>(path: P) -> io::Result<UnixStream> {
+ if let Some(s) = path.as_ref().to_str() {
+ cvt(syscall::open(format!("chan:{}", s), syscall::O_CLOEXEC))
+ .map(FileDesc::new)
+ .map(UnixStream)
+ } else {
+ Err(Error::new(
+ ErrorKind::Other,
+ "UnixStream::connect: non-utf8 paths not supported on redox"
+ ))
+ }
+ }
+
+ /// Creates an unnamed pair of connected sockets.
+ ///
+ /// Returns two `UnixStream`s which are connected to each other.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ ///
+ /// let (sock1, sock2) = match UnixStream::pair() {
+ /// Ok((sock1, sock2)) => (sock1, sock2),
+ /// Err(e) => {
+ /// println!("Couldn't create a pair of sockets: {:?}", e);
+ /// return
+ /// }
+ /// };
+ /// ```
+ pub fn pair() -> io::Result<(UnixStream, UnixStream)> {
+ let server = cvt(syscall::open("chan:", syscall::O_CREAT | syscall::O_CLOEXEC))
+ .map(FileDesc::new)?;
+ let client = server.duplicate_path(b"connect")?;
+ let stream = server.duplicate_path(b"listen")?;
+ Ok((UnixStream(client), UnixStream(stream)))
+ }
+
+ /// Creates a new independently owned handle to the underlying socket.
+ ///
+ /// The returned `UnixStream` is a reference to the same stream that this
+ /// object references. Both handles will read and write the same stream of
+ /// data, and options set on one stream will be propagated to the other
+ /// stream.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ ///
+ /// let socket = UnixStream::connect("/tmp/sock").unwrap();
+ /// let sock_copy = socket.try_clone().expect("Couldn't clone socket");
+ /// ```
+ pub fn try_clone(&self) -> io::Result<UnixStream> {
+ self.0.duplicate().map(UnixStream)
+ }
+
+ /// Returns the socket address of the local half of this connection.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ ///
+ /// let socket = UnixStream::connect("/tmp/sock").unwrap();
+ /// let addr = socket.local_addr().expect("Couldn't get local address");
+ /// ```
+ pub fn local_addr(&self) -> io::Result<SocketAddr> {
+ Err(Error::new(ErrorKind::Other, "UnixStream::local_addr unimplemented on redox"))
+ }
+
+ /// Returns the socket address of the remote half of this connection.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ ///
+ /// let socket = UnixStream::connect("/tmp/sock").unwrap();
+ /// let addr = socket.peer_addr().expect("Couldn't get peer address");
+ /// ```
+ pub fn peer_addr(&self) -> io::Result<SocketAddr> {
+ Err(Error::new(ErrorKind::Other, "UnixStream::peer_addr unimplemented on redox"))
+ }
+
+ /// Sets the read timeout for the socket.
+ ///
+ /// If the provided value is [`None`], then [`read`] calls will block
+ /// indefinitely. An [`Err`] is returned if the zero [`Duration`] is passed to this
+ /// method.
+ ///
+ /// [`None`]: ../../../../std/option/enum.Option.html#variant.None
+ /// [`Err`]: ../../../../std/result/enum.Result.html#variant.Err
+ /// [`read`]: ../../../../std/io/trait.Read.html#tymethod.read
+ /// [`Duration`]: ../../../../std/time/struct.Duration.html
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ /// use std::time::Duration;
+ ///
+ /// let socket = UnixStream::connect("/tmp/sock").unwrap();
+ /// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout");
+ /// ```
+ ///
+ /// An [`Err`] is returned if the zero [`Duration`] is passed to this
+ /// method:
+ ///
+ /// ```no_run
+ /// use std::io;
+ /// use std::os::unix::net::UnixStream;
+ /// use std::time::Duration;
+ ///
+ /// let socket = UnixStream::connect("/tmp/sock").unwrap();
+ /// let result = socket.set_read_timeout(Some(Duration::new(0, 0)));
+ /// let err = result.unwrap_err();
+ /// assert_eq!(err.kind(), io::ErrorKind::InvalidInput)
+ /// ```
+ pub fn set_read_timeout(&self, _timeout: Option<Duration>) -> io::Result<()> {
+ Err(Error::new(ErrorKind::Other, "UnixStream::set_read_timeout unimplemented on redox"))
+ }
+
+ /// Sets the write timeout for the socket.
+ ///
+ /// If the provided value is [`None`], then [`write`] calls will block
+ /// indefinitely. An [`Err`] is returned if the zero [`Duration`] is
+ /// passed to this method.
+ ///
+ /// [`None`]: ../../../../std/option/enum.Option.html#variant.None
+ /// [`Err`]: ../../../../std/result/enum.Result.html#variant.Err
+ /// [`write`]: ../../../../std/io/trait.Write.html#tymethod.write
+ /// [`Duration`]: ../../../../std/time/struct.Duration.html
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ /// use std::time::Duration;
+ ///
+ /// let socket = UnixStream::connect("/tmp/sock").unwrap();
+ /// socket.set_write_timeout(Some(Duration::new(1, 0))).expect("Couldn't set write timeout");
+ /// ```
+ ///
+ /// An [`Err`] is returned if the zero [`Duration`] is passed to this
+ /// method:
+ ///
+ /// ```no_run
+ /// use std::io;
+ /// use std::net::UdpSocket;
+ /// use std::time::Duration;
+ ///
+ /// let socket = UdpSocket::bind("127.0.0.1:34254").unwrap();
+ /// let result = socket.set_write_timeout(Some(Duration::new(0, 0)));
+ /// let err = result.unwrap_err();
+ /// assert_eq!(err.kind(), io::ErrorKind::InvalidInput)
+ /// ```
+ pub fn set_write_timeout(&self, _timeout: Option<Duration>) -> io::Result<()> {
+ Err(Error::new(ErrorKind::Other, "UnixStream::set_write_timeout unimplemented on redox"))
+ }
+
+ /// Returns the read timeout of this socket.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ /// use std::time::Duration;
+ ///
+ /// let socket = UnixStream::connect("/tmp/sock").unwrap();
+ /// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout");
+ /// assert_eq!(socket.read_timeout().unwrap(), Some(Duration::new(1, 0)));
+ /// ```
+ pub fn read_timeout(&self) -> io::Result<Option<Duration>> {
+ Err(Error::new(ErrorKind::Other, "UnixStream::read_timeout unimplemented on redox"))
+ }
+
+ /// Returns the write timeout of this socket.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ /// use std::time::Duration;
+ ///
+ /// let socket = UnixStream::connect("/tmp/sock").unwrap();
+ /// socket.set_write_timeout(Some(Duration::new(1, 0))).expect("Couldn't set write timeout");
+ /// assert_eq!(socket.write_timeout().unwrap(), Some(Duration::new(1, 0)));
+ /// ```
+ pub fn write_timeout(&self) -> io::Result<Option<Duration>> {
+ Err(Error::new(ErrorKind::Other, "UnixStream::write_timeout unimplemented on redox"))
+ }
+
+ /// Moves the socket into or out of nonblocking mode.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ ///
+ /// let socket = UnixStream::connect("/tmp/sock").unwrap();
+ /// socket.set_nonblocking(true).expect("Couldn't set nonblocking");
+ /// ```
+ pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
+ self.0.set_nonblocking(nonblocking)
+ }
+
+ /// Returns the value of the `SO_ERROR` option.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ ///
+ /// let socket = UnixStream::connect("/tmp/sock").unwrap();
+ /// if let Ok(Some(err)) = socket.take_error() {
+ /// println!("Got error: {:?}", err);
+ /// }
+ /// ```
+ ///
+ /// # Platform specific
+ /// On Redox this always returns None.
+ pub fn take_error(&self) -> io::Result<Option<io::Error>> {
+ Ok(None)
+ }
+
+ /// Shuts down the read, write, or both halves of this connection.
+ ///
+ /// This function will cause all pending and future I/O calls on the
+ /// specified portions to immediately return with an appropriate value
+ /// (see the documentation of [`Shutdown`]).
+ ///
+ /// [`Shutdown`]: ../../../../std/net/enum.Shutdown.html
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixStream;
+ /// use std::net::Shutdown;
+ ///
+ /// let socket = UnixStream::connect("/tmp/sock").unwrap();
+ /// socket.shutdown(Shutdown::Both).expect("shutdown function failed");
+ /// ```
+ pub fn shutdown(&self, _how: Shutdown) -> io::Result<()> {
+ Err(Error::new(ErrorKind::Other, "UnixStream::shutdown unimplemented on redox"))
+ }
+}
+
+impl io::Read for UnixStream {
+ fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
+ io::Read::read(&mut &*self, buf)
+ }
+
+ #[inline]
+ unsafe fn initializer(&self) -> Initializer {
+ Initializer::nop()
+ }
+}
+
+impl<'a> io::Read for &'a UnixStream {
+ fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
+ self.0.read(buf)
+ }
+
+ #[inline]
+ unsafe fn initializer(&self) -> Initializer {
+ Initializer::nop()
+ }
+}
+
+impl io::Write for UnixStream {
+ fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+ io::Write::write(&mut &*self, buf)
+ }
+
+ fn flush(&mut self) -> io::Result<()> {
+ io::Write::flush(&mut &*self)
+ }
+}
+
+impl<'a> io::Write for &'a UnixStream {
+ fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+ self.0.write(buf)
+ }
+
+ fn flush(&mut self) -> io::Result<()> {
+ Ok(())
+ }
+}
+
+impl AsRawFd for UnixStream {
+ fn as_raw_fd(&self) -> RawFd {
+ self.0.raw()
+ }
+}
+
+impl FromRawFd for UnixStream {
+ unsafe fn from_raw_fd(fd: RawFd) -> UnixStream {
+ UnixStream(FileDesc::new(fd))
+ }
+}
+
+impl IntoRawFd for UnixStream {
+ fn into_raw_fd(self) -> RawFd {
+ self.0.into_raw()
+ }
+}
+
+/// A structure representing a Unix domain socket server.
+///
+/// # Examples
+///
+/// ```no_run
+/// use std::thread;
+/// use std::os::unix::net::{UnixStream, UnixListener};
+///
+/// fn handle_client(stream: UnixStream) {
+/// // ...
+/// }
+///
+/// let listener = UnixListener::bind("/path/to/the/socket").unwrap();
+///
+/// // accept connections and process them, spawning a new thread for each one
+/// for stream in listener.incoming() {
+/// match stream {
+/// Ok(stream) => {
+/// /* connection succeeded */
+/// thread::spawn(|| handle_client(stream));
+/// }
+/// Err(err) => {
+/// /* connection failed */
+/// break;
+/// }
+/// }
+/// }
+/// ```
+pub struct UnixListener(FileDesc);
+
+impl fmt::Debug for UnixListener {
+ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+ let mut builder = fmt.debug_struct("UnixListener");
+ builder.field("fd", &self.0.raw());
+ if let Ok(addr) = self.local_addr() {
+ builder.field("local", &addr);
+ }
+ builder.finish()
+ }
+}
+
+impl UnixListener {
+ /// Creates a new `UnixListener` bound to the specified socket.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixListener;
+ ///
+ /// let listener = match UnixListener::bind("/path/to/the/socket") {
+ /// Ok(sock) => sock,
+ /// Err(e) => {
+ /// println!("Couldn't connect: {:?}", e);
+ /// return
+ /// }
+ /// };
+ /// ```
+ pub fn bind<P: AsRef<Path>>(path: P) -> io::Result<UnixListener> {
+ if let Some(s) = path.as_ref().to_str() {
+ cvt(syscall::open(format!("chan:{}", s), syscall::O_CREAT | syscall::O_CLOEXEC))
+ .map(FileDesc::new)
+ .map(UnixListener)
+ } else {
+ Err(Error::new(
+ ErrorKind::Other,
+ "UnixListener::bind: non-utf8 paths not supported on redox"
+ ))
+ }
+ }
+
+ /// Accepts a new incoming connection to this listener.
+ ///
+ /// This function will block the calling thread until a new Unix connection
+ /// is established. When established, the corresponding [`UnixStream`] and
+ /// the remote peer's address will be returned.
+ ///
+ /// [`UnixStream`]: ../../../../std/os/unix/net/struct.UnixStream.html
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixListener;
+ ///
+ /// let listener = UnixListener::bind("/path/to/the/socket").unwrap();
+ ///
+ /// match listener.accept() {
+ /// Ok((socket, addr)) => println!("Got a client: {:?}", addr),
+ /// Err(e) => println!("accept function failed: {:?}", e),
+ /// }
+ /// ```
+ pub fn accept(&self) -> io::Result<(UnixStream, SocketAddr)> {
+ self.0.duplicate_path(b"listen").map(|fd| (UnixStream(fd), SocketAddr(())))
+ }
+
+ /// Creates a new independently owned handle to the underlying socket.
+ ///
+ /// The returned `UnixListener` is a reference to the same socket that this
+ /// object references. Both handles can be used to accept incoming
+ /// connections and options set on one listener will affect the other.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixListener;
+ ///
+ /// let listener = UnixListener::bind("/path/to/the/socket").unwrap();
+ ///
+ /// let listener_copy = listener.try_clone().expect("try_clone failed");
+ /// ```
+ pub fn try_clone(&self) -> io::Result<UnixListener> {
+ self.0.duplicate().map(UnixListener)
+ }
+
+ /// Returns the local socket address of this listener.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixListener;
+ ///
+ /// let listener = UnixListener::bind("/path/to/the/socket").unwrap();
+ ///
+ /// let addr = listener.local_addr().expect("Couldn't get local address");
+ /// ```
+ pub fn local_addr(&self) -> io::Result<SocketAddr> {
+ Err(Error::new(ErrorKind::Other, "UnixListener::local_addr unimplemented on redox"))
+ }
+
+ /// Moves the socket into or out of nonblocking mode.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixListener;
+ ///
+ /// let listener = UnixListener::bind("/path/to/the/socket").unwrap();
+ ///
+ /// listener.set_nonblocking(true).expect("Couldn't set non blocking");
+ /// ```
+ pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
+ self.0.set_nonblocking(nonblocking)
+ }
+
+ /// Returns the value of the `SO_ERROR` option.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::os::unix::net::UnixListener;
+ ///
+ /// let listener = UnixListener::bind("/tmp/sock").unwrap();
+ ///
+ /// if let Ok(Some(err)) = listener.take_error() {
+ /// println!("Got error: {:?}", err);
+ /// }
+ /// ```
+ ///
+ /// # Platform specific
+ /// On Redox this always returns None.
+ pub fn take_error(&self) -> io::Result<Option<io::Error>> {
+ Ok(None)
+ }
+
+ /// Returns an iterator over incoming connections.
+ ///
+ /// The iterator will never return [`None`] and will also not yield the
+ /// peer's [`SocketAddr`] structure.
+ ///
+ /// [`None`]: ../../../../std/option/enum.Option.html#variant.None
+ /// [`SocketAddr`]: struct.SocketAddr.html
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// use std::thread;
+ /// use std::os::unix::net::{UnixStream, UnixListener};
+ ///
+ /// fn handle_client(stream: UnixStream) {
+ /// // ...
+ /// }
+ ///
+ /// let listener = UnixListener::bind("/path/to/the/socket").unwrap();
+ ///
+ /// for stream in listener.incoming() {
+ /// match stream {
+ /// Ok(stream) => {
+ /// thread::spawn(|| handle_client(stream));
+ /// }
+ /// Err(err) => {
+ /// break;
+ /// }
+ /// }
+ /// }
+ /// ```
+ pub fn incoming<'a>(&'a self) -> Incoming<'a> {
+ Incoming { listener: self }
+ }
+}
+
+impl AsRawFd for UnixListener {
+ fn as_raw_fd(&self) -> RawFd {
+ self.0.raw()
+ }
+}
+
+impl FromRawFd for UnixListener {
+ unsafe fn from_raw_fd(fd: RawFd) -> UnixListener {
+ UnixListener(FileDesc::new(fd))
+ }
+}
+
+impl IntoRawFd for UnixListener {
+ fn into_raw_fd(self) -> RawFd {
+ self.0.into_raw()
+ }
+}
+
+impl<'a> IntoIterator for &'a UnixListener {
+ type Item = io::Result<UnixStream>;
+ type IntoIter = Incoming<'a>;
+
+ fn into_iter(self) -> Incoming<'a> {
+ self.incoming()
+ }
+}
+
+/// An iterator over incoming connections to a [`UnixListener`].
+///
+/// It will never return [`None`].
+///
+/// [`None`]: ../../../../std/option/enum.Option.html#variant.None
+/// [`UnixListener`]: struct.UnixListener.html
+///
+/// # Examples
+///
+/// ```no_run
+/// use std::thread;
+/// use std::os::unix::net::{UnixStream, UnixListener};
+///
+/// fn handle_client(stream: UnixStream) {
+/// // ...
+/// }
+///
+/// let listener = UnixListener::bind("/path/to/the/socket").unwrap();
+///
+/// for stream in listener.incoming() {
+/// match stream {
+/// Ok(stream) => {
+/// thread::spawn(|| handle_client(stream));
+/// }
+/// Err(err) => {
+/// break;
+/// }
+/// }
+/// }
+/// ```
+#[derive(Debug)]
+pub struct Incoming<'a> {
+ listener: &'a UnixListener,
+}
+
+impl<'a> Iterator for Incoming<'a> {
+ type Item = io::Result<UnixStream>;
+
+ fn next(&mut self) -> Option<io::Result<UnixStream>> {
+ Some(self.listener.accept().map(|s| s.0))
+ }
+
+ fn size_hint(&self) -> (usize, Option<usize>) {
+ (usize::max_value(), None)
+ }
+}
}
pub fn duplicate(&self) -> io::Result<FileDesc> {
- let new_fd = cvt(syscall::dup(self.fd, &[]))?;
+ self.duplicate_path(&[])
+ }
+ pub fn duplicate_path(&self, path: &[u8]) -> io::Result<FileDesc> {
+ let new_fd = cvt(syscall::dup(self.fd, path))?;
Ok(FileDesc::new(new_fd))
}
/// println!("Got error: {:?}", err);
/// }
/// ```
+ ///
+ /// # Platform specific
+ /// On Redox this always returns None.
#[stable(feature = "unix_socket", since = "1.10.0")]
pub fn take_error(&self) -> io::Result<Option<io::Error>> {
self.0.take_error()
/// println!("Got error: {:?}", err);
/// }
/// ```
+ ///
+ /// # Platform specific
+ /// On Redox this always returns None.
#[stable(feature = "unix_socket", since = "1.10.0")]
pub fn take_error(&self) -> io::Result<Option<io::Error>> {
self.0.take_error()
}
const RUST_KNOWN_TOOL: &[&str] = &["clippy", "rustfmt"];
+const RUST_KNOWN_LINT_TOOL: &[&str] = &["clippy"];
pub fn is_known_tool(attr: &Attribute) -> bool {
let tool_name =
RUST_KNOWN_TOOL.contains(&tool_name.as_str().as_ref())
}
+pub fn is_known_lint_tool(m_item: Ident) -> bool {
+ RUST_KNOWN_LINT_TOOL.contains(&m_item.as_str().as_ref())
+}
+
impl NestedMetaItem {
/// Returns the MetaItem if self is a NestedMetaItemKind::MetaItem.
pub fn meta_item(&self) -> Option<&MetaItem> {
pub fn is_meta_item_list(&self) -> bool {
self.meta_item_list().is_some()
}
+
+ pub fn is_scoped(&self) -> Option<Ident> {
+ if self.ident.segments.len() > 1 {
+ Some(self.ident.segments[0].ident)
+ } else {
+ None
+ }
+ }
}
impl Attribute {
pub struct CodeMap {
pub(super) files: Lock<CodeMapFiles>,
- file_loader: Box<FileLoader + Sync + Send>,
+ file_loader: Box<dyn FileLoader + Sync + Send>,
// This is used to apply the file path remapping as specified via
// --remap-path-prefix to all FileMaps allocated within this CodeMap.
path_mapping: FilePathMapping,
}
- pub fn with_file_loader(file_loader: Box<FileLoader + Sync + Send>,
+ pub fn with_file_loader(file_loader: Box<dyn FileLoader + Sync + Send>,
path_mapping: FilePathMapping)
-> CodeMap {
CodeMap {
self.span_until_char(sp, '{')
}
+ /// Returns a new span representing just the start-point of this span
+ pub fn start_point(&self, sp: Span) -> Span {
+ let pos = sp.lo().0;
+ let width = self.find_width_of_character_at_span(sp, false);
+ let corrected_start_position = pos.checked_add(width).unwrap_or(pos);
+ let end_point = BytePos(cmp::max(corrected_start_position, sp.lo().0));
+ sp.with_hi(end_point)
+ }
+
/// Returns a new span representing just the end-point of this span
pub fn end_point(&self, sp: Span) -> Span {
let pos = sp.hi().0;
/// For our current purposes the prefix is the target architecture and the name is a crate name.
/// If an error occurs steps will be taken to ensure that no file is created.
pub fn output_metadata(ecx: &ExtCtxt, prefix: &str, name: &str, err_map: &ErrorMap)
- -> Result<(), Box<Error>>
+ -> Result<(), Box<dyn Error>>
{
// Create the directory to place the file in.
let metadata_dir = get_metadata_dir(prefix);
pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
span: Span,
token_tree: &[TokenTree])
- -> Box<MacResult+'cx> {
+ -> Box<dyn MacResult+'cx> {
let code = match (token_tree.len(), token_tree.get(0)) {
(1, Some(&TokenTree::Token(_, token::Ident(code, _)))) => code,
_ => unreachable!()
pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
span: Span,
token_tree: &[TokenTree])
- -> Box<MacResult+'cx> {
+ -> Box<dyn MacResult+'cx> {
let (code, description) = match (
token_tree.len(),
token_tree.get(0),
pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
span: Span,
token_tree: &[TokenTree])
- -> Box<MacResult+'cx> {
+ -> Box<dyn MacResult+'cx> {
assert_eq!(token_tree.len(), 3);
let (crate_name, name) = match (&token_tree[0], &token_tree[2]) {
(
use edition::Edition;
use errors::{DiagnosticBuilder, DiagnosticId};
use ext::expand::{self, AstFragment, Invocation};
-use ext::hygiene::{self, Mark, SyntaxContext};
+use ext::hygiene::{self, Mark, SyntaxContext, Transparency};
use fold::{self, Folder};
use parse::{self, parser, DirectoryOwnership};
use parse::token;
sp: Span,
meta_item: &ast::MetaItem,
item: &Annotatable,
- push: &mut FnMut(Annotatable));
+ push: &mut dyn FnMut(Annotatable));
}
impl<F> MultiItemDecorator for F
- where F : Fn(&mut ExtCtxt, Span, &ast::MetaItem, &Annotatable, &mut FnMut(Annotatable))
+ where F : Fn(&mut ExtCtxt, Span, &ast::MetaItem, &Annotatable, &mut dyn FnMut(Annotatable))
{
fn expand(&self,
ecx: &mut ExtCtxt,
sp: Span,
meta_item: &ast::MetaItem,
item: &Annotatable,
- push: &mut FnMut(Annotatable)) {
+ push: &mut dyn FnMut(Annotatable)) {
(*self)(ecx, sp, meta_item, item, push)
}
}
/// Represents a thing that maps token trees to Macro Results
pub trait TTMacroExpander {
fn expand<'cx>(&self, ecx: &'cx mut ExtCtxt, span: Span, input: TokenStream)
- -> Box<MacResult+'cx>;
+ -> Box<dyn MacResult+'cx>;
}
pub type MacroExpanderFn =
for<'cx> fn(&'cx mut ExtCtxt, Span, &[tokenstream::TokenTree])
- -> Box<MacResult+'cx>;
+ -> Box<dyn MacResult+'cx>;
impl<F> TTMacroExpander for F
- where F: for<'cx> Fn(&'cx mut ExtCtxt, Span, &[tokenstream::TokenTree]) -> Box<MacResult+'cx>
+ where F: for<'cx> Fn(&'cx mut ExtCtxt, Span, &[tokenstream::TokenTree])
+ -> Box<dyn MacResult+'cx>
{
fn expand<'cx>(&self, ecx: &'cx mut ExtCtxt, span: Span, input: TokenStream)
- -> Box<MacResult+'cx> {
+ -> Box<dyn MacResult+'cx> {
struct AvoidInterpolatedIdents;
impl Folder for AvoidInterpolatedIdents {
sp: Span,
ident: ast::Ident,
token_tree: Vec<tokenstream::TokenTree>)
- -> Box<MacResult+'cx>;
+ -> Box<dyn MacResult+'cx>;
}
pub type IdentMacroExpanderFn =
for<'cx> fn(&'cx mut ExtCtxt, Span, ast::Ident, Vec<tokenstream::TokenTree>)
- -> Box<MacResult+'cx>;
+ -> Box<dyn MacResult+'cx>;
impl<F> IdentMacroExpander for F
where F : for<'cx> Fn(&'cx mut ExtCtxt, Span, ast::Ident,
- Vec<tokenstream::TokenTree>) -> Box<MacResult+'cx>
+ Vec<tokenstream::TokenTree>) -> Box<dyn MacResult+'cx>
{
fn expand<'cx>(&self,
cx: &'cx mut ExtCtxt,
sp: Span,
ident: ast::Ident,
token_tree: Vec<tokenstream::TokenTree>)
- -> Box<MacResult+'cx>
+ -> Box<dyn MacResult+'cx>
{
(*self)(cx, sp, ident, token_tree)
}
impl MacEager {
$(
- pub fn $fld(v: $t) -> Box<MacResult> {
+ pub fn $fld(v: $t) -> Box<dyn MacResult> {
Box::new(MacEager {
$fld: Some(v),
..Default::default()
///
/// Use this as a return value after hitting any errors and
/// calling `span_err`.
- pub fn any(sp: Span) -> Box<MacResult+'static> {
+ pub fn any(sp: Span) -> Box<dyn MacResult+'static> {
Box::new(DummyResult { expr_only: false, span: sp })
}
/// Use this for macros that must expand to an expression, so even
/// if an error is encountered internally, the user will receive
/// an error that they also used it in the wrong place.
- pub fn expr(sp: Span) -> Box<MacResult+'static> {
+ pub fn expr(sp: Span) -> Box<dyn MacResult+'static> {
Box::new(DummyResult { expr_only: true, span: sp })
}
}
pub type BuiltinDeriveFn =
- for<'cx> fn(&'cx mut ExtCtxt, Span, &MetaItem, &Annotatable, &mut FnMut(Annotatable));
+ for<'cx> fn(&'cx mut ExtCtxt, Span, &MetaItem, &Annotatable, &mut dyn FnMut(Annotatable));
/// Represents different kinds of macro invocations that can be resolved.
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
/// `#[derive(...)]` is a `MultiItemDecorator`.
///
/// Prefer ProcMacro or MultiModifier since they are more flexible.
- MultiDecorator(Box<MultiItemDecorator + sync::Sync + sync::Send>),
+ MultiDecorator(Box<dyn MultiItemDecorator + sync::Sync + sync::Send>),
/// A syntax extension that is attached to an item and modifies it
/// in-place. Also allows decoration, i.e., creating new items.
- MultiModifier(Box<MultiItemModifier + sync::Sync + sync::Send>),
+ MultiModifier(Box<dyn MultiItemModifier + sync::Sync + sync::Send>),
/// A function-like procedural macro. TokenStream -> TokenStream.
ProcMacro {
- expander: Box<ProcMacro + sync::Sync + sync::Send>,
+ expander: Box<dyn ProcMacro + sync::Sync + sync::Send>,
allow_internal_unstable: bool,
edition: Edition,
},
/// The first TokenSteam is the attribute, the second is the annotated item.
/// Allows modification of the input items and adding new items, similar to
/// MultiModifier, but uses TokenStreams, rather than AST nodes.
- AttrProcMacro(Box<AttrProcMacro + sync::Sync + sync::Send>, Edition),
+ AttrProcMacro(Box<dyn AttrProcMacro + sync::Sync + sync::Send>, Edition),
/// A normal, function-like syntax extension.
///
/// `bytes!` is a `NormalTT`.
NormalTT {
- expander: Box<TTMacroExpander + sync::Sync + sync::Send>,
+ expander: Box<dyn TTMacroExpander + sync::Sync + sync::Send>,
def_info: Option<(ast::NodeId, Span)>,
/// Whether the contents of the macro can
/// directly use `#[unstable]` things (true == yes).
/// A function-like syntax extension that has an extra ident before
/// the block.
///
- IdentTT(Box<IdentMacroExpander + sync::Sync + sync::Send>, Option<Span>, bool),
+ IdentTT(Box<dyn IdentMacroExpander + sync::Sync + sync::Send>, Option<Span>, bool),
/// An attribute-like procedural macro. TokenStream -> TokenStream.
/// The input is the annotated item.
/// Allows generating code to implement a Trait for a given struct
/// or enum item.
- ProcMacroDerive(Box<MultiItemModifier + sync::Sync + sync::Send>,
+ ProcMacroDerive(Box<dyn MultiItemModifier + sync::Sync + sync::Send>,
Vec<Symbol> /* inert attribute names */, Edition),
/// An attribute-like procedural macro that derives a builtin trait.
/// A declarative macro, e.g. `macro m() {}`.
DeclMacro {
- expander: Box<TTMacroExpander + sync::Sync + sync::Send>,
+ expander: Box<dyn TTMacroExpander + sync::Sync + sync::Send>,
def_info: Option<(ast::NodeId, Span)>,
is_transparent: bool,
edition: Edition,
}
}
- pub fn is_modern(&self) -> bool {
+ pub fn default_transparency(&self) -> Transparency {
match *self {
- SyntaxExtension::DeclMacro { .. } |
SyntaxExtension::ProcMacro { .. } |
SyntaxExtension::AttrProcMacro(..) |
- SyntaxExtension::ProcMacroDerive(..) => true,
- _ => false,
- }
- }
-
- pub fn is_transparent(&self) -> bool {
- match *self {
- SyntaxExtension::DeclMacro { is_transparent, .. } => is_transparent,
- _ => false,
+ SyntaxExtension::ProcMacroDerive(..) |
+ SyntaxExtension::DeclMacro { is_transparent: false, .. } => Transparency::Opaque,
+ SyntaxExtension::DeclMacro { is_transparent: true, .. } => Transparency::Transparent,
+ _ => Transparency::SemiTransparent,
}
}
pub parse_sess: &'a parse::ParseSess,
pub ecfg: expand::ExpansionConfig<'a>,
pub root_path: PathBuf,
- pub resolver: &'a mut Resolver,
+ pub resolver: &'a mut dyn Resolver,
pub resolve_err_count: usize,
pub current_expansion: ExpansionData,
pub expansions: HashMap<Span, Vec<String>>,
impl<'a> ExtCtxt<'a> {
pub fn new(parse_sess: &'a parse::ParseSess,
ecfg: expand::ExpansionConfig<'a>,
- resolver: &'a mut Resolver)
+ resolver: &'a mut dyn Resolver)
-> ExtCtxt<'a> {
ExtCtxt {
parse_sess,
}
}
- fn make_from<'a>(self, result: Box<MacResult + 'a>) -> Option<AstFragment> {
+ fn make_from<'a>(self, result: Box<dyn MacResult + 'a>) -> Option<AstFragment> {
match self {
AstFragmentKind::OptExpr =>
result.make_expr().map(Some).map(AstFragment::OptExpr),
pub fn expand_quote_tokens<'cx>(cx: &'cx mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'cx> {
+ -> Box<dyn base::MacResult+'cx> {
let (cx_expr, expr) = expand_tts(cx, sp, tts);
let expanded = expand_wrapper(cx, sp, cx_expr, expr, &[&["syntax", "ext", "quote", "rt"]]);
base::MacEager::expr(expanded)
pub fn expand_quote_expr<'cx>(cx: &'cx mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'cx> {
+ -> Box<dyn base::MacResult+'cx> {
let expanded = expand_parse_call(cx, sp, "parse_expr_panic", vec![], tts);
base::MacEager::expr(expanded)
}
pub fn expand_quote_item<'cx>(cx: &'cx mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'cx> {
+ -> Box<dyn base::MacResult+'cx> {
let expanded = expand_parse_call(cx, sp, "parse_item_panic", vec![], tts);
base::MacEager::expr(expanded)
}
pub fn expand_quote_pat<'cx>(cx: &'cx mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'cx> {
+ -> Box<dyn base::MacResult+'cx> {
let expanded = expand_parse_call(cx, sp, "parse_pat_panic", vec![], tts);
base::MacEager::expr(expanded)
}
pub fn expand_quote_arm(cx: &mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
let expanded = expand_parse_call(cx, sp, "parse_arm_panic", vec![], tts);
base::MacEager::expr(expanded)
}
pub fn expand_quote_ty(cx: &mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
let expanded = expand_parse_call(cx, sp, "parse_ty_panic", vec![], tts);
base::MacEager::expr(expanded)
}
pub fn expand_quote_stmt(cx: &mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
let expanded = expand_parse_call(cx, sp, "parse_stmt_panic", vec![], tts);
base::MacEager::expr(expanded)
}
pub fn expand_quote_attr(cx: &mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
let expanded = expand_parse_call(cx, sp, "parse_attribute_panic",
vec![cx.expr_bool(sp, true)], tts);
pub fn expand_quote_arg(cx: &mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
let expanded = expand_parse_call(cx, sp, "parse_arg_panic", vec![], tts);
base::MacEager::expr(expanded)
}
pub fn expand_quote_block(cx: &mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
let expanded = expand_parse_call(cx, sp, "parse_block_panic", vec![], tts);
base::MacEager::expr(expanded)
}
pub fn expand_quote_meta_item(cx: &mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
let expanded = expand_parse_call(cx, sp, "parse_meta_item_panic", vec![], tts);
base::MacEager::expr(expanded)
}
pub fn expand_quote_path(cx: &mut ExtCtxt,
sp: Span,
tts: &[TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
let mode = mk_parser_path(cx, sp, &["PathStyle", "Type"]);
let expanded = expand_parse_call(cx, sp, "parse_path_panic", vec![mode], tts);
base::MacEager::expr(expanded)
/// line!(): expands to the current line number
pub fn expand_line(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
base::check_zero_tts(cx, sp, tts, "line!");
let topmost = cx.expansion_cause().unwrap_or(sp);
/* column!(): expands to the current column number */
pub fn expand_column(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
base::check_zero_tts(cx, sp, tts, "column!");
let topmost = cx.expansion_cause().unwrap_or(sp);
/* __rust_unstable_column!(): expands to the current column number */
pub fn expand_column_gated(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
if sp.allows_unstable() {
expand_column(cx, sp, tts)
} else {
/// The filemap (`loc.file`) contains a bunch more information we could spit
/// out if we wanted.
pub fn expand_file(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
base::check_zero_tts(cx, sp, tts, "file!");
let topmost = cx.expansion_cause().unwrap_or(sp);
}
pub fn expand_stringify(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
let s = pprust::tts_to_string(tts);
base::MacEager::expr(cx.expr_str(sp, Symbol::intern(&s)))
}
pub fn expand_mod(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
base::check_zero_tts(cx, sp, tts, "module_path!");
let mod_path = &cx.current_expansion.module.mod_path;
let string = mod_path.iter().map(|x| x.to_string()).collect::<Vec<String>>().join("::");
/// This is generally a bad idea because it's going to behave
/// unhygienically.
pub fn expand_include<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
- -> Box<base::MacResult+'cx> {
+ -> Box<dyn base::MacResult+'cx> {
let file = match get_single_str_from_tts(cx, sp, tts, "include!") {
Some(f) => f,
None => return DummyResult::expr(sp),
// include_str! : read the given file, insert it as a literal string expr
pub fn expand_include_str(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
let file = match get_single_str_from_tts(cx, sp, tts, "include_str!") {
Some(f) => f,
None => return DummyResult::expr(sp)
}
pub fn expand_include_bytes(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
- -> Box<base::MacResult+'static> {
+ -> Box<dyn base::MacResult+'static> {
let file = match get_single_str_from_tts(cx, sp, tts, "include_bytes!") {
Some(f) => f,
None => return DummyResult::expr(sp)
cx: &'cx mut ExtCtxt,
sp: Span,
input: TokenStream)
- -> Box<MacResult+'cx> {
+ -> Box<dyn MacResult+'cx> {
if !self.valid {
return DummyResult::any(sp);
}
arg: TokenStream,
lhses: &[quoted::TokenTree],
rhses: &[quoted::TokenTree])
- -> Box<MacResult+'cx> {
+ -> Box<dyn MacResult+'cx> {
if cx.trace_macros() {
trace_macros_note(cx, sp, format!("expanding `{}! {{ {} }}`", name, arg));
}
(active, wasm_custom_section, "1.26.0", Some(51088), None),
// The #![wasm_import_module] attribute
- (active, wasm_import_module, "1.26.0", Some(51088), None),
+ (active, wasm_import_module, "1.26.0", Some(52090), None),
// Allows keywords to be escaped for use as identifiers
(active, raw_identifiers, "1.26.0", Some(48589), None),
// Scoped attributes
(active, tool_attributes, "1.25.0", Some(44690), None),
+ // Scoped lints
+ (active, tool_lints, "1.28.0", Some(44690), None),
// allow irrefutable patterns in if-let and while-let statements (RFC 2086)
(active, irrefutable_let_patterns, "1.27.0", Some(44495), None),
// Allows async and await syntax
(active, async_await, "1.28.0", Some(50547), None),
+
+ // #[alloc_error_handler]
+ (active, alloc_error_handler, "1.29.0", Some(51540), None),
);
declare_features! (
"#[panic_implementation] is an unstable feature",
cfg_fn!(panic_implementation))),
+ ("alloc_error_handler", Normal, Gated(Stability::Unstable,
+ "alloc_error_handler",
+ "#[alloc_error_handler] is an unstable feature",
+ cfg_fn!(alloc_error_handler))),
+
// Crate level attributes
("crate_name", CrateLevel, Ungated),
("crate_type", CrateLevel, Ungated),
use rustc_serialize::json::{as_json, as_pretty_json};
pub struct JsonEmitter {
- dst: Box<Write + Send>,
+ dst: Box<dyn Write + Send>,
registry: Option<Registry>,
- cm: Lrc<CodeMapper + sync::Send + sync::Sync>,
+ cm: Lrc<dyn CodeMapper + sync::Send + sync::Sync>,
pretty: bool,
ui_testing: bool,
}
pretty)
}
- pub fn new(dst: Box<Write + Send>,
+ pub fn new(dst: Box<dyn Write + Send>,
registry: Option<Registry>,
code_map: Lrc<CodeMap>,
pretty: bool) -> JsonEmitter {
//!
//! This API is completely unstable and subject to change.
+#![deny(bare_trait_objects)]
+
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/",
// it appears this function is called only from pprust... that's
// probably not a good thing.
-pub fn gather_comments_and_literals(sess: &ParseSess, path: FileName, srdr: &mut Read)
+pub fn gather_comments_and_literals(sess: &ParseSess, path: FileName, srdr: &mut dyn Read)
-> (Vec<Comment>, Vec<Literal>) {
let mut src = Vec::new();
srdr.read_to_end(&mut src).unwrap();
err.span_suggestion_short_with_applicability(
self.span, msg, "".to_string(), Applicability::MachineApplicable
);
+ if !items.is_empty() { // Issue #51603
+ let previous_item = &items[items.len()-1];
+ let previous_item_kind_name = match previous_item.node {
+ // say "braced struct" because tuple-structs and
+ // braceless-empty-struct declarations do take a semicolon
+ ItemKind::Struct(..) => Some("braced struct"),
+ ItemKind::Enum(..) => Some("enum"),
+ ItemKind::Trait(..) => Some("trait"),
+ ItemKind::Union(..) => Some("union"),
+ _ => None,
+ };
+ if let Some(name) = previous_item_kind_name {
+ err.help(&format!("{} declarations are not followed by a semicolon",
+ name));
+ }
+ }
} else {
err.span_label(self.span, "expected item");
}
const SIZE_INFINITY: isize = 0xffff;
-pub fn mk_printer<'a>(out: Box<io::Write+'a>, linewidth: usize) -> Printer<'a> {
+pub fn mk_printer<'a>(out: Box<dyn io::Write+'a>, linewidth: usize) -> Printer<'a> {
// Yes 55, it makes the ring buffers big enough to never fall behind.
let n: usize = 55 * linewidth;
debug!("mk_printer {}", linewidth);
}
pub struct Printer<'a> {
- out: Box<io::Write+'a>,
+ out: Box<dyn io::Write+'a>,
buf_max_len: usize,
/// Width of lines we're constrained to
margin: isize,
literals: Peekable<vec::IntoIter<comments::Literal>>,
cur_cmnt: usize,
boxes: Vec<pp::Breaks>,
- ann: &'a (PpAnn+'a),
+ ann: &'a (dyn PpAnn+'a),
}
-fn rust_printer<'a>(writer: Box<Write+'a>, ann: &'a PpAnn) -> State<'a> {
+fn rust_printer<'a>(writer: Box<dyn Write+'a>, ann: &'a dyn PpAnn) -> State<'a> {
State {
s: pp::mk_printer(writer, DEFAULT_COLUMNS),
cm: None,
sess: &ParseSess,
krate: &ast::Crate,
filename: FileName,
- input: &mut Read,
- out: Box<Write+'a>,
- ann: &'a PpAnn,
+ input: &mut dyn Read,
+ out: Box<dyn Write+'a>,
+ ann: &'a dyn PpAnn,
is_expanded: bool) -> io::Result<()> {
let mut s = State::new_from_input(cm, sess, filename, input, out, ann, is_expanded);
pub fn new_from_input(cm: &'a CodeMap,
sess: &ParseSess,
filename: FileName,
- input: &mut Read,
- out: Box<Write+'a>,
- ann: &'a PpAnn,
+ input: &mut dyn Read,
+ out: Box<dyn Write+'a>,
+ ann: &'a dyn PpAnn,
is_expanded: bool) -> State<'a> {
let (cmnts, lits) = comments::gather_comments_and_literals(sess, filename, input);
}
pub fn new(cm: &'a CodeMap,
- out: Box<Write+'a>,
- ann: &'a PpAnn,
+ out: Box<dyn Write+'a>,
+ ann: &'a dyn PpAnn,
comments: Option<Vec<comments::Comment>>,
literals: Option<Vec<comments::Literal>>) -> State<'a> {
State {
// Traverse the crate, collecting all the test functions, eliding any
// existing main functions, and synthesizing a main test harness
pub fn modify_for_testing(sess: &ParseSess,
- resolver: &mut Resolver,
+ resolver: &mut dyn Resolver,
should_test: bool,
krate: ast::Crate,
span_diagnostic: &errors::Handler,
}
fn generate_test_harness(sess: &ParseSess,
- resolver: &mut Resolver,
+ resolver: &mut dyn Resolver,
reexport_test_harness_main: Option<Symbol>,
krate: ast::Crate,
sd: &errors::Handler,
use syntax::ext::base;
use syntax::ext::build::AstBuilder;
use syntax::symbol::Symbol;
-use syntax_pos;
use syntax::tokenstream;
+use syntax_pos;
use std::string::String;
-pub fn expand_syntax_ext(cx: &mut base::ExtCtxt,
- sp: syntax_pos::Span,
- tts: &[tokenstream::TokenTree])
- -> Box<base::MacResult + 'static> {
+pub fn expand_syntax_ext(
+ cx: &mut base::ExtCtxt,
+ sp: syntax_pos::Span,
+ tts: &[tokenstream::TokenTree],
+) -> Box<base::MacResult + 'static> {
let es = match base::get_exprs_from_tts(cx, sp, tts) {
Some(e) => e,
None => return base::DummyResult::expr(sp),
let mut accumulator = String::new();
for e in es {
match e.node {
- ast::ExprKind::Lit(ref lit) => {
- match lit.node {
- ast::LitKind::Str(ref s, _) |
- ast::LitKind::Float(ref s, _) |
- ast::LitKind::FloatUnsuffixed(ref s) => {
- accumulator.push_str(&s.as_str());
- }
- ast::LitKind::Char(c) => {
- accumulator.push(c);
- }
- ast::LitKind::Int(i, ast::LitIntType::Unsigned(_)) |
- ast::LitKind::Int(i, ast::LitIntType::Signed(_)) |
- ast::LitKind::Int(i, ast::LitIntType::Unsuffixed) => {
- accumulator.push_str(&format!("{}", i));
- }
- ast::LitKind::Bool(b) => {
- accumulator.push_str(&format!("{}", b));
- }
- ast::LitKind::Byte(..) |
- ast::LitKind::ByteStr(..) => {
- cx.span_err(e.span, "cannot concatenate a byte string literal");
- }
+ ast::ExprKind::Lit(ref lit) => match lit.node {
+ ast::LitKind::Str(ref s, _)
+ | ast::LitKind::Float(ref s, _)
+ | ast::LitKind::FloatUnsuffixed(ref s) => {
+ accumulator.push_str(&s.as_str());
}
- }
+ ast::LitKind::Char(c) => {
+ accumulator.push(c);
+ }
+ ast::LitKind::Int(i, ast::LitIntType::Unsigned(_))
+ | ast::LitKind::Int(i, ast::LitIntType::Signed(_))
+ | ast::LitKind::Int(i, ast::LitIntType::Unsuffixed) => {
+ accumulator.push_str(&format!("{}", i));
+ }
+ ast::LitKind::Bool(b) => {
+ accumulator.push_str(&format!("{}", b));
+ }
+ ast::LitKind::Byte(..) | ast::LitKind::ByteStr(..) => {
+ cx.span_err(e.span, "cannot concatenate a byte string literal");
+ }
+ },
_ => {
- cx.span_err(e.span, "expected a literal");
+ let mut err = cx.struct_span_err(e.span, "expected a literal");
+ let snippet = cx.codemap().span_to_snippet(e.span).unwrap();
+ err.span_suggestion(
+ e.span,
+ "you might be missing a string literal to format with",
+ format!("\"{{}}\", {}", snippet),
+ );
+ err.emit();
}
}
}
/// A SyntaxContext represents a chain of macro expansions (represented by marks).
#[derive(Clone, Copy, PartialEq, Eq, Default, PartialOrd, Ord, Hash)]
-pub struct SyntaxContext(pub(super) u32);
+pub struct SyntaxContext(u32);
#[derive(Copy, Clone, Debug)]
-pub struct SyntaxContextData {
- pub outer_mark: Mark,
- pub prev_ctxt: SyntaxContext,
+struct SyntaxContextData {
+ outer_mark: Mark,
+ transparency: Transparency,
+ prev_ctxt: SyntaxContext,
// This context, but with all transparent and semi-transparent marks filtered away.
- pub opaque: SyntaxContext,
+ opaque: SyntaxContext,
// This context, but with all transparent marks filtered away.
- pub opaque_and_semitransparent: SyntaxContext,
+ opaque_and_semitransparent: SyntaxContext,
}
/// A mark is a unique id associated with a macro expansion.
#[derive(Clone, Debug)]
struct MarkData {
parent: Mark,
- transparency: Transparency,
+ default_transparency: Transparency,
is_builtin: bool,
expn_info: Option<ExpnInfo>,
}
/// A property of a macro expansion that determines how identifiers
/// produced by that expansion are resolved.
-#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Hash, Debug)]
pub enum Transparency {
/// Identifier produced by a transparent expansion is always resolved at call-site.
/// Call-site spans in procedural macros, hygiene opt-out in `macro` should use this.
}
impl Mark {
- fn fresh_with_data(mark_data: MarkData, data: &mut HygieneData) -> Self {
- data.marks.push(mark_data);
- Mark(data.marks.len() as u32 - 1)
- }
-
pub fn fresh(parent: Mark) -> Self {
HygieneData::with(|data| {
- Mark::fresh_with_data(MarkData {
+ data.marks.push(MarkData {
parent,
// By default expansions behave like `macro_rules`.
- transparency: Transparency::SemiTransparent,
+ default_transparency: Transparency::SemiTransparent,
is_builtin: false,
expn_info: None,
- }, data)
- })
- }
-
- pub fn fresh_cloned(clone_from: Mark) -> Self {
- HygieneData::with(|data| {
- Mark::fresh_with_data(data.marks[clone_from.0 as usize].clone(), data)
+ });
+ Mark(data.marks.len() as u32 - 1)
})
}
})
}
- pub fn modern(mut self) -> Mark {
- HygieneData::with(|data| {
- while data.marks[self.0 as usize].transparency != Transparency::Opaque {
- self = data.marks[self.0 as usize].parent;
- }
- self
- })
- }
-
- #[inline]
- pub fn transparency(self) -> Transparency {
- assert_ne!(self, Mark::root());
- HygieneData::with(|data| data.marks[self.0 as usize].transparency)
- }
-
#[inline]
- pub fn set_transparency(self, transparency: Transparency) {
+ pub fn set_default_transparency(self, transparency: Transparency) {
assert_ne!(self, Mark::root());
- HygieneData::with(|data| data.marks[self.0 as usize].transparency = transparency)
+ HygieneData::with(|data| data.marks[self.0 as usize].default_transparency = transparency)
}
#[inline]
pub fn is_builtin(self) -> bool {
+ assert_ne!(self, Mark::root());
HygieneData::with(|data| data.marks[self.0 as usize].is_builtin)
}
#[inline]
pub fn set_is_builtin(self, is_builtin: bool) {
+ assert_ne!(self, Mark::root());
HygieneData::with(|data| data.marks[self.0 as usize].is_builtin = is_builtin)
}
b
})
}
+
+ // Used for enabling some compatibility fallback in resolve.
+ #[inline]
+ pub fn looks_like_proc_macro_derive(self) -> bool {
+ HygieneData::with(|data| {
+ let mark_data = &data.marks[self.0 as usize];
+ if mark_data.default_transparency == Transparency::Opaque {
+ if let Some(expn_info) = &mark_data.expn_info {
+ if let ExpnFormat::MacroAttribute(name) = expn_info.format {
+ if name.as_str().starts_with("derive(") {
+ return true;
+ }
+ }
+ }
+ }
+ false
+ })
+ }
}
#[derive(Debug)]
-pub struct HygieneData {
+crate struct HygieneData {
marks: Vec<MarkData>,
syntax_contexts: Vec<SyntaxContextData>,
- markings: HashMap<(SyntaxContext, Mark), SyntaxContext>,
+ markings: HashMap<(SyntaxContext, Mark, Transparency), SyntaxContext>,
default_edition: Edition,
}
impl HygieneData {
- pub fn new() -> Self {
+ crate fn new() -> Self {
HygieneData {
marks: vec![MarkData {
parent: Mark::root(),
// If the root is opaque, then loops searching for an opaque mark
// will automatically stop after reaching it.
- transparency: Transparency::Opaque,
+ default_transparency: Transparency::Opaque,
is_builtin: true,
expn_info: None,
}],
syntax_contexts: vec![SyntaxContextData {
outer_mark: Mark::root(),
+ transparency: Transparency::Opaque,
prev_ctxt: SyntaxContext(0),
opaque: SyntaxContext(0),
opaque_and_semitransparent: SyntaxContext(0),
SyntaxContext(0)
}
+ crate fn as_u32(self) -> u32 {
+ self.0
+ }
+
+ crate fn from_u32(raw: u32) -> SyntaxContext {
+ SyntaxContext(raw)
+ }
+
// Allocate a new SyntaxContext with the given ExpnInfo. This is used when
// deserializing Spans from the incr. comp. cache.
// FIXME(mw): This method does not restore MarkData::parent or
HygieneData::with(|data| {
data.marks.push(MarkData {
parent: Mark::root(),
- transparency: Transparency::SemiTransparent,
+ default_transparency: Transparency::SemiTransparent,
is_builtin: false,
expn_info: Some(expansion_info),
});
data.syntax_contexts.push(SyntaxContextData {
outer_mark: mark,
+ transparency: Transparency::SemiTransparent,
prev_ctxt: SyntaxContext::empty(),
opaque: SyntaxContext::empty(),
opaque_and_semitransparent: SyntaxContext::empty(),
})
}
- /// Extend a syntax context with a given mark
+ /// Extend a syntax context with a given mark and default transparency for that mark.
pub fn apply_mark(self, mark: Mark) -> SyntaxContext {
- if mark.transparency() == Transparency::Opaque {
- return self.apply_mark_internal(mark);
+ assert_ne!(mark, Mark::root());
+ self.apply_mark_with_transparency(
+ mark, HygieneData::with(|data| data.marks[mark.0 as usize].default_transparency)
+ )
+ }
+
+ /// Extend a syntax context with a given mark and transparency
+ pub fn apply_mark_with_transparency(self, mark: Mark, transparency: Transparency)
+ -> SyntaxContext {
+ assert_ne!(mark, Mark::root());
+ if transparency == Transparency::Opaque {
+ return self.apply_mark_internal(mark, transparency);
}
let call_site_ctxt =
mark.expn_info().map_or(SyntaxContext::empty(), |info| info.call_site.ctxt());
- let call_site_ctxt = if mark.transparency() == Transparency::SemiTransparent {
+ let call_site_ctxt = if transparency == Transparency::SemiTransparent {
call_site_ctxt.modern()
} else {
call_site_ctxt.modern_and_legacy()
};
if call_site_ctxt == SyntaxContext::empty() {
- return self.apply_mark_internal(mark);
+ return self.apply_mark_internal(mark, transparency);
}
// Otherwise, `mark` is a macros 1.0 definition and the call site is in a
//
// See the example at `test/run-pass/hygiene/legacy_interaction.rs`.
let mut ctxt = call_site_ctxt;
- for mark in self.marks() {
- ctxt = ctxt.apply_mark_internal(mark);
+ for (mark, transparency) in self.marks() {
+ ctxt = ctxt.apply_mark_internal(mark, transparency);
}
- ctxt.apply_mark_internal(mark)
+ ctxt.apply_mark_internal(mark, transparency)
}
- fn apply_mark_internal(self, mark: Mark) -> SyntaxContext {
+ fn apply_mark_internal(self, mark: Mark, transparency: Transparency) -> SyntaxContext {
HygieneData::with(|data| {
let syntax_contexts = &mut data.syntax_contexts;
- let transparency = data.marks[mark.0 as usize].transparency;
-
let mut opaque = syntax_contexts[self.0 as usize].opaque;
let mut opaque_and_semitransparent =
syntax_contexts[self.0 as usize].opaque_and_semitransparent;
if transparency >= Transparency::Opaque {
let prev_ctxt = opaque;
- opaque = *data.markings.entry((prev_ctxt, mark)).or_insert_with(|| {
+ opaque = *data.markings.entry((prev_ctxt, mark, transparency)).or_insert_with(|| {
let new_opaque = SyntaxContext(syntax_contexts.len() as u32);
syntax_contexts.push(SyntaxContextData {
outer_mark: mark,
+ transparency,
prev_ctxt,
opaque: new_opaque,
opaque_and_semitransparent: new_opaque,
if transparency >= Transparency::SemiTransparent {
let prev_ctxt = opaque_and_semitransparent;
opaque_and_semitransparent =
- *data.markings.entry((prev_ctxt, mark)).or_insert_with(|| {
+ *data.markings.entry((prev_ctxt, mark, transparency)).or_insert_with(|| {
let new_opaque_and_semitransparent =
SyntaxContext(syntax_contexts.len() as u32);
syntax_contexts.push(SyntaxContextData {
outer_mark: mark,
+ transparency,
prev_ctxt,
opaque,
opaque_and_semitransparent: new_opaque_and_semitransparent,
}
let prev_ctxt = self;
- *data.markings.entry((prev_ctxt, mark)).or_insert_with(|| {
+ *data.markings.entry((prev_ctxt, mark, transparency)).or_insert_with(|| {
let new_opaque_and_semitransparent_and_transparent =
SyntaxContext(syntax_contexts.len() as u32);
syntax_contexts.push(SyntaxContextData {
outer_mark: mark,
+ transparency,
prev_ctxt,
opaque,
opaque_and_semitransparent,
})
}
- pub fn marks(mut self) -> Vec<Mark> {
+ pub fn marks(mut self) -> Vec<(Mark, Transparency)> {
HygieneData::with(|data| {
let mut marks = Vec::new();
while self != SyntaxContext::empty() {
- marks.push(data.syntax_contexts[self.0 as usize].outer_mark);
- self = data.syntax_contexts[self.0 as usize].prev_ctxt;
+ let ctxt_data = &data.syntax_contexts[self.0 as usize];
+ marks.push((ctxt_data.outer_mark, ctxt_data.transparency));
+ self = ctxt_data.prev_ctxt;
}
marks.reverse();
marks
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(const_fn)]
+#![feature(crate_visibility_modifier)]
#![feature(custom_attribute)]
#![feature(non_exhaustive)]
#![feature(optin_builtin_traits)]
-#![allow(unused_attributes)]
#![feature(specialization)]
#![feature(stdsimd)]
#[inline]
fn encode(sd: &SpanData) -> Span {
- let (base, len, ctxt) = (sd.lo.0, sd.hi.0 - sd.lo.0, sd.ctxt.0);
+ let (base, len, ctxt) = (sd.lo.0, sd.hi.0 - sd.lo.0, sd.ctxt.as_u32());
let val = if (base >> INLINE_SIZES[BASE_INDEX]) == 0 &&
(len >> INLINE_SIZES[LEN_INDEX]) == 0 &&
let index = extract(INTERNED_INDEX_OFFSET, INTERNED_INDEX_SIZE);
return with_span_interner(|interner| *interner.get(index));
};
- SpanData { lo: BytePos(base), hi: BytePos(base + len), ctxt: SyntaxContext(ctxt) }
+ SpanData { lo: BytePos(base), hi: BytePos(base + len), ctxt: SyntaxContext::from_u32(ctxt) }
}
#[derive(Default)]
-Subproject commit 1c817c7a0c828b8fc8e8e462afbe5db41c7052d1
+Subproject commit 03684905101f0b7e49dfe530e54dc1aeac6ef0fb
return LLVMRustResult::Failure;
}
+#if LLVM_VERSION_GE(7, 0)
+ unwrap(Target)->addPassesToEmitFile(*PM, OS, nullptr, FileType, false);
+#else
unwrap(Target)->addPassesToEmitFile(*PM, OS, FileType, false);
+#endif
PM->run(*unwrap(M));
// Apparently `addPassesToEmitFile` adds a pointer to our on-the-stack output
return static_cast<LLVMRustDIFlags>(static_cast<uint32_t>(F) & 0x3);
}
-#if LLVM_VERSION_GE(4, 0)
static DINode::DIFlags fromRust(LLVMRustDIFlags Flags) {
DINode::DIFlags Result = DINode::DIFlags::FlagZero;
-#else
-static unsigned fromRust(LLVMRustDIFlags Flags) {
- unsigned Result = 0;
-#endif
switch (visibility(Flags)) {
case LLVMRustDIFlags::FlagPrivate:
if (isSet(Flags & LLVMRustDIFlags::FlagBitField)) {
Result |= DINode::DIFlags::FlagBitField;
}
-#if LLVM_RUSTLLVM || LLVM_VERSION_GE(4, 0)
if (isSet(Flags & LLVMRustDIFlags::FlagNoReturn)) {
Result |= DINode::DIFlags::FlagNoReturn;
}
if (isSet(Flags & LLVMRustDIFlags::FlagMainSubprogram)) {
Result |= DINode::DIFlags::FlagMainSubprogram;
}
-#endif
return Result;
}
unsigned RuntimeVer, const char *SplitName) {
auto *File = unwrapDI<DIFile>(FileRef);
-#if LLVM_VERSION_GE(4, 0)
return wrap(Builder->createCompileUnit(Lang, File, Producer, isOptimized,
Flags, RuntimeVer, SplitName));
-#else
- return wrap(Builder->createCompileUnit(Lang, File->getFilename(),
- File->getDirectory(), Producer, isOptimized,
- Flags, RuntimeVer, SplitName));
-#endif
}
extern "C" LLVMMetadataRef
LLVMRustDIBuilderCreateBasicType(LLVMRustDIBuilderRef Builder, const char *Name,
uint64_t SizeInBits, uint32_t AlignInBits,
unsigned Encoding) {
- return wrap(Builder->createBasicType(Name, SizeInBits,
-#if LLVM_VERSION_LE(3, 9)
- AlignInBits,
-#endif
- Encoding));
+ return wrap(Builder->createBasicType(Name, SizeInBits, Encoding));
}
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreatePointerType(
LLVMMetadataRef Decl = nullptr, uint32_t AlignInBits = 0) {
llvm::GlobalVariable *InitVal = cast<llvm::GlobalVariable>(unwrap(V));
-#if LLVM_VERSION_GE(4, 0)
llvm::DIExpression *InitExpr = nullptr;
if (llvm::ConstantInt *IntVal = llvm::dyn_cast<llvm::ConstantInt>(InitVal)) {
InitExpr = Builder->createConstantValueExpression(
InitVal->setMetadata("dbg", VarExpr);
return wrap(VarExpr);
-#else
- return wrap(Builder->createGlobalVariable(
- unwrapDI<DIDescriptor>(Context), Name, LinkageName,
- unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
- InitVal, unwrapDIPtr<MDNode>(Decl)));
-#endif
}
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateVariable(
if (Tag == 0x100) { // DW_TAG_auto_variable
return wrap(Builder->createAutoVariable(
unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), LineNo,
- unwrapDI<DIType>(Ty), AlwaysPreserve, fromRust(Flags)
-#if LLVM_VERSION_GE(4, 0)
- ,
- AlignInBits
-#endif
- ));
+ unwrapDI<DIType>(Ty), AlwaysPreserve, fromRust(Flags), AlignInBits));
} else {
return wrap(Builder->createParameterVariable(
unwrapDI<DIDescriptor>(Scope), Name, ArgNo, unwrapDI<DIFile>(File),
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InlineAsm.h"
-#include "llvm/IR/InlineAsm.h"
-#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/CommandLine.h"
// compile-flags: -C no-prepopulate-passes
// ignore-tidy-linelength
+// min-llvm-version 7.0
#![crate_type = "lib"]
#[no_mangle]
pub fn align64(i : i32) -> Align64 {
// CHECK: %a64 = alloca %Align64, align 64
-// CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{.*}}, i8* %{{.*}}, i{{[0-9]+}} 64, i32 64, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 64 %{{.*}}, i8* align 64 %{{.*}}, i{{[0-9]+}} 64, i1 false)
let a64 = Align64(i);
a64
}
// scalar value.
// compile-flags: -C no-prepopulate-passes
-// min-llvm-version 4.0
-
#![crate_type = "lib"]
// compile-flags: -C no-prepopulate-passes
// ignore-tidy-linelength
+// min-llvm-version 7.0
#![crate_type = "lib"]
#[no_mangle]
pub fn low_align_const() -> E<i16, [i16; 3]> {
// Check that low_align_const and high_align_const use the same constant
-// CHECK: i8* getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* [[LOW_HIGH]], i32 0, i32 0, i32 0),
+// CHECK: i8* align 2 getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* [[LOW_HIGH]], i32 0, i32 0, i32 0),
*&E::A(0)
}
#[no_mangle]
pub fn high_align_const() -> E<i16, i32> {
// Check that low_align_const and high_align_const use the same constant
-// CHECK: i8* getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* [[LOW_HIGH]], i32 0, i32 0, i32 0),
+// CHECK: i8* align 4 getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* [[LOW_HIGH]], i32 0, i32 0, i32 0),
*&E::A(0)
}
x
}
-// CHECK: i16 @enum_id_2(i16)
+// CHECK: { i8, i8 } @enum_id_2(i1 zeroext %x.0, i8 %x.1)
#[no_mangle]
pub fn enum_id_2(x: Option<u8>) -> Option<u8> {
x
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// min-llvm-version 4.0
// compile-flags: -O
// ignore-x86
// ignore-arm
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// min-llvm-version 4.0
// compile-flags: -O
+// min-llvm-version 6.0
#![crate_type="rlib"]
// ignore-tidy-linelength
// ignore-windows
// ignore-macos
-// min-llvm-version 4.0
// compile-flags: -g -C no-prepopulate-passes
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// This test depends on a patch that was committed to upstream LLVM
-// before 4.0, formerly backported to the Rust LLVM fork.
-
// ignore-tidy-linelength
// ignore-windows
// ignore-macos
-// min-llvm-version 4.0
// compile-flags: -g -C no-prepopulate-passes
// compile-flags: -g -C no-prepopulate-passes
// ignore-tidy-linelength
-// min-llvm-version 4.0
#![crate_type = "lib"]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// ignore-tidy-linelength
// compile-flags: -C no-prepopulate-passes
+// min-llvm-version 7.0
#![crate_type = "lib"]
#![feature(repr_packed)]
pub fn call_pkd1(f: fn() -> Array) -> BigPacked1 {
// CHECK: [[ALLOCA:%[_a-z0-9]+]] = alloca %Array
// CHECK: call void %{{.*}}(%Array* noalias nocapture sret dereferenceable(32) [[ALLOCA]])
-// CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{.*}}, i8* %{{.*}}, i{{[0-9]+}} 32, i32 1, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 1 %{{.*}}, i8* align 1 %{{.*}}, i{{[0-9]+}} 32, i1 false)
// check that calls whose destination is a field of a packed struct
// go through an alloca rather than calling the function with an
// unaligned destination.
pub fn call_pkd2(f: fn() -> Array) -> BigPacked2 {
// CHECK: [[ALLOCA:%[_a-z0-9]+]] = alloca %Array
// CHECK: call void %{{.*}}(%Array* noalias nocapture sret dereferenceable(32) [[ALLOCA]])
-// CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{.*}}, i8* %{{.*}}, i{{[0-9]+}} 32, i32 2, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 2 %{{.*}}, i8* align 2 %{{.*}}, i{{[0-9]+}} 32, i1 false)
// check that calls whose destination is a field of a packed struct
// go through an alloca rather than calling the function with an
// unaligned destination.
// CHECK-LABEL: @pkd1_pair
#[no_mangle]
pub fn pkd1_pair(pair1: &mut Packed1Pair, pair2: &mut Packed1Pair) {
-// CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{.*}}, i8* %{{.*}}, i{{[0-9]+}} 5, i32 1, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 1 %{{.*}}, i8* align 1 %{{.*}}, i{{[0-9]+}} 5, i1 false)
*pair2 = *pair1;
}
// CHECK-LABEL: @pkd2_pair
#[no_mangle]
pub fn pkd2_pair(pair1: &mut Packed2Pair, pair2: &mut Packed2Pair) {
-// CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{.*}}, i8* %{{.*}}, i{{[0-9]+}} 6, i32 2, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 2 %{{.*}}, i8* align 2 %{{.*}}, i{{[0-9]+}} 6, i1 false)
*pair2 = *pair1;
}
// CHECK-LABEL: @pkd1_nested_pair
#[no_mangle]
pub fn pkd1_nested_pair(pair1: &mut Packed1NestedPair, pair2: &mut Packed1NestedPair) {
-// CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{.*}}, i8* %{{.*}}, i{{[0-9]+}} 8, i32 1, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 1 %{{.*}}, i8* align 1 %{{.*}}, i{{[0-9]+}} 8, i1 false)
*pair2 = *pair1;
}
// CHECK-LABEL: @pkd2_nested_pair
#[no_mangle]
pub fn pkd2_nested_pair(pair1: &mut Packed2NestedPair, pair2: &mut Packed2NestedPair) {
-// CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{.*}}, i8* %{{.*}}, i{{[0-9]+}} 8, i32 2, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 2 %{{.*}}, i8* align 2 %{{.*}}, i{{[0-9]+}} 8, i1 false)
*pair2 = *pair1;
}
// compile-flags: -O
// ignore-tidy-linelength
+// min-llvm-version 7.0
#![crate_type = "lib"]
// CHECK-LABEL: @repeat_take_collect
#[no_mangle]
pub fn repeat_take_collect() -> Vec<u8> {
-// CHECK: call void @llvm.memset.p0i8.[[USIZE]](i8* {{(nonnull )?}}%{{[0-9]+}}, i8 42, [[USIZE]] 100000, i32 1, i1 false)
+// CHECK: call void @llvm.memset.p0i8.[[USIZE]](i8* {{(nonnull )?}}align 1 %{{[0-9]+}}, i8 42, [[USIZE]] 100000, i1 false)
iter::repeat(42).take(100000).collect()
}
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -O
+
+#![crate_type = "lib"]
+
+// CHECK: define { i8, i8 } @pair_bool_bool(i1 zeroext %pair.0, i1 zeroext %pair.1)
+#[no_mangle]
+pub fn pair_bool_bool(pair: (bool, bool)) -> (bool, bool) {
+ pair
+}
+
+// CHECK: define { i8, i32 } @pair_bool_i32(i1 zeroext %pair.0, i32 %pair.1)
+#[no_mangle]
+pub fn pair_bool_i32(pair: (bool, i32)) -> (bool, i32) {
+ pair
+}
+
+// CHECK: define { i32, i8 } @pair_i32_bool(i32 %pair.0, i1 zeroext %pair.1)
+#[no_mangle]
+pub fn pair_i32_bool(pair: (i32, bool)) -> (i32, bool) {
+ pair
+}
+
+// CHECK: define { i8, i8 } @pair_and_or(i1 zeroext %arg0.0, i1 zeroext %arg0.1)
+#[no_mangle]
+pub fn pair_and_or((a, b): (bool, bool)) -> (bool, bool) {
+ // Make sure it can operate directly on the unpacked args
+ // CHECK: and i1 %arg0.0, %arg0.1
+ // CHECK: or i1 %arg0.0, %arg0.1
+ (a && b, a || b)
+}
+
+// CHECK: define void @pair_branches(i1 zeroext %arg0.0, i1 zeroext %arg0.1)
+#[no_mangle]
+pub fn pair_branches((a, b): (bool, bool)) {
+ // Make sure it can branch directly on the unpacked bool args
+ // CHECK: br i1 %arg0.0
+ if a {
+ println!("Hello!");
+ }
+ // CHECK: br i1 %arg0.1
+ if b {
+ println!("Goodbye!");
+ }
+}
// except according to those terms.
// ignore-emscripten
-// min-llvm-version 6.0
+// min-llvm-version 7.0
// compile-flags: -C no-prepopulate-passes
simd_fmin(a, b)
}
-// FIXME(49261)
-// // C_HECK-LABEL: @fmax
-// #[no_mangle]
-// pub unsafe fn fmax(a: f32x4, b: f32x4) -> f32x4 {
-// // C_HECK: call <4 x float> @llvm.maxnum.v4f32
-// simd_fmax(a, b)
-// }
+// CHECK-LABEL: @fmax
+#[no_mangle]
+pub unsafe fn fmax(a: f32x4, b: f32x4) -> f32x4 {
+ // CHECK: call <4 x float> @llvm.maxnum.v4f32
+ simd_fmax(a, b)
+}
// ignore-wasm
// ignore-emscripten
// ignore-windows
-// min-system-llvm-version 5.0
// compile-flags: -C no-prepopulate-passes
#![crate_type = "lib"]
// except according to those terms.
// compile-flags: -C no-prepopulate-passes
+// ignore-tidy-linelength
+// min-llvm-version 7.0
#![crate_type = "lib"]
// CHECK: store i32 %0, i32* [[TMP]]
// CHECK: [[Y8:%[0-9]+]] = bitcast [4 x i8]* %y to i8*
// CHECK: [[TMP8:%[0-9]+]] = bitcast i32* [[TMP]] to i8*
-// CHECK: call void @llvm.memcpy.{{.*}}(i8* [[Y8]], i8* [[TMP8]], i{{[0-9]+}} 4, i32 1, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 1 [[Y8]], i8* align 1 [[TMP8]], i{{[0-9]+}} 4, i1 false)
*x = y;
}
// CHECK: store i32 %0, i32* [[TMP]]
// CHECK: [[Y8:%[0-9]+]] = bitcast %Bytes* %y to i8*
// CHECK: [[TMP8:%[0-9]+]] = bitcast i32* [[TMP]] to i8*
-// CHECK: call void @llvm.memcpy.{{.*}}(i8* [[Y8]], i8* [[TMP8]], i{{[0-9]+}} 4, i32 1, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 1 [[Y8]], i8* align 1 [[TMP8]], i{{[0-9]+}} 4, i1 false)
*x = y;
}
// ignore-tidy-linelength
// ignore-windows
// ignore-macos
-// min-system-llvm-version 5.1
+// min-llvm-version 6.0
// compile-flags: -g -C no-prepopulate-passes
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags:-C panic=abort
+
+#![feature(alloc_error_handler, panic_implementation)]
+#![no_std]
+#![no_main]
+
+use core::alloc::Layout;
+
+#[alloc_error_handler]
+fn oom(
+ info: &Layout, //~ ERROR argument should be `Layout`
+) -> () //~ ERROR return type should be `!`
+{
+ loop {}
+}
+
+#[panic_implementation]
+fn panic(_: &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.
+
+// compile-flags:-C panic=abort
+
+#![feature(alloc_error_handler, panic_implementation)]
+#![no_std]
+#![no_main]
+
+struct Layout;
+
+#[alloc_error_handler]
+fn oom(
+ info: Layout, //~ ERROR argument should be `Layout`
+) { //~ ERROR return type should be `!`
+ loop {}
+}
+
+#[panic_implementation]
+fn panic(_: &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.
+
+// compile-flags:-C panic=abort
+
+#![feature(alloc_error_handler, panic_implementation)]
+#![no_std]
+#![no_main]
+
+struct Layout;
+
+#[alloc_error_handler]
+fn oom() -> ! { //~ ERROR function should have one argument
+ loop {}
+}
+
+#[panic_implementation]
+fn panic(_: &core::panic::PanicInfo) -> ! { loop {} }
}
fn foo<T:Get>(t: T) {
- let x = t.get(); //~ ERROR the size for value values of type
+ let x = t.get(); //~ ERROR the size for values of type
}
fn main() {
pub fn main() {
let x: Vec<Trait + Sized> = Vec::new();
//~^ ERROR only auto traits can be used as additional traits in a trait object
- //~| ERROR the size for value values of type
- //~| ERROR the size for value values of type
+ //~| ERROR the size for values of type
+ //~| ERROR the size for values of type
}
// FIXME(#49824) -- the free region error below should probably not be there
let mut x = 0;
|| {
- || { //[mir]~ ERROR free region `` does not outlive
+ || { //[mir]~ ERROR unsatisfied lifetime constraints
let y = &mut x;
&mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
//[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
let f5: &mut Fat<ToBar> = &mut Fat { f1: 5, f2: "some str", ptr: Bar1 {f :42} };
let z: Box<ToBar> = Box::new(Bar1 {f: 36});
f5.ptr = *z;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
//~| expected type `dyn ToBar`
//~| found type `Bar1`
//~| expected trait ToBar, found struct `Bar1`
- //~| ERROR the size for value values of type
+ //~| ERROR the size for values of type
}
//~| expected type `dyn ToBar`
//~| found type `Bar1`
//~| expected trait ToBar, found struct `Bar1`
- //~| ERROR the size for value values of type
+ //~| ERROR the size for values of type
}
let f: ([isize; 3],) = ([5, 6, 7],);
let g: &([isize],) = &f;
let h: &(([isize],),) = &(*g,);
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
let f: Fat<[isize; 3]> = Fat { ptr: [5, 6, 7] };
let g: &Fat<[isize]> = &f;
let h: &Fat<Fat<[isize]>> = &Fat { ptr: *g };
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn test1<T: ?Sized + Foo>(t: &T) {
let u: &Foo = t;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn test2<T: ?Sized + Foo>(t: &T) {
let v: &Foo = t as &Foo;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn test3() {
let _: &[&Foo] = &["hi"];
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn test4(x: &[u8]) {
let _: &Foo = x as &Foo;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() { }
trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
impl Foo<[isize]> for usize { }
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
impl Foo<isize> for [usize] { }
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
pub fn main() { }
fn main() {
assert_sized::<A>();
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
assert_sized::<Foo>();
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
assert_sized::<Bar<A>>();
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
assert_sized::<Bar<Bar<A>>>();
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags:-C panic=abort
+
+#![no_std]
+#![no_main]
+
+use core::alloc::Layout;
+
+#[alloc_error_handler] //~ ERROR #[alloc_error_handler] is an unstable feature (see issue #51540)
+fn oom(info: Layout) -> ! {
+ 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.
+
+#[warn(clippy::assign_ops)] //~ ERROR scoped lint `clippy::assign_ops` is experimental
+fn main() {}
fn main() {
test::free();
- //~^ ERROR call to unsafe function requires unsafe function or block
+ //~^ ERROR call to unsafe function is unsafe
}
+++ /dev/null
-// Copyright 2013 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(core_intrinsics)]
-
-use std::intrinsics::{init};
-
-// Test that the `forget` and `init` intrinsics are really unsafe
-pub fn main() {
- let stuff = init::<isize>(); //~ ERROR call to unsafe function requires unsafe
-}
--- /dev/null
+// Copyright 2013 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(core_intrinsics)]
+
+use std::intrinsics::{init};
+
+// Test that the `init` intrinsic is really unsafe
+pub fn main() {
+ let stuff = init::<isize>(); //~ ERROR call to unsafe function is unsafe
+}
static CRASH: () = symbol;
//~^ ERROR could not evaluate static initializer
//~| tried to read from foreign (extern) static
-//~^^^ ERROR could not evaluate static initializer
-//~| tried to read from foreign (extern) static
fn main() {}
fn main() {
let _x = "test" as &::std::any::Any;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
{
for
&mut something
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
in arg2
{
}
fn main() {
(|| Box::new(*(&[0][..])))();
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn _create_render(_: &()) ->
AbstractRenderer
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
{
match 0 {
_ => unimplemented!()
type FuncType<'f> = Fn(&isize) -> isize + 'f;
fn ho_func(f: Option<FuncType>) {
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() {}
}
trait To {
- fn to<Dst>( //~ ERROR the size for value values of type
+ fn to<Dst>( //~ ERROR the size for values of type
self
) -> <Dst as From<Self>>::Result where Dst: From<Self> {
From::from(self)
impl The {
fn iceman(c: Vec<[i32]>) {}
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn changer<'a>(mut things: Box<Iterator<Item=&'a mut u8>>) {
for item in *things { *item = 0 }
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
}
fn main() {}
struct Table {
rows: [[String]],
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn f(table: &Table) -> &[String] {
impl Struct {
pub fn function(funs: Vec<Fn() -> ()>) {}
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() {}
fn main() {
static foo: Fn() -> u32 = || -> u32 {
//~^ ERROR mismatched types
- //~| ERROR the size for value values of type
+ //~| ERROR the size for values of type
0
};
}
#[repr(packed)]
pub struct Bad<T: ?Sized> {
- data: T, //~ ERROR the size for value values of type
+ data: T, //~ ERROR the size for values of type
}
fn main() {}
+++ /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.
-
-#[repr(packed)]
-pub struct Good {
- data: &'static u32,
- data2: [&'static u32; 2],
- aligned: [u8; 32],
-}
-
-#[repr(packed)]
-pub struct JustArray {
- array: [u32]
-}
-
-#[deny(safe_packed_borrows)]
-fn main() {
- let good = Good {
- data: &0,
- data2: [&0, &0],
- aligned: [0; 32]
- };
-
- unsafe {
- let _ = &good.data; // ok
- let _ = &good.data2[0]; // ok
- }
-
- let _ = &good.data; //~ ERROR borrow of packed field requires unsafe
- //~| hard error
- let _ = &good.data2[0]; //~ ERROR borrow of packed field requires unsafe
- //~| hard error
- let _ = &*good.data; // ok, behind a pointer
- let _ = &good.aligned; // ok, has align 1
- let _ = &good.aligned[2]; // ok, has align 1
-}
trait Foo {
const BAR: i32;
fn foo(self) -> &'static i32 {
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
&<Self>::BAR
}
}
pub static BAZ: u32 = *&error_message_count;
//~^ ERROR could not evaluate static initializer
//~| tried to read from foreign (extern) static
-//~^^^ ERROR could not evaluate static initializer
-//~| tried to read from foreign (extern) static
fn main() {}
enum E {
V([Box<E>]),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() {}
// except according to those terms.
fn _test(ref _p: str) {}
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
fn main() { }
// except according to those terms.
pub fn example(ref s: str) {}
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
fn main() {}
pub trait Foo {
fn baz(_: Self::Target) where Self: Deref {}
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
pub fn f(_: ToString) {}
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
fn main() { }
&'static std::cell::UnsafeCell<
std::option::Option<Foo>>>
{
- __KEY.get() //~ ERROR call to unsafe function requires unsafe
+ __KEY.get() //~ ERROR call to unsafe function is unsafe
}
static FOO: std::thread::LocalKey<Foo> =
std::thread::LocalKey::new(__getit, Default::default);
-//~^ ERROR call to unsafe function requires unsafe
+//~^ ERROR call to unsafe function is unsafe
fn main() {
FOO.with(|foo| println!("{}", foo.borrow()));
fn main() {
return;
*(1 as *mut u32) = 42;
- //~^ ERROR dereference of raw pointer requires unsafe
+ //~^ ERROR dereference of raw pointer is unsafe
}
fn main() {
let _ = || {
*(1 as *mut u32) = 42;
- //~^ ERROR dereference of raw pointer requires unsafe
+ //~^ ERROR dereference of raw pointer is unsafe
yield;
};
}
union Union { unit: (), void: Void }
let u = Union { unit: () };
match u.void {}
- //~^ ERROR access to union field requires unsafe function or block
+ //~^ ERROR access to union field is unsafe
}
fn raw_ptr_deref() {
let ptr = std::ptr::null::<Void>();
match *ptr {}
- //~^ ERROR dereference of raw pointer requires unsafe function or block
+ //~^ ERROR dereference of raw pointer is unsafe
}
fn main() {}
--- /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.
+
+fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
+ match (&t,) { //~ ERROR cannot infer an appropriate lifetime
+ ((u,),) => u,
+ }
+}
+
+fn main() {
+ let x = {
+ let y = Box::new((42,));
+ transmute_lifetime(&y)
+ };
+
+ println!("{}", x);
+}
}
fn new_struct(r: A+'static)
- -> Struct { //~^ ERROR the size for value values of type
- //~^ ERROR the size for value values of type
+ -> Struct { //~^ ERROR the size for values of type
+ //~^ ERROR the size for values of type
Struct { r: r }
}
// General test of maybe_uninits state computed by MIR dataflow.
+#![feature(nll)]
#![feature(core_intrinsics, rustc_attrs)]
use std::intrinsics::rustc_peek;
struct S(i32);
-#[rustc_mir_borrowck]
#[rustc_mir(rustc_peek_definite_init,stop_after_dataflow)]
fn foo(test: bool, x: &mut S, y: S, mut z: S) -> S {
let ret;
// General test of maybe_inits state computed by MIR dataflow.
+#![feature(nll)]
#![feature(core_intrinsics, rustc_attrs)]
use std::intrinsics::rustc_peek;
struct S(i32);
-#[rustc_mir_borrowck]
#[rustc_mir(rustc_peek_maybe_init,stop_after_dataflow)]
fn foo(test: bool, x: &mut S, y: S, mut z: S) -> S {
let ret;
// General test of maybe_uninits state computed by MIR dataflow.
+#![feature(nll)]
#![feature(core_intrinsics, rustc_attrs)]
use std::intrinsics::rustc_peek;
struct S(i32);
-#[rustc_mir_borrowck]
#[rustc_mir(rustc_peek_maybe_uninit,stop_after_dataflow)]
fn foo(test: bool, x: &mut S, y: S, mut z: S) -> S {
let ret;
// General test of maybe_uninits state computed by MIR dataflow.
+#![feature(nll)]
#![feature(core_intrinsics, rustc_attrs)]
use std::intrinsics::rustc_peek;
struct S(i32);
-#[rustc_mir_borrowck]
#[rustc_mir(rustc_peek_maybe_uninit,stop_after_dataflow)]
fn foo(x: &mut S) {
// `x` is initialized here, so maybe-uninit bit is 0.
fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 {
let g: fn(_, _) -> _ = |_x, y| y;
- //~^ ERROR free region `'b` does not outlive free region `'a`
+ //~^ ERROR unsatisfied lifetime constraints
g
//~^ WARNING not reporting region error due to nll
}
// as part of checking the `ReifyFnPointer`.
let f: fn(_) -> _ = foo;
//~^ WARNING not reporting region error due to nll
- //~| ERROR free region `'a` does not outlive free region `'static`
+ //~| ERROR unsatisfied lifetime constraints
f(x)
}
// in `g`. These are related via the `UnsafeFnPointer` cast.
let g: unsafe fn(_) -> _ = f;
//~^ WARNING not reporting region error due to nll
- //~| ERROR free region `'a` does not outlive free region `'static`
+ //~| ERROR unsatisfied lifetime constraints
unsafe { g(input) }
}
use std::fmt::Debug;
fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
- //~^ ERROR free region `'a` does not outlive free region `'static`
- x
+ x //~ ERROR unsatisfied lifetime constraints
//~^ WARNING not reporting region error due to nll
}
// Unsized type.
let arr: &[_] = &[1, 2, 3];
let range = *arr..;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
t //[ll]~ ERROR E0312
//[nll]~^ WARNING not reporting region error due to nll
- //[nll]~| ERROR free region `'a` does not outlive free region `'static`
+ //[nll]~| ERROR unsatisfied lifetime constraints
}
fn error(u: &(), v: &()) {
}
fn main() {
- let b = B; //~ ERROR use of mutable static requires unsafe function or block
- let rb = &B; //~ ERROR use of mutable static requires unsafe function or block
- let xb = XB; //~ ERROR use of mutable static requires unsafe function or block
- let xrb = &XB; //~ ERROR use of mutable static requires unsafe function or block
+ let b = B; //~ ERROR use of mutable static is unsafe
+ let rb = &B; //~ ERROR use of mutable static is unsafe
+ let xb = XB; //~ ERROR use of mutable static is unsafe
+ let xrb = &XB; //~ ERROR use of mutable static is unsafe
}
}
fn main() {
- let a = A; //~ ERROR use of extern static requires unsafe function or block
+ let a = A; //~ ERROR use of extern static is unsafe
//~^ WARN this was previously accepted by the compiler
- let ra = &A; //~ ERROR use of extern static requires unsafe function or block
+ let ra = &A; //~ ERROR use of extern static is unsafe
//~^ WARN this was previously accepted by the compiler
- let xa = XA; //~ ERROR use of extern static requires unsafe function or block
+ let xa = XA; //~ ERROR use of extern static is unsafe
//~^ WARN this was previously accepted by the compiler
- let xra = &XA; //~ ERROR use of extern static requires unsafe function or block
+ let xra = &XA; //~ ERROR use of extern static is unsafe
//~^ WARN this was previously accepted by the compiler
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// min-llvm-version 5.0
// ignore-emscripten
// Test that the simd_reduce_{op} intrinsics produce ok-ish error
fn mutate(s: &mut str) {
s[1..2] = bot();
- //~^ ERROR the size for value values of type
- //~| ERROR the size for value values of type
+ //~^ ERROR the size for values of type
+ //~| ERROR the size for values of type
s[1usize] = bot();
//~^ ERROR the type `str` cannot be mutably indexed by `usize`
}
//[normal]~| found type `fn() {foo::<'static>}`
<str as Foo<u8>>::bar;
- //[verbose]~^ ERROR the size for value values of type
- //[normal]~^^ ERROR the size for value values of type
+ //[verbose]~^ ERROR the size for values of type
+ //[normal]~^^ ERROR the size for values of type
}
--- /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.
+
+// Don't allow tool_lints, which aren't scoped
+
+#![feature(tool_lints)]
+#![deny(unknown_lints)]
+
+#![deny(clippy)] //~ ERROR: unknown lint: `clippy`
+
+fn main() {}
// This should emit the less confusing error, not the more confusing one.
fn foo(_x: Foo + Send) {
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() { }
fn generic_noncopy<T: Default>() {
let mut u3 = U3 { a: T::default() };
- u3.a = T::default(); //~ ERROR assignment to non-`Copy` union field requires unsafe
+ u3.a = T::default(); //~ ERROR assignment to non-`Copy` union field is unsafe
}
fn generic_copy<T: Copy + Default>() {
fn main() {
let mut u1 = U1 { a: 10 }; // OK
- let a = u1.a; //~ ERROR access to union field requires unsafe
+ let a = u1.a; //~ ERROR access to union field is unsafe
u1.a = 11; // OK
- let U1 { a } = u1; //~ ERROR access to union field requires unsafe
- if let U1 { a: 12 } = u1 {} //~ ERROR access to union field requires unsafe
+ let U1 { a } = u1; //~ ERROR access to union field is unsafe
+ if let U1 { a: 12 } = u1 {} //~ ERROR access to union field is unsafe
// let U1 { .. } = u1; // OK
let mut u2 = U2 { a: String::from("old") }; // OK
- u2.a = String::from("new"); //~ ERROR assignment to non-`Copy` union field requires unsafe
+ u2.a = String::from("new"); //~ ERROR assignment to non-`Copy` union field is unsafe
let mut u3 = U3 { a: 0 }; // OK
u3.a = 1; // OK
let mut u3 = U3 { a: String::from("old") }; // OK
- u3.a = String::from("new"); //~ ERROR assignment to non-`Copy` union field requires unsafe
+ u3.a = String::from("new"); //~ ERROR assignment to non-`Copy` union field is unsafe
}
union U {
a: str,
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
b: u8,
}
union W {
a: u8,
b: str,
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() {}
--- /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(tool_lints)]
+
+#![deny(foo::bar)] //~ ERROR an unknown tool name found in scoped lint: `foo::bar`
+
+#[allow(foo::bar)] //~ ERROR an unknown tool name found in scoped lint: `foo::bar`
+fn main() {}
fn f(p: *mut u8) {
- *p = 0; //~ ERROR dereference of raw pointer requires unsafe function or block
+ *p = 0; //~ ERROR dereference of raw pointer is unsafe
return;
}
unsafe fn f() { return; }
fn main() {
- f(); //~ ERROR call to unsafe function requires unsafe function or block
+ f(); //~ ERROR call to unsafe function is unsafe
}
fn f(p: *const u8) -> u8 {
- return *p; //~ ERROR dereference of raw pointer requires unsafe function or block
+ return *p; //~ ERROR dereference of raw pointer is unsafe
}
fn main() {
fn main() {
let x = f;
- x(); //~ ERROR call to unsafe function requires unsafe function or block
+ x(); //~ ERROR call to unsafe function is unsafe
}
// as unsafe.
fn main() {
intrinsics::move_val_init(1 as *mut u32, 1);
- //~^ ERROR dereference of raw pointer requires unsafe function or block
+ //~^ ERROR dereference of raw pointer is unsafe
}
fn bar<T: Sized>() { }
fn foo<T: ?Sized>() { bar::<T>() }
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
fn main() { }
enum Foo<U> { FooSome(U), FooNone }
fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
//
// Not OK: `T` is not sized.
struct S5<Y>(Y);
impl<X: ?Sized> S5<X> {
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() { }
struct Foo<T> { data: T }
fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
//
// Not OK: `T` is not sized.
struct Bar<T: ?Sized> { data: T }
fn bar1<T: ?Sized>() { not_sized::<Bar<T>>() }
fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
//
// Not OK: `Bar<T>` is not sized, but it should be.
struct S5<Y>(Y);
impl<X: ?Sized> T3<X> for S5<X> {
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() { }
}
struct S4<Y: ?Sized>(Box<Y>);
impl<X: ?Sized> T2<X> for S4<X> {
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() { }
// Unbounded.
fn f1<X: ?Sized>(x: &X) {
f2::<X>(x);
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn f2<X>(x: &X) {
}
}
fn f3<X: ?Sized + T>(x: &X) {
f4::<X>(x);
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn f4<X: T>(x: &X) {
}
fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
f5(x1);
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
f6(x2); // ok
}
// Test some tuples.
fn f9<X: ?Sized>(x1: Box<S<X>>) {
f5(&(*x1, 34));
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn f10<X: ?Sized>(x1: Box<S<X>>) {
f5(&(32, *x1));
- //~^ ERROR the size for value values of type
- //~| ERROR the size for value values of type
+ //~^ ERROR the size for values of type
+ //~| ERROR the size for values of type
}
pub fn main() {
struct S1<X: ?Sized> {
f1: X,
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
f2: isize,
}
struct S2<X: ?Sized> {
f: isize,
g: X,
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
h: isize,
}
struct S3 {
f: str,
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
g: [usize]
}
struct S4 {
f: [u8],
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
g: usize
}
enum E<X: ?Sized> {
V1(X, isize),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
enum F<X: ?Sized> {
V2{f1: X, f: isize},
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
pub fn main() {
fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
let _: W; // <-- this is OK, no bindings created, no initializer.
let _: (isize, (X, isize));
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
let y: Y;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
let y: (isize, (Z, usize));
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
let y: X;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
let y: (isize, (Y, isize));
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
let y: X = *x1;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
let y = *x2;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
let (y, z) = (*x3, 4);
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
let y: X = *x1;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
let y = *x2;
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
let (y, z) = (*x3, 4);
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn g1<X: ?Sized>(x: X) {}
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
fn g2<X: ?Sized + T>(x: X) {}
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
pub fn main() {
}
struct S3<Y: ?Sized>(Box<Y>);
impl<X: ?Sized + T> T1<X> for S3<X> {
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() { }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// asmjs can't even pass i128 as arguments or return values, so ignore it.
-// this will hopefully be fixed by the LLVM 5 upgrade (#43370)
-// ignore-asmjs
// ignore-emscripten
// compile-flags: -Z lower_128bit_ops=yes -C debug_assertions=no
--- /dev/null
+// Copyright 2012 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.
+
+// error-pattern: thread 'main' panicked at 'explicit panic'
+
+#![feature(nll)]
+
+fn main() {
+ let mut vec = vec![];
+ vec.push((vec.len(), panic!()));
+}
-
-# min-llvm-version 4.0
-# ignore-mingw
+# ignore-msvc
-include ../tools.mk
-# This test makes sure that the expected .llvmbc sections for use by
-# linker-based LTO are available in object files when compiling with
-# -Z cross-lang-lto
-
-LLVMBC_SECTION_NAME=\\.llvmbc
-
-ifeq ($(UNAME),Darwin)
- LLVMBC_SECTION_NAME=__bitcode
-endif
-
-
-OBJDUMP=llvm-objdump
-SECTION_HEADERS=$(OBJDUMP) -section-headers
+# This test makes sure that the object files we generate are actually
+# LLVM bitcode files (as used by linker LTO plugins) when compiling with
+# -Z cross-lang-lto.
-BUILD_LIB=$(RUSTC) lib.rs -Copt-level=2 -Z cross-lang-lto=no-link -Ccodegen-units=1
+ASSERT_IS_BITCODE_OBJ=llvm-bcanalyzer # this only succeeds for bitcode files
+EXTRACT_OBJS=(cd $(TMPDIR); rm -f ./*.o; llvm-ar x $(1))
-BUILD_EXE=$(RUSTC) main.rs -Copt-level=2 -Z cross-lang-lto=no-link -Ccodegen-units=1 --emit=obj
+BUILD_LIB=$(RUSTC) lib.rs -Copt-level=2 -Z cross-lang-lto=on -Ccodegen-units=1
+BUILD_EXE=$(RUSTC) main.rs -Copt-level=2 -Z cross-lang-lto=on -Ccodegen-units=1 --emit=obj
all: staticlib staticlib-fat-lto staticlib-thin-lto rlib exe cdylib rdylib
staticlib: lib.rs
$(BUILD_LIB) --crate-type=staticlib -o $(TMPDIR)/liblib.a
- [ "$$($(SECTION_HEADERS) $(TMPDIR)/liblib.a | grep -c $(LLVMBC_SECTION_NAME))" -ne "0" ]
+ $(call EXTRACT_OBJS, liblib.a)
+ $(ASSERT_IS_BITCODE_OBJ) $(TMPDIR)/liblib.lib0.rcgu.o
staticlib-fat-lto: lib.rs
$(BUILD_LIB) --crate-type=staticlib -o $(TMPDIR)/liblib-fat-lto.a -Clto=fat
- [ "$$($(SECTION_HEADERS) $(TMPDIR)/liblib-fat-lto.a | grep -c $(LLVMBC_SECTION_NAME))" -ne "0" ]
+ $(call EXTRACT_OBJS, liblib-fat-lto.a)
+ $(ASSERT_IS_BITCODE_OBJ) $(TMPDIR)/liblib-fat-lto.lib0.rcgu.o
staticlib-thin-lto: lib.rs
$(BUILD_LIB) --crate-type=staticlib -o $(TMPDIR)/liblib-thin-lto.a -Clto=thin
- [ "$$($(SECTION_HEADERS) $(TMPDIR)/liblib-thin-lto.a | grep -c $(LLVMBC_SECTION_NAME))" -ne "0" ]
+ $(call EXTRACT_OBJS, liblib-thin-lto.a)
+ $(ASSERT_IS_BITCODE_OBJ) $(TMPDIR)/liblib-thin-lto.lib0.rcgu.o
rlib: lib.rs
$(BUILD_LIB) --crate-type=rlib -o $(TMPDIR)/liblib.rlib
- [ "$$($(SECTION_HEADERS) $(TMPDIR)/liblib.rlib | grep -c $(LLVMBC_SECTION_NAME))" -ne "0" ]
+ $(call EXTRACT_OBJS, liblib.rlib)
+ $(ASSERT_IS_BITCODE_OBJ) $(TMPDIR)/liblib.lib0.rcgu.o
cdylib: lib.rs
$(BUILD_LIB) --crate-type=cdylib --emit=obj -o $(TMPDIR)/cdylib.o
- [ "$$($(SECTION_HEADERS) $(TMPDIR)/cdylib.o | grep -c $(LLVMBC_SECTION_NAME))" -ne "0" ]
+ $(ASSERT_IS_BITCODE_OBJ) $(TMPDIR)/cdylib.o
rdylib: lib.rs
$(BUILD_LIB) --crate-type=dylib --emit=obj -o $(TMPDIR)/rdylib.o
- [ "$$($(SECTION_HEADERS) $(TMPDIR)/rdylib.o | grep -c $(LLVMBC_SECTION_NAME))" -ne "0" ]
+ $(ASSERT_IS_BITCODE_OBJ) $(TMPDIR)/rdylib.o
exe: lib.rs
$(BUILD_EXE) -o $(TMPDIR)/exe.o
- [ "$$($(SECTION_HEADERS) $(TMPDIR)/exe.o | grep -c $(LLVMBC_SECTION_NAME))" -ne "0" ]
+ $(ASSERT_IS_BITCODE_OBJ) $(TMPDIR)/exe.o
/bin/echo || exit 0 # This test requires /bin/echo to exist
$(RUSTC) the_backend.rs --crate-name the_backend --crate-type dylib \
-o $(TMPDIR)/the_backend.dylib
- $(RUSTC) some_crate.rs --crate-name some_crate --crate-type bin -o $(TMPDIR)/some_crate \
+ $(RUSTC) some_crate.rs --crate-name some_crate --crate-type lib -o $(TMPDIR)/some_crate \
-Z codegen-backend=$(TMPDIR)/the_backend.dylib -Z unstable-options
grep -x "This has been \"compiled\" successfully." $(TMPDIR)/some_crate
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-fn main() {
- ::std::process::exit(1);
-}
+#![feature(no_core)]
+#![no_core]
let crate_name = ongoing_codegen.downcast::<Symbol>()
.expect("in join_codegen_and_link: ongoing_codegen is not a Symbol");
for &crate_type in sess.opts.crate_types.iter() {
- if crate_type != CrateType::CrateTypeExecutable {
+ if crate_type != CrateType::CrateTypeRlib {
sess.fatal(&format!("Crate type is {:?}", crate_type));
}
let output_name =
#![no_main]
#![no_std]
+use core::alloc::Layout;
use core::panic::PanicInfo;
#[panic_implementation]
fn eh() {}
#[lang = "oom"]
-fn oom() {}
+fn oom(_: Layout) -> ! {
+ loop {}
+}
bool runOnFunction(Function &F) override;
-#if LLVM_VERSION_MAJOR >= 4
- StringRef
-#else
- const char *
-#endif
- getPassName() const override {
+ StringRef getPassName() const override {
return "Some LLVM pass";
}
bool runOnModule(Module &M) override;
-#if LLVM_VERSION_MAJOR >= 4
- StringRef
-#else
- const char *
-#endif
- getPassName() const override {
+ StringRef getPassName() const override {
return "Some LLVM pass";
}
all:
ifeq ($(PROFILER_SUPPORT),1)
+ifndef IS_WINDOWS
$(RUSTC) -Copt-level=3 -Clto=fat -Z pgo-gen="$(TMPDIR)/test.profraw" test.rs
$(call RUN,test) || exit 1
[ -e "$(TMPDIR)/test.profraw" ] || (echo "No .profraw file"; exit 1)
endif
+endif
all:
ifeq ($(PROFILER_SUPPORT),1)
+ifndef IS_WINDOWS
$(RUSTC) -g -Z pgo-gen="$(TMPDIR)/test.profraw" test.rs
$(call RUN,test) || exit 1
[ -e "$(TMPDIR)/test.profraw" ] || (echo "No .profraw file"; exit 1)
endif
+endif
--- /dev/null
+-include ../tools.mk
+
+# The target used below doesn't support atomic CAS operations. Verify that's the case
+all:
+ $(RUSTC) --print cfg --target thumbv6m-none-eabi | $(CGREP) -v 'target_has_atomic="cas"'
+++ /dev/null
--include ../tools.mk
-
-# The target used below doesn't support atomic operations. Verify that's the case
-all:
- $(RUSTC) --print cfg --target thumbv6m-none-eabi | $(CGREP) -v target_has_atomic
--- /dev/null
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//compile-flags: -Z borrowck=mir
+
+#![feature(slice_patterns)]
+
+fn mut_head_tail<'a, A>(v: &'a mut [A]) -> Option<(&'a mut A, &'a mut [A])> {
+ match *v {
+ [ref mut head, ref mut tail..] => {
+ Some((head, tail))
+ }
+ [] => None
+ }
+}
+
+fn main() {
+ let mut v = [1,2,3,4];
+ match mut_head_tail(&mut v) {
+ None => {},
+ Some((h,t)) => {
+ *h = 1000;
+ t.reverse();
+ }
+ }
+}
--- /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.
+
+// ignore-cloudabi no processes
+// ignore-emscripten no processes
+
+use std::alloc::{Layout, handle_alloc_error};
+use std::env;
+use std::process::Command;
+use std::str;
+
+fn main() {
+ if env::args().len() > 1 {
+ handle_alloc_error(Layout::new::<[u8; 42]>())
+ }
+
+ let me = env::current_exe().unwrap();
+ let output = Command::new(&me).arg("next").output().unwrap();
+ assert!(!output.status.success(), "{:?} is a success", output.status);
+ assert_eq!(str::from_utf8(&output.stderr).unwrap(), "memory allocation of 42 bytes failed");
+}
+++ /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.
-
-// ignore-pretty pretty-printing is unhygienic
-
-#![feature(decl_macro)]
-
-macro m($t:ty, $e:expr) {
- mod foo {
- #[allow(unused)]
- struct S;
- pub(super) fn f(_: $t) {}
- }
- foo::f($e);
-}
-
-fn main() {
- struct S;
- m!(S, S);
-}
// except according to those terms.
// check that we don't have linear stack usage with multiple calls to `push`
-// min-llvm-version 4.0
#![feature(test)]
--- /dev/null
+// Copyright 2012 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(nll)]
+
+fn main() {
+ let mut v = Vec::new();
+
+ loop { v.push(break) }
+}
--- /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.
+
+trait Foo {
+ extern fn borrow(&self);
+ extern fn take(self: Box<Self>);
+}
+
+struct Bar;
+impl Foo for Bar {
+ extern fn borrow(&self) {}
+ extern fn take(self: Box<Self>) {}
+}
+
+fn main() {
+ let foo: Box<dyn Foo> = Box::new(Bar);
+ foo.borrow();
+ foo.take()
+}
fn simd_fpowi<T>(x: T, y: i32) -> T;
}
+macro_rules! assert_approx_eq_f32 {
+ ($a:expr, $b:expr) => ({
+ let (a, b) = (&$a, &$b);
+ assert!((*a - *b).abs() < 1.0e-6,
+ "{} is not approximately equal to {}", *a, *b);
+ })
+}
+macro_rules! assert_approx_eq {
+ ($a:expr, $b:expr) => ({
+ let a = $a;
+ let b = $b;
+ assert_approx_eq_f32!(a.0, b.0);
+ assert_approx_eq_f32!(a.1, b.1);
+ assert_approx_eq_f32!(a.2, b.2);
+ assert_approx_eq_f32!(a.3, b.3);
+ })
+}
+
fn main() {
let x = f32x4(1.0, 1.0, 1.0, 1.0);
let y = f32x4(-1.0, -1.0, -1.0, -1.0);
unsafe {
let r = simd_fabs(y);
- assert_eq!(x, r);
+ assert_approx_eq!(x, r);
let r = simd_fcos(z);
- assert_eq!(x, r);
+ assert_approx_eq!(x, r);
let r = simd_ceil(h);
- assert_eq!(x, r);
+ assert_approx_eq!(x, r);
let r = simd_fexp(z);
- assert_eq!(x, r);
+ assert_approx_eq!(x, r);
let r = simd_fexp2(z);
- assert_eq!(x, r);
+ assert_approx_eq!(x, r);
let r = simd_floor(h);
- assert_eq!(z, r);
+ assert_approx_eq!(z, r);
let r = simd_fma(x, h, h);
- assert_eq!(x, r);
+ assert_approx_eq!(x, r);
let r = simd_fsqrt(x);
- assert_eq!(x, r);
+ assert_approx_eq!(x, r);
let r = simd_flog(x);
- assert_eq!(z, r);
+ assert_approx_eq!(z, r);
let r = simd_flog2(x);
- assert_eq!(z, r);
+ assert_approx_eq!(z, r);
let r = simd_flog10(x);
- assert_eq!(z, r);
+ assert_approx_eq!(z, r);
let r = simd_fpow(h, x);
- assert_eq!(h, r);
+ assert_approx_eq!(h, r);
let r = simd_fpowi(h, 1);
- assert_eq!(h, r);
+ assert_approx_eq!(h, r);
let r = simd_fsin(z);
- assert_eq!(z, r);
+ assert_approx_eq!(z, r);
}
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// min-llvm-version 5.0
// ignore-emscripten
// Test that the simd_reduce_{op} intrinsics produce the correct results.
// ignore-emscripten no processes
// ignore-musl FIXME #31506
// ignore-pretty
-// min-system-llvm-version 5.0
// compile-flags: -C lto
// no-prefer-dynamic
// ignore-cloudabi no processes
// ignore-emscripten no processes
// ignore-musl FIXME #31506
-// min-system-llvm-version 5.0
use std::mem;
use std::process::Command;
// except according to those terms.
// compile-flags: -Z thinlto -C codegen-units=2
-// min-llvm-version 4.0
#[global_allocator]
static A: std::alloc::System = std::alloc::System;
// compile-flags: -Clto=thin
// no-prefer-dynamic
-// min-llvm-version 4.0
fn main() {
println!("hello!");
// except according to those terms.
// aux-build:dylib.rs
-// min-llvm-version 4.0
extern crate dylib;
// aux-build:msvc-imp-present.rs
// compile-flags: -Z thinlto -C codegen-units=8
-// min-llvm-version: 4.0
// no-prefer-dynamic
// On MSVC we have a "hack" where we emit symbols that look like `_imp_$name`
// except according to those terms.
// compile-flags: -Z thinlto -C codegen-units=8 -O
-// min-llvm-version 4.0
// ignore-emscripten can't inspect instructions on emscripten
// We want to assert here that ThinLTO will inline across codegen units. There's
// compile-flags: -C codegen-units=8 -O -C lto=thin
// aux-build:thin-lto-inlines-aux.rs
-// min-llvm-version 4.0
// no-prefer-dynamic
// ignore-emscripten can't inspect instructions on emscripten
// compile-flags: -C codegen-units=8 -Z thinlto
// ignore-windows
-// min-llvm-version 4.0
#![feature(linkage)]
--- /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(tool_lints)]
+#![deny(unknown_lints)]
+
+#[allow(clippy::almost_swapped)]
+fn main() {}
--- /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(tool_lints)]
+#![feature(rust_2018_preview)]
+#![deny(unknown_lints)]
+
+#[allow(clippy::almost_swapped)]
+fn main() {}
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+ enum Void {}
+ std::rc::Weak::<Void>::new();
+ std::sync::Weak::<Void>::new();
+}
// compile-flags: -Z borrowck=compare
+#![recursion_limit = "128"]
+
use std::cell::Cell;
use std::mem::swap;
assert!(!val);
}
+fn punch_card() -> impl std::fmt::Debug {
+ ..=..=.. .. .. .. .. .. .. .. .. .. .. ..=.. ..
+ ..=.. ..=.. .. .. .. .. .. .. .. .. ..=..=..=..
+ ..=.. ..=.. ..=.. ..=.. .. ..=..=.. .. ..=.. ..
+ ..=..=.. .. ..=.. ..=.. ..=.. .. .. .. ..=.. ..
+ ..=.. ..=.. ..=.. ..=.. .. ..=.. .. .. ..=.. ..
+ ..=.. ..=.. ..=.. ..=.. .. .. ..=.. .. ..=.. ..
+ ..=.. ..=.. .. ..=..=.. ..=..=.. .. .. ..=.. ..
+}
+
pub fn main() {
strange();
funny();
fishy();
union();
special_characters();
+ punch_card();
}
--- /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
+
+// This test purpose is to check that unused_imports lint isn't fired
+// by rustdoc. Why would it? Because when rustdoc is running, it uses
+// "everybody-loops" which replaces parts of code with "loop {}" to get
+// huge performance improvements.
+
+#![deny(unused_imports)]
+
+use std::fs::File;
+
+pub fn f() {
+ let _: File;
+}
--- /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_name = "foo"]
+
+pub mod a {
+ pub struct Foo;
+ pub enum Bar {
+ Baz,
+ }
+}
+
+// @count 'foo/index.html' '//*[code="pub use a::Foo;"]' 1
+#[doc(no_inline)]
+pub use a::Foo;
+// @count 'foo/index.html' '//*[code="pub use a::Bar::Baz;"]' 1
+#[doc(no_inline)]
+pub use a::Bar::Baz;
--- /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_name = "foo"]
+
+// @has foo/index.html '//*[@class="docblock-short"]/p' 'fooo'
+// @!has foo/index.html '//*[@class="docblock-short"]/p/h1' 'fooo'
+// @has foo/fn.foo.html '//h1[@id="fooo"]/a[@href="#fooo"]' 'fooo'
+
+/// # fooo
+///
+/// foo
+pub fn foo() {}
+
+// @has foo/index.html '//*[@class="docblock-short"]/p' 'mooood'
+// @!has foo/index.html '//*[@class="docblock-short"]/p/h2' 'mooood'
+// @has foo/foo/index.html '//h2[@id="mooood"]/a[@href="#mooood"]' 'mooood'
+
+/// ## mooood
+///
+/// foo mod
+pub mod foo {}
+
+// @has foo/index.html '//*[@class="docblock-short"]/p/a[@href=\
+// "https://nougat.world"]/code' 'nougat'
+
+/// [`nougat`](https://nougat.world)
+pub struct Bar;
--- /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.
+
+// run-pass
+// no-prefer-dynamic
+
+#![feature(proc_macro)]
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+use proc_macro::*;
+
+#[proc_macro]
+pub fn check(_: TokenStream) -> TokenStream {
+ "
+ type Alias = FromOutside; // OK
+ struct Outer;
+ mod inner {
+ type Alias = FromOutside; // `FromOutside` shouldn't be available from here
+ type Inner = Outer; // `Outer` shouldn't be available from here
+ }
+ ".parse().unwrap()
+}
+
+#[proc_macro_attribute]
+pub fn check_attr(_: TokenStream, _: TokenStream) -> TokenStream {
+ "
+ type AliasAttr = FromOutside; // OK
+ struct OuterAttr;
+ mod inner_attr {
+ type Alias = FromOutside; // `FromOutside` shouldn't be available from here
+ type Inner = OuterAttr; // `OuterAttr` shouldn't be available from here
+ }
+ ".parse().unwrap()
+}
+
+#[proc_macro_derive(CheckDerive)]
+pub fn check_derive(_: TokenStream) -> TokenStream {
+ "
+ type AliasDerive = FromOutside; // OK
+ struct OuterDerive;
+ mod inner_derive {
+ type Alias = FromOutside; // `FromOutside` shouldn't be available from here
+ type Inner = OuterDerive; // `OuterDerive` shouldn't be available from here
+ }
+ ".parse().unwrap()
+}
--- /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.
+
+// Modules generated by transparent proc macros still acts as barriers for names (issue #50504).
+
+// aux-build:generate-mod.rs
+
+#![feature(proc_macro, proc_macro_gen, proc_macro_path_invoc)]
+
+extern crate generate_mod;
+
+struct FromOutside;
+
+generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
+ //~| ERROR cannot find type `Outer` in this scope
+
+#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope
+ //~| ERROR cannot find type `OuterAttr` in this scope
+struct S;
+
+#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope
+ //~| WARN cannot find type `OuterDerive` in this scope
+ //~| WARN this was previously accepted
+ //~| WARN this was previously accepted
+struct Z;
+
+fn main() {}
--- /dev/null
+error[E0412]: cannot find type `FromOutside` in this scope
+ --> $DIR/generate-mod.rs:21:1
+ |
+LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
+ | ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
+
+error[E0412]: cannot find type `Outer` in this scope
+ --> $DIR/generate-mod.rs:21:1
+ |
+LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
+ | ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
+
+error[E0412]: cannot find type `FromOutside` in this scope
+ --> $DIR/generate-mod.rs:24:1
+ |
+LL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
+
+error[E0412]: cannot find type `OuterAttr` in this scope
+ --> $DIR/generate-mod.rs:24:1
+ |
+LL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
+
+warning: cannot find type `FromOutside` in this scope
+ --> $DIR/generate-mod.rs:28:10
+ |
+LL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
+ |
+ = note: #[warn(proc_macro_derive_resolution_fallback)] on by default
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #50504 <https://github.com/rust-lang/rust/issues/50504>
+
+warning: cannot find type `OuterDerive` in this scope
+ --> $DIR/generate-mod.rs:28:10
+ |
+LL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #50504 <https://github.com/rust-lang/rust/issues/50504>
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0412`.
--- /dev/null
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//compile-flags: -Z borrowck=mir
+
+#![feature(slice_patterns)]
+
+fn nop(_s: &[& i32]) {}
+fn nop_subslice(_s: &[i32]) {}
+
+fn const_index_ok(s: &mut [i32]) {
+ if let [ref first, ref second, _, ref fourth, ..] = *s {
+ if let [_, _, ref mut third, ..] = *s {
+ nop(&[first, second, third, fourth]);
+ }
+ }
+}
+
+fn const_index_err(s: &mut [i32]) {
+ if let [ref first, ref second, ..] = *s {
+ if let [_, ref mut second2, ref mut third, ..] = *s { //~ERROR
+ nop(&[first, second, second2, third]);
+ }
+ }
+}
+
+fn const_index_from_end_ok(s: &mut [i32]) {
+ if let [.., ref fourth, ref third, _, ref first] = *s {
+ if let [.., ref mut second, _] = *s {
+ nop(&[first, second, third, fourth]);
+ }
+ }
+}
+
+fn const_index_from_end_err(s: &mut [i32]) {
+ if let [.., ref fourth, ref third, _, ref first] = *s {
+ if let [.., ref mut third2, _, _] = *s { //~ERROR
+ nop(&[first, third, third2, fourth]);
+ }
+ }
+}
+
+fn const_index_mixed(s: &mut [i32]) {
+ if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
+ if let [ref mut from_begin0, ..] = *s {
+ nop(&[from_begin0, from_end1, from_end3, from_end4]);
+ }
+ if let [_, ref mut from_begin1, ..] = *s { //~ERROR
+ nop(&[from_begin1, from_end1, from_end3, from_end4]);
+ }
+ if let [_, _, ref mut from_begin2, ..] = *s { //~ERROR
+ nop(&[from_begin2, from_end1, from_end3, from_end4]);
+ }
+ if let [_, _, _, ref mut from_begin3, ..] = *s { //~ERROR
+ nop(&[from_begin3, from_end1, from_end3, from_end4]);
+ }
+ }
+ if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s {
+ if let [.., ref mut from_end1] = *s {
+ nop(&[from_begin0, from_begin1, from_begin3, from_end1]);
+ }
+ if let [.., ref mut from_end2, _] = *s { //~ERROR
+ nop(&[from_begin0, from_begin1, from_begin3, from_end2]);
+ }
+ if let [.., ref mut from_end3, _, _] = *s { //~ERROR
+ nop(&[from_begin0, from_begin1, from_begin3, from_end3]);
+ }
+ if let [.., ref mut from_end4, _, _, _] = *s { //~ERROR
+ nop(&[from_begin0, from_begin1, from_begin3, from_end4]);
+ }
+ }
+}
+
+fn const_index_and_subslice_ok(s: &mut [i32]) {
+ if let [ref first, ref second, ..] = *s {
+ if let [_, _, ref mut tail..] = *s {
+ nop(&[first, second]);
+ nop_subslice(tail);
+ }
+ }
+}
+
+fn const_index_and_subslice_err(s: &mut [i32]) {
+ if let [ref first, ref second, ..] = *s {
+ if let [_, ref mut tail..] = *s { //~ERROR
+ nop(&[first, second]);
+ nop_subslice(tail);
+ }
+ }
+}
+
+fn const_index_and_subslice_from_end_ok(s: &mut [i32]) {
+ if let [.., ref second, ref first] = *s {
+ if let [ref mut tail.., _, _] = *s {
+ nop(&[first, second]);
+ nop_subslice(tail);
+ }
+ }
+}
+
+fn const_index_and_subslice_from_end_err(s: &mut [i32]) {
+ if let [.., ref second, ref first] = *s {
+ if let [ref mut tail.., _] = *s { //~ERROR
+ nop(&[first, second]);
+ nop_subslice(tail);
+ }
+ }
+}
+
+fn subslices(s: &mut [i32]) {
+ if let [_, _, _, ref s1..] = *s {
+ if let [ref mut s2.., _, _, _] = *s { //~ERROR
+ nop_subslice(s1);
+ nop_subslice(s2);
+ }
+ }
+}
+
+fn main() {
+ let mut v = [1,2,3,4];
+ const_index_ok(&mut v);
+ const_index_err(&mut v);
+ const_index_from_end_ok(&mut v);
+ const_index_from_end_err(&mut v);
+ const_index_and_subslice_ok(&mut v);
+ const_index_and_subslice_err(&mut v);
+ const_index_and_subslice_from_end_ok(&mut v);
+ const_index_and_subslice_from_end_err(&mut v);
+ subslices(&mut v);
+}
--- /dev/null
+error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-slice-pattern-element-loan.rs:28:20
+ |
+LL | if let [ref first, ref second, ..] = *s {
+ | ---------- immutable borrow occurs here
+LL | if let [_, ref mut second2, ref mut third, ..] = *s { //~ERROR
+ | ^^^^^^^^^^^^^^^^ mutable borrow occurs here
+LL | nop(&[first, second, second2, third]);
+ | ------ borrow later used here
+
+error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-slice-pattern-element-loan.rs:44:21
+ |
+LL | if let [.., ref fourth, ref third, _, ref first] = *s {
+ | --------- immutable borrow occurs here
+LL | if let [.., ref mut third2, _, _] = *s { //~ERROR
+ | ^^^^^^^^^^^^^^ mutable borrow occurs here
+LL | nop(&[first, third, third2, fourth]);
+ | ----- borrow later used here
+
+error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-slice-pattern-element-loan.rs:55:20
+ |
+LL | if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
+ | ------------- immutable borrow occurs here
+...
+LL | if let [_, ref mut from_begin1, ..] = *s { //~ERROR
+ | ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
+LL | nop(&[from_begin1, from_end1, from_end3, from_end4]);
+ | --------- borrow later used here
+
+error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-slice-pattern-element-loan.rs:58:23
+ |
+LL | if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
+ | ------------- immutable borrow occurs here
+...
+LL | if let [_, _, ref mut from_begin2, ..] = *s { //~ERROR
+ | ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
+LL | nop(&[from_begin2, from_end1, from_end3, from_end4]);
+ | --------- borrow later used here
+
+error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-slice-pattern-element-loan.rs:61:26
+ |
+LL | if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
+ | ------------- immutable borrow occurs here
+...
+LL | if let [_, _, _, ref mut from_begin3, ..] = *s { //~ERROR
+ | ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
+LL | nop(&[from_begin3, from_end1, from_end3, from_end4]);
+ | --------- borrow later used here
+
+error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-slice-pattern-element-loan.rs:69:21
+ |
+LL | if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s {
+ | --------------- immutable borrow occurs here
+...
+LL | if let [.., ref mut from_end2, _] = *s { //~ERROR
+ | ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
+LL | nop(&[from_begin0, from_begin1, from_begin3, from_end2]);
+ | ----------- borrow later used here
+
+error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-slice-pattern-element-loan.rs:72:21
+ |
+LL | if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s {
+ | --------------- immutable borrow occurs here
+...
+LL | if let [.., ref mut from_end3, _, _] = *s { //~ERROR
+ | ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
+LL | nop(&[from_begin0, from_begin1, from_begin3, from_end3]);
+ | ----------- borrow later used here
+
+error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-slice-pattern-element-loan.rs:75:21
+ |
+LL | if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s {
+ | --------------- immutable borrow occurs here
+...
+LL | if let [.., ref mut from_end4, _, _, _] = *s { //~ERROR
+ | ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
+LL | nop(&[from_begin0, from_begin1, from_begin3, from_end4]);
+ | ----------- borrow later used here
+
+error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-slice-pattern-element-loan.rs:92:20
+ |
+LL | if let [ref first, ref second, ..] = *s {
+ | ---------- immutable borrow occurs here
+LL | if let [_, ref mut tail..] = *s { //~ERROR
+ | ^^^^^^^^^^^^ mutable borrow occurs here
+LL | nop(&[first, second]);
+ | ------ borrow later used here
+
+error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-slice-pattern-element-loan.rs:110:17
+ |
+LL | if let [.., ref second, ref first] = *s {
+ | ---------- immutable borrow occurs here
+LL | if let [ref mut tail.., _] = *s { //~ERROR
+ | ^^^^^^^^^^^^ mutable borrow occurs here
+LL | nop(&[first, second]);
+ | ------ borrow later used here
+
+error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-slice-pattern-element-loan.rs:119:17
+ |
+LL | if let [_, _, _, ref s1..] = *s {
+ | ------ immutable borrow occurs here
+LL | if let [ref mut s2.., _, _, _] = *s { //~ERROR
+ | ^^^^^^^^^^ mutable borrow occurs here
+LL | nop_subslice(s1);
+ | -- borrow later used here
+
+error: aborting due to 11 previous errors
+
+For more information about this error, try `rustc --explain E0502`.
LL | give_any(|y| x = Some(y));
| ^
-error: free region `` does not outlive free region `'_#2r`
- --> $DIR/issue-45983.rs:17:27
+error: unsatisfied lifetime constraints
+ --> $DIR/issue-45983.rs:17:18
|
+LL | let x = None;
+ | - lifetime `'2` appears in the type of `x`
LL | give_any(|y| x = Some(y));
- | ^
+ | - ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
+ | |
+ | lifetime `'1` appears in this argument
error[E0594]: cannot assign to immutable item `x`
--> $DIR/issue-45983.rs:17:18
LL | let mut lines_to_use: Vec<&CrateId> = Vec::new();
| ^
-error: free region `` does not outlive free region `'_#2r`
+error: unsatisfied lifetime constraints
--> $DIR/issue-7573.rs:32:9
|
+LL | let mut lines_to_use: Vec<&CrateId> = Vec::new();
+ | ---------------- lifetime `'2` appears in the type of `lines_to_use`
+LL | //~^ NOTE cannot infer an appropriate lifetime
+LL | let push_id = |installed_id: &CrateId| {
+ | - let's call the lifetime of this reference `'1`
+...
LL | lines_to_use.push(installed_id);
- | ^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
error: aborting due to previous error
LL | with_int(|y| x = Some(y));
| ^
-error: free region `` does not outlive free region `'_#2r`
- --> $DIR/regions-escape-bound-fn-2.rs:18:27
+error: unsatisfied lifetime constraints
+ --> $DIR/regions-escape-bound-fn-2.rs:18:18
|
+LL | let mut x = None;
+ | ----- lifetime `'2` appears in the type of `x`
LL | with_int(|y| x = Some(y));
- | ^
+ | - ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
+ | |
+ | lifetime `'1` appears in this argument
error: aborting due to previous error
LL | with_int(|y| x = Some(y));
| ^^^^^^^
-error: free region `` does not outlive free region `'_#2r`
- --> $DIR/regions-escape-bound-fn.rs:18:27
+error: unsatisfied lifetime constraints
+ --> $DIR/regions-escape-bound-fn.rs:18:18
|
+LL | let mut x: Option<&isize> = None;
+ | ----- lifetime `'2` appears in the type of `x`
LL | with_int(|y| x = Some(y));
- | ^
+ | - ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
+ | |
+ | lifetime `'1` appears in this argument
error: aborting due to previous error
LL | with_int(&mut |y| x = Some(y));
| ^^^^^^^
-error: free region `` does not outlive free region `'_#2r`
- --> $DIR/regions-escape-unboxed-closure.rs:16:32
+error: unsatisfied lifetime constraints
+ --> $DIR/regions-escape-unboxed-closure.rs:16:23
|
+LL | let mut x: Option<&isize> = None;
+ | ----- lifetime `'2` appears in the type of `x`
LL | with_int(&mut |y| x = Some(y));
- | ^
+ | - ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
+ | |
+ | lifetime `'1` appears in this argument
error: aborting due to previous error
= note: FromEnv(Self: Foo) :- FromEnv(Self: Bar).
= note: FromEnv(Self: Foo) :- FromEnv(Self: Bar).
= note: Implemented(Self: Bar) :- FromEnv(Self: Bar).
+ = note: WellFormed(Self: Bar) :- Implemented(Self: Bar), WellFormed(Self: Foo), WellFormed(Self: Foo).
error: program clause dump
--> $DIR/lower_env1.rs:19:1
= note: Implemented(Self: Bar) :- FromEnv(Self: Bar).
= note: Implemented(Self: Foo) :- FromEnv(Self: Foo).
= note: Implemented(Self: std::marker::Sized) :- FromEnv(Self: std::marker::Sized).
+ = note: WellFormed(Self: Bar) :- Implemented(Self: Bar), WellFormed(Self: Foo), WellFormed(Self: Foo).
+ = note: WellFormed(Self: Foo) :- Implemented(Self: Foo).
+ = note: WellFormed(Self: std::marker::Sized) :- Implemented(Self: std::marker::Sized).
error: aborting due to 2 previous errors
= note: FromEnv(T: std::marker::Sized) :- FromEnv(Self: Foo<S, T, U>).
= note: FromEnv(U: std::marker::Sized) :- FromEnv(Self: Foo<S, T, U>).
= note: Implemented(Self: Foo<S, T, U>) :- FromEnv(Self: Foo<S, T, U>).
+ = note: WellFormed(Self: Foo<S, T, U>) :- Implemented(Self: Foo<S, T, U>), WellFormed(S: std::marker::Sized), WellFormed(T: std::marker::Sized), WellFormed(U: std::marker::Sized).
error: aborting due to previous error
= note: FromEnv(F: std::ops::Fn<(&'a (u8, u16),)>) :- FromEnv(Self: Foo<F>).
= note: Implemented(Self: Foo<F>) :- FromEnv(Self: Foo<F>).
= note: ProjectionEq(<F as std::ops::FnOnce<(&'a (u8, u16),)>>::Output == &'a u8) :- FromEnv(Self: Foo<F>).
+ = note: WellFormed(Self: Foo<F>) :- Implemented(Self: Foo<F>), WellFormed(F: std::marker::Sized), forall<> { WellFormed(F: std::ops::Fn<(&'a (u8, u16),)>) }, forall<> { ProjectionEq(<F as std::ops::FnOnce<(&'a (u8, u16),)>>::Output == &'a u8) }.
error: aborting due to previous error
= note: Implemented(Self: Foo<'a, 'b, S, T, U>) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
= note: RegionOutlives('a : 'b) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
= note: TypeOutlives(U : 'b) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+ = note: WellFormed(Self: Foo<'a, 'b, S, T, U>) :- Implemented(Self: Foo<'a, 'b, S, T, U>), WellFormed(S: std::marker::Sized), WellFormed(T: std::marker::Sized), WellFormed(S: std::fmt::Debug), WellFormed(T: std::borrow::Borrow<U>), RegionOutlives('a : 'b), TypeOutlives(U : 'b).
error: aborting due to previous error
LL | f = Some(x);
| ^^^^^^^
-error: free region `` does not outlive free region `'_#2r`
- --> $DIR/expect-region-supply-region.rs:28:18
+error: unsatisfied lifetime constraints
+ --> $DIR/expect-region-supply-region.rs:28:9
|
+LL | let mut f: Option<&u32> = None;
+ | ----- lifetime `'2` appears in the type of `f`
+LL | closure_expecting_bound(|x| {
+ | - lifetime `'1` appears in this argument
LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
- | ^
+ | ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
-error: free region `` does not outlive free region `'_#2r`
- --> $DIR/expect-region-supply-region.rs:38:18
+error: unsatisfied lifetime constraints
+ --> $DIR/expect-region-supply-region.rs:38:9
|
+LL | let mut f: Option<&u32> = None;
+ | ----- lifetime `'2` appears in the type of `f`
+LL | closure_expecting_bound(|x: &u32| {
+ | - let's call the lifetime of this reference `'1`
LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
- | ^
+ | ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
-error: free region `` does not outlive free region `'_#2r`
- --> $DIR/expect-region-supply-region.rs:52:18
+error: unsatisfied lifetime constraints
+ --> $DIR/expect-region-supply-region.rs:52:9
|
+LL | let mut f: Option<&u32> = None;
+ | ----- lifetime `'2` appears in the type of `f`
+...
+LL | closure_expecting_bound(|x: &'x u32| {
+ | - let's call the lifetime of this reference `'1`
+...
LL | f = Some(x);
- | ^
+ | ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
error: aborting due to 3 previous errors
static FOO: i32 = [][0];
//~^ ERROR E0080
-//~| ERROR E0080
fn main() {
let array = [std::env::args().len()];
LL | static FOO: i32 = [][0];
| ^^^^^ index out of bounds: the len is 0 but the index is 0
-error[E0080]: could not evaluate static initializer
- --> $DIR/index_out_of_bounds.rs:11:1
- |
-LL | static FOO: i32 = [][0];
- | ^^^^^^^^^^^^^^^^^^-----^
- | |
- | index out of bounds: the len is 0 but the index is 0
-
error: index out of bounds: the len is 1 but the index is 1
- --> $DIR/index_out_of_bounds.rs:17:5
+ --> $DIR/index_out_of_bounds.rs:16:5
|
LL | array[1]; //~ ERROR index out of bounds
| ^^^^^^^^
|
= note: #[deny(const_err)] on by default
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
--- /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_let)]
+
+fn main() {
+ // Tests the Collatz conjecture with an incorrect base case (0 instead of 1).
+ // The value of `n` will loop indefinitely (4 - 2 - 1 - 4).
+ let _ = [(); {
+ //~^ WARNING Constant evaluating a complex constant, this might take some time
+ //~| ERROR could not evaluate repeat length
+ let mut n = 113383; // #20 in https://oeis.org/A006884
+ while n != 0 { //~ ERROR constant contains unimplemented expression type
+ n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
+ }
+ n
+ }];
+}
--- /dev/null
+error[E0019]: constant contains unimplemented expression type
+ --> $DIR/infinite_loop.rs:20:9
+ |
+LL | / while n != 0 { //~ ERROR constant contains unimplemented expression type
+LL | | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
+LL | | }
+ | |_________^
+
+warning: Constant evaluating a complex constant, this might take some time
+ --> $DIR/infinite_loop.rs:16:18
+ |
+LL | let _ = [(); {
+ | __________________^
+LL | | //~^ WARNING Constant evaluating a complex constant, this might take some time
+LL | | //~| ERROR could not evaluate repeat length
+LL | | let mut n = 113383; // #20 in https://oeis.org/A006884
+... |
+LL | | n
+LL | | }];
+ | |_____^
+
+error[E0080]: could not evaluate repeat length
+ --> $DIR/infinite_loop.rs:16:18
+ |
+LL | let _ = [(); {
+ | __________________^
+LL | | //~^ WARNING Constant evaluating a complex constant, this might take some time
+LL | | //~| ERROR could not evaluate repeat length
+LL | | let mut n = 113383; // #20 in https://oeis.org/A006884
+LL | | while n != 0 { //~ ERROR constant contains unimplemented expression type
+LL | | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
+ | | ---------- duplicate interpreter state observed here, const evaluation will never terminate
+LL | | }
+LL | | n
+LL | | }];
+ | |_____^
+
+error: aborting due to 2 previous errors
+
+Some errors occurred: E0019, E0080.
+For more information about an error, try `rustc --explain E0019`.
use std::fmt::Debug;
const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
const CONST_FOO: str = *"foo";
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
static STATIC_BAR: str = *"bar";
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
fn main() {
println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR);
-error[E0277]: the size for value values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time
--> $DIR/const-unsized.rs:13:29
|
LL | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: constant expressions must have a statically known size
-error[E0277]: the size for value values of type `str` cannot be known at compilation time
+error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/const-unsized.rs:16:24
|
LL | const CONST_FOO: str = *"foo";
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: constant expressions must have a statically known size
-error[E0277]: the size for value values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time
--> $DIR/const-unsized.rs:19:31
|
LL | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: constant expressions must have a statically known size
-error[E0277]: the size for value values of type `str` cannot be known at compilation time
+error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/const-unsized.rs:22:26
|
LL | static STATIC_BAR: str = *"bar";
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^ statics require immutable values
-error[E0017]: references in statics may only refer to immutable values
- --> $DIR/E0017.rs:17:38
- |
-LL | static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017
- | ^^^^^^ statics require immutable values
-
error[E0596]: cannot borrow immutable item `X` as mutable
--> $DIR/E0017.rs:15:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^ cannot borrow as mutable
+error[E0017]: references in statics may only refer to immutable values
+ --> $DIR/E0017.rs:17:38
+ |
+LL | static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017
+ | ^^^^^^ statics require immutable values
+
error: aborting due to 4 previous errors
Some errors occurred: E0017, E0596.
-error[E0133]: call to unsafe function requires unsafe function or block
+error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/E0133.rs:14:5
|
LL | f();
| ^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
error: aborting due to previous error
}
fn f(p: Path) { }
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
fn main() {
some_func(5i32);
-error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> $DIR/E0277.rs:23:6
|
LL | fn f(p: Path) { }
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^ statics require immutable values
-error[E0017]: references in statics may only refer to immutable values
- --> $DIR/E0388.rs:17:38
- |
-LL | static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017
- | ^^^^^^ statics require immutable values
-
error[E0596]: cannot borrow immutable item `X` as mutable
--> $DIR/E0388.rs:15:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^ cannot borrow as mutable
+error[E0017]: references in statics may only refer to immutable values
+ --> $DIR/E0388.rs:17:38
+ |
+LL | static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017
+ | ^^^^^^ statics require immutable values
+
error: aborting due to 4 previous errors
Some errors occurred: E0017, E0596.
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
| ^^^^^^
-error: free region `` does not outlive free region `'_#2r`
+error: unsatisfied lifetime constraints
--> $DIR/E0621-does-not-trigger-for-closures.rs:25:26
|
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
- | ^^^^^
+ | ----------^^^^^-----------------
+ | | | |
+ | | | free region requires that `'1` must outlive `'2`
+ | | lifetime `'1` appears in this argument
+ | lifetime `'2` appears in return type
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.
+
+#[warn(clippy::decimal_literal_representation)]
+//~^ ERROR scoped lint `clippy::decimal_literal_representation` is experimental
+fn main() {
+ let a = 65_535;
+}
--- /dev/null
+error[E0658]: scoped lint `clippy::decimal_literal_representation` is experimental (see issue #44690)
+ --> $DIR/feature-gate-tool_lints.rs:11:8
+ |
+LL | #[warn(clippy::decimal_literal_representation)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(tool_lints)] to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
-error[E0277]: the size for value values of type `str` cannot be known at compilation time
+error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:62:1
|
LL | struct TwoStrs(str, str) where str: Sized; //~ ERROR
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
-error[E0277]: the size for value values of type `(dyn A + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:65:1
|
LL | / fn unsized_local() where Dst<A>: Sized { //~ ERROR
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
-error[E0277]: the size for value values of type `str` cannot be known at compilation time
+error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:69:1
|
LL | / fn return_str() -> str where str: Sized { //~ ERROR
-error[E0658]: experimental attribute (see issue #51088)
+error[E0658]: experimental attribute (see issue #52090)
--> $DIR/feature-gate-wasm_import_module.rs:11:1
|
LL | #[wasm_import_module = "test"] //~ ERROR: experimental
fn main() {
let s = String::from("foo");
let mut gen = move || {
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
yield s[..];
};
unsafe { gen.resume(); }
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
-error[E0277]: the size for value values of type `str` cannot be known at compilation time
+error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/sized-yield.rs:17:26
|
LL | let mut gen = move || {
| __________________________^
-LL | | //~^ ERROR the size for value values of type
+LL | | //~^ ERROR the size for values of type
LL | | yield s[..];
LL | | };
| |____^ doesn't have a size known at compile-time
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: the yield type of a generator must have a statically known size
-error[E0277]: the size for value values of type `str` cannot be known at compilation time
+error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/sized-yield.rs:21:17
|
LL | unsafe { gen.resume(); }
--- /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.
+
+// ignore-pretty pretty-printing is unhygienic
+
+#![feature(decl_macro)]
+
+macro m($t:ty, $e:expr) {
+ mod foo {
+ #[allow(unused)]
+ struct S;
+ pub(super) fn f(_: $t) {}
+ }
+ foo::f($e);
+}
+
+fn main() {
+ struct S;
+ m!(S, S); //~ ERROR cannot find type `S` in this scope
+}
--- /dev/null
+error[E0412]: cannot find type `S` in this scope
+ --> $DIR/arguments.rs:26:8
+ |
+LL | m!(S, S); //~ ERROR cannot find type `S` in this scope
+ | ^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
#![feature(decl_macro, rustc_attrs)]
+macro genmod($FromOutside: ident, $Outer: ident) {
+ type A = $FromOutside;
+ struct $Outer;
+ mod inner {
+ type A = $FromOutside; // `FromOutside` shouldn't be available from here
+ type Inner = $Outer; // `Outer` shouldn't be available from here
+ }
+}
+
#[rustc_transparent_macro]
-macro genmod() {
- mod m {
- type A = S; //~ ERROR cannot find type `S` in this scope
+macro genmod_transparent() {
+ type A = FromOutside;
+ struct Outer;
+ mod inner {
+ type A = FromOutside; //~ ERROR cannot find type `FromOutside` in this scope
+ type Inner = Outer; //~ ERROR cannot find type `Outer` in this scope
}
}
-struct S;
+macro_rules! genmod_legacy { () => {
+ type A = FromOutside;
+ struct Outer;
+ mod inner {
+ type A = FromOutside; //~ ERROR cannot find type `FromOutside` in this scope
+ type Inner = Outer; //~ ERROR cannot find type `Outer` in this scope
+ }
+}}
-genmod!();
+fn check() {
+ struct FromOutside;
+ genmod!(FromOutside, Outer); //~ ERROR cannot find type `FromOutside` in this scope
+ //~| ERROR cannot find type `Outer` in this scope
+}
+
+fn check_transparent() {
+ struct FromOutside;
+ genmod_transparent!();
+}
+
+fn check_legacy() {
+ struct FromOutside;
+ genmod_legacy!();
+}
-error[E0412]: cannot find type `S` in this scope
- --> $DIR/generate-mod.rs:18:18
+error[E0412]: cannot find type `FromOutside` in this scope
+ --> $DIR/generate-mod.rs:45:13
|
-LL | type A = S; //~ ERROR cannot find type `S` in this scope
- | ^ did you mean `A`?
+LL | genmod!(FromOutside, Outer); //~ ERROR cannot find type `FromOutside` in this scope
+ | ^^^^^^^^^^^ not found in this scope
+
+error[E0412]: cannot find type `Outer` in this scope
+ --> $DIR/generate-mod.rs:45:26
+ |
+LL | genmod!(FromOutside, Outer); //~ ERROR cannot find type `FromOutside` in this scope
+ | ^^^^^ not found in this scope
+
+error[E0412]: cannot find type `FromOutside` in this scope
+ --> $DIR/generate-mod.rs:29:18
+ |
+LL | type A = FromOutside; //~ ERROR cannot find type `FromOutside` in this scope
+ | ^^^^^^^^^^^ not found in this scope
+...
+LL | genmod_transparent!();
+ | ---------------------- in this macro invocation
+
+error[E0412]: cannot find type `Outer` in this scope
+ --> $DIR/generate-mod.rs:30:22
+ |
+LL | type Inner = Outer; //~ ERROR cannot find type `Outer` in this scope
+ | ^^^^^ not found in this scope
+...
+LL | genmod_transparent!();
+ | ---------------------- in this macro invocation
+
+error[E0412]: cannot find type `FromOutside` in this scope
+ --> $DIR/generate-mod.rs:38:18
+ |
+LL | type A = FromOutside; //~ ERROR cannot find type `FromOutside` in this scope
+ | ^^^^^^^^^^^ not found in this scope
+...
+LL | genmod_legacy!();
+ | ----------------- in this macro invocation
+
+error[E0412]: cannot find type `Outer` in this scope
+ --> $DIR/generate-mod.rs:39:22
+ |
+LL | type Inner = Outer; //~ ERROR cannot find type `Outer` in this scope
+ | ^^^^^ not found in this scope
...
-LL | genmod!();
- | ---------- in this macro invocation
+LL | genmod_legacy!();
+ | ----------------- in this macro invocation
error[E0601]: `main` function not found in crate `generate_mod`
|
= note: consider adding a `main` function to `$DIR/generate-mod.rs`
-error: aborting due to 2 previous errors
+error: aborting due to 7 previous errors
Some errors occurred: E0412, E0601.
For more information about an error, try `rustc --explain E0412`.
}
}
}
+ macro n_with_super($j:ident) {
+ mod test {
+ use super::*;
+ fn g() {
+ let _: u32 = $i();
+ let _: () = f();
+ super::$j();
+ }
+ }
+ }
- n!(f);
+ n!(f); //~ ERROR cannot find function `f` in this scope
+ n_with_super!(f);
mod test2 {
super::n! {
f //~ ERROR cannot find function `f` in this scope
}
+ super::n_with_super! {
+ f
+ }
}
}
}
|
LL | use foo::test2::test::g;
|
-LL | use foo::test::g;
+LL | use foo::test2::test::g;
|
LL | use foo::test::g;
|
+and 2 other candidates
+
+error[E0425]: cannot find function `f` in this scope
+ --> $DIR/globs.rs:71:12
+ |
+LL | n!(f);
+ | ------ in this macro invocation
+...
+LL | n!(f); //~ ERROR cannot find function `f` in this scope
+ | ^ not found in this scope
error[E0425]: cannot find function `f` in this scope
- --> $DIR/globs.rs:64:17
+ --> $DIR/globs.rs:75:17
|
LL | n!(f);
| ------ in this macro invocation
LL | f //~ ERROR cannot find function `f` in this scope
| ^ not found in this scope
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0425`.
LL | self.x.iter().map(|a| a.0)
| ^^^^
-error: free region `` does not outlive free region `'static`
+error: unsatisfied lifetime constraints
--> $DIR/static-return-lifetime-infered.rs:17:9
|
+LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
+ | - let's call the lifetime of this reference `'1`
LL | self.x.iter().map(|a| a.0)
- | ^^^^^^^^^^^^^
+ | ^^^^^^ cast requires that `'1` must outlive `'static`
-error: free region `'a` does not outlive free region `'static`
+error: unsatisfied lifetime constraints
--> $DIR/static-return-lifetime-infered.rs:21:9
|
LL | self.x.iter().map(|a| a.0)
- | ^^^^^^^^^^^^^
+ | ^^^^^^ cast requires that `'a` must outlive `'static`
error: aborting due to 2 previous errors
LL | static_val(x); //~ ERROR cannot infer
| ^
-error: free region `'a` does not outlive free region `'static`
+error: unsatisfied lifetime constraints
--> $DIR/dyn-trait.rs:32:5
|
LL | static_val(x); //~ ERROR cannot infer
- | ^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^ argument requires that `'a` must outlive `'static`
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.
+
+fn main() {
+ let b: &[u8] = include_str!("file.txt"); //~ ERROR mismatched types
+ let s: &str = include_bytes!("file.txt"); //~ ERROR mismatched types
+}
--- /dev/null
+error[E0308]: mismatched types
+ --> $DIR/mismatched-types.rs:12:20
+ |
+LL | let b: &[u8] = include_str!("file.txt"); //~ ERROR mismatched types
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found str
+ |
+ = note: expected type `&[u8]`
+ found type `&'static str`
+
+error[E0308]: mismatched types
+ --> $DIR/mismatched-types.rs:13:19
+ |
+LL | let s: &str = include_bytes!("file.txt"); //~ ERROR mismatched types
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found array of 0 elements
+ |
+ = note: expected type `&str`
+ found type `&'static [u8; 0]`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
--- /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.
+
+#[repr(packed)]
+pub struct Good {
+ data: &'static u32,
+ data2: [&'static u32; 2],
+ aligned: [u8; 32],
+}
+
+#[repr(packed)]
+pub struct JustArray {
+ array: [u32]
+}
+
+#[deny(safe_packed_borrows)]
+fn main() {
+ let good = Good {
+ data: &0,
+ data2: [&0, &0],
+ aligned: [0; 32]
+ };
+
+ unsafe {
+ let _ = &good.data; // ok
+ let _ = &good.data2[0]; // ok
+ }
+
+ let _ = &good.data; //~ ERROR borrow of packed field is unsafe
+ //~| hard error
+ let _ = &good.data2[0]; //~ ERROR borrow of packed field is unsafe
+ //~| hard error
+ let _ = &*good.data; // ok, behind a pointer
+ let _ = &good.aligned; // ok, has align 1
+ let _ = &good.aligned[2]; // ok, has align 1
+}
--- /dev/null
+error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
+ --> $DIR/issue-27060.rs:36:13
+ |
+LL | let _ = &good.data; //~ ERROR borrow of packed field is unsafe
+ | ^^^^^^^^^^
+ |
+note: lint level defined here
+ --> $DIR/issue-27060.rs:23:8
+ |
+LL | #[deny(safe_packed_borrows)]
+ | ^^^^^^^^^^^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
+ = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
+
+error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
+ --> $DIR/issue-27060.rs:38:13
+ |
+LL | let _ = &good.data2[0]; //~ ERROR borrow of packed field is unsafe
+ | ^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
+ = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
+
+error: aborting due to 2 previous errors
+
-error[E0133]: call to unsafe function requires unsafe function or block
+error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/issue-28776.rs:14:5
|
LL | (&ptr::write)(1 as *mut _, 42);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
error: aborting due to previous error
|
LL | }; //~ ERROR expected item, found `;`
| ^ help: consider removing this semicolon
+ |
+ = help: braced struct declarations are not followed by a semicolon
error: aborting due to previous error
--> $DIR/issue-47184.rs:14:44
|
LL | let _vec: Vec<&'static String> = vec![&String::new()];
- | ^^^^^^^^^^^^^ temporary value does not live long enough
-LL | //~^ ERROR borrowed value does not live long enough [E0597]
-LL | }
- | - temporary value only lives until here
+ | ^^^^^^^^^^^^^ - temporary value only lives until here
+ | |
+ | temporary value does not live long enough
|
= note: borrowed value must be valid for the static lifetime...
|
LL | println!(3 + 4); //~ ERROR expected a literal
| ^^^^^
+help: you might be missing a string literal to format with
+ |
+LL | println!("{}", 3 + 4); //~ ERROR expected a literal
+ | ^^^^^^^^^^^
error: aborting due to previous error
let _ = 42usize as *const [u8]; //~ ERROR is invalid
let _ = v as *const [u8]; //~ ERROR cannot cast
- let _ = fat_v as *const Foo; //~ ERROR the size for value values of type
+ let _ = fat_v as *const Foo; //~ ERROR the size for values of type
let _ = foo as *const str; //~ ERROR is invalid
let _ = foo as *mut str; //~ ERROR is invalid
let _ = main as *mut str; //~ ERROR is invalid
let _ = fat_sv as usize; //~ ERROR is invalid
let a : *const str = "hello";
- let _ = a as *const Foo; //~ ERROR the size for value values of type
+ let _ = a as *const Foo; //~ ERROR the size for values of type
// check no error cascade
let _ = main.f as *const u32; //~ ERROR no field
|
= note: vtable kinds may not match
-error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> $DIR/cast-rfc0401.rs:63:13
|
-LL | let _ = fat_v as *const Foo; //~ ERROR the size for value values of type
+LL | let _ = fat_v as *const Foo; //~ ERROR the size for values of type
| ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[u8]`
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required for the cast to the object type `dyn Foo`
-error[E0277]: the size for value values of type `str` cannot be known at compilation time
+error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/cast-rfc0401.rs:72:13
|
-LL | let _ = a as *const Foo; //~ ERROR the size for value values of type
+LL | let _ = a as *const Foo; //~ ERROR the size for values of type
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
--- /dev/null
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -C panic=abort
+// no-prefer-dynamic
+
+#![no_std]
+#![crate_type = "staticlib"]
+#![feature(panic_implementation, alloc_error_handler, alloc)]
+
+#[panic_implementation]
+fn panic(_: &core::panic::PanicInfo) -> ! {
+ loop {}
+}
+
+extern crate alloc;
+
+#[global_allocator]
+static A: MyAlloc = MyAlloc;
+
+struct MyAlloc;
+
+unsafe impl core::alloc::GlobalAlloc for MyAlloc {
+ unsafe fn alloc(&self, _: core::alloc::Layout) -> *mut u8 { 0 as _ }
+ unsafe fn dealloc(&self, _: *mut u8, _: core::alloc::Layout) {}
+}
--- /dev/null
+error: `#[alloc_error_handler]` function required, but not found
+
+error: aborting due to previous error
+
#![no_std]
#![crate_type = "staticlib"]
-#![feature(panic_implementation, lang_items, alloc)]
+#![feature(panic_implementation, alloc_error_handler, alloc)]
#[panic_implementation]
fn panic(_: &core::panic::PanicInfo) -> ! {
loop {}
}
-#[lang = "oom"]
-fn oom() {}
+#[alloc_error_handler]
+fn oom(_: core::alloc::Layout) -> ! {
+ loop {}
+}
extern crate alloc;
{
let y = 22;
let mut closure = expect_sig(|p, y| *p = y);
- //~^ ERROR does not outlive free region
+ //~^ ERROR
//~| WARNING not reporting region error due to nll
closure(&mut p, &y);
}
LL | let mut closure = expect_sig(|p, y| *p = y);
| ^
-error: free region `ReFree(DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]), BrAnon(3))` does not outlive free region `ReFree(DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]), BrAnon(2))`
+error: unsatisfied lifetime constraints
--> $DIR/escape-argument-callee.rs:36:45
|
LL | let mut closure = expect_sig(|p, y| *p = y);
- | ^^^^^^
+ | - - ^^^^^^ free region requires that `'1` must outlive `'2`
+ | | |
+ | | lifetime `'1` appears in this argument
+ | lifetime `'2` appears in this argument
note: No external requirements
--> $DIR/escape-argument-callee.rs:36:38
// Only works if 'x: 'y:
let p = x.get();
//~^ WARN not reporting region error due to nll
- //~| ERROR does not outlive free region
- demand_y(x, y, p)
+ demand_y(x, y, p) //~ ERROR
},
);
}
LL | let p = x.get();
| ^^^^^^^
-error: free region `ReFree(DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]), BrAnon(1))` does not outlive free region `ReFree(DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]), BrAnon(2))`
- --> $DIR/propagate-approximated-fail-no-postdom.rs:55:17
+error: unsatisfied lifetime constraints
+ --> $DIR/propagate-approximated-fail-no-postdom.rs:57:13
|
-LL | let p = x.get();
- | ^
+LL | |_outlives1, _outlives2, _outlives3, x, y| {
+ | ---------- ---------- lifetime `'2` appears in this argument
+ | |
+ | lifetime `'1` appears in this argument
+...
+LL | demand_y(x, y, p) //~ ERROR
+ | ^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
note: No external requirements
--> $DIR/propagate-approximated-fail-no-postdom.rs:53:9
LL | | // Only works if 'x: 'y:
LL | | let p = x.get();
LL | | //~^ WARN not reporting region error due to nll
-LL | | //~| ERROR does not outlive free region
-LL | | demand_y(x, y, p)
+LL | | demand_y(x, y, p) //~ ERROR
LL | | },
| |_________^
|
foo(cell, |cell_a, cell_x| {
//~^ WARNING not reporting region error due to nll
cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
- //~^ ERROR argument requires that data must outlive free region
+ //~^ ERROR
})
}
LL | foo(cell, |cell_a, cell_x| {
| ^^^
-error: argument requires that data must outlive free region `'_#1r`
- --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:20
+error: unsatisfied lifetime constraints
+ --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:9
|
+LL | foo(cell, |cell_a, cell_x| {
+ | ------ ------ lifetime `'1` appears in this argument
+ | |
+ | lifetime `'2` appears in this argument
+LL | //~^ WARNING not reporting region error due to nll
LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
- | ^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
note: No external requirements
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:31:15
| _______________^
LL | | //~^ WARNING not reporting region error due to nll
LL | | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
-LL | | //~^ ERROR argument requires that data must outlive free region
+LL | | //~^ ERROR
LL | | })
| |_____^
|
#[rustc_regions]
fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
- //~^ ERROR argument requires that data must outlive free region
+ //~^ ERROR
// 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, |_outlives, x, y| {
| _______________________________________________^
-LL | | //~^ ERROR argument requires that data must outlive free region
+LL | | //~^ ERROR
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: 2
= note: where '_#1r: '_#0r
-error: argument requires that data must outlive free region `ReStatic`
+error: unsatisfied lifetime constraints
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:5
|
LL | / establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
-LL | | //~^ ERROR argument requires that data must outlive free region
+LL | | //~^ ERROR
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 `'static`
note: No external requirements
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:44:1
|
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
-LL | | //~^ ERROR argument requires that data must outlive free region
+LL | | //~^ ERROR
LL | |
... |
LL | | });
#[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 argument requires that data must outlive free region
+ //~^ ERROR
// 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 argument requires that data must outlive free region
+LL | | //~^ ERROR
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | //~^ WARNING not reporting region error due to nll
= note: number of external vids: 3
= note: where '_#1r: '_#0r
-error: argument requires that data must outlive free region `ReStatic`
+error: unsatisfied lifetime constraints
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:5
|
LL | / establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | | //~^ ERROR argument requires that data must outlive free region
+LL | | //~^ ERROR
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | //~^ WARNING not reporting region error due to nll
LL | | });
- | |______^
+ | |______^ argument requires that `'a` must outlive `'static`
note: No external requirements
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:47: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 argument requires that data must outlive free region
+LL | | //~^ ERROR
LL | | // Only works if 'x: 'y:
... |
LL | | });
// Only works if 'x: 'y:
demand_y(x, y, x.get())
//~^ WARN not reporting region error due to nll
- //~| ERROR argument requires that data must outlive free region
+ //~| ERROR
});
}
LL | demand_y(x, y, x.get())
| ^^^^^^^^^^^^^^^^^^^^^^^
-error: argument requires that data must outlive free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(2))`
+error: unsatisfied lifetime constraints
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:47:9
|
+LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
+ | --------- - lifetime `'1` appears in this argument
+ | |
+ | lifetime `'2` appears in this argument
+LL | // Only works if 'x: 'y:
LL | demand_y(x, y, x.get())
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
note: No external requirements
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:45:47
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | //~^ WARN not reporting region error due to nll
-LL | | //~| ERROR argument requires that data must outlive free region
+LL | | //~| ERROR
LL | | });
| |_____^
|
// Only works if 'x: 'y:
demand_y(x, y, x.get())
//~^ WARN not reporting region error due to nll
- //~| ERROR does not outlive free region
+ //~| ERROR
});
}
LL | demand_y(x, y, x.get())
| ^^^^^^^^^^^^^^^^^^^^^^^
-error: free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(2))` does not outlive free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(4))`
- --> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:18
+error: unsatisfied lifetime constraints
+ --> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:9
|
+LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
+ | ---------- ---------- lifetime `'2` appears in this argument
+ | |
+ | lifetime `'1` appears in this argument
+LL | // Only works if 'x: 'y:
LL | demand_y(x, y, x.get())
- | ^
+ | ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
note: No external requirements
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:49:47
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | //~^ WARN not reporting region error due to nll
-LL | | //~| ERROR does not outlive free region
+LL | | //~| ERROR
LL | | });
| |_____^
|
fn foo<'a>(x: &'a u32) -> &'static u32 {
&*x
//~^ WARN not reporting region error due to nll
- //~| ERROR does not outlive free region
+ //~| ERROR
}
fn main() { }
LL | &*x
| ^^^
-error: free region `ReFree(DefId(0/0:3 ~ region_lbr_named_does_not_outlive_static[317d]::foo[0]), BrNamed(crate0:DefIndex(1:9), 'a))` does not outlive free region `ReStatic`
+error: unsatisfied lifetime constraints
--> $DIR/region-lbr-named-does-not-outlive-static.rs:19:5
|
LL | &*x
- | ^^^
+ | ^^^ free region requires that `'a` must outlive `'static`
error: aborting due to previous error
fn test() {
expect_sig(|a, b| b); // ought to return `a`
//~^ WARN not reporting region error due to nll
- //~| ERROR does not outlive free region
+ //~| ERROR
}
fn expect_sig<F>(f: F) -> F
LL | expect_sig(|a, b| b); // ought to return `a`
| ^
-error: free region `ReFree(DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]), BrAnon(2))` does not outlive free region `ReFree(DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]), BrAnon(1))`
+error: unsatisfied lifetime constraints
--> $DIR/return-wrong-bound-region.rs:21:23
|
LL | expect_sig(|a, b| b); // ought to return `a`
- | ^
+ | - - ^ free region requires that `'1` must outlive `'2`
+ | | |
+ | | lifetime `'1` appears in this argument
+ | lifetime `'2` appears in this argument
note: No external requirements
--> $DIR/return-wrong-bound-region.rs:21:16
LL | / fn test() {
LL | | expect_sig(|a, b| b); // ought to return `a`
LL | | //~^ WARN not reporting region error due to nll
-LL | | //~| ERROR does not outlive free region
+LL | | //~| ERROR
LL | | }
| |_^
|
LL | | }
| |_^
+error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
+ --> $DIR/get_default.rs:45:17
+ |
+LL | match map.get() {
+ | --- immutable borrow occurs here
+LL | Some(v) => {
+LL | map.set(String::new()); // Both AST and MIR error here
+ | ^^^ mutable borrow occurs here
+...
+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 | | }
| |_^
-error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
- --> $DIR/get_default.rs:45:17
- |
-LL | match map.get() {
- | --- immutable borrow occurs here
-LL | Some(v) => {
-LL | map.set(String::new()); // Both AST and MIR error here
- | ^^^ mutable borrow occurs here
-...
-LL | return v;
- | - borrow later used here
-
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0502`.
fn main() {
let orig: u8 = 5;
- move || use_val(&orig); //~ ERROR free region `` does not outlive free region `'_#1r`
+ move || use_val(&orig); //~ ERROR
}
-error: free region `` does not outlive free region `'_#1r`
- --> $DIR/issue-48238.rs:21:21
+error: unsatisfied lifetime constraints
+ --> $DIR/issue-48238.rs:21:13
|
-LL | move || use_val(&orig); //~ ERROR free region `` does not outlive free region `'_#1r`
- | ^^^^^
+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
error: aborting due to previous error
for<'b> &'b T: A,
<&'static T as A>::X: Sized
{
- let _x = *s; //~ ERROR assignment requires that data must outlive free region `'static`
+ let _x = *s; //~ ERROR
}
fn main() {}
-error: assignment requires that data must outlive free region `'static`
+error: unsatisfied lifetime constraints
--> $DIR/issue-50716.rs:25:14
|
-LL | let _x = *s; //~ ERROR assignment requires that data must outlive free region `'static`
- | ^^
+LL | let _x = *s; //~ ERROR
+ | ^^ assignment requires that `'a` must outlive `'static`
error: aborting due to previous error
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
//~| ERROR the parameter type `T` may not live long enough
- //~| ERROR argument requires that data must outlive free region
+ //~| ERROR
}
#[rustc_regions]
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
//~| ERROR the parameter type `T` may not live long enough
- //~| ERROR argument requires that data must outlive free region
+ //~| ERROR
}
#[rustc_regions]
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
//~| ERROR the parameter type `T` may not live long enough
- //~| ERROR argument requires that data must outlive free region
+ //~| ERROR
}
#[rustc_regions]
|
= help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`...
-error: argument requires that data must outlive free region `ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`
+error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-closure.rs:55:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-closure.rs:51:1
LL | | T: Anything<'b>,
LL | | {
... |
-LL | | //~| ERROR argument requires that data must outlive free region
+LL | | //~| ERROR
LL | | }
| |_^
|
|
= help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
-error: argument requires that data must outlive free region `ReEarlyBound(0, 'a)`
+error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-closure.rs:67:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-closure.rs:62:1
LL | | T: Anything<'b>,
LL | | 'a: 'a,
... |
-LL | | //~| ERROR argument requires that data must outlive free region
+LL | | //~| ERROR
LL | | }
| |_^
|
|
= help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
-error: argument requires that data must outlive free region `ReEarlyBound(0, 'a)`
+error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-closure.rs:89:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-closure.rs:74:1
LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
... |
-LL | | //~| ERROR argument requires that data must outlive free region
+LL | | //~| ERROR
LL | | }
| |_^
|
{
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
- //~| ERROR argument requires that data must outlive free region
+ //~| ERROR
}
#[rustc_regions]
{
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
- //~| ERROR argument requires that data must outlive free region
+ //~| ERROR
}
#[rustc_regions]
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
- //~| ERROR argument requires that data must outlive free region
+ //~| ERROR
}
#[rustc_regions]
= note: number of external vids: 3
= note: where '_#1r: '_#2r
-error: argument requires that data must outlive free region `ReFree(DefId(0/0:8 ~ projection_one_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`
+error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-trait-bound-closure.rs:47:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:43:1
LL | | T: Anything<'b>,
LL | | {
... |
-LL | | //~| ERROR argument requires that data must outlive free region
+LL | | //~| ERROR
LL | | }
| |_^
|
= note: number of external vids: 4
= note: where '_#2r: '_#3r
-error: argument requires that data must outlive free region `ReEarlyBound(0, 'a)`
+error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-trait-bound-closure.rs:58:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:53:1
LL | | T: Anything<'b>,
LL | | 'a: 'a,
... |
-LL | | //~| ERROR argument requires that data must outlive free region
+LL | | //~| ERROR
LL | | }
| |_^
|
= note: number of external vids: 4
= note: where '_#2r: '_#3r
-error: argument requires that data must outlive free region `ReEarlyBound(0, 'a)`
+error: unsatisfied lifetime constraints
--> $DIR/projection-one-region-trait-bound-closure.rs:79:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:64:1
LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
... |
-LL | | //~| ERROR argument requires that data must outlive free region
+LL | | //~| ERROR
LL | | }
| |_^
|
{
with_signature(cell, t, |cell, t| require(cell, t));
//~^ WARNING not reporting region error due to nll
- //~| ERROR argument requires that data must outlive free region
+ //~| ERROR
}
#[rustc_regions]
= note: number of external vids: 3
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
-error: argument requires that data must outlive free region `ReFree(DefId(0/0:13 ~ projection_two_region_trait_bound_closure[317d]::two_regions[0]), BrNamed(crate0:DefIndex(1:43), 'a))`
+error: unsatisfied lifetime constraints
--> $DIR/projection-two-region-trait-bound-closure.rs:108:5
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
note: No external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:104:1
LL | | T: Anything<'b, 'b>,
LL | | {
... |
-LL | | //~| ERROR argument requires that data must outlive free region
+LL | | //~| ERROR
LL | | }
| |_^
|
type K = I+'static;
fn foo(_x: K) {}
-//~^ ERROR the size for value values of type
+//~^ ERROR the size for values of type
fn main() {}
-error[E0277]: the size for value values of type `(dyn I + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn I + 'static)` cannot be known at compilation time
--> $DIR/issue-5035-2.rs:14:8
|
LL | fn foo(_x: K) {}
--- /dev/null
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
+
+#[rustc_outlives]
+struct Foo<'a, T> { //~ ERROR 15:1: 17:2: rustc_outlives
+ bar: std::slice::IterMut<'a, T>
+}
+
+fn main() {}
+
--- /dev/null
+error: rustc_outlives
+ --> $DIR/cross-crate.rs:15:1
+ |
+LL | / struct Foo<'a, T> { //~ ERROR 15:1: 17:2: rustc_outlives
+LL | | bar: std::slice::IterMut<'a, T>
+LL | | }
+ | |_^
+ |
+ = note: T : 'a
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: --edition 2018
+
+// The local `use` suggestion should start with `crate::` (but the
+// standard-library suggestions should not, obviously).
+
+mod plumbing {
+ pub struct Drain;
+}
+
+fn main() {
+ let _d = Drain {};
+ //~^ ERROR cannot find struct, variant or union type `Drain` in this scope
+}
--- /dev/null
+error[E0422]: cannot find struct, variant or union type `Drain` in this scope
+ --> $DIR/issue-52202-use-suggestions.rs:21:14
+ |
+LL | let _d = Drain {};
+ | ^^^^^ not found in this scope
+help: possible candidates are found in other modules, you can import them into scope
+ |
+LL | use crate::plumbing::Drain;
+ |
+LL | use std::collections::binary_heap::Drain;
+ |
+LL | use std::collections::hash_map::Drain;
+ |
+LL | use std::collections::hash_set::Drain;
+ |
+and 3 other candidates
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0422`.
-error[E0597]: `b1` does not live long enough
- --> $DIR/dropck_arr_cycle_checked.rs:111:24
+error[E0597]: `b3` does not live long enough
+ --> $DIR/dropck_arr_cycle_checked.rs:105:24
|
-LL | b3.a[0].v.set(Some(&b1));
+LL | b1.a[1].v.set(Some(&b3));
| ^^^ borrowed value does not live long enough
...
LL | }
| borrowed value only lives until here
| borrow later used here, when `b1` is dropped
-error[E0597]: `b3` does not live long enough
- --> $DIR/dropck_arr_cycle_checked.rs:105:24
+error[E0597]: `b1` does not live long enough
+ --> $DIR/dropck_arr_cycle_checked.rs:111:24
|
-LL | b1.a[1].v.set(Some(&b3));
+LL | b3.a[0].v.set(Some(&b1));
| ^^^ borrowed value does not live long enough
...
LL | }
-error[E0597]: `d1` does not live long enough
- --> $DIR/dropck_direct_cycle_with_drop.rs:48:19
+error[E0597]: `d2` does not live long enough
+ --> $DIR/dropck_direct_cycle_with_drop.rs:46:19
|
-LL | d2.p.set(Some(&d1));
+LL | d1.p.set(Some(&d2));
| ^^^ borrowed value does not live long enough
-LL | //~^ ERROR `d1` does not live long enough
+...
LL | }
| -
| |
|
= note: values in a scope are dropped in the opposite order they are defined
-error[E0597]: `d2` does not live long enough
- --> $DIR/dropck_direct_cycle_with_drop.rs:46:19
+error[E0597]: `d1` does not live long enough
+ --> $DIR/dropck_direct_cycle_with_drop.rs:48:19
|
-LL | d1.p.set(Some(&d2));
+LL | d2.p.set(Some(&d1));
| ^^^ borrowed value does not live long enough
-...
+LL | //~^ ERROR `d1` does not live long enough
LL | }
| -
| |
-error[E0597]: `c1` does not live long enough
- --> $DIR/dropck_vec_cycle_checked.rs:121:24
+error[E0597]: `c3` does not live long enough
+ --> $DIR/dropck_vec_cycle_checked.rs:115:24
|
-LL | c3.v[0].v.set(Some(&c1));
+LL | c1.v[1].v.set(Some(&c3));
| ^^^ borrowed value does not live long enough
...
LL | }
| borrowed value only lives until here
| borrow later used here, when `c1` is dropped
-error[E0597]: `c3` does not live long enough
- --> $DIR/dropck_vec_cycle_checked.rs:115:24
+error[E0597]: `c1` does not live long enough
+ --> $DIR/dropck_vec_cycle_checked.rs:121:24
|
-LL | c1.v[1].v.set(Some(&c3));
+LL | c3.v[0].v.set(Some(&c1));
| ^^^ borrowed value does not live long enough
...
LL | }
-error[E0597]: `c1` does not live long enough
- --> $DIR/vec-must-not-hide-type-from-dropck.rs:129:24
+error[E0597]: `c2` does not live long enough
+ --> $DIR/vec-must-not-hide-type-from-dropck.rs:127:24
|
-LL | c2.v[0].v.set(Some(&c1));
+LL | c1.v[0].v.set(Some(&c2));
| ^^^ borrowed value does not live long enough
-LL | //~^ ERROR `c1` does not live long enough
+...
LL | }
| -
| |
| borrowed value only lives until here
| borrow later used here, when `c1` is dropped
-error[E0597]: `c2` does not live long enough
- --> $DIR/vec-must-not-hide-type-from-dropck.rs:127:24
+error[E0597]: `c1` does not live long enough
+ --> $DIR/vec-must-not-hide-type-from-dropck.rs:129:24
|
-LL | c1.v[0].v.set(Some(&c2));
+LL | c2.v[0].v.set(Some(&c1));
| ^^^ borrowed value does not live long enough
-...
+LL | //~^ ERROR `c1` does not live long enough
LL | }
| -
| |
--- /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(nll)]
+
+fn main() {
+ let foo = &16;
+ //~^ HELP consider changing this to be a mutable reference
+ //~| SUGGESTION &mut 16
+ *foo = 32;
+ //~^ ERROR cannot assign to `*foo` which is behind a `&` reference
+ let bar = foo;
+ //~^ HELP consider changing this to be a mutable reference
+ //~| SUGGESTION &mut i32
+ *bar = 64;
+ //~^ ERROR cannot assign to `*bar` which is behind a `&` reference
+}
--- /dev/null
+error[E0594]: cannot assign to `*foo` which is behind a `&` reference
+ --> $DIR/issue-51515.rs:17:5
+ |
+LL | let foo = &16;
+ | --- help: consider changing this to be a mutable reference: `&mut 16`
+...
+LL | *foo = 32;
+ | ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
+
+error[E0594]: cannot assign to `*bar` which is behind a `&` reference
+ --> $DIR/issue-51515.rs:22:5
+ |
+LL | let bar = foo;
+ | --- help: consider changing this to be a mutable reference: `&mut i32`
+...
+LL | *bar = 64;
+ | ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0594`.
--- /dev/null
+error[E0597]: borrowed value does not live long enough
+ --> $DIR/issue-52049.rs:16:10
+ |
+LL | foo(&unpromotable(5u32));
+ | ^^^^^^^^^^^^^^^^^^ 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 previous error
+
+For more information about this error, try `rustc --explain E0597`.
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn foo(_: &'static u32) {}
+
+fn unpromotable<T>(t: T) -> T { t }
+
+fn main() {
+ foo(&unpromotable(5u32));
+}
+//~^^ ERROR borrowed value does not live long enough
--- /dev/null
+error[E0597]: borrowed value does not live long enough
+ --> $DIR/issue-52049.rs:16:10
+ |
+LL | foo(&unpromotable(5u32));
+ | ^^^^^^^^^^^^^^^^^^ - temporary value only lives until here
+ | |
+ | temporary value does not live long enough
+ |
+ = note: borrowed value must be valid for the static lifetime...
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0597`.
let u: &str = if true { s[..2] } else { s };
//~^ ERROR mismatched types
let v = s[..2];
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
let w: &str = s[..2];
//~^ ERROR mismatched types
}
= note: expected type `&str`
found type `str`
-error[E0277]: the size for value values of type `str` cannot be known at compilation time
+error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/str-array-assignment.rs:17:7
|
LL | let v = s[..2];
--- /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(tool_lints)]
+
+#[warn(foo::bar)]
+//~^ ERROR an unknown tool name found in scoped lint: `foo::bar`
+fn main() {}
--- /dev/null
+error[E0710]: an unknown tool name found in scoped lint: `foo::bar`
+ --> $DIR/tool_lints.rs:13:8
+ |
+LL | #[warn(foo::bar)]
+ | ^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0710`.
-error[E0133]: dereference of raw pointer requires unsafe function or block
+error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
--> $DIR/trait-safety-fn-body.rs:21:9
|
LL | *self += 1;
| ^^^^^^^^^^ dereference of raw pointer
+ |
+ = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
error: aborting due to previous error
fn check<T: Iterator, U: ?Sized>() {
// suggest a where-clause, if needed
mem::size_of::<U>();
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
mem::size_of::<Misc<U>>();
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
// ... even if T occurs as a type parameter
// ... and also not if the error is not related to the type
mem::size_of::<[T]>();
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
mem::size_of::<[&U]>();
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() {
-error[E0277]: the size for value values of type `U` cannot be known at compilation time
+error[E0277]: the size for values of type `U` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:17:5
|
LL | mem::size_of::<U>();
= help: consider adding a `where U: std::marker::Sized` bound
= note: required by `std::mem::size_of`
-error[E0277]: the size for value values of type `U` cannot be known at compilation time
+error[E0277]: the size for values of type `U` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:20:5
|
LL | mem::size_of::<Misc<U>>();
|
= note: required by `std::convert::From::from`
-error[E0277]: the size for value values of type `[T]` cannot be known at compilation time
+error[E0277]: the size for values of type `[T]` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:38:5
|
LL | mem::size_of::<[T]>();
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: required by `std::mem::size_of`
-error[E0277]: the size for value values of type `[&U]` cannot be known at compilation time
+error[E0277]: the size for values of type `[&U]` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:41:5
|
LL | mem::size_of::<[&U]>();
-error[E0277]: the size for value values of type `str` cannot be known at compilation time
+error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/trivial-bounds-leak.rs:22:25
|
LL | fn cant_return_str() -> str { //~ ERROR
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^^^^^^^^^^^^^^^^^^^
-error: cast requires that data must outlive free region `'static`
+error: unsatisfied lifetime constraints
--> $DIR/dyn-trait-underscore.rs:18:5
|
+LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
+ | - let's call the lifetime of this reference `'1`
+LL | // ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'1` must outlive `'static`
error: aborting due to previous error
union Foo<T: ?Sized> {
value: T,
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
struct Foo2<T: ?Sized> {
value: T,
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
t: u32,
}
enum Foo3<T: ?Sized> {
Value(T),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
fn main() {}
-error[E0277]: the size for value values of type `T` cannot be known at compilation time
+error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/union-sized-field.rs:14:5
|
LL | value: T,
= help: consider adding a `where T: std::marker::Sized` bound
= note: no field of a union may have a dynamically sized type
-error[E0277]: the size for value values of type `T` cannot be known at compilation time
+error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/union-sized-field.rs:19:5
|
LL | value: T,
= help: consider adding a `where T: std::marker::Sized` bound
= note: only the last field of a struct may have a dynamically sized type
-error[E0277]: the size for value values of type `T` cannot be known at compilation time
+error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/union-sized-field.rs:25:11
|
LL | Value(T),
-error[E0133]: call to unsafe function requires unsafe function or block
+error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/unsafe-const-fn.rs:19:18
|
LL | const VAL: u32 = dummy(0xFFFF);
| ^^^^^^^^^^^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
error: aborting due to previous error
enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
// parameter
VA(W),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VB{x: X},
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VC(isize, Y),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VD{u: isize, x: Z},
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
// slice / str
VE([u8]),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VF{x: str},
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VG(isize, [f32]),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VH{u: isize, x: [u32]},
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
// unsized struct
VI(Path1),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VJ{x: Path2},
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VK(isize, Path3),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VL{u: isize, x: Path4},
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
// plain trait
VM(Foo),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VN{x: Bar},
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VO(isize, FooBar),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VP{u: isize, x: BarFoo},
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
// projected
VQ(<&'static [i8] as Deref>::Target),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VR{x: <&'static [char] as Deref>::Target},
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VS(isize, <&'static [f64] as Deref>::Target),
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
VT{u: isize, x: <&'static [i32] as Deref>::Target},
- //~^ ERROR the size for value values of type
+ //~^ ERROR the size for values of type
}
-error[E0277]: the size for value values of type `W` cannot be known at compilation time
+error[E0277]: the size for values of type `W` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:33:8
|
LL | VA(W),
= help: consider adding a `where W: std::marker::Sized` bound
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `X` cannot be known at compilation time
+error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:35:8
|
LL | VB{x: X},
= help: consider adding a `where X: std::marker::Sized` bound
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `Y` cannot be known at compilation time
+error[E0277]: the size for values of type `Y` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:37:15
|
LL | VC(isize, Y),
= help: consider adding a `where Y: std::marker::Sized` bound
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `Z` cannot be known at compilation time
+error[E0277]: the size for values of type `Z` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:39:18
|
LL | VD{u: isize, x: Z},
= help: consider adding a `where Z: std::marker::Sized` bound
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:43:8
|
LL | VE([u8]),
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `str` cannot be known at compilation time
+error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:45:8
|
LL | VF{x: str},
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `[f32]` cannot be known at compilation time
+error[E0277]: the size for values of type `[f32]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:47:15
|
LL | VG(isize, [f32]),
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `[u32]` cannot be known at compilation time
+error[E0277]: the size for values of type `[u32]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:49:18
|
LL | VH{u: isize, x: [u32]},
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `(dyn Foo + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:63:8
|
LL | VM(Foo),
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `(dyn Bar + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn Bar + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:65:8
|
LL | VN{x: Bar},
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `(dyn FooBar + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn FooBar + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:67:15
|
LL | VO(isize, FooBar),
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `(dyn BarFoo + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn BarFoo + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:69:18
|
LL | VP{u: isize, x: BarFoo},
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `[i8]` cannot be known at compilation time
+error[E0277]: the size for values of type `[i8]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:73:8
|
LL | VQ(<&'static [i8] as Deref>::Target),
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `[char]` cannot be known at compilation time
+error[E0277]: the size for values of type `[char]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:75:8
|
LL | VR{x: <&'static [char] as Deref>::Target},
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `[f64]` cannot be known at compilation time
+error[E0277]: the size for values of type `[f64]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:77:15
|
LL | VS(isize, <&'static [f64] as Deref>::Target),
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `[i32]` cannot be known at compilation time
+error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:79:18
|
LL | VT{u: isize, x: <&'static [i32] as Deref>::Target},
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `(dyn PathHelper1 + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn PathHelper1 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:53:8
|
LL | VI(Path1),
= note: required because it appears within the type `Path1`
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:55:8
|
LL | VJ{x: Path2},
= note: required because it appears within the type `Path2`
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `(dyn PathHelper3 + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn PathHelper3 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:57:15
|
LL | VK(isize, Path3),
= note: required because it appears within the type `Path3`
= note: no field of an enum variant may have a dynamically sized type
-error[E0277]: the size for value values of type `(dyn PathHelper4 + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn PathHelper4 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:59:18
|
LL | VL{u: isize, x: Path4},
"powerpc-unknown-linux-gnuspe",
"powerpc64-unknown-linux-gnu",
"powerpc64le-unknown-linux-gnu",
+ "powerpc64le-unknown-linux-musl",
"s390x-unknown-linux-gnu",
"sparc-unknown-linux-gnu",
"sparc64-unknown-linux-gnu",
self.rust_version = self.version("rust", "x86_64-unknown-linux-gnu");
self.cargo_version = self.version("cargo", "x86_64-unknown-linux-gnu");
self.rls_version = self.version("rls", "x86_64-unknown-linux-gnu");
+ self.clippy_version = self.version("clippy", "x86_64-unknown-linux-gnu");
self.rustfmt_version = self.version("rustfmt", "x86_64-unknown-linux-gnu");
self.llvm_tools_version = self.version("llvm-tools", "x86_64-unknown-linux-gnu");
-Subproject commit 5699afe508d62924f6b38b19dc98296ad33d1659
+Subproject commit af9e40c26b4ea2ebd6f31ee86ee61d5ac1c74eb0
-Subproject commit 28daee4c919dd88772847ec5240eb850bb0dcbf3
+Subproject commit aad450ef923091ba4699891df0fe518f0d3686f6
[dependencies]
diff = "0.1.10"
env_logger = { version = "0.5", default-features = false }
-filetime = "0.1"
+filetime = "0.2"
getopts = "0.2"
log = "0.4"
regex = "0.2"
-Subproject commit b87873eaceb75cf9342d5273f01ba2c020f61ca8
+Subproject commit 8214ccf861d538671b0a1436dbf4538dc4a64d09
-Subproject commit 7d0bc550b0899a13a56c81eb2d5064abd0bcf385
+Subproject commit 6b4238b46595de1660a95887b287ddabe62726ea
var arraysToLoad = ["itemTypes"];
var variablesToLoad = ["MAX_LEV_DISTANCE", "MAX_RESULTS",
+ "GENERICS_DATA", "NAME", "INPUTS_DATA", "OUTPUT_DATA",
"TY_PRIMITIVE", "TY_KEYWORD",
"levenshtein_row2"];
// execQuery first parameter is built in getQuery (which takes in the search input).
-Subproject commit 87edd75ecf26c9084969f431bb5e363693a8a4ca
+Subproject commit 5e5992517d3591e2708d4ca6b155dfcbdf3344b9
"selectors", // MPL-2.0, rustdoc
"clippy_lints", // MPL-2.0, rls
"colored", // MPL-2.0, rustfmt
+ "ordslice", // Apache-2.0, rls
];
/// Which crates to check against the whitelist?
/// Whitelist of crates rustc is allowed to depend on. Avoid adding to the list if possible.
static WHITELIST: &'static [Crate] = &[
Crate("aho-corasick"),
- Crate("ar"),
Crate("arrayvec"),
Crate("atty"),
Crate("backtrace"),