Commit Graph

52196 Commits

Author SHA1 Message Date
pierzchalski
0fe1359885 whoops 2016-04-04 21:14:15 +10:00
pierzchalski
1e9595e116 Change build_helper to modify suffix of cc
This should help avoid issues when using tools like ccache.
2016-04-04 19:44:38 +10:00
James Miller
e4d4fa3295 Handle operand temps for function calls
This allows temporary destinations for function calls to have their
allocas omitted.
2016-04-04 19:21:27 +12:00
Nick Cameron
a4e2933c6a rustdoc: factor out function for getting inner html of highlighted source 2016-04-04 11:07:41 +12:00
Nick Cameron
8c2a8ae9cc Give better spans for SpanEnd errors 2016-04-04 10:32:37 +12:00
Amanieu d'Antras
8620bbaafd Add compile-fail test 2016-04-03 23:14:48 +01:00
bors
f92ce2e9fe Auto merge of #32676 - durka:patch-18, r=alexcrichton
add missing spaces in #16758 warning

I should probably add a test.
2016-04-03 15:01:47 -07:00
Jonas Schievink
da9c43a723 Autoderef when suggesting to call (self.field)
Fixes #32128
2016-04-03 22:58:44 +02:00
Jonas Schievink
0163ccc36b Fix "consider removing this semicolon" help
Check last statement in a block, not the first
2016-04-03 22:12:48 +02:00
bors
9c2186d4d7 Auto merge of #32672 - ollie27:patch-5, r=alexcrichton
Fix a couple of dead links on core::num::ParseFloatError docs
2016-04-03 12:11:57 -07:00
bors
c0b8c43820 Auto merge of #32210 - Aatch:mir-traversal, r=nikomatsakis
rBreak Critical Edges and other MIR work

This PR is built on top of #32080.

This adds the basic depth-first traversals for MIR, preorder, postorder and reverse postorder. The MIR blocks are now translated using reverse postorder. There is also a transform for breaking critical edges, which includes the edges from `invoke`d calls (`Drop` and `Call`), to account for the fact that we can't add code after an `invoke`. It also stops generating the intermediate block (since the transform essentially does it if necessary already).

The kinds of cases this deals with are difficult to produce, so the test is the one I managed to get. However, it seems to bootstrap with `-Z orbit`, which it didn't before my changes.
2016-04-03 08:58:59 -07:00
Oliver Schneider
913a2b4b05 check constants even if they are unused in the current crate 2016-04-03 15:18:16 +02:00
bors
0894b06283 Auto merge of #32168 - alexcrichton:fix-filecheck, r=aturon
mk: Add configure option for disabling codegen tests

Our `codegen` test suite requires the LLVM `FileCheck` utility but unfortunately
this isn't always available in all custom LLVM roots (e.g. those specified via
`--llvm-root`). This commit adds a `./configure` option called
`--disable-codegen-tests` which will manually disable running these tests. In
the case that this option is passed we can forgo the need for the `FileCheck`
executable. Note that we still require `FileCheck` by default as we will attempt
to run these tests.

Closes #28667
2016-04-03 03:12:41 -07:00
Alex Crichton
a3fdde7453 mk: Add configure option for disabling codegen tests
Our `codegen` test suite requires the LLVM `FileCheck` utility but unfortunately
this isn't always available in all custom LLVM roots (e.g. those specified via
`--llvm-root`). This commit adds a `./configure` option called
`--disable-codegen-tests` which will manually disable running these tests. In
the case that this option is passed we can forgo the need for the `FileCheck`
executable. Note that we still require `FileCheck` by default as we will attempt
to run these tests.

Closes #28667
2016-04-03 00:18:44 -07:00
bors
a09f386e8d Auto merge of #32579 - michaelwoerister:stable-symbol-name-fix, r=eddyb
Fix typo in TxCtxt::crate_disambiguator() and add test case.

r? @nikomatsakis

Fixes #32554
2016-04-02 23:34:58 -07:00
Steven Fackler
8128817119 Drop the default buffer size to 8K
The 64k capacity was picked by me a couple of years ago in the initial
implementation of buffered IO adaptors:
https://github.com/rust-lang/rust/pull/9091/files#diff-b131eeef531ad098b32f49695a031008R62.
64K was picked for symmetry with libuv, which we no longer use.

