]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #32071 - jseyfried:parse_pub, r=nikomatsakis
bors [Wed, 9 Mar 2016 09:45:33 +0000 (01:45 -0800)]
Auto merge of #32071 - jseyfried:parse_pub, r=nikomatsakis

Make errors for unnecessary visibility qualifiers consistent

This PR refactors away `syntax::parse::parser::ParsePub` so that unnecessary visibility qualifiers on variant fields are reported not by the parser but by `privacy::SanePrivacyVisitor` (thanks to @petrochenkov's drive-by improvements in #31919).

r? @nikomatsakis

8 years agoAuto merge of #32023 - matklad:diamonds-and-rust, r=nikomatsakis
bors [Wed, 9 Mar 2016 07:34:34 +0000 (23:34 -0800)]
Auto merge of #32023 - matklad:diamonds-and-rust, r=nikomatsakis

tests: add test for empty <>

Rust allows to specify an empty list of type and lifetime parameters, but there are no tests for it:

```
user@UNIT-326 [12:53:45] [~/projects/rust] [diamonds-and-rust]
-> % grep "<>" -R src/test
src/test/compile-fail/generic-type-params-name-repr.rs:    // And don't print <> at all when there's just defaults.
src/test/debuginfo/issue22656.rs:// when trying to handle a Vec<> or anything else that contains zero-sized
```

So let's add them! Besides it's such a wonderful opportunity to put a reference to Judas Priest band into the branch name ;)

8 years agoAuto merge of #31981 - achanda:unspecified-ip, r=alexcrichton
bors [Wed, 9 Mar 2016 05:13:29 +0000 (21:13 -0800)]
Auto merge of #31981 - achanda:unspecified-ip, r=alexcrichton

Exclude 0.0.0.0 from the list of globally routable addresses

8 years agoAuto merge of #32126 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 9 Mar 2016 00:13:19 +0000 (16:13 -0800)]
Auto merge of #32126 - steveklabnik:rollup, r=steveklabnik

Rollup of 7 pull requests

- Successful merges: #31772, #32083, #32084, #32092, #32099, #32103, #32115
- Failed merges:

8 years agoRollup merge of #32115 - tclfs:patch-1, r=apasel422
Steve Klabnik [Tue, 8 Mar 2016 18:44:12 +0000 (21:44 +0300)]
Rollup merge of #32115 - tclfs:patch-1, r=apasel422

Update a spelling inconsistency

L26: "zero cost" -> "zero-cost"

8 years agoRollup merge of #32103 - timmontague:patch-1, r=alexcrichton
Steve Klabnik [Tue, 8 Mar 2016 18:44:11 +0000 (21:44 +0300)]
Rollup merge of #32103 - timmontague:patch-1, r=alexcrichton

Fixed link in ownership documentation

Changed "[vector]" to a link to the vector documentation.

8 years agoRollup merge of #32099 - bluss:doc-string-slicing, r=alexcrichton
Steve Klabnik [Tue, 8 Mar 2016 18:44:11 +0000 (21:44 +0300)]
Rollup merge of #32099 - bluss:doc-string-slicing, r=alexcrichton

Clarify documentation for string slicing (Index impls)

Clarify documentation for string slicing (Index impls)

- Mention the sugared syntax for the implementations, since it's not
  apparent from the docs that `Index<Range<usize>>` corresponds to
  `&self[a..b]`.
- Be specific in that start <= end and end <= len

This is just one fix in response to #32057

8 years agoRollup merge of #32092 - bluss:operator-overload, r=steveklabnik
Steve Klabnik [Tue, 8 Mar 2016 18:44:11 +0000 (21:44 +0300)]
Rollup merge of #32092 - bluss:operator-overload, r=steveklabnik

Update syntax index with OpAssign traits

book: Update syntax index with OpAssign traits

The traits are stable from Rust 1.8.

8 years agoRollup merge of #32084 - gokhanettin:typo-in-comment, r=alexcrichton
Steve Klabnik [Tue, 8 Mar 2016 18:44:11 +0000 (21:44 +0300)]
Rollup merge of #32084 - gokhanettin:typo-in-comment, r=alexcrichton

Fix typos - mismatching parentheses in comments

Fixes mismatching parentheses in the comments of precision example.

r? @steveklabnik

