Skip to content

Commit

Permalink
rustc: change 'use' to 'add' in error message, fix rust-lang#2994
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed May 30, 2013
1 parent a394298 commit 2bed5dc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/librustc/middle/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/kindck-owned-trait-scoped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn to_foo_2<T:Copy>(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<T> { 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:Copy + 'static>(t: T) -> @foo {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/kindck-owned-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
trait foo { fn foo(&self); }

fn to_foo<T:Copy + 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:Copy + foo + 'static>(t: T) -> @foo {
Expand Down

0 comments on commit 2bed5dc

Please sign in to comment.