Commit graph

33 commits

Author SHA1 Message Date
Nilstrieb
2c7d32b4f4
Use type_ascribe! in many UI tests
Use it in all UI tests that are about the semantics and not the syntax
of type ascription.
2022-11-19 22:16:42 +01:00
Maybe Waffle
13b67fb9d2 bless ui tests 2022-10-01 10:03:06 +00:00
Bryysen
4ee2fe308b Further improve error message for E0081
Multiple duplicate assignments of the same discriminant are now reported
in the samme error. We now point out the incrementation start point for
discriminants that are not explicitly assigned that are also duplicates.
Removed old test related to E0081 that is now covered by error-codes/E0081.rs.
Also refactored parts of the `check_enum` function.
2022-08-07 17:43:52 +02:00
Michael Goulet
aad2334ecb Make item spans more consistent 2022-07-15 03:17:20 +00:00
Deadbeef
2f0ccdfbba suggest adding a derive for #[default] applied to variants 2022-07-07 04:57:01 +00:00
Takayuki Maeda
eb80407d79 suggest #[derive(Default)] to enums with #[default] 2022-07-04 20:46:59 +09:00
Bryysen
f671bc969f Improve error message for E0081
Previously whenever a duplicate discriminant was detected for an Enum,
we would print the discriminant bits in the diagnostic without any
casting. This caused us to display incorrect values for negative
discriminants. After this PR we format the discriminant signedness
correctly. Also reworded some of the original error
messages.
2022-05-28 23:05:45 +02:00
Caio
7fd15f0900 Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
lcnr
0c28e028b6 feature(const_generics) -> feature(const_param_types) 2021-08-30 11:00:21 +02:00
Ellen
fcc2badf9b rename const_evaluatable_checked to generic_const_exprs
2021-08-30 11:00:21 +02:00
Maarten de Vries
4c0ff4db80 Show discriminant before overflow in diagnostic. 2021-07-28 10:04:23 +02:00
kadmin
50c86db4fa Add help message for unused type param 2021-05-01 21:58:06 +00:00
Guillaume Gomez
ec007845cf
Rollup merge of #79981 - camelid:overflowing_literals-inference-error, r=lcnr
Add 'consider using' message to overflowing_literals

Fixes #79744.

Ironically, the `overflowing_literals` handler for binary or hex already
had this message! You would think it would be the other way around :)

cc ```@scottmcm```
2021-02-17 20:37:48 +01:00
Camelid
a9b16c6d71 Improve error and help messages 2021-02-13 21:42:32 -08:00
Bastian Kauschke
c4ba60a191 update tests 2020-12-26 18:24:10 +01:00
Camelid
d00ca11202 Add 'consider using' message to overflowing_literals
Ironically, the overflowing_literals handler for binary or hex already
had this message! You would think it would be the other way around :)
2020-12-12 14:59:35 -08:00
Yuki Okushi
f22bc7b1cf
Add some tests for #67945 2020-05-07 02:22:08 +09:00
RoccoDev
b85c64c3ea
rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
YI
a4ffbaadc8 Add more context to the literal overflow message 2020-03-15 11:37:43 +08:00
varkor
24a2929ed1 Normalise notes with the/is 2020-01-24 16:24:50 +00:00
Kamlesh Kumar
f8ecf04f4b accept union inside enum if not followed by identifier 2019-12-06 10:52:28 +05:30
Janusz Marcinkiewicz
0e660d8a79 Add error reporting on nested keywords inside 'enum' definition 2019-11-23 03:41:12 +01:00
Guillaume Gomez
7d357fbffd update ui tests 2019-10-16 13:56:14 +02:00
varkor
218982bef0 Place types inside backticks 2019-04-30 22:43:51 +01:00
Andy Russell
b6f148c8bd
hide --explain hint if error has no extended info 2019-04-18 13:29:28 -04: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
bors
14b96659e4 Auto merge of #57088 - euclio:non-camel-case-early-lint, r=estebank
make non_camel_case_types an early lint

This allows us to catch these kinds of style violations much earlier, as evidenced by the large number of tests that had to be updated for this change.
2018-12-25 16:12:24 +00:00
Andy Russell
6474de904c
make non_camel_case_types an early lint 2018-12-24 12:58:52 -05:00
Zack M. Davis
3986c96448 enum type instead of variant suggestion unification
Weirdly, we were deciding between a help note and a structured
suggestion based on whether the import candidate span was a dummy—but
we weren't using that span in any case! The dummy-ness of the span
(which appears to be a matter of this-crate vs. other-crate
definition) isn't the right criterion by which we should decide
whether it's germane to mention that "there is an enum variant";
instead, let's use the someness of `def` (which is used as the
`has_unexpected_resolution` argument to `error_code`).

Since `import_candidate_to_paths` has no other callers, we are free to
stop returning the span and rename the function. By using
`span_suggestions_`, we leverage the max-suggestions output limit
already built in to the emitter, thus resolving #56028.

In the matter of message wording, "you can" is redundant (and perhaps
too informal); prefer the imperative.
2018-12-22 17:40:48 -08:00
Vadim Petrochenkov
cfd762954b resolve: Tweak some articles in ambiguity diagnostics 2018-11-18 13:57:03 +03:00
Vadim Petrochenkov
c56adf6413 cleanup: Add main functions to some UI tests 2018-08-31 18:56:15 +03:00
David Wood
3fc7ab2373
Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00