-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #102695 - compiler-errors:int-and-float-trivial-copy, r…
…=lcnr Int and float inference variables are trivially copy Fixes #102645
- Loading branch information
Showing
4 changed files
with
50 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// compile-flags: -Zdrop-tracking | ||
|
||
#![feature(generators, generator_trait)] | ||
|
||
use std::ops::Generator; | ||
use std::pin::Pin; | ||
|
||
fn main() { | ||
let mut a = 5; | ||
let mut b = || { | ||
let d = 6; | ||
yield; | ||
_zzz(); // #break | ||
a = d; | ||
}; | ||
Pin::new(&mut b).resume(); | ||
//~^ ERROR this function takes 1 argument but 0 arguments were supplied | ||
// This type error is required to reproduce the ICE... | ||
} | ||
|
||
fn _zzz() { | ||
() | ||
} |
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,19 @@ | ||
error[E0061]: this function takes 1 argument but 0 arguments were supplied | ||
--> $DIR/issue-102645.rs:16:22 | ||
| | ||
LL | Pin::new(&mut b).resume(); | ||
| ^^^^^^-- an argument of type `()` is missing | ||
| | ||
note: associated function defined here | ||
--> $SRC_DIR/core/src/ops/generator.rs:LL:COL | ||
| | ||
LL | fn resume(self: Pin<&mut Self>, arg: R) -> GeneratorState<Self::Yield, Self::Return>; | ||
| ^^^^^^ | ||
help: provide the argument | ||
| | ||
LL | Pin::new(&mut b).resume(()); | ||
| ~~~~ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0061`. |