8 years agoRollup merge of #32083 - nodakai:reference-scoped-enum-alias, r=nikomatsakis
Steve Klabnik [Tue, 8 Mar 2016 18:44:11 +0000 (21:44 +0300)]
Rollup merge of #32083 - nodakai:reference-scoped-enum-alias, r=nikomatsakis

reference.md: clarify the limitation of type alias on an enum

Tentatively define the current behavior as the specification.

Cf. rust-lang/rust#26264, rust-lang/rust#28556, rust-lang/rust#30936

8 years agoRollup merge of #31772 - nodakai:patch-1, r=steveklabnik
Steve Klabnik [Tue, 8 Mar 2016 18:44:10 +0000 (21:44 +0300)]
Rollup merge of #31772 - nodakai:patch-1, r=steveklabnik

Clarify the semantics of enum discriminants

cf. https://doc.rust-lang.org/error-index.html#E0082

> The default type for enum discriminants is isize, but it can be adjusted by adding the repr attribute to the enum declaration.

It would be great if anyone could check my English.

8 years agoAuto merge of #32009 - alexcrichton:trim-fulldeps, r=brson
bors [Tue, 8 Mar 2016 15:34:28 +0000 (07:34 -0800)]
Auto merge of #32009 - alexcrichton:trim-fulldeps, r=brson

mk: Distribute fewer TARGET_CRATES

Right now everything in TARGET_CRATES is built by default for all non-fulldeps
tests and is distributed by default for all target standard library packages.
Currenly this includes a number of unstable crates which are rarely used such as
`graphviz` and `rbml`>

This commit trims down the set of `TARGET_CRATES`, moves a number of tests to
`*-fulldeps` as a result, and trims down the dependencies of libtest so we can
distribute fewer crates in the `rust-std` packages.

8 years agoAuto merge of #31995 - alexcrichton:fix-make-clena-empty, r=brson
bors [Tue, 8 Mar 2016 13:34:37 +0000 (05:34 -0800)]
Auto merge of #31995 - alexcrichton:fix-make-clena-empty, r=brson

rustbuild: Fix building from an empty directory

A stray shutil.rmtree happened when it shouldn't have happened, causing the
entire build to fail.

8 years agoAuto merge of #31957 - GuillaumeGomez:error_display, r=brson
bors [Tue, 8 Mar 2016 11:31:30 +0000 (03:31 -0800)]
Auto merge of #31957 - GuillaumeGomez:error_display, r=brson

Add error file for E0152

It completes #31818.

However it is not complete yet:
 * test will need to be updated
 * the file name displayed is a bit too unclear.

I'm not sure yet what's the "correct" file name to display. If anyone has an idea on this, it'd be very appreciated.

r? @brson

8 years agoAuto merge of #31954 - japaric:rfc243, r=nikomatsakis
bors [Tue, 8 Mar 2016 09:31:04 +0000 (01:31 -0800)]
Auto merge of #31954 - japaric:rfc243, r=nikomatsakis

implement the `?` operator

The `?` postfix operator is sugar equivalent to the try! macro, but is more amenable to chaining:
`File::open("foo")?.metadata()?.is_dir()`.

`?` is accepted on any *expression* that can return a `Result`, e.g. `x()?`, `y!()?`, `{z}?`,
`(w)?`, etc. And binds more tightly than unary operators, e.g. `!x?` is parsed as `!(x?)`.

cc #31436

---

cc @aturon @eddyb

8 years agoAuto merge of #31606 - Ms2ger:ClosureKind, r=eddyb
bors [Tue, 8 Mar 2016 06:57:38 +0000 (22:57 -0800)]
Auto merge of #31606 - Ms2ger:ClosureKind, r=eddyb

Rename ClosureKind variants and stop re-exporting them.

8 years agoUpdate a spelling inconsistency
Tang Chenglong [Tue, 8 Mar 2016 05:42:05 +0000 (13:42 +0800)]
Update a spelling inconsistency

L26: "zero cost" -> "zero-cost"

8 years agoAuto merge of #29734 - Ryman:whitespace_consistency, r=Aatch
bors [Tue, 8 Mar 2016 04:06:17 +0000 (20:06 -0800)]
Auto merge of #29734 - Ryman:whitespace_consistency, r=Aatch

libsyntax: be more accepting of whitespace in lexer

Fixes #29590.

Perhaps this may need more thorough testing?

r? @Aatch

8 years agoupdate error messages in parse-fail tests
Jorge Aparicio [Tue, 8 Mar 2016 02:17:31 +0000 (21:17 -0500)]
update error messages in parse-fail tests

