Commit graph

35 commits

Author SHA1 Message Date
Albert Larsan
cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00
Esteban Küber
73b371a16c Further tweak the type shortening logic 2022-11-28 14:08:19 -08:00
Esteban Küber
7674edeeba Detect long types in E0308 and write them to disk
On type error with long types, print an abridged type and write the full
type to disk.

Print the widest possible short type while still fitting in the
terminal.
2022-11-28 14:08:18 -08:00
Esteban Küber
4ed1376490 On E0275 do not print out the full type in the msg
When printing requirement overflow errors, do not print out the full
type name when it is longer than 50 characters long.
2022-11-18 08:46:47 -08:00
Esteban Küber
787e633d1a On overflow errors, do not print out long types 2022-11-18 08:46:47 -08:00
Andy Wang
84a199369b
Reword "Required because of the requirements on the impl of ..." 2022-08-18 21:08:08 +01:00
Camille GILLOT
9ae2546907 Only keep a single well-formed query. 2022-06-21 23:56:17 +02:00
Esteban Kuber
6b9d910639 Point at source of trait bound obligations in more places
Be more thorough in using `ItemObligation` and `BindingObligation` when
evaluating obligations so that we can point at trait bounds that
introduced unfulfilled obligations. We no longer incorrectly point at
unrelated trait bounds (`substs-ppaux.verbose.stderr`).

In particular, we now point at trait bounds on method calls.

We no longer point at "obvious" obligation sources (we no longer have a
note pointing at `Trait` saying "required by a bound in `Trait`", like
in `associated-types-no-suitable-supertrait*`).

Address part of #89418.
2021-11-20 18:54:31 +00:00
Ross MacArthur
d2613fb7a5
Improve help for recursion limit errors 2021-09-28 22:17:13 +02:00
Esteban Küber
39f220ce12 Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
Camille GILLOT
da43aa61c1 Bless tests. 2021-07-25 12:23:37 +02:00
kadmin
50c86db4fa Add help message for unused type param 2021-05-01 21:58:06 +00:00
Esteban Küber
8bc5581978 Point at impl and type defs introducing requirements on E0277 2021-04-06 19:55:44 -07:00
Esteban Küber
352796402f Account for indirect cyclic requirements 2020-11-18 09:06:18 -08:00
Esteban Küber
2098ade771 Remove redundant notes in E0275
Fix #58964.
2020-11-18 09:05:48 -08: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
David Wood
a54ed872cb
standardize limit comparisons with Limit type
This commit introduces a `Limit` type which is used to ensure that all
comparisons against limits within the compiler are consistent (which can
result in ICEs if they aren't).

Signed-off-by: David Wood <david@davidtw.co>
2020-05-28 10:33:07 +01:00
Esteban Küber
bd7ea5441e Use PredicateObligations instead of Predicates
Keep more information about trait binding failures.
2020-04-08 14:40:45 -07:00
Mazdak Farrokhzad
01dd376ded #![recursion_limit = "X"]: note current crate name. 2020-02-05 03:24:43 +01:00
Esteban Küber
6870f79e9c Use more accurate failed predicate spans 2020-02-02 11:53:09 -08:00
Esteban Küber
fca5c64abd Point at arguments or output when fn obligations come from them, or ident when they don't 2020-02-02 11:52:33 -08:00
Ben Boeckel
126bf3b1dd typo: fix typo in E0392
See #64931.
2019-10-03 09:22:29 -04:00
Esteban Küber
a180294f8b review comment 2019-10-02 14:34:29 -07:00
Esteban Küber
5cbe6aa6ca Reword E0392 slightly
Make it clearer that a type or lifetime argument not being used can be
fixed by referencing it in a struct's fields, not just using `PhathomData`.
2019-09-30 13:35:26 -07:00
Esteban Küber
444bc3ca66 Use span label instead of note for cause in E0631 2019-08-31 00:14:23 -07:00
Simonas Kazlauskas
7e40df3f13 Raise the default recursion limit to 128 2019-07-07 00:12:35 +03:00
Mazdak Farrokhzad
2d6150a762
Rollup merge of #60052 - varkor:unused-parameter-diagnostic, r=estebank
Correct unused parameter diagnostic

The message was incorrect for unused lifetime parameters. There's no need to be specific.
2019-04-19 06:03:17 +02:00
varkor
048ba28ad1 Update tests 2019-04-18 18:35:18 +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
John Kåre Alsaker
01f7450ae4 Update tests 2019-03-06 04:47:08 +01:00
Aaron Hill
9b68dcd32a
Don't explicitly increment the depth for new trait predicates 2019-01-16 12:55:22 -05:00
Aaron Hill
b1a8da6e61
Improve error generation, fixup recursion limits 2019-01-03 21:58:57 -05:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
David Wood
3fc7ab2373
Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
Renamed from src/test/ui/issue-20413.stderr (Browse further)