Commit Graph

76789 Commits

Author SHA1 Message Date
Manish Goregaokar
323795534f Add more features to rust_2018_preview 2018-04-04 13:58:38 -07:00
Jorge Aparicio
b1015f5c5a compile other no-std crates 2018-04-04 22:42:56 +02:00
Jorge Aparicio
bca569f57c Revert "create a nostd crate"
This reverts commit 14768f9b63.
2018-04-04 22:23:33 +02:00
kennytm
00ada06bba
Rollup merge of #49547 - Phlosioneer:44831-borrowck-remove-ignore, r=arielb1
Unignore borrowck test

Unignores a test that has been fixed.

See #44831
2018-04-05 03:09:47 +08:00
kennytm
f29d20e198
Rollup merge of #49641 - valff:decl-macro-illegal-copy, r=nikomatsakis
Regression test for #46314

#46314 is fixed by NLL. This PR adds a regression test for the bug. Intended for #47366.
2018-04-05 02:17:07 +08:00
kennytm
2025a08393
Rollup merge of #49634 - lloydmeta:tests/issue-43058, r=nikomatsakis
Add a test for the fix to issue #43058

Followed the instructions laid out here https://github.com/rust-lang/rust/issues/43058#issuecomment-378389971
2018-04-05 02:17:06 +08:00
kennytm
391959feb9
Rollup merge of #49625 - bjorn3:miri_access_memory_kind, r=oli-obk
miri: add public alloc_kind accessor
2018-04-05 02:17:04 +08:00
kennytm
93ad4f2b9c
Rollup merge of #49594 - mbrubeck:docs, r=steveklabnik
Add some performance guidance to std::fs and std::io docs

Adds more documentation about performance to various "read" functions in `fs` and `io`, and to `BufReader`/`BufWriter`, with the goal of helping developers choose the best option for a given task.
2018-04-05 02:17:03 +08:00
kennytm
d6f19b676f
Rollup merge of #49628 - steveklabnik:learn-use-master, r=QuietMisdreavus
Re-write the documentation index

The docs team has decided that we're framing resources in three ways:
"learning Rust," "using Rust," "mastering Rust." This is a more useful
split than "beginner/intermediate/advanced." As we add more resources
in the future, we expect "using Rust" to grow. "the bookshelf" as a
concept is great, but isn't really organized along these lines. As such,
this reorganizes the docs along these lines.
2018-04-05 02:17:02 +08:00
kennytm
b6b8ed2eff
Rollup merge of #49639 - matklad:cargo, r=kennytm
Update Cargo

This includes at least two notable changes:

  * a regression is fixed where Cargo would update index on every
    operation https://github.com/rust-lang/cargo/pull/5288
  * a new unstable `--out-dir` option is implemented
    https://github.com/rust-lang/cargo/pull/5203
2018-04-05 02:17:01 +08:00
kennytm
a4f744d84e
Rollup merge of #49637 - tmccombs:parent-id-stabilize, r=sfackler
Stabilize parent_id()

Fixes #46104
2018-04-05 02:17:00 +08:00
bors
fb44b4c0eb Auto merge of #48171 - FraGag:doc-copy-clone-impls, r=nikomatsakis
Better document the implementors of Clone and Copy

There are two parts to this change. The first part is a change to the compiler and to the standard library (specifically, libcore) to allow implementations of `Clone` and `Copy` to be written for a subset of builtin types. By adding these implementations to libcore, they now show up in the documentation. This is a [breaking-change] for users of `#![no_core]`, because they will now have to supply their own copy of the implementations of `Clone` and `Copy` that were added in libcore.

The second part is purely a documentation change to document the other implementors of `Clone` and `Copy` that cannot be described in Rust code (yet) and are thus provided by the compiler.

Fixes #25893
2018-04-04 18:11:51 +00:00
Jorge Aparicio
14768f9b63 create a nostd crate
the goal is to build, in a single Cargo invocation, several no-std crates that we want to put in the
rust-std component of no-std targets. The nostd crate builds these crates:

