varkor
5a2410a07c
Add error for pattern-matching on arrays without a fixed size
2019-06-02 01:55:46 +01:00
varkor
c2b663c666
Fix unwrapping usize issue with transparent MaybeUnit array wrapper
2019-06-02 01:50:06 +01:00
varkor
7e92607f5a
Fix unwrapping usize issue in HasMutInterior
2019-05-31 01:19:59 +01:00
Mazdak Farrokhzad
528972a28a
Rollup merge of #61333 - varkor:apit-const-param-ice, r=estebank
...
Fix ICE with APIT in a function with a const parameter
Fixes https://github.com/rust-lang/rust/issues/60953 .
2019-05-30 10:53:07 +02:00
Mazdak Farrokhzad
6351267c1f
Rollup merge of #61231 - pnkfelix:issue-59548-linkage-diagnostic, r=petrochenkov
...
Fix linkage diagnostic so it doesn't ICE for external crates
Fix linkage diagnostic so it doesn't ICE for external crates
(As a drive-by improvement, improved the diagnostic to indicate *why* `*const T` or `*mut T` is required.)
Fix #59548
Fix #61232
2019-05-30 10:52:53 +02:00
Mazdak Farrokhzad
933c773b61
Rollup merge of #60839 - davidtwco:const-generics-struct-ctor, r=varkor
...
Fix ICE with struct ctors and const generics.
Fixes #60818 .
r? @varkor
2019-05-30 10:52:49 +02:00
varkor
998ef688a3
Add a regression test for const parameters with impl Trait
2019-05-30 00:21:04 +01:00
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
David Wood
41aaf7bc46
Fix ICE with struct ctors and const generics.
...
This commit fixes a ICE where struct constructors were resulting in an
ICE with const generics. Previously, a `match` in `type_of` did not have
an arm for the `DefKind::Ctor` resolutions and therefore would assume
that the type did not have generics.
2019-05-29 08:30:07 +01: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
Felix S. Klock II
c8887abf20
Tests for external linkage symbol collision check.
...
Fix #61232
2019-05-27 12:10:58 +02:00
Felix S. Klock II
4e60f53280
Regression test for issue #59548 .
2019-05-27 10:26:02 +02:00
Felix S. Klock II
444f2bae59
Refine the message to at least *mention* the attribute itself.
...
Update pre-existing test's diagnostic output accordingly.
2019-05-27 10:26:02 +02:00
Felix S. Klock II
21aa149b0b
Move existing #[linkage] tests to a subdirectory where I can add more tests.
2019-05-27 10:26:02 +02: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