Skip to content

Commit 381f131

Browse files
pnkfelixMark-Simulacrum
authored andcommitted
Revert PR 81473 to resolve (on beta) issues 81626 and 81658.
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.
1 parent cadf901 commit 381f131

File tree

4 files changed

+0
-135
lines changed

4 files changed

+0
-135
lines changed

compiler/rustc_passes/src/dead.rs

-21
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,6 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
133133
}
134134
}
135135

136-
fn handle_assign(&mut self, expr: &'tcx hir::Expr<'tcx>) {
137-
if self
138-
.typeck_results()
139-
.expr_adjustments(expr)
140-
.iter()
141-
.any(|adj| matches!(adj.kind, ty::adjustment::Adjust::Deref(_)))
142-
{
143-
self.visit_expr(expr);
144-
} else if let hir::ExprKind::Field(base, ..) = expr.kind {
145-
// Ignore write to field
146-
self.handle_assign(base);
147-
} else {
148-
self.visit_expr(expr);
149-
}
150-
}
151-
152136
fn handle_field_pattern_match(
153137
&mut self,
154138
lhs: &hir::Pat<'_>,
@@ -277,11 +261,6 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
277261
hir::ExprKind::MethodCall(..) => {
278262
self.lookup_and_handle_method(expr.hir_id);
279263
}
280-
hir::ExprKind::Assign(ref left, ref right, ..) => {
281-
self.handle_assign(left);
282-
self.visit_expr(right);
283-
return;
284-
}
285264
hir::ExprKind::Field(ref lhs, ..) => {
286265
self.handle_field_access(&lhs, expr.hir_id);
287266
}

src/test/ui/borrowck/borrowck-assign-to-subfield.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// pretty-expanded FIXME #23616
3-
#![allow(dead_code)]
43

54
pub fn main() {
65
struct A {

src/test/ui/lint/dead-code/write-only-field.rs

-69
This file was deleted.

src/test/ui/lint/dead-code/write-only-field.stderr

-44
This file was deleted.

0 commit comments

Comments
 (0)