-
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
Changes from 2 commits
d43c424
d2d62de
6eeac46
341e266
3430bc1
e381143
7364648
40c91ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. This can stay |
||
self.mutates_static |= is_mutated_static(self.cx, target) | ||
}, | ||
_ => {}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe 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. |
||
let mut visitor = MutArgVisitor::new(cx); | ||
visitor.visit_expr(lhs); | ||
if let Some(span) = visitor.expr_span() { | ||
return Some(span); | ||
} | ||
} | ||
if let ExprKind::AddrOf(_, ref rhs) = conditions[1].kind { | ||
if let ExprKind::AddrOf(_, _, ref rhs) = conditions[1].kind { | ||
let mut visitor = MutArgVisitor::new(cx); | ||
visitor.visit_expr(rhs); | ||
if let Some(span) = visitor.expr_span() { | ||
|
@@ -128,7 +128,7 @@ impl<'a, 'tcx> MutArgVisitor<'a, 'tcx> { | |
impl<'a, 'tcx> Visitor<'tcx> for MutArgVisitor<'a, 'tcx> { | ||
fn visit_expr(&mut self, expr: &'tcx Expr) { | ||
match expr.kind { | ||
ExprKind::AddrOf(Mutability::Mutable, _) => { | ||
ExprKind::AddrOf(_, Mutability::Mutable, _) => { | ||
self.found = true; | ||
return; | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. The ones in this file |
||
| ExprKind::Box(ref inner) => has_no_effect(cx, inner), | ||
ExprKind::Struct(_, ref fields, ref base) => { | ||
!has_drop(cx, cx.tables.expr_ty(expr)) | ||
|
@@ -134,7 +134,7 @@ fn reduce_expression<'a>(cx: &LateContext<'_, '_>, expr: &'a Expr) -> Option<Vec | |
| ExprKind::Type(ref inner, _) | ||
| ExprKind::Unary(_, ref inner) | ||
| ExprKind::Field(ref inner, _) | ||
| ExprKind::AddrOf(_, ref inner) | ||
| ExprKind::AddrOf(_, _, ref inner) | ||
| ExprKind::Box(ref inner) => reduce_expression(cx, inner).or_else(|| Some(vec![inner])), | ||
ExprKind::Struct(_, ref fields, ref base) => { | ||
if has_drop(cx, cx.tables.expr_ty(expr)) { | ||
|
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