- core
- compiler-builtin (with the "c" and "mem" features enabled)
- alloc
- std_unicode
2018-04-04 19:24:57 +02:00
bors
17fea66ba4 Auto merge of #48913 - Mark-Simulacrum:rustbuild-test, r=alexcrichton
Add tests to rustbuild

In order to run tests, we cfg out various parts of rustbuild. Generally
speaking, these are filesystem and process-spawning operations. Then, rustbuild
is run "as normal" and the various steps that where run are retrieved from the
cache and checked against the expected results.

Note that this means that the current implementation primarily tests "what" we
build, but doesn't actually test that what we build *will* build. In other
words, it doesn't do any form of dependency verification for any crate. This is
possible to implement, but is considered future work.

This implementation strives to cfg out as little code as possible; it also does
not currently test anywhere near all of rustbuild. The current tests are also
not checked for "correctness," rather, they simply represent what we do as of
this commit, which may be wrong.

Test cases are drawn from the old implementation of rustbuild, though the
expected results may vary.

r? @alexcrichton
2018-04-04 15:38:10 +00:00
David Wood
809d01c62e
Updated codeblocks to specify language where required. 2018-04-04 16:09:58 +01:00
David Wood
9e9a987a02
Documenting private items in compiler docs. 2018-04-04 16:09:01 +01:00
Guillaume Gomez
238583a50f Fix anchors issue when everything is collapsed 2018-04-04 16:16:53 +02:00
bjorn3
ac4f69bea4 miri: add public alloc_kind accessor 2018-04-04 15:31:49 +02:00
kennytm
4b6ab5a115
Rollup merge of #49619 - durka:patch-46, r=steveklabnik
tweak core::fmt docs

Remove an outdated (pre-1.0!) claim about passing something or other to a function. Also swap the variable names in the example.
2018-04-04 11:07:28 +02:00
kennytm
ce5db0f887
Rollup merge of #49618 - pftbest:fix_warning, r=SimonSapin
Fix build error when compiling libcore for 16bit targets

Fixes #49617

cc @SimonSapin
2018-04-04 11:07:27 +02:00
kennytm
19c07d382a
Rollup merge of #49612 - tmccombs:stabilize-getpid, r=kennytm
Fix "since" version for getpid feature.

It was stabilized right before the beta branch was cut for 1.26.0.

See https://github.com/rust-lang/rust/pull/49523#issuecomment-377996315

This will need to be backported to beta (1.26.0)
2018-04-04 11:07:26 +02:00
kennytm
b3b7e776cb
Rollup merge of #49609 - abonander:attr-macro-stmt-expr, r=petrochenkov
run-pass/attr-stmt-expr: expand test cases

Follow-up to https://github.com/rust-lang/rust/pull/49124#discussion_r178542587

r? @petrochenkov
2018-04-04 11:07:25 +02:00
kennytm
dd2ec6a099
Rollup merge of #49607 - cuviper:stable-iter-1.27, r=alexcrichton
Stabilize iterator methods in 1.27

- Closes #39480, feature  `iter_rfind`
  - `DoubleEndedIterator::rfind`
- Closes #44705, feature `iter_rfold`
  - `DoubleEndedIterator::rfold`
- Closes #45594, feature `iterator_try_fold`
  - `Iterator::try_fold`
  - `Iterator::try_for_each`
  - `DoubleEndedIterator::try_rfold`
2018-04-04 11:07:24 +02:00
kennytm
52fd162603
Rollup merge of #49603 - GuillaumeGomez:fix-intra-link-trait-provided-method, r=QuietMisdreavus
Fix url for intra link provided method

Fixes #49582.

r? @QuietMisdreavus
2018-04-04 11:07:22 +02:00
kennytm
e1ebd0a9ee
Rollup merge of #49599 - rolfvandekrol:feature/no_ru, r=frewsxcv
Fix typo

