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.
Auto merge of rust-lang#70040 - Dylan-DPC:rollup-id1k6lz, r=Dylan-DPC
Rollup of 7 pull requests Successful merges: - rust-lang#67335 (Refactor the `Qualif` trait) - rust-lang#69122 (Backtrace Debug tweaks) - rust-lang#69520 (Make error message clearer about creating new module) - rust-lang#69738 (More Method -> AssocFn renaming) - rust-lang#69867 (Add long error explanation for E0628 ) - rust-lang#69989 (resolve/hygiene: `macro_rules` are not "legacy") - rust-lang#70036 (Make article_and_description primarily use def_kind) Failed merges: r? @ghost
- Loading branch information
Showing
82 changed files
with
694 additions
and
579 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
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
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
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,30 @@ | ||
More than one parameter was used for a generator. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0628 | ||
#![feature(generators, generator_trait)] | ||
fn main() { | ||
let generator = |a: i32, b: i32| { | ||
// error: too many parameters for a generator | ||
// Allowed only 0 or 1 parameter | ||
yield a; | ||
}; | ||
} | ||
``` | ||
|
||
At present, it is not permitted to pass more than one explicit | ||
parameter for a generator.This can be fixed by using | ||
at most 1 parameter for the generator. For example, we might resolve | ||
the previous example by passing only one parameter. | ||
|
||
``` | ||
#![feature(generators, generator_trait)] | ||
fn main() { | ||
let generator = |a: i32| { | ||
yield a; | ||
}; | ||
} | ||
``` |
Oops, something went wrong.