Esteban Kuber
83ce1aad42
Tweak wording
2021-12-10 03:08:25 +00:00
Esteban Kuber
10a74ac2e0
Use a more accurate Span for 'static obligation from return type
2021-12-10 03:08:24 +00:00
Esteban Kuber
ee0fd105d8
Point at return type when it introduces 'static obligation
2021-12-10 03:08:23 +00:00
Esteban Kuber
dd81e98466
Clean up visual output logic
2021-12-10 03:08:22 +00:00
Nilstrieb
4b9e4606cb
Add beginner friendly lifetime elision hint to E0623
...
Suggest adding a new lifetime parameter when two elided lifetimes should match up but don't
Issue #90170
This also changes the tests introduced by the previous commits because of another rustc issue (#90258 )
2021-11-03 20:10:44 +01:00
Esteban Kuber
14add46e94
Use more accurate spans when proposing adding lifetime to item
2021-08-18 10:25:15 +00:00
Esteban Küber
99f2977031
Modify structured suggestion output
...
* On suggestions that include deletions, use a diff inspired output format
* When suggesting addition, use `+` as underline
* Color highlight modified span
2021-08-11 09:46:24 +00:00
Esteban Küber
7bf39fa9d9
Further tweak wording of E0759 and introduce E0767
2020-07-22 12:25:54 -07:00
Esteban Küber
f7a1f97307
Change E0758 to E0759 to avoid conflict with #72912
2020-06-15 09:06:58 -07:00
Esteban Küber
e31367de6b
small tweaks
2020-06-15 09:06:58 -07:00
Esteban Küber
34d8692262
Register new eror code
2020-06-15 09:06:58 -07:00
Esteban Küber
31ea589a06
review comments: wording
2020-06-15 09:06:58 -07:00
Esteban Küber
539e9783df
Tweak wording and add error code
2020-06-15 09:06:57 -07:00
Esteban Küber
921f35fe73
Reduce verbosity of suggestion message and mention lifetime in label
2020-06-15 09:06:57 -07:00
Esteban Küber
4e90f177cc
When 'static is explicit, suggest constraining argument with it
2020-06-15 09:06:57 -07:00
Esteban Küber
83f6f22358
Tweak wording and spans of 'static dyn Trait/impl Trait requirements
2020-05-30 10:22:27 -07:00
Esteban Küber
1d9472b470
Update nll tests
2020-05-30 10:22:26 -07:00
Esteban Küber
731ea85f21
review comment: tweak wording and account for span overlap
2020-05-30 10:22:26 -07:00
Esteban Küber
65f492be12
Account for returned dyn Trait evaluating to 'static lifetime
...
Provide a suggestion for `dyn Trait + '_` when possible.
2020-05-30 10:22:26 -07:00
Esteban Küber
a724d9a4fb
Fix NLL output
2020-05-30 10:21:58 -07:00
Esteban Küber
99d9ccd547
Improve output of argument anonymous borrow missing annotation involving opaque return type
...
Go from
```
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> file8.rs:22:5
|
22 | / move || {
23 | | *dest = g.get();
24 | | }
| |_____^
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the function body at 18:1...
--> file8.rs:18:1
|
18 | / fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
19 | | where
20 | | G: Get<T>
21 | | {
... |
24 | | }
25 | | }
| |_^
note: ...so that the types are compatible
--> file8.rs:22:5
|
22 | / move || { //~ ERROR cannot infer an appropriate lifetime
23 | | *dest = g.get();
24 | | }
| |_____^
= note: expected `&mut T`
found `&mut T`
note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 18:8...
--> file8.rs:18:8
|
18 | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ^^
note: ...so that return value is valid for the call
--> file8.rs:18:45
|
18 | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ^^^^^^^^^^^^^^^^^^^^^^^
```
to
```
error[E0621]: explicit lifetime required in the type of `dest`
--> file8.rs:18:45
|
18 | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ------ ^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
| |
| help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T`
```
2020-05-30 10:21:58 -07:00
Esteban Küber
3fea832fd7
Fix spacing of expected/found notes without a label
2020-05-27 16:27:15 -07:00
Jade McGough
5320bd986b
add long error explanation for E0228
2020-05-12 17:09:09 -07:00
Esteban Küber
1f43fc0209
Tweak wording
2020-04-22 12:12:33 -07:00
Esteban Küber
13c1daeb2f
Tweak 'static suggestion code
...
Fix #71196 .
2020-04-22 12:12:33 -07:00
Josh White
8b77f8688e
performed --bless of 15 ui tests affected
2020-02-07 12:44:31 -05:00
Esteban Küber
92505df338
Account for fn() types in lifetime suggestions
2020-02-05 10:32:01 -08:00
Esteban Küber
ba3b44c508
Account for '_ in suggestions
2020-02-05 10:32:01 -08:00
Esteban Küber
2100b31535
review comments
2020-02-05 10:32:01 -08:00
Esteban Küber
fa4594196d
Suggest 'r instead of 'lifetime
2020-02-05 10:32:01 -08:00
Esteban Küber
7e1464336a
When suggesting lifetimes, propose adding the new lifetime to all arguments
2020-02-05 10:32:01 -08:00
Esteban Küber
70dbf5526d
Use spans for input borrowed types unrelated to return type
2020-02-05 10:32:01 -08:00
Esteban Küber
2102723887
review comments
2020-01-19 17:31:34 -08:00
Esteban Küber
78d3ea5484
When encountering an expected named lifetime and none are present, suggest adding one
2020-01-19 17:31:33 -08:00
Aaron Hill
168e35d569
Include a span in more expected...found notes
...
In most places, we use a span when emitting `expected...found` errors.
However, there were a couple of places where we didn't use any span,
resulting in hard-to-interpret error messages.
This commit attaches the relevant span to these notes, and additionally
switches over to using `note_expected_found` instead of manually
formatting the message
2019-12-03 23:13:10 -05:00
Dylan MacKenzie
ae2293837e
Change some tests to use the shorter comment style
2019-11-21 14:09:18 -08:00
Guillaume Gomez
ffc1c5a04d
Update ui tests
2019-11-07 13:02:34 +01:00
Guillaume Gomez
96efaad342
update ui tests
2019-10-07 17:12:54 +02:00
David Wood
5e3b41e0cb
rustc: remove HirId from ArgSource::AsyncFn
...
This commit removes the `HirId` from `ArgSource::AsyncFn`, relying on
the fact that only `simple_ident` is used in each of the locations that
previously took the original pattern from the `ArgSource::AsyncFn`.
2019-06-03 14:02:21 +01:00
memoryruins
eb4580a570
Update ui test suite to use dyn
2019-05-29 00:57:31 -04:00
Matthew Jasper
ff71b80a85
Change compare mode to use -Zborrowck=mir
2019-05-12 18:46:43 +01:00
Andy Russell
b6f148c8bd
hide --explain hint if error has no extended info
2019-04-18 13:29:28 -04:00
Eduard-Mihai Burtescu
22d6c55cdf
rustc: print ExistentialProjection with spaces around =, e.g. dyn Foo<A = X>.
2019-03-15 13:25:10 +02:00
Vadim Petrochenkov
fa72a81bea
Update tests
2019-03-11 23:10:26 +03:00
Mark Rousskov
2a663555dd
Remove licenses
2018-12-25 21:08:33 -07:00
Oliver Scherer
61efc3b71b
Update tests
2018-12-04 10:06:05 +01:00
Pietro Albini
f50e285e30
Rollup merge of #55173 - estebank:suggest-static, r=oli-obk
...
Suggest appropriate syntax on missing lifetime specifier in return type
Suggest using `'static` when a lifetime is missing in the return type
with a structured suggestion instead of a note.
Fix #55170 .
2018-10-25 14:31:03 +02:00
Esteban Küber
d0bd69a2d5
review comments
2018-10-22 14:56:02 -07:00
Esteban Küber
e1e52eb5a0
Suggest appropriate syntax on missing lifetime specifier in return type
...
Suggest using `'static` when a lifetime is missing in the return type
with a structured suggestion instead of a note.
2018-10-22 14:54:29 -07:00
Scott McMurray
18f7db3d69
impl<'_> IceCube<'_> {} is now only one error in both editions
2018-10-19 22:57:41 -07:00