64K is *way* larger than the default size of any other language that I
can find. C, C++, and Java default to 8K, and Go defaults to 4K. There
have been a variety of issues filed relating to this such as #31885.

Closes #31885
2016-04-02 22:24:42 -07:00
Michael Woerister
c2ede7e185 Add run-make test for stable symbol-name generation. 2016-04-03 00:44:17 -04:00
Steven Fackler
f486b7c3b3 Inline Duration constructors and accessors
These are all super small functions
2016-04-02 20:42:42 -07:00
James Miller
605bc04264 Use a BitVector instead of Vec<bool> for recording cleanup blocks
Also adds a FromIterator impl for BitVector to allow construction of a
BitVector from an iterator yeilding bools.
2016-04-03 14:58:34 +12:00
bors
080edd9957 Auto merge of #32633 - frewsxcv:map-values-mut, r=alexcrichton
Implement `values_mut` on `{BTree, Hash}Map`

https://github.com/rust-lang/rust/issues/32551
2016-04-02 19:36:58 -07:00
Corey Farwell
da4d7f59ad Indicate None is code-like in doc comment. 2016-04-02 20:20:52 -04:00
bors
5ab11d72ca Auto merge of #32667 - dotdash:def_dec, r=nagisa
Stop accepting declarations when looking for definitions

eternally_available linkage isn't legal for declarations anyway, so the
check for an externally_available declaration should never succeed, so
let's remove it.
2016-04-02 15:52:00 -07:00
Jeffrey Seyfried
432eb8a094 Add Crate and Restricted variants to ast::Visibility 2016-04-02 20:32:18 +00:00
Jeffrey Seyfried
bc355244df Make ast::Visibility non-copyable 2016-04-02 20:21:41 +00:00
Jeffrey Seyfried
74240b22d9 Remove ast::Visibility::inherit_from (it is unused and has obsolete semantics) 2016-04-02 20:21:22 +00:00
bors
3ec71b033a Auto merge of #32598 - alexcrichton:rustbuild-osx, r=aturon
rustbuild: Fix compile on OSX for 10.7

This commit should help configure our OSX rustbuild builder for targeting 10.7.
A key part of this is using `libc++` instead of `libstdc++` as apparently it's
more filled out and otherwise LLVM's cmake configuration would fail.
2016-04-02 10:30:03 -07:00
Michael Neumann
9f3de64732 Prefix jemalloc on DragonFly to prevent segfaults.
Similar to commits ed015456a1 (iOS)
and e3b414d861 (Android)
2016-04-02 18:40:59 +02:00
Dave Huseby
39055800c1 adding freebsd i686 snapshot 4d3eebf 2016-04-02 08:50:09 -07:00
Tang Chenglong
a2f6d29420 Remove error description of move
(1) `x` can be used in main() after the call to spawn(). Because the variables follow normal move semantics, though the keyword `move` is used, and i32 implements `Copy`.
(2) I remove this sentence because the previous sentence gives the referrence to `move closures`, and more description of `move` may be redundant.
2016-04-02 21:03:59 +08:00
bors
1af79cf34e Auto merge of #32562 - ben0x539:bug-macro, r=nikomatsakis
librustc: Add bug!(), bug_span!() macros as unified entry points for internal compiler errors

The macros pass `file!()`, `line!()` and `format_args!(...)` on to a cold, never-inlined function, ultimately calling `session::{span_,}bug_fmt` via the tcx in tls or, failing that, panicking directly.

cc @eddyb
r? @nikomatsakis
2016-04-02 05:14:25 -07:00
mitaa
95eb8a68aa Slim down rustdoc::html::render::Context
Like the comment on `Context` explains, `Context` is supposed to be
lightweight, so we're putting everything that's immutable after
creation of the Context behind an `Arc<SharedContext>`.
2016-04-02 13:47:11 +02:00
mitaa
0ef85c1e6a Refactor HiddenStructField into StrippedItem 2016-04-02 13:47:05 +02:00
mitaa
b1543a1aac Make the rendering process less pass-aware
Instead of hardcoding knowledge about the strip-private pass into the
rendering process we represent (some) stripped items as `ItemEnum::StrippedItem`.

