about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-11-01Remove duplicate logic in compute_missing_constructorsNadrieril-84/+35
This is equivalent to the previous code in terms of performance. The expensive path is clearly identical. The fast path is also the same, because in both cases we loop until we get a non-empty `refined_ctors`, and then stop there. So the new code doesn't compute anything more than the previous did.
2019-11-01Remove some redundancyNadrieril-40/+52
2019-11-01Factor out some pattern-stack related functionsNadrieril-12/+52
2019-11-01Abstract out pattern stacks to make the code more legibleNadrieril-41/+92
2019-10-27Clarify and fix the explanation of the algorithmNadrieril-66/+132
There was a bit of confusion between individual patterns and lists of patterns, and index mismatches linked to that. This introduces a vocabulary of "pattern-stacks" to provide a clearer mental model of what is happening. This also adds examples.
2019-10-27Remove mention of old slice pattern syntaxNadrieril-13/+13
2019-10-27tidyNadrieril-3/+4
2019-10-27Run `rustfmt`Nadrieril-476/+497
2019-10-27Auto merge of #65541 - eddyb:spanned-inferred-outlives, r=nikomatsakisbors-36/+62
rustc: add `Span`s to `inferred_outlives_of` predicates. This would simplify #59789, and I suspect it has some potential in diagnostics (although we don't seem to use the predicate `Span`s much atm).
2019-10-27Auto merge of #65519 - pnkfelix:issue-63438-trait-based-structural-match, ↵bors-356/+730
r=matthewjasper trait-based structural match implementation Moves from using a `#[structural_match]` attribute to using a marker trait (or pair of such traits, really) instead. Fix #63438. (This however does not remove the hacks that I believe were put into place to support the previous approach of injecting the attribute based on the presence of both derives... I have left that for follow-on work.)
2019-10-27Auto merge of #65288 - estebank:point-at-assoc-type, r=nikomatsakisbors-61/+304
Point at associated type for some obligations Partially address #57663.
2019-10-26Auto merge of #65852 - flip1995:clippyup, r=Manishearthbors-13/+7
Update Clippy Fixes https://github.com/rust-lang/rust/pull/65845#issuecomment-546633123 r? @Manishearth
2019-10-26Update Clippyflip1995-13/+7
2019-10-26Auto merge of #65167 - hermitcore:rusty-hermit, r=alexcrichtonbors-450/+2310
Redesign the interface to the unikernel HermitCore We are developing the unikernel HermitCore, where the kernel is written in Rust and is already part of the Rust Standard Library. The interface between the standard library and the kernel based on a small C library. With this pull request, we remove completely the dependency to C and use lld as linker. Currently, the kernel will be linked to the application as static library, which is published at https://github.com/hermitcore/libhermit-rs. We don’t longer support the C interface to the kernel. Consequently, we remove this part from the Rust Standard Library.
2019-10-26Auto merge of #65845 - Centril:rollup-28jtjfc, r=Centrilbors-465/+957
Rollup of 8 pull requests Successful merges: - #65743 (rustc_typeck: don't record direct callees in generator_interior.) - #65761 (libsyntax: Enhance documentation of the AST module) - #65772 (Remove the last remaining READMEs) - #65773 (Increase spacing for suggestions in diagnostics) - #65791 (Adding doc on keyword continue) - #65824 (rustc: make DefPathData (and friends) Copy (now that it uses Symbol).) - #65828 (Derive Eq and Hash for SourceInfo again) - #65842 (Add more information on rustdoc search) Failed merges: - #65825 (rustc: use IndexVec<DefIndex, T> instead of Vec<T>.) r? @ghost
2019-10-26Rollup merge of #65842 - GuillaumeGomez:more-search-information, r=Dylan-DPCMazdak Farrokhzad-0/+8
Add more information on rustdoc search Fixes #65735. r? @kinnison
2019-10-26Rollup merge of #65828 - bjorn3:add_source_info_eq_hash, r=petrochenkovMazdak Farrokhzad-1/+3
Derive Eq and Hash for SourceInfo again In https://github.com/bjorn3/rustc_codegen_cranelift/blob/75c24b9c9677600422ec86fa9f4c78fe3678d2ce/src/common.rs#L368 I store it in a `indexmap::IndexSet`, which requires `Eq` and `Hash`. Unfortunately they were removed in https://github.com/rust-lang/rust/pull/65647, so I can't update to latest nightly.
2019-10-26Rollup merge of #65824 - eddyb:def-key-copy, r=varkorMazdak Farrokhzad-8/+8
rustc: make DefPathData (and friends) Copy (now that it uses Symbol). Spotted this while working on something else.
2019-10-26Rollup merge of #65791 - dorfsmay:doc_keyword_continue, r=Mark-SimulacrumMazdak Farrokhzad-2/+33
Adding doc on keyword continue Partial solution of issue #34601.
2019-10-26Rollup merge of #65773 - estebank:sugg-whitespace, r=CentrilMazdak Farrokhzad-14/+744
Increase spacing for suggestions in diagnostics Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages. r? @Centril
2019-10-26Rollup merge of #65772 - mark-i-m:final-readmes, r=nikomatsakisMazdak Farrokhzad-400/+8
Remove the last remaining READMEs cc https://github.com/rust-lang/rustc-guide/pull/481 closes #48478 r? @nikomatsakis
2019-10-26Rollup merge of #65761 - popzxc:document-ast, r=petrochenkovMazdak Farrokhzad-26/+112
libsyntax: Enhance documentation of the AST module This PR enhances documentation state to the `libsyntax/ast.rs` (as initiative caused by [rustc-guide#474](https://github.com/rust-lang/rustc-guide/issues/474)), by adding: - Module documentation. - Doc-comments (and a bit of usual comments) in non-obvious (as for me) places. - Minor style fixes to improve module readability.
2019-10-26Rollup merge of #65743 - eddyb:generator-on-call, r=matthewjasperMazdak Farrokhzad-14/+41
rustc_typeck: don't record direct callees in generator_interior. For expressions like `f(g().await)` we were recording `f` as needing to be kept in a temporary (and therefore be tracked by the generator type) across the suspend, even if a function/method path. However, this is never needed, and can cause issues with complex function types (see #65244). cc @Zoxc @nikomatsakis
2019-10-26Add more information on searchGuillaume Gomez-0/+8
2019-10-26update miriRalf Jung-7/+7
2019-10-26use plain cargo to install xargoRalf Jung-11/+1
2019-10-26bootstrap now takes care of installing xargoRalf Jung-4/+21
2019-10-26update MiriRalf Jung-7/+7
2019-10-26libsyntax: Document ast moduleIgor Aleksanov-26/+112
Apply review suggestions Remove links in the module docs Flatten imports Apply review suggestions Remove useless comments Fix nits
2019-10-26Auto merge of #63812 - eddyb:promo-sanity, r=oli-obkbors-57/+789
rustc_mir: double-check const-promotion candidates for sanity. Previously, const promotion involved tracking information about the value in a MIR local (or any part of the computation leading up to that value), aka "qualifs", in a quite stateful manner, which is hard to extend to arbitrary CFGs without a dataflow pass. However, the nature of the promotion we do is that it's effectively an SSA-like "tree" (or DAG, really), of assigned-once locals - which is how we can take them from the original MIR in the first place. This structure means that the subset of the MIR responsible for computing any given part of a const-promoted value is readily analyzable by walking that tree/DAG. This PR implements such an analysis in `promote_consts`, reusing the `HasMutInterior` / `NeedsDrop` computation from `qualify_consts`, but reimplementing the equivalent of `IsNotPromotable` / `IsNotImplicitlyPromotable`. Eventually we should be able to remove `IsNotPromotable` / `IsNotImplicitlyPromotable` from `qualify_consts`, which will simplify @ecstatic-morse's dataflow-based const-checking efforts. But currently this is mainly for a crater check-only run - it will compare the results from the old promotion collection and the new promotion validation and ICE if they don't match. r? @oli-obk
2019-10-26rustc_mir: use the new validator's Qualif in promotion.Eduard-Mihai Burtescu-49/+120
2019-10-26rustc_mir: double-check const-promotion candidates for sanity.Eduard-Mihai Burtescu-30/+691
2019-10-25Derive Eq and Hash for SourceInfo againbjorn3-1/+3
2019-10-26Rollup merge of #65810 - raoulstrackx:ac_mitigation, r=nagisaYuki Okushi-1/+7
SGX: Clear additional flag on enclave entry An attacker could set both the AC flag in CR0 as in rflags. This causes the enclave to perform an AEX upon a misaligned memory access, and an attacker learns some information about the internal enclave state. The AC flag in rflags is copied from userspace upon an enclave entry. Upon AEX it is copied and later restored. This patch forces the rflag.AC bit to be reset right after an enter.
2019-10-26Rollup merge of #65806 - fusion-engineering-forks:slice-ptr-range, r=CentrilYuki Okushi-1/+81
Add [T]::as_ptr_range() and [T]::as_mut_ptr_range(). Implementation of https://github.com/rust-lang/rfcs/pull/2791
2019-10-26Rollup merge of #65800 - michaelwoerister:measureme-0.4.0, r=wesleywiserYuki Okushi-100/+30
self-profiling: Update measureme to 0.4.0 and remove non-RAII methods from profiler. This PR removes all non-RAII based profiling methods from `SelfProfilerRef` :tada: It also delegates the `TimingGuard` implementation to `measureme`, now that that is available there. r? @wesleywiser
2019-10-26Rollup merge of #65799 - ↵Yuki Okushi-11/+11
LukasKalbertodt:fill-array-value-iter-tracking-issue, r=Centril Fill tracking issue number for `array_value_iter` Thanks for [noticing](https://github.com/rust-lang/rust/pull/62959#discussion_r338930448)! r? @Centril
2019-10-26Rollup merge of #65749 - Centril:insurance-policy, r=RalfJungYuki Okushi-1/+5
Insurance policy in case `iter.size_hint()` lies. Follow up to https://github.com/rust-lang/rust/pull/64949/files#r334235076. (If the perf impact is bad we can use `debug_assert!` instead.) The good news is that the UI tests pass locally so `iter.size_hint()` seems to be honest *thus far*. On the other hand, with the status quo we do not have an insurance policy should that change in some case. This is problematic because a) this could possibly make some program be accepted which shouldn't, b) the compiler itself could have memory unsafety if the correctness of the iterator is assumed in `unsafe { ... }` code (even though the blame lies with the `unsafe { ... }` block in question.) r? @RalfJung cc @nnethercote
2019-10-25rustc: replace a few `.cloned()` with `.copied()`.Eduard-Mihai Burtescu-3/+3
2019-10-25rustc: make DefPathData (and friends) Copy (now that it uses Symbol).Eduard-Mihai Burtescu-5/+5
2019-10-25Fix slice::as_ptr_range doctest.Mara Bos-7/+10
2019-10-25Take out an insurance policy in case `iter.size_hint()`Mazdak Farrokhzad-1/+5
lies, underreporting the number of elements.
2019-10-25Add {String,Vec}::into_raw_partsJake Goulding-0/+73
2019-10-25Use ManuallyDrop in examples for {Vec,String}::from_raw_partsJake Goulding-12/+14
2019-10-25Remove unneeded pointer castingJake Goulding-6/+6
2019-10-25forgot pushfq/popqfq: fixedRaoul Strackx-0/+2
2019-10-25Explain why pointer::add in slice::as_ptr_range is safe.Mara Bos-0/+18
2019-10-25cleaning up codeRaoul Strackx-9/+4
2019-10-25removed unnecessary pushRaoul Strackx-1/+0
2019-10-25Update test output.Felix S. Klock II-2/+2
(My inference is that the number changed from 4 to 5 because `derive(PartialEq)` now injects an extra trait impl before.)