]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoImprove time complexity of equality relations
Markus Westerlind [Thu, 3 Mar 2016 09:43:52 +0000 (10:43 +0100)]
Improve time complexity of equality relations

This PR adds a `UnificationTable` to the `TypeVariableTable` type which
is used store information about variable equality instead of just
storing them in a vector for later processing. By using a
`UnificationTable` equality relations can be resolved in O(n) (for all
realistic values of n) rather than O(n!) which can give massive
speedups in certain cases (see combine as an example).

Link to combine: https://github.com/Marwes/combine

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 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 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 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 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 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 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 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 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.

8 years agoclean up check_pat_enum
Ariel Ben-Yehuda [Fri, 4 Mar 2016 00:26:42 +0000 (02:26 +0200)]
clean up check_pat_enum

8 years agomake skip a double ended iterator
Oliver Schneider [Fri, 4 Mar 2016 09:22:55 +0000 (10:22 +0100)]
make skip a double ended iterator

8 years agoClarify ambiguous wording in fold() docs
Brian Bowman [Fri, 4 Mar 2016 07:09:23 +0000 (01:09 -0600)]
Clarify ambiguous wording in fold() docs

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

8 years agoAuto merge of #32006 - jseyfried:fix_expanded_mod_path, r=nikomatsakis
bors [Fri, 4 Mar 2016 06:55:11 +0000 (06:55 +0000)]
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

8 years agoAuto merge of #31945 - sfackler:net2, r=alexcrichton
bors [Fri, 4 Mar 2016 04:19:30 +0000 (04:19 +0000)]
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.

8 years ago`usize` is now a proper ctype, so fix cmp_slice
ubsan [Fri, 4 Mar 2016 03:53:31 +0000 (19:53 -0800)]
`usize` is now a proper ctype, so fix cmp_slice

8 years agotruncate i8-s to i1-s when loading constants
Ariel Ben-Yehuda [Thu, 3 Mar 2016 23:05:31 +0000 (01:05 +0200)]
truncate i8-s to i1-s when loading constants

Fixes #30891

8 years agoAuto merge of #31671 - ranma42:printcfg, r=alexcrichton
bors [Thu, 3 Mar 2016 21:37:18 +0000 (21:37 +0000)]
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?

8 years agoAuto merge of #31797 - apasel422:issue-28950, r=alexcrichton
bors [Thu, 3 Mar 2016 19:52:11 +0000 (19:52 +0000)]
Auto merge of #31797 - apasel422:issue-28950, r=alexcrichton

Closes #28950.

r? @eddyb

8 years ago[rustbuild] fix cross compilation of std for mips(el)-linux-musl
Jorge Aparicio [Thu, 3 Mar 2016 19:50:28 +0000 (14:50 -0500)]
[rustbuild] fix cross compilation of std for mips(el)-linux-musl

These targets don't link statically to libunwind or libc

8 years agoFix netbsd
Steven Fackler [Thu, 3 Mar 2016 17:54:15 +0000 (09:54 -0800)]
Fix netbsd

8 years agoAuto merge of #32007 - nikomatsakis:compiletest-incremental, r=alexcrichton
bors [Thu, 3 Mar 2016 17:41:13 +0000 (17:41 +0000)]
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

