Commit Graph

55124 Commits

Author SHA1 Message Date
ggomez
9b5db220c8 Add doc for btree_map types 2016-07-20 14:06:25 +02:00
bors
a63e3fac8f Auto merge of #33526 - steveklabnik:gh21889, r=alexcrichton
Add some warnings to std::env::current_exe

/cc #21889 @rust-lang/libs @semarie

I started writing this up. I'm not sure if we want to go into other things and in what depth; we don't currently have a lot of security-specific documentation to model after.

Thoughts?
2016-07-20 00:48:21 -07:00
mitchmindtree
aed2e5c1e5 Add the missing tracking issue field for #34931 to the receiver_try_iter stability attributes 2016-07-20 14:49:40 +10:00
Corey Farwell
00e3149ded Add doc examples for Vec::{as_slice,as_mut_slice}. 2016-07-19 21:34:45 -04:00
cgswords
536c315795 Introduced NoDelim and modified the compiler to support it. 2016-07-19 16:05:44 -07:00
Jeffrey Seyfried
485e2df1b1 Add regression test. 2016-07-19 20:22:20 +00:00
Jeffrey Seyfried
b40b7ef0c4 Support nested macro_rules!. 2016-07-19 20:15:58 +00:00
bors
48c245411b Auto merge of #34885 - GuillaumeGomez:btree_map_debug, r=alexcrichton
Add debug for btree_map::{Entry, VacantEntry, OccupiedEntry}
2016-07-19 12:50:15 -07:00
Srinivas Reddy Thatiparthy
9652fcbb6e
Run rustfmt on libsyntax_ext/deriving folder 2016-07-19 23:07:57 +05:30
Steve Klabnik
c4730daf45 re-work example 2016-07-19 12:32:56 -04:00
Corey Farwell
a005b2cd2a Rewrite/expand doc examples for Vec::set_len. 2016-07-19 12:31:41 -04:00
ggomez
4a2116b97a [CSS] Fix unwanted top margin for toggle wrapper 2016-07-19 15:03:32 +02:00
bors
27e766d7bc Auto merge of #34898 - sanxiyn:rollup, r=sanxiyn
Rollup of 5 pull requests

- Successful merges: #34807, #34853, #34875, #34884, #34889
- Failed merges:
2016-07-19 05:12:51 -07:00
Michael Woerister
f7820888da Add codegen test to make sure that closures are 'internalized' properly. 2016-07-19 06:22:35 -04:00
Guillaume Gomez
dae311ea3b Add debug for btree_map::{Entry, VacantEntry, OccupiedEntry} 2016-07-19 11:50:25 +02:00
Michael Woerister
4c605e52e6 Fix wrong condition in base::internalize_symbols(). 2016-07-19 05:47:28 -04:00
bors
92400cf8dc Auto merge of #33974 - habnabit:eintr-retry-for-read-iterators, r=alexcrichton
Retry on EINTR in Bytes and Chars.

