]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agorustdoc: Render `extern fn` instead of `extern "C" fn`
Oliver Middleton [Wed, 27 Apr 2016 17:43:51 +0000 (18:43 +0100)]
rustdoc: Render `extern fn` instead of `extern "C" fn`

8 years agorustdoc: Cleanup ABI rendering
Oliver Middleton [Fri, 22 Apr 2016 10:48:46 +0000 (11:48 +0100)]
rustdoc: Cleanup ABI rendering

Use a common method for rendering `extern "<abi>"`.

This now consistently shows `extern "C" fn` rather than just `extern fn`.

8 years agoAuto merge of #33079 - bluss:split-iter, r=alexcrichton
bors [Thu, 21 Apr 2016 23:17:55 +0000 (16:17 -0700)]
Auto merge of #33079 - bluss:split-iter, r=alexcrichton

Split core::iter module implementation into parts

Split core::iter module implementation into parts

split iter.rs into a directory of (implementation private) modules.

+ mod (adaptor structs whose private fields need to be available both for them and Iterator
  + iterator (Iterator trait)
  + traits (FromIterator, etc; all traits but Iterator itself)
  + range (range related)
  + sources (Repeat, Once, Empty)

8 years agoAuto merge of #33074 - mitaa:rdoc-irlst, r=alexcrichton
bors [Thu, 21 Apr 2016 17:52:15 +0000 (10:52 -0700)]
Auto merge of #33074 - mitaa:rdoc-irlst, r=alexcrichton

rustdoc: Fix the strip-hidden `ImplStripper`

Instead of stripping impls which reference *stripped* items, we keep impls which reference *retained* items. We do this because when we strip an item we immediately return, and do not recurse into it - leaving the contained items non-stripped from the point of view of the `ImplStripper`.

fixes #33069

r? @alexcrichton

8 years agoAuto merge of #33030 - nagisa:mir-unrequire-end-block, r=nikomatsakis
bors [Thu, 21 Apr 2016 04:25:26 +0000 (21:25 -0700)]
Auto merge of #33030 - nagisa:mir-unrequire-end-block, r=nikomatsakis

MIR: Do not require END_BLOCK to always exist

Basically, all this does, is removing restriction for END_BLOCK to exist past the first invocation of RemoveDeadBlocks pass. This way for functions whose CFG does not reach the `END_BLOCK` end up not containing the block.

As far as the implementation goes, I’m not entirely satisfied with the `BasicBlock::end_block`. I had hoped to make `new` a `const fn` and then just have a `const END_BLOCK` private to mir::build, but it turns out that constant functions don’t yet support conditionals nor a way to assert.

8 years agoAuto merge of #33011 - alexcrichton:pkg-everything, r=brson
bors [Wed, 20 Apr 2016 21:58:20 +0000 (14:58 -0700)]
Auto merge of #33011 - alexcrichton:pkg-everything, r=brson

rustbuild: Package librustc & co for cross-hosts

Currently the `rust-std` package produced by rustbuild only contains the
standard library plus libtest, but the makefiles actually produce a `rust-std`
package with all known target libraries (including libsyntax, librustc, etc).
Tweak the behavior so the dependencies of the `dist-docs` step in rustbuild
depend on the compiler libraries as well (so that they're all packaged).

Closes #32984

8 years agoAuto merge of #32968 - alexcrichton:update-suport, r=brson
bors [Wed, 20 Apr 2016 19:28:34 +0000 (12:28 -0700)]
Auto merge of #32968 - alexcrichton:update-suport, r=brson

doc: Update our tier support

This modifies our listing of tiered platforms a few ways:

* All lists are alphabetized based on target now
* Lots of targets are moved up to "Tier 2" as we're gating on all these builds
  and official releases are provided (and installable via rustup).
* A few targets now list having a compiler + cargo now as well.

No more platforms have been moved up to Tier 1 at this time, however. The only
real candidate is ``x86_64-unknown-linux-musl`, but that's not *quite* to a tier
1 level of quality just yet so let's hold off for another release or so to iron
it out a bit.

8 years agoAuto merge of #31709 - ranma42:target_feature-from-llvm, r=alexcrichton
bors [Wed, 20 Apr 2016 16:57:57 +0000 (09:57 -0700)]
Auto merge of #31709 - ranma42:target_feature-from-llvm, r=alexcrichton

Compute `target_feature` from LLVM

This is a work-in-progress fix for #31662.

The logic that computes the target features from the command line has been replaced with queries to the `TargetMachine`.

8 years agoAuto merge of #32939 - eddyb:layout, r=nikomatsakis
bors [Wed, 20 Apr 2016 14:27:59 +0000 (07:27 -0700)]
Auto merge of #32939 - eddyb:layout, r=nikomatsakis

Compute LLVM-agnostic type layouts in rustc.

Layout for monomorphic types, and some polymorphic ones (e.g. `&T` where `T: Sized`),
can now be computed by rustc without involving LLVM in the actual process.

This gives rustc the ability to evaluate `size_of` or `align_of`, as well as obtain field offsets.
MIR-based CTFE will eventually make use of these layouts, as will MIR trans, shortly.

Layout computation also comes with a `[breaking-change]`, or two:
* `"data-layout"` is now mandatory in custom target specifications, reverting the decision from #27076.
This string is needed because it describes endianness, pointer size and alignments for various types.
We have the first two and we could allow tweaking alignments in target specifications.
Or we could also extract the data layout from LLVM and feed it back into rustc.
However, that can vary with the LLVM version, which is fragile and undermines stability.
For built-in targets, I've added a check that the hardcoded data-layout matches LLVM defaults.
* `transmute` calls are checked in a stricter fashion, which fixes #32377

To expand on `transmute`, there are only 2 allowed patterns: between types with statically known sizes and between pointers with the same potentially-unsized "tail" (which determines the type of unsized metadata they use, if any).
If you're affected, my suggestions are:
* try to use casts (and raw pointer deref) instead of transmutes
* *really* try to avoid `transmute` where possible
* if you have a structure, try working on individual fields and unpack/repack the structure instead of transmuting it whole, e.g. `transmute::<RefCell<Box<T>>, RefCell<*mut T>>(x)` doesn't work, but `RefCell::new(Box::into_raw(x.into_inner()))` does (and `Box::into_raw` is just a `transmute`)

8 years agoAuto merge of #32951 - LukasKalbertodt:collection_contains_rfc1552, r=brson
bors [Wed, 20 Apr 2016 11:58:44 +0000 (04:58 -0700)]
Auto merge of #32951 - LukasKalbertodt:collection_contains_rfc1552, r=brson

Add `contains` to `VecDeque` and `LinkedList` (+ tests)

This implements [RFC 1552](https://github.com/rust-lang/rfcs/blob/master/text/1552-contains-method-for-various-collections.md). Tracking issue: #32630

Sorry for the late response. This is my first contribution, so please tell me if anything isn't optimal!

8 years agoAuto merge of #32942 - alexcrichton:bootstrap-from-previous, r=brson
bors [Wed, 20 Apr 2016 08:16:55 +0000 (01:16 -0700)]
Auto merge of #32942 - alexcrichton:bootstrap-from-previous, r=brson

mk: Bootstrap from stable instead of snapshots

This commit removes all infrastructure from the repository for our so-called
snapshots to instead bootstrap the compiler from stable releases. Bootstrapping
from a previously stable release is a long-desired feature of distros because
they're not fans of downloading binary stage0 blobs from us. Additionally, this
makes our own CI easier as we can decommission all of the snapshot builders and
start having a regular cadence to when we update the stage0 compiler.

A new `src/etc/get-stage0.py` script was added which shares some code with
`src/bootstrap/bootstrap.py` to read a new file, `src/stage0.txt`, which lists
the current stage0 compiler as well as cargo that we bootstrap from. This script
will download the relevant `rustc` package an unpack it into `$target/stage0` as
we do today.

One problem of bootstrapping from stable releases is that we're not able to
compile unstable code (e.g. all the `#![feature]` directives in libcore/libstd).
To overcome this we employ two strategies:

* The bootstrap key of the previous compiler is hardcoded into `src/stage0.txt`
  (enabled as a result of #32731) and exported by the build system. This enables
  nightly features in the compiler we download.
* The standard library and compiler are pinned to a specific stage0, which
  doesn't change, so we're guaranteed that we'll continue compiling as we start
  from a known fixed source.

The process for making a release will also need to be tweaked now to continue to
cadence of bootstrapping from the previous release. This process looks like:

1. Merge `beta` to `stable`
2. Produce a new stable compiler.
3. Change `master` to bootstrap from this new stable compiler.
4. Merge `master` to `beta`
5. Produce a new beta compiler
6. Change `master` to bootstrap from this new beta compiler.

Step 3 above should involve very few changes as `master` was previously
bootstrapping from `beta` which is the same as `stable` at that point in time.
Step 6, however, is where we benefit from removing lots of `#[cfg(stage0)]` and
get to use new features. This also shouldn't slow the release too much as steps
1-5 requires little work other than waiting and step 6 just needs to happen at
some point during a release cycle, it's not time sensitive.

Closes #29555
Closes #29557

8 years agoCheck that the feature strings are well-formed
Andrea Canciani [Wed, 20 Apr 2016 07:09:30 +0000 (09:09 +0200)]
Check that the feature strings are well-formed

Assert that the feature strings are NUL terminated, so that they will
be well-formed as C strings.

This is a safety check to ease the maintaninace and update of the
feature lists.

8 years agoMake the feature whitelists constants
Andrea Canciani [Wed, 20 Apr 2016 07:08:25 +0000 (09:08 +0200)]
Make the feature whitelists constants

This simplifies the code a bit and makes the types nicer, too.

8 years agoAuto merge of #32903 - alexcrichton:fix-rpath, r=brson
bors [Wed, 20 Apr 2016 05:53:17 +0000 (22:53 -0700)]
Auto merge of #32903 - alexcrichton:fix-rpath, r=brson

rustbuild: Fix --enable-rpath usage

This commit fixes the `--enable-rpath` configure flag in rustbuild to work
despite the compile-time directories being different than the runtime
directories. This unfortunately means that we can't use `-C rpath` out of the
box but hopefully the portability story here isn't too bad as
`src/librustc_back/rpath.rs` isn't *too* complicated.

Closes #32886

8 years agoAuto merge of #31253 - ranma42:improve-unicode-iter-offset, r=brson
bors [Wed, 20 Apr 2016 02:17:08 +0000 (19:17 -0700)]
Auto merge of #31253 - ranma42:improve-unicode-iter-offset, r=brson

Improve computation of offset in `EscapeUnicode`

Unify the computation of `offset` and use `leading_zeros` instead of manually scanning the bits.
This PR removes some duplicated code and makes it a little simpler .
The computation of `offset` is also faster, but it is unlikely to have an impact on actual code.

(split from #31049)

8 years agoAdd test for `target_feature`
Andrea Canciani [Tue, 19 Apr 2016 16:37:39 +0000 (18:37 +0200)]
Add test for `target_feature`

This test checks that all of the x86 architectures (both `x86` and
`x86_64`) have the `sse2` feature. This is currently true for all of
the targets whose target CPU is `pentium4` (or better), but it might
fail on other targets (for example on `i586`).

8 years agoGenerate block containing return lazily instead
Simonas Kazlauskas [Tue, 19 Apr 2016 21:13:30 +0000 (00:13 +0300)]
Generate block containing return lazily instead

8 years agomk: Bootstrap from stable instead of snapshots
Alex Crichton [Wed, 13 Apr 2016 18:18:35 +0000 (11:18 -0700)]
mk: Bootstrap from stable instead of snapshots

This commit removes all infrastructure from the repository for our so-called
snapshots to instead bootstrap the compiler from stable releases. Bootstrapping
from a previously stable release is a long-desired feature of distros because
they're not fans of downloading binary stage0 blobs from us. Additionally, this
makes our own CI easier as we can decommission all of the snapshot builders and
start having a regular cadence to when we update the stage0 compiler.

A new `src/etc/get-stage0.py` script was added which shares some code with
`src/bootstrap/bootstrap.py` to read a new file, `src/stage0.txt`, which lists
the current stage0 compiler as well as cargo that we bootstrap from. This script
will download the relevant `rustc` package an unpack it into `$target/stage0` as
we do today.

One problem of bootstrapping from stable releases is that we're not able to
compile unstable code (e.g. all the `#![feature]` directives in libcore/libstd).
To overcome this we employ two strategies:

* The bootstrap key of the previous compiler is hardcoded into `src/stage0.txt`
  (enabled as a result of #32731) and exported by the build system. This enables
  nightly features in the compiler we download.
* The standard library and compiler are pinned to a specific stage0, which
  doesn't change, so we're guaranteed that we'll continue compiling as we start
  from a known fixed source.

The process for making a release will also need to be tweaked now to continue to
cadence of bootstrapping from the previous release. This process looks like:

1. Merge `beta` to `stable`
2. Produce a new stable compiler.
3. Change `master` to bootstrap from this new stable compiler.
4. Merge `master` to `beta`
5. Produce a new beta compiler
6. Change `master` to bootstrap from this new beta compiler.

Step 3 above should involve very few changes as `master` was previously
bootstrapping from `beta` which is the same as `stable` at that point in time.
Step 6, however, is where we benefit from removing lots of `#[cfg(stage0)]` and
get to use new features. This also shouldn't slow the release too much as steps
1-5 requires little work other than waiting and step 6 just needs to happen at
some point during a release cycle, it's not time sensitive.

Closes #29555
Closes #29557

8 years agoDistinguish different `vfp?` features
Andrea Canciani [Thu, 14 Apr 2016 11:02:47 +0000 (13:02 +0200)]
Distinguish different `vfp?` features

The different generations of ARM floating point VFP correspond to the
LLVM CPU features named `vfp2`, `vfp3`, and `vfp4`; they are now
exposed in Rust under the same names.

This commit fixes some crashes that would occour when checking if the
`vfp` feature exists (the crash occurs because the linear scan of the
LLVM feature goes past the end of the features whenever it searches
for a feature that does not exist in the LLVM tables).

8 years agoDo not intern NUL terminators
Andrea Canciani [Sun, 10 Apr 2016 12:21:00 +0000 (14:21 +0200)]
Do not intern NUL terminators

The C representation needed by LLVM requires strings to be
NUL-terminated, but on the Rust side they should not contain unwanted
NULs.

8 years agoAuto merge of #33060 - jseyfried:cleanup_resolve, r=nrc
bors [Tue, 19 Apr 2016 15:02:59 +0000 (08:02 -0700)]
Auto merge of #33060 - jseyfried:cleanup_resolve, r=nrc

resolve: miscellaneous clean-ups

This PR consists of some small, miscellaneous clean-ups in `resolve`.
r? @eddyb

8 years agoCheck transmutes between types without statically known sizes.
Eduard Burtescu [Tue, 19 Apr 2016 14:03:30 +0000 (17:03 +0300)]
Check transmutes between types without statically known sizes.

8 years agoGuard against rustc::layout diverging from rustc_trans.
Eduard Burtescu [Tue, 19 Apr 2016 12:57:34 +0000 (15:57 +0300)]
Guard against rustc::layout diverging from rustc_trans.

8 years agoCompute LLVM-agnostic type layouts in rustc.
Eduard Burtescu [Tue, 19 Apr 2016 06:11:46 +0000 (09:11 +0300)]
Compute LLVM-agnostic type layouts in rustc.

# Conflicts:
# src/librustc/ty/layout.rs

8 years agoParse data-layout specifications.
Eduard Burtescu [Mon, 18 Apr 2016 13:03:16 +0000 (16:03 +0300)]
Parse data-layout specifications.

8 years agoMake data-layout mandatory in target specs.
Eduard Burtescu [Mon, 18 Apr 2016 12:38:45 +0000 (15:38 +0300)]
Make data-layout mandatory in target specs.

8 years agoAuto merge of #33002 - mitaa:rdoc-cross-impls, r=alexcrichton
bors [Tue, 19 Apr 2016 12:00:10 +0000 (05:00 -0700)]
Auto merge of #33002 - mitaa:rdoc-cross-impls, r=alexcrichton

rustdoc: refine cross-crate impl inlining

This changes the current rule that impls within `doc(hidden)` modules aren't inlined, to only inlining impls where the implemented trait and type are reachable in documentation.

fixes #14586
fixes #31948

.. and also applies the reachability checking to cross-crate links.

fixes #28480

r? @alexcrichton

8 years agoAuto merge of #32985 - caipre:rustdoc-disambiguate-impl-anchors, r=alexcrichton
bors [Tue, 19 Apr 2016 08:49:13 +0000 (01:49 -0700)]
Auto merge of #32985 - caipre:rustdoc-disambiguate-impl-anchors, r=alexcrichton

rustdoc: Disambiguate anchors

Closes https://github.com/rust-lang/rust/issues/32890

8 years agoAuto merge of #32866 - davidhewitt:master, r=apasel422
bors [Tue, 19 Apr 2016 04:05:58 +0000 (21:05 -0700)]
Auto merge of #32866 - davidhewitt:master, r=apasel422

Implement `From<Vec<T>>` and `Into<Vec<T>>` for `VecDeque<T>`

8 years agoAuto merge of #32755 - alexcrichton:rustbuild-start-test, r=brson
bors [Tue, 19 Apr 2016 00:53:58 +0000 (17:53 -0700)]
Auto merge of #32755 - alexcrichton:rustbuild-start-test, r=brson

rustbuild: Add support for compiletest test suites

This commit adds support in rustbuild for running all of the compiletest test
suites as part of `make check`. The `compiletest` program was moved to
`src/tools` (like `rustbook` and others) and is now just compiled like any other
old tool. Each test suite has a pretty standard set of dependencies and just
tweaks various parameters to the final compiletest executable.

Note that full support is lacking in terms of:

* Once a test suite has passed, that's not remembered. When a test suite is
  requested to be run, it's always run.
* The arguments to compiletest probably don't work for every possible
  combination of platforms and testing environments just yet. There will likely
  need to be future updates to tweak various pieces here and there.
* Cross compiled test suites probably don't work just yet, support for that will
  come in a follow-up patch.

8 years agorustbuild: Add support for compiletest test suites
Alex Crichton [Tue, 5 Apr 2016 18:34:23 +0000 (11:34 -0700)]
rustbuild: Add support for compiletest test suites

This commit adds support in rustbuild for running all of the compiletest test
suites as part of `make check`. The `compiletest` program was moved to
`src/tools` (like `rustbook` and others) and is now just compiled like any other
old tool. Each test suite has a pretty standard set of dependencies and just
tweaks various parameters to the final compiletest executable.

Note that full support is lacking in terms of:

* Once a test suite has passed, that's not remembered. When a test suite is
  requested to be run, it's always run.
* The arguments to compiletest probably don't work for every possible
  combination of platforms and testing environments just yet. There will likely
  need to be future updates to tweak various pieces here and there.
* Cross compiled test suites probably don't work just yet, support for that will
  come in a follow-up patch.

8 years agocore::iter: Move ExactSizeIterator impls to each struct definition
Ulrik Sverdrup [Mon, 18 Apr 2016 21:44:02 +0000 (23:44 +0200)]
core::iter: Move ExactSizeIterator impls to each struct definition

8 years agoAuto merge of #33081 - steveklabnik:rollup, r=steveklabnik
bors [Mon, 18 Apr 2016 19:03:14 +0000 (12:03 -0700)]
Auto merge of #33081 - steveklabnik:rollup, r=steveklabnik

Rollup of 6 pull requests

- Successful merges: #32558, #32906, #33007, #33008, #33035, #33058
- Failed merges: #32912

8 years agoRollup merge of #33058 - Manishearth:fx-E0102, r=GuillaumeGomez
Steve Klabnik [Mon, 18 Apr 2016 18:50:35 +0000 (14:50 -0400)]
Rollup merge of #33058 - Manishearth:fx-E0102, r=GuillaumeGomez

Update E0102's example (fixes #33057)

r? @GuillaumeGomez

8 years agoRollup merge of #33035 - jbranchaud:use-consistent-variable-names-in-ownership, r...
Steve Klabnik [Mon, 18 Apr 2016 18:50:35 +0000 (14:50 -0400)]
Rollup merge of #33035 - jbranchaud:use-consistent-variable-names-in-ownership, r=GuillaumeGomez

Use `v` instead of `v1` for consistency

The code examples and previous paragraphs all use `v` and `v2`

8 years agoRollup merge of #33008 - sanmai-NL:patch-1, r=steveklabnik
Steve Klabnik [Mon, 18 Apr 2016 18:50:35 +0000 (14:50 -0400)]
Rollup merge of #33008 - sanmai-NL:patch-1, r=steveklabnik

grammar: fix

Reading this, one item stood out a bit. Small improvements here.

1. ‘Compile-time’ is not a noun, ‘compilation time’ was meant;
1. Mathematical formulas are best not rendered as code;
1. Use the same tense as in other items.

8 years agoRollup merge of #33007 - notriddle:master, r=steveklabnik
Steve Klabnik [Mon, 18 Apr 2016 18:50:35 +0000 (14:50 -0400)]
Rollup merge of #33007 - notriddle:master, r=steveklabnik

Do not use "bind" to refer to both referencing and to assignment

See https://users.rust-lang.org/t/difference-between-four-references/5406/7

8 years agoRollup merge of #32906 - jocki84:jocki84-book-size, r=steveklabnik
Steve Klabnik [Mon, 18 Apr 2016 18:50:34 +0000 (14:50 -0400)]
Rollup merge of #32906 - jocki84:jocki84-book-size, r=steveklabnik

Reword explanation of 'size' types.

Do not reference machine 'pointers' in explanation of 'size' types.

I think the number of elements that can be directly addressed is a fundamental feature of a machine architecture in its own right. The fact that it coincides with the ‘size’ of a pointer should be viewed as an ‘implementation detail’ ;)

8 years agoRollup merge of #32558 - sanxiyn:rustdoc-self-link, r=steveklabnik
Steve Klabnik [Mon, 18 Apr 2016 18:50:34 +0000 (14:50 -0400)]
Rollup merge of #32558 - sanxiyn:rustdoc-self-link, r=steveklabnik

Avoid linking to itself in implementors section of trait page

Fix #32474.

8 years agocore::iter: break long lines
Ulrik Sverdrup [Mon, 18 Apr 2016 18:21:08 +0000 (20:21 +0200)]
core::iter: break long lines

8 years agoSplit core::iter module implementation into parts
Ulrik Sverdrup [Mon, 18 Apr 2016 18:08:27 +0000 (20:08 +0200)]
Split core::iter module implementation into parts

split iter.rs into a directory of (implementation private) modules.

+ mod Adaptor structs
  - Private fields need to be available both for them and Iterator
+ iterator (Iterator trait)
+ traits (FromIterator, traits but Iterator itself)
+ range (range related)
+ sources (Repeat, Once, Empty)

8 years agoAdded From<VecDeque<T>> for Vec<T> and From<Vec<T>> for VecDeque<T>
David Hewitt [Sat, 9 Apr 2016 22:33:43 +0000 (23:33 +0100)]
Added From<VecDeque<T>> for Vec<T> and From<Vec<T>> for VecDeque<T>

8 years agoAuto merge of #33042 - alexcrichton:clean-doc, r=nikomatsakis
bors [Mon, 18 Apr 2016 16:53:13 +0000 (09:53 -0700)]
Auto merge of #33042 - alexcrichton:clean-doc, r=nikomatsakis

rustbuild: Clean more as part of `make clean`

Clean out old documentation as well as the new test/tools directories. Should
prevent a problem that happened this morning where a PR bounced and then it left
docs with "broken links" so all future PRs bounced.

8 years agoFix the strip-hidden `ImplStripper`
mitaa [Mon, 18 Apr 2016 15:32:00 +0000 (17:32 +0200)]
Fix the strip-hidden `ImplStripper`

Instead of stripping impls which reference *stripped* items, we keep impls
which reference *retained* items. We do this because when we strip an
item we immediately return, and do not recurse into it - leaving the
contained items non-stripped from the point of view of the `ImplStripper`.

8 years agoUpdate E0102's example (fixes #33057)
Manish Goregaokar [Sun, 17 Apr 2016 19:05:06 +0000 (00:35 +0530)]
Update E0102's example (fixes #33057)

8 years agoAuto merge of #33064 - jseyfried:improve_resolve_performance, r=eddyb
bors [Mon, 18 Apr 2016 02:11:20 +0000 (19:11 -0700)]
Auto merge of #33064 - jseyfried:improve_resolve_performance, r=eddyb

resolve: Improve performance

This fixes #33061 by speeding up searchs through all traits in scope, a bottleneck in `resolve`.

According to my measurements, this PR improves resolution performance by a factor of 3.4x on `librustc`, which almost completely reverses the 3.75x performance regression reported in #33061.

r? @eddyb

8 years agoresolve: improve performance
Jeffrey Seyfried [Mon, 18 Apr 2016 00:00:18 +0000 (00:00 +0000)]
resolve: improve performance

8 years agorustdoc: Disambiguate anchors for assoc item impls
Nick Platt [Sat, 16 Apr 2016 15:46:52 +0000 (11:46 -0400)]
rustdoc: Disambiguate anchors for assoc item impls

8 years agoUpdate outdated comment
Jeffrey Seyfried [Mon, 18 Apr 2016 00:26:18 +0000 (00:26 +0000)]
Update outdated comment

8 years agoReachability check cross-crate links
mitaa [Sun, 17 Apr 2016 06:54:48 +0000 (08:54 +0200)]
Reachability check cross-crate links

8 years agoPerform doc-reachability check for inlined impls
mitaa [Fri, 15 Apr 2016 14:34:48 +0000 (16:34 +0200)]
Perform doc-reachability check for inlined impls

This changes the current rule that impls within `doc(hidden)` modules
aren't inlined, to only inlining impls where the implemented
trait and type are reachable in documentation.

8 years agoRefactor the per-module node map `module_children` into a per-resolver map.
Jeffrey Seyfried [Sun, 17 Apr 2016 20:41:57 +0000 (20:41 +0000)]
Refactor the per-module node map `module_children` into a per-resolver map.

8 years agoMake import resolution and error resolution reporting deterministic.
Jeffrey Seyfried [Sun, 17 Apr 2016 20:23:10 +0000 (20:23 +0000)]
Make import resolution and error resolution reporting deterministic.
These tasks used to depend on the iteration order of `module_children`.

8 years agoRefactor `is_prelude` to only apply to glob imports
Jeffrey Seyfried [Sun, 17 Apr 2016 19:23:25 +0000 (19:23 +0000)]
Refactor `is_prelude` to only apply to glob imports

8 years agoAuto merge of #33034 - tbu-:pr_doc_mutex_lock, r=nagisa
bors [Sun, 17 Apr 2016 21:00:56 +0000 (14:00 -0700)]
Auto merge of #33034 - tbu-:pr_doc_mutex_lock, r=nagisa

Add a comment about locking a `Mutex` multiple times

Fixes #32260.

8 years agoAdd a comment about locking a `Mutex` multiple times
Tobias Bucher [Sat, 16 Apr 2016 17:59:40 +0000 (19:59 +0200)]
Add a comment about locking a `Mutex` multiple times

Fixes #32260.

8 years agoAuto merge of #33050 - apasel422:bh, r=alexcrichton
bors [Sun, 17 Apr 2016 18:17:54 +0000 (11:17 -0700)]
Auto merge of #33050 - apasel422:bh, r=alexcrichton

Implement `Clone` for `binary_heap::IntoIter`

r? @alexcrichton

8 years agoAuto merge of #33016 - tbu-:pr_doc_peekable, r=alexcrichton
bors [Sun, 17 Apr 2016 16:09:24 +0000 (09:09 -0700)]
Auto merge of #33016 - tbu-:pr_doc_peekable, r=alexcrichton

Add a note about side effects for "peekable" iterators

8 years agoImplement `Clone` for `binary_heap::IntoIter`
Andrew Paseltiner [Sun, 17 Apr 2016 13:28:30 +0000 (09:28 -0400)]
Implement `Clone` for `binary_heap::IntoIter`

8 years agoAuto merge of #33049 - Manishearth:rollup, r=Manishearth
bors [Sun, 17 Apr 2016 12:32:47 +0000 (05:32 -0700)]
Auto merge of #33049 - Manishearth:rollup, r=Manishearth

Rollup of 10 pull requests

- Successful merges: #31441, #32956, #33003, #33022, #33023, #33032, #33039, #33044, #33045, #33046
- Failed merges:

8 years agoRollup merge of #33046 - jseyfried:fix_unresolved_pattern_diagnostics, r=eddyb
Manish Goregaokar [Sun, 17 Apr 2016 12:20:35 +0000 (17:50 +0530)]
Rollup merge of #33046 - jseyfried:fix_unresolved_pattern_diagnostics, r=eddyb

Fix diagnostics for unresolved patterns

This fixes #33043, a bug in the diagnostics for unresolved patterns.
r? @eddyb

8 years agoRollup merge of #33045 - jseyfried:no_def_modifiers, r=eddyb
Manish Goregaokar [Sun, 17 Apr 2016 12:20:35 +0000 (17:50 +0530)]
Rollup merge of #33045 - jseyfried:no_def_modifiers, r=eddyb

resolve: Refactor away `DefModifiers`

This refactors away `DefModifiers`, which is unneeded now that #32875 has landed.
r? @eddyb

8 years agoRollup merge of #33044 - petrochenkov:prefix, r=eddyb
Manish Goregaokar [Sun, 17 Apr 2016 12:20:35 +0000 (17:50 +0530)]
Rollup merge of #33044 - petrochenkov:prefix, r=eddyb

syntax: Parse import prefixes as paths

Fixes https://github.com/rust-lang/rust/issues/10415

r? @eddyb
(This partially intersects with https://github.com/rust-lang/rust/pull/33041)

8 years agoRollup merge of #33039 - bluss:trait-obj-error, r=arielb1
Manish Goregaokar [Sun, 17 Apr 2016 12:20:35 +0000 (17:50 +0530)]
Rollup merge of #33039 - bluss:trait-obj-error, r=arielb1

Adjust example for error E0225

Adjust example for error E0225

It's using Copy as a trait object compatible trait, which is not
appropriate, change to use a more typical Read + Send + Sync example.

Also use whitespace around `+`.

This seems appropriate apropos issue #32963

8 years agoRollup merge of #33032 - kindlychung:patch-3, r=Manishearth
Manish Goregaokar [Sun, 17 Apr 2016 12:20:34 +0000 (17:50 +0530)]
Rollup merge of #33032 - kindlychung:patch-3, r=Manishearth

Update casting-between-types.md

8 years agoRollup merge of #33023 - tbu-:pr_wrapping_traits, r=alexcrichton
Manish Goregaokar [Sun, 17 Apr 2016 12:20:34 +0000 (17:50 +0530)]
Rollup merge of #33023 - tbu-:pr_wrapping_traits, r=alexcrichton

Implement `Display` and `Hash` for `std::num::Wrapping`

Also, change the `Debug` implementation to only show the inner value.

Fixes #33006.

8 years agoRollup merge of #33022 - Mr4x:master, r=bluss
Manish Goregaokar [Sun, 17 Apr 2016 12:20:34 +0000 (17:50 +0530)]
Rollup merge of #33022 - Mr4x:master, r=bluss

Fix f32::sin_cos and f64::sin_cos examples

8 years agoRollup merge of #33003 - fbergr:link, r=steveklabnik
Manish Goregaokar [Sun, 17 Apr 2016 12:20:34 +0000 (17:50 +0530)]
Rollup merge of #33003 - fbergr:link, r=steveklabnik

Fix link in contributing page

Link was broken (404).

8 years agoRollup merge of #32956 - GuillaumeGomez:ptr_examples, r=steveklabnik
Manish Goregaokar [Sun, 17 Apr 2016 12:20:34 +0000 (17:50 +0530)]
Rollup merge of #32956 - GuillaumeGomez:ptr_examples, r=steveklabnik

Add examples for std::ptr module functions

Part of #29371.

r? @steveklabnik

8 years agoRollup merge of #31441 - gereeter:btree-docs, r=bluss
Manish Goregaokar [Sun, 17 Apr 2016 12:20:33 +0000 (17:50 +0530)]
Rollup merge of #31441 - gereeter:btree-docs, r=bluss

Start documenting BTreeMap's node interface

cc @Gankro @apasel422

8 years agoAuto merge of #33012 - pravic:describe-L-rustc-option, r=alexcrichton
bors [Sun, 17 Apr 2016 10:24:46 +0000 (03:24 -0700)]
Auto merge of #33012 - pravic:describe-L-rustc-option, r=alexcrichton

List possible keys of the -L rustc option.

Since `rustc --help -v` does not describe it, only *rustc.1* man page, but there is no man for Windows.

r? @alexcrichton
cc @steveklabnik

8 years agoAuto merge of #32987 - xosmig:binary_heap_extension, r=apasel422
bors [Sun, 17 Apr 2016 08:16:02 +0000 (01:16 -0700)]
Auto merge of #32987 - xosmig:binary_heap_extension, r=apasel422

collections: add append for binary heap

8 years agoAuto merge of #32977 - alexcrichton:ignore-panics, r=brson
bors [Sun, 17 Apr 2016 06:06:29 +0000 (23:06 -0700)]
Auto merge of #32977 - alexcrichton:ignore-panics, r=brson

std: Change String::truncate to panic less

The `Vec::truncate` method does not panic if the length argument is greater than
the vector's current length, but `String::truncate` will indeed panic. This
semantic difference can be a bit jarring (e.g. #32717), and after some
discussion the libs team concluded that although this can technically be a
breaking change it is almost undoubtedly not so in practice.

This commit changes the semantics of `String::truncate` to be a noop if
`new_len` is greater than the length of the current string.

Closes #32717

8 years agoAuto merge of #32952 - eddyb:mir-debuginfo-2, r=michaelwoerister
bors [Sun, 17 Apr 2016 03:40:33 +0000 (20:40 -0700)]
Auto merge of #32952 - eddyb:mir-debuginfo-2, r=michaelwoerister

Get all (but one) of debuginfo tests to pass with MIR codegen.

I didn't get much feedback in #31005 so I went ahead and implemented something simple.
Closes #31005, as MIR debuginfo should work now for most usecases.

The `no-debug-attribute` test no longer assumes variables are in scope of `return`.
We might also want to revisit that in #32949, but the test is more reliable now either way.

In order to get one last function in the `associated-type` test pass, this PR also fixes #32790.

8 years agoresolve: Refactor away `DefModifiers`
Jeffrey Seyfried [Sun, 17 Apr 2016 01:57:09 +0000 (01:57 +0000)]
resolve: Refactor away `DefModifiers`

8 years agoFix diagnostics for unresolved patterns
Jeffrey Seyfried [Sun, 17 Apr 2016 02:37:15 +0000 (02:37 +0000)]
Fix diagnostics for unresolved patterns

8 years agoAuto merge of #32909 - sanxiyn:unused-trait-import-2, r=alexcrichton
bors [Sun, 17 Apr 2016 01:31:11 +0000 (18:31 -0700)]
Auto merge of #32909 - sanxiyn:unused-trait-import-2, r=alexcrichton

Remove unused trait imports

8 years agosyntax: Parse import prefixes as paths
Vadim Petrochenkov [Sun, 17 Apr 2016 00:48:40 +0000 (03:48 +0300)]
syntax: Parse import prefixes as paths

8 years agoAuto merge of #32875 - jseyfried:1422_implementation, r=nikomatsakis
bors [Sat, 16 Apr 2016 23:21:09 +0000 (16:21 -0700)]
Auto merge of #32875 - jseyfried:1422_implementation, r=nikomatsakis

Implement `pub(restricted)` privacy (RFC 1422)

This implements `pub(restricted)` privacy from RFC 1422 (cc #32409) behind a feature gate.

`pub(restricted)` paths currently cannot use re-exported modules both for simplicity of implementation and for future compatibility with RFC 1560 (cf #31783).

r? @nikomatsakis

8 years agoAdd tests for `pub(restricted)`
Jeffrey Seyfried [Sun, 10 Apr 2016 11:52:25 +0000 (11:52 +0000)]
Add tests for `pub(restricted)`

8 years agorustbuild: Clean more as part of `make clean`
Alex Crichton [Sat, 16 Apr 2016 21:56:37 +0000 (14:56 -0700)]
rustbuild: Clean more as part of `make clean`

Clean out old documentation as well as the new test/tools directories. Should
prevent a problem that happened this morning where a PR bounced and then it left
docs with "broken links" so all future PRs bounced.

8 years agoAlways report PRIVATE_IN_PUBLIC violations as hard errors when
Jeffrey Seyfried [Wed, 13 Apr 2016 03:21:17 +0000 (03:21 +0000)]
Always report PRIVATE_IN_PUBLIC violations as hard errors when
the feature `pub_restricted` is enabled.

8 years agoAdjust example for error E0225
Ulrik Sverdrup [Sat, 16 Apr 2016 19:29:31 +0000 (21:29 +0200)]
Adjust example for error E0225

It's using Copy as a trait object compatible trait, which is not
appropriate, change to use a more typical Read + Send + Sync example.

Also use whitespace around `+`.

8 years agomir: place match pattern bindings in their respective arms.
Eduard Burtescu [Thu, 14 Apr 2016 14:17:37 +0000 (17:17 +0300)]
mir: place match pattern bindings in their respective arms.

8 years agodebuginfo: argument and upvar names for MIR.
Eduard Burtescu [Sat, 16 Apr 2016 18:51:26 +0000 (21:51 +0300)]
debuginfo: argument and upvar names for MIR.

8 years agoAuto merge of #33019 - kamalmarhubi:binary_search_by_key, r=alexcrichton
bors [Sat, 16 Apr 2016 18:51:13 +0000 (11:51 -0700)]
Auto merge of #33019 - kamalmarhubi:binary_search_by_key, r=alexcrichton

slice: Add tracking issue for slice_binary_search_by_key

8 years agoUse `v` instead of `v1` for consistency
jbranchaud [Sat, 16 Apr 2016 18:27:33 +0000 (13:27 -0500)]
Use `v` instead of `v1` for consistency

The code examples and previous paragraphs all use `v` and `v2`

8 years agoUpdate casting-between-types.md
Kaiyin Zhong [Sat, 16 Apr 2016 16:04:27 +0000 (18:04 +0200)]
Update casting-between-types.md

8 years agoMIR: Do not require END_BLOCK to always exist
Simonas Kazlauskas [Sat, 16 Apr 2016 15:09:51 +0000 (18:09 +0300)]
MIR: Do not require END_BLOCK to always exist

Once upon a time, along with START_BLOCK and END_BLOCK in the castle of important blocks also lived
a RESUME_BLOCK (or was it UNWIND_BLOCK? Either works, I don’t remember anymore). This trinity of
important blocks were required to always exist from the birth to death of the MIR-land they
belonged to.

Some time later, it was discovered that RESUME_BLOCK was just a lazy goon enjoying comfortable life
in the light of fame of the other two. Needless to say, once found out, the RESUME_BLOCK was
quickly slain and disposed of.

Now, the all-seeing eye of ours discovers that END_BLOCK is actually the more evil and better
disguised twin of the slain RESUME_BLOCK. Thus END_BLOCK gets slain and quickly disposed
of. Glory to the START_BLOCK, one and only lord of the important blocks’ castle!

---

Basically, all this does, is removing restriction for END_BLOCK to exist past the first invocation
of RemoveDeadBlocks pass. This way for functions whose CFG does not reach the `END_BLOCK` end up
not containing the block.

As far as the implementation goes, I’m not entirely satisfied with the `BasicBlock::end_block`, I
had hoped to make `new` a `const fn` and then just have a `const END_BLOCK` private to mir::build,
but it turns out that constant functions don’t yet support conditionals nor a way to assert.

8 years agotest: don't depend on locals being in scope on the return path.
Eduard Burtescu [Thu, 14 Apr 2016 07:55:40 +0000 (10:55 +0300)]
test: don't depend on locals being in scope on the return path.

8 years agosemantics: slightly clarify big-O claim
Sander Maijers [Sat, 16 Apr 2016 08:58:20 +0000 (10:58 +0200)]
semantics: slightly clarify big-O claim

Clarification by more precise specification.

8 years agostyle: enhance font of big-O expressions
Sander Maijers [Sat, 16 Apr 2016 08:55:33 +0000 (10:55 +0200)]
style: enhance font of big-O expressions

8 years agoImplement `Display` and `Hash` for `std::num::Wrapping`
Tobias Bucher [Sat, 16 Apr 2016 07:51:21 +0000 (09:51 +0200)]
Implement `Display` and `Hash` for `std::num::Wrapping`

Also, change the `Debug` implementation to only show the inner value.

Fixes #33006.

8 years agoFix f32::sin_cos and f64::sin_cos examples
Maxim Samburskiy [Sat, 16 Apr 2016 06:42:37 +0000 (11:42 +0500)]
Fix f32::sin_cos and f64::sin_cos examples

8 years agoAuto merge of #32785 - tbu-:pr_more_defaults, r=alexcrichton
bors [Sat, 16 Apr 2016 03:26:19 +0000 (20:26 -0700)]
Auto merge of #32785 - tbu-:pr_more_defaults, r=alexcrichton

Implement `Default` for more types in the standard library

Also add `Hash` to `std::cmp::Ordering` and most possible traits to
`fmt::Error`.

8 years agoAuto merge of #32779 - michaelwoerister:partitioning, r=nikomatsakis
bors [Sat, 16 Apr 2016 01:13:59 +0000 (18:13 -0700)]
Auto merge of #32779 - michaelwoerister:partitioning, r=nikomatsakis

Add initial version of codegen unit partitioning for incremental compilation.

The task of the partitioning module is to take the complete set of translation items of a crate and produce a set of codegen units from it, where a codegen unit is a named set of (translation-item, linkage) pairs. That is, this module decides which translation item appears in which codegen units with which linkage.

This version only handles the case of partitioning for incremental compilation, not the regular N-codegen units case. In the future the regular case should be handled too, maybe even doing a bit more analysis to intelligently figure out a good partitioning.

One thing that could be improved is the syntax of the codegen unit tests. Right now they still use the compile-fail error specification infrastructure, so everything has to be on one line. Would be nice to be able to format things in a more readable way.

8 years agoslice: Add tracking issue for slice_binary_search_by_key
Kamal Marhubi [Fri, 15 Apr 2016 23:27:03 +0000 (19:27 -0400)]
slice: Add tracking issue for slice_binary_search_by_key

8 years agoAdd a note about side effects for "peekable" iterators
Tobias Bucher [Fri, 15 Apr 2016 23:00:18 +0000 (01:00 +0200)]
Add a note about side effects for "peekable" iterators

8 years agoAuto merge of #33005 - Manishearth:rollup, r=Manishearth
bors [Fri, 15 Apr 2016 21:51:16 +0000 (14:51 -0700)]
Auto merge of #33005 - Manishearth:rollup, r=Manishearth

Rollup of 11 pull requests

- Successful merges: #32923, #32926, #32929, #32931, #32935, #32945, #32946, #32964, #32970, #32973, #32997
- Failed merges:

8 years agocollections: add append and extend specialization for binary heap
Andrey Tonkih [Thu, 14 Apr 2016 23:18:52 +0000 (02:18 +0300)]
collections: add append and extend specialization for binary heap