8 years agostd: Stabilize `into_*` ASCII methods
Alex Crichton [Thu, 3 Mar 2016 01:03:00 +0000 (17:03 -0800)]
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`

8 years agoadded ignore
srinivasreddy [Thu, 3 Mar 2016 16:24:21 +0000 (21:54 +0530)]
added ignore

8 years agoFix android build
Steven Fackler [Thu, 3 Mar 2016 16:11:07 +0000 (08:11 -0800)]
Fix android build

8 years agomention caveat about should-fail in docs
Niko Matsakis [Thu, 3 Mar 2016 16:18:42 +0000 (11:18 -0500)]
mention caveat about should-fail in docs

8 years agomake pretty printer tests understand revisions, and make them ignore the
Niko Matsakis [Thu, 3 Mar 2016 16:17:32 +0000 (11:17 -0500)]
make pretty printer tests understand revisions, and make them ignore the
should-fail annotation

8 years agoRefactor src-link creation for local sources
mitaa [Sat, 27 Feb 2016 06:35:05 +0000 (07:35 +0100)]
Refactor src-link creation for local sources

Since we emit the sources beforhand we actually **know** whether we
can safely create src-links to these files and where they are stored.

8 years agoAuto merge of #31979 - jseyfried:rename_ctxt, r=eddyb
bors [Thu, 3 Mar 2016 10:22:41 +0000 (10:22 +0000)]
Auto merge of #31979 - jseyfried:rename_ctxt, r=eddyb

r? @eddyb

8 years agoDo not assert revisions list is empty for pretty printing tests
Niko Matsakis [Thu, 3 Mar 2016 09:17:39 +0000 (04:17 -0500)]
Do not assert revisions list is empty for pretty printing tests

8 years agoHide gated cfg attributes from the output of `--print cfg`
Andrea Canciani [Thu, 3 Mar 2016 09:06:09 +0000 (10:06 +0100)]
Hide gated cfg attributes from the output of `--print cfg`

Gated cfg attributes are not available on the stable and beta release
channels, therefore they should not be presented to users of those
channels in order to avoid confusion.

8 years agoAuto merge of #32012 - bluss:more-drop-in-place, r=alexcrichton
bors [Thu, 3 Mar 2016 08:35:51 +0000 (08:35 +0000)]
Auto merge of #32012 - bluss:more-drop-in-place, r=alexcrichton

Use `drop_in_place` in Vec and VecDeque

We can use drop_in_place's DST capabilities directly in Vec::drop and similarly in VecDeque::drop. I verfied this has the same effect as the previous `needs_drop` code; `drop_in_place` it itself an intrinsic.

The VecDeque replacement should be more efficient too, even in release mode (slice iteration makes a more efficient loop than the deque iterator).

8 years agoRename middle::ty::ctxt to TyCtxt
Jeffrey Seyfried [Mon, 29 Feb 2016 23:36:51 +0000 (23:36 +0000)]
Rename middle::ty::ctxt to TyCtxt

8 years agoFix comments and OSX build
Steven Fackler [Thu, 3 Mar 2016 06:05:14 +0000 (22:05 -0800)]
Fix comments and OSX build

8 years agoResponsive layout correction.
gohyda [Thu, 3 Mar 2016 03:46:30 +0000 (04:46 +0100)]
Responsive layout correction.

8 years agoAuto merge of #31824 - jseyfried:privacy_in_resolve, r=nikomatsakis
bors [Thu, 3 Mar 2016 02:21:28 +0000 (02:21 +0000)]
Auto merge of #31824 - jseyfried:privacy_in_resolve, r=nikomatsakis

This PR privacy checks paths as they are resolved instead of in `librustc_privacy` (fixes #12334 and fixes #31779). This removes the need for the `LastPrivate` system introduced in PR #9735, the limitations of which cause #31779.

This PR also reports privacy violations in paths to intra- and inter-crate items the same way -- it always reports the first inaccessible segment of the path.

Since it fixes #31779, this is a [breaking-change]. For example, the following code would break:
```rust
mod foo {
    pub use foo::bar::S;
    mod bar { // `bar` should be private to `foo`
        pub struct S;
    }
}

impl foo::S {
    fn f() {}
}

