From 252027960410da9f425cab9b6f6599af1d63800f Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 13 Nov 2017 13:26:27 -0500 Subject: [PATCH] test we reject equivalent signatures with more than one argument --- .../impl-trait/impl-generic-mismatch-ab.rs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/compile-fail/impl-trait/impl-generic-mismatch-ab.rs diff --git a/src/test/compile-fail/impl-trait/impl-generic-mismatch-ab.rs b/src/test/compile-fail/impl-trait/impl-generic-mismatch-ab.rs new file mode 100644 index 00000000000..43b47e9e915 --- /dev/null +++ b/src/test/compile-fail/impl-trait/impl-generic-mismatch-ab.rs @@ -0,0 +1,23 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(universal_impl_trait)] +use std::fmt::Debug; + +trait Foo { + fn foo(&self, a: &A, b: &impl Debug); +} + +impl Foo for () { + fn foo(&self, a: &impl Debug, b: &B) { } + //~^ ERROR method `foo` has an incompatible type for trait +} + +fn main() {}