8 years agoAuto merge of #31986 - ashleysommer:emscripten_fixes, r=alexcrichton
bors [Tue, 8 Mar 2016 01:04:36 +0000 (01:04 +0000)]
Auto merge of #31986 - ashleysommer:emscripten_fixes, r=alexcrichton

Fix building libstd on emscripten targets.

The main cause of the problem is that libstd/os/mod.rs treats emscripten targets as an alias of linux targets, whereas liblibc treats emscripten targets as musl-compliant, so it gets a slightly different struct stat64 defined.
This commit adds conditional compilation checks to use the correct timestamp format on fs metadata functions in the case of compiling to emscripten targets.

This commit also depends needs https://github.com/ashleysommer/rust/commit/f1575cff2d631e977038fdba3fa3422ba5f8f2fe applied in order to successfully build libstd with emscripten target.

8 years agoreference.md: clarify the limitation of type alias on an enum
NODA, Kai [Mon, 15 Feb 2016 00:13:08 +0000 (08:13 +0800)]
reference.md: clarify the limitation of type alias on an enum

Cf. rust-lang/rust#26264

Signed-off-by: NODA, Kai <nodakai@gmail.com>
8 years agomk: Distribute fewer TARGET_CRATES
Alex Crichton [Wed, 2 Mar 2016 06:00:18 +0000 (22:00 -0800)]
mk: Distribute fewer TARGET_CRATES

Right now everything in TARGET_CRATES is built by default for all non-fulldeps
tests and is distributed by default for all target standard library packages.
Currenly this includes a number of unstable crates which are rarely used such as
`graphviz` and `rbml`>

This commit trims down the set of `TARGET_CRATES`, moves a number of tests to
`*-fulldeps` as a result, and trims down the dependencies of libtest so we can
distribute fewer crates in the `rust-std` packages.

8 years agoClarify documentation for string slicing (Index impls)
Ulrik Sverdrup [Mon, 7 Mar 2016 14:38:02 +0000 (15:38 +0100)]
Clarify documentation for string slicing (Index impls)

- Mention the sugared syntax for the implementations, since it's not
  apparent from the docs that `Index<Range<usize>>` corresponds to
  `&self[a..b]`.
- Be specific in that start <= end and end <= len

8 years agoimplement the `?` operator
Jorge Aparicio [Sun, 28 Feb 2016 22:38:48 +0000 (17:38 -0500)]
implement the `?` operator

The `?` postfix operator is sugar equivalent to the try! macro, but is more amenable to chaining:
`File::open("foo")?.metadata()?.is_dir()`.

`?` is accepted on any *expression* that can return a `Result`, e.g. `x()?`, `y!()?`, `{z}?`,
`(w)?`, etc. And binds more tightly than unary operators, e.g. `!x?` is parsed as `!(x?)`.

cc #31436

8 years agoFixed link
Tim Montague [Mon, 7 Mar 2016 18:30:25 +0000 (10:30 -0800)]
Fixed link

Changed "[vector]" to a link to the vector documentation.

8 years agoAuto merge of #32081 - cmbrandenburg:spell_fix, r=apasel422
bors [Mon, 7 Mar 2016 15:45:11 +0000 (15:45 +0000)]
Auto merge of #32081 - cmbrandenburg:spell_fix, r=apasel422

8 years agoAuto merge of #32078 - japaric:rustbuild-i686-musl, r=alexcrichton
bors [Mon, 7 Mar 2016 13:46:11 +0000 (13:46 +0000)]
Auto merge of #32078 - japaric:rustbuild-i686-musl, r=alexcrichton

- make sure we copy the third party objects (crt*.o) to the target stage directory.
- apply the x86_64-musl logic also to the i686-musl target.

---

r? @alexcrichton

8 years agoAuto merge of #31664 - nodakai:reference-negation, r=steveklabnik
bors [Mon, 7 Mar 2016 09:55:36 +0000 (09:55 +0000)]
Auto merge of #31664 - nodakai:reference-negation, r=steveklabnik

It would be great if someone could check my English.

8 years agoFix building libstd on on emscripten targets.
ashleysommer [Tue, 1 Mar 2016 10:48:03 +0000 (20:48 +1000)]
Fix building libstd on on emscripten targets.

