about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-03-21Add missing -Z unstable-options flagAlex Tokarev-1/+6
2020-02-26Stabilize --crate-version option in rustdocGuillaume Gomez-19/+14
2020-02-26Auto merge of #69484 - Dylan-DPC:rollup-j6ripxy, r=Dylan-DPCbors-406/+445
Rollup of 5 pull requests Successful merges: - #68712 (Add methods to 'leak' RefCell borrows as references with the lifetime of the original reference) - #69209 (Miscellaneous cleanup to formatting) - #69381 (Allow getting `no_std` from the config file) - #69434 (rustc_metadata: Use binary search from standard library) - #69447 (Minor refactoring of statement parsing) Failed merges: r? @ghost
2020-02-26Rollup merge of #69447 - Centril:minor-stmt-refactor, r=estebankDylan DPC-94/+87
Minor refactoring of statement parsing Extracted out of https://github.com/rust-lang/rust/pull/69445. r? @estebank
2020-02-26Rollup merge of #69434 - petrochenkov:metabs, r=Mark-SimulacrumDylan DPC-13/+5
rustc_metadata: Use binary search from standard library instead of a hand rolled one. Noticed while reviewing https://github.com/rust-lang/rust/pull/68941.
2020-02-26Rollup merge of #69381 - QuiltOS:no-std-from-config, r=Mark-SimulacrumDylan DPC-7/+17
Allow getting `no_std` from the config file Currently, it is only set correctly in the sanity checking implicit default fallback code. Having a config file at all will for force `no_std = false`.
2020-02-26Rollup merge of #69209 - Mark-Simulacrum:strip-unsafe, r=dtolnayDylan DPC-292/+273
Miscellaneous cleanup to formatting Each commit stands alone. This pull request will also resolve #58320.
2020-02-26Rollup merge of #68712 - HeroicKatora:finalize-ref-cell, r=dtolnayDylan DPC-0/+63
Add methods to 'leak' RefCell borrows as references with the lifetime of the original reference Usually, references to the interior are only created by the `Deref` and `DerefMut` impl of the guards `Ref` and `RefMut`. Note that `RefCell` already has to cope with leaks of such guards which, when it occurs, effectively makes it impossible to ever acquire a mutable guard or any guard for `Ref` and `RefMut` respectively. It is already safe to use this to create a reference to the inner of the ref cell that lives as long as the reference to the `RefCell` itself, e.g. ```rust fn leak(r: &RefCell<usize>) -> Option<&usize> { let guard = r.try_borrow().ok()?; let leaked = Box::leak(Box::new(guard)); Some(&*leaked) } ``` The newly added methods allow the same reference conversion without an indirection over a leaked allocation. It's placed on the `Ref`/`RefMut` to compose with both borrow and try_borrow directly.
2020-02-26Auto merge of #67290 - jonas-schievink:leak-audit, r=KodrAusbors-128/+497
Audit liballoc for leaks in `Drop` impls when user destructor panics Inspired by https://github.com/rust-lang/rust/pull/67243 and https://github.com/rust-lang/rust/pull/67235, this audits and hopefully fixes the remaining `Drop` impls in liballoc for resource leaks in the presence of panics in destructors called by the affected `Drop` impl. This does not touch `Hash{Map,Set}` since they live in hashbrown. They have similar issues though. r? @KodrAus
2020-02-26Auto merge of #61812 - jonas-schievink:assoc-ty-defaults, r=nikomatsakisbors-154/+2048
Implement RFC 2532 – Associated Type Defaults This is a partial implementation that is still missing the changes to object types, since I ran into some trouble while implementing that. I'm opening this part already to get feedback on the implementation and the unexpected test fallout (see my comments below). The remaining changes can be done in a later PR. Blockers before this can land: * [x] Resolve unsoundness around interaction with specialization (https://github.com/rust-lang/rust/pull/61812#discussion_r300504010) - #64564 cc https://github.com/rust-lang/rust/issues/29661 Fixes #53907 Fixes #54182 Fixes #62211 Fixes #41868 Fixes #63593 Fixes #47385 Fixes #43924 Fixes #32350 Fixes #26681 Fixes https://github.com/rust-lang/rust/issues/67187
2020-02-26Auto merge of #69474 - Dylan-DPC:rollup-ciotplu, r=Dylan-DPCbors-119/+290
Rollup of 7 pull requests Successful merges: - #67637 (Add primitive module to libcore) - #69387 (Deduplicate identifier printing a bit) - #69412 (Mark attributes consumed by `check_mod_attrs` as normal) - #69423 (syntax: Remove `Nt(Impl,Trait,Foreign)Item`) - #69429 (remove redundant clones and import) - #69457 (Clean up e0370 e0371) - #69468 ([master] Backport release notes of 1.41.1) Failed merges: r? @ghost
2020-02-26Rollup merge of #69457 - GuillaumeGomez:clean-up-e0370-e0371, r=Dylan-DPCDylan DPC-6/+10
Clean up e0370 e0371 r? @Dylan-DPC
2020-02-26Rollup merge of #69429 - matthiaskrgr:clippy_, r=estebankDylan DPC-10/+9
remove redundant clones and import
2020-02-26Rollup merge of #69423 - petrochenkov:nont, r=CentrilDylan DPC-47/+45
syntax: Remove `Nt(Impl,Trait,Foreign)Item` Follow-up to https://github.com/rust-lang/rust/pull/69366. r? @Centril
2020-02-26Rollup merge of #69412 - tmiasko:checked-unused, r=petrochenkovDylan DPC-6/+63
Mark attributes consumed by `check_mod_attrs` as normal Take advantage of the fact that `check_mod_attrs` marks attributes as used and change their type to normal, so that any remaining uses will be warned about by the unused attribute lint.
2020-02-26Rollup merge of #69387 - petrochenkov:idprint, r=Mark-SimulacrumDylan DPC-49/+66
Deduplicate identifier printing a bit https://github.com/rust-lang/rust/pull/67010 introduced a couple more subtly different ways to print an identifier. This PR attempts to restore the order. The most basic identifier printing interface is `Formatter`-based now, so `String`s are not allocated unless required. r? @Mark-Simulacrum
2020-02-26Rollup merge of #67637 - Mark-Simulacrum:primitive-mod, r=dtolnayDylan DPC-1/+97
Add primitive module to libcore This re-exports the primitive types from libcore at `core::primitive` to allow macro authors to have a reliable location to use them from. Fixes #44865
2020-02-25Auto merge of #69450 - cuviper:llvm-scev-no-wrap, r=nikicbors-0/+33
Cherry-pick the LLVM fix for #69225 An additional reproducer was provided in #69225 -- the new testcase here -- which still crashes even after #69241 reverted #67174. Now this pull request updates LLVM with the cherry-picked reversion of its own. This is also going to stable in #69444. I have not tried to reapply #67174 yet -- cc @kraai @shahn
2020-02-25Auto merge of #69421 - flip1995:clippyup, r=Dylan-DPCbors-10/+8
Update Clippy from 8fbb23f to fc5d0cc Fixes #69419 ``` Fix false positive in `missing_const_for_fn` Rustup to rust-lang/rust#69366 Add new lint [`wildcard imports`]. Add suggestion to [`enum_glob_use`] Add new lint `lossy_float_literal` to detect lossy whole number float literals ```
2020-02-25Clean up E0371 explanationGuillaume Gomez-5/+7
2020-02-25Clean up E0370 explanationGuillaume Gomez-1/+3
2020-02-25Auto merge of #69440 - Dylan-DPC:rollup-hj4bo9l, r=Dylan-DPCbors-32/+150
Rollup of 6 pull requests Successful merges: - #69220 (Add documentation for the `-Zself-profile` flag) - #69391 (Add rustdoc aliases to `ptr::copy` and `ptr::copy_nonoverlapping`) - #69427 (Cleanup e0368 e0369) - #69433 (don't explicitly compare against true or false) - #69435 (Replace uses of Cell::get + Cell::set with Cell::replace.) - #69437 (no more codegen for miri_start_panic) Failed merges: r? @ghost
2020-02-25Auto merge of #69428 - matthiaskrgr:submodule_upd, r=Xanewokbors-0/+0
submodules: update rls from 10bf331 to 5fde462 Changes: ```` Update cargo. ```` Fixes #69383 Fixes #69286 r? @Xanewok
2020-02-25parse: address nitpickMazdak Farrokhzad-3/+2
2020-02-24bootstrap: Further centralize target defaulting logic.John Ericson-7/+16
Background: targets can be specied with or without config files; unneccessarily differences in the logic between those cases has caused a) the bug I tried to fix in the previous commit, b) the bug I introduced in the previous commit. The solution is to make the code paths the same as much as possible. 1. Targets are now not created from the `default` method. (I would both remove the impl if this was a public library, but just wrap it for convience becaues it's not.) Instead, there is a `from_triple` method which does the defaulting. 2. Besides the sanity checking, use the new method in the code reading config files. Now `no_std` is overriden iff set explicitly just like the other fields which are optional in the TOML AST type. 3. In sanity checking, just populate the map for all targets no matter what. That way do don't duplicate logic trying to be clever and remember which targets have "non standard" overrides. Sanity checking is back to just sanity checking, and out of the game of trying to default too.
2020-02-24Cherry-pick the LLVM fix for #69225Josh Stone-0/+33
2020-02-25parse: move condition into guardMazdak Farrokhzad-28/+28
2020-02-24parse: simplify `parse_stmt_without_recovery`.Mazdak Farrokhzad-36/+29
2020-02-24parse: extract `parse_stmt_item` & `parse_stmt_path_start`.Mazdak Farrokhzad-32/+33
2020-02-24Rollup merge of #69437 - RalfJung:miri-no-codegen, r=ecstatic-morseDylan DPC-5/+2
no more codegen for miri_start_panic With https://github.com/rust-lang/miri/pull/1136 landed, we don't generate code any more for crates that will be run by Miri. So the LLVM backend does not have to implement the `miri_start_panic` intrinsic any more. Cc @Aaron1011
2020-02-24Rollup merge of #69435 - anyska:cell-replace, r=CentrilDylan DPC-10/+5
Replace uses of Cell::get + Cell::set with Cell::replace.
2020-02-24Rollup merge of #69433 - matthiaskrgr:bool_cmp, r=eddybDylan DPC-15/+15
don't explicitly compare against true or false
2020-02-24Rollup merge of #69427 - GuillaumeGomez:cleanup-e0368-e0369, r=Dylan-DPCDylan DPC-2/+5
Cleanup e0368 e0369 r? @Dylan-DPC
2020-02-24Rollup merge of #69391 - memoryruins:memalias, r=Mark-SimulacrumDylan DPC-0/+2
Add rustdoc aliases to `ptr::copy` and `ptr::copy_nonoverlapping` This PR adds a [rustdoc alias](https://doc.rust-lang.org/nightly/rustdoc/unstable-features.html#add-aliases-for-an-item-in-documentation-search) to `ptr::copy` and `ptr::copy_nonoverlapping` using the commonly used terms `memcpy` and `memmove`. The motivation for this PR is to improve discoverability for these functions, since I've noticed users overlook these functions on multiple occasions (and they have thus reached for [libc](https://crates.io/crates/libc) without need). Currently std docs state: https://doc.rust-lang.org/nightly/std/ptr/fn.copy_nonoverlapping.html > `copy_nonoverlapping` is semantically equivalent to C's `memcpy`, but with the argument order swapped. https://doc.rust-lang.org/nightly/std/ptr/fn.copy.html > `copy` is semantically equivalent to C's `memmove`, but with the argument order swapped. #### search results before adding a rustdoc alias: ![screenshot 6517](https://user-images.githubusercontent.com/6868531/75102985-78fbb680-55c2-11ea-8e41-04979e6fa6f6.png) ![screenshot 6518](https://user-images.githubusercontent.com/6868531/75102984-78632000-55c2-11ea-9673-8822aae636d1.png) #### after adding `#[doc(alias = "memcpy")]` and `#[doc(alias = "memmove")]`: ![screenshot 6516](https://user-images.githubusercontent.com/6868531/75102986-78fbb680-55c2-11ea-93b9-1929be940043.png) ![screenshot 6515](https://user-images.githubusercontent.com/6868531/75102987-78fbb680-55c2-11ea-9861-ce8a77a0c3b9.png)
2020-02-24Rollup merge of #69220 - wesleywiser:doc_self_profile_unstable_book, ↵Dylan DPC-0/+121
r=nikomatsakis Add documentation for the `-Zself-profile` flag
2020-02-24syntax: Remove `Nt(Impl,Trait,Foreign)Item`Vadim Petrochenkov-47/+45
2020-02-24Replace uses of Cell::get + Cell::set with Cell::replace.Ana-Maria-10/+5
2020-02-24rustc_metadata: Use binary search from standard libraryVadim Petrochenkov-13/+5
instead of a hand rolled one.
2020-02-24don't explicitly compare against true or falseMatthias Krüger-15/+15
2020-02-24no more codegen for miri_start_panicRalf Jung-5/+2
2020-02-24Auto merge of #69344 - RalfJung:miri, r=oli-obkbors-8/+10
bump Miri Fixes https://github.com/rust-lang/rust/issues/69331 r? @ghost Cc @oli-obk
2020-02-24librustc_macros: remove redundant single component path importMatthias Krüger-1/+0
2020-02-24librustc{, codegen_ssa,infer,mir_build}: don't clone types that are copyMatthias Krüger-6/+6
2020-02-24remove redundant clones in librustc_mir_build and librustc_data_structuresMatthias Krüger-3/+3
2020-02-24submodules: update rls from 10bf331 to 5fde462Matthias Krüger-0/+0
Changes: ```` Update cargo. ```` Fixes #69383 Fixes #69286 r? @Xanewok
2020-02-24bump Miri once moreRalf Jung-7/+7
2020-02-24Clean up E0368 and E0369 explanationsGuillaume Gomez-2/+5
2020-02-24Address method commentsAndreas Molzer-3/+2
2020-02-24Rollup merge of #69405 - NieDzejkob:docs-readline-appends, r=joshtriplettPietro Albini-1/+1
docs: Stdin::read_line: mention the appending The fact that `stdin().read_line()` is an [unpleasant](https://twitter.com/Michcioperz/status/1231646797661167617?s=20) [footgun](https://rustbattle.net/battle/straight-finch-8-e4f4). Let's make it clearer in the documentation.
2020-02-24Rollup merge of #69394 - GuillaumeGomez:clean-up-0367, r=Dylan-DPCPietro Albini-2/+3
Clean up E0367 explanation r? @Dylan-DPC