Commit Graph

103892 Commits

Author SHA1 Message Date
Christian Poveda
683c4c788f
Add error message if Scalar::from_(u)int fails 2019-12-22 08:29:46 -05:00
Christian Poveda
309f437e1d
Change results to options 2019-12-21 10:27:58 -05:00
Christian Poveda
90686ded25 add ImmTy::try_from_(u)int methods 2019-12-14 12:13:26 -05:00
Christian Poveda
0bce91ff0b add Scalar::try_from_(u)int methods 2019-12-14 12:13:10 -05:00
bors
c8ea4ace92 Auto merge of #67136 - oli-obk:const_stability, r=Centril
Require stable/unstable annotations for the constness of all stable fns with a const modifier

r? @RalfJung @Centril

Every `#[stable]` const fn now needs either a `#[rustc_const_unstable]` attribute or a `#[rustc_const_stable]` attribute. You can't silently stabilize the constness of a function anymore.
2019-12-14 10:21:32 +00:00
bors
12307b3b08 Auto merge of #67084 - Pagten:feature/print-msg-from-elf-entrypoint, r=Amanieu
SGX: Change ELF entrypoint

This fixes [rust-sgx issue #148](https://github.com/fortanix/rust-sgx/issues/148).

A new entry point is created for the ELF file generated by `rustc`, separate from the enclave entry point. When the ELF file is executed as a Linux binary, the error message below is written to stderr.

> Error: This file is an SGX enclave which cannot be executed as a standard Linux binary.
> See the installation guide at https://edp.fortanix.com/docs/installation/guide/ on how to use 'cargo run' or follow the steps at https://edp.fortanix.com/docs/tasks/deployment/ for manual deployment.

When the ELF file is converted to an SGXS using `elf2sgxs`, the old entry point is still set as the enclave entry point. In a future pull request in the rust-sgx repository, `elf2sgxs` will be modified to remove the code in the ELF entry point, since this code is not needed in the enclave.
2019-12-14 04:08:50 +00:00
bors
8843b28e64 Auto merge of #65951 - estebank:type-inference-error, r=nikomatsakis
Point at method call when type annotations are needed

- Point at method call instead of whole expression when type annotations are needed.
- Suggest use of turbofish on function and methods.

Fix #49391, fix #46333, fix #48089. CC #58517, #63502, #63082.

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

r? @nikomatsakis
2019-12-13 22:56:27 +00:00
bors
ff15e96708 Auto merge of #67284 - Centril:rollup-ghiukob, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #67026 (Improve diagnostics and code for exhaustiveness of empty matches)
 - #67235 (VecDeque: drop remaining items on destructor panic)
 - #67254 (dont ICE in case of invalid drop fn)
 - #67256 (Reduce allocs for validation errors)
 - #67274 (be explicit that mem::uninitialized is the same as MaybeUninit::uninit().assume_init())
 - #67278 (`coerce_inner`: use initial `expected_ty`)
 - #67280 (docs: std::convert::From: Fix typo)

Failed merges:

r? @ghost
2019-12-13 19:39:20 +00:00
Mazdak Farrokhzad
d0cc289ec0
Rollup merge of #67280 - shalzz:patch-1, r=jonas-schievink
docs: std::convert::From: Fix typo

Fix a minor typo
2019-12-13 20:35:37 +01:00
Mazdak Farrokhzad
0f30462efa
Rollup merge of #67278 - Centril:67273, r=oli-obk
`coerce_inner`: use initial `expected_ty`

Fixes #67273.
Follow-up to #59439.

r? @oli-obk
2019-12-13 20:35:36 +01:00
Mazdak Farrokhzad
83536a5c82
Rollup merge of #67274 - RalfJung:uninit, r=Centril
be explicit that mem::uninitialized is the same as MaybeUninit::uninit().assume_init()

Cc @Centril @nikomatsakis
2019-12-13 20:35:34 +01:00
Mazdak Farrokhzad
88e702a6ec
Rollup merge of #67256 - RalfJung:reduce-allocs, r=oli-obk
Reduce allocs for validation errors

This probably doesn't really matter, but I just felt like I had to do this...

r? @oli-obk
2019-12-13 20:35:33 +01:00
Mazdak Farrokhzad
a0be3a683d
Rollup merge of #67254 - RalfJung:vtable-ice, r=oli-obk
dont ICE in case of invalid drop fn

Fixes https://github.com/rust-lang/miri/issues/1112

r? @oli-obk
2019-12-13 20:35:31 +01:00
Mazdak Farrokhzad
48164f8a17
Rollup merge of #67235 - jonas-schievink:vecdeque-leak, r=KodrAus
VecDeque: drop remaining items on destructor panic

Closes https://github.com/rust-lang/rust/issues/67232
2019-12-13 20:35:30 +01:00
Mazdak Farrokhzad
df9e491fb2
Rollup merge of #67026 - Nadrieril:improve-usefulness-empty, r=varkor,Centril,estebank
Improve diagnostics and code for exhaustiveness of empty matches

There was a completely separate check and diagnostics for the case of an empty match. This led to slightly different error messages and duplicated code.
This improves code reuse and generally clarifies what happens for empty matches. This also clarifies the action of the `exhaustive_patterns` feature, and ensures that this feature doesn't change diagnostics in places it doesn't need to.
2019-12-13 20:35:28 +01:00
Shaleen Jain
9abde64a4e
docs: std::convert::From: Fix typo
Fix a minor typo
2019-12-13 23:20:02 +05:30
bors
703c82e531 Auto merge of #62359 - euclio:remove-serialize, r=Dylan-DPC
replace serialize with serde in rustdoc

This is a slightly less aggressive version of #61028.

r? @GuillaumeGomez
2019-12-13 16:14:47 +00:00
Mazdak Farrokhzad
f97c37f8ae coerce_inner: use initial expected_ty 2019-12-13 15:52:51 +01:00
Oliver Scherer
0b47ba7019 The constness of 128 bit atomics will be stabilized together with the atomics 2019-12-13 13:28:55 +01:00
Ralf Jung
216b9ae878 be explicit that mem::uninitialized is the same as MaybeUninit::uninit().assume_init() 2019-12-13 13:13:37 +01:00
Oliver Scherer
f12affef12 Address review comments 2019-12-13 11:27:02 +01:00
Oliver Scherer
3abc7272dc Consistently name min_const_fn 2019-12-13 11:27:02 +01:00
Oliver Scherer
83b8a561a1 Change the const stab default for internal const fns 2019-12-13 11:27:02 +01:00
Oliver Scherer
395a789def Fix rustdoc test 2019-12-13 11:27:02 +01:00
Oliver Scherer
8c83264989 Elaborate internal const fn comment 2019-12-13 11:27:02 +01:00
Oliver Scherer
c7471ad43a Compiler internal error codes need no documentation 2019-12-13 11:27:02 +01:00
Oliver Scherer
5e17e39881 Require stable/unstable annotations for the constness of all stable functions with a const modifier 2019-12-13 11:27:02 +01:00
Oliver Scherer
d75c7530f3 Reuse the staged_api feature for rustc_const_unstable 2019-12-13 11:27:01 +01:00
bors
3964a55ba5 Auto merge of #67077 - Aaron1011:build-llvm-in-binary, r=alexcrichton
rustc: Link LLVM directly into rustc again (take two)

This is a continuation of PR https://github.com/rust-lang/rust/pull/65703
2019-12-13 10:07:38 +00:00
bors
9409c208a9 Auto merge of #66405 - nnethercote:tweak-ObligForest-NodeStates, r=nikomatsakis
Remove `NodeState::{Waiting,Done}`

An optimization, and then some clean-ups.

r? @nikomatsakis
2019-12-13 06:51:28 +00:00
bors
cf7e019b42 Auto merge of #67271 - Centril:rollup-i71iqkv, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #66341 (Match `VecDeque::extend` to `Vec::extend_desugared`)
 - #67243 (LinkedList: drop remaining items when drop panics)
 - #67247 (Don't suggest wrong snippet in closure)
 - #67250 (Remove the `DelimSpan` from `NamedMatch::MatchedSeq`.)
 - #67251 (Require `allow_internal_unstable` for stable min_const_fn using unsta…)
 - #67269 (parser: recover on `&'lifetime mut? $pat`.)

Failed merges:

r? @ghost
2019-12-13 03:22:20 +00:00
Mazdak Farrokhzad
d25197c52d
Rollup merge of #67269 - Centril:recover-lt-deref-pat, r=estebank
parser: recover on `&'lifetime mut? $pat`.

r? @estebank
2019-12-13 04:21:34 +01:00
Mazdak Farrokhzad
d2d5b83f6b
Rollup merge of #67251 - oli-obk:stability_sieve, r=Centril
Require `allow_internal_unstable` for stable min_const_fn using unsta…

…ble features

r? @Centril

cc @ecstatic-morse @RalfJung
2019-12-13 04:21:33 +01:00
Mazdak Farrokhzad
ac0bd42a4a
Rollup merge of #67250 - nnethercote:rm-DelimSpan-from-NamedMatch-MatchedSeq, r=Centril
Remove the `DelimSpan` from `NamedMatch::MatchedSeq`.

Because it's unused. This then allows the removal of
`MatcherPos::sp_open`. It's a tiny perf win, reducing instruction counts
by 0.1% - 0.2% on a few benchmarks.

r? @Centril
2019-12-13 04:21:31 +01:00
Mazdak Farrokhzad
98df677c3f
Rollup merge of #67247 - JohnTitor:fix-sugg, r=estebank
Don't suggest wrong snippet in closure

Fixes #67190

r? @estebank
2019-12-13 04:21:30 +01:00
Mazdak Farrokhzad
87f3b16e0b
Rollup merge of #67243 - jonas-schievink:linkedlist-drop, r=KodrAus
LinkedList: drop remaining items when drop panics

https://github.com/rust-lang/rust/pull/67235, but for `LinkedList`, which has the same issue.

I've also copied over the other drop-related tests from `VecDeque` since AFAICT `LinkedList` didn't have any.
2019-12-13 04:21:27 +01:00
Mazdak Farrokhzad
2ca7b7e539
Rollup merge of #66341 - crgl:vec-deque-extend, r=Amanieu
Match `VecDeque::extend` to `Vec::extend_desugared`

Currently, `VecDeque::extend` [does not reserve at all](https://github.com/rust-lang/rust/pull/65069#discussion_r333166522). This implementation still runs a check every iteration of the loop, but should reallocate at most once for the common cases where the `size_hint` lower bound is exact. Further optimizations in the future could improve this for some common cases, but given the complexity of the `Vec::extend` implementation it's not immediately clear that this would be worthwhile.
2019-12-13 04:21:22 +01:00
Mazdak Farrokhzad
45c1e38147 parser: recover on &'lifetime mut $pat. 2019-12-13 02:36:25 +01:00
Nicholas Nethercote
cb212938d4 Avoid re-processing nodes in find_cycles_from_node. 2019-12-13 08:36:25 +11:00
Nicholas Nethercote
76916d7a4b Remove an unnecessary local variable. 2019-12-13 08:36:25 +11:00
Nicholas Nethercote
4ec87d5cd2 Remove some debug! statements.
Because I am tired of looking at them.
2019-12-13 08:36:25 +11:00
Nicholas Nethercote
7d550445e2 Move functions around.
In particular, it has bugged me for some time that `process_cycles` is
currently located before `mark_still_waiting_nodes` despite being called
afterwards.
2019-12-13 08:36:25 +11:00
Nicholas Nethercote
a8207b1958 Remove NodeState::{Waiting,Done}.
`NodeState` has two states, `Success` and `Done`, that are only used
within `ObligationForest` methods. This commit removes them, and renames
the existing `Waiting` state as `Success`.

We are left with three states: `Pending`, `Success`, and `Error`.
`Success` is augmented with a new `WaitingState`, which indicates when
(if ever) it was last waiting on one or more `Pending` nodes. This
notion of "when" requires adding a "process generation" to
`ObligationForest`; it is incremented on each call to
`process_obligtions`.

This commit is a performance win.

- Most of the benefit comes from `mark_as_waiting` (which the commit
  renames as `mark_still_waiting_nodes`). This function used to do two
  things: (a) change all `Waiting` nodes to `Success`, and (b) mark all
  nodes that depend on a pending node as `Waiting`. In practice, many
  nodes went from `Waiting` to `Success` and then immediately back to
  `Waiting`. The use of generations lets us skip step (a).

- A smaller benefit comes from not having to change nodes to the `Done`
  state in `process_cycles`.
2019-12-13 08:36:25 +11:00
Andy Russell
94630d4c8b
replace serialize with serde in rustdoc 2019-12-12 16:33:25 -05:00
bors
3eeb8d4f2f Auto merge of #67172 - jethrogb:jb/bootstrap-linker, r=alexcrichton
Bootstrap: change logic for choosing linker and rpath

This is a follow-up from #66957 and #67023. Apparently there was one more location with a hard-coded list of targets to influence linking.

I've filed #67171 to track this madness.

r? @alexcrichton
2019-12-12 19:52:27 +00:00
Aaron Hill
47e932b96e
Fix weird implicit dependency between rustllvm and rustc_codegen_llvm
rustllvm relies on the `LLVMRustStringWriteImpl` symbol existing, but
this symbol was previously defined in a *downstream* crate
(rustc_codegen_llvm, which depends on rustc_llvm.

While this somehow worked under the old 'separate bootstrap step for
codegen' scheme, it meant that rustc_llvm could not actually be built by
itself, since it relied linking to the downstream rustc_codegen_llvm
crate.

Now that librustc_codegen_llvm is just a normal crate, we actually try
to build a standalone rustc_llvm when we run tests. This commit moves
`LLVMRustStringWriteImpl` into rustc_llvm (technically the rustllvm
directory, which has its contents built by rustc_llvm). This ensures
that we can build each crate in the graph by itself, without requiring
that any downstream crates be linked in as well.
2019-12-12 10:51:19 -05:00
Ralf Jung
14b2436993 avoid more intermediate allocations in validation errors 2019-12-12 16:48:46 +01:00
Ralf Jung
3ddc0278d3 validation: avoid some intermediate allocations 2019-12-12 16:21:57 +01:00
bors
e9469a6aec Auto merge of #66886 - mark-i-m:simplify-borrow_check-2, r=matthewjasper
Remove the borrow check::nll submodule

NLL is the only borrow checker now, so no need to have a separate submodule.

@rustbot modify labels: +S-blocked

Waiting on #66815
2019-12-12 15:04:36 +00:00
Ralf Jung
b2392aa2fc dont ICE in case of invalid drop fn 2019-12-12 15:23:27 +01:00