mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-23 12:23:22 +00:00
Auto merge of #39260 - steveklabnik:rollup, r=steveklabnik
Rollup of 7 pull requests - Successful merges: #38794, #38956, #38993, #39191, #39200, #39233, #39258 - Failed merges:
This commit is contained in:
commit
a583f6f47c
@ -17,6 +17,10 @@
|
|||||||
# most intimate workings of the compiler itself, you've come to the
|
# most intimate workings of the compiler itself, you've come to the
|
||||||
# right place. Let's see what's on the menu.
|
# right place. Let's see what's on the menu.
|
||||||
#
|
#
|
||||||
|
# Please note that most of these options only work if configure was
|
||||||
|
# run with --disable-rustbuild. For documentation on the new build
|
||||||
|
# system, see CONTRIBUTING.md.
|
||||||
|
#
|
||||||
# First, start with one of these build targets:
|
# First, start with one of these build targets:
|
||||||
#
|
#
|
||||||
# * all - The default. Build a complete, bootstrapped compiler.
|
# * all - The default. Build a complete, bootstrapped compiler.
|
||||||
|
@ -82,7 +82,7 @@ fn process_message(msg: Message) {
|
|||||||
match msg {
|
match msg {
|
||||||
Message::Quit => quit(),
|
Message::Quit => quit(),
|
||||||
Message::ChangeColor(r, g, b) => change_color(r, g, b),
|
Message::ChangeColor(r, g, b) => change_color(r, g, b),
|
||||||
Message::Move { x: x, y: y } => move_cursor(x, y),
|
Message::Move { x, y: new_name_for_y } => move_cursor(x, new_name_for_y),
|
||||||
Message::Write(s) => println!("{}", s),
|
Message::Write(s) => println!("{}", s),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
* `%` (`expr % expr`): arithmetic remainder. Overloadable (`Rem`).
|
* `%` (`expr % expr`): arithmetic remainder. Overloadable (`Rem`).
|
||||||
* `%=` (`var %= expr`): arithmetic remainder & assignment. Overloadable (`RemAssign`).
|
* `%=` (`var %= expr`): arithmetic remainder & assignment. Overloadable (`RemAssign`).
|
||||||
* `&` (`expr & expr`): bitwise and. Overloadable (`BitAnd`).
|
* `&` (`expr & expr`): bitwise and. Overloadable (`BitAnd`).
|
||||||
* `&` (`&expr`): borrow. See [References and Borrowing].
|
* `&` (`&expr`, `&mut expr`): borrow. See [References and Borrowing].
|
||||||
* `&` (`&type`, `&mut type`, `&'a type`, `&'a mut type`): borrowed pointer type. See [References and Borrowing].
|
* `&` (`&type`, `&mut type`, `&'a type`, `&'a mut type`): borrowed pointer type. See [References and Borrowing].
|
||||||
* `&=` (`var &= expr`): bitwise and & assignment. Overloadable (`BitAndAssign`).
|
* `&=` (`var &= expr`): bitwise and & assignment. Overloadable (`BitAndAssign`).
|
||||||
* `&&` (`expr && expr`): logical and.
|
* `&&` (`expr && expr`): logical and.
|
||||||
|
@ -263,10 +263,7 @@ any resources of the vtable’s type: for `u8` it is trivial, but for `String` i
|
|||||||
will free the memory. This is necessary for owning trait objects like
|
will free the memory. This is necessary for owning trait objects like
|
||||||
`Box<Foo>`, which need to clean-up both the `Box` allocation as well as the
|
`Box<Foo>`, which need to clean-up both the `Box` allocation as well as the
|
||||||
internal type when they go out of scope. The `size` and `align` fields store
|
internal type when they go out of scope. The `size` and `align` fields store
|
||||||
the size of the erased type, and its alignment requirements; these are
|
the size of the erased type, and its alignment requirements.
|
||||||
essentially unused at the moment since the information is embedded in the
|
|
||||||
destructor, but will be used in the future, as trait objects are progressively
|
|
||||||
made more flexible.
|
|
||||||
|
|
||||||
Suppose we’ve got some values that implement `Foo`. The explicit form of
|
Suppose we’ve got some values that implement `Foo`. The explicit form of
|
||||||
construction and use of `Foo` trait objects might look a bit like (ignoring the
|
construction and use of `Foo` trait objects might look a bit like (ignoring the
|
||||||
|
@ -510,8 +510,9 @@ unit_expr : "()" ;
|
|||||||
### Structure expressions
|
### Structure expressions
|
||||||
|
|
||||||
```antlr
|
```antlr
|
||||||
struct_expr : expr_path '{' ident ':' expr
|
struct_expr_field_init : ident | ident ':' expr ;
|
||||||
[ ',' ident ':' expr ] *
|
struct_expr : expr_path '{' struct_expr_field_init
|
||||||
|
[ ',' struct_expr_field_init ] *
|
||||||
[ ".." expr ] '}' |
|
[ ".." expr ] '}' |
|
||||||
expr_path '(' expr
|
expr_path '(' expr
|
||||||
[ ',' expr ] * ')' |
|
[ ',' expr ] * ')' |
|
||||||
|
@ -21,9 +21,10 @@
|
|||||||
//!
|
//!
|
||||||
//! Each method takes an `Ordering` which represents the strength of
|
//! Each method takes an `Ordering` which represents the strength of
|
||||||
//! the memory barrier for that operation. These orderings are the
|
//! the memory barrier for that operation. These orderings are the
|
||||||
//! same as [LLVM atomic orderings][1].
|
//! same as [LLVM atomic orderings][1]. For more information see the [nomicon][2].
|
||||||
//!
|
//!
|
||||||
//! [1]: http://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations
|
//! [1]: http://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations
|
||||||
|
//! [2]: https://doc.rust-lang.org/nomicon/atomics.html
|
||||||
//!
|
//!
|
||||||
//! Atomic variables are safe to share between threads (they implement `Sync`)
|
//! Atomic variables are safe to share between threads (they implement `Sync`)
|
||||||
//! but they do not themselves provide the mechanism for sharing and follow the
|
//! but they do not themselves provide the mechanism for sharing and follow the
|
||||||
@ -141,6 +142,9 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
|
|||||||
///
|
///
|
||||||
/// Rust's memory orderings are [the same as
|
/// Rust's memory orderings are [the same as
|
||||||
/// LLVM's](http://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations).
|
/// LLVM's](http://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations).
|
||||||
|
///
|
||||||
|
/// For more information see the [nomicon][1].
|
||||||
|
/// [1]: https://doc.rust-lang.org/nomicon/atomics.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum Ordering {
|
pub enum Ordering {
|
||||||
|
@ -66,6 +66,11 @@ pub trait AsciiExt {
|
|||||||
/// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
|
/// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
|
||||||
/// but non-ASCII letters are unchanged.
|
/// but non-ASCII letters are unchanged.
|
||||||
///
|
///
|
||||||
|
/// To uppercase the string in-place, use [`make_ascii_uppercase`].
|
||||||
|
///
|
||||||
|
/// To uppercase ASCII characters in addition to non-ASCII characters, use
|
||||||
|
/// [`str::to_uppercase`].
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
@ -77,6 +82,9 @@ pub trait AsciiExt {
|
|||||||
/// assert_eq!('A', ascii.to_ascii_uppercase());
|
/// assert_eq!('A', ascii.to_ascii_uppercase());
|
||||||
/// assert_eq!('❤', utf8.to_ascii_uppercase());
|
/// assert_eq!('❤', utf8.to_ascii_uppercase());
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// [`make_ascii_uppercase`]: #tymethod.make_ascii_uppercase
|
||||||
|
/// [`str::to_uppercase`]: ../primitive.str.html#method.to_uppercase
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
fn to_ascii_uppercase(&self) -> Self::Owned;
|
fn to_ascii_uppercase(&self) -> Self::Owned;
|
||||||
|
|
||||||
@ -85,6 +93,11 @@ pub trait AsciiExt {
|
|||||||
/// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
|
/// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
|
||||||
/// but non-ASCII letters are unchanged.
|
/// but non-ASCII letters are unchanged.
|
||||||
///
|
///
|
||||||
|
/// To lowercase the string in-place, use [`make_ascii_lowercase`].
|
||||||
|
///
|
||||||
|
/// To lowercase ASCII characters in addition to non-ASCII characters, use
|
||||||
|
/// [`str::to_lowercase`].
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
@ -96,6 +109,9 @@ pub trait AsciiExt {
|
|||||||
/// assert_eq!('a', ascii.to_ascii_lowercase());
|
/// assert_eq!('a', ascii.to_ascii_lowercase());
|
||||||
/// assert_eq!('❤', utf8.to_ascii_lowercase());
|
/// assert_eq!('❤', utf8.to_ascii_lowercase());
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// [`make_ascii_lowercase`]: #tymethod.make_ascii_lowercase
|
||||||
|
/// [`str::to_lowercase`]: ../primitive.str.html#method.to_lowercase
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
fn to_ascii_lowercase(&self) -> Self::Owned;
|
fn to_ascii_lowercase(&self) -> Self::Owned;
|
||||||
|
|
||||||
@ -123,7 +139,11 @@ pub trait AsciiExt {
|
|||||||
|
|
||||||
/// Converts this type to its ASCII upper case equivalent in-place.
|
/// Converts this type to its ASCII upper case equivalent in-place.
|
||||||
///
|
///
|
||||||
/// See `to_ascii_uppercase` for more information.
|
/// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
|
||||||
|
/// but non-ASCII letters are unchanged.
|
||||||
|
///
|
||||||
|
/// To return a new uppercased string without modifying the existing one, use
|
||||||
|
/// [`to_ascii_uppercase`].
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
@ -136,12 +156,18 @@ pub trait AsciiExt {
|
|||||||
///
|
///
|
||||||
/// assert_eq!('A', ascii);
|
/// assert_eq!('A', ascii);
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// [`to_ascii_uppercase`]: #tymethod.to_ascii_uppercase
|
||||||
#[stable(feature = "ascii", since = "1.9.0")]
|
#[stable(feature = "ascii", since = "1.9.0")]
|
||||||
fn make_ascii_uppercase(&mut self);
|
fn make_ascii_uppercase(&mut self);
|
||||||
|
|
||||||
/// Converts this type to its ASCII lower case equivalent in-place.
|
/// Converts this type to its ASCII lower case equivalent in-place.
|
||||||
///
|
///
|
||||||
/// See `to_ascii_lowercase` for more information.
|
/// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
|
||||||
|
/// but non-ASCII letters are unchanged.
|
||||||
|
///
|
||||||
|
/// To return a new lowercased string without modifying the existing one, use
|
||||||
|
/// [`to_ascii_lowercase`].
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
@ -154,6 +180,8 @@ pub trait AsciiExt {
|
|||||||
///
|
///
|
||||||
/// assert_eq!('a', ascii);
|
/// assert_eq!('a', ascii);
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// [`to_ascii_lowercase`]: #tymethod.to_ascii_lowercase
|
||||||
#[stable(feature = "ascii", since = "1.9.0")]
|
#[stable(feature = "ascii", since = "1.9.0")]
|
||||||
fn make_ascii_lowercase(&mut self);
|
fn make_ascii_lowercase(&mut self);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user