]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAutoderef when suggesting to call `(self.field)`
Jonas Schievink [Sun, 3 Apr 2016 20:58:44 +0000 (22:58 +0200)]
Autoderef when suggesting to call `(self.field)`

Fixes #32128

8 years agoAuto merge of #32210 - Aatch:mir-traversal, r=nikomatsakis
bors [Sun, 3 Apr 2016 15:58:59 +0000 (08:58 -0700)]
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.

8 years agoAuto merge of #32168 - alexcrichton:fix-filecheck, r=aturon
bors [Sun, 3 Apr 2016 10:12:41 +0000 (03:12 -0700)]
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

8 years agomk: Add configure option for disabling codegen tests
Alex Crichton [Thu, 10 Mar 2016 03:11:02 +0000 (19:11 -0800)]
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

8 years agoAuto merge of #32579 - michaelwoerister:stable-symbol-name-fix, r=eddyb
bors [Sun, 3 Apr 2016 06:34:58 +0000 (23:34 -0700)]
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

8 years agoAdd run-make test for stable symbol-name generation.
Michael Woerister [Tue, 29 Mar 2016 16:12:12 +0000 (12:12 -0400)]
Add run-make test for stable symbol-name generation.

8 years agoUse a BitVector instead of Vec<bool> for recording cleanup blocks
James Miller [Sun, 3 Apr 2016 02:58:34 +0000 (14:58 +1200)]
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.

8 years agoAuto merge of #32633 - frewsxcv:map-values-mut, r=alexcrichton
bors [Sun, 3 Apr 2016 02:36:58 +0000 (19:36 -0700)]
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

8 years agoAuto merge of #32667 - dotdash:def_dec, r=nagisa
bors [Sat, 2 Apr 2016 22:52:00 +0000 (15:52 -0700)]
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.

8 years agoAuto merge of #32598 - alexcrichton:rustbuild-osx, r=aturon
bors [Sat, 2 Apr 2016 17:30:03 +0000 (10:30 -0700)]
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.

8 years agoAuto merge of #32562 - ben0x539:bug-macro, r=nikomatsakis
bors [Sat, 2 Apr 2016 12:14:25 +0000 (05:14 -0700)]
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

