Commit Graph

76614 Commits

Author SHA1 Message Date
bors
934902af61 Auto merge of #49252 - Manishearth:easy-feature-flag, r=nikomatsakis
Easy edition feature flag

We no longer gate features on epochs; instead we have a `#![feature(rust_2018_preview)]` that flips on a bunch of features (currently dyn_trait).

Based on #49001 to avoid merge conflicts

r? @nikomatsakis
2018-04-02 18:14:09 +00:00
Guillaume Gomez
f9cc0307fe Fix url for intra link provided method 2018-04-02 18:52:04 +02:00
Matt Brubeck
85310860c2 Add performance note to fs::read docs 2018-04-02 09:33:27 -07:00
bors
097efa9a99 Auto merge of #49124 - abonander:attr-macro-stmt-expr, r=abonander
Expand Attributes on Statements and Expressions

This enables attribute-macro expansion on statements and expressions while retaining the `stmt_expr_attributes` feature requirement for attributes on expressions.

closes #41475
cc #38356  @petrochenkov @jseyfried
r? @nrc
2018-04-02 10:38:28 +00:00
Austin Bonander
7c0124dd35 Expand attribute macros on statements and expressions.
Retains the `stmt_expr_attributes` feature requirement for attributes on expressions.

closes #41475
cc #38356
2018-04-02 01:56:12 -07:00
bors
135f334e0a Auto merge of #49580 - glandium:core-heap, r=SimonSapin
Use Alloc and Layout from core::heap.

94d1970bba moved the alloc::allocator
module to core::heap, moving e.g. Alloc and Layout out of the alloc
crate. While alloc::heap reexports them, it's better to use them from
where they really come from.
2018-04-02 08:07:10 +00:00
Mike Hommey
b647583c2d Use Alloc and Layout from core::heap.
94d1970bba moved the alloc::allocator
module to core::heap, moving e.g. Alloc and Layout out of the alloc
crate. While alloc::heap reexports them, it's better to use them from
where they really come from.
2018-04-02 16:06:19 +09:00
Peter Hrvola
9056c7a849 Fixed error message from PR review #49392 2018-04-02 09:01:58 +02:00
bors
73f08719ea Auto merge of #49574 - tmccombs:stabilize-getpid, r=sfackler
Stabilize `std::process::id()`

Fixes #44971
2018-04-02 05:48:33 +00:00
Thayne McCombs
196b1426be Stabilize String::replace_range
Fixes #44643
2018-04-01 22:50:22 -06:00
Thayne McCombs
d4f5e89ee0 Stabilize std::process::id()
Fixes #44971
2018-04-01 21:40:56 -06:00
Mike Hommey
98175a8793 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-02 12:29:23 +09:00
bors
acad4cc981 Auto merge of #49571 - anderspitman:patch-1, r=frewsxcv
Update drop.rs
2018-04-02 03:24:51 +00:00
Mike Hommey
0df837f792 Add vec!['\0'; n] optimization, like vec![0; n]
Similarly to vec![ptr::null{,_mut}(); n] in previous change, this adds
the optimization for vec!['\0'; n].
2018-04-02 10:44:38 +09:00
Mike Hommey
cc939ac345 Add vec![ptr::null{,_mut}(); n] optimization, like vec![0; n]
vec![0; n], via implementations of SpecFromElem, has an optimization
that uses with_capacity_zeroed instead of with_capacity, which will use
calloc instead of malloc, and avoid an extra memset.

This adds the same optimization for vec![ptr::null(); n] and
vec![ptr::null_mut(); n], assuming their bit value is 0 (which is true
on all currently supported platforms).

This does so by adding an intermediate trait IsZero, which looks very
much like nonzero::Zeroable, but that one is on the way out, and doesn't
apply to pointers anyways.

Adding such a trait allows to avoid repeating the logic using
with_capacity_zeroed or with_capacity, or making the macro more complex
to support generics.
2018-04-02 10:10:12 +09:00
Anders Pitman
da9e18b3db
Update drop.rs 2018-04-01 16:19:42 -07:00
Ariel Ben-Yehuda
8f9ec1cb06 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.
2018-04-02 00:14:44 +03:00
Jorge Aparicio
2a99c027eb add new image to .travis.yml 2018-04-01 18:56:13 +02:00
Jorge Aparicio
68b54a5f43 add a dist-thumb builder to build rust-std for the THUMB targets
the rust-std component only contains the core and compiler-builtins (+c +mem) crates

