Commit Graph

1066 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
5a6fd110b8
Rollup merge of #66007 - estebank:remove-here, r=Centril
Remove "here" from "expected one of X here"
2019-11-08 16:50:35 +01:00
Mazdak Farrokhzad
7ab50e4006
Rollup merge of #65785 - Centril:compat-to-error-2, r=oli-obk
Transition future compat lints to {ERROR, DENY} - Take 2

Follow up to https://github.com/rust-lang/rust/pull/63247 implementing https://github.com/rust-lang/rust/pull/63247#issuecomment-536295992.

- `legacy_ctor_visibility` (ERROR) -- closes #39207
- `legacy_directory_ownership` (ERROR) -- closes #37872
- `safe_extern_static` (ERROR) -- closes #36247
- `parenthesized_params_in_types_and_modules` (ERROR) -- closes #42238
- `duplicate_macro_exports` (ERROR)
- `nested_impl_trait` (ERROR) -- closes #59014
- `ill_formed_attribute_input` (DENY) -- transitions #57571
- `patterns_in_fns_without_body` (DENY) -- transitions #35203

r? @varkor
cc @petrochenkov
2019-11-08 16:50:33 +01:00
Yuki Okushi
9dc5d0ec81
Rollup merge of #66049 - RalfJung:missing-spans, r=alexcrichton
consistent handling of missing sysroot spans

Due to https://github.com/rust-lang/rust/issues/53081, sysroot spans (pointing to code in libcore/libstd/...) fails to print on some x86 runners. This consolidates the ignore directives for that and references the relevant issue.

I also did that for the generated derive-error-span tests -- but there the script and the tests were not entirely in sync any more since https://github.com/rust-lang/rust/pull/64151. Cc @estebank @varkor
2019-11-08 13:42:16 +09:00
Mazdak Farrokhzad
a96811ee9c
Rollup merge of #66087 - tmiasko:ui-mode, r=Centril
Update some build-pass ui tests to use check-pass where applicable

Helps with issue https://github.com/rust-lang/rust/issues/62277.
2019-11-07 14:27:24 +01:00
Mazdak Farrokhzad
379b19c17f
Rollup merge of #63793 - oli-obk:🧹, r=dtolnay
Have tidy ensure that we document all `unsafe` blocks in libcore

cc @rust-lang/libs

I documented a few and added ignore flags on the other files. We can incrementally document the files, but won't regress any files this way.
2019-11-07 14:27:20 +01:00
Tomasz Miąsko
e88db92148 Use -Zsave-analysis when compiling issue-37323.rs 2019-11-07 08:45:57 +01:00
Esteban Küber
52e8ec1432 Remove "here" from "expected one of X here" 2019-11-06 17:26:20 -08:00
Esteban Küber
f545a50ee4 Suggest missing item from trait in impl 2019-11-06 10:00:59 -08:00
bors
3f0e16473d Auto merge of #65134 - davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, r=rkruppe
improper_ctypes: `extern "C"` fns

cc #19834. Fixes #65867.

