Skip to content

Commit fe81211

Browse files
committed
---
yaml --- r: 212920 b: refs/heads/master c: 1035645 h: refs/heads/master v: v3
1 parent cd5f062 commit fe81211

File tree

6 files changed

+23
-27
lines changed

6 files changed

+23
-27
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: b87056fa31b4c5926c2a0ad78613cf6387f8fdba
2+
refs/heads/master: 10356458a7299066b20c4282368af2f76a17ea52
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
55
refs/heads/try: 1864973ae17213c5a58c4dd3f9af6d1b6c7d2e05

trunk/src/doc/reference.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -928,21 +928,20 @@ A _generic function_ allows one or more _parameterized types_ to appear in its
928928
signature. Each type parameter must be explicitly declared, in an
929929
angle-bracket-enclosed, comma-separated list following the function name.
930930

931-
```{.ignore}
932-
fn iter<T, F>(seq: &[T], f: F) where T: Copy, F: Fn(T) {
933-
for elt in seq { f(*elt); }
934-
}
935-
fn map<T, U, F>(seq: &[T], f: F) -> Vec<U> where T: Copy, U: Copy, F: Fn(T) -> U {
936-
let mut acc = vec![];
937-
for elt in seq { acc.push(f(*elt)); }
938-
acc
939-
}
931+
```rust,ignore
932+
// foo is generic over A and B
933+
934+
fn foo<A, B>(x: A, y: B) {
940935
```
941936

942937
Inside the function signature and body, the name of the type parameter can be
943938
used as a type name. [Trait](#traits) bounds can be specified for type parameters
944939
to allow methods with that trait to be called on values of that type. This is
945-
specified using the `where` syntax, as in the above example.
940+
specified using the `where` syntax:
941+
942+
```rust,ignore
943+
fn foo<T>(x: T) where T: Debug {
944+
```
946945

947946
When a generic function is referenced, its type is instantiated based on the
948947
context of the reference. For example, calling the `iter` function defined

trunk/src/doc/trpl/closures.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ let y = &mut num;
120120
```
121121

122122
If your closure requires it, however, Rust will take ownership and move
123-
the environment instead:
123+
the environment instead. This doesn’t work:
124124

125125
```rust,ignore
126126
let nums = vec![1, 2, 3];
@@ -130,7 +130,7 @@ let takes_nums = || nums;
130130
println!("{:?}", nums);
131131
```
132132

133-
This gives us:
133+
We get this error:
134134

135135
```text
136136
note: `nums` moved into closure environment here because it has type

trunk/src/doc/trpl/trait-objects.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,3 @@ let y = TraitObject {
300300
// y.method();
301301
(y.vtable.method)(y.data);
302302
```
303-
304-
If `b` or `y` were owning trait objects (`Box<Foo>`), there would be a
305-
`(b.vtable.destructor)(b.data)` (respectively `y`) call when they went out of
306-
scope.

trunk/src/libcore/str/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,10 @@ impl<'a, P: Pattern<'a>> SplitInternal<'a, P> {
638638

639639
generate_pattern_iterators! {
640640
forward:
641-
/// Created with the method `.split()`.
641+
#[doc="Created with the method `.split()`."]
642642
struct Split;
643643
reverse:
644-
/// Created with the method `.rsplit()`.
644+
#[doc="Created with the method `.rsplit()`."]
645645
struct RSplit;
646646
stability:
647647
#[stable(feature = "rust1", since = "1.0.0")]
@@ -652,10 +652,10 @@ generate_pattern_iterators! {
652652

653653
generate_pattern_iterators! {
654654
forward:
655-
/// Created with the method `.split_terminator()`.
655+
#[doc="Created with the method `.split_terminator()`."]
656656
struct SplitTerminator;
657657
reverse:
658-
/// Created with the method `.rsplit_terminator()`.
658+
#[doc="Created with the method `.rsplit_terminator()`."]
659659
struct RSplitTerminator;
660660
stability:
661661
#[stable(feature = "rust1", since = "1.0.0")]
@@ -698,10 +698,10 @@ impl<'a, P: Pattern<'a>> SplitNInternal<'a, P> {
698698

699699
generate_pattern_iterators! {
700700
forward:
701-
/// Created with the method `.splitn()`.
701+
#[doc="Created with the method `.splitn()`."]
702702
struct SplitN;
703703
reverse:
704-
/// Created with the method `.rsplitn()`.
704+
#[doc="Created with the method `.rsplitn()`."]
705705
struct RSplitN;
706706
stability:
707707
#[stable(feature = "rust1", since = "1.0.0")]
@@ -732,10 +732,10 @@ impl<'a, P: Pattern<'a>> MatchIndicesInternal<'a, P> {
732732

733733
generate_pattern_iterators! {
734734
forward:
735-
/// Created with the method `.match_indices()`.
735+
#[doc="Created with the method `.match_indices()`."]
736736
struct MatchIndices;
737737
reverse:
738-
/// Created with the method `.rmatch_indices()`.
738+
#[doc="Created with the method `.rmatch_indices()`."]
739739
struct RMatchIndices;
740740
stability:
741741
#[unstable(feature = "core",
@@ -773,10 +773,10 @@ impl<'a, P: Pattern<'a>> MatchesInternal<'a, P> {
773773

774774
generate_pattern_iterators! {
775775
forward:
776-
/// Created with the method `.matches()`.
776+
#[doc="Created with the method `.matches()`."]
777777
struct Matches;
778778
reverse:
779-
/// Created with the method `.rmatches()`.
779+
#[doc="Created with the method `.rmatches()`."]
780780
struct RMatches;
781781
stability:
782782
#[unstable(feature = "core", reason = "type got recently added")]

trunk/src/librustc_back/sha2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ pub struct Sha256 {
482482

483483
impl Sha256 {
484484
/// Construct a new instance of a SHA-256 digest.
485+
/// Do not – under any circumstances – use this where timing attacks might be possible!
485486
pub fn new() -> Sha256 {
486487
Sha256 {
487488
engine: Engine256::new(&H256)

0 commit comments

Comments
 (0)