Commit graph

42 commits

Author SHA1 Message Date
Scott McMurray
4a7ceea930 Better rustc_on_unimplemented, and UI test fixes 2021-05-06 11:37:45 -07:00
Dylan DPC
54ea8e1b82
Rollup merge of #81922 - magurotuna:issue81522, r=matthewjasper
Let `#[allow(unstable_name_collisions)]` work for things other than function

Fixes #81522

In addition to the report in #81522, currently `#[allow(unstable_name_collisions)]` doesn't suppress the corresponding diagnostics even if this attribute is appended to an expression statement or a let statement. It seems like this is because the wrong `HirId` is passed to `struct_span_lint_hir`.
It's fixed in this PR, and a regression test for it is also added.
2021-04-05 13:03:36 +02:00
JohnTitor
7e6fd40614 Do not emit a suggestion that causes the E0632 error 2021-03-30 03:00:25 +09:00
Yusuke Tanaka
a421cfed74
Add regression test to ensure #[allow(unstable_name_collisions)] works 2021-03-24 23:16:55 +09:00
Dylan DPC
c5629131fa
Rollup merge of #81713 - estebank:unstable-assoc-item-lint, r=oli-obk
Account for associated consts in the "unstable assoc item name colission" lint

Fix #81663.
2021-02-25 14:33:53 +01:00
Esteban Küber
e655941241 Account for associated consts in the "unstable assoc item name colission" lint
Fix #81663.
2021-02-24 15:35:16 -08:00
Dan Aloni
eaefe4a230 path trimming: ignore type aliases 2021-02-06 12:03:48 +02:00
William Bain
d46c3e3411 Tweak ? inference error messages 2021-01-10 19:48:11 -05:00
William Bain
0496fdee4f Note inference failures using ? conversion 2021-01-10 19:47:57 -05:00
Yuki Okushi
98e13169ad Add regression test for issue-71732 2020-10-23 16:41:34 +09:00
Yuki Okushi
5b32c84952 Add a regression test for issue-72616 2020-10-23 16:10:19 +09:00
Matthew Jasper
022c148fcd Fix tests from rebase 2020-10-06 11:19:33 +01:00
Matthew Jasper
f958e6c246 Separate bounds and predicates for associated/opaque types 2020-10-06 11:19:29 +01: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
Ralf Jung
6a8cf4a17c adjust tests 2020-05-09 14:40:17 +02: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
RoccoDev
b85c64c3ea
rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
Yuki Okushi
3f7ed88fdc
Rollup merge of #68129 - varkor:infer-binary-operand-behind-reference, r=nikomatsakis
Correct inference of primitive operand type behind binary operation

Fixes https://github.com/rust-lang/rust/issues/57447.

r? @nikomatsakis
2020-02-15 07:17:43 +09:00
Matthias Prechtl
7b555178ae --bless --compare-mode=nll 2020-02-09 20:43:49 +01:00
varkor
0276d7a32e Add more tests 2020-02-09 01:51:13 +00:00
varkor
38060567e8 Correct inference of primitive operand type behind binary operation 2020-02-09 00:47:01 +00:00
Esteban Küber
3980342f31 Use structured suggestion for disambiguating method calls
Fix #65635.
2019-12-11 17:42:28 -08:00
Tomasz Miąsko
427952e808 Make error and warning annotations mandatory in UI tests
This change makes error and warning annotations mandatory in UI tests.
The only exception are tests that use error patterns to match compiler
output and don't have any annotations.
2019-11-10 21:01:02 +01: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
21476e7d6c --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
Mazdak Farrokhzad
228015acd2 Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
Esteban Küber
806476c840 Suggest giving return type to closures on E0282 2019-08-13 16:41:43 -07:00
Esteban Küber
939c1cb349 review comments 2019-08-13 11:24:08 -07:00
Esteban Küber
1e6f753762 Fix tidy 2019-08-12 20:24:26 -07:00
Esteban Küber
3b6d46c640 Resolve types when suggesting boxed closure 2019-08-12 18:12:19 -07:00
Esteban Küber
b8708e2c9a When needing type annotations in local bindings, account for impl Trait and closures
Do not suggest nonsensical types when the type inference is failing on
`impl Trait` or anonymous closures.
2019-08-12 16:50:46 -07:00
Ilija Tovilo
be510dbc35
Adjust tests for method disambiguation help 2019-07-24 03:03:52 +02:00
Samy Kacimi
e5e1397adb
normalize use of backticks in compiler messages for librustc/lint
https://github.com/rust-lang/rust/issues/60532
2019-07-17 22:49:48 +02:00
Samy Kacimi
41e71b0c93
normalize use of backticks in compiler messages for libsyntax/feature_gate
https://github.com/rust-lang/rust/issues/60532
2019-07-09 14:13:28 +02:00
Samy Kacimi
60a49384f5
normalize use of backticks in compiler messages for librustc_typecheck
https://github.com/rust-lang/rust/issues/60532
2019-07-07 18:27:21 +02:00
Yuki Okushi
c004451a20 Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
Esteban Küber
146d040f0b Reword tracking issue note 2019-04-11 11:42:06 -07:00
Esteban Küber
3ab97062cf Tweak unstable diagnostic output 2019-04-10 18:10:30 -07: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
Alexander Regueiro
4151de43aa Updated stderr test files. 2018-09-27 04:20:25 +01:00
David Wood
3fc7ab2373
Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00