In `libstd/io/buffered.rs` one example was marked as `no_ru` instead of `no_run`. I assume this is a typo.
2018-04-04 11:07:21 +02:00
kennytm
29ab7d8db0
Rollup merge of #49577 - tmccombs:string-splice-stabilize, r=TimNN
Stabilize String::replace_range

Fixes #44643
2018-04-04 11:07:20 +02:00
kennytm
7dad49f906
Rollup merge of #49570 - arielb1:bounded-universe, r=nikomatsakis
avoid IdxSets containing garbage above the universe length

This makes sure that all bits in each IdxSet between the universe length
and the end of the word are all zero instead of being in an indeterminate state.

This fixes a crash with RUST_LOG=rustc_mir, and is probably a good idea
anyway.

r? @nikomatsakis - I think you are responsible for this code area now?
2018-04-04 11:07:19 +02:00
kennytm
0cccf810ad
Rollup merge of #49559 - djc:resize-with, r=TimNN
Introduce Vec::resize_with method (see #41758)

In #41758, the libs team decided they preferred `Vec::resize_with` over `Vec::resize_default()`. Here is an implementation to get this moving forward.

I don't know what the removal process for `Vec::resize_default()` should be, so I've left it in place for now. Would be happy to follow up with its removal.
2018-04-04 11:07:18 +02:00
kennytm
b5ceda86aa
Rollup merge of #49540 - bjorn3:fix_miri_discriminant, r=oli-obk
Fix miri Discriminant() for non-ADT

Fixes #49327
2018-04-04 11:07:17 +02:00
kennytm
6c8b8091fc
Rollup merge of #49533 - scottmcm:more-must-use, r=nikomatsakis
Add #[must_use] to a few standard library methods

Chosen to start a precedent of using it on ones that are potentially-expensive and where using it for side effects is particularly discouraged.

Discuss :)

