summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-27949.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/issues/issue-27949.rs
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.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-27949.rs')
-rw-r--r--src/test/ui/issues/issue-27949.rs41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/test/ui/issues/issue-27949.rs b/src/test/ui/issues/issue-27949.rs
deleted file mode 100644
index e905da72a..000000000
--- a/src/test/ui/issues/issue-27949.rs
+++ /dev/null
@@ -1,41 +0,0 @@
-// run-pass
-//
-// At one time, the `==` operator (and other binary operators) did not
-// support subtyping during type checking, and would therefore require
-// LHS and RHS to be exactly identical--i.e. to have the same lifetimes.
-//
-// This was fixed in 1a7fb7dc78439a704f024609ce3dc0beb1386552.
-
-#[derive(Copy, Clone)]
-struct Input<'a> {
- foo: &'a u32
-}
-
-impl <'a> std::cmp::PartialEq<Input<'a>> for Input<'a> {
- fn eq(&self, other: &Input<'a>) -> bool {
- self.foo == other.foo
- }
-
- fn ne(&self, other: &Input<'a>) -> bool {
- self.foo != other.foo
- }
-}
-
-
-fn check_equal<'a, 'b>(x: Input<'a>, y: Input<'b>) -> bool {
- // Type checking error due to 'a != 'b prior to 1a7fb7dc78
- x == y
-}
-
-fn main() {
- let i = 1u32;
- let j = 1u32;
- let k = 2u32;
-
- let input_i = Input { foo: &i };
- let input_j = Input { foo: &j };
- let input_k = Input { foo: &k };
- assert!(check_equal(input_i, input_i));
- assert!(check_equal(input_i, input_j));
- assert!(!check_equal(input_i, input_k));
-}