Rustdoc will, for example, generate redirect pages for public items
contained in private modules which have been re-exported to somewhere
externally reachable - this will now not only work for the `strip-private`
pass, but for other passes as well, such as the `strip-hidden` pass.
2016-04-02 12:00:55 +02:00
bors
f2285bdaf5 Auto merge of #32549 - respeccing:rust_backtrace_disabled, r=alexcrichton
allow RUST_BACKTRACE=0 to act as if unset

**UPDATE:** `RUST_BACKTRACE=0` to act as if the env. var is unset! (now `0` is what `disabled` was for, below)

When RUST_BACKTRACE is set to "disabled" then this acts as if the env. var is unset. So, either make sure `RUST_BACKTRACE` is not set OR set it to `disabled` to achieve the same effect.

Sample usage:

```bash
$ rustc -o /tmp/a.out -- <(echo 'fn main(){ panic!() }') && RUST_BACKTRACE=disabled /tmp/a.out
!! executing '/home/zazdxscf/build/1nonpkgs/rust/rust//x86_64-unknown-linux-gnu/stage2/bin//rustc' with args: '-o /tmp/a.out -- /dev/fd/63'
thread '<main>' panicked at 'explicit panic', /dev/fd/63:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.

$ rustc -o /tmp/a.out -- <(echo 'fn main(){ panic!() }') && RUST_BACKTRACE=1 /tmp/a.out
!! executing '/home/zazdxscf/build/1nonpkgs/rust/rust//x86_64-unknown-linux-gnu/stage2/bin//rustc' with args: '-o /tmp/a.out -- /dev/fd/63'
thread '<main>' panicked at 'explicit panic', /dev/fd/63:1
stack backtrace:
   1:     0x55709e8148c0 - sys::backtrace::tracing:👿:write::h140f24a0cfc189b98Ru
   2:     0x55709e816a5b - panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::closure.45165
   3:     0x55709e8166e8 - panicking::default_hook::hed419823688cb82aXoA
   4:     0x55709e810fff - sys_common::unwind::begin_unwind_inner::hbb9642f6e212d56fmHt
   5:     0x55709e810513 - sys_common::unwind::begin_unwind::h16232867470678019594
   6:     0x55709e810489 - main::hb524f9576270962feaa
   7:     0x55709e816314 - sys_common::unwind::try::try_fn::h1274188004693518534
   8:     0x55709e813dfb - __rust_try
   9:     0x55709e815dab - rt::lang_start::h712b1cd650781872ahA
  10:     0x55709e810679 - main
  11:     0x7efd1026859f - __libc_start_main
  12:     0x55709e810348 - _start
  13:                0x0 - <unknown>
```

