about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-05-18 05:36:27 -0700
committerbors <bors@rust-lang.org>2014-05-18 05:36:27 -0700
commit63287eef27b1a23a1fc24a7b4453eb7bd8ec1f11 (patch)
tree19d04808125f6ed7ca26cb0ff3166b171e7a9fdb
parent2b4cdea7f1a26f2ddb543a0650b32e1024df7985 (diff)
parent2ee0ca5132a0450b55171caa17c702d5b55ca512 (diff)
downloadrust-63287eef27b1a23a1fc24a7b4453eb7bd8ec1f11.tar.gz
rust-63287eef27b1a23a1fc24a7b4453eb7bd8ec1f11.zip
auto merge of #14274 : youknowone/rust/advice-tilt-to-box, r=thestinger
-rw-r--r--src/librustc/middle/typeck/astconv.rs2
-rw-r--r--src/test/compile-fail/issue-5883.rs6
-rw-r--r--src/test/compile-fail/trait-bounds-not-on-bare-trait.rs2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc/middle/typeck/astconv.rs b/src/librustc/middle/typeck/astconv.rs
index e3591af6440..e9a95a4a9eb 100644
--- a/src/librustc/middle/typeck/astconv.rs
+++ b/src/librustc/middle/typeck/astconv.rs
@@ -653,7 +653,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
                         tcx.sess.span_err(
                             ast_ty.span,
                             format!("reference to trait `{name}` where a type is expected; \
-                                    try `~{name}` or `&{name}`", name=path_str));
+                                    try `Box<{name}>` or `&{name}`", name=path_str));
                         ty::mk_err()
                     }
                     ast::DefTy(did) | ast::DefStruct(did) => {
diff --git a/src/test/compile-fail/issue-5883.rs b/src/test/compile-fail/issue-5883.rs
index 5a7eb75d90d..831e165ad0e 100644
--- a/src/test/compile-fail/issue-5883.rs
+++ b/src/test/compile-fail/issue-5883.rs
@@ -11,15 +11,15 @@
 trait A {}
 
 struct Struct {
-    r: A //~ ERROR reference to trait `A` where a type is expected; try `~A` or `&A`
+    r: A //~ ERROR reference to trait `A` where a type is expected; try `Box<A>` or `&A`
 }
 
 fn new_struct(r: A) -> Struct {
-    //~^ ERROR reference to trait `A` where a type is expected; try `~A` or `&A`
+    //~^ ERROR reference to trait `A` where a type is expected; try `Box<A>` or `&A`
     Struct { r: r }
 }
 
 trait Curve {}
 enum E {X(Curve)}
-//~^ ERROR reference to trait `Curve` where a type is expected; try `~Curve` or `&Curve`
+//~^ ERROR reference to trait `Curve` where a type is expected; try `Box<Curve>` or `&Curve`
 fn main() {}
diff --git a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs b/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs
index 50e55ad295e..435c90c7830 100644
--- a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs
+++ b/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs
@@ -14,7 +14,7 @@ trait Foo {
 // This should emit the less confusing error, not the more confusing one.
 
 fn foo(_x: Foo:Send) {
-    //~^ERROR reference to trait `Foo` where a type is expected; try `~Foo` or `&Foo`
+    //~^ERROR reference to trait `Foo` where a type is expected; try `Box<Foo>` or `&Foo`
 }
 
 fn main() { }