about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-01-02introduce placeholder-placeholder errors for trait matchingNiko Matsakis-91/+35
2019-01-02WIP other test changesNiko Matsakis-7/+6
2019-01-02tests: cases where we now do the right thing but did not beforeNiko Matsakis-137/+137
Fixes #33684
2019-01-02tests: worse diagnostics, but basically same errorsNiko Matsakis-437/+463
2019-01-02tests: move coherence-subtyping from run-pass to compile-failNiko Matsakis-1/+33
This is the pattern we no longer accept.
2019-01-02add tests exercising `exists<'a> { forall<'b> { .. } }` patternNiko Matsakis-0/+163
Amazingly, this scenario was not tested for trait matching.
2019-01-02select.rs: unsizing coercion should use a subtypeNiko Matsakis-7/+9
When we coerce `dyn Foo` to `dyn Bar`, that is OK as long as `Foo` is usable in all contexts where `Bar` is usable (hence using the source must be a subtype of the target). This is needed for the universe-based code to handle `old-lub-glb-object`; that test used to work sort of by accident before with the old code.
2019-01-02make evaluation track whether outlives relationships matteredNiko Matsakis-0/+41
Previously, evaluation ignored outlives relationships. Since we using evaluation to skip the "normal" trait selection (which enforces outlives relationships) this led to incorrect results in some cases.
2019-01-02Wf-check the output type of a function in MIR-typeckMatthew Jasper-0/+38
2019-01-02Remove no longer working testAlex Crichton-141/+0
2019-01-02make `panictry!` private to libsyntaxAndy Russell-14/+220
This commit completely removes usage of the `panictry!` macro from outside libsyntax. The macro causes parse errors to be fatal, so using it in libsyntax_ext caused parse failures *within* a syntax extension to be fatal, which is probably not intended. Furthermore, this commit adds spans to diagnostics emitted by empty extensions if they were missing, à la #56491.
2019-01-02Auto merge of #57250 - codeworm96:tyerr_msg, r=varkorbors-103/+103
Improve type mismatch error messages Closes #56115. Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing. TODO the book and clippy needs to be changed accordingly later. r? @varkor
2019-01-02Auto merge of #57251 - petrochenkov:reregr, r=varkorbors-1/+13
syntax: Fix regression in diagnostics for patterns in trait method parameters Fixes https://github.com/rust-lang/rust/issues/55036
2019-01-01Auto merge of #57209 - estebank:suggest-raw-ident, r=petrochenkovbors-0/+80
Suggest using raw identifiers in 2018 edition when using keywords
2019-01-01syntax: Fix regression in diagnostics for patterns in trait method parametersVadim Petrochenkov-1/+13
2019-01-01Fix broken links to second edition TRPL.Corey Farwell-135/+135
Fixes https://github.com/rust-lang/rust/issues/57104.
2019-01-01Auto merge of #55937 - davidtwco:issue-54943, r=pnkfelixbors-14/+150
NLL: User type annotations refactor, associated constant patterns and ref bindings. Fixes #55511 and Fixes #55401. Contributes to #54943. This PR performs a large refactoring on user type annotations, checks user type annotations for associated constants in patterns and that user type annotations for `ref` bindings are respected. r? @nikomatsakis
2019-01-01Auto merge of #57210 - estebank:str-err, r=zackmdavisbors-5/+73
Tweak unicode escape diagnostics
2019-01-01Auto merge of #57194 - matthiaskrgr:copyright_headers, r=Centrilbors-171/+13
remove more copyright headers r? @Mark-Simulacrum
2019-01-01Auto merge of #57199 - petrochenkov:ambig, r=estebankbors-2/+13
resolve: Simplify treatment of ambiguity errors If we have a glob conflict like this ```rust mod m1 { struct S; } mod m2 { struct S; } use m1::*; use m2::*; ``` we treat it as a special "ambiguity item" that's not an error by itself, but produces an error when actually used. ```rust use m1::*; // primary use m2::*; // secondary => ambiguity S(m1::S, m2::S); ``` Ambiguity items were *sometimes* treated as their primary items for error recovery, but pretty irregularly. After this PR they are always treated as their primary items, except that - If an ambiguity item is marked as used, then it still produces an error. - Ambiguity items are still filtered away when exported to other crates (which is also a use in some sense).
2018-12-31Improve type mismatch error messagesYuning Zhang-103/+103
Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.
2018-12-31Auto merge of #56878 - petrochenkov:privdyn, r=arielb1bors-35/+163
privacy: Use common `DefId` visiting infrastructure for all privacy visitors One repeating pattern in privacy checking is going through a type, visiting all `DefId`s inside it and doing something with them. This is the case because visibilities and reachabilities are attached to `DefId`s. Previously various privacy visitors visited types slightly differently using their own methods, with most recently written `TypePrivacyVisitor` being the "gold standard". This mostly worked okay, but differences could manifest in overly conservative reachability analysis, some errors being reported twice, some private-in-public lints (not errors) being wrongly reported or not reported. This PR does something that I wanted to do since https://github.com/rust-lang/rust/pull/32674#discussion_r58291608 - factoring out the common visiting logic! Now all the common logic is contained in `struct DefIdVisitorSkeleton`, with specific privacy visitors deciding only what to do with visited `DefId`s (via `trait DefIdVisitor`). A bunch of cleanups is also applied in the process. This area is somewhat tricky due to lots of easily miss-able details, but thankfully it's was well covered by tests in https://github.com/rust-lang/rust/pull/46083 and previous PRs, so I'm relatively sure in the refactoring correctness. Fixes https://github.com/rust-lang/rust/pull/56837#discussion_r241962239 in particular. Also this will help with implementing https://github.com/rust-lang/rust/issues/48054.
2019-01-01Address review commentsVadim Petrochenkov-19/+19
Say "trait" instead of "type" in diagnostics for `dyn Trait`
2019-01-01privacy: Use common `DefId` visiting infra for all privacy visitorsVadim Petrochenkov-20/+148
2018-12-31Auto merge of #57047 - euclio:field-structured-suggestions, r=estebankbors-28/+33
use structured suggestions for nonexistent fields r? @estebank
2018-12-31Do not use unicode character in diagnostic helpEsteban Küber-3/+3
2018-12-31use structured suggestions for nonexistent fieldsAndy Russell-28/+33
2018-12-31Use structured suggestion for braceless unicode escape squenceEsteban Küber-8/+15
2018-12-31Account for `\xFF` and `\u{FF}` sequences in string format errorsEsteban Küber-1/+62
2018-12-31Update tests after rebaseEsteban Küber-0/+4
2018-12-31Address review commentsEsteban Küber-7/+55
- Suggest raw ident escaping in all editions - Keep primary label in all cases
2018-12-31Suggest using raw identifiers in 2018 edition when using keywordsEsteban Küber-7/+35
2018-12-31const-stabilize const_int_ops + reverse_bitsMazdak Farrokhzad-115/+114
2018-12-31Rename and fix nolink-with-link-args testMika Lehtinen-13/+12
There are three problems with the nolink-with-link-args test: * The test fails when using MSVC. It's caused by the `linker-flavor=ld` flag which was added in #46291. * In its comment, this test tests that "link_args are indeed passed when nolink is specified", but the `nolink` attribute has been removed [a long time ago](https://github.com/rust-lang/rust/pull/12826). * Pattern has a small typo. At first I was going to completely remove this test, but there is [a closed pull request for that](https://github.com/rust-lang/rust/pull/21090). So: * rename the file as suggested in the closed PR * adjust the comment * fix typo in the pattern * add `ignore-msvc`.
2018-12-31Auto merge of #57208 - estebank:issue-57198, r=petrochenkovbors-0/+25
Do not complain about missing crate named as a keyword Fix #57198.
2018-12-30Tweak E0308 error for clarityEsteban Küber-40/+37
2018-12-31Auto merge of #57044 - varkor:E0512-equal-type, r=matthewjasperbors-115/+135
Add specific diagnostic when attempting to transmute between equal generic types Also clarifies the wording of E0512. Fixes https://github.com/rust-lang/rust/issues/49793.
2018-12-31unchecked_{shl,shr}: extend const tests.Mazdak Farrokhzad-15/+428
2018-12-31const stabilizations: adjust run-pass tests.Mazdak Farrokhzad-6/+0
2018-12-30Fix variable string size problem in transmute testvarkor-3/+3
2018-12-30Point at function name spanEsteban Küber-30/+71
2018-12-30Point at the return type span on type mismatch due to missing returnEsteban Küber-121/+83
Do not point at the entire block span on fn return type mismatches caused by missing return.
2018-12-30Remove unused nll debug flagsMatthew Jasper-15/+9
2018-12-30Auto merge of #57205 - petrochenkov:extrecov, r=estebankbors-25/+42
Improve error recovery for some built-in macros Fixes https://github.com/rust-lang/rust/issues/55897
2018-12-30Change return types and check return values in tests.Camille GILLOT-9/+20
This allows to verify that we handle different types as return types, and that we call the expected functions.
2018-12-30Move tests to ui.Camille GILLOT-0/+2
2018-12-30test: Add test for issues 45510 and 18952.Camille GILLOT-0/+75
Those tests are directly taken from the comments on the bug reports.
2018-12-30Guarantee `rustc_dump_user_substs` error order.David Wood-8/+8
This commit buffers the errors output by the `rustc_dump_user_substs` attribute so that they can be output in order of span and would therefore be consistent.
2018-12-30Stop well-formedness checking unreachable code.David Wood-29/+33
This commit stops well-formedness checking applying to unreachable code and therefore stops some of the ICEs that the intended solution taken by this PR causes. By disabling these checks, we can land the other fixes and larger refactors that this PR includes.
2018-12-30Fix unresolved inference variable ICE.David Wood-2/+35
This commit moves well-formedness check for the `UserTypeAnnotation::Ty(..)` case from always running to only when the code is reachable. This solves the ICE that resulted from `src/test/ui/issue-54943-1.rs` (a minimal repro of `dropck-eyepatch` run-pass tests that failed). The main well-formedness check that was intended to be run despite unreachable code still is, that being the `UserTypeAnnotation::TypeOf(..)` case. Before this PR, the other case wasn't being checked at all. It is possible to fix this ICE while still always checking well-formedness for the `UserTypeAnnotation::Ty(..)` case but that solution will ICE in unreachable code for that case, the diff for that change [can be found here](0). [0]: https://gist.github.com/davidtwco/f9751ffd9c0508f7251c0f17adc3af53