Commit Graph

52152 Commits

Author SHA1 Message Date
Manish Goregaokar
02acff64a4 Rollup merge of #32732 - dotdash:ext_arg, r=eddyb
Handle integer-extending for C ABI

We need to supply sext/zext attributes to LLVM to ensure that arguments
are extended to the appropriate width in the correct way.

Most platforms extend integers less than 32 bits, though not all.
2016-04-07 23:26:18 +05:30
Manish Goregaokar
6e360e521f Rollup merge of #32731 - alexcrichton:known-bootstrap-key, r=brson
mk: Hardcode the bootstrap key for each release

Starting with the 1.10.0 release we would like to bootstrap all compilers from
the previous stable release. For example the 1.10.0 compiler should bootstrap
from the literal 1.9.0 release artifacts. To do this, however, we need a way to
enable unstable features temporarily in a stable compiler (as the released
compiler is stable), but it turns out we already have a way to do that!

At compile time the configure script selects a `CFG_BOOTSTRAP_KEY` variable
value and then exports it into the makefiles. If the `RUSTC_BOOTSTRAP_KEY`
environment variable is set to this value, then the compiler is allowed to
"cheat" and use unstable features.

This method of choosing the bootstrap key, however, is problematic for the
intention of bootstrapping from the previous release. Each time a 1.9.0 compiler
is created, a new bootstrap key will be selected. That means that the 1.10.0
compiler will only compile from *our* literal release artifacts. Instead
distributions would like to bootstrap from their own compilers, so instead we
simply hardcode the bootstrap key for each release.

This patch uses the same `CFG_FILENAME_EXTRA` value (a hash of the release
string) as the bootstrap key. Consequently all 1.9.0 compilers, no matter where
they are compiled, will have the same bootstrap key. Additionally we won't need
to keep updating this as it'll be based on the release number anyway.

Once the 1.9.0 beta has been created, we can update the 1.10.0 nightly sources
(the `master` branch at that time) to bootstrap from that release using this
hard-coded bootstrap key. We will likely just hardcode into the makefiles what
the previous bootstrap key was and we'll change that whenever the stage0
compiler is updated.
2016-04-07 23:26:18 +05:30
Manish Goregaokar
ef8635ec82 Rollup merge of #32729 - pierzchalski:build_helper_suffix, r=alexcrichton
Change build helper to modify suffix

The current implementation of [gcc](https://crates.io/crates/gcc) defaults to using the ```CC``` environment variable to determine the compiler. The current global-find-replace in ```build_helper``` causes issues for projects using tools like ```ccache``` if they try to integrate libstd into their build system.

Almost all cross-compiler toolchains have the tool name as a suffix of the filename, so changing this to suffix-replacement instead of global-replacement should be fine.
2016-04-07 23:26:17 +05:30
Manish Goregaokar
2baa1503c9 Rollup merge of #32687 - mneumann:dragonfly_fix_libstd, r=alexcrichton
Fix libstd on DragonFly

Following changes:

* birthtime does not exist on DragonFly
* errno: __dfly_error is no more. Use #[thread_local] static errno.
* clock_gettime expects a c_ulong

These changes are required to build DragonFly snapshots again.
2016-04-07 23:26:17 +05:30
bors
470ca1c3ff Auto merge of #32794 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests

- Successful merges: #32674, #32699, #32711, #32745, #32748, #32757, #32789
- Failed merges:
2016-04-07 07:54:39 -07:00
Manish Goregaokar
b0f81a3595 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
2016-04-07 20:22:43 +05:30
Manish Goregaokar
2a88ca4405 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.
2016-04-07 20:22:43 +05:30
Manish Goregaokar
c0ea2adbe6 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
2016-04-07 20:22:42 +05:30
Manish Goregaokar
ffd1450c27 Rollup merge of #32745 - Amanieu:arc_fix, r=alexcrichton
Fix infinite loop in Arc::downgrade
2016-04-07 20:22:42 +05:30
Manish Goregaokar
684e2aace5 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).
2016-04-07 20:22:41 +05:30
Manish Goregaokar
76e2349c44 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
2016-04-07 20:22:41 +05:30
bors
444a118a89 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
2016-04-07 03:07:24 -07:00
Michael Neumann
60c988ec17 Fix libstd on DragonFly
Following changes:

* birthtime does not exist on DragonFly
* errno: __dfly_error is no more. Use #[thread_local] static errno.
* clock_gettime expects a c_ulong (use a type alias)

