about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorDavid Wood <david@davidtw.co>2018-11-16 22:56:18 +0100
committerDavid Wood <david@davidtw.co>2018-12-30 14:25:20 +0100
commit24a7a010d1015731418852d893d889f4bcbdeb51 (patch)
tree88f576b3734b605cec00ba83114c22a038e627ae /src/test
parent7155690ffcdf2ce325361bdb5b64ad69c043662f (diff)
downloadrust-24a7a010d1015731418852d893d889f4bcbdeb51.tar.gz
rust-24a7a010d1015731418852d893d889f4bcbdeb51.zip
Refactor `UserTypeAnnotation`.
This commit refactors the `UserTypeAnnotation` type to be referred to by
an index within `UserTypeProjection`. `UserTypeAnnotation` is instead
kept in an `IndexVec` within the `Mir` struct.

Further, instead of `UserTypeAnnotation` containing canonicalized types,
it now contains normal types and the entire `UserTypeAnnotation` is
canonicalized. To support this, the type was moved from the `rustc::mir`
module to `rustc::ty` module.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/mir-opt/basic_assignment.rs2
-rw-r--r--src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr2
-rw-r--r--src/test/ui/nll/user-annotations/dump-fn-method.stderr20
3 files changed, 12 insertions, 12 deletions
diff --git a/src/test/mir-opt/basic_assignment.rs b/src/test/mir-opt/basic_assignment.rs
index bb304ea12ca..88fd53d4ba5 100644
--- a/src/test/mir-opt/basic_assignment.rs
+++ b/src/test/mir-opt/basic_assignment.rs
@@ -37,7 +37,7 @@ fn main() {
 //        StorageLive(_4);
 //        _4 = std::option::Option<std::boxed::Box<u32>>::None;
 //        FakeRead(ForLet, _4);
-//        AscribeUserType(_4, o, UserTypeProjection { base: Ty(Canonical { max_universe: U0, variables: [], value: std::option::Option<std::boxed::Box<u32>> }), projs: [] });
+//        AscribeUserType(_4, o, UserTypeProjection { base: UserTypeAnnotation(1), projs: [] });
 //        StorageLive(_5);
 //        StorageLive(_6);
 //        _6 = move _4;
diff --git a/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr b/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr
index 5a359cf9ed8..123c26195d0 100644
--- a/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr
+++ b/src/test/ui/nll/user-annotations/dump-adt-brace-struct.stderr
@@ -1,4 +1,4 @@
-error: user substs: Canonical { max_universe: U0, variables: [], value: UserSubsts { substs: [u32], user_self_ty: None } }
+error: user substs: UserSubsts { substs: [u32], user_self_ty: None }
   --> $DIR/dump-adt-brace-struct.rs:18:5
    |
 LL |     SomeStruct::<u32> { t: 22 }; //~ ERROR [u32]
diff --git a/src/test/ui/nll/user-annotations/dump-fn-method.stderr b/src/test/ui/nll/user-annotations/dump-fn-method.stderr
index 3f159cc92b5..fc4544437c5 100644
--- a/src/test/ui/nll/user-annotations/dump-fn-method.stderr
+++ b/src/test/ui/nll/user-annotations/dump-fn-method.stderr
@@ -1,26 +1,26 @@
-error: user substs: Canonical { max_universe: U0, variables: [], value: UserSubsts { substs: [u32], user_self_ty: None } }
-  --> $DIR/dump-fn-method.rs:26:13
+error: user substs: UserSubsts { substs: [^0, ^1, u32], user_self_ty: None }
+  --> $DIR/dump-fn-method.rs:44:5
    |
-LL |     let x = foo::<u32>; //~ ERROR [u32]
-   |             ^^^^^^^^^^
+LL |     y.method::<u32>(44, 66); //~ ERROR [^0, ^1, u32]
+   |     ^^^^^^^^^^^^^^^^^^^^^^^
 
-error: user substs: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: UserSubsts { substs: [^0, u32, ^1], user_self_ty: None } }
+error: user substs: UserSubsts { substs: [^0, u32, ^1], user_self_ty: None }
   --> $DIR/dump-fn-method.rs:32:13
    |
 LL |     let x = <_ as Bazoom<u32>>::method::<_>; //~ ERROR [^0, u32, ^1]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: user substs: Canonical { max_universe: U0, variables: [], value: UserSubsts { substs: [u8, u16, u32], user_self_ty: None } }
+error: user substs: UserSubsts { substs: [u8, u16, u32], user_self_ty: None }
   --> $DIR/dump-fn-method.rs:36:13
    |
 LL |     let x = <u8 as Bazoom<u16>>::method::<u32>; //~ ERROR [u8, u16, u32]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: user substs: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: UserSubsts { substs: [^0, ^1, u32], user_self_ty: None } }
-  --> $DIR/dump-fn-method.rs:44:5
+error: user substs: UserSubsts { substs: [u32], user_self_ty: None }
+  --> $DIR/dump-fn-method.rs:26:13
    |
-LL |     y.method::<u32>(44, 66); //~ ERROR [^0, ^1, u32]
-   |     ^^^^^^^^^^^^^^^^^^^^^^^
+LL |     let x = foo::<u32>; //~ ERROR [u32]
+   |             ^^^^^^^^^^
 
 error: aborting due to 4 previous errors