Commit graph

68 commits

Author SHA1 Message Date
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
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
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
Mathias Blikstad
ef5acdeceb RFC 2027: "first draft" of implementation
These are a squashed series of commits.
2019-10-22 15:24:33 -04:00
Mazdak Farrokhzad
aba84894d1
Rollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJung
Change untagged_unions to not allow union fields with drop

This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass.

Change untagged_unions to not allow union fields with drop

Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar).

The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature.

Tracking issue: https://github.com/rust-lang/rust/issues/55149
2019-10-21 22:00:45 +02:00
Simon Sapin
84ca0a1cb4 Remove most uses of allow(unions_with_drop_fields) in tests 2019-10-11 10:43:54 +02:00
Yuki Okushi
2ae5e3421d Print lifetimes with backticks 2019-10-11 16:08:53 +09:00
Tyler Mandry
cc5dcfaada
Rollup merge of #65057 - mathstuf:fix-warning-typo, r=Centril
typo: fix typo in E0392

See #64931.

---
Cc: @Centril @estebank
2019-10-03 16:25:51 -07:00
Ben Boeckel
126bf3b1dd typo: fix typo in E0392
See #64931.
2019-10-03 09:22:29 -04:00
bors
cfb6d84720 Auto merge of #64999 - nikomatsakis:issue-60424-async-return-inference, r=cramertj
extract expected return type for async fn generators

Fixes #60424

cc @Centril, I know you've been eager to see this fixed.

r? @cramertj
2019-10-03 12:19:21 +00:00
Niko Matsakis
a807032f9e ./x.py test --bless --compare-mode=nll 2019-10-03 04:20:51 -04:00
Esteban Küber
a180294f8b review comment 2019-10-02 14:34:29 -07:00
Niko Matsakis
dce20bf62a WIP fix tests 2019-10-02 14:17:38 -04: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
bors
18f00b9496 Auto merge of #64455 - GuillaumeGomez:long-error-explanation-E0531, r=Centril
Add Long error explanation for E0531

Part of #61137.
2019-09-28 12:06:44 +00:00
Guillaume Gomez
2fd3811509 update ui tests 2019-09-25 16:41:05 +02:00
Vadim Petrochenkov
f7f8d6584b resolve: Remove ! from "cannot find" diagnostics for macros 2019-09-15 13:22:07 +03:00
Esteban Küber
5799fb419c Give method not found a primary span label 2019-09-08 18:27:02 -07:00
Mazdak Farrokhzad
8ef11fcf4b
Rollup merge of #64110 - estebank:receiver-type, r=Centril
Refer to "`self` type" instead of "receiver type"

Fix https://github.com/rust-lang/rust/issues/42603.
2019-09-05 03:59:44 +02:00
Esteban Küber
4a79633ad2 review comments 2019-09-03 08:05:54 -07:00
Esteban Küber
c1e5e5c567 On object safety violation, point at source when possible 2019-09-02 20:22:22 -07:00
Esteban Küber
a9ce33c059 Account for arbitrary self types in E0599 2019-09-01 02:22:42 -07:00
Mazdak Farrokhzad
42e895d4d9 Improve 'mut ' diagnostic. 2019-08-27 23:44:44 +02:00
Mazdak Farrokhzad
f908aa9e80 recover on 'mut ' and improve recovery for keywords. 2019-08-27 13:04:48 +02:00
Mazdak Farrokhzad
21476e7d6c --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
Mazdak Farrokhzad
228015acd2 Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
Eduard-Mihai Burtescu
45980e809f bless you nll 2019-08-16 15:54:11 +03:00
Niko Matsakis
18d69c8ebe bless tests with compare-mode=nll 2019-08-13 09:13:50 -04:00
Niko Matsakis
d7c7c52dbc bless tests 2019-08-12 21:13:59 -04:00
Niko Matsakis
ad214fe470 fix README.md 2019-08-12 19:23:21 -04:00
Niko Matsakis
03e7b96281 revamp how we handle elision in async fn
We now always make fresh lifetimne parameters for all elided
lifetimes, whether they are in the inputs or outputs. But then
we generate `'_` in the case of elided lifetimes from the outputs.

Example:

```rust
async fn foo<'a>(x: &'a u32) -> &u32 { .. }
```

becomes

```rust
type Foo<'a, 'b> = impl Future<Output = &'b u32>;
fn foo<'a>(x: &'a u32) -> Foo<'a, '_>
```
2019-08-12 17:18:26 -04:00
Mazdak Farrokhzad
5ce8f7a1f9 Add async versions of arbitrary_self_types_pin_lifetime tests. 2019-08-08 18:21:08 +02:00
Mazdak Farrokhzad
f3957876c8 Add async version of self_lifetime.rs test. 2019-08-08 17:08:30 +02:00
Mazdak Farrokhzad
d9294a284d lifetime elision: document conformance of 'async fn' to 'fn'. 2019-08-08 16:00:46 +02:00
Mazdak Farrokhzad
a69478242d lifetime elision: add non-conforming-to-fn tests. 2019-08-08 15:57:32 +02:00
Mazdak Farrokhzad
43a2cbdfd3 lifetime elision: add conforming-to-fn tests. 2019-08-08 15:06:26 +02:00
Taiki Endo
05f67a297a arbitrary_self_types lifetime elision: --bless --compare-mode=nll 2019-07-27 12:35:05 +09:00
Taiki Endo
34f59eb9c5 Fix typo 2019-07-27 12:28:07 +09:00
Taiki Endo
1e2905269b Add tests for self: (&)AssocType 2019-07-27 12:28:07 +09:00
Taiki Endo
8507b8e42f Add test for multiple ref-self 2019-07-27 12:28:06 +09:00
Taiki Endo
aab9edc68a Minor clean up 2019-07-27 12:28:06 +09:00
Taiki Endo
c1f22c018e Add main functions and check-pass annotations 2019-07-27 12:28:05 +09:00
Taiki Endo
258498af58 Update src/test/ui/self/elision/README.md
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-07-27 12:28:05 +09:00
Niko Matsakis
3096568904 add a bevy of new test cases 2019-07-27 12:28:04 +09:00
Taiki Endo
a1fd4fa848 Remove query for .pin_type() 2019-07-27 12:28:03 +09:00
Taiki Endo
e2eb957be0 Allow lifetime elision in Pin<&(mut) Self> 2019-07-27 12:28:02 +09:00
Yuki Okushi
c004451a20 Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
Esteban Küber
d6ea6b972d fix tidy 2019-05-31 13:50:04 -07:00
Esteban Küber
860dce794c Remove unecessary -Z continue-parse-after-error from tests 2019-05-30 18:57:17 -07:00
memoryruins
eb4580a570 Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00