Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 25 pull requests #56830

Closed
wants to merge 61 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
934e4d3
Remove not used mod
yui-knk Nov 28, 2018
eaeebb5
Clearer error message for dead assign
JohnGinger Dec 2, 2018
54026c1
Fix line length
JohnGinger Dec 2, 2018
4cf5702
Fix stderr files
JohnGinger Dec 3, 2018
70536d4
Fix stderr file (unused variable)
JohnGinger Dec 3, 2018
c0e3f4b
Change to give a help message
JohnGinger Dec 7, 2018
aa04285
Add lint for items deprecated in future
aheart Dec 9, 2018
562f33b
Document time of back operations of a Linked List
Dec 10, 2018
a336228
Add test to check library traits have #[must_use] attribute
aelred Dec 10, 2018
ecc4ca5
Add #[must_use] attribute to stdlib traits
aelred Dec 10, 2018
3246f49
Add trailing newline
aelred Dec 10, 2018
c3c2de9
reject invalid external doc attributes
euclio Nov 28, 2018
7f7045f
improve diagnostics for invalid external docs
euclio Nov 28, 2018
07a3d69
Update the stdsimd submodule
alexcrichton Dec 10, 2018
3d23e55
fix install broken link
mishaker Dec 10, 2018
f8c03b6
Add lint for stlib
aheart Dec 10, 2018
30f531b
generate invalidations from 2-phase-borrow activations
nikomatsakis Dec 4, 2018
8ee2c06
adopt polonius-engine 0.6.1
nikomatsakis Dec 4, 2018
1006425
Test capacity of ZST vector
KamilaBorowska Dec 11, 2018
5acab2d
Always set the RDRAND and RDSEED features on SGX
Dec 11, 2018
45b97f2
miri: use backtrace crate printing instead of rolling our own
RalfJung Dec 11, 2018
b17a3f2
fix rust-lang/rust issue #50583
piersfinlayson Dec 11, 2018
8e994a2
bump backtrace version to get prettier pretty-printing
RalfJung Dec 11, 2018
94c1c73
Documentation for impl From for AtomicBool and other Atomic types
phungleson Dec 11, 2018
b96186b
Add missing urls in ffi module docs
GuillaumeGomez Dec 11, 2018
517bfe0
Fix private_no_mangle_fns message grammar
turboladen Dec 12, 2018
29e7ca9
Add test of current behavior (infer free region within closure body) …
pnkfelix Dec 10, 2018
29bec2d
target: remove Box returned from get_targets
ljedrz Dec 12, 2018
8a6ca24
Allow ptr::hash to accept fat pointers
mbrubeck Dec 12, 2018
b9235ea
Account for `impl Trait` when suggesting lifetime
estebank Dec 12, 2018
ae893bb
Add short emoji status to toolstate updates
Manishearth Dec 12, 2018
bec5b66
Deduplicate unsatisfied trait bounds
estebank Dec 12, 2018
88cf2a2
Add x86_64-unknown-uefi target
Dec 13, 2018
a39f184
Use `dedup` instead of `dedup_by`
oli-obk Dec 13, 2018
b6b278e
Fixes broken links
jrvidal Dec 14, 2018
275deac
Fix docs path to PermissionsExt
dbrgn Dec 14, 2018
7b62bf3
Rollup merge of #53506 - phungleson:fix-from-docs-atomic, r=KodrAus
pietroalbini Dec 14, 2018
08a9cc3
Rollup merge of #56203 - aheart:master, r=varkor
pietroalbini Dec 14, 2018
e103111
Rollup merge of #56343 - yui-knk:remove_mir_stats_mod, r=nikomatsakis
pietroalbini Dec 14, 2018
11408f6
Rollup merge of #56439 - JohnGinger:master, r=nikomatsakis
pietroalbini Dec 14, 2018
11adb6c
Rollup merge of #56507 - nikomatsakis:polonius-integrate, r=MatthewJa…
pietroalbini Dec 14, 2018
be13a49
Rollup merge of #56672 - ccouzens:master, r=nikic
pietroalbini Dec 14, 2018
526cec8
Rollup merge of #56677 - aelred:must-use-on-traits, r=estebank
pietroalbini Dec 14, 2018
6febd8e
Rollup merge of #56679 - euclio:external-doc-parse, r=estebank
pietroalbini Dec 14, 2018
872b987
Rollup merge of #56682 - alexcrichton:update-stdsimd, r=nikomatsakis
pietroalbini Dec 14, 2018
1c8ffc1
Rollup merge of #56691 - mishaker:fix_doc_install_broken_link, r=jona…
pietroalbini Dec 14, 2018
409bbb8
Rollup merge of #56710 - jethrogb:jb/sgx-target-features, r=alexcrichton
pietroalbini Dec 14, 2018
eca4383
Rollup merge of #56713 - xfix:vec-test-zst-capacity, r=TimNN
pietroalbini Dec 14, 2018
c6ff109
Rollup merge of #56718 - RalfJung:use-libbacktrace-printing, r=alexcr…
pietroalbini Dec 14, 2018
9db99cf
Rollup merge of #56725 - piersfinlayson:master, r=alexcrichton
pietroalbini Dec 14, 2018
1b6eff0
Rollup merge of #56731 - GuillaumeGomez:ffi-doc-urls, r=Centril
pietroalbini Dec 14, 2018
2f45d5c
Rollup merge of #56738 - turboladen:fix-private_no_mangle_fns-message…
pietroalbini Dec 14, 2018
33ba9ac
Rollup merge of #56746 - pnkfelix:issue-56537-add-test-of-closure-usi…
pietroalbini Dec 14, 2018
20b36f4
Rollup merge of #56747 - ljedrz:remove_box_from_target, r=zackmdavis
pietroalbini Dec 14, 2018
e9580b1
Rollup merge of #56751 - mbrubeck:hash, r=dtolnay
pietroalbini Dec 14, 2018
604a843
Rollup merge of #56755 - estebank:impl-trait-lt-sugg, r=cramertj
pietroalbini Dec 14, 2018
da30d51
Rollup merge of #56758 - Manishearth:emoji-status-toolstate, r=kennytm
pietroalbini Dec 14, 2018
9fa81f5
Rollup merge of #56760 - estebank:dedup-bounds, r=oli-obk
pietroalbini Dec 14, 2018
0481f2a
Rollup merge of #56769 - dvdhrm:uefi-target, r=alexcrichton
pietroalbini Dec 14, 2018
7a92fbd
Rollup merge of #56808 - jrvidal:broken-links, r=kennytm
pietroalbini Dec 14, 2018
9ab47d1
Rollup merge of #56809 - dbrgn:permissions-ext, r=alexcrichton
pietroalbini Dec 14, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dependencies = [

[[package]]
name = "backtrace"
version = "0.3.9"
version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -614,7 +614,7 @@ dependencies = [

[[package]]
name = "datafrog"
version = "0.1.0"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
Expand Down Expand Up @@ -728,15 +728,15 @@ name = "error-chain"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "error-chain"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
Expand All @@ -751,7 +751,7 @@ name = "failure"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
]

Expand Down Expand Up @@ -1625,10 +1625,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "polonius-engine"
version = "0.5.0"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"datafrog 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"datafrog 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
Expand Down Expand Up @@ -2060,7 +2060,7 @@ name = "rustc"
version = "0.0.0"
dependencies = [
"arena 0.0.0",
"backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"chalk-engine 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
Expand All @@ -2071,7 +2071,7 @@ dependencies = [
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"polonius-engine 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"polonius-engine 0.6.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)",
"rustc_apfloat 0.0.0",
Expand Down Expand Up @@ -2518,7 +2518,7 @@ dependencies = [
"graphviz 0.0.0",
"log 0.4.6 (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)",
"polonius-engine 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_apfloat 0.0.0",
"rustc_data_structures 0.0.0",
Expand Down Expand Up @@ -3380,7 +3380,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"
"checksum assert_cli 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98589b0e465a6c510d95fceebd365bb79bedece7f6e18a480897f2015f85ec51"
"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a"
"checksum backtrace 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "18b65ea1161bfb2dd6da6fade5edd4dbd08fba85012123dd333d2fd1b90b2782"
"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0"
"checksum bit-set 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6f1efcc46c18245a69c38fcc5cc650f16d3a59d034f3106e9ed63748f695730a"
"checksum bit-vec 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4440d5cb623bb7390ae27fec0bb6c61111969860f8e3ae198bfa0663645e67cf"
Expand Down Expand Up @@ -3419,7 +3419,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum crypto-hash 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "09de9ee0fc255ace04c7fa0763c9395a945c37c8292bb554f8d48361d1dcf1b4"
"checksum curl 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "c7c9d851c825e0c033979d4516c9173bc19a78a96eb4d6ae51d4045440eafa16"
"checksum curl-sys 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)" = "721c204978be2143fab0a84b708c49d79d1f6100b8785610f456043a90708870"
"checksum datafrog 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d724bf4ffe77cdceeecd461009b5f8d9e23c5d645d68bedb4586bf43e7e142"
"checksum datafrog 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71a3eacc779bb35090718501c2de27bb679dee18f6c28e6589590e4ed8b9fa08"
"checksum derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6ca414e896ae072546f4d789f452daaecf60ddee4c9df5dc6d5936d769e3d87c"
"checksum derive_more 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f57d78cf3bd45270dad4e70c21ec77a960b36c7a841ff9db76aaa775a8fb871"
"checksum diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3c2b69f912779fbb121ceb775d74d51e915af17aaebc38d28a592843a2dd0a3a"
Expand Down Expand Up @@ -3529,7 +3529,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"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.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"
"checksum polonius-engine 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b6b0a7f5f4278b991ffd14abce1d01b013121ad297460237ef0a2f08d43201"
"checksum polonius-engine 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d9274a1db7bffb87f7e810ef480a75b67eed0f1a3838f80c652e881f4b4970fd"
"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 pretty_env_logger 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df8b3f4e0475def7d9c2e5de8e5a1306949849761e107b360d03e98eafaffd61"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ standard library, and documentation.

Read ["Installation"] from [The Book].

["Installation"]: https://doc.rust-lang.org/book/second-edition/ch01-01-installation.html
["Installation"]: https://doc.rust-lang.org/book/ch01-01-installation.html
[The Book]: https://doc.rust-lang.org/book/index.html

## Building from Source
Expand Down
4 changes: 2 additions & 2 deletions src/ci/docker/dist-various-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ RUN env \
CXX=arm-linux-gnueabi-g++ CXXFLAGS="-march=armv6 -marm" \
bash musl.sh arm && \
env \
CC=arm-linux-gnueabihf-gcc CFLAGS="-march=armv6 -marm" \
CXX=arm-linux-gnueabihf-g++ CXXFLAGS="-march=armv6 -marm" \
CC=arm-linux-gnueabihf-gcc CFLAGS="-march=armv6 -marm -mfpu=vfp" \
CXX=arm-linux-gnueabihf-g++ CXXFLAGS="-march=armv6 -marm -mfpu=vfp" \
bash musl.sh armhf && \
env \
CC=arm-linux-gnueabihf-gcc CFLAGS="-march=armv7-a" \
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/targets/built-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ the team is supporting directly.

To see the list of built-in targets, you can run `rustc --print target-list`,
or look at [the API
docs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_back/target/#modules).
docs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/spec/index.html#modules).
Each module there defines a builder for a particular target.
2 changes: 1 addition & 1 deletion src/doc/rustc/src/targets/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
architecture. The list of *targets* are the possible architectures that you can build for.

To see all the options that you can set with a target, see the docs
[here](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_back/target/struct.Target.html).
[here](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/spec/struct.Target.html).

To compile to a particular target, use the `--target` flag:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The tracking issue for this feature is: [#48055]

This implements [RFC1909]. When turned on, you can have unsized arguments and locals:

[RFC1909]: https://github.com/rust-lang/rfcs/blob/master/text/1909-coercions.md
[RFC1909]: https://github.com/rust-lang/rfcs/blob/master/text/1909-unsized-rvalues.md

```rust
#![feature(unsized_locals)]
Expand Down
6 changes: 5 additions & 1 deletion src/liballoc/collections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,9 @@ impl<T> LinkedList<T> {
self.pop_front_node().map(Node::into_element)
}

/// Appends an element to the back of a list
/// Appends an element to the back of a list.
///
/// This operation should compute in O(1) time.
///
/// # Examples
///
Expand All @@ -647,6 +649,8 @@ impl<T> LinkedList<T> {
/// Removes the last element from a list and returns it, or `None` if
/// it is empty.
///
/// This operation should compute in O(1) time.
///
/// # Examples
///
/// ```
Expand Down
5 changes: 5 additions & 0 deletions src/liballoc/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ fn test_reserve() {
assert!(v.capacity() >= 33)
}

#[test]
fn test_zst_capacity() {
assert_eq!(Vec::<()>::new().capacity(), usize::max_value());
}

#[test]
fn test_extend() {
let mut v = Vec::new();
Expand Down
1 change: 1 addition & 0 deletions src/libcore/future/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use task::{Poll, LocalWaker};
///
/// When using a future, you generally won't call `poll` directly, but instead
/// `await!` the value.
#[must_use]
pub trait Future {
/// The result of the `Future`.
type Output;
Expand Down
1 change: 1 addition & 0 deletions src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ fn _assert_is_object_safe(_: &dyn Iterator<Item=()>) {}
message="`{Self}` is not an iterator"
)]
#[doc(spotlight)]
#[must_use]
pub trait Iterator {
/// The type of the elements being iterated over.
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
3 changes: 3 additions & 0 deletions src/libcore/ops/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
label="expected an `Fn<{Args}>` closure, found `{Self}`",
)]
#[fundamental] // so that regex can rely that `&str: !FnMut`
#[must_use]
pub trait Fn<Args> : FnMut<Args> {
/// Performs the call operation.
#[unstable(feature = "fn_traits", issue = "29625")]
Expand Down Expand Up @@ -150,6 +151,7 @@ pub trait Fn<Args> : FnMut<Args> {
label="expected an `FnMut<{Args}>` closure, found `{Self}`",
)]
#[fundamental] // so that regex can rely that `&str: !FnMut`
#[must_use]
pub trait FnMut<Args> : FnOnce<Args> {
/// Performs the call operation.
#[unstable(feature = "fn_traits", issue = "29625")]
Expand Down Expand Up @@ -228,6 +230,7 @@ pub trait FnMut<Args> : FnOnce<Args> {
label="expected an `FnOnce<{Args}>` closure, found `{Self}`",
)]
#[fundamental] // so that regex can rely that `&str: !FnMut`
#[must_use]
pub trait FnOnce<Args> {
/// The returned type after the call operator is used.
#[stable(feature = "fn_once_output", since = "1.12.0")]
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2544,7 +2544,7 @@ pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
/// assert_eq!(actual, expected);
/// ```
#[unstable(feature = "ptr_hash", reason = "newly added", issue = "56286")]
pub fn hash<T, S: hash::Hasher>(hashee: *const T, into: &mut S) {
pub fn hash<T: ?Sized, S: hash::Hasher>(hashee: *const T, into: &mut S) {
use hash::Hash;
hashee.hash(into);
}
Expand Down
17 changes: 15 additions & 2 deletions src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,15 @@ impl<T> AtomicPtr<T> {
#[cfg(target_has_atomic = "8")]
#[stable(feature = "atomic_bool_from", since = "1.24.0")]
impl From<bool> for AtomicBool {
/// Converts a `bool` into an `AtomicBool`.
///
/// # Examples
///
/// ```
/// use std::sync::atomic::AtomicBool;
/// let atomic_bool = AtomicBool::from(true);
/// assert_eq!(format!("{:?}", atomic_bool), "true")
/// ```
#[inline]
fn from(b: bool) -> Self { Self::new(b) }
}
Expand Down Expand Up @@ -1126,8 +1135,12 @@ macro_rules! atomic_int {

#[$stable_from]
impl From<$int_type> for $atomic_type {
#[inline]
fn from(v: $int_type) -> Self { Self::new(v) }
doc_comment! {
concat!(
"Converts an `", stringify!($int_type), "` into an `", stringify!($atomic_type), "`."),
#[inline]
fn from(v: $int_type) -> Self { Self::new(v) }
}
}

#[$stable_debug]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobserver = "0.1"
lazy_static = "1.0.0"
scoped-tls = { version = "0.1.1", features = ["nightly"] }
log = { version = "0.4", features = ["release_max_level_info", "std"] }
polonius-engine = "0.5.0"
polonius-engine = "0.6.1"
rustc-rayon = "0.1.1"
rustc-rayon-core = "0.1.1"
rustc_apfloat = { path = "../librustc_apfloat" }
Expand Down
31 changes: 20 additions & 11 deletions src/librustc/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1095,15 +1095,16 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
let sp = hir.span(id);
// `sp` only covers `T`, change it so that it covers
// `T:` when appropriate
let sp = if has_bounds {
let is_impl_trait = bound_kind.to_string().starts_with("impl ");
let sp = if has_bounds && !is_impl_trait {
sp.to(self.tcx
.sess
.source_map()
.next_point(self.tcx.sess.source_map().next_point(sp)))
} else {
sp
};
(sp, has_bounds)
(sp, has_bounds, is_impl_trait)
})
} else {
None
Expand Down Expand Up @@ -1136,25 +1137,33 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {

fn binding_suggestion<'tcx, S: fmt::Display>(
err: &mut DiagnosticBuilder<'tcx>,
type_param_span: Option<(Span, bool)>,
type_param_span: Option<(Span, bool, bool)>,
bound_kind: GenericKind<'tcx>,
sub: S,
) {
let consider = &format!(
"consider adding an explicit lifetime bound `{}: {}`...",
bound_kind, sub
let consider = format!(
"consider adding an explicit lifetime bound {}",
if type_param_span.map(|(_, _, is_impl_trait)| is_impl_trait).unwrap_or(false) {
format!(" `{}` to `{}`...", sub, bound_kind)
} else {
format!("`{}: {}`...", bound_kind, sub)
},
);
if let Some((sp, has_lifetimes)) = type_param_span {
let tail = if has_lifetimes { " + " } else { "" };
let suggestion = format!("{}: {}{}", bound_kind, sub, tail);
if let Some((sp, has_lifetimes, is_impl_trait)) = type_param_span {
let suggestion = if is_impl_trait {
format!("{} + {}", bound_kind, sub)
} else {
let tail = if has_lifetimes { " + " } else { "" };
format!("{}: {}{}", bound_kind, sub, tail)
};
err.span_suggestion_short_with_applicability(
sp,
consider,
&consider,
suggestion,
Applicability::MaybeIncorrect, // Issue #41966
);
} else {
err.help(consider);
err.help(&consider);
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,13 @@ pub mod parser {
}
}

declare_lint! {
pub DEPRECATED_IN_FUTURE,
Allow,
"detects use of items that will be deprecated in a future version",
report_in_external_macro: true
}

/// Does nothing as a lint pass, but registers some `Lint`s
/// that are used by other parts of the compiler.
#[derive(Copy, Clone)]
Expand Down Expand Up @@ -427,6 +434,7 @@ impl LintPass for HardwiredLints {
MACRO_USE_EXTERN_CRATE,
MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
parser::QUESTION_MARK_MACRO_SEP,
DEPRECATED_IN_FUTURE,
)
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1657,11 +1657,15 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
fn report_dead_assign(&self, hir_id: HirId, sp: Span, var: Variable, is_argument: bool) {
if let Some(name) = self.should_warn(var) {
if is_argument {
self.ir.tcx.lint_hir(lint::builtin::UNUSED_ASSIGNMENTS, hir_id, sp,
&format!("value passed to `{}` is never read", name));
self.ir.tcx.struct_span_lint_hir(lint::builtin::UNUSED_ASSIGNMENTS, hir_id, sp,
&format!("value passed to `{}` is never read", name))
.help("maybe it is overwritten before being read?")
.emit();
} else {
self.ir.tcx.lint_hir(lint::builtin::UNUSED_ASSIGNMENTS, hir_id, sp,
&format!("value assigned to `{}` is never read", name));
self.ir.tcx.struct_span_lint_hir(lint::builtin::UNUSED_ASSIGNMENTS, hir_id, sp,
&format!("value assigned to `{}` is never read", name))
.help("maybe it is overwritten before being read?")
.emit();
}
}
}
Expand Down
Loading