about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-12-13Rollup merge of #67280 - shalzz:patch-1, r=jonas-schievinkMazdak Farrokhzad-1/+1
docs: std::convert::From: Fix typo Fix a minor typo
2019-12-13Rollup merge of #67278 - Centril:67273, r=oli-obkMazdak Farrokhzad-2/+63
`coerce_inner`: use initial `expected_ty` Fixes #67273. Follow-up to #59439. r? @oli-obk
2019-12-13Rollup merge of #67274 - RalfJung:uninit, r=CentrilMazdak Farrokhzad-1/+5
be explicit that mem::uninitialized is the same as MaybeUninit::uninit().assume_init() Cc @Centril @nikomatsakis
2019-12-13Rollup merge of #67256 - RalfJung:reduce-allocs, r=oli-obkMazdak Farrokhzad-29/+22
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-13Rollup merge of #67254 - RalfJung:vtable-ice, r=oli-obkMazdak Farrokhzad-1/+12
dont ICE in case of invalid drop fn Fixes https://github.com/rust-lang/miri/issues/1112 r? @oli-obk
2019-12-13Rollup merge of #67235 - jonas-schievink:vecdeque-leak, r=KodrAusMazdak Farrokhzad-1/+47
VecDeque: drop remaining items on destructor panic Closes https://github.com/rust-lang/rust/issues/67232
2019-12-13Rollup merge of #67026 - Nadrieril:improve-usefulness-empty, ↵Mazdak Farrokhzad-182/+889
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-13docs: std::convert::From: Fix typoShaleen Jain-1/+1
Fix a minor typo
2019-12-13coerce_inner: use initial expected_tyMazdak Farrokhzad-2/+63
2019-12-13be explicit that mem::uninitialized is the same as ↵Ralf Jung-1/+5
MaybeUninit::uninit().assume_init()
2019-12-13Auto merge of #67077 - Aaron1011:build-llvm-in-binary, r=alexcrichtonbors-476/+229
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-13Auto merge of #66405 - nnethercote:tweak-ObligForest-NodeStates, r=nikomatsakisbors-129/+153
Remove `NodeState::{Waiting,Done}` An optimization, and then some clean-ups. r? @nikomatsakis
2019-12-13Rollup merge of #67269 - Centril:recover-lt-deref-pat, r=estebankMazdak Farrokhzad-9/+55
parser: recover on `&'lifetime mut? $pat`. r? @estebank
2019-12-13Rollup merge of #67251 - oli-obk:stability_sieve, r=CentrilMazdak Farrokhzad-32/+37
Require `allow_internal_unstable` for stable min_const_fn using unsta… …ble features r? @Centril cc @ecstatic-morse @RalfJung
2019-12-13Rollup merge of #67250 - ↵Mazdak Farrokhzad-20/+11
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-13Rollup merge of #67247 - JohnTitor:fix-sugg, r=estebankMazdak Farrokhzad-4/+46
Don't suggest wrong snippet in closure Fixes #67190 r? @estebank
2019-12-13Rollup merge of #67243 - jonas-schievink:linkedlist-drop, r=KodrAusMazdak Farrokhzad-1/+122
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-13Rollup merge of #66341 - crgl:vec-deque-extend, r=AmanieuMazdak Farrokhzad-1/+16
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-13parser: recover on `&'lifetime mut $pat`.Mazdak Farrokhzad-9/+55
2019-12-13Avoid re-processing nodes in `find_cycles_from_node`.Nicholas Nethercote-4/+8
2019-12-13Remove an unnecessary local variable.Nicholas Nethercote-2/+1
2019-12-13Remove some `debug!` statements.Nicholas Nethercote-19/+1
Because I am tired of looking at them.
2019-12-13Move functions around.Nicholas Nethercote-59/+59
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-13Remove `NodeState::{Waiting,Done}`.Nicholas Nethercote-87/+126
`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-12Auto merge of #67172 - jethrogb:jb/bootstrap-linker, r=alexcrichtonbors-11/+17
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-12Fix weird implicit dependency between rustllvm and rustc_codegen_llvmAaron Hill-17/+25
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-12avoid more intermediate allocations in validation errorsRalf Jung-23/+16
2019-12-12validation: avoid some intermediate allocationsRalf Jung-6/+6
2019-12-12Auto merge of #66886 - mark-i-m:simplify-borrow_check-2, r=matthewjasperbors-148/+182
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-12dont ICE in case of invalid drop fnRalf Jung-1/+12
2019-12-12Auto merge of #67079 - nnethercote:optimize-shallow_resolve_changed, ↵bors-28/+36
r=nikomatsakis Optimize `shallow_resolve_changed` r? @nikomatsakis
2019-12-12Require `allow_internal_unstable` for stable min_const_fn using unstable ↵Oliver Scherer-32/+37
features
2019-12-12Remove the `DelimSpan` from `NamedMatch::MatchedSeq`.Nicholas Nethercote-20/+11
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.
2019-12-11fix imports after rebaseMark Mansi-3/+2
2019-12-11more privateMark Mansi-19/+18
2019-12-11fix importsMark Mansi-21/+0
2019-12-11tidyMark Mansi-1/+0
2019-12-11fix importsMark Mansi-129/+187
2019-12-11get rid of nll submodMark Mansi-0/+0
2019-12-12Don't suggest wrong snippet in closureYuki Okushi-4/+46
2019-12-12Auto merge of #67246 - JohnTitor:rollup-nfa7skn, r=JohnTitorbors-100/+220
Rollup of 8 pull requests Successful merges: - #62514 (Clarify `Box<T>` representation and its use in FFI) - #66983 (Fix `unused_parens` triggers on macro by example code) - #67215 (Fix `-Z print-type-sizes`'s handling of zero-sized fields.) - #67230 (Remove irelevant comment on `register_dtor`) - #67236 (resolve: Always resolve visibilities on impl items) - #67237 (Some small readability improvements) - #67238 (Small std::borrow::Cow improvements) - #67239 (Make TinyList::remove iterate instead of recurse) Failed merges: r? @ghost
2019-12-12Rollup merge of #67239 - llogiq:tiny-list-iterative-remove, r=Mark-SimulacrumYuki Okushi-24/+16
Make TinyList::remove iterate instead of recurse Most of the diff is from from rustfmt, the actual change is in line 91..79 (or 79..89 in the "after" diff). I had converted the other methods to iterate instead of recurse already, so this is the last recursive function on `TinyList`.
2019-12-12Rollup merge of #67238 - llogiq:moo-and-improved, r=Dylan-DPCYuki Okushi-13/+8
Small std::borrow::Cow improvements This is a small set of improvements (+ one more tested code path) for `Cow`.
2019-12-12Rollup merge of #67237 - llogiq:improve-str, r=Dylan-DPCYuki Okushi-16/+6
Some small readability improvements
2019-12-12Rollup merge of #67236 - petrochenkov:docerr2, r=matthewjasperYuki Okushi-12/+46
resolve: Always resolve visibilities on impl items Fixes https://github.com/rust-lang/rust/issues/64705. Similarly to https://github.com/rust-lang/rust/pull/67106 this was an issue with visitor discipline. Impl items were visited as a part of visiting `ast::ItemKind::Impl`, but they should be visit-able in isolation from their parents as well, because that's how they are visited when they are expanded from macros. I've checked that all the remaining `resolve_visibility` calls are used correctly. r? @matthewjasper
2019-12-12Rollup merge of #67230 - chansuke:remove-irrelevant-passage, r=Dylan-DPCYuki Okushi-2/+0
Remove irelevant comment on `register_dtor` Fixes #66572.
2019-12-12Rollup merge of #67215 - nnethercote:fix-Zprint-type-size-zero-sized-fields, ↵Yuki Okushi-3/+68
r=pnkfelix Fix `-Z print-type-sizes`'s handling of zero-sized fields. Currently, the type `struct S { x: u32, y: u32, tag: () }` is incorrectly described like this: ``` print-type-size type: `S`: 8 bytes, alignment: 4 bytes print-type-size field `.x`: 4 bytes print-type-size field `.tag`: 0 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size padding: 4 bytes print-type-size field `.y`: 4 bytes, alignment: 4 bytes ``` Specifically: - The `padding` line is wrong. (There is no padding.) - The `offset` and `alignment` on the `.tag` line shouldn't be printed. The problem is that multiple fields can end up with the same offset, and the printing code doesn't handle this correctly. This commit fixes it by adjusting the field sorting so that zero-sized fields are dealt with before non-zero-sized fields. With that in place, the printing code works correctly. The commit also corrects the "something is very wrong" comment. The new output looks like this: ``` print-type-size type: `S`: 8 bytes, alignment: 4 bytes print-type-size field `.tag`: 0 bytes print-type-size field `.x`: 4 bytes print-type-size field `.y`: 4 bytes ``` r? @pnkfelix
2019-12-12Rollup merge of #66983 - weiznich:bugfix/issue_66295, r=estebankYuki Okushi-30/+23
Fix `unused_parens` triggers on macro by example code Fix #66295 Unfortunately this does also break [an existing test](https://github.com/rust-lang/rust/blob/4787e97475de6be9487e3d9255a9c2d3c0bf9252/src/test/ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs#L22). I'm not sure how to handle that, because that seems to be quite similar to the allowed cases If this gets accepted it would be great to backport this fix to beta.
2019-12-12Rollup merge of #62514 - stephaneyfx:box-ffi, r=nikomatsakisYuki Okushi-0/+53
Clarify `Box<T>` representation and its use in FFI This officializes what was only shown as a code example in [the unsafe code guidelines](https://rust-lang.github.io/unsafe-code-guidelines/layout/function-pointers.html?highlight=box#use) and follows [the discussion](https://github.com/rust-lang/unsafe-code-guidelines/issues/157) in the corresponding repository. It is also related to [the issue](https://github.com/rust-lang/rust/issues/52976) regarding marking `Box<T>` `#[repr(transparent)]`. If the statement this PR adds is incorrect or a more in-depth discussion is warranted, I apologize. Should it be the case, the example in the unsafe code guidelines should be amended and some document should make it clear that it is not sound/supported.
2019-12-12Add comment to `Dropper`Jonas Schievink-0/+2