Commit graph

30568 commits

Author SHA1 Message Date
David Ross
940f65782c Parse & reject postfix operators after casts
This adds parsing for expressions like 'x as Ty[0]' which will
immediately error out, but still give the rest of the parser a valid
parse tree to continue.
2020-02-15 19:50:50 -08:00
bors
2a0d1cbd46 Auto merge of #68814 - Aaron1011:fix/proc-macro-order-two, r=petrochenkov
Record proc macro harness order for use during metadata deserialization

Fixes #68690

When we generate the proc macro harness, we now explicitly recorder the
order in which we generate entries. We then use this ordering data to
deserialize the correct proc-macro-data from the crate metadata.
2020-02-16 01:46:05 +00:00
Jonas Schievink
759526e513 Fix printing of Yield terminator 2020-02-16 00:57:48 +01:00
bors
8ba3ca0e6b Auto merge of #68668 - GuillaumeGomez:struct-variant-field-search, r=ollie27
Struct variant field search

Fixes #16017.

Reopening of #64724.

cc @tomjakubowski
cc @ollie27

r? @kinnison
2020-02-15 22:32:51 +00:00
Ralf Jung
97cc3a229b fix incremental tests 2020-02-15 23:02:58 +01:00
Mazdak Farrokhzad
d6238bd8d4 reject assoc statics & extern consts during parsing 2020-02-15 22:21:00 +01:00
Aaron Hill
51a16e574a
Record proc macro harness order for use during metadata deserialization
Fixes #68690

When we generate the proc macro harness, we now explicitly recorder the
order in which we generate entries. We then use this ordering data to
deserialize the correct proc-macro-data from the crate metadata.
2020-02-15 15:48:36 -05:00
Ralf Jung
b6aaacd991 fix codegen tests 2020-02-15 21:37:53 +01:00
Mazdak Farrokhzad
0e0c0286a2 fuse extern & associated item parsing up to defaultness 2020-02-15 20:57:12 +01:00
Mazdak Farrokhzad
35884fe168 parse extern consts 2020-02-15 20:57:12 +01:00
Mazdak Farrokhzad
f8d2264463 parse associated statics. 2020-02-15 20:57:12 +01:00
Mazdak Farrokhzad
1c2906ead3 ast/parser: fuse static & const grammars in all contexts. 2020-02-15 20:57:12 +01:00
Mazdak Farrokhzad
f3e9763543 ast: make = <expr>; optional in free statics/consts. 2020-02-15 20:57:12 +01:00
Yuki Okushi
2f39ec24b2 Add FIXME note 2020-02-16 04:36:44 +09:00
Ralf Jung
94047f18c2 remove no-longer-needed test 2020-02-15 19:40:33 +01:00
Yuki Okushi
9478503315 Add test for issue-68653 2020-02-16 03:22:00 +09:00
Yuki Okushi
426dcf0da0 Add test for issue-63952 2020-02-16 03:22:00 +09:00
Yuki Okushi
ecb8bf069e Add test for issue-62894 2020-02-16 03:22:00 +09:00
Ralf Jung
3134df2214 adjust run-fail tests 2020-02-15 19:02:36 +01:00
Yuki Okushi
f32447d541 Add test for issue-51798 2020-02-16 02:54:16 +09:00
Yuki Okushi
6351bfd182 Add test for issue-39618 2020-02-16 02:53:58 +09:00
Mazdak Farrokhzad
95dc9b9a73 ast: normalize ForeignItemKind::Ty & AssocItemKind::TyAlias. 2020-02-15 18:00:01 +01:00
Matthew Jasper
0663f25375 Always qualify literals by type 2020-02-15 14:41:34 +00:00
Ralf Jung
c4a6f84b80 fix compile-fail 2020-02-15 14:57:13 +01:00
bors
61d9231ff2 Auto merge of #69168 - brainlock:test-textrel-regression, r=Mark-Simulacrum,tmandry
add regression test for issue #68794

This is a minimal regression test for the issue #68794: "TEXTREL in
i686", which was fixed with e86019c4a0.

The test links a minimal rust static library into a shared library, and
checks that the linker didn't have to add the TEXTREL flag.
2020-02-15 13:48:53 +00:00
Vadim Petrochenkov
1bd6b98220 Emit some additional unused_doc_comments lints outside of the main pass 2020-02-15 15:29:45 +03:00
Ralf Jung
25870a0b77 fix another test 2020-02-15 13:15:15 +01:00
Ralf Jung
415218fc8d expand assoc-const test a bit, just to be sure 2020-02-15 11:47:11 +01:00
Ralf Jung
2107e73d2f fix exceeding_bitshift lint and test 2020-02-15 11:43:54 +01:00
Ralf Jung
4b8c784968 add test for issue 69020 2020-02-15 11:00:14 +01:00
Ralf Jung
9c7639492f more revisions and use them for another test 2020-02-15 10:52:49 +01:00
Ralf Jung
bd48522314 fix tests, and use variants to test debug and release builds together 2020-02-15 10:47:27 +01:00
Vadim Petrochenkov
bcd7e2b38b rustc_lint: Move unused_doc_comments from pre-expansion to early lints 2020-02-15 12:38:34 +03:00
Dylan DPC
e9db0613ac
Rollup merge of #69180 - Aaron1011:feature/comma-struct-init, r=petrochenkov
Suggest a comma if a struct initializer field fails to parse