This pull request implements the change [described in this comment](https://github.com/rust-lang/rust/issues/19834#issuecomment-466671572).

cc @rkruppe @varkor @shepmaster
2019-11-06 12:45:35 +00:00
Mazdak Farrokhzad
8e27c4f312 duplicate_macro_exports -> error 2019-11-06 11:10:37 +01:00
Mazdak Farrokhzad
b54c5781b8 parenthesized_params_in_types_and_modules -> error 2019-11-06 11:10:37 +01:00
Mazdak Farrokhzad
98d2c510dd safe_extern_static -> error 2019-11-06 11:10:36 +01:00
Oliver Scherer
34f7fcb862 Rebase fallout 2019-11-06 11:04:42 +01:00
Mazdak Farrokhzad
e5da1a12e7
Rollup merge of #66054 - petrochenkov:delspan, r=estebank
syntax: Avoid span arithmetic for delimiter tokens

The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it.
Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly.
If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract `1` from the span boundaries.

Fixes https://github.com/rust-lang/rust/issues/62524
r? @estebank
2019-11-06 03:28:09 +01:00
Mazdak Farrokhzad
f746d99f68
Rollup merge of #66014 - dkadashev:47319-type-param-def-location, r=estebank
Show type parameter name and definition in type mismatch error messages

Fixes #47319

r? estebank
2019-11-06 03:28:06 +01:00
Tomasz Miąsko
f736de5dbc Apply review suggestions 2019-11-06 00:00:00 +00:00
David Wood
a515258b35
improper_ctypes: extern "C" fns 2019-11-05 12:44:02 +00:00
Tomasz Miąsko
e8733f7845 Add warning annotations for issue-47094 test 2019-11-04 16:03:46 +01:00
Tomasz Miąsko
0501d8ab0d Use check-pass in ui tests where appropriate 2019-11-04 16:03:46 +01:00
Tomasz Miąsko
045fdd9fa9 Use build-pass in ui tests where appropriate 2019-11-04 16:03:46 +01:00
Tomasz Miąsko
a03474bc54 Use run-pass for ui tests where appropriate 2019-11-04 13:57:42 +01:00
Tomasz Miąsko
a99fba5bc5 Remove no longer useful ui test 2019-11-04 13:57:42 +01:00
bors
f49f388713 Auto merge of #65838 - estebank:resilient-recovery, r=Centril
Reduce amount of errors given unclosed delimiter

When in a file with a non-terminated item, catch the error and consume
the block instead of trying to recover it on a more granular way in order to
reduce the amount of unrelated errors that would be fixed after adding
the missing closing brace. Also point out the possible location of the
missing closing brace.

Fix #63690.
2019-11-04 02:30:45 +00:00
Vadim Petrochenkov
90f891d8ae syntax: Avoid span arithmetics for delimiter tokens 2019-11-03 14:58:12 +03:00
Ralf Jung
05c07916ed consistent handling of missing sysroot spans 2019-11-02 23:15:45 +01:00
Tomasz Miąsko
dae4c6e722 Update error annotations in tests that successfully compile
Those annotation are silently ignored rather than begin validated
against compiler output. Update them before validation is enabled,
to avoid test failures.
2019-11-02 10:28:29 +01:00
Dmitry Kadashev
4e10b75951 Update tests
Update the tests to reflect changes to how type mismatch errors are
reported (two previous commits).
2019-11-02 13:23:28 +07:00
Ohad Ravid
8bb5450128 Fix incorrect diagnostics for expected type in E0271 with an associated type 2019-10-31 09:30:14 +01:00
Esteban Küber
053a09529a Reduce ammount of errors given unclosed delimiter
When in a file with a non-terminated item, catch the error and consume
the block instead of trying to recover it more granularly in order to
reduce the amount of unrelated errors that would be fixed after adding
the missing closing brace. Also point out the possible location of the
missing closing brace.
2019-10-30 12:05:17 -07:00
Tyler Mandry
8aa23125bb
Rollup merge of #65832 - tlively:emscripten-exception-handling, r=alexcrichton
Re-enable Emscripten's exception handling support

Passes LLVM codegen and Emscripten link-time flags for exception
handling if and only if the panic strategy is `unwind`. Sets the
default panic strategy for Emscripten targets to `unwind`. Re-enables
tests that depend on unwinding support for Emscripten, including
`should_panic` tests.

r? @alexcrichton
2019-10-29 12:01:38 -07:00
Mazdak Farrokhzad
9c5b6b2201
Rollup merge of #65562 - Patryk27:master, r=estebank
Improve the "try using a variant of the expected type" hint.

Fix https://github.com/rust-lang/rust/issues/65494.

- Change type-printing output.
- Use `span_to_snippet` when possible.
- Change the message to `try using a variant of the expected enum`
2019-10-29 04:08:21 +01:00
Mazdak Farrokhzad
b07e8ed825
Rollup merge of #65318 - estebank:coherence, r=varkor
Call out the types that are non local on E0117

CC #24745.
2019-10-29 04:08:19 +01:00
Mazdak Farrokhzad
42d4e261a1
Rollup merge of #65294 - varkor:lint-inline-prototype, r=matthewjasper
Lint ignored `#[inline]` on function prototypes

Fixes https://github.com/rust-lang/rust/issues/51280.

- Adds a `unused_attribute` lint for `#[inline]` on function prototypes.
- As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).
2019-10-29 04:08:18 +01:00
Mazdak Farrokhzad
2fe6f22dea
Rollup merge of #65640 - estebank:recover-missing-semi, r=Centril
Use heuristics to recover parsing of missing `;`

