Commit Graph

50983 Commits

Author SHA1 Message Date
Simon Sapin
bbb45c41df Shorter output for rustc --test binaries.
A program created with `rustc --test` prints at least one line per test.
This can be very verbose, especially with [data-driven tests](
https://internals.rust-lang.org/t/test-and-external-test-harnesses/3145)
when hundreds or thousands of tests is not rare.

This adds a `-q` or `--quiet` option that changes the output
to one character instead of one line per test
(except metrics and benchmarks results which have additional data to
show):

```
     Running target/debug/wpt-75c594dc1e6e6187

running 314 tests
..............................................................................
..............................................................................
..............................................................................
..............................................................................
..
test result: ok. 314 passed; 0 failed; 0 ignored; 0 measured
```

This is a breaking change since the `test::TestOpts` struct
now has one more field.
2016-03-15 17:59:01 +01:00
bors
c116ae35cf Auto merge of #32020 - alexcrichton:stabilize-into-ascii, r=brson
These were intended to land in stable 1.8 but were just waiting for the
implementation PR, so now they're landing. Specifically this PR stabilizes:

* `AsciiExt::into_ascii_uppercase`
* `AsciiExt::into_ascii_lowercase`
* `AsciiExt for Vec<u8>`
* `AsciiExt for String`
2016-03-06 11:16:15 +00:00
bors
21fb3ce71b Auto merge of #31967 - mitaa:rdoc-refactor, r=alexcrichton
This is mostly cleanup of individual code bits and code reuse for `clean::Attribute` handling.

The only change in behaviour should be that emitted sources are now being recorded and queried when trying to create src-links to local source-files.

r? @alexcrichton
2016-03-06 09:16:32 +00:00
bors
8484831d29 Auto merge of #30884 - durka:inclusive-ranges, r=aturon
This PR implements [RFC 1192](https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md), which is triple-dot syntax for inclusive range expressions. The new stuff is behind two feature gates (one for the syntax and one for the std::ops types). This replaces the deprecated functionality in std::iter. Along the way I simplified the desugaring for all ranges.

This is my first contribution to rust which changes more than one character outside of a test or comment, so please review carefully! Some of the individual commit messages have more of my notes. Also thanks for putting up with my dumb questions in #rust-internals.

- For implementing `std::ops::RangeInclusive`, I took @Stebalien's suggestion from https://github.com/rust-lang/rfcs/pull/1192#issuecomment-137864421. It seemed to me to make the implementation easier and increase type safety. If that stands, the RFC should be amended to avoid confusion.
- I also kind of like @glaebhoerl's [idea](https://github.com/rust-lang/rfcs/pull/1254#issuecomment-147815299), which is unified inclusive/exclusive range syntax something like `x>..=y`. We can experiment with this while everything is behind a feature gate.
- There are a couple of FIXMEs left (see the last commit). I didn't know what to do about `RangeArgument` and I haven't added `Index` impls yet. Those should be discussed/finished before merging.

cc @Gankro since you [complained](https://www.reddit.com/r/rust/comments/3xkfro/what_happened_to_inclusive_ranges/cy5j0yq)
cc #27777 #30877 rust-lang/rust#1192 rust-lang/rfcs#1254
relevant to #28237 (tracking issue)
2016-03-06 07:16:41 +00:00
bors
45f0ce71c1 Auto merge of #31920 - jseyfried:fix_spurious_privacy_error, r=nikomatsakis
This PR allows using methods from traits that are visible but are defined in an inaccessible module (fixes #18241). For example,
```rust
mod foo {
    pub use foo::bar::Tr;
    mod bar { // This module is inaccessible from `g`
        pub trait Tr { fn f(&self) {} }
    }
}
fn g<T: foo::Tr>(t: T) {
    t.f(); // Currently, this is a privacy error even though `foo::Tr` is visible
}
```

After this PR, it will continue to be a privacy error to use a method from a trait that is not visible. This can happen when a public trait inherits from a private trait (in violation of the `public_in_private` lint) -- see @petrochenkov's example in #28504.
r? @nikomatsakis
2016-03-06 02:29:34 +00:00
bors
52e0bda644 Auto merge of #31889 - alexcrichton:update-jemalloc-again, r=nikomatsakis
Now that 767d85061a is upstream, the relevant deadlocking issue which prompted our downgrade has been resolved. As a result, there's no known issue to *not* upgrade! This also re-enables jemalloc for the pc-windows-gnu target as known issues with that have also been fixed.

Closes #31030
2016-03-05 23:44:51 +00:00
bors
3029e0918d Auto merge of #31726 - jseyfried:improve_import_resolution, r=nikomatsakis
This PR improves the import resolution algorithm.

First, it records that an import succeeded or failed for one namespace (by calling `decrement_outstanding_references_for` and `try_define_child` if successful) even if it is still indeterminate in the other namespace, fixing #31444.

Second, it starts importing bindings from globs as soon as the glob path is determined.
It maintains links from imported modules to their importers so that when a resolution becomes successful in an imported module, a corresponding binding will be added to the importer module.
It also maintains links from importer modules to imported modules so that we can determine if an undefined name is indeterminate or failing by recursively checking this in the imported modules.
This allows, for example:
```rust
mod foo {
    pub mod baz {}
    pub use bar::baz::*;
}

mod bar {
    pub use foo::*;
}
```
It also allows cycles of pub glob imports, although by to the current shadowing rules, the only way for such a cycle to compile is if each participating module defines no names. Incidentally, this PR lays the groundwork for more permissive feature-gated shadowing rules.

Finally, this PR encapsulates almost all implementation details of import resolution in `resolve_imports` (some of which used to be in `lib.rs`) and refactors reexport recording, shadowed trait collecting, some duplicate checking, and the `private_in_public` lint out of the core import resolution algorithm and into a post-processing pass in `resolve_imports`.

r? @nrc
2016-03-05 20:11:37 +00:00
bors
07a1803dd3 Auto merge of #31700 - oli-obk:skip_double_ended, r=alexcrichton
[Playground Example](https://play.rust-lang.org/?gist=66fdb4fe1cf4d8aa2ad4&version=stable)
2016-03-05 16:58:20 +00:00
Alex Burka
430b3e1960 remove under/overflow from next_back/next 2016-03-04 18:57:43 -05:00
Alex Burka
a928c8360c add underflow/overflow tests 2016-03-04 18:57:22 -05:00
Alex Burka
003120aa19 add more unstable annotations 2016-03-04 18:39:25 -05:00
bors
da0ccd8cc9 Auto merge of #32046 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #32002, #32017, #32027, #32035, #32036
- Failed merges:
2016-03-04 21:01:14 +00:00
Jeffrey Seyfried
b3572ae15a Finish encapsulating the details of import resolution in resolve_imports 2016-03-04 20:48:55 +00:00
Jeffrey Seyfried
51ca449f74 Refactor away define 2016-03-04 20:48:54 +00:00
Jeffrey Seyfried
20b99d303d Start importing bindings from globs as soon as the glob path is known. 2016-03-04 20:48:51 +00:00
Jeffrey Seyfried
fb4710ce21 Add a field in Module for the ResolverArenas 2016-03-04 20:48:50 +00:00
Jeffrey Seyfried
6b94bc345c Add an arena for import directives 2016-03-04 20:48:49 +00:00
Jeffrey Seyfried
064f17c6a3 Record that an import succeeded or failed in one namespace even while it is indeterminate in the other namespace (fixes #31444) 2016-03-04 20:48:43 +00:00
Steve Klabnik
d5aeb769e9 Rollup merge of #32036 - Seeker14491:patch-1, r=steveklabnik
To me it was unclear whether 'it' referred to the fold function, or the closure.
2016-03-04 14:17:29 -05:00
Steve Klabnik
b99354f07f Rollup merge of #32035 - ubsan:master, r=bluss
Just take out the `NOTE` and the `#[allow(improper_ctypes)]`
2016-03-04 14:17:29 -05:00
Steve Klabnik
1f0d928de8 Rollup merge of #32027 - japaric:rustbuild-mips, r=alexcrichton
These targets don't link statically to libunwind or libc

---

r? @alexcrichton
2016-03-04 14:17:29 -05:00
Steve Klabnik
805daa11b0 Rollup merge of #32017 - brson:ignoretest, r=nikomatsakis 2016-03-04 14:17:28 -05:00
Steve Klabnik
55bc488db4 Rollup merge of #32002 - srinivasreddy:vector_doc, r=Manishearth
Issue here : https://github.com/rust-lang/rust/issues/31991
2016-03-04 14:17:28 -05:00
mitaa
938c8c18c4 This doesn't seem necessary? 2016-03-04 19:40:01 +01:00
mitaa
d78f19ebbd Use const instead of function 2016-03-04 19:40:00 +01:00
mitaa
032156210d Use Item::is_* methods consistently 2016-03-04 19:40:00 +01:00
mitaa
2a28b69948 Refactor rustdocs attribute handling 2016-03-04 19:39:52 +01:00
Jeffrey Seyfried
d908ff1759 Don't treat associated types specially in def_privacy
Improve trait privacy error message
2016-03-04 18:30:24 +00:00
Jeffrey Seyfried
32f251cc1c Add test 2016-03-04 18:30:23 +00:00
Jeffrey Seyfried
13f5fca0f2 privacy: change def_privacy so that it checks for visiblity instead of nameability 2016-03-04 18:30:22 +00:00
mitaa
8f6e09a956 Simplify if let/match expressions 2016-03-04 19:07:35 +01:00
Alex Crichton
df9e173353 test: Clean up alloc_jemalloc usage in tests
Right now there's just a smattering of `// ignore-foo` platforms which is ever
expanding as new ones are added. Instead switch to only running these tests on
Linux/OSX and then use a guaranteed-to-work but not-as-well-tested alternative
on other platforms.
2016-03-04 09:53:50 -08:00
Alex Crichton
4fbc080033 std: Update jemalloc again to the 4.* track 2016-03-04 09:49:39 -08:00
bors
d31d8a9a91 Auto merge of #32039 - arielb1:pat-enum, r=nagisa
Fixes #32004

r? @eddyb
2016-03-04 17:19:40 +00:00
bors
c97524bef9 Auto merge of #32032 - arielb1:load-const, r=eddyb
Fixes #30891

r? @eddyb
2016-03-04 15:33:10 +00:00
Ariel Ben-Yehuda
f40d12f180 don't treat unit patterns as wildcard patterns
Fixes #32004
2016-03-04 15:50:55 +02:00
bors
85ad61c583 Auto merge of #32022 - gohyda:master, r=alexcrichton
- Empty `.sidebar .location` caused "grey line" on top of the documentation page (under 700px) fixed.
- `.sidebar .location` appearance improvement in responsive mode.
2016-03-04 13:47:02 +00:00
Ariel Ben-Yehuda
af55b4189f clean up check_pat_enum 2016-03-04 15:24:28 +02:00
Oliver Schneider
25e5de3f7e make skip a double ended iterator 2016-03-04 10:22:55 +01:00
Brian Bowman
84e6e04d83 Clarify ambiguous wording in fold() docs
To me it was unclear whether 'it' referred to the fold function, or the closure.
2016-03-04 01:09:23 -06:00
bors
5b5e521869 Auto merge of #32006 - jseyfried:fix_expanded_mod_path, r=nikomatsakis
This PR changes the search paths for macro-expanded non-inline modules so that they match ordinary non-inline modules (fixes #31624). This is a [breaking-change].

Right now, the search paths for a macro-expanded non-inline module are computed as if the module were declared in the top level of the file in which the macro was defined.
For example, consider `./foo/mod.rs`:
```rust
mod inconsequential { // moving the macro outside this module wouldn't change anything
    macro_rules! mod_decl {
        ($i:ident) => { mod $i; }
    }
}
```
and `./lib.rs`:
```rust
mod foo;

mod bar {
    mod_decl!(baz);
    //^ Now, rustc expects `./foo/baz.rs` (or `./foo/baz/mod.rs`)
    //| After this PR, rustc will expect `./bar/baz.rs` (or `./bar/baz/mod.rs`)
}
```
r? @alexcrichton
2016-03-04 06:55:11 +00:00
bors
8e261d12e3 Auto merge of #31945 - sfackler:net2, r=alexcrichton
I have these tagged as stable in 1.9, so this shouldn't merge until the 1.8 beta's cut.
2016-03-04 04:19:30 +00:00
ubsan
633cd84821 usize is now a proper ctype, so fix cmp_slice 2016-03-03 19:53:31 -08:00
Ariel Ben-Yehuda
cf29344c63 truncate i8-s to i1-s when loading constants
Fixes #30891
2016-03-04 01:16:23 +02:00
bors
e91f889ed3 Auto merge of #31671 - ranma42:printcfg, r=alexcrichton
Show `cfg` as possible argument to `--print` and make it so that `--print cfg` also outputs the `target_feature`s.

Should I also extend `src/test/run-make/print-cfg/Makefile` to check that `target_feature`s are actually printed?
2016-03-03 21:37:18 +00:00
bors
809b14acf1 Auto merge of #31797 - apasel422:issue-28950, r=alexcrichton
Closes #28950.

r? @eddyb
2016-03-03 19:52:11 +00:00
Jorge Aparicio
ddd2e99d02 [rustbuild] fix cross compilation of std for mips(el)-linux-musl
These targets don't link statically to libunwind or libc
2016-03-03 14:50:28 -05:00
Steven Fackler
e4aa513139 Fix netbsd 2016-03-03 09:54:15 -08:00
bors
493d999ffa Auto merge of #32007 - nikomatsakis:compiletest-incremental, r=alexcrichton
This PR extends compiletest to support **test revisions** and with a preliminary **incremental testing harness**. run-pass, compile-fail, and run-fail tests may be tagged with

```
// revisions: a b c d
```

This will cause the test to be re-run four times with `--cfg {a,b,c,d}` in turn. This means you can write very closely related things using `cfg`. You can also configure the headers/expected-errors by writing `//[foo] header: value` or `//[foo]~ ERROR bar`, where `foo` is the name of your revision. See the changes to `coherence-cow.rs` as a proof of concept.

The main point of this work is to support the incremental testing harness. This PR contains an initial, unused version. The code that uses it will land later. The incremental testing harness compiles each revision in turn, and requires that the revisions have particular names (e.g., `rpass2`, `cfail3`), which tell it whether a particular revision is expected to compile or not.

Two questions:

- Is there compiletest documentation anywhere I can update?
- Should I hold off on landing the incremental testing harness until I have the code to exercise it? (That will come in a separate PR, still fixing a few details)

r? @alexcrichton
cc @rust-lang/compiler <-- new testing capabilities
2016-03-03 17:41:13 +00:00
Alex Crichton
6f9afba602 std: Stabilize into_* ASCII methods
These were intended to land in stable 1.8 but were just waiting for the
implementation PR, so now they're landing. Specifically this PR stabilizes:

* `AsciiExt::into_ascii_uppercase`
* `AsciiExt::into_ascii_lowercase`
* `AsciiExt for Vec<u8>`
* `AsciiExt for String`
2016-03-03 09:11:59 -08:00