about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-03-26Rollup merge of #59389 - euclio:deprecated-suggestion, r=varkorMazdak Farrokhzad-5/+71
replace redundant note in deprecation warning
2019-03-26Rollup merge of #59315 - Zoxc:move-query, r=oli-obkMazdak Farrokhzad-159/+159
Add no_hash to query macro and move some queries over r? @oli-obk
2019-03-26Rollup merge of #59267 - estebank:assoc-const-as-field, r=davidtwcoMazdak Farrokhzad-1/+25
Provide suggestion when using field access instead of path When trying to access an associated constant as if it were a field of an instance, provide a suggestion for the correct syntax. Fix #57316.
2019-03-26Rollup merge of #59150 - estebank:type-ascription, r=varkorMazdak Farrokhzad-0/+177
Expand suggestions for type ascription parse errors Fix #51222. CC #48016, #47666, #54516, #34255.
2019-03-25Auto merge of #59258 - euclio:suggestions-filter-crate, r=oli-obkbors-1/+24
filter suggestions from extern prelude Fixes #59027. Modifies the candidate gathering code to call `filter_fn` on extern crates, which causes them to be filtered out when looking for a type.
2019-03-25Auto merge of #59242 - euclio:asm-ice, r=nagisabors-0/+27
make asm diagnostic instruction optional `DiagnosticInfoInlineAsm::getInstruction` may return a null pointer, so the instruction shouldn't be blindly unwrapped. Reopening from #55193. I was unable to trigger the assertion on Windows after rebasing. Fixes #23458. Fixes #55216.
2019-03-25Auto merge of #59240 - euclio:struct-field-span, r=oli-obkbors-7/+7
use the identifier span for missing struct field
2019-03-24Deduplicate code for path suggestionEsteban Küber-2/+2
2019-03-24Provide suggestion when using field access instead of pathEsteban Küber-0/+24
When trying to access an associated constant as if it were a field of an instance, provide a suggestion for the correct syntax.
2019-03-25Auto merge of #59195 - estebank:for-loop-move, r=petrochenkovbors-0/+58
When moving out of a for loop head, suggest borrowing it When encountering code like the following, suggest borrowing the for loop head to avoid moving it into the for loop pattern: ``` fn main() { let a = vec![1, 2, 3]; for i in &a { for j in a { println!("{} * {} = {}", i, j, i * j); } } } ``` Fix #25534.
2019-03-24Auto merge of #59382 - davidtwco:rfc-2008-refactoring, r=petrochenkovbors-2/+2
Separate `DefId`s for variants and their constructors Part of #44109. Split off from #59376. See [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663140) for previous discussion. r? @petrochenkov
2019-03-24Add nll testEsteban Küber-0/+24
2019-03-24When moving out of a for loop head, suggest borrowing itEsteban Küber-0/+34
When encountering code like the following, suggest borrowing the for loop head to avoid moving it into the for loop pattern: ``` fn main() { let a = vec![1, 2, 3]; for i in &a { for j in a { println!("{} * {} = {}", i, j, i * j); } } } ```
2019-03-24Auto merge of #59397 - kennytm:rollup, r=kennytmbors-12/+66
Rollup of 7 pull requests Successful merges: - #59213 (Track changes to robots.txt) - #59239 (Remove inline assembly from hint::spin_loop) - #59251 (Use a valid name for graphviz graphs) - #59296 (Do not encode gensymed imports in metadata) - #59328 (Implement specialized nth_back() for Box and Windows.) - #59355 (Fix ICE with const generic param in struct) - #59377 (Correct minimum system LLVM version in tests)
2019-03-24make asm diagnostic instruction optionalAndy Russell-0/+27
`DiagnosticInfoInlineAsm::getInstruction` may return a null pointer, so the instruction shouldn't be blindly unwrapped.
2019-03-24replace redundant note in deprecation warningAndy Russell-5/+71
2019-03-24Merge `DefPathData::VariantCtor` and `DefPathData::StructCtor`Vadim Petrochenkov-2/+2
2019-03-24Rollup merge of #59377 - smaeul:patch/system-llvm, r=nikickennytm-12/+12
Correct minimum system LLVM version in tests Since commit 9452a8dfa3ba, the new debug info format is only generated for LLVM 8 and newer versions. However, the tests still assume that LLVM 7 will use the new debug info format. Fix the tests (and a comment in the code) to match the actual version check.
2019-03-24Auto merge of #58305 - scalexm:chalk-continued, r=nikomatsakisbors-5/+31
(WIP) Small fixes in chalkification Small fixes around region constraints and builtin impls. There are still some type inference errors, for example the following code errors out: ```rust fn main() { let mut x: Vec<i32> = Vec::new(); // ^^^^^^^^ cannot infer type for `std::vec::Vec<_>` } ``` but explicitly specifying `Vec::<i32>::new` works. With these few fixes, the following code now passes type-checking: ```rust fn main() { let mut x: Vec<i32> = Vec::<i32>::new(); x.push(5); println!("{:?}", x); } ``` I also fixed the implied bounds bug as discussed on Zulip and in https://github.com/rust-lang-nursery/chalk/pull/206 cc @tmandry r? @nikomatsakis
2019-03-24Rollup merge of #59355 - varkor:const-param-struct-ice, r=petrochenkovkennytm-0/+21
Fix ICE with const generic param in struct Fixes https://github.com/rust-lang/rust/issues/59340. r? @petrochenkov
2019-03-24Rollup merge of #59296 - petrochenkov:stdup, r=estebankkennytm-0/+10
Do not encode gensymed imports in metadata (Unless they are underscore `_` imports which are re-gensymed on crate loading, see https://github.com/rust-lang/rust/pull/56392.) We cannot encode gensymed imports properly in metadata and if we encode them improperly, we can get erroneous name conflicts downstream. Gensymed imports are produced by the compiler, so we control their set, and can be sure that none of them needs being encoded for use from other crates. A workaround that fixes https://github.com/rust-lang/rust/issues/59243.
2019-03-24Rollup merge of #59251 - matthewjasper:fix-graphviz, r=petrochenkovkennytm-0/+23
Use a valid name for graphviz graphs Hiridification has broken graphviz output because `HirId` has a more complex display implemetation than `NodeId`. Since the id was just used to generate a distinct identifier, we just pull out the various constituent indexed.
2019-03-24Separate variant id and variant constructor id.David Wood-2/+2
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-03-24Auto merge of #59199 - estebank:untrack-errors, r=eddybbors-1/+5
Remove `track_errors` from `check_match`, `typeck_item_bodies` and `register_plugins` In the spirit of continuing through errors in type checking (#39275), remove `track_errors` from a couple of locations in the codebase.
2019-03-23Fix span after rebaseEsteban Küber-9/+3
2019-03-23Mark duplicate import removal suggestion tool onlyEsteban Küber-10/+0
2019-03-23Deduplicate const eval error spans for better outputEsteban Küber-28/+12
2019-03-23Hide obvious suggestion from cli outputEsteban Küber-21/+9
2019-03-23Tweak unnecessary import suggestionEsteban Küber-44/+24
2019-03-23Tweak unsupported negative trait bounds messageEsteban Küber-30/+40
2019-03-23Swap primary/secondary spans for E0458Esteban Küber-4/+4
2019-03-23Swap const evaluation lint spans to point at problem in primary spanEsteban Küber-304/+344
2019-03-23Tweak spans for E0599Esteban Küber-126/+60
2019-03-23Auto merge of #59058 - petrochenkov:assocrecov3, r=estebankbors-4/+135
syntax: Better recovery for `$ty::AssocItem` and `ty!()::AssocItem` This PR improves on https://github.com/rust-lang/rust/pull/46788 covering a few missing cases. Fixes https://github.com/rust-lang/rust/issues/52307 Fixes https://github.com/rust-lang/rust/issues/53776 r? @estebank
2019-03-22Continue running after `typeck_item_bodies` has failedEsteban Küber-1/+5
2019-03-22Reword type ascription note to reduce verbosityEsteban Küber-60/+10
2019-03-22Review commentEsteban Küber-10/+10
2019-03-22Hide "type ascription is experimental error" unless it's the only oneEsteban Küber-24/+5
In order to minimize the verbosity of common syntax errors that are parsed as type ascription, hide the feature gate error unless there are no other errors being emitted by the parser.
2019-03-22Only suggest let assignment for type ascription if we find an equals signEsteban Küber-9/+3
2019-03-22Tweak labelsEsteban Küber-5/+1
2019-03-22Expand suggestions for type ascription parse errorsEsteban Küber-0/+256
2019-03-23Auto merge of #58929 - estebank:elide-object, r=zackmdavisbors-0/+33
Elide object safety errors on non-existent trait function Fix #58734. r? @zackmdavis
2019-03-22Correct minimum system LLVM version in testsSamuel Holland-12/+12
Since commit 9452a8dfa3ba, the new debug info format is only generated for LLVM 8 and newer versions. However, the tests still assume that LLVM 7 will use the new debug info format. Fix the tests (and a comment in the code) to match the actual version check.
2019-03-22Rollup merge of #59347 - petrochenkov:nomake, r=davidtwcoMazdak Farrokhzad-50/+57
Move one test from run-make-fulldeps to ui The test was written when `--extern` without path didn't exist.
2019-03-22Rollup merge of #59329 - petrochenkov:rmcff, r=alexcrichtonMazdak Farrokhzad-45/+0
cleanup: Remove compile-fail-fulldeps directory again It was already removed once in https://github.com/rust-lang/rust/pull/56444, but was partially resurrected by rebase of some other PR.
2019-03-22Rollup merge of #59323 - euclio:enum-instead-of-variant, r=varkorMazdak Farrokhzad-40/+104
use suggestions for "enum instead of variant" error
2019-03-22Rollup merge of #59322 - estebank:diag-tweak, r=davidtwcoMazdak Farrokhzad-49/+23
Tweak incorrect escaped char diagnostic
2019-03-22Rollup merge of #59321 - varkor:unify-E0109-E0110-E0111, r=davidtwcoMazdak Farrokhzad-182/+179
Unify E0109, E0110 and E0111 Error messages should no longer be restricted to specific generic kinds.
2019-03-22Rollup merge of #59297 - euclio:field-method-suggestions, r=estebankMazdak Farrokhzad-20/+48
convert field/method confusion help to suggestions
2019-03-22Rollup merge of #59266 - estebank:struct-parse-recovery, r=petrochenkovMazdak Farrokhzad-0/+21
Do not complain about non-existing fields after parse recovery When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it. Fix #57361.