From a3592695ce3b414d5dd44f098ed6362af9b7271b Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Wed, 14 Dec 2022 05:31:56 +0200 Subject: [PATCH 1/2] some fixes/improvements to mir::visit module --- compiler/rustc_middle/src/mir/visit.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_middle/src/mir/visit.rs b/compiler/rustc_middle/src/mir/visit.rs index 2ee3f551529..0b806cdac66 100644 --- a/compiler/rustc_middle/src/mir/visit.rs +++ b/compiler/rustc_middle/src/mir/visit.rs @@ -3,15 +3,15 @@ //! ## Overview //! //! There are two visitors, one for immutable and one for mutable references, -//! but both are generated by the following macro. The code is written according -//! to the following conventions: +//! but both are generated by `make_mir_visitor` macro. +//! The code is written according to the following conventions: //! //! - introduce a `visit_foo` and a `super_foo` method for every MIR type //! - `visit_foo`, by default, calls `super_foo` //! - `super_foo`, by default, destructures the `foo` and calls `visit_foo` //! -//! This allows you as a user to override `visit_foo` for types are -//! interested in, and invoke (within that method) call +//! This allows you to override `visit_foo` for types you are +//! interested in, and invoke (within that method call) //! `self.super_foo` to get the default behavior. Just as in an OO //! language, you should never call `super` methods ordinarily except //! in that circumstance. From 5a7e8f8b7970b21c40d28013800a6d4ae0c8374a Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Fri, 16 Dec 2022 16:24:14 +0200 Subject: [PATCH 2/2] accept review suggestion Co-authored-by: nils <48135649+Nilstrieb@users.noreply.github.com> --- compiler/rustc_middle/src/mir/visit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/mir/visit.rs b/compiler/rustc_middle/src/mir/visit.rs index 0b806cdac66..1a264d2d5af 100644 --- a/compiler/rustc_middle/src/mir/visit.rs +++ b/compiler/rustc_middle/src/mir/visit.rs @@ -3,7 +3,7 @@ //! ## Overview //! //! There are two visitors, one for immutable and one for mutable references, -//! but both are generated by `make_mir_visitor` macro. +//! but both are generated by the `make_mir_visitor` macro. //! The code is written according to the following conventions: //! //! - introduce a `visit_foo` and a `super_foo` method for every MIR type