Skip to content

Commit 73f48e5

Browse files
committed
Auto merge of rust-lang#83171 - pnkfelix:revert-81473-warn-write-only-fields, r=Mark-Simulacrum
Revert PR 81473 to resolve (on beta) issues 81626 and 81658. Revert PR rust-lang#81473 to resolve (on beta) issues rust-lang#81626 and rust-lang#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.
2 parents 80eddb9 + 71e57ad commit 73f48e5

File tree

4 files changed

+0
-62
lines changed

4 files changed

+0
-62
lines changed

compiler/rustc_passes/src/dead.rs

-15
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ fn should_explore(tcx: TyCtxt<'_>, hir_id: hir::HirId) -> bool {
3737
)
3838
}
3939

40-
fn base_expr<'a>(mut expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> {
41-
loop {
42-
match expr.kind {
43-
hir::ExprKind::Field(base, ..) => expr = base,
44-
_ => return expr,
45-
}
46-
}
47-
}
48-
4940
struct MarkSymbolVisitor<'tcx> {
5041
worklist: Vec<hir::HirId>,
5142
tcx: TyCtxt<'tcx>,
@@ -272,12 +263,6 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
272263
hir::ExprKind::MethodCall(..) => {
273264
self.lookup_and_handle_method(expr.hir_id);
274265
}
275-
hir::ExprKind::Assign(ref left, ref right, ..) => {
276-
// Ignore write to field
277-
self.visit_expr(base_expr(left));
278-
self.visit_expr(right);
279-
return;
280-
}
281266
hir::ExprKind::Field(ref lhs, ..) => {
282267
self.handle_field_access(&lhs, expr.hir_id);
283268
}

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

-20
This file was deleted.

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

-26
This file was deleted.

0 commit comments

Comments
 (0)