]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAdd `Copy` to the traits that are automatically implemented for tuples
Tobias Bucher [Wed, 6 Apr 2016 18:10:33 +0000 (20:10 +0200)]
Add `Copy` to the traits that are automatically implemented for tuples

8 years agoAuto merge of #32767 - Manishearth:breakingbatch, r=eddyb
bors [Wed, 6 Apr 2016 12:04:15 +0000 (05:04 -0700)]
Auto merge of #32767 - Manishearth:breakingbatch, r=eddyb

Batch up all plugin breaking changes

https://github.com/rust-lang/rust/pull/32688 already landed so we should get this into the same nightly.

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

8 years agoRollup merge of #32570 - eddyb:tis-but-a-front, r=nikomatsakis
Manish Goregaokar [Wed, 6 Apr 2016 12:01:16 +0000 (17:31 +0530)]
Rollup merge of #32570 - eddyb:tis-but-a-front, r=nikomatsakis

 r? @nikomatsakis

Conflicts:
src/librustc_save_analysis/lib.rs
src/libsyntax/ast_util.rs

8 years agoRollup merge of #32682 - petrochenkov:field3, r=Manishearth
Manish Goregaokar [Wed, 6 Apr 2016 11:45:31 +0000 (17:15 +0530)]
Rollup merge of #32682 - petrochenkov:field3, r=Manishearth

 The AST part of https://github.com/rust-lang/rust/pull/31937

Unlike HIR, AST still uses `Option` for field names because parser can't know field indexes reliably due to constructions like
```
struct S(#[cfg(false)] u8, u8); // The index of the second field changes from 1 during parsing to 0 after expansion.
```
and I wouldn't like to put the burden of renaming fields on expansion passes and syntax extensions.

plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645
r? @Manishearth

8 years agorustc: retire hir::map's paths.
Eduard Burtescu [Wed, 6 Apr 2016 10:51:55 +0000 (13:51 +0300)]
rustc: retire hir::map's paths.

8 years agoMove span into `StructField`
Vadim Petrochenkov [Wed, 6 Apr 2016 08:19:10 +0000 (11:19 +0300)]
Move span into `StructField`

8 years agoGet rid of ast::StructFieldKind
Vadim Petrochenkov [Sat, 2 Apr 2016 13:47:53 +0000 (16:47 +0300)]
Get rid of ast::StructFieldKind

8 years agorustc: move some maps from ty to hir.
Eduard Burtescu [Tue, 29 Mar 2016 10:14:01 +0000 (13:14 +0300)]
rustc: move some maps from ty to hir.

8 years agorustc: move middle::{def,def_id,pat_util} to hir.
Eduard Burtescu [Tue, 29 Mar 2016 09:54:26 +0000 (12:54 +0300)]
rustc: move middle::{def,def_id,pat_util} to hir.

8 years agosyntax: dismantle ast_util.
Eduard Burtescu [Tue, 29 Mar 2016 09:12:01 +0000 (12:12 +0300)]
syntax: dismantle ast_util.

8 years agorustc: dismantle hir::util, mostly moving functions to methods.
Eduard Burtescu [Tue, 29 Mar 2016 06:32:58 +0000 (09:32 +0300)]
rustc: dismantle hir::util, mostly moving functions to methods.

8 years agorustc: move rustc_front to rustc::hir.
Eduard Burtescu [Tue, 29 Mar 2016 05:50:44 +0000 (08:50 +0300)]
rustc: move rustc_front to rustc::hir.

8 years agoAuto merge of #32688 - jseyfried:ast_groundwork_for_1422, r=pnkfelix
bors [Wed, 6 Apr 2016 01:58:24 +0000 (18:58 -0700)]
Auto merge of #32688 - jseyfried:ast_groundwork_for_1422, r=pnkfelix

[breaking-batch] Add support for `pub(restricted)` syntax in the AST

