From 7eb723d794312c03c0c49d1ddf4875dacc86eb83 Mon Sep 17 00:00:00 2001 From: Luke Gallagher Date: Tue, 7 Apr 2015 11:31:28 +1000 Subject: [PATCH 1/2] Add test for #22560 Closes #22560 --- src/test/compile-fail/issue-22560.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/compile-fail/issue-22560.rs diff --git a/src/test/compile-fail/issue-22560.rs b/src/test/compile-fail/issue-22560.rs new file mode 100644 index 00000000000..d7a71213a3f --- /dev/null +++ b/src/test/compile-fail/issue-22560.rs @@ -0,0 +1,19 @@ +// 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. + +use std::ops::{Add, Sub}; + +type Test = Add + + //~^ ERROR the type parameter `RHS` must be explicitly specified in an object type because its default value `Self` references the type `Self` + Sub; + //~^ ERROR only the builtin traits can be used as closure or object bounds + +fn main() { +} From 6f9ec0615c29a6c7b45bc0db675ce99d90d61eab Mon Sep 17 00:00:00 2001 From: Luke Gallagher Date: Tue, 7 Apr 2015 21:37:16 +1000 Subject: [PATCH 2/2] Add `ignore-tidy-linelength` and fix formatting --- src/test/compile-fail/issue-22560.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/compile-fail/issue-22560.rs b/src/test/compile-fail/issue-22560.rs index d7a71213a3f..b458e10a89c 100644 --- a/src/test/compile-fail/issue-22560.rs +++ b/src/test/compile-fail/issue-22560.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-tidy-linelength + use std::ops::{Add, Sub}; type Test = Add + @@ -15,5 +17,4 @@ type Test = Add + Sub; //~^ ERROR only the builtin traits can be used as closure or object bounds -fn main() { -} +fn main() { }