8 years agoAuto merge of #32549 - respeccing:rust_backtrace_disabled, r=alexcrichton
bors [Sat, 2 Apr 2016 08:47:59 +0000 (01:47 -0700)]
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::imp::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](https://github.com/respeccing/gentooskyline/blob/cb5533e1598f871d3fdf7c3d8248ce767b5b9360/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::imp::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.

```

8 years agoAuto merge of #32334 - tbu-:pr_ipv6_octets, r=aturon
bors [Sat, 2 Apr 2016 03:38:52 +0000 (20:38 -0700)]
Auto merge of #32334 - tbu-:pr_ipv6_octets, r=aturon

Add functions to convert IPv6 addresses from and to octets

See also #32313.

8 years agoAuto merge of #32666 - Manishearth:rollup, r=Manishearth
bors [Sat, 2 Apr 2016 00:06:04 +0000 (17:06 -0700)]
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:

8 years agoImplement `values_mut` on `BTreeMap`.
Corey Farwell [Wed, 30 Mar 2016 23:12:29 +0000 (19:12 -0400)]
Implement `values_mut` on `BTreeMap`.

https://github.com/rust-lang/rust/issues/32551

8 years agoImplement `values_mut` on `HashMap`.
Corey Farwell [Wed, 30 Mar 2016 13:26:34 +0000 (09:26 -0400)]
Implement `values_mut` on `HashMap`.

https://github.com/rust-lang/rust/issues/32551

8 years agoRollup merge of #32656 - tbu-:pr_ty_outdated_comment, r=alexcrichton
Manish Goregaokar [Fri, 1 Apr 2016 13:14:50 +0000 (18:44 +0530)]
Rollup merge of #32656 - tbu-:pr_ty_outdated_comment, r=alexcrichton

Remove incorrect comment about `PartialEq` implementation

8 years agoRollup merge of #32654 - tbu-:pr_doc_joinhandleext, r=sfackler
Manish Goregaokar [Fri, 1 Apr 2016 13:14:50 +0000 (18:44 +0530)]
Rollup merge of #32654 - tbu-:pr_doc_joinhandleext, r=sfackler

Fix a typo in the doc comment of `std::os::unix::thread::JoinHandleExt`

8 years agoRollup merge of #32652 - VFLashM:refcell_ref_coercion, r=alexcrichton
Manish Goregaokar [Fri, 1 Apr 2016 13:14:49 +0000 (18:44 +0530)]
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.

8 years agoAuto merge of #32544 - alexcrichton:rustbuild-dist-libtest, r=brson
bors [Fri, 1 Apr 2016 19:52:08 +0000 (12:52 -0700)]
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

8 years agoFix typo in TxCtxt::crate_disambiguator().
Michael Woerister [Tue, 29 Mar 2016 16:10:26 +0000 (12:10 -0400)]
Fix typo in TxCtxt::crate_disambiguator().

8 years agorustbuild: Fix dist for non-host targets
Alex Crichton [Mon, 28 Mar 2016 05:28:10 +0000 (22:28 -0700)]
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

8 years agoStop accepting declarations when looking for definitions
Björn Steinbrink [Fri, 1 Apr 2016 13:24:56 +0000 (15:24 +0200)]
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.

8 years agoRollup merge of #32645 - asomers:master, r=alexcrichton
Manish Goregaokar [Fri, 1 Apr 2016 13:14:49 +0000 (18:44 +0530)]
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

8 years agoRollup merge of #32642 - Amanieu:doc_fixes, r=apasel422
Manish Goregaokar [Fri, 1 Apr 2016 13:14:49 +0000 (18:44 +0530)]
Rollup merge of #32642 - Amanieu:doc_fixes, r=apasel422

Fix formatting in the documentation for AtomicIsize::compare_exchange_weak

8 years agoRollup merge of #32641 - tbu-:pr_e0277, r=pnkfelix
Manish Goregaokar [Fri, 1 Apr 2016 13:14:49 +0000 (18:44 +0530)]
Rollup merge of #32641 - tbu-:pr_e0277, r=pnkfelix

Improve E0277 error message in a generic context

This now mentions that you can restrict type parameters to be able to
call functions of traits.

8 years agoRollup merge of #32640 - jseyfried:remove_println, r=Manishearth
Manish Goregaokar [Fri, 1 Apr 2016 13:14:48 +0000 (18:44 +0530)]
Rollup merge of #32640 - jseyfried:remove_println, r=Manishearth

Remove accidental `println!`

This removes a use of `println!` added in #32358 that appears to accidental.
r? @Manishearth

8 years agoRollup merge of #32629 - mbrubeck:nomicon-version, r=steveklabnik
Manish Goregaokar [Fri, 1 Apr 2016 13:14:48 +0000 (18:44 +0530)]
Rollup merge of #32629 - mbrubeck:nomicon-version, r=steveklabnik

Update Rust version in the Rustonomicon Vec chapter

I verified that the final code compiles in Rust 1.9.0-nightly.

r? @steveklabnik

8 years agoRollup merge of #32622 - tyoc213:rust-beginners, r=alexcrichton
Manish Goregaokar [Fri, 1 Apr 2016 13:14:48 +0000 (18:44 +0530)]
Rollup merge of #32622 - tyoc213:rust-beginners, r=alexcrichton

Book: in beginner guide change irc channel #rust → #rust-beginners

I also would like to add the reference on the first README.md

Some like

```
 most popular channel is [#rust], a venue for general discussion about
-Rust, and a good place to ask for help.
+Rust. And a good place to ask for help would be [#rust-beginners].

 [IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
 [#rust]: irc://irc.mozilla.org/rust
+[#rust-beginners]: irc://irc.mozilla.org/rust-beginners
```

So In the first page would be the two options for #rust or #rust-beginners

8 years agoAuto merge of #32643 - Amanieu:arc_compare_exchange, r=alexcrichton
bors [Fri, 1 Apr 2016 08:46:06 +0000 (01:46 -0700)]
Auto merge of #32643 - Amanieu:arc_compare_exchange, r=alexcrichton

Change Arc to use compare_exchange instead of compare_and_swap

This should slightly improve code generation on architectures with a weak memory model like ARM.

8 years agoAuto merge of #32635 - gereeter:hashmap-iter-variance, r=alexcrichton
bors [Fri, 1 Apr 2016 06:31:58 +0000 (23:31 -0700)]
Auto merge of #32635 - gereeter:hashmap-iter-variance, r=alexcrichton

Make HashMap, HashSet, and their iterators properly covariant

See #30642. `Drain` is the only type left invariant.

8 years agoAuto merge of #32586 - seanmonstar:speialize-to-string, r=alexcrichton
bors [Fri, 1 Apr 2016 04:18:29 +0000 (21:18 -0700)]
Auto merge of #32586 - seanmonstar:speialize-to-string, r=alexcrichton

specialize ToString for str

If there was some conditional compiling we could do, such that this impl only exists in nightly, and is turned off in beta/stable, I think that'd be an improvement here, as we could test specialization out without affecting stable builds.

8 years agoAuto merge of #32550 - tbu-:pr_ref_cell_as_unsafe_cell, r=alexcrichton
bors [Fri, 1 Apr 2016 00:52:25 +0000 (17:52 -0700)]
Auto merge of #32550 - tbu-:pr_ref_cell_as_unsafe_cell, r=alexcrichton

Remove `unsafe` qualifier from `RefCell::as_unsafe_cell`

This method is no longer unsafe because the field of `UnsafeCell` is no
longer public.

8 years agoAuto merge of #32506 - petrochenkov:use, r=Manishearth
bors [Thu, 31 Mar 2016 21:08:44 +0000 (14:08 -0700)]
Auto merge of #32506 - petrochenkov:use, r=Manishearth

syntax: Extra diagnostics for `_` used in an identifier position

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

8 years agoallow RUST_BACKTRACE=0 to act as if unset
Emanuel Czirai [Mon, 28 Mar 2016 12:41:55 +0000 (14:41 +0200)]
allow RUST_BACKTRACE=0 to act as if unset

/# This is a combination of 16 commits.
/# The first commit's message is:
allow RUST_BACKTRACE=disabled to act as if unset

When RUST_BACKTRACE is set to "disabled" then this acts as if the env.
var is unset.

/# This is the 2nd commit message:

case insensitive "DiSaBLeD" RUST_BACKTRACE value

previously it expected a lowercase "disabled" to treat the env. var as
unset

/# This is the 3rd commit message:

RUST_BACKTRACE=0 acts as if unset

previously RUST_BACKTRACE=disabled was doing the same thing

/# This is the 4th commit message:

RUST_BACKTRACE=0|n|no|off acts as if unset

previously only RUST_BACKTRACE=0 acted as if RUST_BACKTRACE was unset
Now added more options (case-insensitive): 'n','no' and 'off'
eg. RUST_BACKTRACE=oFF

/# This is the 5th commit message:

DRY on the value of 2

DRY=don't repeat yourself
Because having to remember to keep the two places of '2' in sync is not
ideal, even though this is a simple enough case.

/# This is the 6th commit message:

Revert "DRY on the value of 2"

This reverts commit 95a0479d5cf72a2b2d9d21ec0bed2823ed213fef.

Nevermind this DRY on 2, because we already have a RY on 1,
besides the code is less readable this way...

/# This is the 7th commit message:

attempt to document unsetting RUST_BACKTRACE

/# This is the 8th commit message:

curb allocations when checking for RUST_BACKTRACE

this means we don't check for case-insensitivity anymore

/# This is the 9th commit message:

as decided, RUST_BACKTRACE=0 turns off backtrace

/# This is the 10th commit message:

RUST_TEST_NOCAPTURE=0 acts as if unset

(that is, capture is on)

Any other value acts as if nocapture is enabled (that is, capture is off)

/# This is the 11th commit message:

update other RUST_TEST_NOCAPTURE occurrences

apparently only one place needs updating

/# This is the 12th commit message:

update RUST_BACKTRACE in man page

/# This is the 13th commit message:

handle an occurrence of RUST_BACKTRACE

/# This is the 14th commit message:

ensure consistency with new rules for backtrace

/# This is the 15th commit message:

a more concise comment for RUST_TEST_NOCAPTURE

/# This is the 16th commit message:

update RUST_TEST_NOCAPTURE in man page

8 years agolibrustc: excise Session's now-unused bug methods
Benjamin Herr [Tue, 29 Mar 2016 00:24:15 +0000 (02:24 +0200)]
librustc: excise Session's now-unused bug methods

8 years agolibrustc_const_eval: use bug!(), span_bug!()
Benjamin Herr [Thu, 31 Mar 2016 18:07:23 +0000 (20:07 +0200)]
librustc_const_eval: use bug!(), span_bug!()

8 years agolibrustc_trans: use bug!(), span_bug!()
Benjamin Herr [Mon, 28 Mar 2016 23:46:02 +0000 (01:46 +0200)]
librustc_trans: use bug!(), span_bug!()

8 years agolibrustc_typeck: use bug!(), span_bug!()
Benjamin Herr [Mon, 28 Mar 2016 22:06:35 +0000 (00:06 +0200)]
librustc_typeck: use bug!(), span_bug!()

8 years agolibrustc_save_analysis: remove duplicate macro def
Benjamin Herr [Mon, 28 Mar 2016 21:21:52 +0000 (23:21 +0200)]
librustc_save_analysis: remove duplicate macro def

8 years agolibrustc_save_analysis: use bug!(), span_bug!()
Benjamin Herr [Mon, 28 Mar 2016 21:21:01 +0000 (23:21 +0200)]
librustc_save_analysis: use bug!(), span_bug!()

8 years agolibrustc_resolve: use bug!(), span_bug!()
Benjamin Herr [Mon, 28 Mar 2016 21:11:50 +0000 (23:11 +0200)]
librustc_resolve: use bug!(), span_bug!()

8 years agolibrustc_privacy: use bug!(), span_bug!()
Benjamin Herr [Mon, 28 Mar 2016 21:07:48 +0000 (23:07 +0200)]
librustc_privacy: use bug!(), span_bug!()

8 years agolibrustc_passes: use bug!(), span_bug!()
Benjamin Herr [Mon, 28 Mar 2016 21:03:47 +0000 (23:03 +0200)]
librustc_passes: use bug!(), span_bug!()

8 years agolibrustc_metadata: use bug!(), span_bug!()
Benjamin Herr [Mon, 28 Mar 2016 21:00:01 +0000 (23:00 +0200)]
librustc_metadata: use bug!(), span_bug!()

8 years agolibrustc_mir: use bug!(), span_bug!()
Benjamin Herr [Mon, 28 Mar 2016 20:22:14 +0000 (22:22 +0200)]
librustc_mir: use bug!(), span_bug!()

8 years agolibrustc_lint: use bug!(), span_bug!()
Benjamin Herr [Mon, 28 Mar 2016 20:10:50 +0000 (22:10 +0200)]
librustc_lint: use bug!(), span_bug!()

8 years agolibrustc_borrowck: use bug!(), span_bug!()
Benjamin Herr [Mon, 28 Mar 2016 19:19:32 +0000 (21:19 +0200)]
librustc_borrowck: use bug!(), span_bug!()

8 years agolibrustc: replace panic!() with bug!()
Benjamin Herr [Sat, 26 Mar 2016 18:59:04 +0000 (19:59 +0100)]
librustc: replace panic!() with bug!()

8 years agolibrustc: replace unimplemented!() with bug!()
Benjamin Herr [Fri, 25 Mar 2016 19:58:30 +0000 (20:58 +0100)]
librustc: replace unimplemented!() with bug!()

8 years agolibrustc: replace unreachable! with bug!()
Benjamin Herr [Fri, 25 Mar 2016 17:46:11 +0000 (18:46 +0100)]
librustc: replace unreachable! with bug!()

8 years agolibrustc: replace span_bug calls with span_bug!()
Benjamin Herr [Fri, 25 Mar 2016 17:31:27 +0000 (18:31 +0100)]
librustc: replace span_bug calls with span_bug!()

8 years agolibrustc: replace tcx.sess.bug calls with bug!()
Benjamin Herr [Fri, 25 Mar 2016 00:14:29 +0000 (01:14 +0100)]
librustc: replace tcx.sess.bug calls with bug!()

8 years agolibrustc: add {span_,}bug! macros
Benjamin Herr [Wed, 23 Mar 2016 23:35:26 +0000 (00:35 +0100)]
librustc: add {span_,}bug! macros

... as single "internal compiler error" entry point.

The macros pass `file!()`, `line!()` and `format_args!(...)` on to a
cold, never-inlined function, ultimately calling `bug()` or `span_bug()`
on the `Handler` from `session::diagnostic()` via the tcx in tls or,
failing that, panicking directly.

8 years agoRemove incorrect comment about `PartialEq` implementation
Tobias Bucher [Thu, 31 Mar 2016 19:19:17 +0000 (21:19 +0200)]
Remove incorrect comment about `PartialEq` implementation

8 years agoFix a typo in the doc comment of `std::os::unix::thread::JoinHandleExt`
Tobias Bucher [Thu, 31 Mar 2016 17:28:06 +0000 (19:28 +0200)]
Fix a typo in the doc comment of `std::os::unix::thread::JoinHandleExt`

8 years agoAuto merge of #31938 - jseyfried:autoderef_privacy, r=nikomatsakis
bors [Thu, 31 Mar 2016 16:09:34 +0000 (09:09 -0700)]
Auto merge of #31938 - jseyfried:autoderef_privacy, r=nikomatsakis

Integrate privacy into field and method selection

This PR integrates privacy checking into field and method selection so that an inaccessible field/method can not stop an accessible field/method from being used (fixes #12808 and fixes #22684).
r? @eddyb

8 years agoadded missing refcell ref/refmut coercions to unsized
Валерий Лашманов [Thu, 31 Mar 2016 14:11:59 +0000 (10:11 -0400)]
added missing refcell ref/refmut coercions to unsized

8 years agoChange Arc to use compare_exchange instead of compare_and_swap
Amanieu d'Antras [Thu, 31 Mar 2016 12:15:20 +0000 (13:15 +0100)]
Change Arc to use compare_exchange instead of compare_and_swap

8 years agoFix formatting in the documentation for AtomicIsize::compare_exchange_weak
Amanieu d'Antras [Thu, 31 Mar 2016 12:13:53 +0000 (13:13 +0100)]
Fix formatting in the documentation for AtomicIsize::compare_exchange_weak

8 years agoImprove E0277 error message in a generic context
Tobias Bucher [Thu, 31 Mar 2016 09:15:36 +0000 (11:15 +0200)]
Improve E0277 error message in a generic context

This now mentions that you can restrict type parameters to be able to
call functions of traits.

8 years agoUsing only one Mibbit link for access the two channels
David AO Lozano [Thu, 31 Mar 2016 06:37:37 +0000 (00:37 -0600)]
Using only one Mibbit link for access the two channels

8 years agoAdding #rust-beginners to README and pointing the two channels on getting-started
David AO Lozano [Thu, 31 Mar 2016 02:07:53 +0000 (20:07 -0600)]
Adding #rust-beginners to README and pointing the two channels on getting-started

8 years agoMisspelled beginners in one place
David AO Lozano [Wed, 30 Mar 2016 19:55:25 +0000 (13:55 -0600)]
Misspelled beginners in one place

8 years agoBook: in beginner guide change irc channel #rust → #rust-beginners
David AO Lozano [Wed, 30 Mar 2016 19:45:06 +0000 (13:45 -0600)]
Book: in beginner guide change irc channel #rust → #rust-beginners

8 years agosyntax: Extra diagnostics for `_` used in an identifier position
Vadim Petrochenkov [Thu, 31 Mar 2016 07:15:36 +0000 (10:15 +0300)]
syntax: Extra diagnostics for `_` used in an identifier position

8 years agoRemove accidental `println!`
Jeffrey Seyfried [Thu, 31 Mar 2016 06:22:12 +0000 (06:22 +0000)]
Remove accidental `println!`

8 years agoAuto merge of #32439 - jseyfried:visible_suggestions, r=nrc
bors [Thu, 31 Mar 2016 04:13:43 +0000 (21:13 -0700)]
Auto merge of #32439 - jseyfried:visible_suggestions, r=nrc

diagnostics: make paths to external items more visible

This PR changes the reported path for an external item so that it is visible from at least one local module (i.e. it does not use any inaccessible external modules) if possible. If the external item's crate was declared with an `extern crate`, the path is guarenteed to use the `extern crate`.

Fixes #23224, fixes #23355, fixes #26635, fixes #27165.

r? @nrc

8 years agoTest that HashMap, HashSet, and their iterators are properly covariant
Jonathan S [Thu, 31 Mar 2016 02:57:31 +0000 (21:57 -0500)]
Test that HashMap, HashSet, and their iterators are properly covariant

8 years agoFix the variances of HashMap and HashSet iterators
Jonathan S [Thu, 31 Mar 2016 02:09:09 +0000 (21:09 -0500)]
Fix the variances of HashMap and HashSet iterators

8 years agoMake HashMap's RawBucket covariant
Jonathan S [Thu, 31 Mar 2016 02:50:42 +0000 (21:50 -0500)]
Make HashMap's RawBucket covariant

8 years agoRegister new FreeBSD snapshot
Alan Somers [Wed, 30 Mar 2016 13:25:02 +0000 (13:25 +0000)]
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

8 years agoTurn break critical edges into a MIR pass
James Miller [Wed, 30 Mar 2016 01:46:02 +0000 (14:46 +1300)]
Turn break critical edges into a MIR pass

Also adds a new set of passes to run just before translation that
"prepare" the MIR for codegen. Removal of landing pads, region erasure
and break critical edges are run in this pass.

Also fixes some merge/rebase errors.

8 years agoUpdate Rust version in the Rustonomicon Vec chapter
Matt Brubeck [Wed, 30 Mar 2016 23:59:38 +0000 (16:59 -0700)]
Update Rust version in the Rustonomicon Vec chapter

I verified that the final code compiles in Rust 1.9.0-nightly.

8 years agoAuto merge of #32628 - Manishearth:rollup, r=Manishearth
bors [Wed, 30 Mar 2016 23:41:08 +0000 (16:41 -0700)]
Auto merge of #32628 - Manishearth:rollup, r=Manishearth

Rollup of 4 pull requests

- Successful merges: #32259, #32494, #32612, #32618
- Failed merges: #32562

8 years agoRollup merge of #32618 - ProgVal:patch-1, r=steveklabnik
Manish Goregaokar [Wed, 30 Mar 2016 23:34:59 +0000 (05:04 +0530)]
Rollup merge of #32618 - ProgVal:patch-1, r=steveklabnik

Book: Fix phrasing: “an associated type” → “an object with an associated type”.

From what I understood, `graph` is the object from which we create a trait object, and the associated types are `Graph::N` and `Graph::E`.

8 years agoRollup merge of #32612 - frewsxcv:unnecessary-coercions, r=alexcrichton
Manish Goregaokar [Wed, 30 Mar 2016 23:34:59 +0000 (05:04 +0530)]
Rollup merge of #32612 - frewsxcv:unnecessary-coercions, r=alexcrichton

Remove no longer necessary coercions to fn pointer types.

Originally added in 8fe9e4dff6d9d0fdd940835ae377edcb3754f8c1.

Everything appears to build fine without the coercions, so they can
presumably be removed.

8 years agoRollup merge of #32494 - pnkfelix:gate-parser-recovery-via-debugflag, r=nrc
Manish Goregaokar [Wed, 30 Mar 2016 23:34:59 +0000 (05:04 +0530)]
Rollup merge of #32494 - pnkfelix:gate-parser-recovery-via-debugflag, r=nrc

Gate parser recovery via debugflag

Gate parser recovery via debugflag

Put in `-Z continue_parse_after_error`

This works by adding a method, `fn abort_if_no_parse_recovery`, to the
diagnostic handler in `syntax::errors`, and calling it after each
error is emitted in the parser.

(We might consider adding a debugflag to do such aborts in other
places where we are currently attempting recovery, such as resolve,
but I think the parser is the really important case to handle in the
face of #31994 and the parser bugs of varying degrees that were
injected by parse error recovery.)

r? @nikomatsakis

8 years agoRollup merge of #32259 - oli-obk:move_const_eval, r=alexcrichton
Manish Goregaokar [Wed, 30 Mar 2016 23:34:59 +0000 (05:04 +0530)]
Rollup merge of #32259 - oli-obk:move_const_eval, r=alexcrichton

move `const_eval` and `check_match` out of `librustc` into their own crate

r? @arielb1

8 years agoFix fallout in tests
Jeffrey Seyfried [Sun, 20 Mar 2016 11:24:08 +0000 (11:24 +0000)]
Fix fallout in tests

8 years agoAdd method `visible_item_path` to `CStore`
Jeffrey Seyfried [Sat, 19 Mar 2016 09:01:29 +0000 (09:01 +0000)]
Add method `visible_item_path` to `CStore`

8 years agoImprove tests
Jeffrey Seyfried [Wed, 30 Mar 2016 00:35:53 +0000 (00:35 +0000)]
Improve tests

8 years agoprivacy: Cleanup check_field
Vadim Petrochenkov [Wed, 16 Mar 2016 21:34:18 +0000 (00:34 +0300)]
privacy: Cleanup check_field

8 years agoClean up the privacy visitor
Jeffrey Seyfried [Wed, 16 Mar 2016 02:50:34 +0000 (02:50 +0000)]
Clean up the privacy visitor

8 years agoAdd tests for #12808 and #22684
Jeffrey Seyfried [Fri, 26 Feb 2016 18:58:45 +0000 (18:58 +0000)]
Add tests for #12808 and #22684

8 years agoFix fallout in tests
Jeffrey Seyfried [Thu, 3 Mar 2016 02:32:55 +0000 (02:32 +0000)]
Fix fallout in tests

8 years agoAutoderef privacy for methods
Jeffrey Seyfried [Thu, 25 Feb 2016 02:11:29 +0000 (02:11 +0000)]
Autoderef privacy for methods

8 years agoAutoderef privacy for fields
Jeffrey Seyfried [Wed, 24 Feb 2016 10:58:35 +0000 (10:58 +0000)]
Autoderef privacy for fields

8 years agofix compile-fail and parse-fail tests by blindly opting back into
Felix S. Klock II [Sat, 26 Mar 2016 00:36:03 +0000 (01:36 +0100)]
fix compile-fail and parse-fail tests by blindly opting back into
parser recovery (so that expected errors match up)

I'm opting into parser recovery in all these cases out of expediency,
not because the error messages you get with recovery enabled are
actually all that usable in all cases listed.

8 years agoPut in `-Z continue-parse-after-error`
Felix S. Klock II [Fri, 25 Mar 2016 17:17:04 +0000 (18:17 +0100)]
Put in `-Z continue-parse-after-error`

This works by adding a boolean flag, `continue_after_error`, to
`syntax::errors::Handler` that can be imperatively set to `true` or
`false` via a new `fn set_continue_after_error`.

The flag starts off true (since we generally try to recover from
compiler errors, and `Handler` is shared across all phases).

Then, during the `phase_1_parse_input`, we consult the setting of the
`-Z continue-parse-after-error` debug flag to determine whether we
should leave the flag set to `true` or should change it to `false`.

----

(We might consider adding a debugflag to do such aborts in other
places where we are currently attempting recovery, such as resolve,
but I think the parser is the really important case to handle in the
face of #31994 and the parser bugs of varying degrees that were
injected by parse error recovery.)

8 years agoAuto merge of #32621 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 30 Mar 2016 18:33:31 +0000 (11:33 -0700)]
Auto merge of #32621 - steveklabnik:rollup, r=steveklabnik

Rollup of 7 pull requests

- Successful merges: #32580, #32591, #32603, #32605, #32606, #32607, #32608
- Failed merges:

8 years agospecialize ToString for str
Sean McArthur [Wed, 23 Mar 2016 02:29:56 +0000 (19:29 -0700)]
specialize ToString for str

8 years agoBook: Fix phrasing: “an associated type” → “a trait with an associated type”.
Valentin Lorentz [Wed, 30 Mar 2016 17:34:53 +0000 (19:34 +0200)]
Book: Fix phrasing: “an associated type” → “a trait with an associated type”.

8 years agoRollup merge of #32608 - tshepang:grammar, r=aturon
Steve Klabnik [Wed, 30 Mar 2016 17:16:55 +0000 (10:16 -0700)]
Rollup merge of #32608 - tshepang:grammar, r=aturon

doc: "of the" seems more correct than "to the"

It's also less ambiguous

8 years agoRollup merge of #32607 - tshepang:we-gots-intoiterator, r=apasel422
Steve Klabnik [Wed, 30 Mar 2016 17:16:55 +0000 (10:16 -0700)]
Rollup merge of #32607 - tshepang:we-gots-intoiterator, r=apasel422

doc: no need for an explicit iter()

8 years agoRollup merge of #32606 - tshepang:typo, r=bluss
Steve Klabnik [Wed, 30 Mar 2016 17:16:55 +0000 (10:16 -0700)]
Rollup merge of #32606 - tshepang:typo, r=bluss

doc: fix typo

8 years agoRollup merge of #32605 - tshepang:not-needed, r=Manishearth
Steve Klabnik [Wed, 30 Mar 2016 17:16:54 +0000 (10:16 -0700)]
Rollup merge of #32605 - tshepang:not-needed, r=Manishearth

doc: "mut" not needed for the examples

8 years agoRollup merge of #32603 - tshepang:capitalise, r=bluss
Steve Klabnik [Wed, 30 Mar 2016 17:16:54 +0000 (10:16 -0700)]
Rollup merge of #32603 - tshepang:capitalise, r=bluss

doc: first letter should be upper case

8 years agoRollup merge of #32591 - CryZe:patch-1, r=steveklabnik
Steve Klabnik [Wed, 30 Mar 2016 17:16:54 +0000 (10:16 -0700)]
Rollup merge of #32591 - CryZe:patch-1, r=steveklabnik

Fix panic_fmt in the Book

While implementing panic_fmt for the GameCube I noticed that the parameters given to it were completely broken. Turns out that panic_fmt requires the C ABI to work correctly. This should be fixed in the documentation, so that others don't make the same mistake. Thanks to mbrubeck in the IRC for helping me figure this out.

Not specifying extern for lang_items correctly should potentially also be a compiler error.

8 years agoRollup merge of #32580 - durka:patch-17, r=steveklabnik
Steve Klabnik [Wed, 30 Mar 2016 17:16:54 +0000 (10:16 -0700)]
Rollup merge of #32580 - durka:patch-17, r=steveklabnik

verb agreement in core::convert docs