Commit Graph

55863 Commits

Author SHA1 Message Date
José manuel Barroso Galindo
85388f0958 E0094 error message updated
Part of #35233
Fixes #35231
2016-08-13 16:32:43 +07:00
bors
e64f68817d Auto merge of #35348 - scottcarr:discriminant2, r=nikomatsakis
[MIR] Add explicit SetDiscriminant StatementKind for deaggregating enums

cc #35186

To deaggregate enums, we need to be able to explicitly set the discriminant.  This PR implements a new StatementKind that does that.

I think some of the places that have `panics!` now could maybe do something smarter.
2016-08-13 01:20:46 -07:00
Clement Miao
bd90a16151 updated E0067 to new error format 2016-08-13 00:03:04 -07:00
Ahmed Charles
08e470f9e1 compiletest: Remove dead code. 2016-08-12 23:52:35 -07:00
Ahmed Charles
d56a5b9af7 Upgrade linkchecker to url 1.2.0. 2016-08-12 23:16:29 -07:00
Jorge Aparicio
db16909ae3 exclude #![no_builtins] crates from LTO
this prevents intrinsics like `memcpy` from being mis-optimized to
infinite recursive calls when LTO is used.

fixes #31544
closes #35540
2016-08-12 21:39:21 -05:00
bors
d3c3de8abe Auto merge of #35138 - petrochenkov:clarify, r=eddyb
Implement RFC 1506 "Clarify the relationships between various kinds of structs and variants"

cc https://github.com/rust-lang/rust/issues/35626
2016-08-12 19:38:46 -07:00
Krzysztof Garczynski
5402d28fe7 Update E0302 to the new format 2016-08-13 02:33:52 +02:00
Krzysztof Garczynski
302a423047 Update E0301 to the new format 2016-08-13 01:33:42 +02:00
Vadim Petrochenkov
f6624782d4 Parse numeric fields in struct expressions and patterns 2016-08-13 00:08:14 +03:00
Vadim Petrochenkov
59be332a1b Remove restrictions from tuple structs/variants
Hard errors are turned into feature gates
2016-08-13 00:08:14 +03:00
Clement Miao
4ab00e4397 updated E0070 to new error format 2016-08-12 10:15:54 -07:00
Diggory Blake
7341d68a40 Produce source package in rust-installer format in addition to vanilla tarball
Copy source files from rust code

Add missing wildcard

Remove unused function

Remove use of tar --transform
2016-08-12 18:13:18 +01:00
Matthew Piziak
bfca761c8c fix small typos in std::convert documentation
Fix subject-verb agreement in copypasta: "`AsRef` dereference" to
"`AsRef` dereferences".

Formalize "eg" to "e.g." Italicization of common Latin abbreviations
seems to be going out of style in written English, so I left it plain.
2016-08-12 12:20:56 -04:00
Michael Woerister
09e73a5b03 Make the translation item collector handle *uses* of 'const' items instead of declarations. 2016-08-12 12:07:51 -04:00
bors
1deb02ea69 Auto merge of #35431 - GuillaumeGomez:err_codes, r=jonathandturner
Err codes

r? @jonathandturner
2016-08-12 08:58:55 -07:00
Christophe Vu-Brugier
3042fba44c book: fix the hidden find() functions in error-handling.md
The hidden find() functions always returns None. Consequently, one of the
examples using find() prints "No file extension found" instead of
"File extension: rs" which is the expected output.

This patch fixes the issue by implementing find() with std::str::find().

Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
2016-08-12 14:49:16 +02:00
Seo Sanghyeon
f76a737bae Correct span for pub_restricted field 2016-08-12 21:08:02 +09:00
bors
f55ac6944a Auto merge of #35091 - eddyb:impl-trait, r=nikomatsakis
Implement `impl Trait` in return type position by anonymization.

