Skip to content

Rollup of 7 pull requests #31416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Feb 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terms.

Longer version:

The Rust Project is copyright 2016, The Rust Project
The Rust Project is copyright 2010, The Rust Project
Developers.

Licensed under the Apache License, Version 2.0
Expand Down
2 changes: 1 addition & 1 deletion LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016 The Rust Project Developers
Copyright (c) 2010 The Rust Project Developers

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
Expand Down
2 changes: 1 addition & 1 deletion src/doc/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ struct_expr : expr_path '{' ident ':' expr
### Block expressions

```antlr
block_expr : '{' [ stmt ';' | item ] *
block_expr : '{' [ stmt | item ] *
[ expr ] '}' ;
```

Expand Down
16 changes: 8 additions & 8 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,8 @@ fn first((value, _): (i32, i32)) -> i32 { value }
#### Generic functions

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

```rust,ignore
// foo is generic over A and B
Expand Down Expand Up @@ -1179,7 +1179,7 @@ Enumeration constructors can have either named or unnamed fields:
```rust
enum Animal {
Dog (String, f64),
Cat { name: String, weight: f64 }
Cat { name: String, weight: f64 },
}

let mut a: Animal = Animal::Dog("Cocoa".to_string(), 37.2);
Expand Down Expand Up @@ -1237,12 +1237,12 @@ const STRING: &'static str = "bitstring";

struct BitsNStrings<'a> {
mybits: [u32; 2],
mystring: &'a str
mystring: &'a str,
}

const BITS_N_STRINGS: BitsNStrings<'static> = BitsNStrings {
mybits: BITS,
mystring: STRING
mystring: STRING,
};
```

Expand Down Expand Up @@ -1661,7 +1661,7 @@ struct Foo;

// Declare a public struct with a private field
pub struct Bar {
field: i32
field: i32,
}

// Declare a public enum with two public variants
Expand Down Expand Up @@ -3212,7 +3212,7 @@ may refer to the variables bound within the pattern they follow.
let message = match maybe_digit {
Some(x) if x < 10 => process_digit(x),
Some(x) => process_other(x),
None => panic!()
None => panic!(),
};
```

Expand Down Expand Up @@ -3504,7 +3504,7 @@ An example of a `fn` type:

```
fn add(x: i32, y: i32) -> i32 {
return x + y;
x + y
}

let mut x = add(5,7);
Expand Down
21 changes: 21 additions & 0 deletions src/libstd/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ use mem;
use ops::Range;

/// Extension methods for ASCII-subset only operations on string slices.
///
/// Be aware that operations on seemingly non-ASCII characters can sometimes
/// have unexpected results. Consider this example:
///
/// ```
/// use std::ascii::AsciiExt;
///
/// assert_eq!("café".to_ascii_uppercase(), "CAFÉ");
/// assert_eq!("café".to_ascii_uppercase(), "CAFé");
/// ```
///
/// In the first example, the lowercased string is represented `"cafe\u{301}"`
/// (the last character is an acute accent [combining character]). Unlike the
/// other characters in the string, the combining character will not get mapped
/// to an uppercase variant, resulting in `"CAFE\u{301}"`. In the second
/// example, the lowercased string is represented `"caf\u{e9}"` (the last
/// character is a single Unicode character representing an 'e' with an acute
/// accent). Since the last character is defined outside the scope of ASCII,
/// it will not get mapped to an uppercase variant, resulting in `"CAF\u{e9}"`.
///
/// [combining character]: https://en.wikipedia.org/wiki/Combining_character
#[stable(feature = "rust1", since = "1.0.0")]
pub trait AsciiExt {
/// Container type for copied ASCII characters.
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,9 @@ fn test_resize_policy() {
/// let mut player_stats = HashMap::new();
///
/// fn random_stat_buff() -> u8 {
/// // could actually return some random value here - let's just return
/// // some fixed value for now
/// 42
/// // could actually return some random value here - let's just return
/// // some fixed value for now
/// 42
/// }
///
/// // insert a key only if it doesn't already exist
Expand Down