about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-01-28 11:25:15 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-02-15 16:08:52 +1100
commit7024dc523ac712249bb78833dab80c5087e1de36 (patch)
tree298dd2afffe0308db1f69202ee272ae2daec9563 /src/test
parent925ec0d3c77601ebfa32b148393a5192943c2ff1 (diff)
downloadrust-7024dc523ac712249bb78833dab80c5087e1de36.tar.gz
rust-7024dc523ac712249bb78833dab80c5087e1de36.zip
Overhaul `RegionKind` and `Region`.
Specifically, change `Region` from this:
```
pub type Region<'tcx> = &'tcx RegionKind;
```
to this:
```
pub struct Region<'tcx>(&'tcx Interned<RegionKind>);
```

This now matches `Ty` and `Predicate` more closely.

Things to note
- Regions have always been interned, but we haven't been using pointer-based
  `Eq` and `Hash`. This is now happening.
- I chose to impl `Deref` for `Region` because it makes pattern matching a lot
  nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`.
- Various methods are moved from `RegionKind` to `Region`.
- There is a lot of tedious sigil changes.
- A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a
  `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`.
- A couple of test outputs change slightly, I'm not sure why, but the new
  outputs are a little better.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/issues/issue-35570.stderr4
-rw-r--r--src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/test/ui/issues/issue-35570.stderr b/src/test/ui/issues/issue-35570.stderr
index dda6145e65a..2697d46bdb2 100644
--- a/src/test/ui/issues/issue-35570.stderr
+++ b/src/test/ui/issues/issue-35570.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied
-  --> $DIR/issue-35570.rs:8:4
+  --> $DIR/issue-35570.rs:8:40
    |
 LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
-   |    ^^^^ the trait `for<'a> Trait2<'a>` is not implemented for `()`
+   |                                        ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Trait2<'a>` is not implemented for `()`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
index 44ef13c740c..6844e866532 100644
--- a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
+++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
-  --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:4
+  --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:49
    |
 LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
-   |    ^^^^^^ the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
+   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
    |
 help: consider restricting type parameter `T`
    |