cc #49382
2018-04-01 18:50:21 +02:00
bors
06fa27d7c8 Auto merge of #49561 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 3 pull requests

- Successful merges: #49451, #49498, #49549
- Failed merges:
2018-04-01 16:34:27 +00:00
bjorn3
7a28ffce90 Fix miri Discriminant() for non-ADT 2018-04-01 18:33:50 +02:00
Mark Simulacrum
36f9f76356
Rollup merge of #49549 - Mark-Simulacrum:bootstrap-cleanup, r=alexcrichton
Remove filetime dep from build_helper

r? @alexcrichton
2018-04-01 18:04:57 +02:00
Mark Simulacrum
4799d2eb01
Rollup merge of #49498 - Manishearth:clippyup, r=oli-obk
Update clippy

r? @oli-obk
2018-04-01 18:04:56 +02:00
Mark Simulacrum
5d3916d566
Rollup merge of #49451 - QuietMisdreavus:epoch-doctests, r=GuillaumeGomez
rustdoc: add an --edition flag to compile docs/doctests with a certain edition

To correspond with the 2018 edition, this adds a (currently unstable) `--edition` flag to rustdoc that makes it compile crates and doctests with the given edition. Once this lands, Cargo should be updated to pass this flag when the edition configuration option is given.
2018-04-01 18:04:54 +02:00
bors
d2235f20b5 Auto merge of #49478 - Phlosioneer:fix-windows-file-not-found, r=petrochenkov
Fix escaped backslash in windows file not found message

When a module is declared, but no matching file exists, rustc gives
an error like `help: name the file either foo.rs or foo/mod.rs inside
the directory "src/bar"`. However, at on windows, the backslash was
double-escaped when naming the directory.

It did this because the string was printed in debug mode (`"{:?}"`) to
surround it with quotes. However, it should just be printed like any
other directory in an error message and surrounded by escaped quotes,
rather than relying on the debug print to add quotes (`"\"{}\""`).

I also checked the test suite to see if this output is being correctly tested. It's not - it only tests up to the word "directory". Presumably this is so that the test is not dependent on its exact position in the source tree. I don't know a better way to test this, unless the test suite supports regex?
2018-04-01 12:54:02 +00:00
Mark Simulacrum
86915ddf30 Remove filetime dep from build_helper 2018-04-01 04:49:21 -06:00
bors
cb1f89864e Auto merge of #49418 - frewsxcv:frewsxcv-network-order, r=TimNN
Clarify network byte order conversions for integer / IP address conversions.

Opened primarily to address https://github.com/rust-lang/rust/issues/48819.

Also added a few other conversion docs/examples.
2018-04-01 10:09:58 +00:00
Peter Hrvola
dc41851882 Fixed nits from PR review #49392 2018-04-01 10:01:51 +02:00
bors
85f0098405 Auto merge of #49545 - alexcrichton:proc-macro-fixes, r=eddyb
proc_macro: Tweak doc comments and negative literals

This commit tweaks the tokenization of a doc comment to use `#[doc = "..."]`
like `macro_rules!` does (instead of treating it as a `Literal` token).
Additionally it fixes treatment of negative literals in the compiler, for
exapmle `Literal::i32(-1)`. The current fix is a bit of a hack around the
current compiler implementation, providing a fix at the proc-macro layer rather
than the libsyntax layer.

Closes #48889
2018-04-01 07:22:28 +00:00
bors
804d8c88d9 Auto merge of #49530 - petrhosek:empty-extra-flags, r=cramertj
Only include space in RUSTFLAGS extra flags if not empty

When the RUSTFLAGS_STAGE_{1,2} is not set, including a space means
the string will always be non-empty and RUSTFLAGS will be always be
reset which breaks other ways of setting these such as through config
in CARGO_HOME.
2018-04-01 05:09:48 +00:00
bors
9ceaa5676b Auto merge of #49522 - mbrubeck:fs_read, r=SimonSapin
Rename fs::read_string to read_to_string and stabilize

As approved in https://github.com/rust-lang/rust/issues/46588#issuecomment-377530365

Closes #46588.
2018-04-01 02:44:45 +00:00
Phlosioneer
7a63900f42 Unignore borrowck test
Unignores a test that has been fixed.

See #44831
2018-03-31 20:35:11 -04:00
bors
2b49944006 Auto merge of #49527 - petrhosek:fast-submodules, r=alexcrichton
Handle fast-submodules option correctly

