Commit Graph

107904 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
83be689b94 parser/attr: adjust indentation. 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
e72df7edad parse_labeled_expr: add a suggestion on missing colon. 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
fe848b44fe parse_block_tail: reduce visibility 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
addbc5b9df unify/improve/simplify attribute parsing 2020-03-10 08:35:23 +01:00
Mazdak Farrokhzad
be86b2d37b parse: recover on fn foo() = expr; 2020-03-10 08:32:34 +01:00
Mazdak Farrokhzad
379f3181de parse: simplify parse_fn_body 2020-03-10 08:32:34 +01:00
Mazdak Farrokhzad
055733f3b3 parse: recover on &'lt $expr / 'lt $expr. 2020-03-10 08:32:34 +01:00
Mazdak Farrokhzad
8ee220c447 more reuse in block parsing & improve diagnostics. 2020-03-10 08:32:34 +01:00
Mazdak Farrokhzad
883e90dd81 simplify parse_inner_attributes 2020-03-10 08:32:34 +01:00
Mazdak Farrokhzad
c303c4463c use error_block_no_opening_brace more 2020-03-10 08:32:34 +01:00
Mazdak Farrokhzad
9596dc2a47 parse_labeled_expr: simplify 2020-03-10 08:32:34 +01:00
bors
3dbade652e Auto merge of #69851 - Centril:rollup-iivxvah, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #69201 (Permit attributes on 'if' expressions)
 - #69685 (unix: Don't override existing SIGSEGV/BUS handlers)
 - #69762 (Ensure that validity only raises validity errors)
 - #69779 (librustc_codegen_llvm: Use slices in preference to 0-terminated strings)
 - #69801 (rustc_parse: Remove `Parser::normalized(_prev)_token`)
 - #69842 (Add more regression tests)

Failed merges:

r? @ghost
2020-03-09 11:58:17 +00:00
Mazdak Farrokhzad
7e903f82ff
Rollup merge of #69842 - JohnTitor:more-tests, r=Centril
Add more regression tests

Closes #54239
Closes #57200
Closes #57201
Closes #60473
Closes #64620
Closes #67166

r? @Centril
2020-03-09 12:57:54 +01:00
Mazdak Farrokhzad
2677d59298
Rollup merge of #69801 - petrochenkov:nonorm, r=Centril
rustc_parse: Remove `Parser::normalized(_prev)_token`

Perform the "normalization" (renamed to "uninterpolation") on the fly when necessary.

The final part of https://github.com/rust-lang/rust/pull/69579 https://github.com/rust-lang/rust/pull/69384 https://github.com/rust-lang/rust/pull/69376 https://github.com/rust-lang/rust/pull/69211 https://github.com/rust-lang/rust/pull/69034 https://github.com/rust-lang/rust/pull/69006.
r? @Centril
2020-03-09 12:57:53 +01:00
Mazdak Farrokhzad
2409e70bdb
Rollup merge of #69779 - tmiasko:di-cstr, r=nagisa
librustc_codegen_llvm: Use slices in preference to 0-terminated strings

Additionally whenever possible match C API provided by the LLVM.
2020-03-09 12:57:51 +01:00
Mazdak Farrokhzad
c9bbfb9474
Rollup merge of #69762 - RalfJung:validity-errors, r=oli-obk
Ensure that validity only raises validity errors

For now, only as a debug-assertion (similar to const-prop detecting errors that allocate).