Currently, we emit a "try adding a comma" suggestion if a comma is
missing in a struct definition. However, we emit no such suggestion if a
comma is missing in a struct initializer.

This commit adds a "try adding a comma" suggestion when we don't find a
comma during the parsing of a struct initializer field.

The change to `src/test/ui/parser/removed-syntax-with-1.stderr` isn't
great, but I don't see a good way of avoiding it.
2020-02-15 09:45:49 +01:00
Dylan DPC
09d6a657b1
Rollup merge of #69166 - JohnTitor:ice-const-enum, r=matthewjasper
Check `has_typeck_tables` before calling `typeck_tables_of`

Fixes #68684

r? @matthewjasper
2020-02-15 09:45:48 +01:00
Dylan DPC
c115ad927a
Rollup merge of #69154 - JohnTitor:fix-macro-ices, r=petrochenkov
Avoid calling `fn_sig` on closures

Fixes #68060

r? @petrochenkov
2020-02-15 09:45:46 +01:00
Aaron Hill
98757f14d0
Suggest a comma if a struct initializer field fails to parse
Currently, we emit a "try adding a comma" suggestion if a comma is
missing in a struct definition. However, we emit no such suggestion if a
comma is missing in a struct initializer.

This commit adds a "try adding a comma" suggestion when we don't find a
comma during the parsing of a struct initializer field.

The change to `src/test/ui/parser/removed-syntax-with-1.stderr` isn't
great, but I don't see a good way of avoiding it.
2020-02-14 22:28:13 -05:00
bors
19288ddfd6 Auto merge of #67681 - matthewjasper:infer-regions-in-borrowck, r=nikomatsakis
Infer regions for opaque types in borrowck

This is a step towards the goal of typeck not doing region inference.

The commits up to `Arena allocate the result of mir_borrowck` are various bug fixes and prerequisites.
The remaining commits move opaque type inference to borrow checking.

r? @nikomatsakis
2020-02-15 02:24:04 +00:00
Matthew Jasper
d863978f89 Fix tests after rebase 2020-02-14 22:40:03 +00:00
Matthew Jasper
6d9e270a4d Fix and test nested impl Trait 2020-02-14 22:40:03 +00:00
Matthew Jasper
78e0ab53fb Update tests 2020-02-14 22:40:03 +00:00
Matthew Jasper
5cfa7d1dfb Handle equal regions in opaque type inference 2020-02-14 22:40:03 +00:00
Matthew Jasper
93ac5bc7de Update tests 2020-02-14 22:40:03 +00:00
Yuki Okushi
47aa2b5bfd Avoid calling fn_sig on closures 2020-02-15 07:33:48 +09:00
Yuki Okushi
940fff7250
Rollup merge of #69128 - Centril:fix-69103, r=davidtwco
Fix extra subslice lowering

We are currently ICEing on e.g.
```rust
fn main() {
    let [.., b @ ..] = [1, 2];
    b;
}
```
This happens because `b @ ..` registers a binding such that `b;` is OK, but then we forget to lower that binding in `rustc_ast_lowering`.

Fixes #69103.

r? @davidtwco
2020-02-15 07:17:50 +09:00
Yuki Okushi
829a3635e4
Rollup merge of #68856 - Centril:or-pat-ref-pat, r=matthewjasper
typeck: clarify def_bm adjustments & add tests for or-patterns

Clarify the adjustment algorithm for the expected type / default binding-modes when type checking patterns with more documentation and tweaks that make the algorithm more independent of the pattern forms.

Also resolve the FIXME noted for or-patterns by deciding that the current implementation is correct, noting the rationale and adding tests for the current implementation.

cc https://github.com/rust-lang/rust/issues/54883

r? @oli-obk @varkor
2020-02-15 07:17:47 +09:00
Yuki Okushi
3f7ed88fdc
Rollup merge of #68129 - varkor:infer-binary-operand-behind-reference, r=nikomatsakis
Correct inference of primitive operand type behind binary operation

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

r? @nikomatsakis
2020-02-15 07:17:43 +09:00
Matthew Jasper
4af0952961 Call is_freeze less in unsafety-checking
This is to avoid cycles when calling `is_freeze` on an opaque type.
2020-02-14 20:12:46 +00:00
Matthew Jasper
7f41cf4cef Check associated opaque types don't use unconstrained lifetimes 2020-02-14 20:12:46 +00:00
Matthew Jasper
033bd8c7af Explain a test 2020-02-14 20:12:45 +00:00