Skip to content

Commit 8d7d7b5

Browse files
committed
---
yaml --- r: 275286 b: refs/heads/stable c: 095f5e7 h: refs/heads/master
1 parent b161a85 commit 8d7d7b5

File tree

13 files changed

+114
-47
lines changed

13 files changed

+114
-47
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 0b3bc9b5e29ba867172120361fb32716fdb99e30
32+
refs/heads/stable: 095f5e7c81ae2894bdad8b614297b281b67fd2fc
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/RELEASES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ Libraries
7575
improved by using `memchr` to search for newlines][1.7m].
7676
* [`f32::to_degrees` and `f32::to_radians` are stable][1.7f]. The
7777
`f64` variants were stabilized previously.
78-
* [`BTreeMap` was rewritten to use less memory improve performance of
79-
insertion and iteration, the latter by as much as 5x`][1.7bm].
78+
* [`BTreeMap` was rewritten to use less memory and improve the performance
79+
of insertion and iteration, the latter by as much as 5x`][1.7bm].
8080
* [`BTreeSet` and its iterators, `Iter`, `IntoIter`, and `Range` are
8181
covariant over their contained type][1.7bt].
8282
* [`LinkedList` and its iterators, `Iter` and `IntoIter` are covariant

branches/stable/src/doc/book/const-and-static.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ unsafe {
6464

6565
[unsafe]: unsafe.html
6666

67-
Furthermore, any type stored in a `static` must be `Sync`, and may not have
67+
Furthermore, any type stored in a `static` must be `Sync`, and must not have
6868
a [`Drop`][drop] implementation.
6969

7070
[drop]: drop.html
7171

7272
# Initializing
7373

74-
Both `const` and `static` have requirements for giving them a value. They may
75-
only be given a value that’s a constant expression. In other words, you cannot
76-
use the result of a function call or anything similarly complex or at runtime.
74+
Both `const` and `static` have requirements for giving them a value. They must
75+
be given a value that’s a constant expression. In other words, you cannot use
76+
the result of a function call or anything similarly complex or at runtime.
7777

7878
# Which construct should I use?
7979

branches/stable/src/doc/book/guessing-game.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -906,17 +906,17 @@ let guess: u32 = match guess.trim().parse() {
906906
Err(_) => continue,
907907
};
908908
```
909-
910909
This is how you generally move from ‘crash on error’ to ‘actually handle the
911-
error’, by switching from `expect()` to a `match` statement. The `Result`
912-
returned by `parse()` is an `enum` like `Ordering`, but in this case, each
913-
variant has some data associated with it: `Ok` is a success, and `Err` is a
910+
error’, by switching from `expect()` to a `match` statement. A `Result` is
911+
returned by `parse()`, this is an `enum` like `Ordering`, but in this case,
912+
each variant has some data associated with it: `Ok` is a success, and `Err` is a
914913
failure. Each contains more information: the successfully parsed integer, or an
915-
error type. In this case, we `match` on `Ok(num)`, which sets the inner value
916-
of the `Ok` to the name `num`, and then we return it on the right-hand
917-
side. In the `Err` case, we don’t care what kind of error it is, so we
918-
use `_` instead of a name. This ignores the error, and `continue` causes us
919-
to go to the next iteration of the `loop`.
914+
error type. In this case, we `match` on `Ok(num)`, which sets the name `num` to
915+
the unwrapped `Ok` value (ythe integer), and then we return it on the
916+
right-hand side. In the `Err` case, we don’t care what kind of error it is, so
917+
we just use the catch all `_` instead of a name. This catches everything that
918+
isn't `Ok`, and `continue` lets us move to the next iteration of the loop; in
919+
effect, this enables us to ignore all errors and continue with our program.
920920
921921
Now we should be good! Let’s try:
922922

branches/stable/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3040,7 +3040,7 @@ the case of a `while` loop, the head is the conditional expression controlling
30403040
the loop. In the case of a `for` loop, the head is the call-expression
30413041
controlling the loop. If the label is present, then `continue 'foo` returns
30423042
control to the head of the loop with label `'foo`, which need not be the
3043-
innermost label enclosing the `break` expression, but must enclose it.
3043+
innermost label enclosing the `continue` expression, but must enclose it.
30443044

30453045
A `continue` expression is only permitted in the body of a loop.
30463046

branches/stable/src/libcollections/str.rs

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,11 @@ impl str {
267267
/// Converts a string slice to a raw pointer.
268268
///
269269
/// As string slices are a slice of bytes, the raw pointer points to a
270-
/// `u8`. This pointer will be pointing to the first byte of the string
270+
/// [`u8`]. This pointer will be pointing to the first byte of the string
271271
/// slice.
272272
///
273+
/// [`u8`]: primitive.u8.html
274+
///
273275
/// # Examples
274276
///
275277
/// Basic usage:
@@ -661,7 +663,7 @@ impl str {
661663
/// assert_eq!(None, chars.next());
662664
/// ```
663665
///
664-
/// Remember, `char`s may not match your human intuition about characters:
666+
/// Remember, [`char`]s may not match your human intuition about characters:
665667
///
666668
/// ```
667669
/// let y = "y̆";
@@ -678,16 +680,18 @@ impl str {
678680
pub fn chars(&self) -> Chars {
679681
core_str::StrExt::chars(self)
680682
}
681-
/// Returns an iterator over the `char`s of a string slice, and their
683+
/// Returns an iterator over the [`char`]s of a string slice, and their
682684
/// positions.
683685
///
684686
/// As a string slice consists of valid UTF-8, we can iterate through a
685-
/// string slice by `char`. This method returns an iterator of both
686-
/// these `char`s, as well as their byte positions.
687+
/// string slice by [`char`]. This method returns an iterator of both
688+
/// these [`char`]s, as well as their byte positions.
687689
///
688-
/// The iterator yields tuples. The position is first, the `char` is
690+
/// The iterator yields tuples. The position is first, the [`char`] is
689691
/// second.
690692
///
693+
/// [`char`]: primitive.char.html
694+
///
691695
/// # Examples
692696
///
693697
/// Basic usage:
@@ -711,7 +715,7 @@ impl str {
711715
/// assert_eq!(None, char_indices.next());
712716
/// ```
713717
///
714-
/// Remember, `char`s may not match your human intuition about characters:
718+
/// Remember, [`char`]s may not match your human intuition about characters:
715719
///
716720
/// ```
717721
/// let y = "y̆";
@@ -918,12 +922,13 @@ impl str {
918922
/// Returns the byte index of the first character of this string slice that
919923
/// matches the pattern.
920924
///
921-
/// Returns `None` if the pattern doesn't match.
925+
/// Returns [`None`] if the pattern doesn't match.
922926
///
923927
/// The pattern can be a `&str`, [`char`], or a closure that determines if
924928
/// a character matches.
925929
///
926930
/// [`char`]: primitive.char.html
931+
/// [`None`]: option/enum.Option.html#variant.None
927932
///
928933
/// # Examples
929934
///
@@ -962,12 +967,13 @@ impl str {
962967
/// Returns the byte index of the last character of this string slice that
963968
/// matches the pattern.
964969
///
965-
/// Returns `None` if the pattern doesn't match.
970+
/// Returns [`None`] if the pattern doesn't match.
966971
///
967972
/// The pattern can be a `&str`, [`char`], or a closure that determines if
968973
/// a character matches.
969974
///
970975
/// [`char`]: primitive.char.html
976+
/// [`None`]: option/enum.Option.html#variant.None
971977
///
972978
/// # Examples
973979
///
@@ -1187,14 +1193,18 @@ impl str {
11871193
/// An iterator over substrings of `self`, separated by characters
11881194
/// matched by a pattern and yielded in reverse order.
11891195
///
1190-
/// The pattern can be a simple `&str`, `char`, or a closure that
1196+
/// The pattern can be a simple `&str`, [`char`], or a closure that
11911197
/// determines the split.
11921198
/// Additional libraries might provide more complex patterns like
11931199
/// regular expressions.
11941200
///
1195-
/// Equivalent to `split`, except that the trailing substring is
1201+
/// [`char`]: primitive.char.html
1202+
///
1203+
/// Equivalent to [`split()`], except that the trailing substring is
11961204
/// skipped if empty.
11971205
///
1206+
/// [`split()`]: #method.split
1207+
///
11981208
/// This method can be used for string data that is _terminated_,
11991209
/// rather than _separated_ by a pattern.
12001210
///
@@ -1457,7 +1467,7 @@ impl str {
14571467
/// # Iterator behavior
14581468
///
14591469
/// The returned iterator requires that the pattern supports a reverse
1460-
/// search, and it will be a `[DoubleEndedIterator]` if a forward/reverse
1470+
/// search, and it will be a [`DoubleEndedIterator`] if a forward/reverse
14611471
/// search yields the same elements.
14621472
///
14631473
/// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
@@ -1694,9 +1704,11 @@ impl str {
16941704
///
16951705
/// # Errors
16961706
///
1697-
/// Will return `Err` if it's not possible to parse this string slice into
1707+
/// Will return [`Err`] if it's not possible to parse this string slice into
16981708
/// the desired type.
16991709
///
1710+
/// [`Err`]: str/trait.FromStr.html#associatedtype.Err
1711+
///
17001712
/// # Example
17011713
///
17021714
/// Basic usage
@@ -1707,7 +1719,7 @@ impl str {
17071719
/// assert_eq!(4, four);
17081720
/// ```
17091721
///
1710-
/// Using the 'turbofish' instead of annotationg `four`:
1722+
/// Using the 'turbofish' instead of annotating `four`:
17111723
///
17121724
/// ```
17131725
/// let four = "4".parse::<u32>();
@@ -1765,11 +1777,13 @@ impl str {
17651777
result
17661778
}
17671779

1768-
/// Returns the lowercase equivalent of this string slice, as a new `String`.
1780+
/// Returns the lowercase equivalent of this string slice, as a new [`String`].
17691781
///
17701782
/// 'Lowercase' is defined according to the terms of the Unicode Derived Core Property
17711783
/// `Lowercase`.
17721784
///
1785+
/// [`String`]: string/struct.String.html
1786+
///
17731787
/// # Examples
17741788
///
17751789
/// Basic usage:
@@ -1839,11 +1853,13 @@ impl str {
18391853
}
18401854
}
18411855

1842-
/// Returns the uppercase equivalent of this string slice, as a new `String`.
1856+
/// Returns the uppercase equivalent of this string slice, as a new [`String`].
18431857
///
18441858
/// 'Uppercase' is defined according to the terms of the Unicode Derived Core Property
18451859
/// `Uppercase`.
18461860
///
1861+
/// [`String`]: string/struct.String.html
1862+
///
18471863
/// # Examples
18481864
///
18491865
/// Basic usage:
@@ -1884,7 +1900,9 @@ impl str {
18841900
self.chars().flat_map(|c| c.escape_unicode()).collect()
18851901
}
18861902

1887-
/// Converts a `Box<str>` into a `String` without copying or allocating.
1903+
/// Converts a `Box<str>` into a [`String`] without copying or allocating.
1904+
///
1905+
/// [`String`]: string/struct.String.html
18881906
///
18891907
/// # Examples
18901908
///

branches/stable/src/libcore/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
//! ```
190190
//! let values = vec![1, 2, 3, 4, 5];
191191
//! {
192-
//! let result = match values.into_iter() {
192+
//! let result = match IntoIterator::into_iter(values) {
193193
//! mut iter => loop {
194194
//! match iter.next() {
195195
//! Some(x) => { println!("{}", x); },

branches/stable/src/librustc/lint/context.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ impl<'a, 'tcx, 'v> hir_visit::Visitor<'v> for LateContext<'a, 'tcx> {
766766
self.with_lint_attrs(&it.attrs, |cx| {
767767
run_lints!(cx, check_foreign_item, late_passes, it);
768768
hir_visit::walk_foreign_item(cx, it);
769+
run_lints!(cx, check_foreign_item_post, late_passes, it);
769770
})
770771
}
771772

@@ -795,6 +796,7 @@ impl<'a, 'tcx, 'v> hir_visit::Visitor<'v> for LateContext<'a, 'tcx> {
795796
body: &'v hir::Block, span: Span, id: ast::NodeId) {
796797
run_lints!(self, check_fn, late_passes, fk, decl, body, span, id);
797798
hir_visit::walk_fn(self, fk, decl, body, span);
799+
run_lints!(self, check_fn_post, late_passes, fk, decl, body, span, id);
798800
}
799801

800802
fn visit_variant_data(&mut self,
@@ -835,6 +837,7 @@ impl<'a, 'tcx, 'v> hir_visit::Visitor<'v> for LateContext<'a, 'tcx> {
835837
fn visit_mod(&mut self, m: &hir::Mod, s: Span, n: ast::NodeId) {
836838
run_lints!(self, check_mod, late_passes, m, s, n);
837839
hir_visit::walk_mod(self, m);
840+
run_lints!(self, check_mod_post, late_passes, m, s, n);
838841
}
839842

840843
fn visit_local(&mut self, l: &hir::Local) {
@@ -874,6 +877,7 @@ impl<'a, 'tcx, 'v> hir_visit::Visitor<'v> for LateContext<'a, 'tcx> {
874877
run_lints!(cx, check_trait_item, late_passes, trait_item);
875878
cx.visit_ids(|v| v.visit_trait_item(trait_item));
876879
hir_visit::walk_trait_item(cx, trait_item);
880+
run_lints!(cx, check_trait_item_post, late_passes, trait_item);
877881
});
878882
}
879883

@@ -882,6 +886,7 @@ impl<'a, 'tcx, 'v> hir_visit::Visitor<'v> for LateContext<'a, 'tcx> {
882886
run_lints!(cx, check_impl_item, late_passes, impl_item);
883887
cx.visit_ids(|v| v.visit_impl_item(impl_item));
884888
hir_visit::walk_impl_item(cx, impl_item);
889+
run_lints!(cx, check_impl_item_post, late_passes, impl_item);
885890
});
886891
}
887892

@@ -928,6 +933,7 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
928933
self.with_lint_attrs(&it.attrs, |cx| {
929934
run_lints!(cx, check_foreign_item, early_passes, it);
930935
ast_visit::walk_foreign_item(cx, it);
936+
run_lints!(cx, check_foreign_item_post, early_passes, it);
931937
})
932938
}
933939

@@ -952,6 +958,7 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
952958
body: &'v ast::Block, span: Span, id: ast::NodeId) {
953959
run_lints!(self, check_fn, early_passes, fk, decl, body, span, id);
954960
ast_visit::walk_fn(self, fk, decl, body, span);
961+
run_lints!(self, check_fn_post, early_passes, fk, decl, body, span, id);
955962
}
956963

957964
fn visit_variant_data(&mut self,
@@ -992,6 +999,7 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
992999
fn visit_mod(&mut self, m: &ast::Mod, s: Span, n: ast::NodeId) {
9931000
run_lints!(self, check_mod, early_passes, m, s, n);
9941001
ast_visit::walk_mod(self, m);
1002+
run_lints!(self, check_mod_post, early_passes, m, s, n);
9951003
}
9961004

9971005
fn visit_local(&mut self, l: &ast::Local) {
@@ -1031,6 +1039,7 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
10311039
run_lints!(cx, check_trait_item, early_passes, trait_item);
10321040
cx.visit_ids(|v| v.visit_trait_item(trait_item));
10331041
ast_visit::walk_trait_item(cx, trait_item);
1042+
run_lints!(cx, check_trait_item_post, early_passes, trait_item);
10341043
});
10351044
}
10361045

@@ -1039,6 +1048,7 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
10391048
run_lints!(cx, check_impl_item, early_passes, impl_item);
10401049
cx.visit_ids(|v| v.visit_impl_item(impl_item));
10411050
ast_visit::walk_impl_item(cx, impl_item);
1051+
run_lints!(cx, check_impl_item_post, early_passes, impl_item);
10421052
});
10431053
}
10441054

branches/stable/src/librustc/lint/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ pub trait LateLintPass: LintPass {
134134
fn check_crate(&mut self, _: &LateContext, _: &hir::Crate) { }
135135
fn check_crate_post(&mut self, _: &LateContext, _: &hir::Crate) { }
136136
fn check_mod(&mut self, _: &LateContext, _: &hir::Mod, _: Span, _: ast::NodeId) { }
137+
fn check_mod_post(&mut self, _: &LateContext, _: &hir::Mod, _: Span, _: ast::NodeId) { }
137138
fn check_foreign_item(&mut self, _: &LateContext, _: &hir::ForeignItem) { }
139+
fn check_foreign_item_post(&mut self, _: &LateContext, _: &hir::ForeignItem) { }
138140
fn check_item(&mut self, _: &LateContext, _: &hir::Item) { }
139141
fn check_item_post(&mut self, _: &LateContext, _: &hir::Item) { }
140142
fn check_local(&mut self, _: &LateContext, _: &hir::Local) { }
@@ -150,8 +152,12 @@ pub trait LateLintPass: LintPass {
150152
fn check_generics(&mut self, _: &LateContext, _: &hir::Generics) { }
151153
fn check_fn(&mut self, _: &LateContext,
152154
_: FnKind, _: &hir::FnDecl, _: &hir::Block, _: Span, _: ast::NodeId) { }
155+
fn check_fn_post(&mut self, _: &LateContext,
156+
_: FnKind, _: &hir::FnDecl, _: &hir::Block, _: Span, _: ast::NodeId) { }
153157
fn check_trait_item(&mut self, _: &LateContext, _: &hir::TraitItem) { }
158+
fn check_trait_item_post(&mut self, _: &LateContext, _: &hir::TraitItem) { }
154159
fn check_impl_item(&mut self, _: &LateContext, _: &hir::ImplItem) { }
160+
fn check_impl_item_post(&mut self, _: &LateContext, _: &hir::ImplItem) { }
155161
fn check_struct_def(&mut self, _: &LateContext,
156162
_: &hir::VariantData, _: ast::Name, _: &hir::Generics, _: ast::NodeId) { }
157163
fn check_struct_def_post(&mut self, _: &LateContext,
@@ -179,7 +185,9 @@ pub trait EarlyLintPass: LintPass {
179185
fn check_crate(&mut self, _: &EarlyContext, _: &ast::Crate) { }
180186
fn check_crate_post(&mut self, _: &EarlyContext, _: &ast::Crate) { }
181187
fn check_mod(&mut self, _: &EarlyContext, _: &ast::Mod, _: Span, _: ast::NodeId) { }
188+
fn check_mod_post(&mut self, _: &EarlyContext, _: &ast::Mod, _: Span, _: ast::NodeId) { }
182189
fn check_foreign_item(&mut self, _: &EarlyContext, _: &ast::ForeignItem) { }
190+
fn check_foreign_item_post(&mut self, _: &EarlyContext, _: &ast::ForeignItem) { }
183191
fn check_item(&mut self, _: &EarlyContext, _: &ast::Item) { }
184192
fn check_item_post(&mut self, _: &EarlyContext, _: &ast::Item) { }
185193
fn check_local(&mut self, _: &EarlyContext, _: &ast::Local) { }
@@ -195,8 +203,12 @@ pub trait EarlyLintPass: LintPass {
195203
fn check_generics(&mut self, _: &EarlyContext, _: &ast::Generics) { }
196204
fn check_fn(&mut self, _: &EarlyContext,
197205
_: ast_visit::FnKind, _: &ast::FnDecl, _: &ast::Block, _: Span, _: ast::NodeId) { }
206+
fn check_fn_post(&mut self, _: &EarlyContext,
207+
_: ast_visit::FnKind, _: &ast::FnDecl, _: &ast::Block, _: Span, _: ast::NodeId) { }
198208
fn check_trait_item(&mut self, _: &EarlyContext, _: &ast::TraitItem) { }
209+
fn check_trait_item_post(&mut self, _: &EarlyContext, _: &ast::TraitItem) { }
199210
fn check_impl_item(&mut self, _: &EarlyContext, _: &ast::ImplItem) { }
211+
fn check_impl_item_post(&mut self, _: &EarlyContext, _: &ast::ImplItem) { }
200212
fn check_struct_def(&mut self, _: &EarlyContext,
201213
_: &ast::VariantData, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { }
202214
fn check_struct_def_post(&mut self, _: &EarlyContext,

0 commit comments

Comments
 (0)