diff options
| author | Ding Xiang Fei <dingxiangfei2009@protonmail.ch> | 2025-08-13 02:26:04 +0800 |
|---|---|---|
| committer | Xiangfei Ding <dingxiangfei2009@protonmail.ch> | 2025-09-25 01:54:24 +0800 |
| commit | 120162e30ffa92308a6a3a76f2328467fbd10ced (patch) | |
| tree | 9d11d074ba7c73a02c4887867e7f20dc769d2d9c | |
| parent | a86f14072714fb817a6f60fa20be5a4e875d049f (diff) | |
| download | rust-120162e30ffa92308a6a3a76f2328467fbd10ced.tar.gz rust-120162e30ffa92308a6a3a76f2328467fbd10ced.zip | |
add test fixture for newly allowed const expr
Signed-off-by: Ding Xiang Fei <dingxiangfei2009@protonmail.ch> Co-authored-by: Theemathas Chirananthavat <theemathas@gmail.com>
| -rw-r--r-- | tests/ui/coercion/no_local_for_coerced_const-issue-143671.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/coercion/no_local_for_coerced_const-issue-143671.rs b/tests/ui/coercion/no_local_for_coerced_const-issue-143671.rs index eb814e9723c..5924809f34c 100644 --- a/tests/ui/coercion/no_local_for_coerced_const-issue-143671.rs +++ b/tests/ui/coercion/no_local_for_coerced_const-issue-143671.rs @@ -6,6 +6,7 @@ use std::fmt::Display; use std::marker::Unsize; use std::ops::CoerceUnsized; +use std::rc::Weak; #[repr(transparent)] struct X<'a, T: ?Sized> { @@ -27,4 +28,11 @@ const Y: X<'static, i32> = X { f: &0 }; fn main() { let _: [X<'static, dyn Display>; 0] = [Y; 0]; + coercion_on_weak_in_const(); +} + +fn coercion_on_weak_in_const() { + const X: Weak<i32> = Weak::new(); + const Y: [Weak<dyn Send>; 0] = [X; 0]; + let _ = Y; } |
