mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Delegation: one more ICE fix for MethodCall generation
This commit is contained in:
@@ -330,6 +330,7 @@ fn finalize_body_lowering(
|
||||
.unwrap_or_default()
|
||||
&& delegation.qself.is_none()
|
||||
&& !has_generic_args
|
||||
&& !args.is_empty()
|
||||
{
|
||||
let ast_segment = delegation.path.segments.last().unwrap();
|
||||
let segment = self.lower_path_segment(
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#![feature(fn_delegation)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait HasSelf {
|
||||
fn method(self);
|
||||
}
|
||||
trait NoSelf {
|
||||
fn method();
|
||||
}
|
||||
impl NoSelf for u8 {
|
||||
reuse HasSelf::method;
|
||||
//~^ ERROR this function takes 1 argument but 0 arguments were supplied
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,19 @@
|
||||
error[E0061]: this function takes 1 argument but 0 arguments were supplied
|
||||
--> $DIR/ice-issue-138362.rs:11:20
|
||||
|
|
||||
LL | reuse HasSelf::method;
|
||||
| ^^^^^^ argument #1 is missing
|
||||
|
|
||||
note: method defined here
|
||||
--> $DIR/ice-issue-138362.rs:5:8
|
||||
|
|
||||
LL | fn method(self);
|
||||
| ^^^^^^ ----
|
||||
help: provide the argument
|
||||
|
|
||||
LL | reuse HasSelf::method(/* value */);
|
||||
| +++++++++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0061`.
|
||||
Reference in New Issue
Block a user