Commit Graph

101152 Commits

Author SHA1 Message Date
Guillaume Gomez
ed965f1b6a Update E0659 error code long explanation to 2018 edition 2019-10-22 11:52:05 +02:00
Ralf Jung
fc5b48514e add comments 2019-10-22 10:18:38 +02:00
Ralf Jung
768965a2a6 bring back some Debug instances for Miri 2019-10-22 10:15:56 +02:00
Yuki Okushi
93fab980e3 Add test for issue-52437 2019-10-22 17:05:03 +09:00
Yuki Okushi
dd0f98bc3e Add test for issue-51431 2019-10-22 17:05:03 +09:00
Yuki Okushi
a239c8dfb2 Add test for issue-41366 2019-10-22 17:05:03 +09:00
yjhmelody
40f92b3b05 refactor maybe_append 2019-10-22 12:25:14 +08:00
bors
50ffa79589 Auto merge of #65501 - alexcrichton:remove-emscripten-backend, r=Mark-Simulacrum
Remove `src/llvm-emscripten` submodule

With #65251 landed there's no need to build two LLVM backends and ship
them with rustc, every target we have now uses the same LLVM backend!

This removes the `src/llvm-emscripten` submodule and additionally
removes all support from rustbuild for building the emscripten LLVM
backend. Multiple codegen backend support is left in place for now, and
this is intended to be an easy 10-15 minute win on CI times by avoiding
having to build LLVM twice.
2019-10-22 04:09:28 +00:00
Dan Gohman
3f1af9056d Code cleanups following up on #65576.
This makes a few code cleanups to follow up on the review comments in
https://github.com/rust-lang/rust/pull/65576.
2019-10-21 17:29:40 -07:00
bors
6576f4be5a Auto merge of #65671 - Centril:rollup-00glhmb, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #62330 (Change untagged_unions to not allow union fields with drop)
 - #65092 (make is_power_of_two a const function)
 - #65621 (miri: add write_bytes method to Memory doing bounds-checks and supporting iterators)
 - #65647 (Remove unnecessary trait bounds and derivations)
 - #65653 (keep the root dir clean from debugging)
 - #65660 (Rename `ConstValue::Infer(InferConst::Canonical(..))` to `ConstValue::Bound(..)`)
 - #65663 (Fix typo from #65214)

Failed merges:

r? @ghost
2019-10-22 00:20:12 +00:00
Yuki Okushi
4fcc784c9a Apply suggestions 2019-10-22 09:02:58 +09:00
Yuki Okushi
cde60e82a0 Add long error explanation for E0728 2019-10-22 08:48:01 +09:00
Alex Crichton
c7d285b781 Remove src/llvm-emscripten submodule
With #65251 landed there's no need to build two LLVM backends and ship
them with rustc, every target we have now uses the same LLVM backend!

This removes the `src/llvm-emscripten` submodule and additionally
removes all support from rustbuild for building the emscripten LLVM
backend. Multiple codegen backend support is left in place for now, and
this is intended to be an easy 10-15 minute win on CI times by avoiding
having to build LLVM twice.
2019-10-21 13:05:31 -07:00
Mazdak Farrokhzad
56756c28a0
Rollup merge of #65663 - Amanieu:typo, r=varkor
Fix typo from #65214
2019-10-21 22:00:54 +02:00
Mazdak Farrokhzad
c461d02e08
Rollup merge of #65660 - varkor:canonical-const-to-bound-const, r=eddyb
Rename `ConstValue::Infer(InferConst::Canonical(..))` to `ConstValue::Bound(..)`

It already has the right form, so this is just a renaming. Fixes https://github.com/rust-lang/rust/issues/65655.

r? @eddyb
2019-10-21 22:00:53 +02:00
Mazdak Farrokhzad
760cd9759e
Rollup merge of #65653 - RalfJung:gitignore, r=Mark-Simulacrum,Centril
keep the root dir clean from debugging

We landed this before with https://github.com/rust-lang/rust/pull/63307 but recently in https://github.com/rust-lang/rust/pull/65630 the IMO bad ignore crept back in.

If you regularly do graphviz-based debugging and you are fine leaving junk in the rustc root dir, please configure your local `.git/info/exclude`. But most people working on rustc don't work with graphciz all that often (I for once never did), and not everyone likes to have stray generated files in their source dirs.

