Santiago Pastorino
e049ba0808
Make tidy happy
2020-10-27 14:45:34 -03:00
Santiago Pastorino
953d7a64a5
Add unsized_locals to INCOMPLETE_FEATURES list
2020-10-27 14:45:28 -03:00
Santiago Pastorino
708fc3b1a2
Add unsized_fn_params feature
2020-10-27 14:45:02 -03:00
bors
78307d8700
Auto merge of #77278 - camelid:use-correct-article, r=estebank
...
Use correct article in help message for conversion or cast
Before it always used `an`; now it uses the correct article for the type.
2020-10-19 02:19:21 +00:00
Andy Russell
14b2d16c5c
ensure arguments are included in count mismatch span
2020-10-15 10:22:39 -04:00
Camelid
8a6831a7fd
Say "doesn't" instead of "wouldn't" in convert message
2020-09-29 19:27:58 -07:00
Camelid
094f14c554
Add article after "to"
...
Also added missing backtick in "you can cast" message.
2020-09-29 10:30:42 -07:00
Dan Aloni
07e7823c01
pretty: trim paths of unique symbols
...
If a symbol name can only be imported from one place for a type, and
as long as it was not glob-imported anywhere in the current crate, we
can trim its printed path and print only the name.
This has wide implications on error messages with types, for example,
shortening `std::vec::Vec` to just `Vec`, as long as there is no other
`Vec` importable anywhere.
This adds a new '-Z trim-diagnostic-paths=false' option to control this
feature.
On the good path, with no diagnosis printed, we should try to avoid
issuing this query, so we need to prevent trimmed_def_paths query on
several cases.
This change also relies on a previous commit that differentiates
between `Debug` and `Display` on various rustc types, where the latter
is trimmed and presented to the user and the former is not.
2020-09-02 22:26:37 +03:00
Yuki Okushi
a9b64766a4
Tweak wording
2020-07-10 07:24:18 +09:00
Yuki Okushi
6864546049
Add a help to use in_band_lifetimes in nightly
2020-07-10 06:39:46 +09:00
Rustin-Liu
b07e7fe047
Rename AssocKind::Method to AssocKind::Fn
...
Rename fn_has_self_argument to fn_has_self_parameter
Rename AssocItemKind::Method to AssocItemKind::Fn
Refine has_no_input_arg
Refine has_no_input_arg
Revert has_no_input_arg
Refine suggestion_descr
Move as_def_kind into AssocKind
Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
Fix tidy check issue
Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
2020-04-14 07:12:07 +08:00
Yuki Okushi
ef07cf4518
Remove FnCtxt::impl_self_ty
2020-04-13 11:36:37 +09:00
Mazdak Farrokhzad
92885e3a5b
rustc_typeck: remove rustc_hir_pretty usage
2020-03-24 08:38:32 +01:00
Esteban Küber
9175940c92
Use more targetted span for error label
2020-03-22 16:09:42 -07:00
Esteban Küber
94bbd46682
Add span label to primary error span
2020-03-22 11:18:06 -07:00
Esteban Küber
52fbd3e569
Increase verbosity when suggesting subtle code changes
2020-03-22 10:36:45 -07:00
Mark Mansi
b6518f0f66
update tests
2020-03-12 15:47:36 -05:00
Mazdak Farrokhzad
cf2d4236eb
--bless some tests
2020-03-10 07:26:27 +01:00
Mazdak Farrokhzad
f459d2ed99
Rollup merge of #69422 - JohnTitor:remove-unwrap, r=Xanewok
...
Remove use of `unwrap()` from save-analysis
Fix #69409 , fix #69416
2020-03-08 11:51:04 +01:00
Esteban Küber
a9a99df0a2
Do not suggest implementing traits if present in predicates
2020-02-28 11:37:59 -08:00
Esteban Küber
7c29441ef2
Review comments: split requirement text to multiple lines for readability
2020-02-28 11:37:59 -08:00
Esteban Küber
9a64c3f5cb
Show information of chain of bound obligations
...
When the obligation that couldn't be fulfilled is specific to a nested
obligation, maintain both the nested and parent obligations around for
more accurate and detailed error reporting.
2020-02-28 11:37:59 -08:00
Esteban Küber
8119d0853d
Track all predicates in errors, not just trait obligations
...
Surface associated type projection bounds that could not be fulfilled in
E0599 errors. Always present the list of unfulfilled trait bounds,
regardless of whether we're pointing at the ADT or trait that didn't
satisfy it.
2020-02-28 11:37:59 -08:00
Esteban Küber
ad4777dbca
Deduplicate information in E0599
2020-02-28 11:37:59 -08:00
Esteban Küber
5e8707f39d
Reduce vebosity of E0599
2020-02-28 11:37:58 -08:00
Esteban Küber
f037d5ca1b
Add more context to E0599 errors
...
Point at the intermediary unfullfilled trait bounds.
2020-02-28 11:37:58 -08:00
Yuki Okushi
5307edce6f
Tweak tests
2020-02-25 00:28:39 +09:00
Esteban Küber
683ebc2dec
On mismatched argument count point at arguments
2020-02-11 12:42:00 -08:00
Eduard-Mihai Burtescu
4c7eb59e81
rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.
2020-02-06 21:46:38 +02:00
Eduard-Mihai Burtescu
f6fc80206e
rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.
2020-02-06 21:32:07 +02:00
varkor
24a2929ed1
Normalise notes with the/is
2020-01-24 16:24:50 +00:00
Esteban Küber
6ba08755df
When encountering an undefined named lifetime, point to where it can be
...
This doesn't mention that using an existing lifetime is possible, but
that would hopefully be clear as always being an option. The intention
of this is to teach newcomers what the lifetime syntax is.
2020-01-19 17:31:33 -08:00
Esteban Küber
2c5766f2d4
Unify output of "variant not found" errors
2020-01-08 08:05:31 -08:00
Mazdak Farrokhzad
f0eb4b4752
Rollup merge of #67127 - estebank:disambiguate-suggestion, r=varkor
...
Use structured suggestion for disambiguating method calls
Fix #65635 .
2019-12-20 12:17:20 +01:00
Esteban Küber
8c4f1d5f87
review comments
2019-12-11 18:21:52 -08:00
Esteban Küber
3980342f31
Use structured suggestion for disambiguating method calls
...
Fix #65635 .
2019-12-11 17:42:28 -08:00
Esteban Küber
da023c0c6f
Add more context for type parameters
2019-12-11 17:18:43 -08:00
Esteban Küber
34f03c01f6
Point at type in let assignment on type errors
2019-11-21 19:24:31 -08:00
Esteban Küber
6f8f70624b
Surround types with backticks in type errors
2019-11-18 11:03:04 -08:00
Esteban Küber
94c6425464
Remove E0308 note when primary label has all info
2019-11-18 11:03:03 -08:00
Esteban Küber
b2e6aef073
review comments: tweak prefix strings
2019-11-18 11:02:44 -08:00
Esteban Küber
83ffda5216
Specific labels when referring to "expected" and "found" types
2019-11-18 11:02:22 -08:00
Patryk Wychowaniec
273ee611f0
Improve the "try using a variant of the expected type" hint.
2019-10-28 18:43:51 +01:00
Esteban Küber
b26ddb8af3
Point at local similarly named element and tweak references to variants
...
Point at the span for the definition of ADTs internal to the current
crate.
Look at the leading char of the ident to determine whether we're
expecting a likely fn or any of a fn, a tuple struct or a tuple variant.
Turn fn `add_typo_suggestion` into a `Resolver` method.
2019-10-27 11:50:43 -07:00
Esteban Küber
0baf61bfdb
Increase spacing for suggestions in diagnostics
...
Make the spacing between the code snippet and verbose structured
suggestions consistent with note and help messages.
2019-10-24 12:26:01 -07:00
Mazdak Farrokhzad
f34e2b1e7c
Rollup merge of #64735 - GuillaumeGomez:long-err-explanation-E0533, r=Centril
...
Add long error explanation for E0533
Part of https://github.com/rust-lang/rust/issues/61137
2019-09-29 20:34:14 +02:00
Guillaume Gomez
e58e144e66
Update ui tests
2019-09-25 13:10:25 +02:00
Esteban Küber
d9ab4ff9a3
Remove blanket silencing of "type annotation needed" errors
...
Remove blanket check for existence of other errors before emitting
"type annotation needed" errors, and add some eager checks to avoid
adding obligations when they refer to types that reference
`[type error]` in order to reduce unneded errors.
2019-09-24 11:31:14 -07:00
Esteban Küber
5799fb419c
Give method not found a primary span label
2019-09-08 18:27:02 -07:00
sd234678
56ebd57960
Remove meaningless comments in src/test
2019-08-16 10:54:20 +01:00