Commit Graph

56004 Commits

Author SHA1 Message Date
Andrew Cann
06747c669f Add another test for ! 2016-08-13 21:37:09 +08:00
Andrew Cann
00a71ea644 Add tests for ! type 2016-08-13 21:37:09 +08:00
Andrew Cann
2eff282aef Add some tests for ! type 2016-08-13 21:37:09 +08:00
Andrew Cann
c6890e17a0 Revert Ty::is_uninhabited to its original state 2016-08-13 21:37:09 +08:00
Andrew Cann
a4e6009bf0 Minor fixups based on feedback 2016-08-13 21:37:09 +08:00
Andrew Cann
a05560bebe Add run-pass/never_coercions.rs test 2016-08-13 21:37:09 +08:00
Andrew Cann
f019a92b77 Correctly handle AdjustNeverToAny in try_find_coercion_lub 2016-08-13 21:37:09 +08:00
Andrew Cann
69e27614c6 Minor fixup. 2016-08-13 21:37:09 +08:00
Andrew Cann
a6d6fff068 Lookup node type in map rather than using write_ty_expr 2016-08-13 21:37:09 +08:00
Andrew Cann
3639341685 Default diverging types based on feature gate.
Default to either `!` or `()` depending on whether feature(never_type)
is on or not.
2016-08-13 21:37:09 +08:00
Andrew Cann
54c72d8f98 Minor fix 2016-08-13 21:37:09 +08:00
Andrew Cann
8010314190 Un-improve Ty::is_uninabited 2016-08-13 21:37:09 +08:00
Andrew Cann
fadabe08f5 Rename empty/bang to never
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13 21:37:09 +08:00
Andrew Cann
f0a8b6d43f Minor fixups based on @eddyb's feedback
Mainly, remove mk_empty() method and replace with tcx.types.empty
2016-08-13 21:37:09 +08:00
Andrew Cann
5096a8c5c0 Control usage of ! through a feature gate.
Adds the `bang_type` feature gate. `!` in a non-return-type position now
relies on that feature.
2016-08-13 21:37:09 +08:00
Andrew Cann
0e1c2aa52e Make AdjustEmptyToAny actually perform the adjustment 2016-08-13 21:37:09 +08:00
Andrew Cann
ba65d2e15b Remove invalid compile-fail tests related to !
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-13 21:37:09 +08:00
Andrew Cann
51c6ae25e2 implement std::cmp::* traits for ! 2016-08-13 21:37:09 +08:00
Andrew Cann
b22beed737 Fix build after rebase to lastest master 2016-08-13 21:37:09 +08:00
Andrew Cann
ed02344fbc Remove obsolete divergence related stuff
Replace FnOutput with Ty
Replace FnConverging(ty) with ty
Purge FnDiverging, FunctionRetTy::NoReturn and FunctionRetTy::None
2016-08-13 21:37:09 +08:00
Andrew Cann
ee78f37e2a impl Debug + Display for ! 2016-08-13 21:37:09 +08:00
Andrew Cann
082915290d Make unused lint ignore unused ! 2016-08-13 21:37:09 +08:00
Andrew Cann
f31d9757f8 Fix super_relate_tys so that ! == ! 2016-08-13 21:37:09 +08:00
Andrew Cann
104963c539 Switch on TyEmpty
Parse -> ! as FnConverging(!)
Add AdjustEmptyToAny coercion to all ! expressions
Some fixes
2016-08-13 21:37:09 +08:00
Andrew Cann
9f9f8567eb Fix rustdoc after rebase 2016-08-13 21:37:09 +08:00
Andrew Cann
533a389962 Small optimization
Optimiize ExprKind::EmptyToAny expressions applied to function calls.
2016-08-13 21:37:09 +08:00
Andrew Cann
798f719daf Add run-fail/adjust_empty.rs test 2016-08-13 21:37:09 +08:00
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