Skip to content

Commit 9d8e3a0

Browse files
committed
Auto merge of #31416 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #31007, #31396, #31401, #31411, #31412, #31413, #31415 - Failed merges:
2 parents c007e4a + 96d866a commit 9d8e3a0

File tree

6 files changed

+35
-14
lines changed

6 files changed

+35
-14
lines changed

COPYRIGHT

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terms.
66

77
Longer version:
88

9-
The Rust Project is copyright 2016, The Rust Project
9+
The Rust Project is copyright 2010, The Rust Project
1010
Developers.
1111

1212
Licensed under the Apache License, Version 2.0

LICENSE-MIT

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2016 The Rust Project Developers
1+
Copyright (c) 2010 The Rust Project Developers
22

33
Permission is hereby granted, free of charge, to any
44
person obtaining a copy of this software and associated

src/doc/grammar.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ struct_expr : expr_path '{' ident ':' expr
516516
### Block expressions
517517

518518
```antlr
519-
block_expr : '{' [ stmt ';' | item ] *
519+
block_expr : '{' [ stmt | item ] *
520520
[ expr ] '}' ;
521521
```
522522

src/doc/reference.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,8 @@ fn first((value, _): (i32, i32)) -> i32 { value }
984984
#### Generic functions
985985

986986
A _generic function_ allows one or more _parameterized types_ to appear in its
987-
signature. Each type parameter must be explicitly declared, in an
988-
angle-bracket-enclosed, comma-separated list following the function name.
987+
signature. Each type parameter must be explicitly declared in an
988+
angle-bracket-enclosed and comma-separated list, following the function name.
989989

990990
```rust,ignore
991991
// foo is generic over A and B
@@ -1179,7 +1179,7 @@ Enumeration constructors can have either named or unnamed fields:
11791179
```rust
11801180
enum Animal {
11811181
Dog (String, f64),
1182-
Cat { name: String, weight: f64 }
1182+
Cat { name: String, weight: f64 },
11831183
}
11841184

11851185
let mut a: Animal = Animal::Dog("Cocoa".to_string(), 37.2);
@@ -1237,12 +1237,12 @@ const STRING: &'static str = "bitstring";
12371237
12381238
struct BitsNStrings<'a> {
12391239
mybits: [u32; 2],
1240-
mystring: &'a str
1240+
mystring: &'a str,
12411241
}
12421242
12431243
const BITS_N_STRINGS: BitsNStrings<'static> = BitsNStrings {
12441244
mybits: BITS,
1245-
mystring: STRING
1245+
mystring: STRING,
12461246
};
12471247
```
12481248

@@ -1661,7 +1661,7 @@ struct Foo;
16611661
16621662
// Declare a public struct with a private field
16631663
pub struct Bar {
1664-
field: i32
1664+
field: i32,
16651665
}
16661666
16671667
// Declare a public enum with two public variants
@@ -3212,7 +3212,7 @@ may refer to the variables bound within the pattern they follow.
32123212
let message = match maybe_digit {
32133213
Some(x) if x < 10 => process_digit(x),
32143214
Some(x) => process_other(x),
3215-
None => panic!()
3215+
None => panic!(),
32163216
};
32173217
```
32183218

@@ -3504,7 +3504,7 @@ An example of a `fn` type:
35043504

35053505
```
35063506
fn add(x: i32, y: i32) -> i32 {
3507-
return x + y;
3507+
x + y
35083508
}
35093509
35103510
let mut x = add(5,7);

src/libstd/ascii.rs

+21
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@ use mem;
1818
use ops::Range;
1919

2020
/// Extension methods for ASCII-subset only operations on string slices.
21+
///
22+
/// Be aware that operations on seemingly non-ASCII characters can sometimes
23+
/// have unexpected results. Consider this example:
24+
///
25+
/// ```
26+
/// use std::ascii::AsciiExt;
27+
///
28+
/// assert_eq!("café".to_ascii_uppercase(), "CAFÉ");
29+
/// assert_eq!("café".to_ascii_uppercase(), "CAFé");
30+
/// ```
31+
///
32+
/// In the first example, the lowercased string is represented `"cafe\u{301}"`
33+
/// (the last character is an acute accent [combining character]). Unlike the
34+
/// other characters in the string, the combining character will not get mapped
35+
/// to an uppercase variant, resulting in `"CAFE\u{301}"`. In the second
36+
/// example, the lowercased string is represented `"caf\u{e9}"` (the last
37+
/// character is a single Unicode character representing an 'e' with an acute
38+
/// accent). Since the last character is defined outside the scope of ASCII,
39+
/// it will not get mapped to an uppercase variant, resulting in `"CAF\u{e9}"`.
40+
///
41+
/// [combining character]: https://en.wikipedia.org/wiki/Combining_character
2142
#[stable(feature = "rust1", since = "1.0.0")]
2243
pub trait AsciiExt {
2344
/// Container type for copied ASCII characters.

src/libstd/collections/hash/map.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,9 @@ fn test_resize_policy() {
282282
/// let mut player_stats = HashMap::new();
283283
///
284284
/// fn random_stat_buff() -> u8 {
285-
/// // could actually return some random value here - let's just return
286-
/// // some fixed value for now
287-
/// 42
285+
/// // could actually return some random value here - let's just return
286+
/// // some fixed value for now
287+
/// 42
288288
/// }
289289
///
290290
/// // insert a key only if it doesn't already exist

0 commit comments

Comments
 (0)