Squashed 10 commits:
1) The main cause of the problem is that libstd/os/mod.rs treats emscripten targets as an alias of linux targets, whereas liblibc treats emscripten targets as musl-compliant, so it gets a slightly different struct stat64 defined.
This commit adds conditional compilation checks to use the correct timestamp format on fs metadata functions in the case of compiling to emscripten targets.

2) Update previous commit to comply with rust formatting standards.
Removed tab characters, remove trailing whitespaces.

3) Move emscripten changes into their own file under libstd/os/emscripten
Put libstd/os/linux/fs back to the way it was.

4) Cannot use stat.st_ctim on emscripten to get created time.

5) Remove compile-time conditionals for target_env = musl, it looks like musl builds compile fine already.

6) Undone some formatting changes that are no longer needed,
Removed some more target_env="musl" compilation checks that I missed from my previous commit.

7) upgrade to liblibc e19309c, it fixes the differences in the musl stat and stat64 definitions.

8) Undo the compile-time checks to check for emscripten (or musl targets) in the FileAttr struct.
No longer needed after updating liblibc to e19309c.

9) Change the MetadataExt implementation of emscripten fs.rs module to match the changes in new liblibc.

10) remove a stray return statement, should have been removed in the previous commit.

8 years agoAuto merge of #32051 - steveklabnik:gh9447, r=bluss
bors [Mon, 7 Mar 2016 06:54:36 +0000 (06:54 +0000)]
Auto merge of #32051 - steveklabnik:gh9447, r=bluss

Fixes #9447

8 years agoAuto merge of #32066 - ruud-v-a:fma, r=alexcrichton
bors [Mon, 7 Mar 2016 04:25:27 +0000 (04:25 +0000)]
Auto merge of #32066 - ruud-v-a:fma, r=alexcrichton

