about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-07-21 15:52:47 +0200
committerGitHub <noreply@github.com>2021-07-21 15:52:47 +0200
commit1008ace95c825bd48ad9dffdb27fd63be45bb3c2 (patch)
tree5786084682e91ed2798eeec904ae056d429dfc91 /src
parente6380a699b150b88e4e0b43ed5e7c3eff438ec58 (diff)
parent4b82bbeac009c09c55e4a5458ee7338bddb14a44 (diff)
downloadrust-1008ace95c825bd48ad9dffdb27fd63be45bb3c2.tar.gz
rust-1008ace95c825bd48ad9dffdb27fd63be45bb3c2.zip
Rollup merge of #87273 - fee1-dead:impl-const-impl-bounds, r=oli-obk
Recognize bounds on impls as const bounds

r? ```@oli-obk```
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs
new file mode 100644
index 00000000000..536c1d73740
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs
@@ -0,0 +1,15 @@
+// check-pass
+#![feature(const_fn_trait_bound)]
+#![feature(const_trait_impl)]
+
+trait MyPartialEq {
+    fn eq(&self, other: &Self) -> bool;
+}
+
+impl<T: PartialEq> const MyPartialEq for T {
+    fn eq(&self, other: &Self) -> bool {
+        PartialEq::eq(self, other)
+    }
+}
+
+fn main() {}