From 59e9cfa0cf66b92c05dc19c28dc6eb95cf2e4a67 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 14 Jan 2015 18:22:16 -0500 Subject: use UFCS in `#[deriving(Hash)]` expansion now uses `::std::hash::Hash::hash(&*__self_0_0, __arg_0)` instead of `(*__self_0_0).hash(__arg_0)` closes #21160 --- src/test/compile-fail/issue-21160.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/test/compile-fail/issue-21160.rs (limited to 'src/test/compile-fail') diff --git a/src/test/compile-fail/issue-21160.rs b/src/test/compile-fail/issue-21160.rs new file mode 100644 index 00000000000..30ed4f43940 --- /dev/null +++ b/src/test/compile-fail/issue-21160.rs @@ -0,0 +1,21 @@ +// Copyright 2015 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. + +struct Bar; + +impl Bar { + fn hash(&self, _: T) {} +} + +#[derive(Hash)] +//~^ error: the trait `core::hash::Hash<__S>` is not implemented for the type `Bar` +struct Foo(Bar); + +fn main() {} -- cgit 1.4.1-3-g733a5