Also Cc https://github.com/rust-lang/rust/pull/63373 https://github.com/rust-lang/rust/pull/53768 @ecstatic-morse @Mark-Simulacrum
2019-10-21 22:00:51 +02:00
Mazdak Farrokhzad
9072e108b5
Rollup merge of #65647 - nnethercote:rm-unnecessary-traits, r=Centril
Remove unnecessary trait bounds and derivations

This PR removes unnecessary trait bounds and derivations from many types.

r? @nikomatsakis
2019-10-21 22:00:50 +02:00
Mazdak Farrokhzad
e825e21e7a
Rollup merge of #65621 - RalfJung:write_bytes, r=oli-obk
miri: add write_bytes method to Memory doing bounds-checks and supporting iterators

This lets us avoid some direct `Allocation` accesses in Miri.
2019-10-21 22:00:49 +02:00
Mazdak Farrokhzad
a160258927
Rollup merge of #65092 - tspiteri:const-is-pow2, r=oli-obk
make is_power_of_two a const function

This makes `is_power_of_two` a const function by using `&` instead of short-circuiting `&&`; Rust supports bitwise `&` for `bool` and short-circuiting is not required in the existing expression.

I don't think this needs a const-hack label as I don't find the changed code less readable, if anything I prefer that it is clearer that short circuiting is not used.

@oli-obk
2019-10-21 22:00:47 +02:00
Mazdak Farrokhzad
aba84894d1
Rollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJung
Change untagged_unions to not allow union fields with drop

This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass.

Change untagged_unions to not allow union fields with drop

Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar).

The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature.

Tracking issue: https://github.com/rust-lang/rust/issues/55149
2019-10-21 22:00:45 +02:00
varkor
e9c2685167 Rename ConstValue::Infer(InferConst::Canonical(..)) to ConstValue::Bound(..) 2019-10-21 20:50:41 +01:00
Stefan Lankes
8a11c61a7a remove hermit-abi from the wrong list, add to the whitelist 2019-10-21 20:23:59 +02:00
Stefan Lankes
0a7ba6b9fc add hermit-abi to the whitelist 2019-10-21 19:43:24 +02:00
Stefan Lankes
99b2e04a6e add aarch64 support for HermitCore 2019-10-21 19:39:38 +02:00
Ralf Jung
ebc9a1ab10 expand comment 2019-10-21 18:05:48 +02:00
bors
10f12fe3e7 Auto merge of #65661 - JohnTitor:rollup-68la1fq, r=JohnTitor
Rollup of 5 pull requests

Successful merges:

 - #65544 (Added doc on keyword break)
 - #65620 (Correctly note code as Ok not error for E0573)
 - #65624 ([mir-opt] Improve SimplifyLocals pass so it can remove unused consts)
 - #65650 (use unwrap_or in lint code)
 - #65652 (Fix `canonicalize_const_var` leaking inference variables)

Failed merges:

r? @ghost
2019-10-21 15:50:37 +00:00
Trevor Spiteri
d689c709ea improve readability of is_power_of_two 2019-10-21 15:35:54 +02:00
Amanieu d'Antras
3de7698e12 Fix typo from #65214 2019-10-21 13:30:43 +01:00
Yuki Okushi
1c94a4475b
Rollup merge of #65652 - skinny121:const_infer_leak, r=eddyb
Fix `canonicalize_const_var` leaking inference variables

Fixes #61338
Fixes #61516
Fixes #62536
Fixes #64087
Fixes #64863
Fixes #65623

I added regression tests for all these issues apart from #64863, which is very similar to #61338.

r? @varkor
2019-10-21 19:53:06 +09:00
Yuki Okushi
865e46b4ba
Rollup merge of #65650 - guanqun:use-unwrap-or, r=eddyb
use unwrap_or in lint code
2019-10-21 19:53:05 +09:00
Yuki Okushi
bcc59ac229
Rollup merge of #65624 - wesleywiser:improve_simplify_locals, r=oli-obk
[mir-opt] Improve SimplifyLocals pass so it can remove unused consts

The `ConstProp` can cause many locals to be initialized to a constant
value and then never read from. `ConstProp` can also evaluate ZSTs into
constant values. Previously, many of these would be removed by other
parts of the MIR optimization pipeline. However, evaluating ZSTs
(especially `()`) into constant values defeated those parts of the
optimizer and so in a2e3ed5, I added a
hack to `ConstProp` that skips evaluating ZSTs to avoid that regression.

This commit changes `SimplifyLocals` so that it doesn't consider writes
of const values to a local to be a use of that local. In doing so,
`SimplifyLocals` is able to remove otherwise unused locals left behind
by other optimization passes (`ConstProp` in particular).

