about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-02-03Auto merge of #47845 - Zoxc:gen-fixes, r=nikomatsakisbors-18/+122
Generator bugfixes r? @nikomatsakis
2018-02-03Auto merge of #46254 - Dylan-DPC:ellided-lifetime, r=nikomatsakisbors-0/+33
elided lifetime Closes #45992 Hey Having a problem with my config so decided to make a WIP PR nevertheless. Will add some more tests.
2018-02-03Auto merge of #47962 - kennytm:rollup, r=kennytmbors-3/+76
Rollup of 10 pull requests - Successful merges: #46156, #47829, #47842, #47898, #47914, #47916, #47919, #47942, #47951, #47973 - Failed merges: #47753
2018-02-03Auto merge of #47791 - estebank:mismatched-trait-impl, r=nikomatsakisbors-86/+124
Tweak presentation on lifetime trait mismatch - On trait/impl method discrepancy, add label pointing at trait signature. - Point only at method definition when referring to named lifetimes on lifetime mismatch. - When the sub and sup expectations are the same, tweak the output to avoid repeated spans. Fix #30790, CC #18759.
2018-02-02Rollup merge of #47942 - estebank:macro-spans, r=nikomatsakis Minimize weird ↵kennytm-2/+38
spans involving macro context Sometimes the parser attempts to synthesize spans from within a macro context with the span for the captured argument, leading to non-sensical spans with very bad output. Given that an incorrect span is worse than a partially incomplete span, when detecting this situation return only one of the spans without merging them. Fix #32072, #47778. CC #23480.
2018-02-02Rollup merge of #47914 - etaoins:improve-char-escape-in-lexer-msg, ↵kennytm-1/+14
r=petrochenkov Improve char escaping in lexer messages Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as `error: unknown start of token: \\` when encountering a single backslash. Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters. Fixes #47902
2018-02-02Rollup merge of #47898 - Aaron1011:static-ref-nll, r=nikomatsakis Fix ICE ↵kennytm-0/+20
when assigning references to a static mut with NLL is_unsafe_place only filters out statics in the rhs, not the lhs. Since it's possible to reach that 'Place::Static', we handle statics the same way as we do locals. Fixes #47789
2018-02-02Rollup merge of #47829 - estebank:break-in-for, r=cramertj Suggest removing ↵kennytm-0/+4
value from `break` when invalid When attempting to use `break` with a value in a type of loop where it'd be invalid (any non-`loop`), suggest using `break` on its own. Close #34359.
2018-02-02Auto merge of #47465 - estebank:include-space-after-mut, r=nikomatsakisbors-29/+47
Include space in suggestion `mut` in bindings Fix #46614.
2018-02-02add ellided lifetimedpc-0/+33
2018-02-01Minimize weird spans involving macro contextEsteban Küber-2/+38
Sometimes the parser attempts to synthesize spans from within a macro context with the span for the captured argument, leading to non-sensical spans with very bad output. Given that an incorrect span is worse than a partially incomplete span, when detecting this situation return only one of the spans without mergin them.
2018-02-01Auto merge of #47738 - nikomatsakis:issue-47139-master, r=arielb1bors-0/+162
remove intercrate ambiguity hints The scheme was causing overflows during coherence checking (e.g. #47139). This is sort of a temporary fix; the proper fix I think involves reworking trait selection in deeper ways. cc @sgrif -- this *should* fix diesel cc @qnighy -- I'd like to discuss you with alternative techniques for achieving the same end. =) Actually, it might be good to put some energy into refactoring traits first. r? @eddyb
2018-02-01Improve char escaping in lexer messagesRyan Cumming-1/+14
Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as `error: unknown start of token: \\` when encountering a single backslash. Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters. Fixes #47902
2018-02-01Rollup merge of #47895 - varkor:non-utf-stdin, r=estebankkennytm-0/+7
Fix ICE when reading non-UTF-8 input from stdin Fixes #22387.
2018-01-31Use file containing non-UTF-8 character instead of echo -evarkor-1/+3
2018-01-31Add echo escape flagvarkor-1/+1
2018-01-31Rollup merge of #47891 - eddyb:issue-47638, r=nikomatsakiskennytm-2/+20
rustc_trans: keep LLVM types for trait objects anonymous. Fixes #47638 by reverting the addition of readable LLVM trait object type names. r? @nikomatsakis
2018-01-31Rollup merge of #47884 - cuviper:run-pass-sse2, r=alexcrichtonkennytm-1/+1
Ignore run-pass/sse2 when using system LLVM This is a test of `target_feature`, which needs a rust-specific patch to LLVM to add `MCSubtargetInfo::getFeatureTable()`.
2018-01-31Rollup merge of #47876 - GuillaumeGomez:associated-const-error, r=nikomatsakiskennytm-2/+5
Update associated constants error message Fixes #47570.
2018-01-31Rollup merge of #47844 - CAD97:patch-1, r=estebankkennytm-0/+28
Fix regression: account for trait methods in arg count mismatch error Fixed #47706 (https://github.com/rust-lang/rust/issues/47706#issuecomment-361161495) Original PR #47747 missed methods on trait definitions. This edit was done in GitHub. I think I got the signature of the variant right, going by the ICE debug output and the other cases above.
2018-01-31Rollup merge of #47838 - euclio:snakecase-suggestion, r=petrochenkovkennytm-12/+12
use correct casing for rename suggestions If the original name is uppercase, use camel case. Otherwise, use snake case.
2018-01-30Fix ICE when assigning references to a static mut with NLLAaron Hill-0/+20
is_unsafe_place only filters out statics in the rhs, not the lhs. Since it's possible to reach that 'Place::Static', we handle statics the same way as we do locals. Fixes #47789
2018-01-31Fix ICE when reading non-UTF-8 input from stdinvarkor-0/+5
Fixes #22387.
2018-01-31rustc_trans: keep LLVM types for trait objects anonymous.Eduard-Mihai Burtescu-2/+20
2018-01-30Ignore run-pass/sse2 when using system LLVMJosh Stone-1/+1
This is a test of `target_feature`, which needs a rust-specific patch to LLVM to add `MCSubtargetInfo::getFeatureTable()`.
2018-01-30Update associated constants error messageGuillaume Gomez-2/+5
2018-01-30Force locals to be live after they are borrowed for immovable generators. ↵John Kåre Alsaker-0/+28
Fixes #47736
2018-01-30Auto merge of #47870 - kennytm:rollup, r=kennytmbors-6/+117
Rollup of 12 pull requests - Successful merges: #47515, #47603, #47718, #47732, #47760, #47780, #47822, #47826, #47836, #47839, #47853, #47855 - Failed merges:
2018-01-30Allow access of the state field before the generator transform. Fixes ↵John Kåre Alsaker-18/+18
#47482, #46476
2018-01-30Rollup merge of #47855 - ollie27:rustdoc_hoedown_link_title, r=QuietMisdreavuskennytm-0/+19
rustdoc: Fix link title rendering with hoedown The link title needs to be HTML escaped. It was broken by #47046. r? @QuietMisdreavus
2018-01-30Rollup merge of #47853 - rust-lang:increase-nested-groups-test-coverage, ↵kennytm-0/+42
r=nikomatsakis Increase test coverage of use_nested_groups r? @nikomatsakis
2018-01-30Rollup merge of #47780 - varkor:cross-file-errors-line-col, r=estebankkennytm-5/+52
Add line numbers and columns to error messages spanning multiple files If an error message is emitted that spans several files, only the primary file currently has line and column data attached. This is useful information, even in files other than the one in which the error occurs. We can often work out which line and column the error corresponds to in other files — in this case it is helpful to add them (in the case of ambiguity, the first relevant line/column is picked, which is still helpful than none).
2018-01-30Rollup merge of #47718 - malbarbo:env-home-dir, r=nikomatsakiskennytm-1/+4
Make run-pass/env-home-dir.rs test more robust Remove the assumption that home_dir always returns Some. This allows the test to be executed with [cross](https://github.com/japaric/cross).
2018-01-30Auto merge of #45294 - petrochenkov:prioplus, r=nikomatsakisbors-2/+129
syntax: Lower priority of `+` in `impl Trait`/`dyn Trait` Now you have to write `Fn() -> (impl A + B)` instead of `Fn() -> impl A + B`, this is consistent with priority of `+` in trait objects (`Fn() -> A + B` means `(Fn() -> A) + B`). To make this viable I changed the syntax to also permit `+` in return types in function declarations ``` fn f() -> dyn A + B { ... } // OK, don't have to write `-> (dyn A + B)` // This is acceptable, because `dyn A + B` here is an isolated type and // not part of a larger type with various operator priorities in play // like `dyn A + B` in `Fn() -> dyn A + B` despite syntax similarities. ``` but you still have to use `-> (dyn A + B)` in function types and function-like trait object types (see this PR's tests for examples). This can be a breaking change for code using `impl Trait` on nightly. The thing that is most likely to break is `&impl A + B`, it needs to be rewritten as `&(impl A + B)`. cc https://github.com/rust-lang/rust/issues/34511 https://github.com/rust-lang/rust/issues/44662 https://github.com/rust-lang/rfcs/pull/438
2018-01-29Fix regression: account for trait methods in arg count mismatch errorChristopher Durham-0/+28
2018-01-29Auto merge of #47837 - eddyb:going-places, r=nikomatsakisbors-14/+14
Replace "lvalue" terminology with "place". See #46425 for the previous PR (which only changed MIR-related code). r? @nikomatsakis
2018-01-29rustdoc: Fix link title rendering with hoedownOliver Middleton-0/+19
The link title needs to be HTML escaped.
2018-01-29move comment right onto the line in questionNiko Matsakis-3/+3
2018-01-29Make run-pass/env-home-dir.rs test more robustMarco A L Barbosa-1/+4
Remove the assumption that home_dir always returns Some This allows the test to be executed with [cross](https://github.com/japaric/cross).
2018-01-29Increase test coverage of use_nested_groupsPietro Albini-0/+42
2018-01-29tests: replace "lvalue" terminology with "place".Eduard-Mihai Burtescu-14/+14
2018-01-29Require yield types to be sizedJohn Kåre Alsaker-0/+43
2018-01-29Make `yield_in_scope_for_expr` work with patterns. Fixes #47758John Kåre Alsaker-0/+33
2018-01-28use correct casing for rename suggestionsAndy Russell-12/+12
If the original name is uppercase, use camel case. Otherwise, use snake case.
2018-01-28Point only at method signatures and point at traitEsteban Küber-71/+36
- On mismatch between impl and trait method, point at the trait signature. - Point only at the method signature instead of the whole body on trait/impl mismatch errors.
2018-01-28For named lifetimes point only at method signatureEsteban Küber-24/+105
When refering to named lifetime conflict, point only at the method's signature span instead of the entire method. When the expected and found sup and sub traces are the same, avoid redundant text.
2018-01-28Suggest removing value from `break` when invalidEsteban Küber-0/+4
2018-01-28Auto merge of #47800 - Pulkit07:issue47755, r=sfacklerbors-1/+1
don't mention tasks in stability warnings of #[thread_local] #47755 This is a fix for issue #47755.
2018-01-28Auto merge of #47794 - etaoins:fix-ice-on-const-eval-of-union-field, r=eddybbors-0/+45
Fix ICE on const eval of union field MIR's `Const::get_field()` attempts to retrieve the value for a given field in a constant. In the case of a union constant it was falling through to a generic `const_get_elt` based on the field index. As union fields don't have an index this caused an ICE in `llvm_field_index`. Fix by simply returning the current value when accessing any field in a union. This works because all union fields start at byte offset 0. The added test uses `const_fn` it ensure the field is extracted using MIR's const evaluation. The crash is reproducible without it, however. Fixes #47788 r? @eddyb
2018-01-28Auto merge of #47767 - estebank:as-suggestion, r=petrochenkovbors-0/+27
Correctly format `extern crate` conflict resolution help Closes #45799. Follow up to @Cldfire's #45820. If the `extern` statement that will have a suggestion ends on a `;`, synthesize a new span that doesn't include it.