Skip to content
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

Rollup of 16 pull requests #66021

Merged
merged 39 commits into from
Nov 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5930551
Check if there are any delayed_span_bugs and abort incremental compil…
traxys Oct 16, 2019
58b67c8
Use structured suggestion for unnecessary bounds in type aliases
estebank Oct 28, 2019
08ca236
Add lint for unnecessary parens around types
jack-t Oct 4, 2019
9bb9833
Add method to `Candidate` that determines its promotability rules
ecstatic-morse Oct 29, 2019
46b68b0
Emit errors in `promote_consts` when required promotion fails
ecstatic-morse Oct 29, 2019
122c6fe
Stop emitting error in `qualify_consts` if promotion fails
ecstatic-morse Oct 29, 2019
8995974
vxWorks: remove all code related to UNIX socket as it is not supporte…
BaoshanPang Oct 29, 2019
d7869ec
Make ItemContext available for better diagnositcs.
gilescope Oct 28, 2019
732842f
update submodules to rust-lang
steveklabnik Oct 30, 2019
627e3ef
Remove references to now unused `E0526`
ecstatic-morse Oct 30, 2019
bb1f4c4
doc: reword iter module example and mention other methods
tesuji Oct 30, 2019
e9e4836
Fix libunwind build: Define __LITTLE_ENDIAN__ for LE targets
Oct 30, 2019
c24a099
rustdoc: Resolve module-level doc references more locally
kinnison Oct 31, 2019
8bb5450
Fix incorrect diagnostics for expected type in E0271 with an associat…
ohadravid Oct 30, 2019
5dfb167
Create new error E0743
GuillaumeGomez Oct 31, 2019
fcbf77e
Update ui tests
GuillaumeGomez Oct 31, 2019
18391b6
Fix outdated rustdoc of Once::init_locking function
spastorino Oct 31, 2019
9c2f1dd
Add long error explanation for E0578
GuillaumeGomez Oct 16, 2019
bfe9c9e
update ui tests
GuillaumeGomez Oct 16, 2019
be0e381
Merge pull request #42 from Wind-River/master_003
n-salim Oct 31, 2019
7b72c28
Stabilize float_to_from_bytes feature
tesuji Oct 31, 2019
d21f9b7
targeted revert of PR rust-lang/rust#64324 (just undo change to dylib…
pnkfelix Nov 1, 2019
6457914
ui test formulation of regression test for issue 64872.
pnkfelix Oct 30, 2019
9175247
Rollup merge of #65112 - jack-t:type-parens-lint, r=varkor
tmandry Nov 1, 2019
7297cd8
Rollup merge of #65470 - traxys:fix_65401, r=michaelwoerister
tmandry Nov 1, 2019
1918205
Rollup merge of #65471 - GuillaumeGomez:long-err-explanation-E0578, r…
tmandry Nov 1, 2019
48a9f59
Rollup merge of #65857 - kinnison:kinnison/issue-55364, r=Manisheart,…
tmandry Nov 1, 2019
d75338e
Rollup merge of #65902 - gilescope:issue62570, r=estebank
tmandry Nov 1, 2019
b741634
Rollup merge of #65914 - estebank:type-alias-bounds-sugg, r=davidtwco
tmandry Nov 1, 2019
4160e5a
Rollup merge of #65946 - ecstatic-morse:refactor-promotion2, r=eddyb
tmandry Nov 1, 2019
723f0ef
Rollup merge of #65960 - lzutao:doc-iter-example, r=Centril
tmandry Nov 1, 2019
9bf1613
Rollup merge of #65963 - steveklabnik:update-submodules, r=Centril
tmandry Nov 1, 2019
05de0d7
Rollup merge of #65972 - braiins:vkr-arm-panicking, r=alexcrichton
tmandry Nov 1, 2019
959a563
Rollup merge of #65977 - ohadravid:fix-incorrect-diagnostics-with-an-…
tmandry Nov 1, 2019
1ea6685
Rollup merge of #65995 - GuillaumeGomez:add-err-code-E0743, r=estebank
tmandry Nov 1, 2019
665d647
Rollup merge of #65997 - spastorino:fix-init_locking-rustdoc, r=Mark-…
tmandry Nov 1, 2019
5b707f8
Rollup merge of #66002 - lzutao:stablilize-float_to_from_bytes, r=Sim…
tmandry Nov 1, 2019
81505e7
Rollup merge of #66005 - Wind-River:master_base, r=alexcrichton
tmandry Nov 1, 2019
d6e35d1
Rollup merge of #66018 - pnkfelix:issue-64872-revert-64324, r=alexcri…
tmandry Nov 1, 2019
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
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
url = https://github.com/rust-lang/rust-installer.git
[submodule "src/doc/nomicon"]
path = src/doc/nomicon
url = https://github.com/rust-lang-nursery/nomicon.git
url = https://github.com/rust-lang/nomicon.git
[submodule "src/tools/cargo"]
path = src/tools/cargo
url = https://github.com/rust-lang/cargo.git
[submodule "src/doc/reference"]
path = src/doc/reference
url = https://github.com/rust-lang-nursery/reference.git
url = https://github.com/rust-lang/reference.git
[submodule "src/doc/book"]
path = src/doc/book
url = https://github.com/rust-lang/book.git
Expand All @@ -36,7 +36,7 @@
url = https://github.com/rust-lang/rustc-guide.git
[submodule "src/doc/edition-guide"]
path = src/doc/edition-guide
url = https://github.com/rust-lang-nursery/edition-guide.git
url = https://github.com/rust-lang/edition-guide.git
[submodule "src/llvm-project"]
path = src/llvm-project
url = https://github.com/rust-lang/llvm-project.git
Expand Down
35 changes: 14 additions & 21 deletions src/libcore/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,16 @@
//!
//! let mut counter = Counter::new();
//!
//! let x = counter.next().unwrap();
//! println!("{}", x);
//!
//! let x = counter.next().unwrap();
//! println!("{}", x);
//!
//! let x = counter.next().unwrap();
//! println!("{}", x);
//!
//! let x = counter.next().unwrap();
//! println!("{}", x);
//!
//! let x = counter.next().unwrap();
//! println!("{}", x);
//! assert_eq!(counter.next(), Some(1));
//! assert_eq!(counter.next(), Some(2));
//! assert_eq!(counter.next(), Some(3));
//! assert_eq!(counter.next(), Some(4));
//! assert_eq!(counter.next(), Some(5));
//! assert_eq!(counter.next(), None);
//! ```
//!
//! This will print `1` through `5`, each on their own line.
//!
//! Calling `next()` this way gets repetitive. Rust has a construct which can
//! call `next()` on your iterator, until it reaches `None`. Let's go over that
//! Calling [`next`] this way gets repetitive. Rust has a construct which can
//! call [`next`] on your iterator, until it reaches `None`. Let's go over that
//! next.
//!
//! Also note that `Iterator` provides a default implementation of methods such as `nth` and `fold`
Expand Down Expand Up @@ -253,20 +243,23 @@
//! ```
//!
//! The idiomatic way to write a [`map`] for its side effects is to use a
//! `for` loop instead:
//! `for` loop or call the [`for_each`] method:
//!
//! ```
//! let v = vec![1, 2, 3, 4, 5];
//!
//! v.iter().for_each(|x| println!("{}", x));
//! // or
//! for x in &v {
//! println!("{}", x);
//! }
//! ```
//!
//! [`map`]: trait.Iterator.html#method.map
//! [`for_each`]: trait.Iterator.html#method.for_each
//!
//! The two most common ways to evaluate an iterator are to use a `for` loop
//! like this, or using the [`collect`] method to produce a new collection.
//! Another common way to evaluate an iterator is to use the [`collect`]
//! method to produce a new collection.
//!
//! [`collect`]: trait.Iterator.html#method.collect
//!
Expand Down
18 changes: 6 additions & 12 deletions src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,11 +466,10 @@ impl f32 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let bytes = 12.5f32.to_be_bytes();
/// assert_eq!(bytes, [0x41, 0x48, 0x00, 0x00]);
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn to_be_bytes(self) -> [u8; 4] {
self.to_bits().to_be_bytes()
Expand All @@ -482,11 +481,10 @@ impl f32 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let bytes = 12.5f32.to_le_bytes();
/// assert_eq!(bytes, [0x00, 0x00, 0x48, 0x41]);
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn to_le_bytes(self) -> [u8; 4] {
self.to_bits().to_le_bytes()
Expand All @@ -504,7 +502,6 @@ impl f32 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let bytes = 12.5f32.to_ne_bytes();
/// assert_eq!(
/// bytes,
Expand All @@ -515,7 +512,7 @@ impl f32 {
/// }
/// );
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn to_ne_bytes(self) -> [u8; 4] {
self.to_bits().to_ne_bytes()
Expand All @@ -526,11 +523,10 @@ impl f32 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let value = f32::from_be_bytes([0x41, 0x48, 0x00, 0x00]);
/// assert_eq!(value, 12.5);
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn from_be_bytes(bytes: [u8; 4]) -> Self {
Self::from_bits(u32::from_be_bytes(bytes))
Expand All @@ -541,11 +537,10 @@ impl f32 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let value = f32::from_le_bytes([0x00, 0x00, 0x48, 0x41]);
/// assert_eq!(value, 12.5);
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn from_le_bytes(bytes: [u8; 4]) -> Self {
Self::from_bits(u32::from_le_bytes(bytes))
Expand All @@ -563,15 +558,14 @@ impl f32 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let value = f32::from_ne_bytes(if cfg!(target_endian = "big") {
/// [0x41, 0x48, 0x00, 0x00]
/// } else {
/// [0x00, 0x00, 0x48, 0x41]
/// });
/// assert_eq!(value, 12.5);
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn from_ne_bytes(bytes: [u8; 4]) -> Self {
Self::from_bits(u32::from_ne_bytes(bytes))
Expand Down
18 changes: 6 additions & 12 deletions src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,10 @@ impl f64 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let bytes = 12.5f64.to_be_bytes();
/// assert_eq!(bytes, [0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn to_be_bytes(self) -> [u8; 8] {
self.to_bits().to_be_bytes()
Expand All @@ -495,11 +494,10 @@ impl f64 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let bytes = 12.5f64.to_le_bytes();
/// assert_eq!(bytes, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]);
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn to_le_bytes(self) -> [u8; 8] {
self.to_bits().to_le_bytes()
Expand All @@ -517,7 +515,6 @@ impl f64 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let bytes = 12.5f64.to_ne_bytes();
/// assert_eq!(
/// bytes,
Expand All @@ -528,7 +525,7 @@ impl f64 {
/// }
/// );
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn to_ne_bytes(self) -> [u8; 8] {
self.to_bits().to_ne_bytes()
Expand All @@ -539,11 +536,10 @@ impl f64 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let value = f64::from_be_bytes([0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
/// assert_eq!(value, 12.5);
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn from_be_bytes(bytes: [u8; 8]) -> Self {
Self::from_bits(u64::from_be_bytes(bytes))
Expand All @@ -554,11 +550,10 @@ impl f64 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let value = f64::from_le_bytes([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]);
/// assert_eq!(value, 12.5);
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn from_le_bytes(bytes: [u8; 8]) -> Self {
Self::from_bits(u64::from_le_bytes(bytes))
Expand All @@ -576,15 +571,14 @@ impl f64 {
/// # Examples
///
/// ```
/// #![feature(float_to_from_bytes)]
/// let value = f64::from_ne_bytes(if cfg!(target_endian = "big") {
/// [0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
/// } else {
/// [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]
/// });
/// assert_eq!(value, 12.5);
/// ```
#[unstable(feature = "float_to_from_bytes", issue = "60446")]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[inline]
pub fn from_ne_bytes(bytes: [u8; 8]) -> Self {
Self::from_bits(u64::from_ne_bytes(bytes))
Expand Down
17 changes: 15 additions & 2 deletions src/libcore/ops/try.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/// extracting those success or failure values from an existing instance and
/// creating a new instance from a success or failure value.
#[unstable(feature = "try_trait", issue = "42327")]
#[rustc_on_unimplemented(
#[cfg_attr(bootstrap, rustc_on_unimplemented(
on(all(
any(from_method="from_error", from_method="from_ok"),
from_desugaring="QuestionMark"),
Expand All @@ -17,7 +17,20 @@
message="the `?` operator can only be applied to values \
that implement `{Try}`",
label="the `?` operator cannot be applied to type `{Self}`")
)]
))]
#[cfg_attr(not(bootstrap), rustc_on_unimplemented(
on(all(
any(from_method="from_error", from_method="from_ok"),
from_desugaring="QuestionMark"),
message="the `?` operator can only be used in {ItemContext} \
that returns `Result` or `Option` \
(or another type that implements `{Try}`)",
label="cannot use the `?` operator in {ItemContext} that returns `{Self}`"),
on(all(from_method="into_result", from_desugaring="QuestionMark"),
message="the `?` operator can only be applied to values \
that implement `{Try}`",
label="the `?` operator cannot be applied to type `{Self}`")
))]
#[doc(alias = "?")]
pub trait Try {
/// The type of this value when viewed as successful.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
&self,
arg: &'tcx hir::Ty,
br: &ty::BoundRegion,
) -> Option<(&'tcx hir::Ty)> {
) -> Option<&'tcx hir::Ty> {
let mut nested_visitor = FindNestedTypeVisitor {
tcx: self.tcx(),
bound_region: *br,
Expand Down
3 changes: 3 additions & 0 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ impl Session {
pub fn has_errors(&self) -> bool {
self.diagnostic().has_errors()
}
pub fn has_errors_or_delayed_span_bugs(&self) -> bool {
self.diagnostic().has_errors_or_delayed_span_bugs()
}
pub fn abort_if_errors(&self) {
self.diagnostic().abort_if_errors();
}
Expand Down
Loading