From 01a15d5870169636cec50a1f9d98bc967472a680 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 12 Mar 2014 13:38:17 -0400 Subject: [PATCH] Tweak comments --- src/librustc/middle/typeck/check/regionck.rs | 23 ++++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/librustc/middle/typeck/check/regionck.rs b/src/librustc/middle/typeck/check/regionck.rs index aef1b20273a28..1278bfb2e168f 100644 --- a/src/librustc/middle/typeck/check/regionck.rs +++ b/src/librustc/middle/typeck/check/regionck.rs @@ -509,8 +509,8 @@ fn visit_expr(rcx: &mut Rcx, expr: &ast::Expr) { }; match ty::get(base_ty).sty { ty::ty_rptr(r_ptr, _) => { - mk_subregion_due_to_derefence(rcx, expr.span, - ty::ReScope(expr.id), r_ptr); + mk_subregion_due_to_dereference(rcx, expr.span, + ty::ReScope(expr.id), r_ptr); } _ => {} } @@ -843,10 +843,9 @@ fn constrain_autoderefs(rcx: &mut Rcx, derefs: uint, mut derefd_ty: ty::t) { /*! - * Invoked on any dereference that occurs, whether explicitly - * or through an auto-deref. Checks that if this is a region - * pointer being derefenced, the lifetime of the pointer includes - * the deref expr. + * Invoked on any auto-dereference that occurs. Checks that if + * this is a region pointer being dereferenced, the lifetime of + * the pointer includes the deref expr. */ let r_deref_expr = ty::ReScope(deref_expr.id); for i in range(0u, derefs) { @@ -887,8 +886,8 @@ fn constrain_autoderefs(rcx: &mut Rcx, match ty::get(derefd_ty).sty { ty::ty_rptr(r_ptr, _) => { - mk_subregion_due_to_derefence(rcx, deref_expr.span, - r_deref_expr, r_ptr); + mk_subregion_due_to_dereference(rcx, deref_expr.span, + r_deref_expr, r_ptr); } _ => {} } @@ -902,10 +901,10 @@ fn constrain_autoderefs(rcx: &mut Rcx, } } -pub fn mk_subregion_due_to_derefence(rcx: &mut Rcx, - deref_span: Span, - minimum_lifetime: ty::Region, - maximum_lifetime: ty::Region) { +pub fn mk_subregion_due_to_dereference(rcx: &mut Rcx, + deref_span: Span, + minimum_lifetime: ty::Region, + maximum_lifetime: ty::Region) { rcx.fcx.mk_subr(true, infer::DerefPointer(deref_span), minimum_lifetime, maximum_lifetime) }