summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-71676-1.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/issues/issue-71676-1.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-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/issues/issue-71676-1.rs')
-rw-r--r--src/test/ui/issues/issue-71676-1.rs53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/test/ui/issues/issue-71676-1.rs b/src/test/ui/issues/issue-71676-1.rs
deleted file mode 100644
index 6e87c7174..000000000
--- a/src/test/ui/issues/issue-71676-1.rs
+++ /dev/null
@@ -1,53 +0,0 @@
-// run-rustfix
-use std::ops::Deref;
-use std::ops::DerefMut;
-struct Bar(u8);
-struct Foo(Bar);
-struct Emm(Foo);
-impl Deref for Bar{
- type Target = u8;
- fn deref(&self) -> &Self::Target {
- &self.0
- }
-}
-impl Deref for Foo {
- type Target = Bar;
- fn deref(&self) -> &Self::Target {
- &self.0
- }
-}
-impl Deref for Emm {
- type Target = Foo;
- fn deref(&self) -> &Self::Target {
- &self.0
- }
-}
-impl DerefMut for Bar{
- fn deref_mut(&mut self) -> &mut Self::Target {
- &mut self.0
- }
-}
-impl DerefMut for Foo {
- fn deref_mut(&mut self) -> &mut Self::Target {
- &mut self.0
- }
-}
-impl DerefMut for Emm {
- fn deref_mut(&mut self) -> &mut Self::Target {
- &mut self.0
- }
-}
-fn main() {
- // Suggest dereference with arbitrary mutability
- let a = Emm(Foo(Bar(0)));
- let _: *const u8 = &a; //~ ERROR mismatched types
-
- let mut a = Emm(Foo(Bar(0)));
- let _: *mut u8 = &a; //~ ERROR mismatched types
-
- let a = Emm(Foo(Bar(0)));
- let _: *const u8 = &mut a; //~ ERROR mismatched types
-
- let mut a = Emm(Foo(Bar(0)));
- let _: *mut u8 = &mut a; //~ ERROR mismatched types
-}