bors
413790186c
Auto merge of #61203 - memoryruins:bare_trait_objects, r=Centril
...
Warn on bare_trait_objects by default
The `bare_trait_objects` lint is set to `warn` by default.
Most ui tests have been updated to use `dyn` to avoid creating noise in stderr files.
r? @Centril
cc #54910
2019-05-29 21:55:59 +00:00
Oliver Scherer
18967566c7
Rollup merge of #61310 - RalfJung:mem, r=Centril
...
split libcore::mem into multiple files
r? @Centril
2019-05-29 14:41:09 +02:00
Oliver Scherer
e83776f3ab
Rollup merge of #61217 - estebank:issue-52820, r=Centril
...
Account for short-hand init structs when suggesting conversion
Fix #52820 .
2019-05-29 14:41:05 +02:00
Ralf Jung
d0b3774490
bless you
2019-05-29 12:28:45 +02:00
memoryruins
eb4580a570
Update ui test suite to use dyn
2019-05-29 00:57:31 -04:00
Mazdak Farrokhzad
dae331d921
Rollup merge of #61195 - davidtwco:seg-fault-mangler, r=eddyb
...
Special-case `.llvm` in mangler
Fixes #60925 and fixes #53912 .
r? @michaelwoerister
cc @eddyb
2019-05-29 00:20:00 +02:00
Mazdak Farrokhzad
bfe9080ea0
Rollup merge of #61024 - petrochenkov:proctest, r=nikomatsakis
...
tests: Centralize proc macros commonly used for testing
Many proc macros in `ui\proc-macro\auxiliary` were doing same things.
(I added a fair share of those myself.)
Now commonly used macros (empty, identity, etc) are collected in one place - `ui\proc-macro\auxiliary\test-macros.rs`.
2019-05-29 00:19:57 +02:00
Mazdak Farrokhzad
e19a229c88
Rollup merge of #60756 - matthewjasper:extra-impl-trait-tests, r=nikomatsakis
...
Add better tests for hidden lifetimes in impl trait
cc #60670
2019-05-29 00:19:53 +02:00
varkor
6233d1fee5
Use assert_eq! instead of println! in tests
2019-05-28 21:35:20 +01:00
varkor
b3a13fdd13
Make sure array length diagnostic doesn't regress
2019-05-28 21:35:20 +01:00
varkor
56181cf8ab
Correct pluralisation of tuple/array/associated type binding mismatch errors
2019-05-28 21:35:20 +01:00
varkor
854995313a
Reintroduce TypeError::FixedArraySize
2019-05-28 21:35:20 +01:00
varkor
f13317ca2e
Use Display rather than Debug printing for const mismatch
2019-05-28 21:35:20 +01:00
varkor
f865b7dda4
Update tests after pretty printing
2019-05-28 21:35:20 +01:00
varkor
cfa1f80cd9
Fix test after rebase
2019-05-28 21:35:20 +01:00
varkor
57ff5899d2
Add broken MIR regression tests
2019-05-28 21:35:20 +01:00
varkor
d5c6cb8778
Eagerly evaluate in super_relate_consts
2019-05-28 21:35:20 +01:00
varkor
908d97d03c
Update test output
2019-05-28 21:34:42 +01:00
varkor
55dcc20f9a
Add tests for uninferred consts during codegen
2019-05-28 21:34:42 +01:00
varkor
5a585fe45e
Add a test for a function taking a const param array as an argument
2019-05-28 21:34:42 +01:00
David Wood
9c34473ecf
Special-case .llvm in mangler to fix segfaults
...
This commit special cases `.llvm` in the mangler to print `.llvm$6d$`
instead. This will avoid segfaults when names in a user's Rust code are
`llvm`.
2019-05-28 20:26:51 +01:00
memoryruins
a1d1d7a2c6
Update test/ui/parser for bare_trait_object warnings
2019-05-28 14:45:27 -04:00
Mazdak Farrokhzad
3b5157917a
Rollup merge of #61220 - imbrem:error_explanations, r=estebank
...
Added error message for E0284
Work on #61137
2019-05-28 11:48:55 +02:00
Jad Ghalayini
b3480126d4
Incorporated suggested changes
2019-05-27 19:37:20 -04:00
bors
e70d5386d7
Auto merge of #61140 - estebank:attr-diagnostics, r=michaelwoerister
...
Reword malformed attribute input diagnostics
- Handle empty `cfg_attr` attribute
- Reword empty `derive` attribute error
- Use consistend error message: "malformed `attrname` attribute input"
- Provide suggestions when possible
- Move note/help to label/suggestion
- Use consistent wording "ill-formed" -> "malformed"
- Move diagnostic logic out of parser
Split up from https://github.com/rust-lang/rust/pull/61026 , where there's prior conversation.
2019-05-27 20:12:14 +00:00
bors
ed2a5115da
Auto merge of #61147 - estebank:suggest-as-ref, r=oli-obk
...
When encountering move error on an `Option`, suggest using `as_ref`
Fix #61109 , cc #15457 .
2019-05-27 01:10:22 +00:00
Esteban Küber
24b2e20b31
Account for short-hand init structs when suggesting conversion
2019-05-26 11:39:48 -07:00
Mazdak Farrokhzad
6ae3c2b2a4
Rollup merge of #61189 - oli-obk:turbofish_ice, r=varkor
...
Turn turbo 🐟 🍨 into an error
Master branch part of #60989
r? @varkor
2019-05-26 02:13:33 +02:00
Mazdak Farrokhzad
b4a3d44a87
Rollup merge of #61144 - estebank:issue-61108, r=matthewjasper
...
Suggest borrowing for loop head on move error
Fix #61108 .
2019-05-26 02:13:27 +02:00
Mazdak Farrokhzad
24cc368118
Rollup merge of #61087 - estebank:parsepalooza, r=Centril
...
Tweak `self` arg not as first argument of a method diagnostic
Mention that `self` is only valid on "associated functions"
```
error: unexpected `self` argument in function
--> $DIR/self-in-function-arg.rs:1:15
|
LL | fn foo(x:i32, self: i32) -> i32 { self }
| ^^^^ not valid as function argument
|
= note: `self` is only valid as the first argument of an associated function
```
When it is a method, mention it must be first
```
error: unexpected `self` argument in function
--> $DIR/trait-fn.rs:4:20
|
LL | fn c(foo: u32, self) {}
| ^^^^ must be the first associated function argument
```
Move a bunch of error recovery methods to `diagnostics.rs` away from `parser.rs`.
Fix #51547 . CC #60015 .
2019-05-26 02:13:24 +02:00
Oliver Scherer
a15df94b69
Turn ICE on type arguments on variables into an error
2019-05-25 21:16:27 +02:00
Esteban Küber
4e68ddca90
review comments: move back some methods and clean up wording
2019-05-25 12:15:06 -07:00
Esteban Küber
976541884f
Tweak self arg not as first argument of a method diagnostic
...
Mention that `self` is only valid on "associated functions"
```
error: unexpected `self` argument in function
--> $DIR/self-in-function-arg.rs:1:15
|
LL | fn foo(x:i32, self: i32) -> i32 { self }
| ^^^^ not valid as function argument
|
= note: `self` is only valid as the first argument of an associated function
```
When it is a method, mention it must be first
```
error: unexpected `self` argument in function
--> $DIR/trait-fn.rs:4:20
|
LL | fn c(foo: u32, self) {}
| ^^^^ must be the first associated function argument
```
2019-05-25 12:05:18 -07:00
Esteban Küber
609ffa1a89
Reword malformed attribute input diagnostics
...
- Handle empty `cfg_attr` attribute
- Reword empty `derive` attribute error
- Use consistend error message: "malformed `attrname` attribute input"
- Provide suggestions when possible
- Move note/help to label/suggestion
- Use consistent wording "ill-formed" -> "malformed"
- Move diagnostic logic out of parser
2019-05-25 11:55:50 -07:00
Esteban Küber
1cc42ea675
Add support for suggesting as_ref to Result accesses
2019-05-25 11:12:41 -07:00
Oliver Scherer
0b732aa607
Update nll ui tests
2019-05-25 17:21:29 +02:00
Oliver Scherer
dd327951eb
Update ui tests
2019-05-25 10:07:02 +02:00
Oliver Scherer
fa459a08e1
Fix rebase fallout
2019-05-25 10:07:02 +02:00
Oliver Scherer
28198bb3be
Update ui tests
2019-05-25 10:07:02 +02:00
Oliver Scherer
fa17654f79
Make ConstValue::Slice solely take [u8] and str
2019-05-25 10:07:01 +02:00
Mazdak Farrokhzad
19b5a10346
Rollup merge of #61138 - varkor:async-await-tests, r=cramertj
...
Move async/await tests to their own folder
This moves run-pass and ui async/await tests to their own folder `src/test/ui/async-await` and organises some into subfolders. (It does not move rustdoc tests for async/await.)
I also did some drive-by cleaning up of issues/error code tests into their own folders (which already existed). These are in separate commits, so easy to separate out if that's more desirable.
r? @cramertj
2019-05-25 04:55:45 +02:00
Mazdak Farrokhzad
57139e2055
Rollup merge of #61118 - pnkfelix:issue-60654-dont-ice-on-gat, r=varkor
...
Dont ICE on an attempt to use GAT without feature gate
Fix #60654
2019-05-25 04:55:39 +02:00
Mazdak Farrokhzad
8e5e1a0d3c
Rollup merge of #61113 - SimonSapin:fnbox, r=alexcrichton
...
Deprecate `FnBox`. `Box<dyn FnOnce()>` can be called directly, since 1.35
FCP completion: https://github.com/rust-lang/rust/issues/28796#issuecomment-439731515
2019-05-25 04:55:36 +02:00
Esteban Küber
4b0963653e
When encountering move error on an Option, suggest using as_ref
2019-05-24 19:10:00 -07:00
Esteban Küber
274b7e49e0
Suggest borrowing for loop head on move error
2019-05-24 18:23:43 -07:00
varkor
c91ab64048
Add extra arc_wake
2019-05-25 00:23:15 +01:00
Esteban Küber
ee7593e0ac
Revert changes that belong to separate PR
2019-05-24 15:17:32 -07:00
varkor
79816bb9e3
Delete stray .stderr
2019-05-24 22:36:57 +01:00
varkor
aea04009e4
Move error code tests to error code folder
2019-05-24 22:07:35 +01:00
varkor
cb7e0d0dd3
Add issues folder in async-await
2019-05-24 22:06:09 +01:00