Commit graph

38 commits

Author SHA1 Message Date
Aaron Hill
0dd9f118d9
Show macro name in 'this error originates in macro' message
When there are multiple macros in use, it can be difficult to tell
which one was responsible for producing an error.
2021-05-12 19:03:06 -04:00
Ryan Levick
cd8392dd99 Fix tests 2021-04-16 11:06:51 +02:00
Ryan Levick
c2d0f1457a Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021 2021-04-08 15:36:27 +02:00
Tomasz Miąsko
62366ee6f1 ./x.py test --bless 2021-02-09 00:00:00 +00:00
Mark Rousskov
4614671cae Update code to account for extern ABI requirement 2021-01-13 07:49:45 -05: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
Amanieu d'Antras
239f833ed1 Abort when catch_unwind catches a foreign exception 2020-08-27 21:08:30 +01:00
David Wood
664ecf1085
hir: simplify is_range_literal
This commit simplifies `is_range_literal` by checking for
`QPath::LangItem` containing range-related lang items, rather than using
a heuristic.

Co-authored-by: Matthew Jasper <mjjasper1@gmail.com>
Signed-off-by: David Wood <david@davidtw.co>
2020-08-16 15:42:27 +01:00
Esteban Küber
b7db6bb5af Remove Sized on_unimplemented note 2020-07-14 10:50:24 -07:00
Yuki Okushi
ec31b4e3a8
Audit uses of span_suggestion_short 2020-07-02 15:18:33 +09:00
Ayaz Hafiz
7930f9a368
Change heuristic for determining range literal
Currently, rustc uses a heuristic to determine if a range expression is
not a literal based on whether the expression looks like a function call
or struct initialization. This fails for range literals whose
lower/upper bounds are the results of function calls. A possibly-better
heuristic is to check if the expression contains `..`, required in range
literals.

Of course, this is also not perfect; for example, if the range
expression is a struct which includes some text with `..` this will
fail, but in general I believe it is a better heuristic.

A better alternative altogether is to add the `QPath::LangItem` enum
variant suggested in #60607. I would be happy to do this as a precursor
to this patch if someone is able to provide general suggestions on how
usages of `QPath` need to be changed later in the compiler with the
`LangItem` variant.

Closes #73553
2020-06-22 20:52:44 -07:00
RoccoDev
b85c64c3ea
rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
Amanieu d'Antras
f4f91f0b2f Remove eh_unwind_resume lang item 2020-03-05 17:36:50 +00:00
Eduard-Mihai Burtescu
4c7eb59e81 rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
varkor
24a2929ed1 Normalise notes with the/is 2020-01-24 16:24:50 +00:00
Vadim Petrochenkov
642669c74d Update tests 2020-01-09 21:23:12 +03:00
Esteban Küber
6f8f70624b Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
Esteban Küber
83ffda5216 Specific labels when referring to "expected" and "found" types 2019-11-18 11:02:22 -08:00
Yuki Okushi
c004451a20 Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
varkor
7f0f0e31ec Remove double trailing newlines 2019-04-22 16:57:01 +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
Corey Farwell
d2c91a1a6d Fix broken links to second edition TRPL.
Fixes https://github.com/rust-lang/rust/issues/57104.
2019-01-01 12:53:07 -05:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Pietro Albini
3c7acc7878
Rollup merge of #55852 - varkor:dotdotequals-lint, r=zackmdavis
Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint

Fixes https://github.com/rust-lang/rust/issues/51043.
2018-11-15 11:04:40 +01:00
varkor
c63df7c64f Use non-short suggestion for parenthesised ..= 2018-11-10 21:27:40 +00:00
varkor
c148714549 Rewrite ... as ..= as a MachineApplicable 2018 idiom lint 2018-11-10 19:26:49 +00:00
bors
06118eac4c Auto merge of #55626 - nikic:update-emscripten, r=alexcrichton
Update emscripten

This updates emscripten to 1.38.15, which is based on LLVM 6.0.1 and would allow us to drop code for handling LLVM 4.

The main issue I ran into is that exporting statics through `EXPORTED_FUNCTIONS` no longer works. As far as I understand exporting non-functions doesn't really make sense under emscripten anyway, so I've modified the symbol export code to not even try.

Closes #52323.
2018-11-10 01:16:02 +00:00
Nikita Popov
b1a33971ab Fix some tests for wasm32-unknown-emscripten 2018-11-08 18:17:57 +01:00
Felix S. Klock II
a2e090624e Removed #[rustc_error] from tests that are all // compile-pass.
I also added `// skip-codegen` to each one, to address potential concerns
that this change would otherwise slow down our test suite spending time
generating code for files that are really just meant to be checks of
compiler diagnostics.

(However, I will say: My preference is to not use `// skip-codegen` if
one can avoid it. We can use all the testing of how we drive LLVM that
we can get...)

(Updated post rebase.)
2018-11-07 13:09:52 +01:00
Paweł Romanowski
1f7dafbb77 Fix test for windows os 2018-10-09 08:24:29 +02:00
Paweł Romanowski
882e373275 Attempt to fix #54505 tests for wasm 2018-10-08 18:39:09 +02:00
Paweł Romanowski
87bf9e2056 Address review comments 2018-10-02 22:10:04 +01:00
Paweł Romanowski
f7d35cc5a8 Fix range borrowing suggestions logic 2018-10-02 00:17:13 +01:00
Paweł Romanowski
0626afbcd2 First stab at fixing #54505 2018-09-29 15:18:27 +01:00
David Wood
3fc7ab2373
Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00