forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#112513 - compiler-errors:dont-compute-box-s…
…pan-for-tait, r=cjgillot Dont compute `opt_suggest_box_span` span for TAIT Fixes rust-lang#112434 Also a couple more commits on top, pruning some dead code and fixing another weird suggestion encountered in the above issue.
- Loading branch information
Showing
5 changed files
with
56 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
fn test() -> impl std::fmt::Debug { | ||
if true { | ||
"boo2" | ||
} else { | ||
//~^ ERROR `if` and `else` have incompatible types | ||
} | ||
} | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
tests/ui/impl-trait/dont-suggest-box-on-empty-else-arm.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error[E0308]: `if` and `else` have incompatible types | ||
--> $DIR/dont-suggest-box-on-empty-else-arm.rs:4:12 | ||
| | ||
LL | if true { | ||
| ------- `if` and `else` have incompatible types | ||
LL | "boo2" | ||
| ------ expected because of this | ||
LL | } else { | ||
| ____________^ | ||
LL | | | ||
LL | | } | ||
| |_____^ expected `&str`, found `()` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |