about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2017-11-15add a UI test showing the current output from an impl trait typeNiko Matsakis-0/+32
2017-11-15add some more positive testsNiko Matsakis-0/+99
It'd be good to have a positive test for each case where it is allowed, I should think.
2017-11-15rename `equality-universal` to a more extensible naming schemeNiko Matsakis-0/+0
2017-11-15extend `where-allowed.rs` with many more casesNiko Matsakis-93/+179
also merge disallowed and disallowed-2 into that set
2017-11-15rename many-cases to where-allowedNiko Matsakis-0/+0
2017-11-15test we reject equivalent signatures with more than one argumentNiko Matsakis-0/+23
2017-11-15Add universal_impl_trait unstable-book entryChristopher Vittal-0/+32
2017-11-15Fix unclosed delimiter in sample errorChristopher Vittal-2/+2
2017-11-15Remove unamed parametersChristopher Vittal-4/+4
2017-11-15Fix style and grammarChristopher Vittal-1/+1
2017-11-15Add/Modify tests for argument position impl TraitChristopher Vittal-22/+160
2017-11-15Add universal_impl_trait feature gateChristopher Vittal-5/+32
Move feature gate check to inside HIR lowering. Change error messages and update tests.
2017-11-15Add new error comparision to hide desugaringChristopher Vittal-13/+68
First some background: To the compiler, the following two signatures in the trait vs the impl are the same. ```rust trait Foo { fn foo(&self, &impl Debug); } impl Foo for () { fn foo<U: Debug>(&self, x: &U) { ... } } ``` We do not want to allow this, and so we add a new error and check. The check just tests that all paramters 'syntheticness' match up. As during collection, the impl Trait parameters are transformed into anonymous synthetic generics. Furthermore, causes a check for unused type parameters to be skipped in check_bounds_are_used if there is already a TyError. Thus, an unused input will not trigger `type parameter unused` errors. Update the one test that checked for this error in the case of a TyError.
2017-11-15Add collection of impl Trait argument lifetimesChristopher Vittal-0/+11
2017-11-15Alter type collection to collect impl Trait boundsChristopher Vittal-24/+121
In ast_generics extraction in generics_of and explicit_predicates_of, also collect inputs if there are any. Then use a Visitor to extract the necessary information from the TyImplTraitUniversal types before extending generics and predicates with the new information.
2017-11-15Add bool item is_in_impl_trait to LoweringContextChristopher Vittal-1/+24
This is for tracking if an ImplItem is part of a trait impl. Add a with_trait_impl_ref method to ItemLowerer to appropriately save the state to allow appropriate nesting of trait and non-trait impls.
2017-11-15Split hir::TyImplTrait, move checks to HIR loweringChristopher Vittal-148/+211
Replace hir::TyImplTrait with TyImplTraitUniversal and TyImplTraitExistential. Add an ImplTraitContext enum to rustc::hir::lowering to track the kind and allowedness of an impl Trait. Significantly alter lowering to thread ImplTraitContext and one other boolean parameter described below throughought much of lowering. The other parameter is for tracking if lowering a function is in a trait impl, as there is not enough information to otherwise know this information during lowering otherwise. This change also removes the checks from ast_ty_to_ty for impl trait allowedness as they are now all taking place in HIR lowering.
2017-11-15Move E0562 to librustc from librustc_typeckChristopher Vittal-40/+40
With the check for impl trait moving from type checking to HIR lowering the error needs to move too.
2017-11-15Auto merge of #45936 - mikhail-m1:mir-borrowck-storage-dead, r=arielb1bors-28/+57
add `StorageDead` handling fix #45642 r? @arielb1
2017-11-15Auto merge of #45715 - oli-obk:clippy, r=kennytmbors-12/+34
Reenable clippy testing fixes #45680
2017-11-15Reenable clippy testingOliver Schneider-12/+34
2017-11-15fix testMikhail Modin-2/+1
2017-11-15fix comment, remove redundant codeMikhail Modin-19/+5
2017-11-15add `StorageDead` handlingMikhail Modin-15/+59
2017-11-15Auto merge of #45944 - eddyb:provide, r=nikomatsakisbors-81/+66
rustc_driver: expose a way to override query providers in CompileController. This API has been a long-time coming and will probably become the main method for custom drivers (that is, binaries other than `rustc` itself that use `librustc_driver`) to adapt the compiler's behavior.
2017-11-15Auto merge of #45922 - vramana:fix-45702, r=nikomatsakisbors-14/+44
Fix MIR borrowck EndRegion not found Fixes #45702 - [x] Add Tests
2017-11-15Auto merge of #45913 - sinkuu:mir-inlining-closure, r=arielb1bors-29/+113
Handle closures correctly in MIR inlining Fixes #45894.
2017-11-14Auto merge of #45821 - djzin:unreachable-match-arms, r=nikomatsakisbors-31/+103
always add an unreachable branch on matches to give more info to llvm As part of https://github.com/djzin/rustc-optimization I discovered that some simple enum optimizations (src/unary/three_valued_enum.rs and src/unary/four_valued_enum.rs in the repo) are not applied - and the reason for this is that we erase the info that the discriminant of an enum is one of the options by putting the last one in an "otherwise" branch. This patch adds an extra branch so that LLVM can know what the possibilities are for the discriminant, which fixes the three- and four- valued cases. Note that for whatever reason, this doesn't fix the case of 2 variants (most notably `Option` and `Result` have 2 variants) - a pass re-ordering might fix this or we may wish to add "assume" annotations on discriminants to force it to optimize.
2017-11-14Auto merge of #45981 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-239/+175
Rollup of 7 pull requests - Successful merges: #45815, #45941, #45950, #45961, #45967, #45970, #45977 - Failed merges:
2017-11-14Rollup merge of #45977 - kennytm:fix-pulldown-warnings, r=steveklabnikGuillaume Gomez-5/+5
Fixed several pulldown warnings when documenting libstd.
2017-11-14Rollup merge of #45970 - GuillaumeGomez:from-str-docs, r=QuietMisdreavusGuillaume Gomez-2/+5
Add missing links in FromStr docs r? @QuietMisdreavus
2017-11-14Rollup merge of #45967 - matthewjasper:array-move-types, r=arielb1Guillaume Gomez-12/+14
MIR-borrowck: don't ICE for cannot move from array error Closes #45694 compile-fail test E0508 now gives ```text error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array (Ast) --> .\src\test\compile-fail\E0508.rs:18:18 | 18 | let _value = array[0]; //[ast]~ ERROR E0508 | ^^^^^^^^ | | | cannot move out of here | help: consider using a reference instead: `&array[0]` error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array (Mir) --> .\src\test\compile-fail\E0508.rs:18:18 | 18 | let _value = array[0]; //[ast]~ ERROR E0508 | ^^^^^^^^ cannot move out of here error: aborting due to 2 previous errors ```
2017-11-14Rollup merge of #45961 - dereckson:unix-agnosticity-ci, r=Mark-SimulacrumGuillaume Gomez-41/+41
Use #!/usr/bin/env as shebang for Bash scripts On some systems, the bash command could be available in another directory than /bin. As such, to offer an env shebang is more convenient. This make sense even for docker scripts, as you can use Docker on FreeBSD or SmartOS for example.
2017-11-14Rollup merge of #45950 - ↵Guillaume Gomez-112/+56
fitzgen:update-unary-and-binary-exprs-test-to-use-incr-except, r=michaelwoerister incr: Make `unary_and_binary_exprs.rs` use `except`-style incremental checking Part of #44924 r? @michaelwoerister
2017-11-14Rollup merge of #45941 - gaurikholkar:master, r=nikomatsakisGuillaume Gomez-60/+47
update match-expressions.rs with DepNode labels As a part of #44924, I have updated the match-expressions.rs. The PR has tests verified for the following dependency nodes for let-expressions - MirValidated - MirOptimized - TypeCheckTables - TypeOfItem - GenericsOfItem - PredicatesOfItem - FnSignature cc @michaelwoerister r? @nikomatsakis
2017-11-14Rollup merge of #45815 - QuietMisdreavus:happy-little-notices, r=GuillaumeGomezGuillaume Gomez-7/+7
rustdoc: tweak notes on ignore/compile_fail examples Part of https://github.com/rust-lang/rust/issues/44927 This is a softening of these notices to mention *why* a given example has a given callout, rather then telling viewers to be careful with an example. It also changes the character used for these samples from a warning logo to a circle-i/information logo. ![image](https://user-images.githubusercontent.com/5217170/32464361-5fbb5d9e-c305-11e7-8482-ce71b97a54df.png)
2017-11-14Auto merge of #45896 - malbarbo:use-libc-const, r=alexcrichtonbors-50/+5
Use getrandom syscall for all Linux and Android targets. I suppose we can use it in all Linux and Android targets. In function `is_getrandom_available` is checked if the syscall is available (getrandom syscall was add in version 3.17 of Linux kernel), if the syscall is not available `fill_bytes` fallback to reading from `/dev/urandom`. Update libc to include getrandom related constants.
2017-11-14Fix testShotaro Yamada-19/+8
2017-11-14Update libc (new const definitions for Linux sparc64)Marco A L Barbosa-0/+0
2017-11-14Fixed several pulldown warnings when documenting libstd.kennytm-5/+5
2017-11-14Add TyCtxt::is_closureShotaro Yamada-9/+11
2017-11-14Make create_temp_necessary a methodShotaro Yamada-46/+40
2017-11-14Handle closures correctly in MIR inliningShotaro Yamada-10/+109
2017-11-14Auto merge of #45916 - eddyb:even-mirer-0, r=nikomatsakisbors-516/+343
rustc_mir: hardcode pass list internally and remove premature pluggability. Fixes #41712 by moving the MIR pass lists from `rustc_driver` to `rustc_mir`. The application of the passes is done with the `rustc_mir::transform::run_passes` macro, which is public, as are all the passes AFAIK, and can be used to apply MIR passes outside of `rustc_mir`. With the ability to override query providers through the `rustc_driver` (orthogonal to, and not included in this PR), custom drivers will be able to substitute the entire pass list if they want to. **EDIT**: the aforementioned ability is added by #45944. r? @nikomatsakis
2017-11-14don't send block back to be marked unreachable twiceDjzin-4/+2
2017-11-14rustc: split off BodyOwnerKind from MirSource.Eduard-Mihai Burtescu-275/+238
2017-11-14rustc: remove unused MirSource::GeneratorDrop.Eduard-Mihai Burtescu-12/+2
2017-11-14rustc_mir: drive passes directly with a macro.Eduard-Mihai Burtescu-220/+108
2017-11-14rustc: move the MIR pass infrastructure and list to rustc_mir.Eduard-Mihai Burtescu-215/+201
2017-11-14add optimization codegen testsDjzin-0/+44