- Detect `,` and `:` typos where `;` was intended.
- When the next token could have been the start of a new statement,
  detect a missing semicolon.

Fix #48160, fix #44767 (after adding note about statements).
2019-10-28 21:35:58 +01:00
Esteban Küber
1b0836df6f Tweak unexpected token wording 2019-10-28 10:53:13 -07:00
Patryk Wychowaniec
273ee611f0
Improve the "try using a variant of the expected type" hint. 2019-10-28 18:43:51 +01:00
Esteban Küber
9b4f811b7f Use more targeted spans for orphan rule errors 2019-10-28 09:57:36 -07:00
Esteban Küber
b26ddb8af3 Point at local similarly named element and tweak references to variants
Point at the span for the definition of ADTs internal to the current
crate.

Look at the leading char of the ident to determine whether we're
expecting a likely fn or any of a fn, a tuple struct or a tuple variant.

Turn fn `add_typo_suggestion` into a `Resolver` method.
2019-10-27 11:50:43 -07:00
bors
cf148a717a Auto merge of #65288 - estebank:point-at-assoc-type, r=nikomatsakis
Point at associated type for some obligations

Partially address #57663.
2019-10-27 03:34:54 +00:00
Mazdak Farrokhzad
0aa7c6f96b
Rollup merge of #65773 - estebank:sugg-whitespace, r=Centril
Increase spacing for suggestions in diagnostics

Make the spacing between the code snippet and verbose structured
suggestions consistent with note and help messages.

r? @Centril
2019-10-26 14:17:45 +02:00
varkor
94c4dd9902 Emit warning for ignored #[inline] on trait method prototypes 2019-10-25 23:26:27 +01:00
Thomas Lively
62c3443e96 Re-enable Emscripten's exception handling support
Passes LLVM codegen and Emscripten link-time flags for exception
handling if and only if the panic strategy is `unwind`. Sets the
default panic strategy for Emscripten targets to `unwind`. Re-enables
tests that depend on unwinding support for Emscripten, including
`should_panic` tests.
2019-10-25 15:16:36 -07:00
Mazdak Farrokhzad
e25720f106
Rollup merge of #65390 - GuillaumeGomez:long-err-explanation-E0576, r=matthewjasper,kinnison
Add long error explanation for E0576

Part of #61137.
2019-10-25 06:18:02 +02: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
Esteban Küber
18d873e8f0 Avoid ICE when adjusting bad self ty 2019-10-24 00:41:14 -07:00
bors
4a8c5b20c7 Auto merge of #57545 - bovinebuddha:object_safe_for_dispatch, r=nikomatsakis
Object safe for dispatch

cc #43561
2019-10-23 13:34:27 +00:00
Guillaume Gomez
530d7098bf Update ui tests 2019-10-23 14:13:37 +02:00
Esteban Küber
580a93e2b6 Fix rebase 2019-10-22 13:24:30 -07:00
Esteban Küber
669a4035ef review comments: move code, fix indentation and change span 2019-10-22 12:43:04 -07:00
Esteban Küber
58c6591cde Point at associated type for some obligations 2019-10-22 12:42:15 -07:00