Commit graph

61 commits

Author SHA1 Message Date
bors
e8423e6c44 Auto merge of #91033 - JohnTitor:rollup-sr9zg6o, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #89258 (Make char conversion functions unstably const)
 - #90578 (add const generics test)
 - #90633 (Refactor single variant `Candidate` enum into a struct)
 - #90800 (bootstap: create .cargo/config only if not present)
 - #90942 (windows: Return the "Not Found" error when a path is empty)
 - #90947 (Move some tests to more reasonable directories - 9.5)
 - #90961 (Suggest removal of arguments for unit variant, not replacement)
 - #90990 (Arenas cleanup)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-11-19 06:13:29 +00:00
bors
ce3f3a5ffa Auto merge of #90329 - nbdd0121:typeck, r=nagisa
Try all stable method candidates first before trying unstable ones

Currently we try methods in this order in each step:
* Stable by value
* Unstable by value
* Stable autoref
* Unstable autoref
* ...

This PR changes it to first try pick methods without any unstable candidates, and if none is found, try again to pick unstable ones.

Fix #90320
CC #88971, hopefully would allow us to rename the "unstable_*" methods for integer impls back.

`@rustbot` label T-compiler T-libs-api
2021-11-19 03:00:46 +00:00
Caio
41d9abd76c Move some tests to more reasonable directories 2021-11-18 12:09:34 -03:00
Gary Guo
6ad626fb5c Add regression test for issue 90320 2021-11-15 02:14:54 +00:00
Caio
ab5434f9b8 Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
Caio
7fd15f0900 Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
Esteban Kuber
ef212e7fb3 Point at overlapping impls when type annotations are needed 2021-10-24 18:33:04 +00:00
Cameron Steffen
90f4521cfd Bless tests 2021-10-15 02:36:58 -05:00
Yuki Okushi
378300a63d
Make diagnostics clearer for ? operators 2021-09-17 13:13:28 +09:00
Esteban Küber
39f220ce12 Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
bors
fa2692990c Auto merge of #87600 - JohnTitor:classify-ui-tests, r=petrochenkov
Move some UI tests to more suitable subdirs

The classifui result: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427/e06c42226c6038da91e403c33b9947843420cf44

Some notes:
- backtrace-debuginfo.rs: previously I skipped this, I'm still not sure what the best dir is. Any ideas?
- estr-subtyping.rs: Seems a quite old test so removed, shouldn't?
- deref-suggestion.rs: moved to inference as `suggestions` is not an ideal dir.
- issue-43023.rs: a bit misclassified, moved to `derives`

cc #73494
r? `@petrochenkov`
2021-08-14 09:25:33 +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
Yuki Okushi
b7b0291147
Move some UI tests to more suitable subdirs 2021-08-10 13:34:05 +09:00
Yuki Okushi
14e92d7116
Do not suggest impl traits as type arguments 2021-08-03 20:05:50 +09:00
kadmin
8759f00c73 Actually infer args in visitors 2021-07-26 21:15:18 +00:00
Santiago Pastorino
962ac8183d
Remove impl_trait_in_bindings handling on inference error reporting 2021-07-18 09:30:09 -03:00
Yuki Okushi
bc6514e336
Add a regression test for issue-70703 2021-07-02 08:33:47 +09:00
Ryan Levick
7b3940f44b Address PR feedback 2021-06-25 14:51:56 +02:00
Ryan Levick
23176f60e7 Change how edition based future compatibility warnings are handled 2021-06-25 14:51:56 +02:00
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