]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoImplement `Default` for more types in the standard library
Tobias Bucher [Fri, 15 Apr 2016 15:53:43 +0000 (17:53 +0200)]
Implement `Default` for more types in the standard library

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

8 years agoAuto merge of #32778 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 6 Apr 2016 20:44:51 +0000 (13:44 -0700)]
Auto merge of #32778 - steveklabnik:rollup, r=steveklabnik

Rollup of 12 pull requests

- Successful merges: #31762, #32538, #32634, #32668, #32679, #32691, #32724, #32727, #32744, #32761, #32766, #32774
- Failed merges:

8 years agoRollup merge of #32774 - tbu-:pr_doc_tuple_copy, r=brson
Steve Klabnik [Wed, 6 Apr 2016 19:12:09 +0000 (12:12 -0700)]
Rollup merge of #32774 - tbu-:pr_doc_tuple_copy, r=brson

Add `Copy` to the traits that are automatically implemented for tuples

8 years agoRollup merge of #32766 - nikomatsakis:constant-pattern-warning-cycle, r=eddyb
Steve Klabnik [Wed, 6 Apr 2016 19:12:09 +0000 (12:12 -0700)]
Rollup merge of #32766 - nikomatsakis:constant-pattern-warning-cycle, r=eddyb

change constant patterns to have a warning cycle