This is the first step towards implementing `impl Trait` (cc #34511).
`impl Trait` types are only allowed in function and inherent method return types, and capture all named lifetime and type parameters, being invariant over them.
No lifetimes that are not explicitly named lifetime parameters are allowed to escape from the function body.
The exposed traits are only those listed explicitly, i.e. `Foo` and `Clone` in `impl Foo + Clone`, with the exception of "auto traits" (like `Send` or `Sync`) which "leak" the actual contents.

The implementation strategy is anonymization, i.e.:
```rust
fn foo<T>(xs: Vec<T>) -> impl Iterator<Item=impl FnOnce() -> T> {
    xs.into_iter().map(|x| || x)
}

// is represented as:
type A</*invariant over*/ T> where A<T>: Iterator<Item=B<T>>;
type B</*invariant over*/ T> where B<T>: FnOnce() -> T;
fn foo<T>(xs: Vec<T>) -> A<T> {
    xs.into_iter().map(|x| || x): $0 where $0: Iterator<Item=$1>, $1: FnOnce() -> T
}
```
`$0` and `$1` are resolved (to `iter::Map<vec::Iter<T>, closure>` and the closure, respectively) and assigned to `A` and `B`, after checking the body of `foo`. `A` and `B` are *never* resolved for user-facing type equality (typeck), but always for the low-level representation and specialization (trans).

The "auto traits" exception is implemented by collecting bounds like `impl Trait: Send` that have failed for the obscure `impl Trait` type (i.e. `A` or `B` above), pretending they succeeded within the function and trying them again after type-checking the whole crate, by replacing `impl Trait` with the real type.

While passing around values which have explicit lifetime parameters (of the function with `-> impl Trait`) in their type *should* work, regionck appears to assign inference variables in *way* too many cases, and never properly resolving them to either explicit lifetime parameters, or `'static`.
We might not be able to handle lifetime parameters in `impl Trait` without changes to lifetime inference, but type parameters can have arbitrary lifetimes in them from the caller, so most type-generic usecases (or not generic at all) should not run into this problem.

cc @rust-lang/lang
2016-08-12 01:26:12 -07:00
Jeffrey Seyfried
95b68aa5ea Fix fallout in tests. 2016-08-12 07:21:34 +00:00
bors
68d9284a9b Auto merge of #34811 - DanielJCampbell:Expander, r=jseyfried
Extended expand.rs to support alternate expansion behaviours (eg. stepwise expansion)

r? nrc
2016-08-11 22:10:16 -07:00
Jonathan Turner
42247372c6 Improve &-ptr printing 2016-08-11 21:47:56 -07:00
Eduard Burtescu
23f0494114 test: add more extensive tests for impl Trait. 2016-08-12 06:46:31 +03:00
Eduard Burtescu
08bf9f69b9 typeck: leak auto trait obligations through impl Trait. 2016-08-12 06:46:31 +03:00
Eduard Burtescu
d92e594c38 typeck: record impl Trait concrete resolutions. 2016-08-12 06:43:34 +03:00
Eduard Burtescu
1ef7ddfda3 typeck: disallow impl Trait outside of return types of functions and impl methods. 2016-08-12 06:43:34 +03:00
Eduard Burtescu
ef11d4e3c7 rustc: add TyAnon (impl Trait) to the typesystem. 2016-08-12 06:43:34 +03:00
Eduard Burtescu
f0baec691f syntax: add anonymized type syntax, i.e. impl TraitA+TraitB. 2016-08-12 06:43:34 +03:00
Eduard Burtescu
c976e073fd rustc: don't reveal specializable polymorphic projections. 2016-08-12 06:43:34 +03:00
Eduard Burtescu
ab26dbb96f rustc: always normalize projections in ty::layout regardless where they appear. 2016-08-12 06:43:34 +03:00
Eduard Burtescu
d1d16c94c5 rustc: rename ProjectionMode and its variant to be more memorable. 2016-08-12 06:43:34 +03:00
Patrick McCann
629f2aafcf Fix typo
Didn't see this one at first.
2016-08-11 19:04:11 -04:00
Mark-Simulacrum
fc97b5cc6f Change stabilization version of no_std from 1.0 to 1.6. 2016-08-11 15:46:10 -06:00
Corey Farwell
01a766e521 Introduce as_mut_slice method on std::vec::IntoIter struct. 2016-08-11 16:49:01 -04:00
Corey Farwell
d099e30e48 Introduce as_slice method on std::vec::IntoIter struct.
Similar to the `as_slice` method on `core::slice::Iter` struct.
2016-08-11 16:48:43 -04:00
Vadim Petrochenkov
b052dd6240 Add test for #28514
Fixes #28514
2016-08-11 23:19:04 +03:00
Vadim Petrochenkov
737961b6c6 Make private_in_public compatibility lint deny-by-default 2016-08-11 23:19:04 +03:00
bors
8787a12334 Auto merge of #35592 - jonathandturner:rollup, r=jonathandturner
Rollup of 23 pull requests

- Successful merges: #35279, #35331, #35358, #35375, #35445, #35448, #35482, #35486, #35505, #35528, #35530, #35532, #35536, #35537, #35541, #35552, #35554, #35555, #35557, #35562, #35565, #35569, #35576
- Failed merges: #35395, #35415, #35563
2016-08-11 13:14:28 -07:00
crypto-universe
c761184d1d Fix tidy tests 2016-08-11 21:08:36 +02:00
Scott A Carr
d77a136437 add SetDiscriminant StatementKind to enable deaggregation of enums 2016-08-11 11:51:20 -07:00
Tshepang Lekhonkhobe
071410ba57 string: remove needless binding 2016-08-11 20:44:49 +02:00
Tshepang Lekhonkhobe
c99c2ea838 doc: a value of type &str is called a "string slice" 2016-08-11 20:41:31 +02:00
Alex Crichton
045c8c8624 std: Optimize panic::catch_unwind slightly
The previous implementation of this function was overly conservative with
liberal usage of `Option` and `.unwrap()` which in theory never triggers. This
commit essentially removes the `Option`s in favor of unsafe implementations,
improving the code generation of the fast path for LLVM to see through what's
happening more clearly.

cc #34727
2016-08-11 11:19:30 -07:00
crypto-universe
4209f948b1 Add label to E0254
This issue #35513 is a part of #35233.
r? @jonathandturner
2016-08-11 20:15:10 +02:00
Jonathan Turner
d3af9a38ed Fix tidy warning 2016-08-11 10:17:12 -07:00
bors
11f8805887 Auto merge of #34193 - petrochenkov:privalias, r=nikomatsakis
privacy: Substitute type aliases in private-in-public checker

Closes https://github.com/rust-lang/rust/issues/30503
Closes https://github.com/rust-lang/rust/issues/34293

Everyone in the issue discussion seemed to be in favor, @huonw also spoke about this [here](https://www.reddit.com/r/rust/comments/3xldr9/surfaces_and_signatures_component_privacy_versus/cy615wq), but the issue haven't got any movement.
I think it's reasonable to do this before turning `private_in_public` warnings into errors.

r? @nikomatsakis
2016-08-11 10:09:10 -07:00
Jake Goulding
b707a12a6b Allow compiling against a custom LLVM 3.9 installation 2016-08-11 12:55:53 -04:00
Jorge Aparicio
c0ff3c1070 fix match 2016-08-11 11:22:39 -05:00
Michael Woerister
67f19e5e28 Always add -Z incremental-info to incremental compilation tests. 2016-08-11 10:59:35 -04:00
Michael Woerister
3a70aa530f Fix incremental/commandline-args test. 2016-08-11 10:59:05 -04:00