```rust
warning: unused return value of `std::iter::Iterator::collect` which must be used: if you really need to exhaust the iterator, consider `.for_each(drop)` instead
  --> $DIR/fn_must_use_stdlib.rs:19:5
   |
LL |     "1 2 3".split_whitespace().collect::<Vec<_>>();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused return value of `std::borrow::ToOwned::to_owned` which must be used: cloning is often expensive and is not expected to have side effects
  --> $DIR/fn_must_use_stdlib.rs:21:5
   |
LL |     "hello".to_owned();
   |     ^^^^^^^^^^^^^^^^^^^

warning: unused return value of `std::clone::Clone::clone` which must be used: cloning is often expensive and is not expected to have side effects
  --> $DIR/fn_must_use_stdlib.rs:23:5
   |
LL |     String::from("world").clone();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

cc https://github.com/rust-lang/rust/issues/48926
2018-04-04 11:07:16 +02:00
kennytm
f4f13883e5
Rollup merge of #49532 - Phlosioneer:32556-rustdoc-regression-test, r=GuillaumeGomez
Add test for rustdoc ignore test

This will check for regression on issue #32556
2018-04-04 11:07:14 +02:00
kennytm
e0c180362e
Rollup merge of #49516 - GuillaumeGomez:add-union-field-missing-anchor, r=QuietMisdreavus
Add missing anchor for union type fields

r? @QuietMisdreavus
2018-04-04 11:07:13 +02:00
kennytm
fcb17a4728
Rollup merge of #49515 - GuillaumeGomez:target-background, r=QuietMisdreavus
fix targetted value background

r? @QuietMisdreavus
2018-04-04 11:07:12 +02:00
kennytm
609e9f014f
Rollup merge of #49512 - GuillaumeGomez:intra-links-fields, r=QuietMisdreavus
Add support for variant and types fields for intra links

Part of #43466.

r? @QuietMisdreavus
2018-04-04 11:07:11 +02:00
kennytm
b7b2ae2b6f
Rollup merge of #49179 - varkor:future-deprecation, r=QuietMisdreavus,GuillaumeGomez
Handle future deprecation annotations

This adds special handling to the `since` parameter of the `deprecated` attribute: in particular, if the `since` version exceeds the version of the compiler, the deprecation notice will not be printed; but a note is added to the documentation stating that the item will be deprecated in a later version.

(I've used `since` for this, rather than adding a new attribute, because it's more seamless and, I feel, intuitive. Plus it involves less code churn.)

![image](https://user-images.githubusercontent.com/3943692/37611317-ef5cdf16-2b99-11e8-8251-e35e8f7b0137.png)
![image](https://user-images.githubusercontent.com/3943692/37611323-f748c2d0-2b99-11e8-966b-11408c73d416.png)

This is a prerequisite for doing things renaming methods in the standard library (e.g. #30459). Resolves #30785.
2018-04-04 11:07:10 +02:00
Valentine Valyaeff
a981799376 Regression test for #46314 2018-04-04 11:36:38 +03:00
bors
5758c2dd14 Auto merge of #48575 - ishitatsuyuki:unix-no-thread, r=alexcrichton
rustc_driver: get rid of the extra thread

**Do not rollup**

We can alter the stack size afterwards on Unix.

Having a separate thread causes poor debugging experience when interrupting with signals. I have to get the backtrace of the all thread, as the main thread is waiting to join doing nothing else. This patch allows me to just run `bt` to get the desired backtrace.
2018-04-04 06:19:40 +00:00
Aleksey Kladov
db859f5043 Update Cargo
This includes at least two notable changes:

  * a regression is fixed where Cargo would update index on every
    operation https://github.com/rust-lang/cargo/pull/5288
  * a new unstable `--out-dir` option is implemented
    https://github.com/rust-lang/cargo/pull/5203
2018-04-04 09:00:35 +03:00
bors
20338a5240 Auto merge of #49573 - glandium:huge-align, r=SimonSapin
Reject huge alignments on macos with system allocator only

ef8804ba27 addressed #30170 by rejecting
huge alignments at the allocator API level, transforming a specific
platform bug/limitation into an enforced API limitation on all
platforms.

This change essentially reverts that commit, and instead makes alloc()
itself return AllocErr::Unsupported when receiving huge alignments.

This was discussed in https://github.com/rust-lang/rust/issues/32838#issuecomment-368348408
and following.
2018-04-04 03:48:22 +00:00
Thayne McCombs
97ac479066 Stabilize parent_id()
Fixes #46104
2018-04-03 19:47:37 -06:00
lloydmeta
f2cc501f5f
Formatting 2018-04-04 10:33:52 +09:00
lloydmeta
3627e43dc4
Add a test for the fix to issue #43058
Followed the instructions laid out here https://github.com/rust-lang/rust/issues/43058#issuecomment-378389971
2018-04-04 10:25:37 +09:00
bors
199b7e211d Auto merge of #48333 - aidanhs:aphs-no-place-for-placement, r=nikomatsakis
Remove all unstable placement features

Closes #22181, #27779. Effectively makes the assortment of placement RFCs (rust-lang/rfcs#470, rust-lang/rfcs#809, rust-lang/rfcs#1228) 'unaccepted'. It leaves `box_syntax` and keeps the `<-` token as recognised by libsyntax.

------------------------

I don't know the correct process for unaccepting an unstable feature that was accepted as an RFC so...here's a PR.

Let me preface this by saying I'm not particularly happy about doing this (I know it'll be unpopular), but I think it's the most honest expression of how things stand today. I've been motivated by a [post on reddit](https://www.reddit.com/r/rust/comments/7wrqk2/when_will_box_and_placementin_syntax_be_stable/) which asks when these features will be stable - the features have received little RFC-style design work since the end of 2015 (~2 years ago) and leaving them in limbo confuses people who want to know where they're up to. Without additional design work that needs to happen (see the collection of unresolved questions later in this post) they can't really get stabilised, and I think that design work would be most suited to an RFC rather than (currently mostly unused) experimental features in Rust nightly.

I have my own motivations - it's very simple to 'defeat' placement in debug mode today and I don't want a placement in Rust that a) has no guarantees to work and b) has no plan for in-place serde deserialisation.

There's a quote in [1]: "Ordinarily these uncertainties might lead to the RFC being postponed. [The RFC seems like a promising direction hence we will accept since it] will thus give us immediate experience with the design and help in determining the best final solution.". I propose that there have been enough additional uncertainties raised since then that the original direction is less promising and we should be think about the problem anew.

(a historical note: the first mention of placement (under that name - uninit pointers were earlier) in an RFC AFAIK is [0] in late 2014 (pre-1.0). RFCs since then have built on this base - [1] is a comment in Feb 2015 accepting a more conservative design of the Place* traits - this is back when serde still required aster and seemed to break every other nightly! A lot has changed since then, perhaps placement should too)

------------------------

Concrete unresolved questions include:

 - making placement work in debug mode [7]
 - making placement work for serde/with fallible creation [5], [irlo2], [8]
 - trait design:
   - opting into not consuming the placer in `Placer::make_place` - [2]
   - trait proliferation - [4] (+ others in that thread)
   - fallible allocation - [3], [4] (+ others in that thread)
 - support for DSTs/unsized structs (if at all) - [1], [6]

More speculative unresolved questions include:

 - better trait design with in the context of future language features [irlo1] (Q11), [irlo3]
 - interaction between custom allocators and placement [irlo3]

[0] https://github.com/rust-lang/rfcs/pull/470
[1] https://github.com/rust-lang/rfcs/pull/809#issuecomment-73910414
[2] https://github.com/rust-lang/rfcs/issues/1286
[3] https://github.com/rust-lang/rfcs/issues/1315
[4] https://github.com/rust-lang/rust/issues/27779#issuecomment-146711893
[5] https://github.com/rust-lang/rust/issues/27779#issuecomment-285562402
[6] https://github.com/rust-lang/rust/issues/27779#issuecomment-354464938
[7] https://github.com/rust-lang/rust/issues/27779#issuecomment-358025344
[8] https://github.com/rust-lang/rfcs/pull/1228#issuecomment-190825370
[irlo1] https://internals.rust-lang.org/t/placement-nwbi-faq-new-box-in-left-arrow/2789
[irlo2] https://internals.rust-lang.org/t/placement-nwbi-faq-new-box-in-left-arrow/2789/19
[irlo3] https://internals.rust-lang.org/t/lang-team-minutes-feature-status-report-placement-in-and-box/4646
2018-04-04 01:06:35 +00:00
Guillaume Gomez
43815a508c Add test for all.html 2018-04-04 00:56:08 +02:00
Guillaume Gomez
760e389fa6 Add page to list all crate's items 2018-04-04 00:56:08 +02:00
Matt Brubeck
390f8367e7 Add performance notes to BufReader/BufWriter docs 2018-04-03 15:25:55 -07:00
Matt Brubeck
1ce98f34d3 Cross-reference fs::read functions from io::Read docs 2018-04-03 15:25:55 -07:00
bors
c75d5e242f Auto merge of #48647 - alexcrichton:update-sccache, r=kennytm
Update sccache to its master branch

Ideally I'd like to soon enable sccache for rustbuild itself and some of the
stage0 tools, but for that to work we'll need some better Rust support than the
pretty old version we were previously using!
2018-04-03 22:21:37 +00:00
memoryleak47
03e1509f57 make tidy happy 2018-04-03 23:36:47 +02:00
memoryleak47
da4bf14057 running compiletest with --compare-mode will now run, even if the stamp is up to date 2018-04-03 22:22:58 +02:00