Skip to content

Commit

Permalink
Revert PR 81473 to resolve (on beta) issues 81626 and 81658.
Browse files Browse the repository at this point in the history
Revert "Add missing brace"

This reverts commit 85ad773.

Revert "Simplify base_expr"

This reverts commit 899aae4.

Revert "Warn write-only fields"

This reverts commit d3c69a4.
  • Loading branch information
pnkfelix authored and Mark-Simulacrum committed May 3, 2021
1 parent cadf901 commit 381f131
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 135 deletions.
21 changes: 0 additions & 21 deletions compiler/rustc_passes/src/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,6 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
}
}

fn handle_assign(&mut self, expr: &'tcx hir::Expr<'tcx>) {
if self
.typeck_results()
.expr_adjustments(expr)
.iter()
.any(|adj| matches!(adj.kind, ty::adjustment::Adjust::Deref(_)))
{
self.visit_expr(expr);
} else if let hir::ExprKind::Field(base, ..) = expr.kind {
// Ignore write to field
self.handle_assign(base);
} else {
self.visit_expr(expr);
}
}

fn handle_field_pattern_match(
&mut self,
lhs: &hir::Pat<'_>,
Expand Down Expand Up @@ -277,11 +261,6 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
hir::ExprKind::MethodCall(..) => {
self.lookup_and_handle_method(expr.hir_id);
}
hir::ExprKind::Assign(ref left, ref right, ..) => {
self.handle_assign(left);
self.visit_expr(right);
return;
}
hir::ExprKind::Field(ref lhs, ..) => {
self.handle_field_access(&lhs, expr.hir_id);
}
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/borrowck/borrowck-assign-to-subfield.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// run-pass
// pretty-expanded FIXME #23616
#![allow(dead_code)]

pub fn main() {
struct A {
Expand Down
69 changes: 0 additions & 69 deletions src/test/ui/lint/dead-code/write-only-field.rs

This file was deleted.

44 changes: 0 additions & 44 deletions src/test/ui/lint/dead-code/write-only-field.stderr

This file was deleted.

0 comments on commit 381f131

Please sign in to comment.