Skip to content

Commit 815c2f1

Browse files
authored
Unrolled build for rust-lang#130070
Rollup merge of rust-lang#130070 - gurry:rename-regionkind-addof-to-ref, r=compiler-errors Rename variant `AddrOfRegion` of `RegionVariableOrigin` to `BorrowRegion` because "Borrow" is the more idiomatic Rust term than "AddrOf".
2 parents 263a3ae + c0b0627 commit 815c2f1

File tree

3 files changed

+5
-5
lines changed
  • compiler
    • rustc_hir_typeck/src
    • rustc_infer/src/infer
    • rustc_trait_selection/src/error_reporting/infer

3 files changed

+5
-5
lines changed

compiler/rustc_hir_typeck/src/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
447447
// this time with enough precision to check that the value
448448
// whose address was taken can actually be made to live as long
449449
// as it needs to live.
450-
let region = self.next_region_var(infer::AddrOfRegion(expr.span));
450+
let region = self.next_region_var(infer::BorrowRegion(expr.span));
451451
Ty::new_ref(self.tcx, region, ty, mutbl)
452452
}
453453
}

compiler/rustc_infer/src/infer/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ pub enum RegionVariableOrigin {
458458
PatternRegion(Span),
459459

460460
/// Regions created by `&` operator.
461-
///
462-
AddrOfRegion(Span),
461+
BorrowRegion(Span),
462+
463463
/// Regions created as part of an autoref of a method receiver.
464464
Autoref(Span),
465465

@@ -1741,7 +1741,7 @@ impl RegionVariableOrigin {
17411741
match *self {
17421742
MiscVariable(a)
17431743
| PatternRegion(a)
1744-
| AddrOfRegion(a)
1744+
| BorrowRegion(a)
17451745
| Autoref(a)
17461746
| Coercion(a)
17471747
| RegionParameterDefinition(a, ..)

compiler/rustc_trait_selection/src/error_reporting/infer/region.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
10181018
let var_description = match var_origin {
10191019
infer::MiscVariable(_) => String::new(),
10201020
infer::PatternRegion(_) => " for pattern".to_string(),
1021-
infer::AddrOfRegion(_) => " for borrow expression".to_string(),
1021+
infer::BorrowRegion(_) => " for borrow expression".to_string(),
10221022
infer::Autoref(_) => " for autoref".to_string(),
10231023
infer::Coercion(_) => " for automatic coercion".to_string(),
10241024
infer::BoundRegion(_, br, infer::FnCall) => {

0 commit comments

Comments
 (0)