Skip to content

Commit b71f340

Browse files
committed
Auto merge of #7178 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
2 parents 796a6f0 + d481b38 commit b71f340

15 files changed

+24
-21
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.53"
3+
version = "0.1.54"
44
authors = ["The Rust Clippy Developers"]
55
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
66
repository = "https://github.com/rust-lang/rust-clippy"

clippy_dev/src/new_lint.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn create(pass: Option<&str>, lint_name: Option<&str>, category: Option<&str
4444
create_test(&lint).context("Unable to create a test for the new lint")
4545
}
4646

47-
fn create_lint(lint: &LintData) -> io::Result<()> {
47+
fn create_lint(lint: &LintData<'_>) -> io::Result<()> {
4848
let (pass_type, pass_lifetimes, pass_import, context_import) = match lint.pass {
4949
"early" => ("EarlyLintPass", "", "use rustc_ast::ast::*;", "EarlyContext"),
5050
"late" => ("LateLintPass", "<'_>", "use rustc_hir::*;", "LateContext"),
@@ -68,7 +68,7 @@ fn create_lint(lint: &LintData) -> io::Result<()> {
6868
write_file(lint.project_root.join(&lint_path), lint_contents.as_bytes())
6969
}
7070

71-
fn create_test(lint: &LintData) -> io::Result<()> {
71+
fn create_test(lint: &LintData<'_>) -> io::Result<()> {
7272
fn create_project_layout<P: Into<PathBuf>>(lint_name: &str, location: P, case: &str, hint: &str) -> io::Result<()> {
7373
let mut path = location.into().join(case);
7474
fs::create_dir(&path)?;

clippy_lints/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints"
33
# begin automatic update
4-
version = "0.1.53"
4+
version = "0.1.54"
55
# end automatic update
66
authors = ["The Rust Clippy Developers"]
77
description = "A bunch of helpful lints to avoid common pitfalls in Rust"

clippy_lints/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// warn on lints, that are included in `rust-lang/rust`s bootstrap
1717
#![warn(rust_2018_idioms, unused_lifetimes)]
1818
// warn on rustc internal lints
19-
#![deny(rustc::internal)]
19+
#![warn(rustc::internal)]
2020

2121
// FIXME: switch to something more ergonomic here, once available.
2222
// (Currently there is no way to opt into sysroot crates without `extern crate`.)

clippy_lints/src/missing_const_for_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingConstForFn {
137137
let mir = cx.tcx.optimized_mir(def_id);
138138

139139
if let Err((span, err)) = is_min_const_fn(cx.tcx, mir, self.msrv.as_ref()) {
140-
if rustc_mir::const_eval::is_min_const_fn(cx.tcx, def_id.to_def_id()) {
140+
if cx.tcx.is_const_fn_raw(def_id.to_def_id()) {
141141
cx.tcx.sess.span_err(span, &err);
142142
}
143143
} else {

clippy_utils/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy_utils"
3-
version = "0.1.53"
3+
version = "0.1.54"
44
authors = ["The Rust Clippy Developers"]
55
edition = "2018"
66
publish = false

clippy_utils/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ pub fn method_chain_args<'a>(expr: &'a Expr<'_>, methods: &[&str]) -> Option<Vec
678678
pub fn is_entrypoint_fn(cx: &LateContext<'_>, def_id: DefId) -> bool {
679679
cx.tcx
680680
.entry_fn(LOCAL_CRATE)
681-
.map_or(false, |(entry_fn_def_id, _)| def_id == entry_fn_def_id.to_def_id())
681+
.map_or(false, |(entry_fn_def_id, _)| def_id == entry_fn_def_id)
682682
}
683683

684684
/// Returns `true` if the expression is in the program's `#[panic_handler]`.

clippy_utils/src/paths.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub const PARKING_LOT_RWLOCK_WRITE_GUARD: [&str; 2] = ["parking_lot", "RwLockWri
112112
pub const PATH_BUF_AS_PATH: [&str; 4] = ["std", "path", "PathBuf", "as_path"];
113113
pub const PATH_TO_PATH_BUF: [&str; 4] = ["std", "path", "Path", "to_path_buf"];
114114
pub const PERMISSIONS: [&str; 3] = ["std", "fs", "Permissions"];
115-
pub const PERMISSIONS_FROM_MODE: [&str; 7] = ["std", "sys", "unix", "ext", "fs", "PermissionsExt", "from_mode"];
115+
pub const PERMISSIONS_FROM_MODE: [&str; 7] = ["std", "os", "imp", "unix", "fs", "PermissionsExt", "from_mode"];
116116
pub const POLL: [&str; 4] = ["core", "task", "poll", "Poll"];
117117
pub const POLL_PENDING: [&str; 5] = ["core", "task", "poll", "Poll", "Pending"];
118118
pub const POLL_READY: [&str; 5] = ["core", "task", "poll", "Poll", "Ready"];

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2021-04-22"
2+
channel = "nightly-2021-05-06"
33
components = ["llvm-tools-preview", "rustc-dev", "rust-src"]

src/driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// warn on lints, that are included in `rust-lang/rust`s bootstrap
55
#![warn(rust_2018_idioms, unused_lifetimes)]
66
// warn on rustc internal lints
7-
#![deny(rustc::internal)]
7+
#![warn(rustc::internal)]
88

99
// FIXME: switch to something more ergonomic here, once available.
1010
// (Currently there is no way to opt into sysroot crates without `extern crate`.)

tests/compile-test.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,7 @@ fn default_config() -> compiletest::Config {
8383
third_party_crates(),
8484
));
8585

86-
config.build_base = if cargo::is_rustc_test_suite() {
87-
// This make the stderr files go to clippy OUT_DIR on rustc repo build dir
88-
let mut path = PathBuf::from(env!("OUT_DIR"));
89-
path.push("test_build_base");
90-
path
91-
} else {
92-
host_lib().join("test_build_base")
93-
};
86+
config.build_base = host_lib().join("test_build_base");
9487
config.rustc_path = clippy_driver_path();
9588
config
9689
}

tests/ui/crashes/ice-3969.stderr

+8
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,26 @@ LL | for<'a> Dst<A + 'a>: Sized,
55
| ^^^^^^ help: use `dyn`: `dyn A + 'a`
66
|
77
= note: `-D bare-trait-objects` implied by `-D warnings`
8+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
9+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
810

911
error: trait objects without an explicit `dyn` are deprecated
1012
--> $DIR/ice-3969.rs:27:16
1113
|
1214
LL | let x: Dst<A> = *(Box::new(Dst { x: 1 }) as Box<Dst<A>>);
1315
| ^ help: use `dyn`: `dyn A`
16+
|
17+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
18+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
1419

1520
error: trait objects without an explicit `dyn` are deprecated
1621
--> $DIR/ice-3969.rs:27:57
1722
|
1823
LL | let x: Dst<A> = *(Box::new(Dst { x: 1 }) as Box<Dst<A>>);
1924
| ^ help: use `dyn`: `dyn A`
25+
|
26+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
27+
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
2028

2129
error: aborting due to 3 previous errors
2230

tests/ui/wildcard_enum_match_arm.fixed

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn main() {
7777
let error_kind = ErrorKind::NotFound;
7878
match error_kind {
7979
ErrorKind::NotFound => {},
80-
ErrorKind::PermissionDenied | ErrorKind::ConnectionRefused | ErrorKind::ConnectionReset | ErrorKind::ConnectionAborted | ErrorKind::NotConnected | ErrorKind::AddrInUse | ErrorKind::AddrNotAvailable | ErrorKind::BrokenPipe | ErrorKind::AlreadyExists | ErrorKind::WouldBlock | ErrorKind::InvalidInput | ErrorKind::InvalidData | ErrorKind::TimedOut | ErrorKind::WriteZero | ErrorKind::Interrupted | ErrorKind::Other | ErrorKind::UnexpectedEof | ErrorKind::Unsupported | _ => {},
80+
ErrorKind::PermissionDenied | ErrorKind::ConnectionRefused | ErrorKind::ConnectionReset | ErrorKind::ConnectionAborted | ErrorKind::NotConnected | ErrorKind::AddrInUse | ErrorKind::AddrNotAvailable | ErrorKind::BrokenPipe | ErrorKind::AlreadyExists | ErrorKind::WouldBlock | ErrorKind::InvalidInput | ErrorKind::InvalidData | ErrorKind::TimedOut | ErrorKind::WriteZero | ErrorKind::Interrupted | ErrorKind::Other | ErrorKind::UnexpectedEof | ErrorKind::Unsupported | ErrorKind::OutOfMemory | _ => {},
8181
}
8282
match error_kind {
8383
ErrorKind::NotFound => {},
@@ -99,6 +99,7 @@ fn main() {
9999
ErrorKind::Other => {},
100100
ErrorKind::UnexpectedEof => {},
101101
ErrorKind::Unsupported => {},
102+
ErrorKind::OutOfMemory => {},
102103
_ => {},
103104
}
104105
}

tests/ui/wildcard_enum_match_arm.rs

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ fn main() {
9999
ErrorKind::Other => {},
100100
ErrorKind::UnexpectedEof => {},
101101
ErrorKind::Unsupported => {},
102+
ErrorKind::OutOfMemory => {},
102103
_ => {},
103104
}
104105
}

tests/ui/wildcard_enum_match_arm.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ error: wildcard matches known variants and will also match future added variants
3232
--> $DIR/wildcard_enum_match_arm.rs:80:9
3333
|
3434
LL | _ => {},
35-
| ^ help: try this: `ErrorKind::PermissionDenied | ErrorKind::ConnectionRefused | ErrorKind::ConnectionReset | ErrorKind::ConnectionAborted | ErrorKind::NotConnected | ErrorKind::AddrInUse | ErrorKind::AddrNotAvailable | ErrorKind::BrokenPipe | ErrorKind::AlreadyExists | ErrorKind::WouldBlock | ErrorKind::InvalidInput | ErrorKind::InvalidData | ErrorKind::TimedOut | ErrorKind::WriteZero | ErrorKind::Interrupted | ErrorKind::Other | ErrorKind::UnexpectedEof | ErrorKind::Unsupported | _`
35+
| ^ help: try this: `ErrorKind::PermissionDenied | ErrorKind::ConnectionRefused | ErrorKind::ConnectionReset | ErrorKind::ConnectionAborted | ErrorKind::NotConnected | ErrorKind::AddrInUse | ErrorKind::AddrNotAvailable | ErrorKind::BrokenPipe | ErrorKind::AlreadyExists | ErrorKind::WouldBlock | ErrorKind::InvalidInput | ErrorKind::InvalidData | ErrorKind::TimedOut | ErrorKind::WriteZero | ErrorKind::Interrupted | ErrorKind::Other | ErrorKind::UnexpectedEof | ErrorKind::Unsupported | ErrorKind::OutOfMemory | _`
3636

3737
error: aborting due to 5 previous errors
3838

0 commit comments

Comments
 (0)