108308 Commits

Author SHA1 Message Date
Ralf Jung
1a9fc18e83 panic_bounds_check: use caller_location, like PanicFnLangItem 2020-03-09 11:16:23 +01:00
Vadim Petrochenkov
7a30bb1676 Address review comments 2020-03-09 13:07:21 +03:00
Ralf Jung
8a8870fbae miri: add machine hook for Abort terminator 2020-03-09 11:06:55 +01: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
Bastian Kauschke
314da73797 discrimant test must not be inlined! 2020-03-09 10:12:44 +01:00
Guillaume Gomez
c06fa0be82 clean up E0393 explanation 2020-03-09 09:31:15 +01: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
Yuki Okushi
d32924f89d
Check if output is immediate value 2020-03-09 07:48:08 +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
Ralf Jung
4897594656 miri: ICE on invalid terminators 2020-03-08 19:05:18 +01:00
Bastian Kauschke
4b724e82d2 allow dead code in discriminant test 2020-03-08 18:56:15 +01:00
Bastian Kauschke
6bbb9b86c4 test discriminant of enum with uninhabited variant 2020-03-08 17:04:02 +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
Mazdak Farrokhzad
22d6cc7287
Rollup merge of #69771 - GuillaumeGomez:cleanup-e0390, r=Dylan-DPC
Cleanup E0390 explanation

r? @Dylan-DPC
2020-03-08 16:53:41 +01:00
Mazdak Farrokhzad
c13d296e72
Rollup merge of #69668 - ssomers:btreemap_even_more_comments, r=Mark-Simulacrum
More documentation and simplification of BTreeMap's internals

Salvage the documentation and simplification from #67980, without changing the type locked down by debuginfo.

r? @rkruppe
2020-03-08 16:53:40 +01:00
Mazdak Farrokhzad
8ce45d855e
Rollup merge of #69651 - Mark-Simulacrum:black-box-marker, r=eddyb
Try to ensure usize marker does not get merged

This follows up on [this conversation](https://github.com/rust-lang/rust/pull/69209#discussion_r379911282). However, I'm not confident this is quite correct, so feedback is appreciated, as always.
2020-03-08 16:53:38 +01:00
Mazdak Farrokhzad
c31b7044c1
Rollup merge of #69646 - RalfJung:layout-visitor, r=eddyb
Miri visitor: detect primitive types based on type, not layout (also, more tests)

I also converted the union-based transmutes to use `mem::transmute` for increased readability.

r? @eddyb @oli-obk
2020-03-08 16:53:36 +01:00
Mazdak Farrokhzad
b3c405cf46
Rollup merge of #69631 - RalfJung:rust-src, r=Mark-Simulacrum
remove non-sysroot sources from rust-src component

See https://github.com/rust-lang/rust/pull/69592#discussion_r386238725: these were likely added in https://github.com/rust-lang/rust/pull/58269 for the sake of compiler plugins, but those are being entirely phased out, so there is no good reason to ship these sources.

OTOH, @eddyb [wrote](https://github.com/rust-lang/rust/pull/58269#issuecomment-463408918)

> Yeah, my question is why librustc_plugin specifically? Everything else makes sense.

So maybe there is some good reason to keep these? Then we should have a comment explaining that reason.

Cc @eddyb @taeguk @Mark-Simulacrum
2020-03-08 16:53:35 +01:00
Ralf Jung
528cbc4879 fix memory leak when vec::IntoIter panics during drop 2020-03-08 16:43:03 +01:00
Bastian Kauschke
22f2385a73 prevent potential promotion in const_discriminant 2020-03-08 15:12:46 +01:00
Bastian Kauschke
6d03bbd480 constify mem::discriminant 2020-03-08 14:24:32 +01:00
Ralf Jung
a95f00fe1b fix type size mismatch on 32bit 2020-03-08 12:41:59 +01:00
bors
1d5241c962 Auto merge of #69822 - Centril:rollup-360ca2j, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #69422 (Remove use of `unwrap()` from save-analysis)
 - #69548 (Turn trailing tokens in `assert!()` into hard errors)
 - #69561 (Clean up unstable book)
 - #69599 (check_binding_alt_eq_ty: improve precision wrt. `if let`)
 - #69641 (Update books)
 - #69776 (Fix & test leak of some BTreeMap nodes on panic during `into_iter`)
 - #69805 (resolve: Modernize some naming)
 - #69810 (test(bindings_after_at): add dynamic drop tests for bindings_after_at)

Failed merges:

r? @ghost
2020-03-08 10:51:46 +00:00