Commit Graph

55977 Commits

Author SHA1 Message Date
Andrew Cann
c88c54ec5a Invoke coercions on ! 2016-08-13 21:37:09 +08:00
Andrew Cann
0d863616e0 Add EmptyToAny adjustment 2016-08-13 21:37:09 +08:00
Andrew Cann
b0a9acd783 Parse ! as TyEmpty (except in fn return type) 2016-08-13 21:37:09 +08:00
Andrew Cann
ba7330c1cc Start implementation of RFC 1216 (make ! a type)
Add `TyKind::Empty` and fix resulting build errors.
2016-08-13 21:37:09 +08:00
Ahmed Charles
ab00b940bb Predicates haven't existed in almost 5 years.
This test probably adds negative value other than historical amusement.
2016-08-13 02:45:53 -07:00
Ahmed Charles
6fbff4f06a Ensure that attributes are spelled properly. 2016-08-13 02:41:43 -07:00
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
Matthew Piziak
e173ead684 provide additional justification for array interface design
Explain why Rust does not implement traits for large arrays.

Explain why most methods are implemented on slices rather than arrays.
2016-08-12 12:12:54 -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
JessRudder
758aff7883 Update note to include recommendation to use .as_slice() 2016-08-12 10:39:40 -04:00
Corey Farwell
4e4d8baf7b Add doc example for std::ffi::CString::from_vec_unchecked. 2016-08-12 09:08:37 -04: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
Srinivas Reddy Thatiparthy
d652639524
run rustfmt on libsyntax_ext folder 2016-08-12 09:40:12 +05:30
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
JessRudder
91a2c25e2e Add note to docs for &str that example is to demo internals only 2016-08-11 18:47:47 -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