about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2016-08-13Add tests for ! typeAndrew Cann-0/+259
2016-08-13Add some tests for ! typeAndrew Cann-0/+60
2016-08-13Revert Ty::is_uninhabited to its original stateAndrew Cann-3/+3
2016-08-13Minor fixups based on feedbackAndrew Cann-2/+2
2016-08-13Add run-pass/never_coercions.rs testAndrew Cann-0/+19
2016-08-13Correctly handle AdjustNeverToAny in try_find_coercion_lubAndrew Cann-1/+7
2016-08-13Minor fixup.Andrew Cann-2/+1
2016-08-13Lookup node type in map rather than using write_ty_exprAndrew Cann-38/+37
2016-08-13Default diverging types based on feature gate.Andrew Cann-4/+12
Default to either `!` or `()` depending on whether feature(never_type) is on or not.
2016-08-13Minor fixAndrew Cann-2/+1
2016-08-13Un-improve Ty::is_uninabitedAndrew Cann-3/+7
2016-08-13Rename empty/bang to neverAndrew Cann-150/+161
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Minor fixups based on @eddyb's feedbackAndrew Cann-33/+30
Mainly, remove mk_empty() method and replace with tcx.types.empty
2016-08-13Control usage of `!` through a feature gate.Andrew Cann-3/+26
Adds the `bang_type` feature gate. `!` in a non-return-type position now relies on that feature.
2016-08-13Make AdjustEmptyToAny actually perform the adjustmentAndrew Cann-4/+4
2016-08-13Remove invalid compile-fail tests related to `!`Andrew Cann-178/+0
These tests check for the old error messages "`return` in a function declared as diverging" and "computation may converge in a function declared as diverging". The first of these is now invalid as `return` is permitted in functions that return `!`. The second of these is subsumed by the "mismatched types" error.
2016-08-13implement std::cmp::* traits for `!`Andrew Cann-0/+33
2016-08-13Fix build after rebase to lastest masterAndrew Cann-2/+2
2016-08-13Remove obsolete divergence related stuffAndrew Cann-587/+250
Replace FnOutput with Ty Replace FnConverging(ty) with ty Purge FnDiverging, FunctionRetTy::NoReturn and FunctionRetTy::None
2016-08-13impl Debug + Display for !Andrew Cann-0/+23
2016-08-13Make unused lint ignore unused `!`Andrew Cann-0/+1
2016-08-13Fix super_relate_tys so that ! == !Andrew Cann-0/+1
2016-08-13Switch on TyEmptyAndrew Cann-54/+88
Parse -> ! as FnConverging(!) Add AdjustEmptyToAny coercion to all ! expressions Some fixes
2016-08-13Fix rustdoc after rebaseAndrew Cann-0/+2
2016-08-13Small optimizationAndrew Cann-4/+16
Optimiize ExprKind::EmptyToAny expressions applied to function calls.
2016-08-13Add run-fail/adjust_empty.rs testAndrew Cann-0/+18
2016-08-13Invoke coercions on !Andrew Cann-1/+6
2016-08-13Add EmptyToAny adjustmentAndrew Cann-7/+69
2016-08-13Parse `!` as TyEmpty (except in fn return type)Andrew Cann-0/+2
2016-08-13Start implementation of RFC 1216 (make ! a type)Andrew Cann-17/+69
Add `TyKind::Empty` and fix resulting build errors.
2016-08-13Auto merge of #35348 - scottcarr:discriminant2, r=nikomatsakisbors-18/+156
[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-12Auto merge of #35138 - petrochenkov:clarify, r=eddybbors-218/+330
Implement RFC 1506 "Clarify the relationships between various kinds of structs and variants" cc https://github.com/rust-lang/rust/issues/35626
2016-08-13Parse numeric fields in struct expressions and patternsVadim Petrochenkov-2/+54
2016-08-13Remove restrictions from tuple structs/variantsVadim Petrochenkov-224/+284
Hard errors are turned into feature gates
2016-08-12Auto merge of #35431 - GuillaumeGomez:err_codes, r=jonathandturnerbors-263/+512
Err codes r? @jonathandturner
2016-08-12Auto merge of #35091 - eddyb:impl-trait, r=nikomatsakisbors-532/+2788
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-11Auto merge of #34811 - DanielJCampbell:Expander, r=jseyfriedbors-46/+82
Extended expand.rs to support alternate expansion behaviours (eg. stepwise expansion) r? nrc
2016-08-12test: add more extensive tests for impl Trait.Eduard Burtescu-0/+291
2016-08-12typeck: leak auto trait obligations through impl Trait.Eduard Burtescu-163/+613
2016-08-12typeck: record `impl Trait` concrete resolutions.Eduard Burtescu-96/+1224
2016-08-12typeck: disallow `impl Trait` outside of return types of functions and impl ↵Eduard Burtescu-43/+174
methods.
2016-08-12rustc: add TyAnon (impl Trait) to the typesystem.Eduard Burtescu-85/+250
2016-08-12syntax: add anonymized type syntax, i.e. impl TraitA+TraitB.Eduard Burtescu-4/+68
2016-08-12rustc: don't reveal specializable polymorphic projections.Eduard Burtescu-35/+48
2016-08-12rustc: always normalize projections in ty::layout regardless where they appear.Eduard Burtescu-25/+65
2016-08-12rustc: rename ProjectionMode and its variant to be more memorable.Eduard Burtescu-109/+83
2016-08-11Auto merge of #35592 - jonathandturner:rollup, r=jonathandturnerbors-376/+542
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-11add SetDiscriminant StatementKind to enable deaggregation of enumsScott A Carr-18/+156
2016-08-11Fix tidy warningJonathan Turner-1/+2
2016-08-11Auto merge of #34193 - petrochenkov:privalias, r=nikomatsakisbors-18/+127
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