r? @oli-obk
2019-10-21 19:53:04 +09:00
Yuki Okushi
7ea9cfc1fb
Rollup merge of #65620 - ryoqun:remove-unneeded-comment, r=varkor
Correctly note code as Ok not error for E0573

Hi, this is my first pull request to the Rust project.

The fix is very small one just to fix an oversight in a comment.

Namely, [this documentation PR](https://github.com/rust-lang/rust/pull/65234) added a longer explanation for E0573. It illustrated the error using erroneous/corrected contrasting examples. But it accidentally forgot to remove `// error` from the corrected example.

Sadly, I found the error after the PR got merged. [As suggested by the original author](https://github.com/rust-lang/rust/pull/65234/files#r336518549) of the PR, I created an PR to fix this.

Part of #61137.
2019-10-21 19:53:02 +09:00
Yuki Okushi
d56466ff5f
Rollup merge of #65544 - dorfsmay:doc_keyword_break, r=Dylan-DPC
Added doc on keyword break

RE: #34601
2019-10-21 19:53:01 +09:00
Nicholas Nethercote
ac6daed384 Remove many unnecessary trait derivations. 2019-10-21 20:59:18 +11:00
Guillaume Gomez
87744841c8 Add option to disable keyboard shortcuts in docs 2019-10-21 11:36:52 +02:00
Ralf Jung
f6d70b42b8 remove write_repeat; it is subsumed by the new write_bytes 2019-10-21 11:08:37 +02:00
Ralf Jung
d4b365429d points the user away from the Allocation type and towards the Memory type 2019-10-21 10:55:03 +02:00
Ralf Jung
55b787e675 keep the root dir clean from debugging 2019-10-21 10:30:35 +02:00
Oliver Scherer
875bdd5dbe Report even duplilcate errors in case the feature gat is not active 2019-10-21 10:12:09 +02:00
bors
b7a9c285a5 Auto merge of #65594 - RalfJung:miri, r=oli-obk
bump miri

Fixes https://github.com/rust-lang/rust/issues/65529
2019-10-21 07:50:52 +00:00
Nicholas Nethercote
08e2f05549 Remove InternedString.
By using `LocalInternedString` instead for the few remaining uses.
2019-10-21 18:30:40 +11:00
Nicholas Nethercote
2da7a9c0d9 Use Symbol for codegen unit names.
This is a straightforward replacement except for two places where we
have to convert to `LocalInternedString` to get a stable sort.
2019-10-21 18:30:40 +11:00
Nicholas Nethercote
dddacf1eb3 Change SymbolName::name from InternedString to Symbol.
This requires changing the `PartialOrd`/`Ord` implementations to look at
the chars rather than the symbol index.
2019-10-21 18:30:32 +11:00
Oliver Scherer
0653694fdc Don't silently do nothing on mis_use of check_union_fields 2019-10-21 09:08:05 +02:00
ben
aa3d28f9a8 Fix canonicalize_const_var from leaking inference variables through
it's type.
2019-10-21 19:52:32 +13:00
Guanqun Lu
642da6e12a use unwrap_or in lint code 2019-10-21 14:18:09 +08:00
Nicholas Nethercote
b8214e9b44 Convert fields within DefPathData from InternedString to Symbol.
It's a full conversion, except in `DefKey::compute_stable_hash()` where
a `Symbol` now is converted to an `InternedString` before being hashed.
This was necessary to avoid test failures.
2019-10-21 17:17:36 +11:00
Igor Aleksanov
ae04dc8473 Remove unneccessary use under cfg(unix) 2019-10-21 09:05:40 +03:00
Nicholas Nethercote
ddc1c27975 Eliminate intersect_opt.
Its fourth argument is always `Some(pred)`, so the pattern matching is
unnecessary. This commit inlines and removes it.
2019-10-21 15:42:32 +11:00
bors
1ba7b4ecef Auto merge of #65630 - ecstatic-morse:graphviz-tidy, r=Mark-Simulacrum
Check all files in `src/test` for `borrowck_graphviz_postflow`

This attribute causes DOT files to be generated in the top-level directory. It is intended to be used only temporarily and should never appear on master. This also tells git to ignore DOT files in the root or the  `mir_dump` directory, which `-Z dump-mir` uses by default.

This will prevent #65071 from occurring again. It needs to be merged after #65629, otherwise `tidy` will start failing.

r? @Mark-Simulacrum
2019-10-21 04:01:37 +00:00