Skip to content

Commit d30252e

Browse files
committed
Tweak wording
1 parent 5fce361 commit d30252e

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

compiler/rustc_resolve/src/late/diagnostics.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,7 +3012,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
30123012
sugg,
30133013
Applicability::MaybeIncorrect,
30143014
);
3015-
"...or alternatively,"
3015+
"...or alternatively, you might want"
30163016
} else if let Some((kind, _span)) =
30173017
self.diagnostic_metadata.current_function
30183018
&& let FnKind::Fn(_, _, sig, _, _, _) = kind
@@ -3070,9 +3070,9 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
30703070
higher_ranked
30713071
},
30723072
);
3073-
"...or alternatively,"
3073+
"alternatively, you might want"
30743074
} else {
3075-
"instead, you are more likely"
3075+
"instead, you are more likely to want"
30763076
};
30773077
let mut sugg = vec![(lt.span, String::new())];
30783078
if let Some((kind, _span)) =
@@ -3105,7 +3105,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
31053105
}
31063106
};
31073107
err.multipart_suggestion_verbose(
3108-
format!("{pre} to want to return an owned value"),
3108+
format!("{pre} to return an owned value"),
31093109
sugg,
31103110
Applicability::MaybeIncorrect,
31113111
);

tests/ui/c-variadic/variadic-ffi-6.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ help: instead, you are more likely to want to change one of the arguments to be
1313
|
1414
LL | x: &usize,
1515
| +
16-
help: ...or alternatively, to want to return an owned value
16+
help: ...or alternatively, you might want to return an owned value
1717
|
1818
LL - ) -> &usize {
1919
LL + ) -> usize {

tests/ui/lifetimes/issue-26638.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ help: instead, you are more likely to want to change the argument to be borrowed
2525
|
2626
LL | fn parse_type_2(iter: &fn(&u8)->&u8) -> &str { iter() }
2727
| +
28-
help: ...or alternatively, to want to return an owned value
28+
help: ...or alternatively, you might want to return an owned value
2929
|
3030
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> String { iter() }
3131
| ~~~~~~

tests/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ help: instead, you are more likely to want to change the argument to be borrowed
5454
|
5555
LL | fn i(_x: &isize) -> &isize {
5656
| +
57-
help: ...or alternatively, to want to return an owned value
57+
help: ...or alternatively, you might want to return an owned value
5858
|
5959
LL - fn i(_x: isize) -> &isize {
6060
LL + fn i(_x: isize) -> isize {
@@ -75,7 +75,7 @@ help: instead, you are more likely to want to change the argument to be borrowed
7575
|
7676
LL | fn j(_x: &StaticStr) -> &isize {
7777
| +
78-
help: ...or alternatively, to want to return an owned value
78+
help: ...or alternatively, you might want to return an owned value
7979
|
8080
LL - fn j(_x: StaticStr) -> &isize {
8181
LL + fn j(_x: StaticStr) -> isize {
@@ -96,7 +96,7 @@ help: instead, you are more likely to want to change the argument to be borrowed
9696
|
9797
LL | fn k<'a, T: WithLifetime<'a>>(_x: &T::Output) -> &isize {
9898
| +
99-
help: ...or alternatively, to want to return an owned value
99+
help: ...or alternatively, you might want to return an owned value
100100
|
101101
LL - fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize {
102102
LL + fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> isize {
@@ -117,7 +117,7 @@ help: instead, you are more likely to want to change one of the arguments to be
117117
|
118118
LL | fn l<'a>(_: &&'a str, _: &&'a str) -> &str { "" }
119119
| + +
120-
help: ...or alternatively, to want to return an owned value
120+
help: ...or alternatively, you might want to return an owned value
121121
|
122122
LL | fn l<'a>(_: &'a str, _: &'a str) -> String { "" }
123123
| ~~~~~~

tests/ui/self/elision/nested-item.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ help: instead, you are more likely to want to change the argument to be borrowed
2929
|
3030
LL | fn wrap(self: &Wrap<{ fn bar(&self) {} }>) -> &() {
3131
| +
32-
help: ...or alternatively, to want to return an owned value
32+
help: ...or alternatively, you might want to return an owned value
3333
|
3434
LL - fn wrap(self: Wrap<{ fn bar(&self) {} }>) -> &() {
3535
LL + fn wrap(self: Wrap<{ fn bar(&self) {} }>) -> () {

tests/ui/suggestions/impl-trait-missing-lifetime-gated.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ help: consider introducing a named lifetime parameter
1313
|
1414
LL | fn g<'a>(mut x: impl Iterator<Item = &'a ()>) -> Option<&'a ()> { x.next() }
1515
| ++++ ~~~ ~~~
16-
help: ...or alternatively, to want to return an owned value
16+
help: alternatively, you might want to return an owned value
1717
|
1818
LL - fn g(mut x: impl Iterator<Item = &()>) -> Option<&()> { x.next() }
1919
LL + fn g(mut x: impl Iterator<Item = &()>) -> Option<()> { x.next() }
@@ -34,7 +34,7 @@ help: consider introducing a named lifetime parameter
3434
|
3535
LL | async fn i<'a>(mut x: impl Iterator<Item = &'a ()>) -> Option<&'a ()> { x.next() }
3636
| ++++ ~~~ ~~~
37-
help: ...or alternatively, to want to return an owned value
37+
help: alternatively, you might want to return an owned value
3838
|
3939
LL - async fn i(mut x: impl Iterator<Item = &()>) -> Option<&()> { x.next() }
4040
LL + async fn i(mut x: impl Iterator<Item = &()>) -> Option<()> { x.next() }
@@ -79,7 +79,7 @@ help: consider introducing a named lifetime parameter
7979
|
8080
LL | fn g<'a>(mut x: impl Foo) -> Option<&'a ()> { x.next() }
8181
| ++++ ~~~
82-
help: ...or alternatively, to want to return an owned value
82+
help: alternatively, you might want to return an owned value
8383
|
8484
LL - fn g(mut x: impl Foo) -> Option<&()> { x.next() }
8585
LL + fn g(mut x: impl Foo) -> Option<()> { x.next() }
@@ -100,7 +100,7 @@ help: consider introducing a named lifetime parameter
100100
|
101101
LL | fn g<'a>(mut x: impl Foo<()>) -> Option<&'a ()> { x.next() }
102102
| ++++ ~~~
103-
help: ...or alternatively, to want to return an owned value
103+
help: alternatively, you might want to return an owned value
104104
|
105105
LL - fn g(mut x: impl Foo<()>) -> Option<&()> { x.next() }
106106
LL + fn g(mut x: impl Foo<()>) -> Option<()> { x.next() }

tests/ui/suggestions/return-elided-lifetime.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ help: instead, you are more likely to want to change one of the arguments to be
4444
|
4545
LL | fn f2(a: &i32, b: &i32) -> &i32 { loop {} }
4646
| + +
47-
help: ...or alternatively, to want to return an owned value
47+
help: ...or alternatively, you might want to return an owned value
4848
|
4949
LL - fn f2(a: i32, b: i32) -> &i32 { loop {} }
5050
LL + fn f2(a: i32, b: i32) -> i32 { loop {} }

0 commit comments

Comments
 (0)