about summary refs log tree commit diff
path: root/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2021-08-25 14:30:09 +0000
committerDeadbeef <ent3rm4n@gmail.com>2021-08-27 05:07:38 +0000
commitff24ac4f2b1415cc93e0cc3edb70097df6dae073 (patch)
treec7ac8411e8155a93a9f5bea53c70c0fe7b44a2af /src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs
parent1164c946b0a5889f6f0ca1dba48db0cf36c32915 (diff)
downloadrust-ff24ac4f2b1415cc93e0cc3edb70097df6dae073.tar.gz
rust-ff24ac4f2b1415cc93e0cc3edb70097df6dae073.zip
Try fixing some tests
Diffstat (limited to 'src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs')
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs
new file mode 100644
index 00000000000..585b65988f3
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs
@@ -0,0 +1,19 @@
+// check-pass
+
+#![feature(const_fn_trait_bound)]
+
+struct S;
+
+impl PartialEq for S {
+    fn eq(&self, _: &S) -> bool {
+        true
+    }
+}
+
+const fn equals_self<T: PartialEq>(t: &T) -> bool {
+    true
+}
+
+pub const EQ: bool = equals_self(&S);
+
+fn main() {}