Skip to content

Commit b312b66

Browse files
committed
Tweak wording
1 parent d1de8c2 commit b312b66

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

compiler/rustc_resolve/src/late/diagnostics.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2813,7 +2813,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
28132813
sugg,
28142814
Applicability::MaybeIncorrect,
28152815
);
2816-
"...or alternatively,"
2816+
"...or alternatively, you might want"
28172817
} else if let Some((kind, _span)) =
28182818
self.diagnostic_metadata.current_function
28192819
&& let FnKind::Fn(_, _, sig, _, _, _) = kind
@@ -2871,9 +2871,9 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
28712871
higher_ranked
28722872
},
28732873
);
2874-
"...or alternatively,"
2874+
"alternatively, you might want"
28752875
} else {
2876-
"instead, you are more likely"
2876+
"instead, you are more likely to want"
28772877
};
28782878
let mut sugg = vec![(lt.span, String::new())];
28792879
if let Some((kind, _span)) =
@@ -2906,7 +2906,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
29062906
}
29072907
};
29082908
err.multipart_suggestion_verbose(
2909-
format!("{pre} to want to return an owned value"),
2909+
format!("{pre} to return an owned value"),
29102910
sugg,
29112911
Applicability::MaybeIncorrect,
29122912
);

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

+1-1
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

+1-1
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

+4-4
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

+1-1
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

+4-4
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

+1-1
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)