diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2021-07-19 18:50:47 +0800 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2021-07-19 19:51:44 +0800 |
| commit | 4b82bbeac009c09c55e4a5458ee7338bddb14a44 (patch) | |
| tree | 662e8f10cbcfe6e580599e074bdc5ab7f5a9cff6 /src/test | |
| parent | d05a286449809cba5043bdac39074198a63cda6d (diff) | |
| download | rust-4b82bbeac009c09c55e4a5458ee7338bddb14a44.tar.gz rust-4b82bbeac009c09c55e4a5458ee7338bddb14a44.zip | |
Recognize bounds on impls as const bounds
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs | 15 |
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() {} |
