forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#47844 - CAD97:patch-1, r=estebank
Fix regression: account for trait methods in arg count mismatch error Fixed rust-lang#47706 (rust-lang#47706 (comment)) Original PR rust-lang#47747 missed methods on trait definitions. This edit was done in GitHub. I think I got the signature of the variant right, going by the ICE debug output and the other cases above.
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
trait T { | ||
fn f(&self, _: ()) { | ||
None::<()>.map(Self::f); | ||
} | ||
//~^^ ERROR function is expected to take a single 0-tuple as argument | ||
} |
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,12 @@ | ||
error[E0601]: main function not found | ||
|
||
error[E0593]: function is expected to take a single 0-tuple as argument, but it takes 2 distinct arguments | ||
--> $DIR/issue-47706-trait.rs:13:20 | ||
| | ||
12 | fn f(&self, _: ()) { | ||
| ------------------ takes 2 distinct arguments | ||
13 | None::<()>.map(Self::f); | ||
| ^^^ expected function that takes a single 0-tuple as argument | ||
|
||
error: aborting due to 2 previous errors | ||
|