about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-08-21 17:57:56 -0400
committerGitHub <noreply@github.com>2025-08-21 17:57:56 -0400
commitcc98a849c856dddcab0d2aef7b79dcf341d5c66b (patch)
tree6d8af858d66a9eac9fd07a41f145e59a14f8ffd3 /tests
parente4d71b8089f5d47f59d92f4438439276289347c4 (diff)
parent95b3b61b8c2ecf0b5073d5779cea2825c726bf4b (diff)
Rollup merge of #145700 - nnethercote:fix-145696, r=lcnr
Handle `ReEarlyParam` in `type_name`.

Fixes rust-lang/rust#145696.

r? `@lcnr`
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/type/type-name-basic.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/ui/type/type-name-basic.rs b/tests/ui/type/type-name-basic.rs
index e1310e1f365..343bcae175a 100644
--- a/tests/ui/type/type-name-basic.rs
+++ b/tests/ui/type/type-name-basic.rs
@@ -5,7 +5,7 @@
 
 #![allow(dead_code)]
 
-use std::any::type_name;
+use std::any::{Any, type_name, type_name_of_val};
 use std::borrow::Cow;
 
 struct Foo<T>(T);
@@ -29,6 +29,12 @@ macro_rules! t {
     }
 }
 
+macro_rules! v {
+    ($v:expr, $str:literal) => {
+        assert_eq!(type_name_of_val(&$v), $str);
+    }
+}
+
 pub fn main() {
     t!(bool, "bool");
     t!(char, "char");
@@ -91,4 +97,14 @@ pub fn main() {
         }
     }
     S::<u32>::test();
+
+    struct Wrap<T>(T);
+    impl Wrap<&()> {
+        fn get(&self) -> impl Any {
+            struct Info;
+            Info
+        }
+    }
+    let a = Wrap(&()).get();
+    v!(a, "type_name_basic::main::Wrap<&()>::get::Info");
 }