Commit graph

50754 commits

Author SHA1 Message Date
bors 1aa6ac38b2 Auto merge of #31858 - alexcrichton:fix-networking-cast, r=brson
Similar to #31825 where the read/write limits were capped for files, this
implements similar limits when reading/writing networking types. On Unix this
shouldn't affect anything because the write size is already a `usize`, but on
Windows this will cap the read/write amounts to `i32::max_value`.

cc #31841
2016-02-26 15:42:44 +00:00
bors f59fd46425 Auto merge of #31846 - alexcrichton:better-disable-jemallc, r=brson
The `--disable-jemalloc` configure option has a failure mode where it will
create a distribution that is not compatible with other compilers. For example
the nightly for Linux will assume that it will link to jemalloc by default as
an allocator for executable crates. If, however, a standard library is used
which was built via `./configure --disable-jemalloc` then this will fail
because the jemalloc crate wasn't built.

While this seems somewhat reasonable as a niche situation, the same mechanism is
used for disabling jemalloc for platforms that just don't support it. For
example if the rumprun target is compiled then the sibiling Linux target *also*
doesn't have jemalloc. This is currently a problem for our cross-build nightlies
which build many targets. If rumprun is also built, it will disable jemalloc for
all targets, which isn't desired.

This commit moves the platform-specific disabling of jemalloc as hardcoded logic
into the makefiles that is scoped per-platform. This way when configuring
multiple targets **without the `--disable-jemalloc` option specified** all
targets will get jemalloc as they should.
2016-02-26 13:38:46 +00:00
bors ee8b257d2e Auto merge of #31911 - Manishearth:rollup, r=Manishearth
- Successful merges: #31878, #31880, #31883, #31893, #31894, #31896, #31901, #31904
- Failed merges: #31897
2016-02-26 11:36:35 +00:00
Manish Goregaokar 3c9a26853c fixup #31878 2016-02-26 17:05:46 +05:30
Manish Goregaokar acea6fc1cb Rollup merge of #31904 - bluss:writer-formatter-error, r=alexcrichton
Make sure formatter errors are emitted by the default Write::write_fmt

Previously, if an error was returned from the formatter that did not
originate in an underlying writer error, Write::write_fmt would return
successfully even if the formatting did not complete (was interrupted by
an `fmt::Error` return).

Now we choose to emit an io::Error with kind Other for formatter errors.

Since this may reveal error returns from `write!()` and similar that
previously passed silently, it's a kind of a [breaking-change].

Fixes #31879
2016-02-26 17:03:42 +05:30
Manish Goregaokar 263e7228ca Rollup merge of #31901 - bluss:suggest-use, r=sanxiyn
suggest: Put the `use` in suggested code inside the quotes

Change import a trait suggestion from:

       help: candidate #1: use `std::io::Write`

to

       help: candidate #1: `use std::io::Write`

so that the code can be copied directly.

Fixes #31864
2016-02-26 17:03:42 +05:30
Manish Goregaokar f74855ed39 Rollup merge of #31896 - tshepang:idiom, r=steveklabnik 2016-02-26 17:03:41 +05:30
Manish Goregaokar 64af0ff74a Rollup merge of #31894 - tshepang:more-clear, r=steveklabnik 2016-02-26 17:03:41 +05:30
Manish Goregaokar 8d28d47995 Rollup merge of #31893 - tshepang:comma, r=steveklabnik 2016-02-26 17:03:41 +05:30
Manish Goregaokar 903798dce0 Rollup merge of #31883 - birkenfeld:doc-null-escape, r=bluss
It appears in the examples, but is not covered by any of the cases
in the prose description.
2016-02-26 17:03:40 +05:30
Manish Goregaokar a52c7dc27b Rollup merge of #31880 - Manishearth:debug, r=alexcrichton
Right this information isn't documented anywhere, sticking it into `make tips`
2016-02-26 17:03:40 +05:30
Manish Goregaokar cefbe505bd Rollup merge of #31878 - frewsxcv:path-cleanup, r=alexcrichton
None
2016-02-26 17:03:39 +05:30
bors 09130044ce Auto merge of #31834 - ubsan:copy_from_slice, r=alexcrichton
implements rust-lang/rfcs#1419

r? alexcrichton
2016-02-26 09:16:03 +00:00
Nicholas Mazzuca e12b1f9424 Add unstable copy_from_slice 2016-02-25 21:20:41 -08:00
Alex Crichton b980f22877 mk: Move disable-jemalloc logic into makefiles
The `--disable-jemalloc` configure option has a failure mode where it will
create a distribution that is not compatible with other compilers. For example
the nightly for Linux will assume that it will link to jemalloc by default as
an allocator for executable crates. If, however, a standard library is used
which was built via `./configure --disable-jemalloc` then this will fail
because the jemalloc crate wasn't built.

While this seems somewhat reasonable as a niche situation, the same mechanism is
used for disabling jemalloc for platforms that just don't support it. For
example if the rumprun target is compiled then the sibiling Linux target *also*
doesn't have jemalloc. This is currently a problem for our cross-build nightlies
which build many targets. If rumprun is also built, it will disable jemalloc for
all targets, which isn't desired.

