about summary refs log tree commit diff
path: root/src/test/ui/coercion
AgeCommit message (Collapse)AuthorLines
2021-09-26Remove box syntax from most places in src/test outside of the issues direst31-1/+0
2021-09-17Add nofallback testsMark Rousskov-2/+27
2021-08-19Fix non-capturing closure return type coercionFabian Wolff-0/+31
2021-06-30Move some UI tests to more suitable subdirsYuki Okushi-0/+37
2021-02-06path trimming: ignore type aliasesDan Aloni-2/+2
2020-09-02pretty: trim paths of unique symbolsDan Aloni-26/+26
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-07-02Audit uses of `span_suggestion_short`Yuki Okushi-2/+20
2020-06-19coerce reborrow multi arg testBastian Kauschke-0/+27
2020-06-19merge coercion test foldersBastian Kauschke-29/+420
2020-06-18Rollup merge of #73361 - estebank:non-primitive-cast, r=davidtwcoManish Goregaokar-6/+2
Tweak "non-primitive cast" error - Suggest borrowing expression if it would allow cast to work. - Suggest using `<Type>::from(<expr>)` when appropriate. - Minor tweak to `;` typo suggestion. Partily address #47136.
2020-06-15Tweak "non-primitive cast" errorEsteban Küber-6/+2
- Suggest borrowing expression if it would allow cast to work. - Suggest using `<Type>::from(<expr>)` when appropriate. - Minor tweak to `;` typo suggestion. Partily address #47136.
2020-06-09Relate existential associated types with variance InvariantSantiago Pastorino-1/+1
2020-01-16review commentsEsteban Küber-7/+7
2019-12-14Revert "Remove `#![feature(never_type)]` from tests."Niko Matsakis-13/+17
This reverts commit 8f6197f39f7d468dfc5b2bd41dae4769992a2f83.
2019-11-21Point at type in `let` assignment on type errorsEsteban Küber-5/+8
2019-11-21Auto merge of #66389 - estebank:type-err-labels, r=petrochenkovbors-71/+64
Specific labels when referring to "expected" and "found" types
2019-11-21Gate fallback via `#![feature(never_type_fallback)]`.Mazdak Farrokhzad-1/+1
2019-11-21Remove `#![feature(never_type)]` from tests.Mazdak Farrokhzad-17/+12
Also remove `never_type` the feature-gate test.
2019-11-18Surround types with backticks in type errorsEsteban Küber-21/+21
2019-11-18Remove E0308 note when primary label has all infoEsteban Küber-16/+9
2019-11-18review comments: tweak prefix stringsEsteban Küber-4/+4
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-38/+38
2019-10-15Organize `never_type` testsMazdak Farrokhzad-1/+1
Also move {run-fail -> ui}/never_type
2019-09-06Update ui testsvarkor-2/+2
2019-08-09review comments: typo and rewordingEsteban Küber-2/+2
2019-08-09review comment: review wording or missing return errorEsteban Küber-2/+2
2019-08-09Tweak wording of fn without explicit returnEsteban Küber-2/+2
2019-08-09Change wording for function without return valueEsteban Küber-2/+2
Fix #62677
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-1/+1
2019-05-29Update ui test suite to use dynmemoryruins-15/+15
2019-04-22update tests for migrate mode by defaultMatthew Jasper-150/+10
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-4/+4
2019-03-11Update testsVadim Petrochenkov-22/+22
2019-01-05Auto merge of #57230 - estebank:return-mismatch, r=varkorbors-14/+14
Modify mismatched type error for functions with no return Fix #50009. ``` error[E0308]: mismatched types --> $DIR/coercion-missing-tail-expected-type.rs:3:24 | LL | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types | -------- ^^^ expected i32, found () | | | this function's body doesn't return LL | x + 1; | - help: consider removing this semicolon | = note: expected type `i32` found type `()` ``` instead of ``` error[E0308]: mismatched types --> $DIR/coercion-missing-tail-expected-type.rs:3:28 | LL | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types | ____________________________^ LL | | x + 1; | | - help: consider removing this semicolon LL | | } | |_^ expected i32, found () | = note: expected type `i32` found type `()` ```
2018-12-31Improve type mismatch error messagesYuning Zhang-10/+10
Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.
2018-12-30Tweak E0308 error for clarityEsteban Küber-2/+2
2018-12-30Point at function name spanEsteban Küber-2/+6
2018-12-30Point at the return type span on type mismatch due to missing returnEsteban Küber-14/+10
Do not point at the entire block span on fn return type mismatches caused by missing return.
2018-12-25Remove licensesMark Rousskov-129/+49
2018-12-17fix review comments, round 2Ariel Ben-Yehuda-1/+1
2018-12-17address review commentsAriel Ben-Yehuda-7/+11
2018-12-17trigger unsized coercions keyed on Sized boundsAriel Ben-Yehuda-0/+58
This PR causes unsized coercions to not be disabled by `$0: Unsize<dyn Object>` coercion obligations when we have an `$0: Sized` obligation somewhere. Note that `X: Unsize<dyn Object>` obligations can't fail *as obligations* if `X: Sized` holds, so this still maintains some version of monotonicity (I think that an unsized coercion can't be converted to no coercion by unifying type variables). Fixes #49593 (unblocking never_type).
2018-10-03Clearer later use messages for callsMatthew Jasper-23/+19
Give a special message when the later use is from a call. Use the span of the callee instead of the whole expression. For conflicting borrow messages say that the later use is of the first borrow.
2018-08-14Moved tests back to compile-test if they don't work on ui.David Wood-23/+0
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+769