Skip to content

Commit 69075f0

Browse files
committed
Merge branch 'master' of https://github.com/jwhite927/rust into E0637
2 parents 92fc98c + 8498c5f commit 69075f0

File tree

489 files changed

+3435
-1038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

489 files changed

+3435
-1038
lines changed

.github/ISSUE_TEMPLATE/blank_issue.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
name: Blank Issue
3+
about: Create a blank issue.
4+
---

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Bug Report
3+
about: Create a bug report for Rust.
4+
labels: C-bug
5+
---
6+
<!--
7+
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
8+
along with any information you feel relevant to replicating the bug.
9+
-->
10+
11+
I tried this code:
12+
13+
```rust
14+
<code>
15+
```
16+
17+
I expected to see this happen: *explanation*
18+
19+
Instead, this happened: *explanation*
20+
21+
### Meta
22+
<!--
23+
If you're using the stable version of the compiler, you should also check if the
24+
bug also exists in the beta or nightly versions.
25+
-->
26+
27+
`rustc --version --verbose`:
28+
```
29+
<version>
30+
```
31+
32+
<!--
33+
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
34+
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
35+
-->
36+
<details><summary>Backtrace</summary>
37+
<p>
38+
39+
```
40+
<backtrace>
41+
```
42+
43+
</p>
44+
</details>

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Rust Programming Language Forum
4+
url: https://users.rust-lang.org
5+
about: Please ask and answer questions about Rust here.