fn main() {
    foo::bar::S::f(); // This is now a privacy error
}
```

r? @alexcrichton

8 years agoIgnore a rustdoc test that does not work on beta
Brian Anderson [Thu, 3 Mar 2016 00:34:18 +0000 (00:34 +0000)]
Ignore a rustdoc test that does not work on beta

8 years agoAdd test
Jeffrey Seyfried [Tue, 1 Mar 2016 12:17:12 +0000 (12:17 +0000)]
Add test

8 years agoFix the search paths for macro-expanded non-inline modules
Jeffrey Seyfried [Tue, 1 Mar 2016 09:28:42 +0000 (09:28 +0000)]
Fix the search paths for macro-expanded non-inline modules

8 years agoAdd `filename` to Parser
Jeffrey Seyfried [Wed, 2 Mar 2016 01:40:15 +0000 (01:40 +0000)]
Add `filename` to Parser

8 years agoAuto merge of #32005 - vegai:31686, r=Manishearth
bors [Wed, 2 Mar 2016 22:15:51 +0000 (22:15 +0000)]
Auto merge of #32005 - vegai:31686, r=Manishearth

Fix note for type alias in trait position

Fixes #31686

8 years agoBuild the same configuration when compiling and for `--print cfg`
Andrea Canciani [Wed, 2 Mar 2016 21:07:03 +0000 (22:07 +0100)]
Build the same configuration when compiling and for `--print cfg`

The configuration returned by `config::build_configuration` needs to
be modified with `target_features::add_configuration` in order to also
contain the target features. This is already done for the
configuration used when compiling and when creating the documentation,
but was missing in the `cfg` printing code.

8 years agoAdd usage documentation for `--print cfg`
Andrea Canciani [Sun, 14 Feb 2016 22:09:44 +0000 (23:09 +0100)]
Add usage documentation for `--print cfg`

The `--print` flag was extended in #31278 to accept `cfg`, but the
usage message was not updated.

8 years agoType defined here note added to test
vegai [Wed, 2 Mar 2016 20:29:54 +0000 (22:29 +0200)]
Type defined here note added to test

8 years agoadd a run-fail meta test
Niko Matsakis [Wed, 2 Mar 2016 19:25:25 +0000 (14:25 -0500)]
add a run-fail meta test

8 years agorename should-panic to should-fail, per acrichto's suggestion
Niko Matsakis [Wed, 2 Mar 2016 19:20:55 +0000 (14:20 -0500)]
rename should-panic to should-fail, per acrichto's suggestion

8 years agomake it possible for a test to declare `should-panic`
Niko Matsakis [Wed, 2 Mar 2016 16:34:46 +0000 (11:34 -0500)]
make it possible for a test to declare `should-panic`
and write a really basic "meta test" of the compilertest framework

8 years agoUpdate `COMPILER_TESTS.md` documentation to discuss revisions
Niko Matsakis [Wed, 2 Mar 2016 15:59:47 +0000 (10:59 -0500)]
Update `COMPILER_TESTS.md` documentation to discuss revisions

8 years agoAuto merge of #31996 - gandro:update-libc, r=alexcrichton
bors [Wed, 2 Mar 2016 17:41:00 +0000 (17:41 +0000)]
Auto merge of #31996 - gandro:update-libc, r=alexcrichton

This fixes the `x86_64-rumprun-netbsd` target.

r? @alexcrichton

8 years agoFix test to reflect new note
vegai [Wed, 2 Mar 2016 17:27:56 +0000 (19:27 +0200)]
Fix test to reflect new note

8 years agoUse ptr::drop_in_place in VecDeque::drop
Ulrik Sverdrup [Wed, 2 Mar 2016 16:54:43 +0000 (17:54 +0100)]
Use ptr::drop_in_place in VecDeque::drop

Just like for Vec. This should benefit both non-optimized and optimized
performance. Non-optimized since the intrinsic drop_in_place is easily
removed, and optimized because iterating the slices is more efficient
than using the VecDeque iterators.

8 years agoUse ptr::drop_in_place in Vec::truncate
Ulrik Sverdrup [Wed, 2 Mar 2016 16:48:50 +0000 (17:48 +0100)]
Use ptr::drop_in_place in Vec::truncate