Commit graph

28 commits

Author SHA1 Message Date
Albert Larsan cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00
akida31 f780faa8c4
reduce to single suggestion for all arguments 2022-12-13 16:30:04 +01:00
akida31 7822822d51
change error message 2022-12-13 16:29:10 +01:00
akida31 e326e8c885
Remove hint from help message 2022-12-13 16:28:31 +01:00
akida31 e50f5756aa
Fix stderr of tests which have improved diagnostics 2022-12-13 16:27:21 +01:00
b-naber 6118ee343f address review 2022-09-26 14:21:39 +02:00
Maybe Waffle 7da578b8f8 --bless tests 2022-07-28 20:15:24 +04:00
Esteban Küber 39f220ce12 Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00: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
Esteban Küber d605a9d969 Small tweaks to required bound span 2020-04-08 14:40:51 -07:00
Reese Williams 7693bb9e1d Add long error for E0631 and update ui tests. 2019-12-02 22:01:27 -05:00
Esteban Küber 13e9b3deb4 Deduplicate closure type errors
Closure typing obligations flow in both direcitons to properly infer
types. Because of this, we will get 2 type errors whenever there's
an unfulfilled obligation. To avoid this, we deduplicate them in the
`InferCtxt`.
2019-09-30 17:48:22 -07:00
Esteban Küber c9d05aa9ce Point at correct span for parenthesized types 2019-09-22 11:33:12 -07:00
Esteban Küber b370c111fd On obligation errors point at the unfulfilled binding when possible 2019-09-22 11:33:12 -07:00
Esteban Küber 444bc3ca66 Use span label instead of note for cause in E0631 2019-08-31 00:14:23 -07:00
memoryruins eb4580a570 Update ui test suite to use dyn 2019-05-29 00:57:31 -04: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
Niko Matsakis 21e9478366 update test files to reflect new output
One surprise: old-lub-glb-object.rs, may indicate a bug
2019-02-21 11:32:17 -05:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Zack M. Davis 4b1808578a add dyn to display of dynamic (trait) type names
The `dyn Trait` syntax was stabilized in 199ee327. Resolves #49277.
2018-06-23 18:10:25 -07:00
Guillaume Gomez 2e104a77cf update tests 2018-03-14 00:53:24 +01:00
Vadim Petrochenkov fa2d9fc4b9 Update UI tests 2018-02-26 20:24:02 +03:00
Guillaume Gomez 5747fd6611 Update ui tests 2018-02-25 12:15:05 +01:00
Esteban Küber 9b36030a65 On E0283, point at method with the requirements
On required type annotation diagnostic error, point at method with the
requirements if the span is available.
2018-01-15 14:56:32 -08:00
Esteban Küber 8ee82d08ac Point at whole method call instead of args
To avoid confusion in cases where the code is

```rust
fn foo() {}
/ foo(
|     bar()
|     ^^^ current diagnostics point here for arg count mismatch
| );
|_^ new diagnostic span points here
```

as this leads to confusion making people think that the diagnostic is
talking about `bar`'s arg count, not `foo`'s.

Point at `fn`s definition on arg mismatch, just like we do for closures.
2017-12-10 13:37:12 -08:00
Oliver Schneider 8937d6a6cf
Merge cfail and ui tests into ui tests 2017-11-24 11:32:35 +01:00
Wonwoo Choi 9b0480bec6 Name higher-ranked lifetimes properly while displaying
Now they don't shadow other lifetimes.
2017-10-08 20:53:14 +09:00