Skip to content

Commit

Permalink
Auto merge of #6371 - ebroto:rustup, r=ebroto
Browse files Browse the repository at this point in the history
Rustup

changelog: none

r? `@ghost`
  • Loading branch information
bors committed Nov 23, 2020
2 parents 58a2bc4 + 209ab18 commit 51b633b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 35 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static UNIX_SYSTEMS: &[&str] = &[
];

// NOTE: windows is excluded from the list because it's also a valid target family.
static NON_UNIX_SYSTEMS: &[&str] = &["cloudabi", "hermit", "none", "wasi"];
static NON_UNIX_SYSTEMS: &[&str] = &["hermit", "none", "wasi"];

declare_clippy_lint! {
/// **What it does:** Checks for items annotated with `#[inline(always)]`,
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/future_not_send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
for &(p, _span) in preds {
let p = p.subst(cx.tcx, subst);
if let Some(trait_ref) = p.to_opt_poly_trait_ref() {
if Some(trait_ref.def_id()) == cx.tcx.lang_items().future_trait() {
if Some(trait_ref.value.def_id()) == cx.tcx.lang_items().future_trait() {
is_future = true;
break;
}
Expand Down
5 changes: 1 addition & 4 deletions tests/ui/mismatched_target_os_non_unix.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#![warn(clippy::mismatched_target_os)]
#![allow(unused)]

#[cfg(target_os = "cloudabi")]
fn cloudabi() {}

#[cfg(target_os = "hermit")]
fn hermit() {}

Expand All @@ -16,7 +13,7 @@ fn wasi() {}
fn none() {}

// list with conditions
#[cfg(all(not(any(windows, target_os = "cloudabi")), target_os = "wasi"))]
#[cfg(all(not(windows), target_os = "wasi"))]
fn list() {}

// windows is a valid target family, should be ignored
Expand Down
5 changes: 1 addition & 4 deletions tests/ui/mismatched_target_os_non_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#![warn(clippy::mismatched_target_os)]
#![allow(unused)]

#[cfg(cloudabi)]
fn cloudabi() {}

#[cfg(hermit)]
fn hermit() {}

Expand All @@ -16,7 +13,7 @@ fn wasi() {}
fn none() {}

// list with conditions
#[cfg(all(not(any(windows, cloudabi)), wasi))]
#[cfg(all(not(windows), wasi))]
fn list() {}

// windows is a valid target family, should be ignored
Expand Down
35 changes: 10 additions & 25 deletions tests/ui/mismatched_target_os_non_unix.stderr
Original file line number Diff line number Diff line change
@@ -1,51 +1,36 @@
error: operating system used in target family position
--> $DIR/mismatched_target_os_non_unix.rs:6:1
|
LL | #[cfg(cloudabi)]
| ^^^^^^--------^^
| |
| help: try: `target_os = "cloudabi"`
|
= note: `-D clippy::mismatched-target-os` implied by `-D warnings`

error: operating system used in target family position
--> $DIR/mismatched_target_os_non_unix.rs:9:1
|
LL | #[cfg(hermit)]
| ^^^^^^------^^
| |
| help: try: `target_os = "hermit"`
|
= note: `-D clippy::mismatched-target-os` implied by `-D warnings`

error: operating system used in target family position
--> $DIR/mismatched_target_os_non_unix.rs:12:1
--> $DIR/mismatched_target_os_non_unix.rs:9:1
|
LL | #[cfg(wasi)]
| ^^^^^^----^^
| |
| help: try: `target_os = "wasi"`

error: operating system used in target family position
--> $DIR/mismatched_target_os_non_unix.rs:15:1
--> $DIR/mismatched_target_os_non_unix.rs:12:1
|
LL | #[cfg(none)]
| ^^^^^^----^^
| |
| help: try: `target_os = "none"`

error: operating system used in target family position
--> $DIR/mismatched_target_os_non_unix.rs:19:1
|
LL | #[cfg(all(not(any(windows, cloudabi)), wasi))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try
|
LL | #[cfg(all(not(any(windows, target_os = "cloudabi")), wasi))]
| ^^^^^^^^^^^^^^^^^^^^^^
help: try
--> $DIR/mismatched_target_os_non_unix.rs:16:1
|
LL | #[cfg(all(not(any(windows, cloudabi)), target_os = "wasi"))]
| ^^^^^^^^^^^^^^^^^^
LL | #[cfg(all(not(windows), wasi))]
| ^^^^^^^^^^^^^^^^^^^^^^^^----^^^
| |
| help: try: `target_os = "wasi"`

error: aborting due to 5 previous errors
error: aborting due to 4 previous errors

0 comments on commit 51b633b

Please sign in to comment.