Commit Graph

9421 Commits

Author SHA1 Message Date
Esteban Küber
d137b7ac11 review comments 2020-02-02 11:52:34 -08:00
Esteban Küber
0eb29d1a44 fix test 2020-02-02 11:52:34 -08:00
Esteban Küber
d72bcdb42c When object unsafe trait uses itself in associated item suggest using Self 2020-02-02 11:52:34 -08:00
Esteban Küber
1c9242f83f Point at Sized bound 2020-02-02 11:52:34 -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
Ralf Jung
ee60158440 add raw-addr-of variant to mir_raw_fat_ptr 2020-02-02 20:51:24 +01:00
Mazdak Farrokhzad
bd318be05d move_ref_pattern: change pov in diagnostics & add binding names 2020-02-02 17:58:15 +01:00
Mazdak Farrokhzad
8d4973f587 move_ref_pattern: don't ICE on unreachable 2xby-move conflicts 2020-02-02 16:07:51 +01:00
Mazdak Farrokhzad
5951cd3dda Rollup merge of #68764 - Centril:self-semantic, r=petrochenkov
parser: syntactically allow `self` in all `fn` contexts

Part of https://github.com/rust-lang/rust/pull/68728.

`self` parameters are now *syntactically* allowed as the first parameter irrespective of item context (and in function pointers). Instead, semantic validation (`ast_validation`) is used.

r? @petrochenkov
2020-02-02 14:15:52 +01:00
Mazdak Farrokhzad
2e1790dda1 Rollup merge of #68763 - JohnTitor:do-not-sugg-dup-bounds, r=estebank
Do not suggest duplicate bounds

Fixes #68205
Fixes #68695

r? @estebank
2020-02-02 14:15:51 +01:00
Mazdak Farrokhzad
3a7f1edd81 Rollup merge of #68760 - Tyg13:compile_fail_ui_test, r=Centril
Issue error on `compile-fail` header in UI test

Fixes #68732

r? @Centril
2020-02-02 14:15:49 +01:00
Mazdak Farrokhzad
d984f127f6 move_ref_patterns: introduce tests
bindings_after_at: harden tests
2020-02-02 14:13:07 +01:00
Mazdak Farrokhzad
71a6f58229 parser: address review comments re. self. 2020-02-02 13:32:37 +01:00
Jonas Schievink
9fa46fe153 Teach dropck about resume arguments 2020-02-02 13:20:58 +01:00
Jonas Schievink
4ee857c4c3 Add test for E0628 (too many generator parameters) 2020-02-02 13:20:57 +01:00
Jonas Schievink
fca614eb57 Add tests for generator resume arguments 2020-02-02 13:20:57 +01:00
Jonas Schievink
5b2059b257 Fix error message on type mismatch in generator
Instead of "closure is expected to take 0 arguments"
we now get the expected type mismatch error.
2020-02-02 13:20:57 +01:00
Jonas Schievink
2101a1fec0 Adjust tests to type inference changes
This makes some error messages ungreat, but those seem to be preexisting
bugs that also apply to closures / return position `impl Trait` in
general.
2020-02-02 13:20:57 +01:00
Jonas Schievink
044fe0f558 Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
Matthew Jasper
a606ffdb17 Avoid exponential behaviour when relating types 2020-02-02 12:10:08 +00:00
Yuki Okushi
56ad8bcfe0 Do not suggest duplicate bounds 2020-02-02 18:38:23 +09:00
Mazdak Farrokhzad
8674efdb7c parser: move restrictions re. self to ast_validation. 2020-02-02 10:33:55 +01:00
Tyler Lanphear
f6c3894724 compiletest: error if compile-fail header in ui test. 2020-02-02 02:08:30 -05:00
bors
bc4a339064 Auto merge of #68672 - jonas-schievink:dedup-witness, r=Zoxc
Deduplicate types in the generator witness

For the `await-call-tree` benchmark this often reduces the types inside the witness from 12 to 2.
2020-02-02 03:02:41 +00:00
David Ross
410114b9d2 Add tests for issue 59191 2020-02-01 18:59:11 -08:00
Yuki Okushi
c377ed606c Fix ICE with save-analysis 2020-02-02 09:23:47 +09:00
Yuki Okushi
ae22bf9d42 Catch more ICEs 2020-02-02 09:02:54 +09:00
Yuki Okushi
87bb0c4389 Rollup merge of #68740 - JohnTitor:do-not-sugg-underscore, r=Centril
Do not suggest things named underscore

Fixes #68719

r? @estebank
2020-02-02 08:30:21 +09:00
Yuki Okushi
1529126411 Rollup merge of #68727 - xfix:remove-comment-about-pretty-printer-in-format-tests, r=jonas-schievink
Remove a comment about pretty printer in formatting tests

