Skip to content

Commit

Permalink
Merge pull request #2187 from rust-lang-nursery/rustup
Browse files Browse the repository at this point in the history
Rustup to rustc 1.23.0-nightly (90ef337 2017-10-29)
  • Loading branch information
Manishearth authored Oct 30, 2017
2 parents f724b99 + a69764d commit 306b6e2
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 41 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

## 0.0.167
* Rustup to *rustc 1.23.0-nightly (90ef3372e 2017-10-29)*
* New lints: [`const_static_lifetime`], [`erasing_op`], [`fallible_impl_from`], [`println_empty_string`], [`useless_asref`]

## 0.0.166
* Rustup to *rustc 1.22.0-nightly (b7960878b 2017-10-18)*
* New lints: [`explicit_write`], [`identity_conversion`], [`implicit_hasher`], [`invalid_ref`], [`option_map_or_none`], [`range_minus_one`], [`range_plus_one`], [`transmute_int_to_bool`], [`transmute_int_to_char`], [`transmute_int_to_float`]
Expand Down Expand Up @@ -486,6 +490,7 @@ All notable changes to this project will be documented in this file.
[`cmp_null`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#cmp_null
[`cmp_owned`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#cmp_owned
[`collapsible_if`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#collapsible_if
[`const_static_lifetime`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#const_static_lifetime
[`crosspointer_transmute`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#crosspointer_transmute
[`cyclomatic_complexity`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#cyclomatic_complexity
[`deprecated_semver`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#deprecated_semver
Expand All @@ -504,13 +509,15 @@ All notable changes to this project will be documented in this file.
[`enum_glob_use`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#enum_glob_use
[`enum_variant_names`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#enum_variant_names
[`eq_op`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#eq_op
[`erasing_op`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#erasing_op
[`eval_order_dependence`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#eval_order_dependence
[`expl_impl_clone_on_copy`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#expl_impl_clone_on_copy
[`explicit_counter_loop`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#explicit_counter_loop
[`explicit_into_iter_loop`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#explicit_into_iter_loop
[`explicit_iter_loop`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#explicit_iter_loop
[`explicit_write`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#explicit_write
[`extend_from_slice`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#extend_from_slice
[`fallible_impl_from`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#fallible_impl_from
[`filter_map`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#filter_map
[`filter_next`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#filter_next
[`float_arithmetic`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#float_arithmetic
Expand Down Expand Up @@ -611,6 +618,7 @@ All notable changes to this project will be documented in this file.
[`precedence`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#precedence
[`print_stdout`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#print_stdout
[`print_with_newline`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#print_with_newline
[`println_empty_string`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#println_empty_string
[`ptr_arg`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#ptr_arg
[`pub_enum_variant_names`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#pub_enum_variant_names
[`range_minus_one`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#range_minus_one
Expand Down Expand Up @@ -673,6 +681,7 @@ All notable changes to this project will be documented in this file.
[`use_debug`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#use_debug
[`use_self`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#use_self
[`used_underscore_binding`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#used_underscore_binding
[`useless_asref`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#useless_asref
[`useless_attribute`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#useless_attribute
[`useless_format`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#useless_format
[`useless_let_if_seq`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#useless_let_if_seq
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.0.166"
version = "0.0.167"
authors = [
"Manish Goregaokar <[email protected]>",
"Andre Bogus <[email protected]>",
Expand Down Expand Up @@ -37,7 +37,7 @@ path = "src/driver.rs"

[dependencies]
# begin automatic update
clippy_lints = { version = "0.0.166", path = "clippy_lints" }
clippy_lints = { version = "0.0.167", path = "clippy_lints" }
# end automatic update
cargo_metadata = "0.2"

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "clippy_lints"
# begin automatic update
version = "0.0.166"
version = "0.0.167"
# end automatic update
authors = [
"Manish Goregaokar <[email protected]>",
Expand Down
12 changes: 7 additions & 5 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,20 @@ pub mod entry;
pub mod enum_clike;
pub mod enum_glob_use;
pub mod enum_variants;
pub mod erasing_op;
pub mod eq_op;
pub mod erasing_op;
pub mod escape;
pub mod eta_reduction;
pub mod eval_order_dependence;
pub mod explicit_write;
pub mod fallible_impl_from;
pub mod format;
pub mod formatting;
pub mod functions;
pub mod identity_conversion;
pub mod identity_op;
pub mod if_let_redundant_pattern_matching;
pub mod if_not_else;
pub mod fallible_impl_from;
pub mod infinite_iter;
pub mod int_plus_one;
pub mod invalid_ref;
Expand Down Expand Up @@ -209,7 +209,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
let mut store = reg.sess.lint_store.borrow_mut();
store.register_removed(
"should_assert_eq",
"`assert!()` will be more flexible with RFC 2011"
"`assert!()` will be more flexible with RFC 2011",
);
store.register_removed(
"extend_from_slice",
Expand Down Expand Up @@ -360,11 +360,11 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {

reg.register_lint_group("clippy_pedantic", vec![
booleans::NONMINIMAL_BOOL,
const_static_lifetime::CONST_STATIC_LIFETIME,
empty_enum::EMPTY_ENUM,
enum_glob_use::ENUM_GLOB_USE,
enum_variants::PUB_ENUM_VARIANT_NAMES,
enum_variants::STUTTER,
fallible_impl_from::FALLIBLE_IMPL_FROM,
if_not_else::IF_NOT_ELSE,
infinite_iter::MAYBE_INFINITE_ITER,
int_plus_one::INT_PLUS_ONE,
Expand Down Expand Up @@ -423,6 +423,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
booleans::LOGIC_BUG,
bytecount::NAIVE_BYTECOUNT,
collapsible_if::COLLAPSIBLE_IF,
const_static_lifetime::CONST_STATIC_LIFETIME,
copies::IF_SAME_THEN_ELSE,
copies::IFS_SAME_COND,
copies::MATCH_SAME_ARMS,
Expand All @@ -441,6 +442,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
enum_variants::MODULE_INCEPTION,
eq_op::EQ_OP,
eq_op::OP_REF,
erasing_op::ERASING_OP,
escape::BOXED_LOCAL,
eta_reduction::REDUNDANT_CLOSURE,
eval_order_dependence::DIVERGING_SUB_EXPRESSION,
Expand All @@ -455,7 +457,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
identity_conversion::IDENTITY_CONVERSION,
identity_op::IDENTITY_OP,
if_let_redundant_pattern_matching::IF_LET_REDUNDANT_PATTERN_MATCHING,
fallible_impl_from::FALLIBLE_IMPL_FROM,
infinite_iter::INFINITE_ITER,
invalid_ref::INVALID_REF,
is_unit_expr::UNIT_EXPR,
Expand Down Expand Up @@ -509,6 +510,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
methods::SINGLE_CHAR_PATTERN,
methods::STRING_EXTEND_CHARS,
methods::TEMPORARY_CSTRING_AS_PTR,
methods::USELESS_ASREF,
methods::WRONG_SELF_CONVENTION,
minmax::MIN_MAX,
misc::CMP_NAN,
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LifetimePass {

fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
if let ImplItemKind::Method(ref sig, id) = item.node {
check_fn_inner(cx, &sig.decl, Some(id), &sig.generics, item.span);
check_fn_inner(cx, &sig.decl, Some(id), &item.generics, item.span);
}
}

Expand All @@ -76,7 +76,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LifetimePass {
TraitMethod::Required(_) => None,
TraitMethod::Provided(id) => Some(id),
};
check_fn_inner(cx, &sig.decl, body, &sig.generics, item.span);
check_fn_inner(cx, &sig.decl, body, &item.generics, item.span);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
if name == method_name &&
sig.decl.inputs.len() == n_args &&
out_type.matches(&sig.decl.output) &&
self_kind.matches(first_arg_ty, first_arg, self_ty, false, &sig.generics) {
self_kind.matches(first_arg_ty, first_arg, self_ty, false, &implitem.generics) {
span_lint(cx, SHOULD_IMPLEMENT_TRAIT, implitem.span, &format!(
"defining a method called `{}` on this type; consider implementing \
the `{}` trait or choosing a less ambiguous name", name, trait_name));
Expand All @@ -760,7 +760,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
for &(ref conv, self_kinds) in &CONVENTIONS {
if_chain! {
if conv.check(&name.as_str());
if !self_kinds.iter().any(|k| k.matches(first_arg_ty, first_arg, self_ty, is_copy, &sig.generics));
if !self_kinds.iter().any(|k| k.matches(first_arg_ty, first_arg, self_ty, is_copy, &implitem.generics));
then {
let lint = if item.vis == hir::Visibility::Public {
WRONG_PUB_SELF_CONVENTION
Expand Down
10 changes: 5 additions & 5 deletions clippy_lints/src/new_without_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
// can't be implemented by default
return;
}
if !sig.generics.ty_params.is_empty() {
// when the result of `new()` depends on a type parameter we should not require
// an
// impl of `Default`
return;
if !cx.generics.expect("method must have generics").ty_params.is_empty() {
// when the result of `new()` depends on a type parameter we should not require
// an
// impl of `Default`
return;
}
if decl.inputs.is_empty() && name == "new" && cx.access_levels.is_reachable(id) {
let self_ty = cx.tcx
Expand Down
1 change: 1 addition & 0 deletions clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ pub fn opt_def_id(def: Def) -> Option<DefId> {
Def::TyAlias(id) |
Def::AssociatedTy(id) |
Def::TyParam(id) |
Def::TyForeign(id) |
Def::Struct(id) |
Def::StructCtor(id, ..) |
Def::Union(id) |
Expand Down
24 changes: 0 additions & 24 deletions tests/ui/mut_mut.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ error: generally you want to avoid `&mut &mut _` if possible
30 | let y : &mut &mut u32 = &mut &mut 2;
| ^^^^^^^^^^^^^

error: generally you want to avoid `&mut &mut _` if possible
--> $DIR/mut_mut.rs:30:17
|
30 | let y : &mut &mut u32 = &mut &mut 2;
| ^^^^^^^^^^^^^

error: generally you want to avoid `&mut &mut _` if possible
--> $DIR/mut_mut.rs:35:38
|
Expand All @@ -63,21 +57,3 @@ error: generally you want to avoid `&mut &mut _` if possible
35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2;
| ^^^^^^^^^^^^^

error: generally you want to avoid `&mut &mut _` if possible
--> $DIR/mut_mut.rs:35:17
|
35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2;
| ^^^^^^^^^^^^^^^^^^

error: generally you want to avoid `&mut &mut _` if possible
--> $DIR/mut_mut.rs:35:22
|
35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2;
| ^^^^^^^^^^^^^

error: generally you want to avoid `&mut &mut _` if possible
--> $DIR/mut_mut.rs:35:22
|
35 | let y : &mut &mut &mut u32 = &mut &mut &mut 2;
| ^^^^^^^^^^^^^

0 comments on commit 306b6e2

Please sign in to comment.