>Since Bytes and Chars called directly into Read::read, they didn't use any of the retrying wrappers. This allows both iterator types to retry.
2016-07-19 01:20:50 -07:00
Alex Crichton
b45c15ecca mk: Remove -Wall -Werror everywhere
We're not writing C code, so there's not really much of a reason for us to get
warnings and errors from code we haven't written!
2016-07-19 00:04:47 -07:00
Alex Crichton
f77bcc86b1 rustc: Remove soft-float from MIPS targets
Right now two MIPS targets in the compiler, `mips-unknown-linux-{gnu,musl}` both
generate object files using the soft-float ABI through LLVM by default. This is
also expressed as the `-C soft-float` codegen option and otherwise isn't used
for any other target in the compiler. This option was added quite some time ago
(back in #9617), and nowadays it's more appropriate to be done through a codegen
option.

This is motivated by #34743 which necessitated an upgrade in the CMake
installation on our bots which necessitated an upgrade in the Ubuntu version
which invalidated the MIPS compilers we were using. The new MIPS compilers
(coming from Debian I believe) all have hard float enabled by default and soft
float support not built in. This meant that we couldn't upgrade the bots
until #34841 landed because otherwise we would fail to compile C code as the
`-msoft-float` option wouldn't work.

Unfortunately, though, this means that once we upgrade the bots the C code we're
compiling will be compiled for hard float and the Rust code will be compiled
for soft float, a bad mismatch! This PR remedies the situation such that Rust
will compile with hard float as well.

If this lands it will likely produce broken nightlies for a day or two while we
get around to upgrading the bots because the current C toolchain only produces
soft-float binaries, and now rust will be hard-float. Hopefully, though, the
upgrade can go smoothly!
2016-07-18 22:32:59 -07:00
bors
8052f73d7b Auto merge of #34879 - petrochenkov:fnptr, r=alexcrichton
Implement traits for variadic function pointers

Closes https://github.com/rust-lang/rust/issues/34874
cc https://github.com/rust-lang/rust/pull/28268

r? @alexcrichton
2016-07-18 18:09:25 -07:00
bors
bbfcb471db Auto merge of #34357 - tbu-:pr_exact_size_is_empty, r=brson
Add `is_empty` function to `ExactSizeIterator`

All other types implementing a `len` functions have `is_empty` already.
2016-07-18 14:26:22 -07:00
bors
9c88898076 Auto merge of #34899 - michaelwoerister:always_internalize_symbols, r=eddyb
Run base::internalize_symbols() even for single-codegen-unit crates.

The initial linkage-assignment (especially for closures) is a conservative one that makes some symbols more visible than they need to be. While this is not a correctness problem, it does force the LLVM inliner to be more conservative too, which results in poor performance. Once translation is based solely on MIR, it will be easier to also make the initial linkage assignment a better fitting one. Until then `internalize_symbols()` does a good job of preventing most performance regressions.

This should solve the regressions reported in https://github.com/rust-lang/rust/issues/34891 and maybe also those in https://github.com/rust-lang/rust/issues/34831.

As a side-effect, this will also solve most of the problematic cases described in https://github.com/rust-lang/rust/issues/34793. Not reliably so, however. For that, we still need a solution like the one implement in https://github.com/rust-lang/rust/pull/34830.

cc @rust-lang/compiler
2016-07-18 11:29:25 -07:00
Jack O'Connor
9b8130666d use a new feature name for String AddAssign 2016-07-18 14:27:17 -04:00
Jack O'Connor
cac58ab5b7 update the since field to 1.12.0 for String AddAssign 2016-07-18 14:00:35 -04:00
Tobias Bucher
7b2a03f08e Fix doctest of ExactSizeIterator::is_empty 2016-07-18 18:35:08 +02:00
Michael Woerister
22f77a9171 Run base::internalize_symbols() even for single-codegen-unit crates.
The initial linkage-assignment (especially for closures) is a conservative one that makes some symbols more visible than they need to be. While this is not a correctness problem, it does force the LLVM inliner to be more conservative too, which results in poor performance. Once translation is based solely on MIR, it will be easier to also make the initial linkage assignment a better fitting one. Until then `internalize_symbols()` does a good job of preventing most performance regressions.
2016-07-18 10:21:40 -04:00
Seo Sanghyeon
88b37b6d9c Rollup merge of #34889 - infinity0:master, r=sanxiyn
Test fixes for ARM64

When these changes are applied, rustc 1.10.0 tests pass successfully on [asachi.debian.org](https://db.debian.org/machines.cgi?host=asachi).
2016-07-18 22:44:57 +09:00
Seo Sanghyeon
1132a4ddfc Rollup merge of #34884 - shepmaster:from_raw_parts_doc, r=@nagisa
Improve {String,Vec}::from_raw_parts documentation
2016-07-18 22:44:56 +09:00
Seo Sanghyeon
b7138494ef Rollup merge of #34875 - frewsxcv:std-slice-struct, r=GuillaumeGomez
Indicate where `std::slice` structs originate from.

None
2016-07-18 22:44:56 +09:00
Seo Sanghyeon
15715c8377 Rollup merge of #34853 - frewsxcv:vec-truncate, r=GuillaumeGomez
Partial rewrite/expansion of `Vec::truncate` documentation.

None
2016-07-18 22:44:56 +09:00
Seo Sanghyeon
41fef433a0 Rollup merge of #34807 - sanxiyn:dump-mir, r=nagisa
Remove extra newlines in MIR dump
2016-07-18 22:44:56 +09:00
Jeffrey Seyfried
0042c1a620 Add librustc_driver::driver::reset_thread_local_state and
remove the thread local state reset at the beginning of `phase_1_parse_input`.
2016-07-18 10:10:11 +00:00
bors
06ca016b6e Auto merge of #34886 - jseyfried:improve_stmt_matchers, r=eddyb
macros: fix bug in `stmt` matchers

Today, `stmt` matchers stop too early when parsing expression statements that begin with non-braced macro invocations. For example,
```rust
fn main() {
    macro_rules! m { ($s:stmt;) => { $s } }
    id!(vec![].push(0););
    //^ Before this PR, the `stmt` matcher only consumes "vec![]", so this is an error.
    //| After this PR, the `stmt` matcher consumes "vec![].push(0)", so this compiles.
}
```
This change is backwards compatible due to the follow set for `stmt`.

r? @eddyb
2016-07-18 01:40:23 -07:00
Mark Buer
d820fcba12 Remove rustdoc reference to walk_dir 2016-07-18 17:54:15 +09:30
bors
6cc49e51de Auto merge of #34860 - jseyfried:encapsulate_hygiene, r=nrc
Clean up and encapsulate `syntax::ext::mtwt`, rename `mtwt` to `hygiene`

r? @nrc
2016-07-17 22:12:59 -07:00
ggomez
ce442b4f51 Add debug for hash_map::{Entry, VacantEntry, OccupiedEntry} 2016-07-18 01:38:19 +02:00
Jake Goulding
661187a95e Remove extraneous words 2016-07-17 18:19:20 -04:00
Jake Goulding
f6be6aa92a Document from_raw_parts involves ownership transfer 2016-07-17 18:18:49 -04:00
Jack O'Connor
6a09df9079 implement AddAssign for String 2016-07-17 15:30:21 -04:00
bors
f441bca499 Auto merge of #34876 - frewsxcv:vec-as-mut-slice, r=alexcrichton
Remove unnecessary indexing and deref in `Vec::as_mut_slice`.

None
2016-07-17 12:04:51 -07:00
Ximin Luo
8aaf0f894b doc/book: fix tests for non-x86 architectures, such as aarch64
`rustdoc --test` gets confused when "main" exists for some architectures but not others.
2016-07-17 21:00:24 +02:00
Ximin Luo
4e5e36fb79 test: disable more stdcall tests for ARM arches. temp workaround for #24958 2016-07-17 20:57:54 +02:00
Jeffrey Seyfried
275d321ab0 Remove some unit tests and that are redundant with run-pass/hygiene.rs
and that would be painful to rewrite.
2016-07-17 17:12:35 +00:00
Jeffrey Seyfried
44575f708a Rename mtwt to hygiene 2016-07-17 17:12:35 +00:00
Jeffrey Seyfried
76ed445622 Clean up and encapsulate syntax::ext::mtwt 2016-07-17 17:12:32 +00:00
Jeffrey Seyfried
bd1ad762b7 Add regression test 2016-07-17 16:08:09 +00:00
bors
34f35ed29c Auto merge of #34871 - petrochenkov:inherent, r=jseyfried
Do not resolve inherent static methods from other crates prematurely

Under some specific circumstances paths like `Type::method` can be resolved early in rustc_resolve instead of type checker. `Type` must be defined in another crate, it should be an enum or a trait object (i.e. a type that acts as a "module" in resolve), and `method` should be an inherent static method.
As a result, such paths don't go through `resolve_ufcs`, may be resolved incorrectly and break some invariants in type checker. This patch removes special treatment of such methods.

The removed code was introduced in 2bd46e767c to fix a problem that no longer exists.

r? @jseyfried
2016-07-17 09:07:50 -07:00
Jeffrey Seyfried
27a18b127f macros: Fix bug in statement matchers 2016-07-17 15:46:41 +00:00
Corey Farwell
b2f5b5a812 Indicate where std::slice structs originate from. 2016-07-17 09:16:47 -04:00
Novotnik, Petr
3b5d71e0cf Make .enumerate() example self-explanatory 2016-07-17 12:06:10 +02:00