]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agorustdoc: Fix testing no_run code blocks
Alex Crichton [Thu, 7 Apr 2016 23:47:12 +0000 (16:47 -0700)]
rustdoc: Fix testing no_run code blocks

This was a regression introduced by #31250 where the compiler deferred returning
the results of compilation a little too late (after the `Stop` check was looked
at). This commit alters the stop point to first try to return an erroneous
`result` and only if it was successful return the sentinel `Err(0)`.

Closes #31576

8 years agoAuto merge of #32794 - Manishearth:rollup, r=Manishearth
bors [Thu, 7 Apr 2016 14:54:39 +0000 (07:54 -0700)]
Auto merge of #32794 - Manishearth:rollup, r=Manishearth

Rollup of 7 pull requests

- Successful merges: #32674, #32699, #32711, #32745, #32748, #32757, #32789
- Failed merges:

8 years agoRollup merge of #32789 - jseyfried:fix_duplicate_resolve_errors, r=eddyb
Manish Goregaokar [Thu, 7 Apr 2016 11:47:10 +0000 (17:17 +0530)]
Rollup merge of #32789 - jseyfried:fix_duplicate_resolve_errors, r=eddyb

resolve: Avoid emitting redundant path resolution errors

This PR avoids emitting redundant path resolution errors in `resolve` (fixes #32760).

r? @eddyb

8 years agoRollup merge of #32757 - taralx:patch-1, r=brson
Manish Goregaokar [Thu, 7 Apr 2016 11:47:10 +0000 (17:17 +0530)]
Rollup merge of #32757 - taralx:patch-1, r=brson

Fix typos in atomic compare_exchange.

Failure ordering can't be Release, not (not) Acquire. Seems like a typo copy-pasted all over.

8 years agoRollup merge of #32748 - aturon:simplified-spec, r=nikomatsakis
Manish Goregaokar [Thu, 7 Apr 2016 11:47:10 +0000 (17:17 +0530)]
Rollup merge of #32748 - aturon:simplified-spec, r=nikomatsakis

Reinstate fast_reject for overlap checking

The initial implementation of specialization did not use the
`fast_reject` mechanism when checking for overlap, which caused a
serious performance regression in some cases.

This commit modifies the specialization graph to use simplified types
for fast rejection when possible, and along the way refactors the logic
for building the specialization graph.

Closes #32499

r? @nikomatsakis

8 years agoRollup merge of #32745 - Amanieu:arc_fix, r=alexcrichton
Manish Goregaokar [Thu, 7 Apr 2016 11:47:10 +0000 (17:17 +0530)]
Rollup merge of #32745 - Amanieu:arc_fix, r=alexcrichton

Fix infinite loop in Arc::downgrade

8 years agoRollup merge of #32699 - bluss:slice-memcmp, r=alexcrichton
Manish Goregaokar [Thu, 7 Apr 2016 11:47:09 +0000 (17:17 +0530)]
Rollup merge of #32699 - bluss:slice-memcmp, r=alexcrichton

Specialize equality for [T] and comparison for [u8] to use memcmp when possible

Specialize equality for [T] and comparison for [u8] to use memcmp when possible

Where T is a type that can be compared for equality bytewise, we can use
memcmp. We can also use memcmp for PartialOrd, Ord for [u8].

Use specialization to call memcmp in PartialEq for slices for certain element types. This PR does not change the user visible API since the implementation uses an intermediate trait. See commit messages for more information.

The memcmp signature was changed from `*const i8` to `*const u8` which is in line with how the memcmp function is defined in C (taking const void * arguments, interpreting the values as unsigned bytes for purposes of the comparison).

8 years agoRollup merge of #32674 - jseyfried:1422_groundwork, r=nikomatsakis
Manish Goregaokar [Thu, 7 Apr 2016 11:47:09 +0000 (17:17 +0530)]
Rollup merge of #32674 - jseyfried:1422_groundwork, r=nikomatsakis

Lay groundwork for RFC 1422  and improve `PrivateItemsInPublicInterfacesVisitor`

This PR lays groundwork for RFC 1422 (cc #32409) and improves `PrivateItemsInPublicInterfacesVisitor`. More specifically, it
 - Refactors away `hir::Visibility::inherit_from`, the semantics of which are obsolete.
 - Makes `hir::Visibility` non-`Copy` so that we will be able to add new variants to represent `pub(restricted)` (for example, `Visibility::Restricted(Path)`).
 - Adds a new `Copy` type `ty::Visibility` that represents a visibility value, i.e. a characterization of where an item is accessible. This is able to represent `pub(restricted)` visibilities.
 - Improves `PrivateItemsInPublicInterfacesVisitor` so that it checks for items in an interface that are less visible than the interface. This fixes #30079 but doesn't change any other behavior.

r? @nikomatsakis

8 years agoAuto merge of #32583 - arielb1:need-a-bound, r=nikomatsakis
bors [Thu, 7 Apr 2016 10:07:24 +0000 (03:07 -0700)]
Auto merge of #32583 - arielb1:need-a-bound, r=nikomatsakis

Suggest adding a where-clause when that can help

Suggest adding a where-clause when there is an unmet trait-bound that can be satisfied if some type can implement it.

r? @nikomatsakis

8 years agotest the substs ppaux code both with and without -Z verbose
Ariel Ben-Yehuda [Wed, 6 Apr 2016 19:00:00 +0000 (22:00 +0300)]
test the substs ppaux code both with and without -Z verbose

8 years agoAuto merge of #32649 - Amanieu:intrinsic_monomorphization_assert, r=eddyb
bors [Thu, 7 Apr 2016 07:08:14 +0000 (00:08 -0700)]
Auto merge of #32649 - Amanieu:intrinsic_monomorphization_assert, r=eddyb

Fix LLVM assert when handling bad intrinsic monomorphizations

Passing an invalid type to certain intrinsics would trigger an LLVM assert even though the invalid type was caught by the compiler.

r? @eddyb

8 years agoFix tidy errors
Jeffrey Seyfried [Thu, 7 Apr 2016 04:13:34 +0000 (04:13 +0000)]
Fix tidy errors

8 years agoFix fallout in tests
Jeffrey Seyfried [Thu, 7 Apr 2016 03:48:52 +0000 (03:48 +0000)]
Fix fallout in tests

8 years agoAdd test for #30079
Jeffrey Seyfried [Sat, 2 Apr 2016 02:22:41 +0000 (02:22 +0000)]
Add test for #30079

8 years agoImprove `PrivateItemsInPublicInterfacesVisitor`
Jeffrey Seyfried [Fri, 1 Apr 2016 20:16:31 +0000 (20:16 +0000)]
Improve `PrivateItemsInPublicInterfacesVisitor`

8 years agoUse the node id from the `Restricted` variant when checking accessibility
Jeffrey Seyfried [Thu, 31 Mar 2016 07:03:00 +0000 (07:03 +0000)]
Use the node id from the `Restricted` variant when checking accessibility
in `typeck` and in `privacy::PrivacyVisitor`.

8 years agoMake `hir::Visibility` non-copyable and add `ty::Visibility`
Jeffrey Seyfried [Fri, 25 Mar 2016 06:08:11 +0000 (06:08 +0000)]
Make `hir::Visibility` non-copyable and add `ty::Visibility`

8 years agoRefactor away `hir::Visibility::inherit_from`
Jeffrey Seyfried [Sat, 26 Mar 2016 00:35:59 +0000 (00:35 +0000)]
Refactor away `hir::Visibility::inherit_from`

8 years agoImprove path resolution diagnostics
Jeffrey Seyfried [Thu, 7 Apr 2016 00:42:29 +0000 (00:42 +0000)]
Improve path resolution diagnostics

8 years agoAuto merge of #32230 - GuillaumeGomez:extend_css, r=alexcrichton
bors [Thu, 7 Apr 2016 00:11:44 +0000 (17:11 -0700)]
Auto merge of #32230 - GuillaumeGomez:extend_css, r=alexcrichton

Add --extend-css option to rustdoc

Fixes #32223

r? @brson

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 agoFix LLVM assert when handling bad intrinsic monomorphizations
Amanieu d'Antras [Thu, 31 Mar 2016 14:53:12 +0000 (15:53 +0100)]
Fix LLVM assert when handling bad intrinsic monomorphizations

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 agoUpdate to last rustdoc version
Guillaume Gomez [Tue, 5 Apr 2016 03:12:25 +0000 (05:12 +0200)]
Update to last rustdoc version

8 years agoslice: Use doc(hidden) on private traits
Ulrik Sverdrup [Wed, 6 Apr 2016 10:19:19 +0000 (12:19 +0200)]
slice: Use doc(hidden) on private traits

This should avoid the trait impls showing up in rustdoc.

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 agoFix typos in atomic compare_exchange.
JP Sugarbroad [Wed, 6 Apr 2016 00:06:10 +0000 (17:06 -0700)]
Fix typos in atomic compare_exchange.

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 agoclean the note-reporting code in report_selection_error
Ariel Ben-Yehuda [Tue, 5 Apr 2016 20:19:29 +0000 (23:19 +0300)]
clean the note-reporting code in report_selection_error

8 years agoimprove the printing of substs and trait-refs
Ariel Ben-Yehuda [Tue, 5 Apr 2016 19:56:23 +0000 (22:56 +0300)]
improve the printing of substs and trait-refs

8 years agoremove obsolete tests
Ariel Ben-Yehuda [Thu, 31 Mar 2016 18:42:36 +0000 (21:42 +0300)]
remove obsolete tests

the meaning of these tests had changed completely over the years and now they
are only a maintenance burden.

8 years agoimprove error message
Ariel Ben-Yehuda [Thu, 31 Mar 2016 18:42:23 +0000 (21:42 +0300)]
improve error message

8 years agosuggest adding a where-clause when that can help
Ariel Ben-Yehuda [Tue, 29 Mar 2016 17:12:31 +0000 (20:12 +0300)]
suggest adding a where-clause when that can help

suggest adding a where-clause when there is an unmet trait-bound that
can be satisfied if some type can implement it.

8 years agoremove workaround that prints error messages with TyErr
Ariel Ben-Yehuda [Tue, 29 Mar 2016 16:10:39 +0000 (19:10 +0300)]
remove workaround that prints error messages with TyErr

now that normalize_to_error no longer creates these, it is unnecessary.

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 agoReinstate fast_reject for overlap checking
Aaron Turon [Tue, 5 Apr 2016 15:38:48 +0000 (08:38 -0700)]
Reinstate fast_reject for overlap checking

The initial implementation of specialization did not use the
`fast_reject` mechanism when checking for overlap, which caused a
serious performance regression in some cases.

This commit modifies the specialization graph to use simplified types
for fast rejection when possible, and along the way refactors the logic
for building the specialization graph.

Closes #32499

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 agoFix infinite loop in Arc::downgrade
Amanieu d'Antras [Tue, 5 Apr 2016 13:00:17 +0000 (14:00 +0100)]
Fix infinite loop in Arc::downgrade

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 agoAdd test for [u8]'s Ord (and fix the old test for ord)
Ulrik Sverdrup [Tue, 5 Apr 2016 12:06:20 +0000 (14:06 +0200)]
Add test for [u8]'s Ord (and fix the old test for ord)

The old test for Ord used no asserts, and appeared to have a wrong test. (!).

8 years agoSpecialize equality for [T] and comparison for [u8]
Ulrik Sverdrup [Tue, 5 Apr 2016 12:06:20 +0000 (14:06 +0200)]
Specialize equality for [T] and comparison for [u8]

Where T is a type that can be compared for equality bytewise, we can use
memcmp. We can also use memcmp for PartialOrd, Ord for [u8] and by
extension &str.

This is an improvement for example for the comparison [u8] == [u8] that
used to emit a loop that compared the slices byte by byte.

One worry here could be that this introduces function calls to memcmp
in contexts where it should really inline the comparison or even
optimize it out, but llvm takes care of recognizing memcmp specifically.

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 agoCentralize nightly compiler flags handling
Guillaume Gomez [Tue, 15 Mar 2016 08:09:29 +0000 (09:09 +0100)]
Centralize nightly compiler flags handling

8 years agoAdd nightly check on rustdoc --extend-css option
Guillaume Gomez [Mon, 14 Mar 2016 01:52:58 +0000 (02:52 +0100)]
Add nightly check on rustdoc --extend-css option

8 years agoAdd --extend-css option to rustdoc
Guillaume Gomez [Sun, 13 Mar 2016 14:36:01 +0000 (15:36 +0100)]
Add --extend-css option to rustdoc

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`