8992 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
919cf42feb
Rollup merge of #57992 - Matthias247:waker4, r=cramertj
Update the future/task API

This change updates the future and task API as discussed in the stabilization RFC at https://github.com/rust-lang/rfcs/pull/2592.

Changes:
- Replacing UnsafeWake with RawWaker and RawWakerVtable
- Removal of LocalWaker
- Removal of Arc-based Wake trait
2019-02-14 02:41:17 +01:00
Mazdak Farrokhzad
aa896f30bb
Rollup merge of #57856 - lzutao:fix-old-first-edition, r=steveklabnik
Convert old first edition links to current edition one

r? @steveklabnik
2019-02-14 02:41:16 +01:00
Mazdak Farrokhzad
c0d507d73b
Rollup merge of #58272 - fitzgen:num-format-code-size, r=Mark-Simulacrum
Cut down on number formating code size

r? @alexcrichton
2019-02-13 18:12:31 +01:00
Lzu Tao
e7f8e63ed4 Convert old doc links to current edition
Use footnote style to bypass the tidy check
2019-02-13 14:39:25 +00:00
Matthias Einwag
871338c3ae Merging master 2019-02-12 22:46:14 -08:00
Mazdak Farrokhzad
6562c28607
Rollup merge of #58405 - gnzlbg:remove_unused_macros, r=alexcrichton
Remove some dead code from libcore

These macros are not required to glue the `core_arch` crate anymore.
2019-02-13 04:37:09 +01:00
Mazdak Farrokhzad
ecb6503169
Rollup merge of #58200 - RalfJung:str-as-mut-ptr, r=SimonSapin
fix str mutating through a ptr derived from &self

Found by Miri: In `get_unchecked_mut` (also used by the checked variants internally) uses `str::as_ptr` to create a mutable reference, but `as_ptr` takes `&self`.  This means the mutable references we return here got created from a shared reference, which violates the shared-references-are-read-only discipline!

For this by using a newly introduced `as_mut_ptr` instead.
2019-02-13 04:37:03 +01:00
Mazdak Farrokhzad
0ed894afae
Rollup merge of #57815 - dotdash:asserts, r=sfackler
Speed up the fast path for assert_eq! and assert_ne!

Currently, the panic!() calls directly borrow the value bindings. This
causes those bindings to always be initialized, i.e. they're initialized
even before the values are even compared. This causes noticeable
overhead in what should be a really cheap operation.

By performing a reborrow of the value in the call to panic!(), we allow
LLVM to optimize that code, so that the extra borrow only happens in the
error case.

We could achieve the same result by dereferencing the values passed to
panic!(), as the format machinery borrows them anyway, but this causes
assertions to fail to compile if one of the values is unsized, i.e. it
would be a breaking change.
2019-02-13 04:36:56 +01:00
bors
0f949c2fcc Auto merge of #58051 - SimonSapin:str_escape, r=alexcrichton
Stabilize str::escape_* methods with new return types…

… that implement `Display` and `Iterator<Item=char>`, as proposed in FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12 23:30:16 +00:00
bors
b244f61b77 Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
Cosmetic improvements to doc comments

This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase).

r? @steveklabnik

Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12 19:09:24 +00:00
gnzlbg
1431c216fe Remove some dead code from libcore
These macros are not required to glue the `core_arch` crate anymore.
2019-02-12 16:11:59 +01:00
bors
c84e797642 Auto merge of #58098 - oli-obk:maybe_allow_internal_unstable, r=petrochenkov
Require a list of features in `#[allow_internal_unstable]`

The blanket-permission slip is not great and will likely give us trouble some point down the road.
2019-02-12 12:10:10 +00:00
Simon Sapin
eb158f9350 Add doctests for str::escape_* 2019-02-12 09:55:30 +01:00
Simon Sapin
114593d638 Make the prema-unstable char::escape_debug_ext method crate-private 2019-02-12 09:55:30 +01:00
Simon Sapin
92cce78d06 Move str::escape_* to libcore 2019-02-12 09:55:30 +01:00
Simon Sapin
92dcae4742 Add internal impl_fn_for_zst macro for "named closure types" 2019-02-12 09:55:20 +01:00
bors
ba2853b6d3 Auto merge of #58246 - pmccarter:master, r=oli-obk
Make `saturating_add` and `saturating_sub` `const` functions

Fixes #58030
2019-02-12 03:20:16 +00:00
Oliver Scherer
d3c212c552 Require a list of features to allow in allow_internal_unstable 2019-02-11 15:08:16 +01:00
Alexander Regueiro
99ed06eb88 libs: doc comments 2019-02-10 23:57:25 +00:00
Alexander Regueiro
b87363e763 tests: doc comments 2019-02-10 23:42:32 +00:00
Alexander Regueiro
c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
bors
3d845e131f Auto merge of #58361 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 16 pull requests

Successful merges:

 - #57259 (Update reference of rlibc crate to compiler-builtins crate)
 - #57740 (Use `to_ne_bytes` for converting IPv4Addr to octets)
 - #57926 (Tiny expansion to docs for `core::convert`.)
 - #58157 (Add Cargo.lock automatically adding message)
 - #58203 (rustdoc: display sugared return types for async functions)
 - #58243 (Add trait alias support in rustdoc)
 - #58262 (Add #[must_use] message to Fn* traits)
 - #58295 (std::sys::unix::stdio: explain why we do into_raw)
 - #58297 (Cleanup JS a bit)
 - #58317 (Some writing improvement, conciseness of intro)
 - #58324 (miri: give non-generic functions a stable address)
 - #58332 (operand-to-place copies should never be overlapping)
 - #58345 (When there are multiple filenames, print what got interpreted as filenames)
 - #58346 (rpath computation: explain why we pop())
 - #58350 (Fix failing tidy (line endings on Windows))
 - #58352 (miri value visitor: use `?` in macro)

