]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoRollup merge of #33196 - mitaa:rdoc-crate-links, r=alexcrichton
Manish Goregaokar [Mon, 25 Apr 2016 20:14:52 +0000 (01:44 +0530)]
Rollup merge of #33196 - mitaa:rdoc-crate-links, r=alexcrichton

rustdoc: Linkify extern crates

fixes #33178

r? @alexcrichton

8 years agoRollup merge of #33194 - mitaa:rdoc-a, r=alexcrichton
Manish Goregaokar [Mon, 25 Apr 2016 20:14:52 +0000 (01:44 +0530)]
Rollup merge of #33194 - mitaa:rdoc-a, r=alexcrichton

rustdoc: Improve accessibility of rustdoc pages

fixes #33131

r? @alexcrichton

8 years agoRollup merge of #33167 - benaryorg:master, r=alexcrichton
Manish Goregaokar [Mon, 25 Apr 2016 20:14:51 +0000 (01:44 +0530)]
Rollup merge of #33167 - benaryorg:master, r=alexcrichton

clarify documentation of TcpStream::connect() for multiple valid addresses

I am not sure how the UDP part of the stdlib behaves when passing multiple valid addresses, but it should be mentioned as there are legit use cases for [`impl<'a> ToSocketAddrs for &'a [SocketAddr]`](http://doc.rust-lang.org/nightly/std/net/trait.ToSocketAddrs.html), a TCP fallback only being one.

Just a little example program for anyone willing to enhance the documentation further:

```rust
use std::net::SocketAddr;
use std::net::ToSocketAddrs;
use std::net::TcpStream;

fn main()
{
let v: Vec<SocketAddr> = vec!
[
"127.0.0.1:1338".to_socket_addrs().unwrap().next().unwrap(),
"127.0.0.1:1337".to_socket_addrs().unwrap().next().unwrap(),
"127.0.0.1:1339".to_socket_addrs().unwrap().next().unwrap(),
];

let stream = TcpStream::connect(&v[..]).unwrap();
}
```

8 years agoRollup merge of #33160 - euclio:rustdoc-unstable-deprecated, r=alexcrichton
Manish Goregaokar [Mon, 25 Apr 2016 20:14:51 +0000 (01:44 +0530)]
Rollup merge of #33160 - euclio:rustdoc-unstable-deprecated, r=alexcrichton

show unstable status for deprecated items

Fixes #32374.

8 years agoRollup merge of #33133 - mitaa:rdoc-smth-smth-impl, r=alexcrichton
Manish Goregaokar [Mon, 25 Apr 2016 20:14:51 +0000 (01:44 +0530)]
Rollup merge of #33133 - mitaa:rdoc-smth-smth-impl, r=alexcrichton

rustdoc: inline all the impls

This used to be done to avoid inlining impls referencing private items, but is now unnecessary since we actually check that impls do not reference non-doc-reachable items.

fixes #32881
fixes #33025
fixes #33113

r? @alexcrichton

8 years agoRollup merge of #33107 - sanxiyn:prev-impl-item, r=eddyb
Manish Goregaokar [Mon, 25 Apr 2016 20:14:51 +0000 (01:44 +0530)]
Rollup merge of #33107 - sanxiyn:prev-impl-item, r=eddyb

Show previous definition of duplicate impl item

Fix #32971.

8 years agoAuto merge of #33115 - mbrubeck:vfp3-d16, r=nrc
bors [Mon, 25 Apr 2016 17:43:36 +0000 (10:43 -0700)]
Auto merge of #33115 - mbrubeck:vfp3-d16, r=nrc

Enable vfp3-d16 for ARMv7 Android target

Android's [armeabi-v7a ABI][1] guarantees at least VFPv3-d16 hardware FPU support, so Rust should include this in the default features for the `arm-linux-androideabi` target.

[1]: https://developer.android.com/ndk/guides/abis.html

8 years agoAuto merge of #32258 - nikomatsakis:fewer-errors, r=arielb1
bors [Mon, 25 Apr 2016 15:13:22 +0000 (08:13 -0700)]
Auto merge of #32258 - nikomatsakis:fewer-errors, r=arielb1

Suppress fallback and ambiguity errors

If the infcx has observed other errors, then suppress both default type
parameter fallback (which can be unreliable, as the full constraint set
is not available) and errors related to unresovled
variables (annoyingly, integer type variables cannot currently be
unified with error, so that has to be a separate mechanism). Also add a
flag to `infcx` to allow us to independently indicate when we have
observed an error and hence should trigger this suppression mode.

Fixes #31997

cc @alexcrichton
r? @arielb1

8 years agopatch test due to changes from compiletest-json
Niko Matsakis [Mon, 25 Apr 2016 13:38:06 +0000 (09:38 -0400)]
patch test due to changes from compiletest-json

8 years agoAuto merge of #33184 - tamird:misc-cleanup, r=alexcrichton
bors [Mon, 25 Apr 2016 12:45:52 +0000 (05:45 -0700)]
Auto merge of #33184 - tamird:misc-cleanup, r=alexcrichton

librustc_back: misc cleanup

r? @alexcrichton

8 years agoLinkify extern crates on rustdoc pages
mitaa [Mon, 25 Apr 2016 06:24:50 +0000 (08:24 +0200)]
Linkify extern crates on rustdoc pages

8 years agoImprove accessibility of rustdoc pages
mitaa [Fri, 22 Apr 2016 08:16:13 +0000 (10:16 +0200)]
Improve accessibility of rustdoc pages

8 years agoAuto merge of #33120 - tclfs:patch-2, r=Manishearth
bors [Mon, 25 Apr 2016 03:17:08 +0000 (20:17 -0700)]
Auto merge of #33120 - tclfs:patch-2, r=Manishearth

docs: Highlight a keyword

8 years agoAuto merge of #33085 - fitzgen:make-enumerate-example-more-clear, r=steveklabnik
bors [Mon, 25 Apr 2016 00:04:49 +0000 (17:04 -0700)]
Auto merge of #33085 - fitzgen:make-enumerate-example-more-clear, r=steveklabnik

Make the `Iterator::enumerate` doc example more clear

The example uses integers for the value being iterated over, but the indices
added by `enumerate` are also integers, so I always end up double taking and
thinking harder than I should when parsing the documentation. I also always
forget which order the index and value are in the tuple so I frequently hit this
stumbling block. This commit changes the documentation to iterate over
characters so that it is immediately obvious which part of the tuple is the
index and which is the value.

8 years agolibrustc_back: fix typo
Tamir Duberstein [Mon, 20 Jul 2015 14:38:54 +0000 (10:38 -0400)]
librustc_back: fix typo

8 years agolibrustc_back: remove explicit linker
Tamir Duberstein [Sat, 18 Jul 2015 02:03:52 +0000 (22:03 -0400)]
librustc_back: remove explicit linker

"cc" is already the default.

8 years agorustc: update Cargo.lock
Tamir Duberstein [Sun, 24 Apr 2016 21:43:26 +0000 (17:43 -0400)]
rustc: update Cargo.lock

8 years agoAuto merge of #33179 - Manishearth:breaking-batch, r=Manishearth
bors [Sun, 24 Apr 2016 20:47:22 +0000 (13:47 -0700)]
Auto merge of #33179 - Manishearth:breaking-batch, r=Manishearth

Batch up breaking libsyntax changes

Contains:

 - #33125
 - #33041
 - #33157

cc https://github.com/rust-lang/rust/issues/31645

8 years agoRollup merge of #33041 - petrochenkov:path, r=nrc,Manishearth
Manish Goregaokar [Sun, 24 Apr 2016 19:15:16 +0000 (00:45 +0530)]
Rollup merge of #33041 - petrochenkov:path, r=nrc,Manishearth

 Paths are mostly parsed without taking whitespaces into account, e.g. `std :: vec :: Vec :: new ()` parses successfully, however, there are some special cases involving keywords `super`, `self` and `Self`. For example, `self::` is considered a path start only if there are no spaces between `self` and `::`. These restrictions probably made sense when `self` and friends weren't keywords, but now they are unnecessary.

The first two commits remove this special treatment of whitespaces by removing `token::IdentStyle` entirely and therefore fix https://github.com/rust-lang/rust/issues/14109.
This change also affects naked `self` and `super` (which are not tightly followed by `::`, obviously) they can now be parsed as paths, however they are still not resolved correctly in imports (cc @jseyfried, see `compile-fail/use-keyword.rs`), so https://github.com/rust-lang/rust/issues/29036 is not completely fixed.

The third commit also makes `super`, `self`, `Self` and `static` keywords nominally (before this they acted as keywords for all purposes) and removes most of remaining \"special idents\".

The last commit (before tests) contains some small improvements - some qualified paths with type parameters are parsed correctly, `parse_path` is not used for parsing single identifiers, imports are sanity checked for absence of type parameters - such type parameters can be generated by syntax extensions or by macros when https://github.com/rust-lang/rust/issues/10415 is fixed (~~soon!~~already!).

This patch changes some pretty basic things in `libsyntax`, like `token::Token` and the keyword list, so it's a plugin-[breaking-change].

r? @eddyb

8 years agoFix keyword parsing tests
Vadim Petrochenkov [Sun, 24 Apr 2016 18:35:50 +0000 (21:35 +0300)]
Fix keyword parsing tests

8 years agoCheck reachability for inlined extern links too
mitaa [Sun, 24 Apr 2016 12:11:26 +0000 (14:11 +0200)]
Check reachability for inlined extern links too

An item is inlined and recorded as inlined even if it is
`doc(hidden)`, leading to unchecked external links.

8 years agoRemove some old code from libsyntax
Vadim Petrochenkov [Fri, 22 Apr 2016 20:43:14 +0000 (23:43 +0300)]
Remove some old code from libsyntax

8 years agosyntax: Make `is_path_start` precise and improve some error messages about unexpected...
Vadim Petrochenkov [Wed, 20 Apr 2016 23:03:29 +0000 (02:03 +0300)]
syntax: Make `is_path_start` precise and improve some error messages about unexpected tokens

8 years agosyntax: Check paths in visibilities for type parameters
Vadim Petrochenkov [Mon, 18 Apr 2016 21:42:18 +0000 (00:42 +0300)]
syntax: Check paths in visibilities for type parameters

syntax: Merge PathParsingMode::NoTypesAllowed and PathParsingMode::ImportPrefix
syntax: Rename PathParsingMode and its variants to better express their purpose
syntax: Remove obsolete error message about 'self lifetime
syntax: Remove ALLOW_MODULE_PATHS workaround
syntax/resolve: Adjust some error messages
resolve: Compare unhygienic (not renamed) names with keywords::Invalid, invalid identifiers may appear to be valid after renaming

8 years agosyntax: Merge keywords and remaining special idents in one list
Vadim Petrochenkov [Mon, 18 Apr 2016 19:53:50 +0000 (22:53 +0300)]
syntax: Merge keywords and remaining special idents in one list

Simplify the macro used for generation of keywords
Make `Keyword::ident` private

8 years agoAdd tests
Vadim Petrochenkov [Sat, 16 Apr 2016 18:53:40 +0000 (21:53 +0300)]
Add tests

8 years agosyntax: Don't parse idents with `parse_path`
Vadim Petrochenkov [Sat, 16 Apr 2016 16:48:24 +0000 (19:48 +0300)]
syntax: Don't parse idents with `parse_path`

Lift some restrictions on type parameters in paths
Sanity check import paths for type parameters

8 years agosyntax: Make static/super/self/Self keywords + special ident cleanup
Vadim Petrochenkov [Sat, 16 Apr 2016 15:05:06 +0000 (18:05 +0300)]
syntax: Make static/super/self/Self keywords + special ident cleanup

8 years agosyntax: Get rid of token::IdentStyle
Vadim Petrochenkov [Sat, 16 Apr 2016 01:12:02 +0000 (04:12 +0300)]
syntax: Get rid of token::IdentStyle

8 years agosyntax: Don't rely on token::IdentStyle in the parser
Vadim Petrochenkov [Sat, 16 Apr 2016 01:10:59 +0000 (04:10 +0300)]
syntax: Don't rely on token::IdentStyle in the parser

8 years agoAuto merge of #33163 - c4rlo:patch-2, r=Manishearth
bors [Sun, 24 Apr 2016 17:10:50 +0000 (10:10 -0700)]
Auto merge of #33163 - c4rlo:patch-2, r=Manishearth

subtyping.md: typo fix

8 years agoRollup merge of #33125 - Manishearth:closure-span, r=Manishearth
Manish Goregaokar [Sun, 24 Apr 2016 12:42:57 +0000 (18:12 +0530)]
Rollup merge of #33125 - Manishearth:closure-span, r=Manishearth

 Track the span corresponding to the `|...|` part of the closure.

lifted from #32756
cc #31645

libsyntax-[breaking change]

8 years agothread tighter span for closures around
Niko Matsakis [Wed, 20 Apr 2016 18:44:07 +0000 (14:44 -0400)]
thread tighter span for closures around

Track the span corresponding to the `|...|` part of the closure.

8 years agoRemove, now unnecessary, workaround
mitaa [Wed, 20 Apr 2016 15:30:26 +0000 (17:30 +0200)]
Remove, now unnecessary, workaround

This used to be done to avoid inlining impls referencing private items,
but is now unnecessary since we actually check that impls do not
reference non-doc-reachable items.

8 years agoInline impls on traits too
mitaa [Thu, 21 Apr 2016 16:05:15 +0000 (18:05 +0200)]
Inline impls on traits too

8 years agoAuto merge of #33153 - mitaa:rdoc-dejavu, r=alexcrichton
bors [Sun, 24 Apr 2016 01:02:06 +0000 (18:02 -0700)]
Auto merge of #33153 - mitaa:rdoc-dejavu, r=alexcrichton

rustdoc: Only record the same impl once

Due to inlining it is possible to visit the same module multiple times during `<Cache as DocFolder>::fold_crate`, so we keep track of the modules we've already visited.

fixes #33054

r? @alexcrichton

8 years agoAuto merge of #33124 - sfackler:kill-ipv6-only, r=alexcrichton
bors [Sat, 23 Apr 2016 21:40:06 +0000 (14:40 -0700)]
Auto merge of #33124 - sfackler:kill-ipv6-only, r=alexcrichton

Remove IPV6_V6ONLY functionality

These settings can only be adjusted before bind time, which doesn't make
sense in the current set of functionality. These methods are stable, but
haven't hit a stable release yet.

Closes #33052

[breaking-change]

r? @alexcrichton

Will also need a backport to the beta.

8 years agoAuto merge of #33117 - tamird:remove-outdated-workaround, r=sanxiyn
bors [Sat, 23 Apr 2016 18:06:10 +0000 (11:06 -0700)]
Auto merge of #33117 - tamird:remove-outdated-workaround, r=sanxiyn

librustc: remove outdated workaround

Fixed upstream: https://github.com/llvm-mirror/llvm/commit/ca07e256f62f

@alexcrichton following up from https://github.com/rust-lang/rust/pull/31709#discussion_r59125612

cc @ranma42

8 years agoclarify documentation of TcpStream::connect() for multiple valid addresses
benaryorg [Sat, 23 Apr 2016 15:50:16 +0000 (17:50 +0200)]
clarify documentation of TcpStream::connect() for multiple valid addresses

Signed-off-by: benaryorg <binary@benary.org>
8 years agoAuto merge of #33092 - alexcrichton:rustbuild-docs, r=brson
bors [Sat, 23 Apr 2016 12:36:28 +0000 (05:36 -0700)]
Auto merge of #33092 - alexcrichton:rustbuild-docs, r=brson

rustbuild: Run all markdown documentation tests

This commit adds support to rustbuild to run all documentation tests, basically
running `rustdoc --test` over all our documentation.

8 years agosubtyping.md: typo fix
c4rlo [Sat, 23 Apr 2016 10:58:58 +0000 (11:58 +0100)]
subtyping.md: typo fix

8 years agoAuto merge of #33084 - alexcrichton:osx-python-sanity, r=michaelwoerister
bors [Sat, 23 Apr 2016 08:18:03 +0000 (01:18 -0700)]
Auto merge of #33084 - alexcrichton:osx-python-sanity, r=michaelwoerister

Sanity check Python on OSX for LLDB tests

Two primary changes:

* Don't get past the configure stage if `python` isn't coming from `/usr/bin`
* Call `debugger.Terminate()` to prevent segfaults on newer versions of LLDB.

Closes #32994

8 years agoAuto merge of #33020 - nikomatsakis:compiletest-json, r=alexcrichton
bors [Sat, 23 Apr 2016 04:47:54 +0000 (21:47 -0700)]
Auto merge of #33020 - nikomatsakis:compiletest-json, r=alexcrichton

port compiletest to use JSON output

This uncovered a lot of bugs in compiletest and also some shortcomings
of our existing JSON output. We had to add information to the JSON
output, such as suggested text and macro backtraces. We also had to fix
various bugs in the existing tests.

Joint work with @jonathandturner.

r? @alexcrichton

8 years agoshow unstable status for deprecated items
Andy Russell [Sat, 23 Apr 2016 03:26:08 +0000 (23:26 -0400)]
show unstable status for deprecated items

8 years agoAuto merge of #32466 - jooert:btree_append, r=apasel422
bors [Sat, 23 Apr 2016 00:54:30 +0000 (17:54 -0700)]
Auto merge of #32466 - jooert:btree_append, r=apasel422

Implement `append` for b-trees.

I have finally found time to revive #26227, this time only with an `append` implementation.

The algorithm implemented here is linear in the size of the two b-trees. It firsts creates
a `MergeIter` from the two b-trees and then builds a new b-tree by pushing
key-value pairs from the `MergeIter` into nodes at the right heights.

Three functions for stealing have been added to the implementation of `Handle` as
well as a getter for the height of a `NodeRef`.

The docs have been updated with performance information about `BTreeMap::append` and
the remark about B has been removed now that it is the same for all instances of `BTreeMap`.

cc @gereeter @Gankro @apasel422

8 years agoAuto merge of #31169 - gmbonnet:disable-option-checking, r=brson
bors [Fri, 22 Apr 2016 18:58:53 +0000 (11:58 -0700)]
Auto merge of #31169 - gmbonnet:disable-option-checking, r=brson

configure: Support --disable-option-checking

I'm trying to package Rust for Fedora (this is nothing official (yet)).

The standard RPM packaging process involves running `./configure` with a whole lot of options that are commonly recognized by autotools configure scripts, but not by Rust's one. Since it does not make much sense to support all of this options, I think it would be great to support at least `--disable-option-checking`, so Rust's configure script would not fail.

[The old attempt](https://github.com/fabiand/rust-spec/blob/master/rustc.spec) to package Rust used a sed script (at line 72), but this is not the recommended way to do that.

8 years agoMake the `Iterator::enumerate` doc example more clear
Nick Fitzgerald [Mon, 18 Apr 2016 23:25:26 +0000 (16:25 -0700)]
Make the `Iterator::enumerate` doc example more clear

The example uses integers for the value being iterated over, but the indices
added by `enumerate` are also integers, so I always end up double taking and
thinking harder than I should when parsing the documentation. I also always
forget which order the index and value are in the tuple so I frequently hit this
stumbling block. This commit changes the documentation to iterate over
characters so that it is immediately obvious which part of the tuple is the
index and which is the value.

8 years agoOnly record the same impl once
mitaa [Fri, 22 Apr 2016 15:53:15 +0000 (17:53 +0200)]
Only record the same impl once

Due to inlining it is possible to visit the same module multiple times
during `<Cache as DocFolder>::fold_crate`, so we keep track of the
modules we've already visited.

8 years agoFix filepath check for macro backtrace
Jonathan Turner [Fri, 22 Apr 2016 16:30:38 +0000 (09:30 -0700)]
Fix filepath check for macro backtrace

8 years agoconfigure: Move --disable-option-checking to a more appropriate location
Guillaume Bonnet [Wed, 3 Feb 2016 15:29:53 +0000 (16:29 +0100)]
configure: Move --disable-option-checking to a more appropriate location

8 years agoconfigure: Support --disable-option-checking
Guillaume Bonnet [Thu, 21 Jan 2016 17:18:43 +0000 (18:18 +0100)]
configure: Support --disable-option-checking

8 years agoMerge remote-tracking branch 'rust-lang/master' into compiletest-json
Jonathan Turner [Fri, 22 Apr 2016 15:05:58 +0000 (08:05 -0700)]
Merge remote-tracking branch 'rust-lang/master' into compiletest-json

8 years agoAuto merge of #33089 - nrc:hir-name-res, r=eddyb
bors [Fri, 22 Apr 2016 10:41:29 +0000 (03:41 -0700)]
Auto merge of #33089 - nrc:hir-name-res, r=eddyb

Move def id collection and extern crate handling to before AST->HIR lowering

r? @jseyfried, @eddyb, or @nikomatsakis

8 years agoImplement `append` for b-trees.
Johannes Oertel [Thu, 24 Mar 2016 14:39:46 +0000 (15:39 +0100)]
Implement `append` for b-trees.

The algorithm implemented here is linear in the size of the two b-trees. It
firsts creates a `MergeIter` from the two b-trees and then builds a new b-tree
by pushing key-value pairs from the `MergeIter` into nodes at the right heights.

Three functions for stealing have been added to the implementation of `Handle` as
well as a getter for the height of a `NodeRef`.

The docs have been updated with performance information about `BTreeMap::append` and
the remark about B has been removed now that it is the same for all instances of `BTreeMap`.

8 years agoFix for filepath for cfail tests in windows
Jonathan Turner [Fri, 22 Apr 2016 01:24:37 +0000 (18:24 -0700)]
Fix for filepath for cfail tests in windows

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 agofix `transmute-from-fn-item-types-lint`
Niko Matsakis [Thu, 21 Apr 2016 08:51:29 +0000 (04:51 -0400)]
fix `transmute-from-fn-item-types-lint`

This test was relying on buggy behavior.

8 years agoadd serialize as a dep for compiletest
Niko Matsakis [Tue, 19 Apr 2016 20:02:24 +0000 (16:02 -0400)]
add serialize as a dep for compiletest

8 years agofix broken test revealed by compiletest
Niko Matsakis [Tue, 19 Apr 2016 16:24:47 +0000 (12:24 -0400)]
fix broken test revealed by compiletest

8 years agomove json.rs file
Niko Matsakis [Tue, 19 Apr 2016 15:24:41 +0000 (11:24 -0400)]
move json.rs file

8 years agopacify the merciless acrichto (somewhat)
Niko Matsakis [Mon, 18 Apr 2016 09:04:46 +0000 (05:04 -0400)]
pacify the merciless acrichto (somewhat)

Also add a comment or two to pacify the merciless self-critic, who hates
a closure without a comment.

8 years agoimprove tidy to give you file that failed
Niko Matsakis [Sat, 16 Apr 2016 10:11:18 +0000 (06:11 -0400)]
improve tidy to give you file that failed

the current tidy panics give you no idea why it failed

8 years agoport compiletest to use JSON output
Niko Matsakis [Sat, 16 Apr 2016 01:23:50 +0000 (21:23 -0400)]
port compiletest to use JSON output

This uncovered a lot of bugs in compiletest and also some shortcomings
of our existing JSON output. We had to add information to the JSON
output, such as suggested text and macro backtraces. We also had to fix
various bugs in the existing tests.

Joint work with jntrnr.

8 years agoRemove IPV6_V6ONLY functionality
Steven Fackler [Thu, 21 Apr 2016 04:42:19 +0000 (21:42 -0700)]
Remove IPV6_V6ONLY functionality

These settings can only be adjusted before bind time, which doesn't make
sense in the current set of functionality. These methods are stable, but
haven't hit a stable release yet.

Closes #33052

[breaking-change]

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 agodocs: Highlight a keyword
Tang Chenglong [Thu, 21 Apr 2016 01:53:30 +0000 (09:53 +0800)]
docs: Highlight a keyword

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 agolibrustc: remove outdated workaround
Tamir Duberstein [Wed, 20 Apr 2016 20:17:26 +0000 (16:17 -0400)]
librustc: remove outdated workaround

Fixed upstream: https://github.com/llvm-mirror/llvm/commit/ca07e256f62f

8 years agoEnable vfp3-d16 for ARMv7 Android target
Matt Brubeck [Wed, 20 Apr 2016 19:40:38 +0000 (12:40 -0700)]
Enable vfp3-d16 for ARMv7 Android target

Android's [armeabi-v7a ABI][1] guarantees at least VFPv3-d16 hardware FPU
support, so Rust should include this in the default features for the
arm-linux-androideabi target.

[1]: https://developer.android.com/ndk/guides/abis.html

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 agoShow previous definition of duplicate impl item
Seo Sanghyeon [Wed, 20 Apr 2016 13:00:33 +0000 (22:00 +0900)]
Show previous definition of duplicate impl item

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 agorebasing
Nick Cameron [Tue, 19 Apr 2016 04:16:40 +0000 (16:16 +1200)]
rebasing

8 years agodebugging, misc fixes
Nick Cameron [Sun, 17 Apr 2016 22:30:55 +0000 (10:30 +1200)]
debugging, misc fixes

8 years agoHIR visitor for DefCollector
Nick Cameron [Thu, 14 Apr 2016 06:04:55 +0000 (18:04 +1200)]
HIR visitor for DefCollector

So that we can work with inlined HIR from metadata.

8 years agorefactoring
Nick Cameron [Thu, 14 Apr 2016 05:24:30 +0000 (17:24 +1200)]
refactoring

8 years agodef_collector and crate reader operate on AST instead of HIR
Nick Cameron [Thu, 14 Apr 2016 02:51:21 +0000 (14:51 +1200)]
def_collector and crate reader operate on AST instead of HIR

And move extern crate reading earlier in the driver

8 years agoSeparate def collection and hir map making even further
Nick Cameron [Thu, 14 Apr 2016 00:39:18 +0000 (12:39 +1200)]
Separate def collection and hir map making even further

8 years agoMove DefCollector to its own module.
Nick Cameron [Thu, 14 Apr 2016 00:14:03 +0000 (12:14 +1200)]
Move DefCollector to its own module.

8 years agoSplit up NodeCollector so that defs are collected separately from nodes for the HIR...
Nick Cameron [Wed, 13 Apr 2016 23:55:34 +0000 (11:55 +1200)]
Split up NodeCollector so that defs are collected separately from nodes for the HIR map.

8 years agoTrivial refactoring
Nick Cameron [Thu, 7 Apr 2016 06:16:12 +0000 (18:16 +1200)]
Trivial refactoring

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 agomk: Force system python for LLDB tests on OSX
Alex Crichton [Tue, 19 Apr 2016 16:44:19 +0000 (09:44 -0700)]
mk: Force system python for LLDB tests on OSX

Force usage of /usr/bin/python whenever we run LLDB tests on OSX because it
looks like no other Python will work.

8 years agorustbuild: Run all markdown documentation tests
Alex Crichton [Fri, 15 Apr 2016 01:00:35 +0000 (18:00 -0700)]
rustbuild: Run all markdown documentation tests

This commit adds support to rustbuild to run all documentation tests, basically
running `rustdoc --test` over all our documentation. This also includes support
for running the error index tests.

8 years agoetc: Add debugger.Terminate() to lldb_batchmode.py
Alex Crichton [Mon, 18 Apr 2016 22:45:45 +0000 (15:45 -0700)]
etc: Add debugger.Terminate() to lldb_batchmode.py

Right now on the most recent version of LLDB installed on OSX we'll segfault on
all the LLDB tests if this isn't called (unfortunately). Hopefully we've updated
LLDB on the bots to actually get this working everywhere!

Closes #32994

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.