Skip to content

Commit 042040a

Browse files
committed
---
yaml --- r: 234389 b: refs/heads/tmp c: 201bfbe h: refs/heads/master i: 234387: 8a7d621 v: v3
1 parent 1482a7b commit 042040a

File tree

8 files changed

+38
-65
lines changed

8 files changed

+38
-65
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: a269e31a30446bb0dc4ae36d170e507e31188bfe
28+
refs/heads/tmp: 201bfbe55e6852cc41160f29b617439c7098a128
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: ab792abf1fcc28afbd315426213f6428da25c085
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/src/doc/index.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,28 @@ series of small examples.
2020

2121
[rbe]: http://rustbyexample.com/
2222

23+
# Specification
24+
25+
Rust does not have an exact specification, but an effort to describe as much of
26+
the language in as much detail as possible is in [the reference](reference.html).
27+
2328
# The Standard Library
2429

2530
We have [API documentation for the entire standard
2631
library](std/index.html). There's a list of crates on the left with more
2732
specific sections, or you can use the search bar at the top to search for
2833
something if you know its name.
2934

35+
# Tools
36+
37+
Rust is still a young language, so there isn't a ton of tooling yet, but the
38+
tools we have are really nice.
39+
40+
[Cargo](https://crates.io) is Rust's package manager, and its website contains
41+
lots of good documentation.
42+
43+
[`rustdoc`](book/documentation.html) is used to generate documentation for Rust code.
44+
3045
# Community & Getting Help
3146

3247
If you need help with something, or just want to talk about Rust with others,
@@ -54,25 +69,10 @@ There is an active [subreddit](https://reddit.com/r/rust) with lots of
5469
discussion and news about Rust.
5570

5671
There is also a [user forum](https://users.rust-lang.org), for all
57-
user-oriented discussion, and a [developer
72+
user-oriented discussion, and a [developer
5873
forum](https://internals.rust-lang.org/), where the development of Rust
5974
itself is discussed.
6075

61-
# Specification
62-
63-
Rust does not have an exact specification, but an effort to describe as much of
64-
the language in as much detail as possible is in [the reference](reference.html).
65-
66-
# Tools
67-
68-
Rust is still a young language, so there isn't a ton of tooling yet, but the
69-
tools we have are really nice.
70-
71-
[Cargo](https://crates.io) is Rust's package manager, and its website contains
72-
lots of good documentation.
73-
74-
[`rustdoc`](book/documentation.html) is used to generate documentation for Rust code.
75-
7676
# FAQs
7777

7878
There are questions that are asked quite often, so we've made FAQs for them:

branches/tmp/src/doc/nomicon/vec-drain.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,14 @@ impl<'a, T> Drop for Drain<'a, T> {
129129
130130
impl<T> Vec<T> {
131131
pub fn drain(&mut self) -> Drain<T> {
132-
unsafe {
133-
let iter = RawValIter::new(&self);
134-
135-
// this is a mem::forget safety thing. If Drain is forgotten, we just
136-
// leak the whole Vec's contents. Also we need to do this *eventually*
137-
// anyway, so why not do it now?
138-
self.len = 0;
132+
// this is a mem::forget safety thing. If Drain is forgotten, we just
133+
// leak the whole Vec's contents. Also we need to do this eventually
134+
// anyway, so why not do it now?
135+
self.len = 0;
139136
137+
unsafe {
140138
Drain {
141-
iter: iter,
139+
iter: RawValIter::new(&self),
142140
vec: PhantomData,
143141
}
144142
}

branches/tmp/src/doc/nomicon/vec-final.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,13 @@ impl<T> Vec<T> {
155155
}
156156

157157
pub fn drain(&mut self) -> Drain<T> {
158+
// this is a mem::forget safety thing. If this is forgotten, we just
159+
// leak the whole Vec's contents. Also we need to do this *eventually*
160+
// anyway, so why not do it now?
161+
self.len = 0;
158162
unsafe {
159-
let iter = RawValIter::new(&self);
160-
161-
// this is a mem::forget safety thing. If Drain is forgotten, we just
162-
// leak the whole Vec's contents. Also we need to do this *eventually*
163-
// anyway, so why not do it now?
164-
self.len = 0;
165-
166163
Drain {
167-
iter: iter,
164+
iter: RawValIter::new(&self),
168165
vec: PhantomData,
169166
}
170167
}

branches/tmp/src/doc/trpl/macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ fn main() {
313313
}
314314
```
315315

316-
This works because Rust has a [hygienic macro system][https://en.wikipedia.org/wiki/Hygienic_macro]. Each macro expansion
316+
This works because Rust has a [hygienic macro system][]. Each macro expansion
317317
happens in a distinct ‘syntax context’, and each variable is tagged with the
318318
syntax context where it was introduced. It’s as though the variable `state`
319319
inside `main` is painted a different "color" from the variable `state` inside

branches/tmp/src/librustc/middle/region.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,7 @@ impl RegionMaps {
317317
self.intern_code_extent(e, DUMMY_CODE_EXTENT)
318318
}
319319
pub fn lookup_code_extent(&self, e: CodeExtentData) -> CodeExtent {
320-
match self.code_extent_interner.borrow().get(&e) {
321-
Some(&d) => d,
322-
None => panic!("unknown code extent {:?}", e)
323-
}
320+
self.code_extent_interner.borrow()[&e]
324321
}
325322
pub fn node_extent(&self, n: ast::NodeId) -> CodeExtent {
326323
self.lookup_code_extent(CodeExtentData::Misc(n))
@@ -1072,7 +1069,7 @@ fn resolve_item(visitor: &mut RegionResolutionVisitor, item: &hir::Item) {
10721069
}
10731070

10741071
fn resolve_fn(visitor: &mut RegionResolutionVisitor,
1075-
kind: FnKind,
1072+
_: FnKind,
10761073
decl: &hir::FnDecl,
10771074
body: &hir::Block,
10781075
sp: Span,
@@ -1105,7 +1102,6 @@ fn resolve_fn(visitor: &mut RegionResolutionVisitor,
11051102
};
11061103

11071104
visit::walk_fn_decl(visitor, decl);
1108-
visit::walk_fn_kind(visitor, kind);
11091105

11101106
// The body of the every fn is a root scope.
11111107
visitor.cx = Context {

branches/tmp/src/librustc_front/visit.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,13 @@ pub fn walk_fn_decl<'v, V: Visitor<'v>>(visitor: &mut V, function_declaration: &
580580
walk_fn_ret_ty(visitor, &function_declaration.output)
581581
}
582582

583-
pub fn walk_fn_kind<'v, V: Visitor<'v>>(visitor: &mut V,
584-
function_kind: FnKind<'v>) {
583+
pub fn walk_fn<'v, V: Visitor<'v>>(visitor: &mut V,
584+
function_kind: FnKind<'v>,
585+
function_declaration: &'v FnDecl,
586+
function_body: &'v Block,
587+
_span: Span) {
588+
walk_fn_decl(visitor, function_declaration);
589+
585590
match function_kind {
586591
FnKind::ItemFn(_, generics, _, _, _, _) => {
587592
visitor.visit_generics(generics);
@@ -592,15 +597,7 @@ pub fn walk_fn_kind<'v, V: Visitor<'v>>(visitor: &mut V,
592597
}
593598
FnKind::Closure(..) => {}
594599
}
595-
}
596600

597-
pub fn walk_fn<'v, V: Visitor<'v>>(visitor: &mut V,
598-
function_kind: FnKind<'v>,
599-
function_declaration: &'v FnDecl,
600-
function_body: &'v Block,
601-
_span: Span) {
602-
walk_fn_decl(visitor, function_declaration);
603-
walk_fn_kind(visitor, function_kind);
604601
visitor.visit_block(function_body)
605602
}
606603

branches/tmp/src/test/run-pass/issue-28181.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)