Failed merges:

r? @ghost
2019-02-10 22:35:36 +00:00
Guillaume Gomez
112629b921
Rollup merge of #58262 - taiki-e:must_use, r=estebank
Add #[must_use] message to Fn* traits

This PR adds `#[must_use]` message to `Fn*` traits.

Related: #57549

r? @estebank
2019-02-10 21:45:15 +01:00
Guillaume Gomez
82e051b6ce
Rollup merge of #57926 - icefoxen:test-doc-pr, r=frewsxcv
Tiny expansion to docs for `core::convert`.

This is not really significant, accept or reject as you wish.  I just want to make sure I understand how the PR process works and that I'm doing it right before doing a bigger one for #33417.
2019-02-10 21:45:09 +01:00
Guillaume Gomez
e917f8b531
Rollup merge of #57259 - king6cong:master, r=alexcrichton
Update reference of rlibc crate to compiler-builtins crate

None
2019-02-10 21:45:07 +01:00
bors
0b7af2668a Auto merge of #58129 - RalfJung:maybe-uninit, r=cramertj
MaybeUninit: some docs, rename into_inner -> into_initialized, return &mut from set
2019-02-10 20:03:03 +00:00
Ralf Jung
4853ce660e it is okay not to use into_inner 2019-02-10 15:35:47 +01:00
Mazdak Farrokhzad
9708644530
Rollup merge of #58275 - RalfJung:miri-test-libcore, r=Mark-Simulacrum
libcore, liballoc: disable tests in Miri

I am going to run the libcore and liballoc unit test suites in Miri.  Not all tests pass.  This PR disables a whole bunch of tests when running in Miri, to get us to a baseline from which I can investigate failures.

Cc @SimonSapin @alexcrichton
2019-02-09 00:16:04 +01:00
Nick Fitzgerald
8fea7054b9 Use write_char for writing padding characters
Removes some unsafe *and* saves almost half a kilobyte of code size.
2019-02-08 10:07:08 +01:00
Nick Fitzgerald
c104b5c897 Also de-duplicate 32- and 64-bit number formatting on wasm32 2019-02-08 10:07:08 +01:00
Patrick McCarter
da13fbda5e Add unstable feature attribute for unsigned const saturating add/sub intrinsics #58030 2019-02-07 13:46:20 -05:00
Patrick McCarter
17998961d4 Refactor const saturating intrinsics emulation and add unstable feature attribute #58030 2019-02-07 13:12:17 -05:00
Ralf Jung
81613ad7cf disable tests in Miri 2019-02-07 18:24:10 +01:00
Ralf Jung
66c894e07f also fix bad use of shared ref in split_at_mut 2019-02-07 17:55:42 +01:00
Nick Fitzgerald
e633f15239 Un-monomorphize and inline formatting with padding
The generic `F` in `with_padding` was causing a bunch of stuff to get inlined
that otherwise needn't be, blowing up code size.
2019-02-07 15:01:30 +01:00
Guillaume Gomez
761caa2334
Rollup merge of #58185 - GuillaumeGomez:images-url, r=SimonSapin
Remove images' url to make it work even without internet connection

Needed for local std docs mainly.

cc @SimonSapin

r? @QuietMisdreavus
2019-02-07 14:28:41 +01:00
Guillaume Gomez
2f2d61a0f8
Rollup merge of #57848 - jrvanwhy:transmute-export-doc, r=QuietMisdreavus
Generate a documentation page for core::mem::transmute.

In `#[no_std]` environments, `std::mem::transmute` is unavailable. Searching for "core transmute" online only pulls up `core::intrinsics::transmute`, which is behind the (unstable) `core_intrinsics` feature flag. Users wishing to use transmute in `#[no_std]` environments typically should use `core::mem::transmute` instead, as it is stable. This documentation makes `core::mem::transmute` discoverable.
2019-02-07 14:28:29 +01:00
Nick Fitzgerald
ed2157a38f De-duplicate write_prefix lambda in pad_integral
For smaller code size.
2019-02-07 13:02:27 +01:00
Nick Fitzgerald
da5a0cd69c De-duplicate number formatting implementations for smaller code size
Instead of inlining the same logic into every number formatting implementation,
pull it out into a function that each of the number formatting impls call into.
2019-02-07 12:33:27 +01:00
Taiki Endo
1d05f81d19 Add #[must_use] message to Fn* traits 2019-02-07 19:44:06 +09:00
Guillaume Gomez
8b886e07f5 Remove images' url to make it work even without internet connection 2019-02-07 11:06:19 +01:00
Matthias Einwag
a1c4cf6889 Change RawWaker constructor to const fn 2019-02-06 22:56:33 -08:00
Patrick McCarter
0efb8e4d73 Allow const assignment for int saturating_sub() for #58030 2019-02-06 16:15:17 -05:00
Sebastian Dröge
86d8e47c11 Fix broken grammar in iter::from_fn() docs 2019-02-06 19:24:20 +02:00
Ralf Jung
a996f2c8dc add tracking issue 2019-02-06 12:55:50 +01:00
Ralf Jung
13bbba273c remove now-unneeded raw ptr casts 2019-02-06 11:23:10 +01:00
Ralf Jung
f3eede6870 fix doctests 2019-02-06 11:14:12 +01:00
Patrick McCarter
9204497c29 Allow const assignment for int saturating_add() calls for #58030 2019-02-05 15:36:31 -05:00
Ralf Jung
346dc37aee fix str mutating through a ptr derived from &self 2019-02-05 20:07:45 +01:00
Ralf Jung
aaafc3c7fa fix doctest 2019-02-05 18:46:43 +01:00