Uh oh!
There was an error while loading. Please reload this page.
Properly display note/expected details - #39905
Conversation
rust-highfive
commented
Feb 17, 2017
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
eddyb
commented
Feb 17, 2017
Can we get a ui regression test (the more the better – even a UI test derived from one of affected (with red diff) compile-fail tests would be nice). Other than that it LGTM. |
arielb1
commented
Feb 17, 2017
bors
commented
Feb 17, 2017
📌 Commit b2f1fb2 has been approved by |
estebank
commented
Feb 17, 2017
@arielb1 Had to fix typo in test. |
sophiajt
commented
Feb 19, 2017
Are these the only tests affected? I would have thought dozens of tests would need to be updated. |
@jonathandturner I thought the same thing, but after a cursory check the specific cases where this error would trigger (type errors where the inner There were a few tests that could have triggered this, had they not used structs or enums defined in the test for the arg types. This triggers the error: fntakes_cb(f:fn(i8)){}fnmain(){fncallback(x:i32){}takes_cb(callback)}while this doesn't: structA{}structB{}fntakes_cb(f:fn(A)){}fnmain(){fncallback(x:B){}takes_cb(callback)} |
nikomatsakis
commented
Feb 23, 2017
@bors r=arielb1 |
bors
commented
Feb 23, 2017
📌 Commit 038a166 has been approved by |
Properly display note/expected details
Given a file
```rust
fn takes_cb(f: fn(i8)) {}
fn main() {
fn callback(x: i32) {}
takes_cb(callback)
}
```
output
```rust
error[E0308]: mismatched types
--> file2.rs:5:22
|
5 | takes_cb(callback)
| ^^^^^^^^ expected i8, found i32
|
= note: expected type `fn(i8)`
found type `fn(i32) {main::callback}`
```
Fixrust-lang#39343.Properly display note/expected details
Given a file
```rust
fn takes_cb(f: fn(i8)) {}
fn main() {
fn callback(x: i32) {}
takes_cb(callback)
}
```
output
```rust
error[E0308]: mismatched types
--> file2.rs:5:22
|
5 | takes_cb(callback)
| ^^^^^^^^ expected i8, found i32
|
= note: expected type `fn(i8)`
found type `fn(i32) {main::callback}`
```
Fixrust-lang#39343.Properly display note/expected details
Given a file
```rust
fn takes_cb(f: fn(i8)) {}
fn main() {
fn callback(x: i32) {}
takes_cb(callback)
}
```
output
```rust
error[E0308]: mismatched types
--> file2.rs:5:22
|
5 | takes_cb(callback)
| ^^^^^^^^ expected i8, found i32
|
= note: expected type `fn(i8)`
found type `fn(i32) {main::callback}`
```
Fixrust-lang#39343.Rollup of 28 pull requests - Successful merges: #39859, #39864, #39888, #39903, #39905, #39914, #39945, #39950, #39953, #39961, #39980, #39988, #39993, #39995, #40019, #40020, #40022, #40024, #40025, #40026, #40027, #40031, #40035, #40037, #40038, #40064, #40069, #40086 - Failed merges: #39927, #40008, #40047
bors
commented
Feb 25, 2017
frewsxcv
commented
Feb 26, 2017
Trying to fix bors, please ignore @bors r- |
Given a file
output
Fix#39343.