diff options
| author | Jules Bertholet <julesbertholet@quoi.xyz> | 2024-04-16 19:23:30 -0400 |
|---|---|---|
| committer | Jules Bertholet <julesbertholet@quoi.xyz> | 2024-04-17 09:34:39 -0400 |
| commit | 2a4624ddd1d4084f385bbd704e0f90c85e16c42f (patch) | |
| tree | 537a2011738e639ebbd562d10d78c13a67fe0b30 /compiler/rustc_borrowck/src/diagnostics | |
| parent | d19e48d79ab428387bbc354d677d7d9ba221d174 (diff) | |
| download | rust-2a4624ddd1d4084f385bbd704e0f90c85e16c42f.tar.gz rust-2a4624ddd1d4084f385bbd704e0f90c85e16c42f.zip | |
Rename `BindingAnnotation` to `BindingMode`
Diffstat (limited to 'compiler/rustc_borrowck/src/diagnostics')
| -rw-r--r-- | compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs index 8ccf88ec59c..ec0d4af599e 100644 --- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs @@ -377,7 +377,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { if p.span == self.expr_span { self.pat = Some(p); } - if let hir::PatKind::Binding(hir::BindingAnnotation::NONE, _, i, sub) = p.kind { + if let hir::PatKind::Binding(hir::BindingMode::NONE, _, i, sub) = p.kind { if i.span == self.expr_span || p.span == self.expr_span { self.pat = Some(p); } diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs index 602a84ce4dd..8b314217190 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs @@ -5,7 +5,7 @@ use core::ops::ControlFlow; use hir::{ExprKind, Param}; use rustc_errors::{Applicability, Diag}; use rustc_hir::intravisit::Visitor; -use rustc_hir::{self as hir, BindingAnnotation, ByRef, Node}; +use rustc_hir::{self as hir, BindingMode, ByRef, Node}; use rustc_infer::traits; use rustc_middle::mir::{Mutability, Place, PlaceRef, ProjectionElem}; use rustc_middle::ty::{self, InstanceDef, ToPredicate, Ty, TyCtxt}; @@ -303,7 +303,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { { match *decl.local_info() { LocalInfo::User(BindingForm::Var(mir::VarBindingForm { - binding_mode: BindingAnnotation(ByRef::No, Mutability::Not), + binding_mode: BindingMode(ByRef::No, Mutability::Not), opt_ty_info: Some(sp), opt_match_place: _, pat_span: _, @@ -398,7 +398,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { let upvar_hir_id = captured_place.get_root_variable(); if let Node::Pat(pat) = self.infcx.tcx.hir_node(upvar_hir_id) - && let hir::PatKind::Binding(hir::BindingAnnotation::NONE, _, upvar_ident, _) = + && let hir::PatKind::Binding(hir::BindingMode::NONE, _, upvar_ident, _) = pat.kind { if upvar_ident.name == kw::SelfLower { @@ -729,7 +729,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { debug!("local_decl: {:?}", local_decl); let pat_span = match *local_decl.local_info() { LocalInfo::User(BindingForm::Var(mir::VarBindingForm { - binding_mode: BindingAnnotation(ByRef::No, Mutability::Not), + binding_mode: BindingMode(ByRef::No, Mutability::Not), opt_ty_info: _, opt_match_place: _, pat_span, @@ -1086,7 +1086,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { } LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm { - binding_mode: BindingAnnotation(ByRef::No, _), + binding_mode: BindingMode(ByRef::No, _), opt_ty_info, .. })) => { @@ -1154,7 +1154,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { } LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm { - binding_mode: BindingAnnotation(ByRef::Yes(_), _), + binding_mode: BindingMode(ByRef::Yes(_), _), .. })) => { let pattern_span: Span = local_decl.source_info.span; @@ -1356,7 +1356,7 @@ pub fn mut_borrow_of_mutable_ref(local_decl: &LocalDecl<'_>, local_name: Option< match *local_decl.local_info() { // Check if mutably borrowing a mutable reference. LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm { - binding_mode: BindingAnnotation(ByRef::No, Mutability::Not), + binding_mode: BindingMode(ByRef::No, Mutability::Not), .. })) => matches!(local_decl.ty.kind(), ty::Ref(_, _, hir::Mutability::Mut)), LocalInfo::User(mir::BindingForm::ImplicitSelf(kind)) => { |
