aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-19 10:35:56 +0100
committerMartin Fischer <martin@push-f.com>2021-11-19 10:35:56 +0100
commitd8a313dd422c78fb018cfe4249b526fe3e9dc851 (patch)
tree743e20edfd20058b6b784b9099544ff3878d3278 /tests
parenteb686879fdd7cde5d09837c202ebd25c9c9889a6 (diff)
allow same-named method generics if they have same bounds
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/tests.rs b/tests/tests.rs
index 6bccc04..4d09847 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -100,12 +100,14 @@ fn test1<T: Bar1<X>, X, A, B, C>(some: T) {
trait Buz<X> {
type C: Into<String>;
- fn foobar<A>(&self, x: X) -> Result<A, Self::C>;
+ fn foobar1<A>(&self, x: X) -> Result<A, Self::C>;
+ fn foobar2<A>(&self) -> Result<A, Self::C>;
}
-fn test2<T: Buz<X>, X, A>(some: T, x: X) -> Result<A, String> {
+fn test2<T: Buz<X>, X, A>(some: T, x: X) {
let dyn_trait: &dyn DynBuz<X, A> = &some;
- dyn_trait.foobar(x)
+ let _: Result<A, String> = dyn_trait.foobar1(x);
+ let _: Result<A, String> = dyn_trait.foobar2();
}
#[dynamize::dynamize]