Some programs(eg. [vim's syntactic](https://github.com/scrooloose/syntastic) used by [rust.vim](https://github.com/rust-lang/rust.vim)) cannot unset the env. var RUST_BACKTRACE if it's already set(eg. in .bashrc) but [they can set it to some value](cb5533e159/system/Z575/OSes/gentoo/on_baremetal/filesystem_now/gentoo/home/zazdxscf/build/1nonpkgs/rust.vim/upd (L17)), and I needed to ensure the env. var is unset in order to avoid this issue: https://github.com/rust-lang/rust/issues/29293

**EDIT:** Sample usage 2:

```bash
$ export RUST_BACKTRACE=1

$ rustc -o /tmp/a.out -- <(echo 'fn main(){ panic!() }') && /tmp/a.out
!! executing '/home/zazdxscf/build/1nonpkgs/rust/rust//x86_64-unknown-linux-gnu/stage2/bin//rustc' with args: '-o /tmp/a.out -- /dev/fd/63'
thread '<main>' panicked at 'explicit panic', /dev/fd/63:1
stack backtrace:
   1:     0x55c2696738c0 - sys::backtrace::tracing:👿:write::h140f24a0cfc189b98Ru
   2:     0x55c269675a5b - panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::closure.45165
   3:     0x55c2696756e8 - panicking::default_hook::hed419823688cb82aXoA
   4:     0x55c26966ffff - sys_common::unwind::begin_unwind_inner::hbb9642f6e212d56fmHt
   5:     0x55c26966f513 - sys_common::unwind::begin_unwind::h16023941661074805588
   6:     0x55c26966f489 - main::hb524f9576270962feaa
   7:     0x55c269675314 - sys_common::unwind::try::try_fn::h1274188004693518534
   8:     0x55c269672dfb - __rust_try
   9:     0x55c269674dab - rt::lang_start::h712b1cd650781872ahA
  10:     0x55c26966f679 - main
  11:     0x7f593d58459f - __libc_start_main
  12:     0x55c26966f348 - _start
  13:                0x0 - <unknown>

$ rustc -o /tmp/a.out -- <(echo 'fn main(){ panic!() }') && RUST_BACKTRACE=disabled /tmp/a.out
!! executing '/home/zazdxscf/build/1nonpkgs/rust/rust//x86_64-unknown-linux-gnu/stage2/bin//rustc' with args: '-o /tmp/a.out -- /dev/fd/63'
thread '<main>' panicked at 'explicit panic', /dev/fd/63:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.

```
2016-04-02 01:47:59 -07:00
Alex Burka
a14f14f690 add missing spaces in #16758 warning 2016-04-02 02:13:36 -04:00
bors
211c35afcb Auto merge of #32334 - tbu-:pr_ipv6_octets, r=aturon
Add functions to convert IPv6 addresses from and to octets

See also #32313.
2016-04-01 20:38:52 -07:00
bors
18172d1375 Auto merge of #32666 - Manishearth:rollup, r=Manishearth
Rollup of 11 pull requests

- Successful merges: #32622, #32629, #32640, #32641, #32642, #32645, #32647, #32649, #32652, #32654, #32656
- Failed merges:
2016-04-01 17:06:04 -07:00
Oliver Middleton
564ec1ae40 Fix a couple of dead links on core::num::ParseFloatError docs 2016-04-01 23:46:58 +01:00
Corey Farwell
2084f2ed77 Implement values_mut on BTreeMap.
https://github.com/rust-lang/rust/issues/32551
2016-04-01 18:36:08 -04:00
Corey Farwell
5972b22b7c Implement values_mut on HashMap.
https://github.com/rust-lang/rust/issues/32551
2016-04-01 18:35:54 -04:00
Manish Goregaokar
45c4769920 Rollup merge of #32656 - tbu-:pr_ty_outdated_comment, r=alexcrichton
Remove incorrect comment about `PartialEq` implementation
2016-04-02 01:23:26 +05:30
Manish Goregaokar
55dbffe6df Rollup merge of #32654 - tbu-:pr_doc_joinhandleext, r=sfackler
Fix a typo in the doc comment of `std::os::unix:🧵:JoinHandleExt`
2016-04-02 01:23:25 +05:30
Manish Goregaokar
cf0a01a161 Rollup merge of #32652 - VFLashM:refcell_ref_coercion, r=alexcrichton
Added missing refcell ref/refmut coercions to unsized

Ref/RefMut should be coercible to unsized.
This commit adds a unit test and two missing CoerceUnsized implementations.
2016-04-02 01:23:23 +05:30
bors
c8b8eb1fda Auto merge of #32544 - alexcrichton:rustbuild-dist-libtest, r=brson
rustbuild: Fix dist for non-host targets

The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.

There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.

These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.

The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).

All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.

Closes #32523
2016-04-01 12:52:08 -07:00
Michael Woerister
6bd7299964 Fix typo in TxCtxt::crate_disambiguator(). 2016-04-01 13:56:40 -04:00
Alex Crichton
3d6340ffe2 rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.

There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.

These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.

The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).

All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.

Closes #32523
2016-04-01 10:18:36 -07:00
Corey Farwell
313eb328da Address FIXMEs related to short lifetimes in HashMap. 2016-04-01 10:18:41 -04:00
Björn Steinbrink
4b9ddf4573 Stop accepting declarations when looking for definitions
eternally_available linkage isn't legal for declarations anyway, so the
check for an externally_available declaration should never succeed, so
let's remove it.
2016-04-01 15:24:56 +02:00
Manish Goregaokar
e004ce1a32 Rollup merge of #32645 - asomers:master, r=alexcrichton
Register new FreeBSD snapshot

Actual file is at https://people.freebsd.org/~asomers/rust/rust-stage0-2016-03-18-235d774-freebsd-x86_64-390b9a9f60f3d0d6a52c04d939a0355f572d03b3.tar.bz2
2016-04-01 18:44:49 +05:30
Manish Goregaokar
c2fe137823 Rollup merge of #32642 - Amanieu:doc_fixes, r=apasel422
Fix formatting in the documentation for AtomicIsize::compare_exchange_weak
2016-04-01 18:44:49 +05:30