This PR allows the AST to represent the `pub(restricted)` syntax from RFC 1422 (cc #32409).

More specifically, it makes `ast::Visibility` non-`Copy` and adds two new variants, `Visibility::Crate` for `pub(crate)` and `Visitibility::Restricted { path: P<Path>, id: NodeId }` for `pub(path)`.

plugin-[breaking-change] cc #31645
r? @pnkfelix

8 years agoAuto merge of #32415 - alexcrichton:android-signal, r=alexcrichton
bors [Tue, 5 Apr 2016 21:19:28 +0000 (14:19 -0700)]
Auto merge of #32415 - alexcrichton:android-signal, r=alexcrichton

std: Fix linking against `signal` on Android

Currently the minimum supported Android version of the standard library is
API level 18 (android-18). Back in those days [1] the `signal` function was
just an inline wrapper around `bsd_signal`, but starting in API level
android-20 the `signal` symbols was introduced [2]. Finally, in android-21
the API `bsd_signal` was removed [3].

Basically this means that if we want to be binary compatible with multiple
Android releases (oldest being 18 and newest being 21) then we need to check
for both symbols and not actually link against either.

This was first discovered in rust-lang/libc#236 with a fix proposed in
rust-lang/libc#237. I suspect that we'll want to accept rust-lang/libc#237 so
Rust crates at large continue to be compatible with newer releases of Android
and crates, like the standard library, that want to opt into older support can
continue to do so via similar means.

Closes rust-lang/libc#236

[1]: https://chromium.googlesource.com/android_tools/+/20ee6d20/ndk/platforms/android-18/arch-arm/usr/include/signal.h
[2]: https://chromium.googlesource.com/android_tools/+/fbd420/ndk_experimental/platforms/android-20/arch-arm/usr/include/signal.h
[3]: https://chromium.googlesource.com/android_tools/+/20ee6d/ndk/platforms/android-21/arch-arm/usr/include/signal.h

8 years agoAuto merge of #32743 - Manishearth:rollup, r=Manishearth
bors [Tue, 5 Apr 2016 17:55:38 +0000 (10:55 -0700)]
Auto merge of #32743 - Manishearth:rollup, r=Manishearth

Rollup of 11 pull requests

- Successful merges: #32403, #32596, #32675, #32678, #32685, #32686, #32692, #32710, #32712, #32714, #32715
- Failed merges: #32488

8 years agoAuto merge of #32742 - eddyb:cast-fns, r=dotdash
bors [Tue, 5 Apr 2016 12:48:47 +0000 (05:48 -0700)]
Auto merge of #32742 - eddyb:cast-fns, r=dotdash

trans: don't declare symbols that were already imported.

Fixes #32740 by checking for a declaration before attempting a new one.
Before, `LLVMGetOrInsertFunction` was called for a existing import, but with a different type.
The returned value was a cast function pointer instead of a declaration, and we gave this
value to `llvm::SetFunctionCallConv` & friends , which triggered an LLVM assertion.

8 years agoRollup merge of #32715 - nrc:rustdoc-highlight, r=cmr
Manish Goregaokar [Tue, 5 Apr 2016 11:13:22 +0000 (16:43 +0530)]
Rollup merge of #32715 - nrc:rustdoc-highlight, r=cmr

rustdoc: factor out function for getting inner html of highlighted source

8 years agoRollup merge of #32714 - nrc:json-err-end-span, r=sfackler
Manish Goregaokar [Tue, 5 Apr 2016 11:13:22 +0000 (16:43 +0530)]
Rollup merge of #32714 - nrc:json-err-end-span, r=sfackler

JSON errors: give better spans for SpanEnd errors

8 years agoRollup merge of #32712 - jonas-schievink:autoderef-fields-for-fn-ty, r=nagisa
Manish Goregaokar [Tue, 5 Apr 2016 11:13:22 +0000 (16:43 +0530)]
Rollup merge of #32712 - jonas-schievink:autoderef-fields-for-fn-ty, r=nagisa

Autoderef when suggesting to call `(self.field)`

Fixes #32128

8 years agoRollup merge of #32710 - jonas-schievink:consider-last-semi, r=nagisa
Manish Goregaokar [Tue, 5 Apr 2016 11:13:22 +0000 (16:43 +0530)]
Rollup merge of #32710 - jonas-schievink:consider-last-semi, r=nagisa

Fix "consider removing this semicolon" help

Check last statement in a block, not the first.

Example of current weirdness: http://is.gd/w80J9h

The help was only rarely emitted, and if so, often incorrectly (see above playpen). It was basically only useful with single-statement functions.

8 years agoRollup merge of #32692 - sfackler:time-inline, r=alexcrichton
Manish Goregaokar [Tue, 5 Apr 2016 11:13:21 +0000 (16:43 +0530)]
Rollup merge of #32692 - sfackler:time-inline, r=alexcrichton

Inline Duration constructors and accessors

These are all super small functions

r? @alexcrichton

8 years agoRollup merge of #32686 - mneumann:dragonfly_jemalloc_prefix, r=alexcrichton
Manish Goregaokar [Tue, 5 Apr 2016 11:13:21 +0000 (16:43 +0530)]
Rollup merge of #32686 - mneumann:dragonfly_jemalloc_prefix, r=alexcrichton

Prefix jemalloc on DragonFly to prevent segfaults.

Similar to commits ed015456a114ae907a36af80c06f81ea93182a24 (iOS)
and e3b414d8612314e74e2b0ebde1ed5c6997d28e8d (Android)

8 years agoRollup merge of #32685 - dhuseby:add_freebsd_i686_snapshot_4d3eebf, r=alexcrichton
Manish Goregaokar [Tue, 5 Apr 2016 11:13:21 +0000 (16:43 +0530)]
Rollup merge of #32685 - dhuseby:add_freebsd_i686_snapshot_4d3eebf, r=alexcrichton

adding freebsd i686 snapshot 4d3eebf

@alexcrichton will you please upload the following file when landing this patch:

https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2016-02-17-4d3eebf-freebsd-i386-4e2af0b34eb335e173aebff543be693724a956c2.tar.bz2

8 years agoRollup merge of #32678 - mitaa:rdoc-stripped, r=alexcrichton
Manish Goregaokar [Tue, 5 Apr 2016 11:13:21 +0000 (16:43 +0530)]
Rollup merge of #32678 - mitaa:rdoc-stripped, r=alexcrichton

rustdoc: make rustdoc 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.

r? @alexcrichton

8 years agoRollup merge of #32675 - dhuseby:snapshots-01-04-16, r=alexcrichton
Manish Goregaokar [Tue, 5 Apr 2016 11:13:21 +0000 (16:43 +0530)]
Rollup merge of #32675 - dhuseby:snapshots-01-04-16, r=alexcrichton

adds dragonflybsd to snapshots.txt

@alexcrichton please upload the following snapshots when landing this patch:

https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2016-02-17-4d3eebf-dragonfly-x86_64-765bb5820ad406e966ec0ac51c8070b656459b02.tar.bz2

https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2016-02-17-4d3eebf-freebsd-x86_64-395adf223f3f25514c9dffecb524f493c42a0e5d.tar.bz2

8 years agoRollup merge of #32596 - soltanmm:lazy, r=nikomatsakis
Manish Goregaokar [Tue, 5 Apr 2016 11:13:21 +0000 (16:43 +0530)]
Rollup merge of #32596 - soltanmm:lazy, r=nikomatsakis

Plumb obligations through librustc/infer

Like #32542, but more like #31867.

TODO before merge: make an issue for the propagation of obligations through... uh, everywhere... then replace the `#????`s with the actual issue number.

cc @jroesch
r? @nikomatsakis

8 years agoRollup merge of #32403 - vlastachu:super_in_path, r=jseyfried
Manish Goregaokar [Tue, 5 Apr 2016 11:13:20 +0000 (16:43 +0530)]
Rollup merge of #32403 - vlastachu:super_in_path, r=jseyfried

Fix issue: Global paths in `use` directives can begin with `super` or `self` #32225

This PR fixes #32225 by warning on `use ::super::...` and `use ::self::...` on `resolve`.

Current changes is the most minimal and ad-hoc.

8 years agoAuto merge of #29463 - jseyfried:master, r=nikomatsakis
bors [Tue, 5 Apr 2016 10:26:58 +0000 (03:26 -0700)]
Auto merge of #29463 - jseyfried:master, r=nikomatsakis

Remove implicit binder from `FnSpace` in `VecPerParamSpace` (fixes #20526)

This removes the implicit binder from `FnSpace` in `VecPerParamSpace` so that `Binder<T>` is the only region binder (as described in issue #20526), and refactors away `enter_region_binder` and `exit_region_binder` from `TypeFolder`.

8 years agotrans: don't declare symbols that were already imported.
Eduard Burtescu [Tue, 5 Apr 2016 10:01:00 +0000 (13:01 +0300)]
trans: don't declare symbols that were already imported.

8 years agoFixes bug which accepting using `super` in use statemet.
vlastachu [Sun, 20 Mar 2016 00:04:12 +0000 (03:04 +0300)]
Fixes bug which accepting using `super` in use statemet.

Issue: #32225

8 years agostd: Fix linking against `signal` on Android
Alex Crichton [Mon, 21 Mar 2016 23:54:53 +0000 (16:54 -0700)]
std: Fix linking against `signal` on Android

Currently the minimum supported Android version of the standard library is
API level 18 (android-18). Back in those days [1] the `signal` function was
just an inline wrapper around `bsd_signal`, but starting in API level
android-20 the `signal` symbols was introduced [2]. Finally, in android-21
the API `bsd_signal` was removed [3].

Basically this means that if we want to be binary compatible with multiple
Android releases (oldest being 18 and newest being 21) then we need to check
for both symbols and not actually link against either.

This was first discovered in rust-lang/libc#236 with a fix proposed in
rust-lang/libc#237. I suspect that we'll want to accept rust-lang/libc#237 so
Rust crates at large continue to be compatible with newer releases of Android
and crates, like the standard library, that want to opt into older support can
continue to do so via similar means.

Closes rust-lang/libc#236

[1]: https://chromium.googlesource.com/android_tools/+/20ee6d20/ndk/platforms/android-18/arch-arm/usr/include/signal.h
[2]: https://chromium.googlesource.com/android_tools/+/fbd420/ndk_experimental/platforms/android-20/arch-arm/usr/include/signal.h
[3]: https://chromium.googlesource.com/android_tools/+/20ee6d/ndk/platforms/android-21/arch-arm/usr/include/signal.h

8 years agoAuto merge of #32328 - jseyfried:coherence, r=nikomatsakis
bors [Tue, 5 Apr 2016 04:50:05 +0000 (21:50 -0700)]
Auto merge of #32328 - jseyfried:coherence, r=nikomatsakis

resolve: Improve import failure detection and lay groundwork for RFC 1422

This PR improves import failure detection and lays some groundwork for RFC 1422.
More specifically, it
 - Avoids recomputing the resolution of an import directive's module path.
 - Refactors code in `resolve_imports` that does not scale to the arbitrarily many levels of visibility that will be required by RFC 1422.
  - Replaces `ModuleS`'s fields `public_glob_count`, `private_glob_count`, and `resolved_globs` with a list of glob import directives `globs`.
  - Replaces `NameResolution`'s fields `pub_outstanding_references` and `outstanding_references` with a field `single_imports` of a newly defined type `SingleImports`.
 - Improves import failure detection by detecting cycles that include single imports (currently, only cycles of globs are detected). This fixes #32119.

r? @nikomatsakis

8 years agoAuto merge of #32647 - Amanieu:checked_atomic_intrinsics, r=eddyb
bors [Mon, 4 Apr 2016 22:37:31 +0000 (15:37 -0700)]
Auto merge of #32647 - Amanieu:checked_atomic_intrinsics, r=eddyb

Only allow using the atomic intrinsics on integer types

Using these with non-integer types results in LLVM asserts. Atomic operations on non-integer types will require values be transmuted into an integer type of suitable size.

This doesn't affect the standard library since `AtomicBool` and `AtomicPtr` currently use `usize` for atomic operations.

r? @eddyb

8 years agoadds dragonflybsd and freebsd to snapshots.txt
Dave Huseby [Sat, 2 Apr 2016 12:08:19 +0000 (05:08 -0700)]
adds dragonflybsd and freebsd to snapshots.txt

8 years agoAddress nits
Masood Malekghassemi [Mon, 4 Apr 2016 19:41:05 +0000 (12:41 -0700)]
Address nits

8 years agoAuto merge of #32582 - nikomatsakis:issue-32326, r=aturon
bors [Mon, 4 Apr 2016 18:41:01 +0000 (11:41 -0700)]
Auto merge of #32582 - nikomatsakis:issue-32326, r=aturon

process cycles as soon as they are detected

We used to wait for the recursion limit, but that might well be too
long!

Fixes #32326
r? @aturon

8 years agoadd error code to test
Niko Matsakis [Mon, 4 Apr 2016 16:31:29 +0000 (12:31 -0400)]
add error code to test

8 years agofix corner case around top of stack
Niko Matsakis [Tue, 29 Mar 2016 20:33:50 +0000 (16:33 -0400)]
fix corner case around top of stack

When deciding on a coinductive match, we were examining the new
obligation and the backtrace, but not the *current* obligation that goes
in between the two.  Refactoring the code to just have the cycle given
as input also made things a lot simpler.

8 years agoprocess cycles as soon as they are detected
Niko Matsakis [Mon, 28 Mar 2016 23:21:10 +0000 (19:21 -0400)]
process cycles as soon as they are detected

We used to wait for the recursion limit, but that might well be too
long!

8 years agoAuto merge of #32644 - oli-obk:check_all_constants_early, r=nrc
bors [Mon, 4 Apr 2016 14:07:42 +0000 (07:07 -0700)]
Auto merge of #32644 - oli-obk:check_all_constants_early, r=nrc

check constants even if they are not used in the current crate

For now this is just a `warn`-by-default lint. I suggest to make it a `deny`-by-default lint in the next release cycle (so no dependencies break), and then in another release cycle move to an error.

cc #19265
cc #3170

8 years agoJust use Some(()) instead
Jonas Schievink [Mon, 4 Apr 2016 13:08:38 +0000 (15:08 +0200)]
Just use Some(()) instead

8 years agouse `unwrap_or`
Jonas Schievink [Mon, 4 Apr 2016 12:10:03 +0000 (14:10 +0200)]
use `unwrap_or`

8 years agoBeef up test
Jonas Schievink [Mon, 4 Apr 2016 11:53:04 +0000 (13:53 +0200)]
Beef up test

8 years agorustdoc: factor out function for getting inner html of highlighted source
Nick Cameron [Sun, 3 Apr 2016 23:07:41 +0000 (11:07 +1200)]
rustdoc: factor out function for getting inner html of highlighted source

8 years agoGive better spans for SpanEnd errors
Nick Cameron [Sun, 3 Apr 2016 22:32:37 +0000 (10:32 +1200)]
Give better spans for SpanEnd errors

8 years agoAdd compile-fail test
Amanieu d'Antras [Thu, 31 Mar 2016 14:28:12 +0000 (15:28 +0100)]
Add compile-fail test

8 years agoAuto merge of #32676 - durka:patch-18, r=alexcrichton
bors [Sun, 3 Apr 2016 22:01:47 +0000 (15:01 -0700)]
Auto merge of #32676 - durka:patch-18, r=alexcrichton

add missing spaces in #16758 warning

I should probably add a test.

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 agoFix "consider removing this semicolon" help
Jonas Schievink [Sun, 3 Apr 2016 20:10:21 +0000 (22:10 +0200)]
Fix "consider removing this semicolon" help

Check last statement in a block, not the first

8 years agoAuto merge of #32672 - ollie27:patch-5, r=alexcrichton
bors [Sun, 3 Apr 2016 19:11:57 +0000 (12:11 -0700)]
Auto merge of #32672 - ollie27:patch-5, r=alexcrichton

Fix a couple of dead links on core::num::ParseFloatError docs

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 agocheck constants even if they are unused in the current crate
Oliver Schneider [Fri, 1 Apr 2016 07:19:29 +0000 (09:19 +0200)]
check constants even if they are unused in the current crate

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 agoInline Duration constructors and accessors
Steven Fackler [Sun, 3 Apr 2016 03:41:37 +0000 (20:41 -0700)]
Inline Duration constructors and accessors

These are all super small functions

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 agoAdd `Crate` and `Restricted` variants to `ast::Visibility`
Jeffrey Seyfried [Thu, 31 Mar 2016 19:10:38 +0000 (19:10 +0000)]
Add `Crate` and `Restricted` variants to `ast::Visibility`

8 years agoMake `ast::Visibility` non-copyable
Jeffrey Seyfried [Wed, 23 Mar 2016 10:17:34 +0000 (10:17 +0000)]
Make `ast::Visibility` non-copyable

8 years agoRemove `ast::Visibility::inherit_from` (it is unused and has obsolete semantics)
Jeffrey Seyfried [Sat, 2 Apr 2016 20:21:02 +0000 (20:21 +0000)]
Remove `ast::Visibility::inherit_from` (it is unused and has obsolete semantics)

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 agoPrefix jemalloc on DragonFly to prevent segfaults.
Michael Neumann [Sat, 2 Apr 2016 16:40:59 +0000 (18:40 +0200)]
Prefix jemalloc on DragonFly to prevent segfaults.

Similar to commits ed015456a114ae907a36af80c06f81ea93182a24 (iOS)
and e3b414d8612314e74e2b0ebde1ed5c6997d28e8d (Android)

8 years agoadding freebsd i686 snapshot 4d3eebf
Dave Huseby [Sat, 2 Apr 2016 15:50:09 +0000 (08:50 -0700)]
adding freebsd i686 snapshot 4d3eebf

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 agoSlim down `rustdoc::html::render::Context`
mitaa [Sat, 2 Apr 2016 07:03:55 +0000 (09:03 +0200)]
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>`.

8 years agoRefactor `HiddenStructField` into `StrippedItem`
mitaa [Sat, 2 Apr 2016 06:17:59 +0000 (08:17 +0200)]
Refactor `HiddenStructField` into `StrippedItem`

8 years agoMake the rendering process less pass-aware
mitaa [Thu, 31 Mar 2016 16:15:54 +0000 (18:15 +0200)]
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.

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 agoadd missing spaces in #16758 warning
Alex Burka [Sat, 2 Apr 2016 06:13:36 +0000 (02:13 -0400)]
add missing spaces in #16758 warning

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 agoFix a couple of dead links on core::num::ParseFloatError docs
Oliver Middleton [Fri, 1 Apr 2016 22:46:58 +0000 (23:46 +0100)]
Fix a couple of dead links on core::num::ParseFloatError docs

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!()