Skip to content

Commit fa44927

Browse files
committed
reword to "consider borrowing here: {suggestion}"
1 parent 97d8d04 commit fa44927

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
835835
if let hir::ExprIndex(_, _) = expr.node {
836836
if let Ok(snippet) = self.tcx.sess.codemap().span_to_snippet(expr.span) {
837837
err.span_suggestion(expr.span,
838-
"consider a slice instead",
838+
"consider borrowing here",
839839
format!("&{}", snippet));
840840
}
841841
}

src/test/ui/suggestions/str-array-assignment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main() { //~ NOTE expected `()` because of default return type
2020
//~| NOTE expected type
2121
let v = s[..2];
2222
//~^ ERROR the trait bound `str: std::marker::Sized` is not satisfied
23-
//~| HELP consider a slice instead
23+
//~| HELP consider borrowing here
2424
//~| NOTE `str` does not have a constant size known at compile-time
2525
//~| HELP the trait `std::marker::Sized` is not implemented for `str`
2626
//~| NOTE all local variables must have a statically known size

src/test/ui/suggestions/str-array-assignment.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
2323
--> $DIR/str-array-assignment.rs:21:7
2424
|
2525
21 | let v = s[..2];
26-
| ^ ------ help: consider a slice instead: `&s[..2]`
26+
| ^ ------ help: consider borrowing here: `&s[..2]`
2727
| |
2828
| `str` does not have a constant size known at compile-time
2929
|

0 commit comments

Comments
 (0)