-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Rustup to rustc 1.41.0-nightly (e87a205c2 2019-11-27) #4846
Conversation
error: use of `ok_or` followed by a function call | ||
--> $DIR/or_fun_call.rs:74:17 | ||
| | ||
LL | let _ = opt.ok_or(format!("{} world.", hello)); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `ok_or_else(|| format!("{} world.", hello))` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format!
now expands to a block. While format is explicitly handled in expect_fun_call
, it is not in or_fun_call
.
cc @matthewjasper -- simply doing |
Ah thanks, good point! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've commented in the places that should not be using BorrowKind::Ref
@@ -328,7 +328,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ReadVisitor<'a, 'tcx> { | |||
// ``` | |||
// | |||
// TODO: fix this | |||
ExprKind::AddrOf(_, _) => { | |||
ExprKind::AddrOf(_, _, _) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can stay
@@ -656,7 +656,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for StaticMutVisitor<'a, 'tcx> { | |||
tys.clear(); | |||
} | |||
}, | |||
Assign(ref target, _) | AssignOp(_, ref target, _) | AddrOf(hir::Mutability::Mutable, ref target) => { | |||
Assign(ref target, _) | AssignOp(_, ref target, _) | AddrOf(_, hir::Mutability::Mutable, ref target) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can stay
@@ -77,14 +77,14 @@ fn extract_call<'a, 'tcx>(cx: &'a LateContext<'a, 'tcx>, e: &'tcx Expr) -> Optio | |||
if let ExprKind::Tup(ref conditions) = headerexpr.kind; | |||
if conditions.len() == 2; | |||
then { | |||
if let ExprKind::AddrOf(_, ref lhs) = conditions[0].kind { | |||
if let ExprKind::AddrOf(_, _, ref lhs) = conditions[0].kind { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the ones in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eh, i think this is edge casey enough to leave it focused on Ref.
@@ -58,7 +58,7 @@ fn has_no_effect(cx: &LateContext<'_, '_>, expr: &Expr) -> bool { | |||
| ExprKind::Type(ref inner, _) | |||
| ExprKind::Unary(_, ref inner) | |||
| ExprKind::Field(ref inner, _) | |||
| ExprKind::AddrOf(_, ref inner) | |||
| ExprKind::AddrOf(_, _, ref inner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ones in this file
@@ -37,7 +37,7 @@ impl EarlyLintPass for DerefAddrOf { | |||
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &Expr) { | |||
if_chain! { | |||
if let ExprKind::Unary(UnOp::Deref, ref deref_target) = e.kind; | |||
if let ExprKind::AddrOf(_, ref addrof_target) = without_parens(deref_target).kind; | |||
if let ExprKind::AddrOf(_, _, ref addrof_target) = without_parens(deref_target).kind; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ones in this file
}, | ||
ExprKind::Unary(_, ref e) | ||
| ExprKind::Field(ref e, _) | ||
| ExprKind::AddrOf(_, _, ref e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ones in this file
clippy_lints/src/utils/hir_utils.rs
Outdated
@@ -78,7 +78,7 @@ impl<'a, 'tcx> SpanlessEq<'a, 'tcx> { | |||
} | |||
|
|||
match (&left.kind, &right.kind) { | |||
(&ExprKind::AddrOf(l_mut, ref le), &ExprKind::AddrOf(r_mut, ref re)) => { | |||
(&ExprKind::AddrOf(_, l_mut, ref le), &ExprKind::AddrOf(_, r_mut, ref re)) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should compare the BorrowKinds
clippy_lints/src/utils/hir_utils.rs
Outdated
@@ -398,7 +398,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> { | |||
std::mem::discriminant(&e.kind).hash(&mut self.s); | |||
|
|||
match e.kind { | |||
ExprKind::AddrOf(m, ref e) => { | |||
ExprKind::AddrOf(_, m, ref e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should hash the BorrowKind
clippy_lints/src/utils/inspector.rs
Outdated
@@ -264,7 +264,7 @@ fn print_expr(cx: &LateContext<'_, '_>, expr: &hir::Expr, indent: usize) { | |||
println!("{}Relative Path, {:?}", ind, ty); | |||
println!("{}seg: {:?}", ind, seg); | |||
}, | |||
hir::ExprKind::AddrOf(ref muta, ref e) => { | |||
hir::ExprKind::AddrOf(_, ref muta, ref e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should print out the BorrowKind
Updated, added some more fixes @bors r+ |
📌 Commit ef05061 has been approved by |
Rustup Rustups: - rust-lang/rust#66671 (Ast address-of) - rust-lang/rust#64856 (Scope format! temporaries) changelog: none
💔 Test failed - status-appveyor |
@bors r+ |
📌 Commit 9aa58ed has been approved by |
Rustup to rustc 1.41.0-nightly (e87a205 2019-11-27) Rustups: - rust-lang/rust#66671 (Ast address-of) - rust-lang/rust#64856 (Scope format! temporaries) - http://github.com/rust-lang/rust/pull/66719 changelog: none
💔 Test failed - status-appveyor |
@bors r+ |
📌 Commit 40c91ec has been approved by |
Rustup to rustc 1.41.0-nightly (e87a205 2019-11-27) Rustups: - rust-lang/rust#66671 (Ast address-of) - rust-lang/rust#64856 (Scope format! temporaries) - http://github.com/rust-lang/rust/pull/66719 changelog: none
☀️ Test successful - checks-travis, status-appveyor |
Thanks! Hadn't had access to my dev machine the last 2 days! |
Rustups:
changelog: none