These changes are required to build DragonFly snapshots again.
2016-04-07 11:39:27 +02:00
Ariel Ben-Yehuda
0ac5e48069 test the substs ppaux code both with and without -Z verbose 2016-04-07 12:17:24 +03:00
bors
455fa01abc 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
2016-04-07 00:08:14 -07:00
Jeffrey Seyfried
07dac9732d Fix tidy errors 2016-04-07 05:48:46 +00:00
Jeffrey Seyfried
35f5e18f75 Fix fallout in tests 2016-04-07 05:48:42 +00:00
Jeffrey Seyfried
dcd4621b4d Add test for #30079 2016-04-07 04:33:17 +00:00
Jeffrey Seyfried
35204025be Improve PrivateItemsInPublicInterfacesVisitor 2016-04-07 04:33:14 +00:00
Jeffrey Seyfried
0d34c5dd8a Use the node id from the Restricted variant when checking accessibility
in `typeck` and in `privacy::PrivacyVisitor`.
2016-04-07 04:33:06 +00:00
Jeffrey Seyfried
bb66d91c98 Make hir::Visibility non-copyable and add ty::Visibility 2016-04-07 04:31:45 +00:00
Jeffrey Seyfried
ffbbf24186 Refactor away hir::Visibility::inherit_from 2016-04-07 04:23:32 +00:00
Jeffrey Seyfried
20ee53c2f1 Improve path resolution diagnostics 2016-04-07 03:55:20 +00:00
bors
a9f34c86a4 Auto merge of #32230 - GuillaumeGomez:extend_css, r=alexcrichton
Add --extend-css option to rustdoc

Fixes #32223

r? @brson
2016-04-06 17:11:44 -07:00
bors
bf5da36f1d 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:
2016-04-06 13:44:51 -07:00
Steve Klabnik
862ae9aa75 Rollup merge of #32774 - tbu-:pr_doc_tuple_copy, r=brson
Add `Copy` to the traits that are automatically implemented for tuples
2016-04-06 12:12:09 -07:00
Steve Klabnik
76a58954e0 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
2016-04-06 12:12:09 -07:00
Steve Klabnik
3531a1a0da 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
2016-04-06 12:12:09 -07:00
Steve Klabnik
510b380317 Rollup merge of #32744 - GuillaumeGomez:patch-3, r=steveklabnik
Add example doc for ToOwned trait

Fixes #29342.

r? @steveklabnik
2016-04-06 12:12:09 -07:00
Steve Klabnik
ea28533e25 Rollup merge of #32727 - matklad:fix-comment, r=alexcrichton
minor: update old comments

No more lifetimes in function types after f945190e63
2016-04-06 12:12:08 -07:00
Steve Klabnik
028c067a7b 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.
2016-04-06 12:12:08 -07:00
Steve Klabnik
f7154b39ee Rollup merge of #32691 - frewsxcv:patch-28, r=alexcrichton
Indicate `None` is code-like in doc comment.
2016-04-06 12:12:08 -07:00
Steve Klabnik
fce5901507 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.
2016-04-06 12:12:08 -07:00
Steve Klabnik
9ce61702b3 Rollup merge of #32668 - frewsxcv:hashmap-address-fixme, r=alexcrichton
Address FIXMEs related to short lifetimes in `HashMap`.

None
2016-04-06 12:12:08 -07:00
Steve Klabnik
be862ca5b8 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
2016-04-06 12:12:07 -07:00
Steve Klabnik
2bbdbd267a 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
2016-04-06 12:12:07 -07:00
Steve Klabnik
c411897e38 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
2016-04-06 12:12:07 -07:00
Tobias Bucher
3e9b859af2 Add Copy to the traits that are automatically implemented for tuples 2016-04-06 20:10:33 +02:00
Amanieu d'Antras
4d71712a4e Fix LLVM assert when handling bad intrinsic monomorphizations 2016-04-06 18:49:10 +01:00
bors
943ec3bdfc 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
2016-04-06 05:04:15 -07:00
Manish Goregaokar
552af51ffb 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
2016-04-06 17:31:16 +05:30
Manish Goregaokar
af7b00b68f 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
2016-04-06 17:15:31 +05:30
Eduard Burtescu
e8a8dfb056 rustc: retire hir::map's paths. 2016-04-06 13:51:55 +03:00
Guillaume Gomez
669edfaef4 Update to last rustdoc version 2016-04-06 12:40:23 +02:00
Ulrik Sverdrup
a6c27be0b1 slice: Use doc(hidden) on private traits
This should avoid the trait impls showing up in rustdoc.
2016-04-06 12:19:19 +02:00
Niko Matsakis
b27b3e1278 change constant patterns to have a warning cycle
This was the original intention :(
2016-04-06 05:37:08 -04:00
Vadim Petrochenkov
8fe4290f1c Move span into StructField 2016-04-06 11:19:10 +03:00
Vadim Petrochenkov
7f3744f07f Get rid of ast::StructFieldKind 2016-04-06 10:33:15 +03:00
Eduard Burtescu
20f0f3c1f1 rustc: move some maps from ty to hir. 2016-04-06 09:14:21 +03:00
Eduard Burtescu
ffca6c3e15 rustc: move middle::{def,def_id,pat_util} to hir. 2016-04-06 09:14:21 +03:00