about summary refs log tree commit diff
path: root/compiler/stable_mir/src/ty.rs
diff options
context:
space:
mode:
authorCelina G. Val <celinval@amazon.com>2024-03-28 13:19:50 -0700
committerCelina G. Val <celinval@amazon.com>2024-03-28 13:22:10 -0700
commita325bce3cd162a20ecab9ff31def3e6701c8ebea (patch)
tree0da9ff2b9571bb6cf2c19611c57f19cd4bfe9e2c /compiler/stable_mir/src/ty.rs
parentd779a7a25f67fced5f8fea232ef407c5b228a22f (diff)
downloadrust-a325bce3cd162a20ecab9ff31def3e6701c8ebea.tar.gz
rust-a325bce3cd162a20ecab9ff31def3e6701c8ebea.zip
Normalize the result of Fields::ty_with_args
We were only instantiating before, which would leak an AliasTy.
I added a test case that reproduce the issue seen here:

https://github.com/model-checking/kani/issues/3113
Diffstat (limited to 'compiler/stable_mir/src/ty.rs')
-rw-r--r--compiler/stable_mir/src/ty.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/stable_mir/src/ty.rs b/compiler/stable_mir/src/ty.rs
index 21db222095f..3e8d186b97e 100644
--- a/compiler/stable_mir/src/ty.rs
+++ b/compiler/stable_mir/src/ty.rs
@@ -654,7 +654,7 @@ impl AdtDef {
         with(|cx| cx.def_ty(self.0))
     }
 
-    /// Retrieve the type of this Adt instantiating the type with the given arguments.
+    /// Retrieve the type of this Adt by instantiating and normalizing it with the given arguments.
     ///
     /// This will assume the type can be instantiated with these arguments.
     pub fn ty_with_args(&self, args: &GenericArgs) -> Ty {
@@ -733,7 +733,7 @@ pub struct FieldDef {
 }
 
 impl FieldDef {
-    /// Retrieve the type of this field instantiating the type with the given arguments.
+    /// Retrieve the type of this field instantiating and normalizing it with the given arguments.
     ///
     /// This will assume the type can be instantiated with these arguments.
     pub fn ty_with_args(&self, args: &GenericArgs) -> Ty {