This option was introduced in 72cb109bec, but it uses two different
spellings (`fast-submodule` in `bootstrap.py` vs `fast-submodules` in
`config.toml.example`) and isn't handled by Rust bootstrap which means
that any attempt to set this flag fails.
2018-04-01 00:22:45 +00:00
Alex Crichton
ec1a8f081f proc_macro: Tweak doc comments and negative literals
This commit tweaks the tokenization of a doc comment to use `#[doc = "..."]`
like `macro_rules!` does (instead of treating it as a `Literal` token).
Additionally it fixes treatment of negative literals in the compiler, for
exapmle `Literal::i32(-1)`. The current fix is a bit of a hack around the
current compiler implementation, providing a fix at the proc-macro layer rather
than the libsyntax layer.
2018-03-31 14:16:05 -07:00
varkor
44ad8fd136 Shorten deprecation note 2018-03-31 21:44:12 +01:00
Phlosioneer
cb3097567f Add ignore reason 2018-03-31 16:23:50 -04:00
Phlosioneer
42bc0712f1 Remove whitespace 2018-03-31 16:08:58 -04:00
bors
517f24025a Auto merge of #49521 - mbrubeck:fs_read_write_bytes, r=TimNN
fs_read_write_bytes stabilized in 1.26.0

Fix the stabilization attributes from #49422 because it merged before 1.26 branched to beta.

r? @TimNN
2018-03-31 17:58:50 +00:00
nabijaczleweli
e1d3c471d7
Open the file as write before trying to flush it
This should be enough and shouldn't require append(true) since we're not
explicitly writing anything so we're not flushing it so we've no risk of
overwriting it
2018-03-31 19:12:29 +02:00
bors
e38eca6cac Auto merge of #49501 - sfackler:unix-epoch-assoc-const, r=alexcrichton
Make UNIX_EPOCH an associated constant of SystemTime

It's not very discoverable as a separate const in the module.

r? @alexcrichton
2018-03-31 15:33:28 +00:00
bors
70248b1fcf Auto merge of #49500 - oli-obk:mir_dep_graph, r=michaelwoerister
Introduce an edge from a const eval to the MIR of all statics it depends on

r? @michaelwoerister
2018-03-31 12:50:13 +00:00
bors
8dd24c8ed4 Auto merge of #49481 - SimonSapin:core-heap, r=alexcrichton
Move the alloc::allocator module to core::heap

This is the `Alloc` trait and its dependencies.
2018-03-31 09:11:21 +00:00
bors
085c4b43b5 Auto merge of #49201 - Phlosioneer:add-trivial-size-hints, r=SimonSapin
Implement some trivial size_hints for various iterators

This also implements ExactSizeIterator where applicable.

Addresses most of the Iterator traits mentioned in #23708.

I intend to do more, but I don't want to make the PR too large.
2018-03-31 06:40:56 +00:00
Scott McMurray
fb7deda274 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 :)
2018-03-30 23:06:05 -07:00
Phlosioneer
48e3c961eb Fix tidy trailing newlines 2018-03-31 01:26:02 -04:00
Phlosioneer
5057e3c9e1 Commit code for option size hint 2018-03-31 01:13:02 -04:00
Phlosioneer
fa1d125ae6 Add test for rustdoc ignore test
This will check for regression on issue #32556
2018-03-31 00:59:08 -04:00
bors
3c5f850958 Auto merge of #49472 - nikomatsakis:nll-optimize-constraint-prop-1, r=pnkfelix
optimize NLL constraint propagation a little

Removes a bone-headed hot spot in NLL constant propagation; we were re-allocating the stack vector and hashmap as we repeated the DFS. This change shares those resources across each call.

It also modifies the constraint list to be a linked list; arguably I should revert that, though, as this didn't turn out to be a perf hit and perhaps the old code was clearer? (Still, the new style appeals to me.)

r? @pnkfelix
2018-03-31 04:09:43 +00:00
Petr Hosek
c6bae16dc2 Only include space in RUSTFLAGS extra flags if not empty
When the RUSTFLAGS_STAGE_{1,2} is not set, including a space means
the string will always be non-empty and RUSTFLAGS will be always be
reset which breaks other ways of setting these such as through config
in CARGO_HOME.
2018-03-30 19:37:08 -07:00
bors
1c5283b472 Auto merge of #49459 - GuillaumeGomez:primitive-intra-links, r=QuietMisdreavus
Add primitive intra-links

Part of #43466.

r? @QuietMisdreavus
2018-03-31 01:34:15 +00:00