This commit moves the platform-specific disabling of jemalloc as hardcoded logic
into the makefiles that is scoped per-platform. This way when configuring
multiple targets **without the `--disable-jemalloc` option specified** all
targets will get jemalloc as they should.
2016-02-25 21:05:59 -08:00
bors 9c6a0088fb Auto merge of #31857 - jseyfried:fix_scoping, r=nikomatsakis
This fixes a bug (#31845) introduced in #31105 in which lexical scopes contain items from all anonymous module ancestors, even if the path to the anonymous module includes a normal module:
```rust
fn f() {
    fn g() {}
    mod foo {
        fn h() {
           g(); // This erroneously resolves on nightly
        }
    }
}
```

This is a [breaking-change] on nightly but not on stable or beta.
r? @nikomatsakis
2016-02-26 04:38:28 +00:00
Ulrik Sverdrup 6cfafad3c5 Make sure formatter errors are emitted by the default Write::write_fmt
Previously, if an error was returned from the formatter that did not
originate in an underlying writer error, Write::write_fmt would return
successfully even if the formatting did not complete (was interrupted by
an `fmt::Error` return).

Now we choose to emit an io::Error with kind Other for formatter errors.

Since this may reveal error returns from `write!()` and similar that
previously passed silently, it's a kind of a [breaking-change].
2016-02-26 02:59:25 +01:00
bors 15e9a95a4b Auto merge of #31749 - nikomatsakis:compiletest-subdir, r=alexcrichton
You can now group tests into directories like `run-pass/borrowck` or `compile-fail/borrowck`. By default, all `.rs` files within any directory are considered tests: to ignore some directory, create a placeholder file called `compiletest-ignore-dir` (I had to do this for several existing directories).

r? @alexcrichton
cc @brson
2016-02-26 00:53:38 +00:00
Ulrik Sverdrup 5db43169de suggest: Put the use in suggested code inside the quotes
Change import a trait suggestion from:

   help: candidate #1: use `std::io::Write`

to

   help: candidate #1: `use std::io::Write`

so that the code can be copied directly.
2016-02-26 01:25:21 +01:00
Tshepang Lekhonkhobe 5eb46d9a01 doc: follow the idiom of adding a trailing comma 2016-02-25 23:19:47 +02:00
Tshepang Lekhonkhobe 6c21b1bad6 doc: that explanation was a mess 2016-02-25 23:14:20 +02:00
Tshepang Lekhonkhobe 52ed15fb7c doc: add missing comma 2016-02-25 22:52:02 +02:00
bors 798ce4ab59 Auto merge of #30856 - mneumann:thread_local_extern, r=alexcrichton
This will correctly add the thread_local attribute to the external static variable ```errno```:

```rust
extern {
     #[thread_local]
     static errno: c_int;
}
```

Before this commit, the thread_local attribute is ignored. Fixes #30795.

Thanks @alexcrichton for pointing out the solution.
2016-02-25 20:37:38 +00:00
Niko Matsakis d21434c9ca add comment and stop creating directories in runtest 2016-02-25 14:41:52 -05:00
Niko Matsakis a04b4b6213 create the required directories while gathering tests rather than during
parallel execution
2016-02-25 14:40:26 -05:00
bors c9852e2e55 Auto merge of #31882 - Manishearth:rollup, r=Manishearth
- Successful merges: #31362, #31793, #31800, #31809, #31818, #31827, #31831, #31835, #31837, #31846
- Failed merges:
2016-02-25 09:38:51 +00:00
Manish Goregaokar e584a492f3 Rollup merge of #31837 - mitaa:rdoc-inherent-assoc, r=alexcrichton
This effectively only records associated items from either inherent impls or trait definitions in the search-index.

fixes #31808

r? @alexcrichton
2016-02-25 15:06:07 +05:30
Manish Goregaokar 6078a86e2d Rollup merge of #31835 - mitaa:rdoc-global-src, r=alexcrichton
fixes #26995

r? @alexcrichton
2016-02-25 15:06:07 +05:30
Manish Goregaokar 39f41c64f9 Rollup merge of #31831 - tormol:master, r=alexcrichton
The "A buffer that's too small" example was calling encode_utf**8**().
2016-02-25 15:06:07 +05:30
Manish Goregaokar 4cfa2ee2f1 Rollup merge of #31827 - teoryn:patch-1, r=brson 2016-02-25 15:06:06 +05:30
Manish Goregaokar 7731cdc18c Rollup merge of #31818 - GuillaumeGomez:error_display, r=brson
Fixes #31788
2016-02-25 15:06:06 +05:30
Niko Matsakis 588d5d1e3d translate backslashes to forward slashes in the expected strings 2016-02-25 03:26:41 -05:00
Georg Brandl d472b69da1 Document the null-char/null-byte escape in the reference
It appears in the examples, but is not covered by any of the cases
in the prose description.
2016-02-25 08:30:42 +01:00
Manish Goregaokar db86810a60 Rollup merge of #31800 - alexcrichton:armv6-plz, r=brson
Right now the compiler's we're using actually default to armv7/thumb2 I believe,
so this should help push them back to what the arm-unknown-linux-* targets are
for. This at least matches that clang does for the `arm-unknown-linux-gnueabihf`
target which is to map it to an armv6 architecture.

Closes #31787
2016-02-25 11:41:01 +05:30
Manish Goregaokar 05485be02f Rollup merge of #31793 - alexcrichton:add-real-option-gating, r=nikomatsakis
This commit adds support for *truly* unstable options in the compiler, as well
as adding warnings for the start of the deprecation path of
unstable-but-not-really options. Specifically, the following behavior is now in
place for handling unstable options:

* As before, an unconditional error is emitted if an unstable option is passed
  and the `-Z unstable-options` flag is not present. Note that passing another
  `-Z` flag does not require passing `-Z unstable-options` as well.
* New flags added to the compiler will be in the `Unstable` category as opposed
  to the `UnstableButNotReally` category which means they will unconditionally
  emit an error when used on stable.
* All current flags are in a category where they will emit warnings when used
  that the option will soon be a hard error.

Also as before, it is intended that `-Z` is akin to `#![feature]` in a crate
where it is required to unlock unstable functionality. A nightly compiler which
is used without any `-Z` flags should only be exercising stable behavior.
2016-02-25 11:41:01 +05:30
Manish Goregaokar a48f95879d Rollup merge of #31362 - jseyfried:fix_extern_crate_visibility, r=nikomatsakis
This PR changes the visibility of extern crate declarations to match that of items (fixes #26775).
To avoid breakage, the PR makes it a `public_in_private` lint to reexport a private extern crate, and it adds the lint `inaccessible_extern_crate` for uses of an inaccessible extern crate.

The lints can be avoided by making the appropriate `extern crate` declaration public.
2016-02-25 11:41:01 +05:30
Manish Goregaokar bdecd9d904 mention debug-assertions 2016-02-25 10:21:32 +05:30
Corey Farwell c82be2f4cb Prefer 'match' pattern guard over conditional within body. 2016-02-24 22:50:23 -05:00
Corey Farwell 8adc3f74f5 Prefer slice::get over length check with indexing. 2016-02-24 22:34:23 -05:00
Niko Matsakis 6660ad6f8d Move the borrowck run-pass/compile-fail tests into their own directories
as a test.
2016-02-24 18:40:39 -05:00
Niko Matsakis 1c850d8448 Add compiletest-ignore-dir to existing subdirectories. 2016-02-24 18:40:39 -05:00
Niko Matsakis c1ec32d4f7 Recurse to find test files in any subdirectory of the base path. If a
subdirectory contains `compiletest-ignore-dir`, then ignore it.
2016-02-24 18:40:39 -05:00
Niko Matsakis 7c2e5e35a6 Generalize from passing around a single path to the test file to passing
around a set of paths called `TestPaths`

This commit is not quite standalone; it basically contains all the
borrowing plumbing bits, the interesting stuff comes in the next commit.
2016-02-24 18:40:38 -05:00
bors f6f050d090 Auto merge of #31873 - Manishearth:rollup, r=Manishearth
- Successful merges: #31677, #31784, #31839, #31842, #31843, #31850, #31863, #31868, #31870
- Failed merges:
2016-02-24 22:58:28 +00:00
Manish Goregaokar b660ca59ff Rollup merge of #31870 - ivan:filter-explain, r=steveklabnik
As a Rust newbie, I found the book's explanation for why the `filter` closure gets a reference very confusing, and tried to figure out why `filter` is somehow less consumptive than `map` -- but it isn't; that's controlled by `iter`/`into_iter`.  I flailed around for a while until @habnabit explained it to me, and in retrospect it is quite obvious :-)
2016-02-25 04:21:11 +05:30
Manish Goregaokar a834cd1b70 Rollup merge of #31868 - fhahn:capitalize-Rust, r=steveklabnik 2016-02-25 04:21:11 +05:30
Manish Goregaokar f28677506c Rollup merge of #31863 - matklad:clarify-reference, r=steveklabnik
Reference implied that use declarations may appear *only* at the top of blocks and modules, but it is not the case, and the following is valid:

```Rust
fn foo() {
    let x = 92;
    use baz::bar;
}
```

r? @steveklabnik
2016-02-25 04:21:11 +05:30
Manish Goregaokar 901eca9e6c Rollup merge of #31850 - GuillaumeGomez:vec-doc, r=steveklabnik
r? @steveklabnik
cc @mbrubeck
2016-02-25 04:21:11 +05:30
Manish Goregaokar b28debd91c Rollup merge of #31843 - Wafflespeanut:bool_docs, r=steveklabnik
fixes #29332

r? @steveklabnik
2016-02-25 04:21:10 +05:30
Manish Goregaokar ac02f9c18d Rollup merge of #31842 - dileepbapat:master, r=alexcrichton
I have made changes and built it after that. Please advise,

https://github.com/rust-lang/rust/issues/31820
2016-02-25 04:21:10 +05:30