From 2bed5dc528c120e571a75ef77349cd3222ce4cd3 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 8 May 2013 12:52:07 -0700 Subject: [PATCH] rustc: change 'use' to 'add' in error message, fix #2994 --- src/librustc/middle/kind.rs | 2 +- src/test/compile-fail/kindck-owned-trait-scoped.rs | 2 +- src/test/compile-fail/kindck-owned-trait.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc/middle/kind.rs b/src/librustc/middle/kind.rs index b988a88a9019c..6315986d1a6f2 100644 --- a/src/librustc/middle/kind.rs +++ b/src/librustc/middle/kind.rs @@ -421,7 +421,7 @@ pub fn check_durable(tcx: ty::ctxt, ty: ty::t, sp: span) -> bool { match ty::get(ty).sty { ty::ty_param(*) => { tcx.sess.span_err(sp, "value may contain borrowed \ - pointers; use `'static` bound"); + pointers; add `'static` bound"); } _ => { tcx.sess.span_err(sp, "value may contain borrowed \ diff --git a/src/test/compile-fail/kindck-owned-trait-scoped.rs b/src/test/compile-fail/kindck-owned-trait-scoped.rs index dc3717085ca57..808bfba829858 100644 --- a/src/test/compile-fail/kindck-owned-trait-scoped.rs +++ b/src/test/compile-fail/kindck-owned-trait-scoped.rs @@ -37,7 +37,7 @@ fn to_foo_2(t: T) -> @foo { // Not OK---T may contain borrowed ptrs and it is going to escape // as part of the returned foo value struct F { f: T } - @F {f:t} as @foo //~ ERROR value may contain borrowed pointers; use `'static` bound + @F {f:t} as @foo //~ ERROR value may contain borrowed pointers; add `'static` bound } fn to_foo_3(t: T) -> @foo { diff --git a/src/test/compile-fail/kindck-owned-trait.rs b/src/test/compile-fail/kindck-owned-trait.rs index c61bbc69be519..857c71db72ce0 100644 --- a/src/test/compile-fail/kindck-owned-trait.rs +++ b/src/test/compile-fail/kindck-owned-trait.rs @@ -11,7 +11,7 @@ trait foo { fn foo(&self); } fn to_foo(t: T) -> @foo { - @t as @foo //~ ERROR value may contain borrowed pointers; use `'static` bound + @t as @foo //~ ERROR value may contain borrowed pointers; add `'static` bound } fn to_foo2(t: T) -> @foo {