This was the original intention :(

r? @eddyb

8 years agoRollup merge of #32761 - tshepang:assert, r=steveklabnik
Steve Klabnik [Wed, 6 Apr 2016 19:12:09 +0000 (12:12 -0700)]
Rollup merge of #32761 - tshepang:assert, r=steveklabnik

avoid "==" in assert! when one of the values is a bool

Is suspect this is something of an idiom

8 years agoRollup merge of #32744 - GuillaumeGomez:patch-3, r=steveklabnik
Steve Klabnik [Wed, 6 Apr 2016 19:12:09 +0000 (12:12 -0700)]
Rollup merge of #32744 - GuillaumeGomez:patch-3, r=steveklabnik

Add example doc for ToOwned trait

Fixes #29342.

r? @steveklabnik

8 years agoRollup merge of #32727 - matklad:fix-comment, r=alexcrichton
Steve Klabnik [Wed, 6 Apr 2016 19:12:08 +0000 (12:12 -0700)]
Rollup merge of #32727 - matklad:fix-comment, r=alexcrichton

minor: update old comments

No more lifetimes in function types after https://github.com/rust-lang/rust/commit/f945190e6352a1bc965a117569532643319b400f

8 years agoRollup merge of #32724 - sanxiyn:outdated-comment, r=dotdash
Steve Klabnik [Wed, 6 Apr 2016 19:12:08 +0000 (12:12 -0700)]
Rollup merge of #32724 - sanxiyn:outdated-comment, r=dotdash

Remove outdated comment

The corresponding code was removed in #31824. Also remove code duplication and rename the function.

8 years agoRollup merge of #32691 - frewsxcv:patch-28, r=alexcrichton
Steve Klabnik [Wed, 6 Apr 2016 19:12:08 +0000 (12:12 -0700)]
Rollup merge of #32691 - frewsxcv:patch-28, r=alexcrichton

Indicate `None` is code-like in doc comment.

8 years agoRollup merge of #32679 - tclfs:patch-1, r=steveklabnik
Steve Klabnik [Wed, 6 Apr 2016 19:12:08 +0000 (12:12 -0700)]
Rollup merge of #32679 - tclfs:patch-1, r=steveklabnik

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.

8 years agoRollup merge of #32668 - frewsxcv:hashmap-address-fixme, r=alexcrichton
Steve Klabnik [Wed, 6 Apr 2016 19:12:08 +0000 (12:12 -0700)]
Rollup merge of #32668 - frewsxcv:hashmap-address-fixme, r=alexcrichton

Address FIXMEs related to short lifetimes in `HashMap`.

None

8 years agoRollup merge of #32634 - varunvats:docs-fix, r=steveklabnik
Steve Klabnik [Wed, 6 Apr 2016 19:12:07 +0000 (12:12 -0700)]
Rollup merge of #32634 - varunvats:docs-fix, r=steveklabnik

Minor doc fixes in "Crates and Modules" and "Lifetimes" chapters

These commits fix a couple of (minor) issues in the _Crates and Modules_ and the _Lifetimes_ chapters of the book.

r? @steveklabnik

8 years agoRollup merge of #32538 - Manishearth:no-data-race, r=steveklabnik
Steve Klabnik [Wed, 6 Apr 2016 19:12:07 +0000 (12:12 -0700)]
Rollup merge of #32538 - Manishearth:no-data-race, r=steveklabnik

Mention that it's not actually a data race

The example can't cause a data race since different indices are accesed.

(perhaps we should use an example where i iterates twice?)

r? @steveklabnik

8 years agoRollup merge of #31762 - tshepang:in-which-case, r=steveklabnik
Steve Klabnik [Wed, 6 Apr 2016 19:12:07 +0000 (12:12 -0700)]
Rollup merge of #31762 - tshepang:in-which-case, r=steveklabnik

doc: there is no case that is shown, so something was likely missing …

…from the change

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 agochange constant patterns to have a warning cycle
Niko Matsakis [Wed, 6 Apr 2016 09:37:08 +0000 (05:37 -0400)]
change constant patterns to have a warning cycle

This was the original intention :(

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 agoavoid "==" in assert! when one of the values is a bool
Tshepang Lekhonkhobe [Wed, 6 Apr 2016 04:24:19 +0000 (06:24 +0200)]
avoid "==" in assert! when one of the values is a bool

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 agoDoc fix: list all module files Rust looks for.
Varun Vats [Thu, 31 Mar 2016 02:11:06 +0000 (21:11 -0500)]
Doc fix: list all module files Rust looks for.

1. In the English/Japanese phrases example in the "Multiple File
Crates" section of the "Crates and Modules" chapter, there are a total
of 8 module files that Rust looks for, while only four were
listed. This commit lists all 8 explicitly.
2. Title case fix.

8 years agoDoc fix: function takes argument by reference.
Varun Vats [Thu, 31 Mar 2016 02:05:12 +0000 (21:05 -0500)]
Doc fix: function takes argument by reference.

8 years agodoc: make env::consts summaries less confusing
Tshepang Lekhonkhobe [Tue, 5 Apr 2016 15:55:14 +0000 (17:55 +0200)]
doc: make env::consts summaries less confusing

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 agoAdd example doc for ToOwned trait
Guillaume Gomez [Tue, 5 Apr 2016 12:11:08 +0000 (14:11 +0200)]
Add example doc for ToOwned trait

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 agoMention that it's not actually a data race
Manish Goregaokar [Sun, 27 Mar 2016 21:55:23 +0000 (03:25 +0530)]
Mention that it's not actually a data race

Conflicts:
src/doc/book/concurrency.md

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 agominor: update old comments
Aleksey Kladov [Mon, 4 Apr 2016 14:24:57 +0000 (17:24 +0300)]
minor: update old comments

No more lifetimes in function types after
https://github.com/rust-lang/rust/commit/f945190e6352a1bc965a117569532643319b400f

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 agoRemove outdated comment
Seo Sanghyeon [Mon, 4 Apr 2016 11:32:42 +0000 (20:32 +0900)]
Remove outdated comment

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 agoIndicate `None` is code-like in doc comment.
Corey Farwell [Sun, 3 Apr 2016 00:20:52 +0000 (20:20 -0400)]
Indicate `None` is code-like in doc comment.

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 agoRemove error description of `move`
Tang Chenglong [Sat, 2 Apr 2016 13:03:59 +0000 (21:03 +0800)]
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.

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