From 607f60712c7c9d3b96a162d2605a89ff2554fc7e Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Tue, 23 Dec 2014 10:57:44 +0100 Subject: Keep track of the whole error chain --- src/libsyntax/ext/deriving/bounds.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/deriving/bounds.rs b/src/libsyntax/ext/deriving/bounds.rs index c27a27fce6a..cf29bb048d6 100644 --- a/src/libsyntax/ext/deriving/bounds.rs +++ b/src/libsyntax/ext/deriving/bounds.rs @@ -26,8 +26,11 @@ pub fn expand_deriving_bound(cx: &mut ExtCtxt, MetaWord(ref tname) => { match tname.get() { "Copy" => "Copy", - "Send" => "Send", - "Sync" => "Sync", + "Send" | "Sync" => { + return cx.span_err(span, + format!("{} is an unsafe trait and it \ + should be implemented explicitly", *tname)[]) + } ref tname => { cx.span_bug(span, format!("expected built-in trait name but \ -- cgit 1.4.1-3-g733a5