This adds support for fused multiply-add and multiply-subtract vector intrinsics for 128 and 256-bit vectors of `f32` and `f64`. These correspond to the intrinsics [listed here](https://software.intel.com/en-us/node/523929) except for the `_ss` and `_sd` variants. The intrinsics added are:

 * `fmadd`
 * `fmaddsub`
 * `fmsub`
 * `fmsubadd`
 * `fnmadd`
 * `fnmsub`

The “fma” target feature must be enabled by passing `-C target-feature=+fma` to rustc when using these, otherwise LLVM will complain.

I verified locally that the `x86_mm256_fmadd_ps` and `x86_mm256_fmsub_ps` work.

8 years agobook: Update syntax index with OpAssign traits
Ulrik Sverdrup [Wed, 23 Dec 2015 23:20:12 +0000 (00:20 +0100)]
book: Update syntax index with OpAssign traits

8 years agoAuto merge of #32064 - bluss:str-slice-panic, r=alexcrichton
bors [Mon, 7 Mar 2016 02:28:09 +0000 (02:28 +0000)]
Auto merge of #32064 - bluss:str-slice-panic, r=alexcrichton

Fix panic on string slicing error to truncate the string

The string may be arbitrarily long, but we want to limit the panic
message to a reasonable length. Truncate the string if it is too long
(simply to char boundary).

Also add details to the start <= end message. I think it's ok to flesh
out the code here, since it's in a cold function.

Fixes #32063

8 years agoAuto merge of #32061 - infinity0:master, r=alexcrichton
bors [Mon, 7 Mar 2016 00:30:09 +0000 (00:30 +0000)]
Auto merge of #32061 - infinity0:master, r=alexcrichton

Adding -Wno-error is more reliable and simple than trying to modify existing
flags. We've been using this in Debian already for the past few releases.
Making this change also encourages future maintainers towards "best practises".
Also take the opportunity to use the same method at all places in the file.

8 years agoAuto merge of #32060 - inrustwetrust:patch-1, r=alexcrichton
bors [Sun, 6 Mar 2016 22:32:35 +0000 (22:32 +0000)]
Auto merge of #32060 - inrustwetrust:patch-1, r=alexcrichton

Using spaces in the install path causes the issue in #31293.

8 years agoFix typos - mismatching parentheses in comments
Gökhan Karabulut [Sun, 6 Mar 2016 20:37:52 +0000 (22:37 +0200)]
Fix typos - mismatching parentheses in comments

8 years agoreference.md: clarify negation.
NODA, Kai [Mon, 15 Feb 2016 00:05:07 +0000 (08:05 +0800)]
reference.md: clarify negation.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
8 years agoupdate the src/liblibc submodule
Jorge Aparicio [Sun, 6 Mar 2016 20:34:20 +0000 (15:34 -0500)]
update the src/liblibc submodule

8 years agoAuto merge of #32056 - nikomatsakis:rustfmt-data-structures, r=alexcrichton
bors [Sun, 6 Mar 2016 19:06:56 +0000 (19:06 +0000)]
Auto merge of #32056 - nikomatsakis:rustfmt-data-structures, r=alexcrichton

8 years agoClarify the semantics of enum discriminants
Kai Noda [Fri, 19 Feb 2016 08:54:21 +0000 (16:54 +0800)]
Clarify the semantics of enum discriminants

cf. https://doc.rust-lang.org/error-index.html#E0082

8 years agoAuto merge of #32055 - mitaa:rdoc-strip-priv-imports, r=alexcrichton
bors [Sun, 6 Mar 2016 17:08:36 +0000 (17:08 +0000)]
Auto merge of #32055 - mitaa:rdoc-strip-priv-imports, r=alexcrichton

fixes #27104

r? @alexcrichton

8 years agoSpelling fix for "because"
Craig M. Brandenburg [Sun, 6 Mar 2016 15:37:30 +0000 (08:37 -0700)]
Spelling fix for "because"

8 years agoAuto merge of #32048 - bluss:overloaded-assign-op, r=eddyb
bors [Sun, 6 Mar 2016 15:10:44 +0000 (15:10 +0000)]
Auto merge of #32048 - bluss:overloaded-assign-op, r=eddyb

Do not trigger unused_assignments for overloaded AssignOps

If `v` were a type with some kind of indirection, so that `v += 1` would
have an effect even if `v` were not used anymore, the unused_assignments lint
would mark a false positive.

This exempts overloaded (non-primitive) assign ops from being treated as
assignments (they are method calls).

The previous compile-fail tests that ensure x += 1 can trigger for
primitive types continue to pass. Added a representative test for the
"view" indirection.

Fixes #31895

8 years agorustbuild: fix cross compilation of libstd to i686-unknown-linux-musl
Jorge Aparicio [Sun, 6 Mar 2016 13:19:51 +0000 (08:19 -0500)]
rustbuild: fix cross compilation of libstd to i686-unknown-linux-musl

- make sure we copy the third party objects (crt*.o) to the target stage directory.
- apply the x86_64-musl logic also to the i686-musl target.

8 years agoAuto merge of #32041 - arielb1:multiply-inexhaustive, r=eddyb
bors [Sun, 6 Mar 2016 13:13:14 +0000 (13:13 +0000)]
Auto merge of #32041 - arielb1:multiply-inexhaustive, r=eddyb

the assert was invalidated by PR #31020

Fixes #31561

r? @eddyb

8 years agoAuto merge of #32020 - alexcrichton:stabilize-into-ascii, r=brson
bors [Sun, 6 Mar 2016 11:16:15 +0000 (11:16 +0000)]
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`

8 years agoAuto merge of #31967 - mitaa:rdoc-refactor, r=alexcrichton
bors [Sun, 6 Mar 2016 09:16:32 +0000 (09:16 +0000)]
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

8 years agoSplit out rustdoc pass to strip private imports
mitaa [Sat, 5 Mar 2016 10:20:34 +0000 (11:20 +0100)]
Split out rustdoc pass to strip private imports

8 years agoAuto merge of #30884 - durka:inclusive-ranges, r=aturon
bors [Sun, 6 Mar 2016 07:16:41 +0000 (07:16 +0000)]
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)

8 years agoAuto merge of #31920 - jseyfried:fix_spurious_privacy_error, r=nikomatsakis
bors [Sun, 6 Mar 2016 02:29:34 +0000 (02:29 +0000)]
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

8 years agoUpdate tests
Jeffrey Seyfried [Thu, 3 Mar 2016 23:31:44 +0000 (23:31 +0000)]
Update tests

8 years agoRefactor away `ParsePub` and make errors for unnecessary visibility qualifiers consistent
Jeffrey Seyfried [Sun, 28 Feb 2016 15:58:47 +0000 (15:58 +0000)]
Refactor away `ParsePub` and make errors for unnecessary visibility qualifiers consistent

8 years agoAuto merge of #31889 - alexcrichton:update-jemalloc-again, r=nikomatsakis
bors [Sat, 5 Mar 2016 23:44:51 +0000 (23:44 +0000)]
Auto merge of #31889 - alexcrichton:update-jemalloc-again, r=nikomatsakis

Now that https://github.com/jemalloc/jemalloc/commit/767d85061a6fb88ec977bbcd9b429a43aff391e6 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

8 years agoAuto merge of #31726 - jseyfried:improve_import_resolution, r=nikomatsakis
bors [Sat, 5 Mar 2016 20:11:37 +0000 (20:11 +0000)]
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

8 years agoFix panic on string slicing error to truncate the string
Ulrik Sverdrup [Sat, 5 Mar 2016 17:09:14 +0000 (18:09 +0100)]
Fix panic on string slicing error to truncate the string

The string may be arbitrarily long, but we want to limit the panic
message to a reasonable length. Truncate the string if it is too long
(simply to char boundary).

Also add details to the start <= end message. I think it's ok to flesh
out the code here, since it's in a cold function.

8 years agoAuto merge of #31700 - oli-obk:skip_double_ended, r=alexcrichton
bors [Sat, 5 Mar 2016 16:58:20 +0000 (16:58 +0000)]
Auto merge of #31700 - oli-obk:skip_double_ended, r=alexcrichton

[Playground Example](https://play.rust-lang.org/?gist=66fdb4fe1cf4d8aa2ad4&version=stable)

8 years agoRegenerate x86 platform intrinsics
Ruud van Asseldonk [Sat, 5 Mar 2016 15:25:58 +0000 (16:25 +0100)]
Regenerate x86 platform intrinsics

The exact command used was:

    $ cd src/etc/platform-intrinsics/x86
    $ python2 ../generator.py --format compiler-defs -i info.json   \
      sse.json sse2.json sse3.json ssse3.json sse41.json sse42.json \
      avx.json avx2.json fma.json                                   \
      > ../../../librustc_platform_intrinsics/x86.rs

8 years agoUpdate platform intrinsic generator script
Ruud van Asseldonk [Sat, 5 Mar 2016 15:17:55 +0000 (16:17 +0100)]
Update platform intrinsic generator script

The file it generates had been modified, but instead the generator
should have been modified, and the file regenerated. This merges the
modifications into the template in the generator.

8 years agoDefine x86 fused multiply-add intrinsics
Ruud van Asseldonk [Sat, 5 Mar 2016 14:52:08 +0000 (15:52 +0100)]
Define x86 fused multiply-add intrinsics

This defines the following intrinsics for 128 and 256 bit vectors of f32
and f64:

 * `fmadd`
 * `fmaddsub`
 * `fmsub`
 * `fmsubadd`
 * `fnmadd`
 * `fnmsub`

The `_sd` and `_ss` variants are not included yet.

Intel intrinsic reference: https://software.intel.com/en-us/node/523929

The intrinsics there are listed under AVX2, but in the Intel Intrinsic
Guide they are part of the "FMA" technology, and LLVM puts them under
FMA, not AVX2.

8 years agoMore reliable and consistent method of cancelling -Werror*
Angus Lees [Sun, 24 Jan 2016 10:07:47 +0000 (21:07 +1100)]
More reliable and consistent method of cancelling -Werror*

Adding -Wno-error is more reliable and simple than trying to modify existing
flags. We've been using this in Debian already for the past few releases.
Making this change also encourages future maintainers towards "best practises".
Also take the opportunity to use the same method at all places in the file.

8 years agoadopt new header style to sidestep rust-lang-nursery/rustfmt#836
Niko Matsakis [Sat, 5 Mar 2016 11:54:24 +0000 (06:54 -0500)]
adopt new header style to sidestep rust-lang-nursery/rustfmt#836

8 years agoapply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836
Niko Matsakis [Sat, 5 Mar 2016 13:40:33 +0000 (08:40 -0500)]
apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836

8 years agoAdd note about avoiding spaces in MinGW install path
John Talling [Sat, 5 Mar 2016 13:10:25 +0000 (14:10 +0100)]
Add note about avoiding spaces in MinGW install path

Using spaces in the install path causes the issue in #31293.

8 years agoremove under/overflow from next_back/next
Alex Burka [Fri, 4 Mar 2016 23:57:43 +0000 (18:57 -0500)]
remove under/overflow from next_back/next

8 years agoadd underflow/overflow tests
Alex Burka [Fri, 4 Mar 2016 23:57:22 +0000 (18:57 -0500)]
add underflow/overflow tests

8 years agoadd more unstable annotations
Alex Burka [Fri, 4 Mar 2016 23:39:25 +0000 (18:39 -0500)]
add more unstable annotations

8 years agoEnd stdlib module summaries with a full stop.
Steve Klabnik [Fri, 4 Mar 2016 22:37:11 +0000 (17:37 -0500)]
End stdlib module summaries with a full stop.

Fixes #9447

8 years agoDo not trigger unused_variables lint for variable modified through AddAssign
Ulrik Sverdrup [Fri, 4 Mar 2016 21:52:34 +0000 (22:52 +0100)]
Do not trigger unused_variables lint for variable modified through AddAssign

Visit an overloaded += like a method call and not like an assignment.

8 years agoAuto merge of #32046 - steveklabnik:rollup, r=steveklabnik
bors [Fri, 4 Mar 2016 21:01:14 +0000 (21:01 +0000)]
Auto merge of #32046 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #32002, #32017, #32027, #32035, #32036
- Failed merges:

8 years agoFinish encapsulating the details of import resolution in resolve_imports
Jeffrey Seyfried [Tue, 16 Feb 2016 11:48:38 +0000 (11:48 +0000)]
Finish encapsulating the details of import resolution in resolve_imports

8 years agoRefactor away define
Jeffrey Seyfried [Tue, 16 Feb 2016 13:14:32 +0000 (13:14 +0000)]
Refactor away define

8 years agoStart importing bindings from globs as soon as the glob path is known.
Jeffrey Seyfried [Tue, 16 Feb 2016 03:54:14 +0000 (03:54 +0000)]
Start importing bindings from globs as soon as the glob path is known.

8 years agoAdd a field in Module for the ResolverArenas
Jeffrey Seyfried [Mon, 15 Feb 2016 05:18:55 +0000 (05:18 +0000)]
Add a field in Module for the ResolverArenas

8 years agoAdd an arena for import directives
Jeffrey Seyfried [Mon, 15 Feb 2016 02:22:59 +0000 (02:22 +0000)]
Add an arena for import directives

8 years agoRecord that an import succeeded or failed in one namespace even while it is indetermi...
Jeffrey Seyfried [Sat, 13 Feb 2016 21:49:16 +0000 (21:49 +0000)]
Record that an import succeeded or failed in one namespace even while it is indeterminate in the other namespace (fixes #31444)

8 years agoAdd liveness test for unused_assignments for tricky lhs
Ulrik Sverdrup [Fri, 4 Mar 2016 20:44:45 +0000 (21:44 +0100)]
Add liveness test for unused_assignments for tricky lhs

8 years agoDo not trigger unused_assignments for overloaded AssignOps
Ulrik Sverdrup [Fri, 4 Mar 2016 20:01:59 +0000 (21:01 +0100)]
Do not trigger unused_assignments for overloaded AssignOps

If `v` were a type with some kind of indirection, so that `v += 1` would
have an effect even if `v` were not used anymore, the unused_assignments lint
would mark a false positive.

This exempts overloaded (non-primitive) assign ops from being treated as
assignments (they are method calls).

The previous compile-fail tests that ensure x += 1 can trigger for
primitive types continue to pass. Added a representative test for the
"view" indirection.

8 years agoRollup merge of #32036 - Seeker14491:patch-1, r=steveklabnik
Steve Klabnik [Fri, 4 Mar 2016 19:17:29 +0000 (14:17 -0500)]
Rollup merge of #32036 - Seeker14491:patch-1, r=steveklabnik

To me it was unclear whether 'it' referred to the fold function, or the closure.

8 years agoRollup merge of #32035 - ubsan:master, r=bluss
Steve Klabnik [Fri, 4 Mar 2016 19:17:29 +0000 (14:17 -0500)]
Rollup merge of #32035 - ubsan:master, r=bluss

Just take out the `NOTE` and the `#[allow(improper_ctypes)]`

8 years agoRollup merge of #32027 - japaric:rustbuild-mips, r=alexcrichton
Steve Klabnik [Fri, 4 Mar 2016 19:17:29 +0000 (14:17 -0500)]
Rollup merge of #32027 - japaric:rustbuild-mips, r=alexcrichton

These targets don't link statically to libunwind or libc

---

r? @alexcrichton

8 years agoRollup merge of #32017 - brson:ignoretest, r=nikomatsakis
Steve Klabnik [Fri, 4 Mar 2016 19:17:28 +0000 (14:17 -0500)]
Rollup merge of #32017 - brson:ignoretest, r=nikomatsakis

8 years agoRollup merge of #32002 - srinivasreddy:vector_doc, r=Manishearth
Steve Klabnik [Fri, 4 Mar 2016 19:17:28 +0000 (14:17 -0500)]
Rollup merge of #32002 - srinivasreddy:vector_doc, r=Manishearth

Issue here : https://github.com/rust-lang/rust/issues/31991

8 years agoFormatting changes to make tidy pass
Abhishek Chanda [Wed, 2 Mar 2016 07:42:37 +0000 (23:42 -0800)]
Formatting changes to make tidy pass

8 years agoReject the reserved block as not global
Abhishek Chanda [Tue, 1 Mar 2016 18:58:56 +0000 (10:58 -0800)]
Reject the reserved block as not global

8 years agoExclude 0.0.0.0 from the list of globally routable addresses
Abhishek Chanda [Tue, 1 Mar 2016 03:35:15 +0000 (19:35 -0800)]
Exclude 0.0.0.0 from the list of globally routable addresses

8 years agoThis doesn't seem necessary?
mitaa [Sun, 28 Feb 2016 15:38:51 +0000 (16:38 +0100)]
This doesn't seem necessary?

8 years agoUse const instead of function
mitaa [Sun, 28 Feb 2016 13:01:43 +0000 (14:01 +0100)]
Use const instead of function

8 years agoUse `Item::is_*` methods consistently
mitaa [Sun, 28 Feb 2016 11:23:07 +0000 (12:23 +0100)]
Use `Item::is_*` methods consistently

8 years agoRefactor rustdocs attribute handling
mitaa [Sun, 28 Feb 2016 09:12:41 +0000 (10:12 +0100)]
Refactor rustdocs attribute handling

8 years agoDon't treat associated types specially in `def_privacy`
Jeffrey Seyfried [Fri, 26 Feb 2016 20:31:00 +0000 (20:31 +0000)]
Don't treat associated types specially in `def_privacy`

Improve trait privacy error message

8 years agoAdd test
Jeffrey Seyfried [Fri, 26 Feb 2016 19:24:15 +0000 (19:24 +0000)]
Add test

8 years agoprivacy: change def_privacy so that it checks for visiblity instead of nameability
Jeffrey Seyfried [Fri, 26 Feb 2016 19:20:53 +0000 (19:20 +0000)]
privacy: change def_privacy so that it checks for visiblity instead of nameability

8 years agoSimplify `if let`/`match` expressions
mitaa [Sun, 28 Feb 2016 11:11:13 +0000 (12:11 +0100)]
Simplify `if let`/`match` expressions

8 years agotest: Clean up alloc_jemalloc usage in tests
Alex Crichton [Thu, 25 Feb 2016 17:51:45 +0000 (09:51 -0800)]
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.

8 years agostd: Update jemalloc again to the 4.* track
Alex Crichton [Thu, 25 Feb 2016 17:37:47 +0000 (09:37 -0800)]
std: Update jemalloc again to the 4.* track

8 years agoAuto merge of #32039 - arielb1:pat-enum, r=nagisa
bors [Fri, 4 Mar 2016 17:19:40 +0000 (17:19 +0000)]
Auto merge of #32039 - arielb1:pat-enum, r=nagisa

Fixes #32004

r? @eddyb

8 years agoAuto merge of #32032 - arielb1:load-const, r=eddyb
bors [Fri, 4 Mar 2016 15:33:10 +0000 (15:33 +0000)]
Auto merge of #32032 - arielb1:load-const, r=eddyb

Fixes #30891

r? @eddyb

8 years agoremove wrong assert in check_match
Ariel Ben-Yehuda [Fri, 4 Mar 2016 14:10:22 +0000 (16:10 +0200)]
remove wrong assert in check_match

the assert was invalidated by PR #31020

Fixes #31561

8 years agodon't treat unit patterns as wildcard patterns
Ariel Ben-Yehuda [Fri, 4 Mar 2016 13:34:28 +0000 (15:34 +0200)]
don't treat unit patterns as wildcard patterns

Fixes #32004

8 years agoAuto merge of #32022 - gohyda:master, r=alexcrichton
bors [Fri, 4 Mar 2016 13:47:02 +0000 (13:47 +0000)]
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.