rustc is now using rustfmt, not the old formatter.
2020-02-02 08:30:18 +09:00
Yuki Okushi
b18b26924c Rollup merge of #68681 - bobrippling:fix-matched-angle-brackets, r=Centril
Suggest path separator for single-colon typos

This commit adds guidance for when a user means to type a path, but ends
up typing a single colon, such as `<<Impl as T>:Ty>`.

This change seemed pertinent as the current error message is
particularly misleading, emitting `error: unmatched angle bracket`,
despite the angle bracket being matched later on, leaving the user to
track down the typo'd colon.
2020-02-02 08:30:11 +09:00
Dan Robertson
0b1ff27cd8 Basic run-pass tests for or-patterns
Add some basic run-pass ui tests for or-patterns.
2020-02-01 22:10:58 +00:00
Matthew Jasper
30058df867 Update existing tests for or-patterns 2020-02-01 22:10:58 +00:00
Matthew Jasper
425e494fce Remove or_patterns from INCOMPLETE_FEATURES 2020-02-01 22:07:11 +00:00
Yuki Okushi
9d8058fb42 Do not ICE in type-alias-impl-trait with save-analysis 2020-02-02 06:39:50 +09:00
Yuki Okushi
726568bd1b Do not suggest things named underscore 2020-02-02 04:55:37 +09:00
Rob Pilling
991d2ee282 Improve wording and docs for qualified path recovery 2020-02-01 19:38:52 +00:00
Jonas Schievink
791123d2c4 Deduplicate generator interior types 2020-02-01 20:02:56 +01:00
Yuki Okushi
6f5a61b5fb Use next_point to avoid ICE 2020-02-02 02:39:53 +09:00
Konrad Borowski
cad0cfd9fd Remove a comment about pretty printer in formatting tests
rustc is now using rustfmt, not the old formatter.
2020-02-01 13:29:00 +01:00
bors
6c0b779b7b Auto merge of #68698 - tmiasko:catch-panic, r=Amanieu
Remove incorrect debug assertions from catch_unwind

Previously the debug assertions in the implementation of catch_unwind
used to verify consistency of the panic count by checking that the count
is zero just before leaving the function. This incorrectly assumed that
no panic was in progress when entering `catch_unwind`.

Fixes #68696.
2020-02-01 11:41:05 +00:00
Matthew Jasper
a81c59f9b8 Remove some unsound specializations 2020-02-01 09:11:41 +00:00
bors
cdd41ea5fc Auto merge of #68633 - JohnTitor:avoid-ice-in-diagnostics, r=estebank
Avoid ICE in macro's diagnostics

Fixes #68629

r? @estebank
2020-01-31 21:51:28 +00:00
bors
5371ddf8c6 Auto merge of #68080 - varkor:declared-here, r=petrochenkov
Address inconsistency in using "is" with "declared here"

"is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout.

r? @Centril
2020-01-31 15:13:51 +00:00
Dylan DPC
f60b95aaa1 Rollup merge of #68670 - euclio:invalid-issue, r=estebank
clarify "incorrect issue" error

Changes the message to be more precise, shrinks the span and adds a label specifying why the `issue` field is incorrect.
2020-01-31 01:21:30 +01:00
Tomasz Miąsko
80c3bec9fe Remove incorrect debug assertions from catch_unwind
Previously the debug assertions in the implementation of catch_unwind
used to verify consistency of the panic count by checking that the count
is zero just before leaving the function. This incorrectly assumed that
no panic was in progress when entering `catch_unwind`.
2020-01-31 00:00:00 +00:00
Rob Pilling
3c91bdca1d Suggest path separator for single-colon typos
This commit adds guidance for when a user means to type a path, but ends
up typing a single colon, such as `<<Impl as T>:Ty>`.

This change seemed pertinent as the current error message is
particularly misleading, emitting `error: unmatched angle bracket`,
despite the angle bracket being matched later on, leaving the user to
track down the typo'd colon.
2020-01-30 22:41:07 +00:00
Andy Russell
7632ade65b clarify "incorrect issue" error 2020-01-30 09:01:56 -05:00
Andy Russell
db319a8fb0 suggest adding space in accidental doc comments 2020-01-30 09:00:35 -05:00
bors
c4071d0919 Auto merge of #68325 - faern:move-numeric-consts-to-associated-consts-step1, r=LukasKalbertodt
Move numeric consts to associated consts step1

A subset of #67913. Implements the first step of RFC https://github.com/rust-lang/rfcs/pull/2700

This PR adds the new constants as unstable constants and defines the old ones in terms of the new ones. Then fix a tiny bit of code that started having naming collisions because of the new assoc consts.

Removed a test that did not seem relevant any longer. Since doing just `u8::MIN` should now indeed be valid.
2020-01-30 08:55:07 +00:00
Tomasz Miąsko
ee73259bdc Fix revision annotations in borrowck-feature-nll-overrides-migrate 2020-01-29 20:51:29 +01:00