Now includes https://github.com/rust-lang/rust/pull/69646.
[Relative diff](https://github.com/RalfJung/rust/compare/layout-visitor...RalfJung:validity-errors).

r? @oli-obk
2020-03-09 12:57:50 +01:00
Mazdak Farrokhzad
eaf6905c55
Rollup merge of #69685 - cuviper:soft-segv, r=sfackler
unix: Don't override existing SIGSEGV/BUS handlers

Although `stack_overflow::init` runs very early in the process, even
before `main`, there may already be signal handlers installed for things
like the address sanitizer. In that case, just leave it alone, and don't
bother trying to allocate our own signal stacks either.

Fixes #69524.
2020-03-09 12:57:48 +01:00
Mazdak Farrokhzad
4ec997503c
Rollup merge of #69201 - Aaron1011:feature/permit-if-attr, r=Centril
Permit attributes on 'if' expressions

Previously, attributes on 'if' expressions (e.g. `#[attr] if true {}`)
were disallowed during parsing. This made it impossible for macros to
perform any custom handling of such attributes (e.g. stripping them
away), since a compilation error would be emitted before they ever had a
chance to run.

This PR permits attributes on 'if' expressions ('if-attrs' from here on).
Both built-in attributes (e.g. `#[allow]`, `#[cfg]`) and proc-macro attributes are supported.

We still do *not* accept attributes on 'other parts' of an if-else
chain. That is, the following code snippet still fails to parse:

```rust
if true {} #[attr] else if false {} else #[attr] if false {} #[attr]
else {}
```

Closes https://github.com/rust-lang/rust/issues/68618
2020-03-09 12:57:44 +01:00
Vadim Petrochenkov
7a30bb1676 Address review comments 2020-03-09 13:07:21 +03:00
Vadim Petrochenkov
9be233cbfe Use Token::uninterpolate in couple more places matching on (Nt)Ident 2020-03-09 12:42:41 +03:00
Vadim Petrochenkov
5d7f67d3b1 rustc_parse: Remove Parser::normalized(_prev)_token 2020-03-09 12:42:41 +03:00
Vadim Petrochenkov
43b27df5b2 rustc_ast: Introduce Token::uninterpolate 2020-03-09 12:42:41 +03:00
Vadim Petrochenkov
f4a03c44d5 rustc_ast: Introduce Token::uninterpolated_span 2020-03-09 12:42:41 +03:00
Vadim Petrochenkov
925e9a2188 rustc_parse: Use Token::ident where possible 2020-03-09 12:42:41 +03:00
Yuki Okushi
ef98ec055e
Add FIXMEs 2020-03-09 16:50:46 +09:00
Josh Stone
676b9bc477 unix: Don't override existing SIGSEGV/BUS handlers
Although `stack_overflow::init` runs very early in the process, even
before `main`, there may already be signal handlers installed for things
like the address sanitizer. In that case, just leave it alone, and don't
bother trying to allocate our own signal stacks either.
2020-03-08 18:44:12 -07:00
Tomasz Miąsko
e54a829b57 Avoid unnecessary interning of enum variant part id 2020-03-09 02:05:22 +01:00
Tomasz Miąsko
58303b77e0 Use slices in preference to 0-terminated strings
Additionally whenever possible match C API provided by the LLVM.
2020-03-09 02:05:22 +01:00
Yuki Okushi
579ce86d4b
Add test for issue-67166 2020-03-09 09:12:53 +09:00
Yuki Okushi
95d478546f
Add test for issue-64620 2020-03-09 09:12:41 +09:00
Yuki Okushi
0005f29d89
Add test for issue-60473 2020-03-09 09:12:25 +09:00
Yuki Okushi
437c07f662
Add test for issue-57201 2020-03-09 09:12:06 +09:00
Yuki Okushi
fc8be08a8e
Add test for issue-57200 2020-03-09 09:11:58 +09:00
Yuki Okushi
af0c44cb29
Add test for issue-54239 2020-03-09 09:11:40 +09:00
Ralf Jung
ed3014a2b9 use static strings instead of tcx 2020-03-08 22:04:54 +01:00
Ralf Jung
85e1466232 Fix typo
Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>
2020-03-08 22:04:54 +01:00
Ralf Jung
4971d03ccf fix some cases of unexpected exceptions leaving validation 2020-03-08 22:04:54 +01:00
Ralf Jung
938f8522ec miri validation: debug-complain about unexpected errors 2020-03-08 22:04:54 +01:00
Ralf Jung
0468929ce3 move error allocation test to error.rs 2020-03-08 22:04:54 +01:00
bors
2cb0b8582e Auto merge of #69833 - Centril:rollup-mh74yue, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #69120 (Don't give invalid suggestion on desugared span.)
 - #69326 (mir-interpret: add method to read wide strings from Memory)
 - #69608 (Expose target libdir information via print command)
 - #69734 (Change DIBuilderCreateEnumerator signature to match LLVM 9)
 - #69800 (Compile address sanitizer test with debuginfo)
 - #69807 (Cleanup E0391 explanation)
 - #69820 (clean up E0392 explanation)

Failed merges:

r? @ghost
2020-03-08 19:54:57 +00:00
Mazdak Farrokhzad
c934c94212
Rollup merge of #69820 - GuillaumeGomez:cleanup-e0392, r=Dylan-DPC
clean up E0392 explanation

r? @Dylan-DPC
2020-03-08 20:54:36 +01:00
Mazdak Farrokhzad
40b405f2d4
Rollup merge of #69807 - GuillaumeGomez:cleanup-e0391, r=Dylan-DPC
Cleanup E0391 explanation

r? @Dylan-DPC
2020-03-08 20:54:35 +01:00
Mazdak Farrokhzad
cfb2f95450
Rollup merge of #69800 - tmiasko:address-g, r=nikic
Compile address sanitizer test with debuginfo

This makes error-pattern to match regardless of current
configuration of `rust.debuginfo-level-tests` in `config.toml`.
2020-03-08 20:54:33 +01:00
Mazdak Farrokhzad
e2617a98c0
Rollup merge of #69734 - tmiasko:di-enumerator, r=ecstatic-morse
Change DIBuilderCreateEnumerator signature to match LLVM 9

* Change DIBuilderCreateEnumerator signature to match LLVM 9 C API.
* Use provided is unsigned flag when emitting enumerators.
2020-03-08 20:54:31 +01:00
Mazdak Farrokhzad
5e9888eec5
Rollup merge of #69608 - o01eg:expose-target-libdir-print, r=ehuss
Expose target libdir information via print command

With custom libdir it is required to have an access to library placement.

See https://github.com/RazrFalcon/cargo-bloat/issues/51
2020-03-08 20:54:30 +01:00
Mazdak Farrokhzad
ff961789bc
Rollup merge of #69326 - JOE1994:os_str_widestring, r=RalfJung
mir-interpret: add method to read wide strings from Memory

Implemented *step2* from [instructions](https://github.com/rust-lang/miri/issues/707#issuecomment-561564057) laid out in rust-lang/miri#707.

Added 2 new methods to struct `rustc_mir::interpret::InterpCx`.

* `read_os_str_from_wide_str` (src/librustc_mir/interpret/operand.rs)
* `write_os_str_to_wide_str` (src/librustc_mir/interpret/place.rs)
  - used existing logic implemented in [MIRI/src/eval.rs](94732aaf7b/src/eval.rs (L132-L141))

These methods are intended to be used for environment variable emulation in Windows.
2020-03-08 20:54:28 +01:00
Mazdak Farrokhzad
85241b5aa6
Rollup merge of #69120 - spunit262:invalid-sugar-suggest, r=matthewjasper
Don't give invalid suggestion on desugared span.
2020-03-08 20:54:26 +01:00
bors
564758c4c3 Auto merge of #69829 - Centril:rollup-lm5lzsq, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #69631 (remove non-sysroot sources from rust-src component)
 - #69646 (Miri visitor: detect primitive types based on type, not layout (also, more tests))
 - #69651 (Try to ensure usize marker does not get merged)
 - #69668 (More documentation and simplification of BTreeMap's internals)
 - #69771 (Cleanup E0390 explanation)
 - #69777 (Add missing ` in doc for File::with_options())
 - #69812 (Refactorings to method/probe.rs and CrateId)

Failed merges:

r? @ghost
2020-03-08 15:54:09 +00:00
Mazdak Farrokhzad
06689e212f
Rollup merge of #69812 - Marwes:refactor, r=petrochenkov
Refactorings to method/probe.rs and CrateId

A couple of refactorings done while looking into performance improvements in method resolution.
2020-03-08 16:53:44 +01:00
Mazdak Farrokhzad
b61037135c
Rollup merge of #69777 - lukas-code:patch-1, r=jonas-schievink
Add missing ` in doc for File::with_options()
2020-03-08 16:53:43 +01:00