.github/ISSUE_TEMPLATE/ice.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: Internal Compiler Error
3+
about: Create a report for an internal compiler error in rustc.
4+
labels: C-bug, I-ICE, T-compiler
5+
---
6+
<!--
7+
Thank you for finding an Internal Compiler Error! 🧊 If possible, try to provide
8+
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
9+
how to create smaller examples.
10+
11+
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
12+
13+
-->
14+
15+
### Code
16+
17+
```
18+
<code>
19+
```
20+
21+
22+
### Meta
23+
<!--
24+
If you're using the stable version of the compiler, you should also check if the
25+
bug also exists in the beta or nightly versions.
26+
-->
27+
28+
`rustc --version --verbose`:
29+
```
30+
<version>
31+
```
32+
33+
### Error output
34+
35+
```
36+
<output>
37+
```
38+
39+
<!--
40+
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
41+
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
42+
-->
43+
<details><summary><strong>Backtrace</strong></summary>
44+
<p>
45+
46+
```
47+
<backtrace>
48+
```
49+
50+
</p>
51+
</details>
52+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Tracking Issue
3+
about: A tracking issue for a feature in Rust.
4+
title: Tracking Issue for XXX
5+
labels: C-tracking-issue
6+
---
7+
<!--
8+
Thank you for creating a tracking issue! 📜 Tracking issues are for tracking a
9+
feature from implementation to stabilisation. Make sure to include the relevant
10+
RFC for the feature if it has one. Otherwise provide a short summary of the
11+
feature and link any relevant PRs or issues, and remove any sections that are
12+
not relevant to the feature.
13+
14+
Remember to add team labels to the tracking issue.
15+
For a language team feature, this would e.g., be `T-lang`.
16+
Such a feature should also be labeled with e.g., `F-my_feature`.
17+
This label is used to associate issues (e.g., bugs and design questions) to the feature.
18+
-->
19+
20+
This is a tracking issue for the RFC "XXX" (rust-lang/rfcs#NNN).
21+
The feature gate for the issue is `#![feature(FFF)]`.
22+
23+
### About tracking issues
24+
25+
Tracking issues are used to record the overall progress of implementation.
26+
They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions.
27+
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
28+
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
29+
30+
### Steps
31+
<!--
32+
Include each step required to complete the feature. Typically this is a PR
33+
implementing a feature, followed by a PR that stabilises the feature. However
34+
for larger features an implementation could be broken up into multiple PRs.
35+
-->
36+
37+
- [ ] Implement the RFC (cc @rust-lang/XXX -- can anyone write up mentoring
38+
instructions?)
39+
- [ ] Adjust documentation ([see instructions on rustc-guide][doc-guide])
40+
- [ ] Stabilization PR ([see instructions on rustc-guide][stabilization-guide])
41+
42+
[stabilization-guide]: https://rust-lang.github.io/rustc-guide/stabilization_guide.html#stabilization-pr
43+
[doc-guide]: https://rust-lang.github.io/rustc-guide/stabilization_guide.html#documentation-prs
44+
45+
### Unresolved Questions
46+
<!--
47+
Include any open questions that need to be answered before the feature can be
48+
stabilised.
49+
-->
50+
51+
XXX --- list all the "unresolved questions" found in the RFC to ensure they are
52+
not forgotten
53+
54+
### Implementation history
55+
56+
<!--
57+
Include a list of all the PRs that were involved in implementing the feature.
58+
-->

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Graydon Hoare <graydon@pobox.com> Graydon Hoare <graydon@mozilla.com>
100100
Guillaume Gomez <guillaume1.gomez@gmail.com>
101101
Guillaume Gomez <guillaume1.gomez@gmail.com> ggomez <ggomez@ggo.ifr.lan>
102102
Guillaume Gomez <guillaume1.gomez@gmail.com> Guillaume Gomez <ggomez@ggo.ifr.lan>
103+
Hanna Kruppe <hanna.kruppe@gmail.com> <robin.kruppe@gmail.com>
103104
Heather <heather@cynede.net> <Cynede@Gentoo.org>
104105
Heather <heather@cynede.net> <Heather@cynede.net>
105106
Herman J. Radtke III <herman@hermanradtke.com> Herman J. Radtke III <hermanradtke@gmail.com>

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3067,6 +3067,7 @@ name = "rustbook"
30673067
version = "0.1.0"
30683068
dependencies = [
30693069
"clap",
3070+
"codespan",
30703071
"codespan-reporting",
30713072
"failure",
30723073
"mdbook",

src/bootstrap/builder.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,13 @@ impl<'a> Builder<'a> {
847847
rustflags.arg("-Zforce-unstable-if-unmarked");
848848
}
849849

850-
rustflags.arg("-Zexternal-macro-backtrace");
850+
// cfg(bootstrap): the flag was renamed from `-Zexternal-macro-backtrace`
851+
// to `-Zmacro-backtrace`, keep only the latter after beta promotion.
852+
if stage == 0 {
853+
rustflags.arg("-Zexternal-macro-backtrace");
854+
} else {
855+
rustflags.arg("-Zmacro-backtrace");
856+
}
851857

852858
let want_rustdoc = self.doc_tests != DocTests::No;
853859

src/doc/rustc-guide

src/doc/unstable-book/src/language-features/generators.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ fn main() {
3737
return "foo"
3838
};
3939

40-
match Pin::new(&mut generator).resume() {
40+
match Pin::new(&mut generator).resume(()) {
4141
GeneratorState::Yielded(1) => {}
4242
_ => panic!("unexpected value from resume"),
4343
}
44-
match Pin::new(&mut generator).resume() {
44+
match Pin::new(&mut generator).resume(()) {
4545
GeneratorState::Complete("foo") => {}
4646
_ => panic!("unexpected value from resume"),
4747
}
@@ -71,9 +71,9 @@ fn main() {
7171
};
7272

7373
println!("1");
74-
Pin::new(&mut generator).resume();
74+
Pin::new(&mut generator).resume(());
7575
println!("3");
76-
Pin::new(&mut generator).resume();
76+
Pin::new(&mut generator).resume(());
7777
println!("5");
7878
}
7979
```
@@ -92,10 +92,10 @@ The `Generator` trait in `std::ops` currently looks like:
9292
# use std::ops::GeneratorState;
9393
# use std::pin::Pin;
9494
95-
pub trait Generator {
95+
pub trait Generator<R = ()> {
9696
type Yield;
9797
type Return;
98-
fn resume(self: Pin<&mut Self>) -> GeneratorState<Self::Yield, Self::Return>;
98+
fn resume(self: Pin<&mut Self>, resume: R) -> GeneratorState<Self::Yield, Self::Return>;
9999
}
100100
```
101101

@@ -152,10 +152,6 @@ closure-like semantics. Namely:
152152
* Whenever a generator is dropped it will drop all captured environment
153153
variables.
154154

155-
Note that unlike closures, generators at this time cannot take any arguments.
156-
That is, generators must always look like `|| { ... }`. This restriction may be
157-
lifted at a future date, the design is ongoing!
158-
159155
### Generators as state machines
160156

161157
In the compiler, generators are currently compiled as state machines. Each
@@ -179,8 +175,8 @@ fn main() {
179175
return ret
180176
};
181177

182-
Pin::new(&mut generator).resume();
183-
Pin::new(&mut generator).resume();
178+
Pin::new(&mut generator).resume(());
179+
Pin::new(&mut generator).resume(());
184180
}
185181
```
186182

@@ -205,7 +201,7 @@ fn main() {
205201
type Yield = i32;
206202
type Return = &'static str;
207203

208-
fn resume(mut self: Pin<&mut Self>) -> GeneratorState<i32, &'static str> {
204+
fn resume(mut self: Pin<&mut Self>, resume: ()) -> GeneratorState<i32, &'static str> {
209205
use std::mem;
210206
match mem::replace(&mut *self, __Generator::Done) {
211207
__Generator::Start(s) => {
@@ -228,8 +224,8 @@ fn main() {
228224
__Generator::Start(ret)
229225
};
230226

231-
Pin::new(&mut generator).resume();
232-
Pin::new(&mut generator).resume();
227+
Pin::new(&mut generator).resume(());
228+
Pin::new(&mut generator).resume(());
233229
}
234230
```
235231

0 commit comments

Comments
 (0)