diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/consts/const-eval/issue-50814-2.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/consts/const-eval/issue-50814-2.rs')
-rw-r--r-- | src/test/ui/consts/const-eval/issue-50814-2.rs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/test/ui/consts/const-eval/issue-50814-2.rs b/src/test/ui/consts/const-eval/issue-50814-2.rs deleted file mode 100644 index 53eb7b149..000000000 --- a/src/test/ui/consts/const-eval/issue-50814-2.rs +++ /dev/null @@ -1,34 +0,0 @@ -// build-fail - -trait C { - const BOO: usize; -} - -trait Foo<T> { - const BAR: usize; -} - -struct A<T>(T); - -impl<T: C> Foo<T> for A<T> { - const BAR: usize = [5, 6, 7][T::BOO]; //~ ERROR evaluation of `<A<()> as Foo<()>>::BAR` failed -} - -fn foo<T: C>() -> &'static usize { - &<A<T> as Foo<T>>::BAR //~ constant -} - -impl C for () { - const BOO: usize = 42; -} - -impl C for u32 { - const BOO: usize = 1; -} - -fn main() { - println!("{:x}", foo::<()>() as *const usize as usize); - println!("{:x}", foo::<u32>() as *const usize as usize); - println!("{:x}", foo::<()>()); - println!("{:x}", foo::<u32>()); -} |