Skip to content

Commit

Permalink
Auto merge of rust-lang#64751 - Centril:rollup-hpbmcfj, r=Centril
Browse files Browse the repository at this point in the history
Rollup of 16 pull requests

Successful merges:

 - rust-lang#63356 (Issue#63183: Add fs::read_dir() and ReadDir warning about iterator order + example)
 - rust-lang#63934 (Fix coherence checking for impl trait in type aliases)
 - rust-lang#64016 (Streamline `Compiler`)
 - rust-lang#64296 (Document the unstable iter_order_by library feature)
 - rust-lang#64443 (rustdoc: general cleanup)
 - rust-lang#64622 (Add a cycle detector for generic `Graph`s and `mir::Body`s)
 - rust-lang#64689 (Refactor macro by example)
 - rust-lang#64698 (Recover on `const X = 42;` and infer type + Error Stash API)
 - rust-lang#64702 (Remove unused dependencies)
 - rust-lang#64717 (update mem::discriminant test to use assert_eq and assert_ne over comparison operators)
 - rust-lang#64720 ( remove rtp.rs, and move rtpSpawn and RTP_ID_ERROR to libc)
 - rust-lang#64721 (Fixed issue from rust-lang#64447)
 - rust-lang#64725 (fix one typo)
 - rust-lang#64737 (fix several issues in String docs)
 - rust-lang#64742 (relnotes: make compatibility section more sterile and fix rustc version)
 - rust-lang#64748 (Fix rust-lang#64744. Account for the Zero sub-pattern case.)

Failed merges:

r? @ghost
  • Loading branch information
bors committed Sep 24, 2019
2 parents 6ef275e + aeb2414 commit dcd473d
Show file tree
Hide file tree
Showing 78 changed files with 2,725 additions and 2,323 deletions.
13 changes: 0 additions & 13 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3324,8 +3324,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_errors",
"syntax",
"syntax_pos",
]

Expand All @@ -3347,7 +3345,6 @@ dependencies = [
"log",
"memmap",
"num_cpus",
"parking_lot 0.9.0",
"rustc",
"rustc_apfloat",
"rustc_codegen_utils",
Expand All @@ -3366,7 +3363,6 @@ dependencies = [
name = "rustc_codegen_utils"
version = "0.0.0"
dependencies = [
"flate2",
"log",
"punycode",
"rustc",
Expand Down Expand Up @@ -3561,7 +3557,6 @@ name = "rustc_mir"
version = "0.0.0"
dependencies = [
"arena",
"byteorder",
"either",
"graphviz",
"log",
Expand Down Expand Up @@ -3614,7 +3609,6 @@ name = "rustc_plugin_impl"
version = "0.0.0"
dependencies = [
"rustc",
"rustc_errors",
"rustc_metadata",
"syntax",
"syntax_pos",
Expand All @@ -3638,7 +3632,6 @@ version = "0.0.0"
dependencies = [
"arena",
"bitflags",
"indexmap",
"log",
"rustc",
"rustc_data_structures",
Expand All @@ -3660,7 +3653,6 @@ dependencies = [
"rustc_codegen_utils",
"rustc_data_structures",
"rustc_target",
"rustc_typeck",
"serde_json",
"syntax",
"syntax_pos",
Expand Down Expand Up @@ -3691,9 +3683,7 @@ checksum = "b725dadae9fabc488df69a287f5a99c5eaf5d10853842a8a3dfac52476f544ee"
name = "rustc_traits"
version = "0.0.0"
dependencies = [
"bitflags",
"chalk-engine",
"graphviz",
"log",
"rustc",
"rustc_data_structures",
Expand Down Expand Up @@ -4056,7 +4046,6 @@ version = "0.0.0"
dependencies = [
"alloc",
"backtrace",
"cc",
"cfg-if",
"compiler_builtins",
"core",
Expand Down Expand Up @@ -4241,7 +4230,6 @@ dependencies = [
"rustc_data_structures",
"rustc_errors",
"rustc_lexer",
"rustc_macros",
"rustc_target",
"scoped-tls",
"serialize",
Expand All @@ -4257,7 +4245,6 @@ dependencies = [
"log",
"rustc_data_structures",
"rustc_errors",
"rustc_lexer",
"rustc_target",
"smallvec",
"syntax",
Expand Down
8 changes: 4 additions & 4 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ Misc

Compatibility Notes
-------------------
- Unfortunately the [`x86_64-unknown-uefi` platform can not be built][62785]
with rustc 1.39.0.
- The [`armv7-unknown-linux-gnueabihf` platform is also known to have
issues][62896] for certain crates such as libc.
- The [`x86_64-unknown-uefi` platform can not be built][62785] with rustc
1.38.0.
- The [`armv7-unknown-linux-gnueabihf` platform is known to have
issues][62896] with certain crates such as libc.

[60260]: https://github.com/rust-lang/rust/pull/60260/
[61457]: https://github.com/rust-lang/rust/pull/61457/
Expand Down
8 changes: 4 additions & 4 deletions src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl String {

/// Converts a vector of bytes to a `String`.
///
/// A string slice ([`&str`]) is made of bytes ([`u8`]), and a vector of bytes
/// A string ([`String`]) is made of bytes ([`u8`]), and a vector of bytes
/// ([`Vec<u8>`]) is made of bytes, so this function converts between the
/// two. Not all byte slices are valid `String`s, however: `String`
/// requires that it is valid UTF-8. `from_utf8()` checks to ensure that
Expand All @@ -446,7 +446,7 @@ impl String {
/// If you need a [`&str`] instead of a `String`, consider
/// [`str::from_utf8`].
///
/// The inverse of this method is [`as_bytes`].
/// The inverse of this method is [`into_bytes`].
///
/// # Errors
///
Expand Down Expand Up @@ -480,11 +480,11 @@ impl String {
/// with this error.
///
/// [`from_utf8_unchecked`]: struct.String.html#method.from_utf8_unchecked
/// [`&str`]: ../../std/primitive.str.html
/// [`String`]: struct.String.html
/// [`u8`]: ../../std/primitive.u8.html
/// [`Vec<u8>`]: ../../std/vec/struct.Vec.html
/// [`str::from_utf8`]: ../../std/str/fn.from_utf8.html
/// [`as_bytes`]: struct.String.html#method.as_bytes
/// [`into_bytes`]: struct.String.html#method.into_bytes
/// [`FromUtf8Error`]: struct.FromUtf8Error.html
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
#[inline]
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2581,7 +2581,7 @@ pub trait Iterator {
/// assert_eq!(xs.iter().cmp_by(&ys, |&x, &y| (x * x).cmp(&y)), Ordering::Equal);
/// assert_eq!(xs.iter().cmp_by(&ys, |&x, &y| (2 * x).cmp(&y)), Ordering::Greater);
/// ```
#[unstable(feature = "iter_order_by", issue = "0")]
#[unstable(feature = "iter_order_by", issue = "64295")]
fn cmp_by<I, F>(mut self, other: I, mut cmp: F) -> Ordering
where
Self: Sized,
Expand Down Expand Up @@ -2664,7 +2664,7 @@ pub trait Iterator {
/// Some(Ordering::Greater)
/// );
/// ```
#[unstable(feature = "iter_order_by", issue = "0")]
#[unstable(feature = "iter_order_by", issue = "64295")]
fn partial_cmp_by<I, F>(mut self, other: I, mut partial_cmp: F) -> Option<Ordering>
where
Self: Sized,
Expand Down Expand Up @@ -2729,7 +2729,7 @@ pub trait Iterator {
///
/// assert!(xs.iter().eq_by(&ys, |&x, &y| x * x == y));
/// ```
#[unstable(feature = "iter_order_by", issue = "0")]
#[unstable(feature = "iter_order_by", issue = "64295")]
fn eq_by<I, F>(mut self, other: I, mut eq: F) -> bool
where
Self: Sized,
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,9 +818,9 @@ impl<T> fmt::Debug for Discriminant<T> {
///
/// enum Foo { A(&'static str), B(i32), C(i32) }
///
/// assert!(mem::discriminant(&Foo::A("bar")) == mem::discriminant(&Foo::A("baz")));
/// assert!(mem::discriminant(&Foo::B(1)) == mem::discriminant(&Foo::B(2)));
/// assert!(mem::discriminant(&Foo::B(3)) != mem::discriminant(&Foo::C(3)));
/// assert_eq!(mem::discriminant(&Foo::A("bar")), mem::discriminant(&Foo::A("baz")));
/// assert_eq!(mem::discriminant(&Foo::B(1)), mem::discriminant(&Foo::B(2)));
/// assert_ne!(mem::discriminant(&Foo::B(3)), mem::discriminant(&Foo::C(3)));
/// ```
#[stable(feature = "discriminant_value", since = "1.21.0")]
pub fn discriminant<T>(v: &T) -> Discriminant<T> {
Expand Down
6 changes: 6 additions & 0 deletions src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ impl<'tcx> Body<'tcx> {
dominators(self)
}

/// Returns `true` if a cycle exists in the control-flow graph that is reachable from the
/// `START_BLOCK`.
pub fn is_cfg_cyclic(&self) -> bool {
graph::is_cyclic(self)
}

#[inline]
pub fn local_kind(&self, local: Local) -> LocalKind {
let index = local.as_usize();
Expand Down
1 change: 1 addition & 0 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ impl Session {
}
pub fn compile_status(&self) -> Result<(), ErrorReported> {
if self.has_errors() {
self.diagnostic().emit_stashed_diagnostics();
Err(ErrorReported)
} else {
Ok(())
Expand Down
18 changes: 13 additions & 5 deletions src/librustc/traits/coherence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ fn orphan_check_trait_ref<'tcx>(
}

fn uncovered_tys<'tcx>(tcx: TyCtxt<'_>, ty: Ty<'tcx>, in_crate: InCrate) -> Vec<Ty<'tcx>> {
if ty_is_local_constructor(ty, in_crate) {
if ty_is_local_constructor(tcx, ty, in_crate) {
vec![]
} else if fundamental_ty(ty) {
ty.walk_shallow()
Expand All @@ -451,7 +451,7 @@ fn is_possibly_remote_type(ty: Ty<'_>, _in_crate: InCrate) -> bool {
}

fn ty_is_local(tcx: TyCtxt<'_>, ty: Ty<'_>, in_crate: InCrate) -> bool {
ty_is_local_constructor(ty, in_crate) ||
ty_is_local_constructor(tcx, ty, in_crate) ||
fundamental_ty(ty) && ty.walk_shallow().any(|t| ty_is_local(tcx, t, in_crate))
}

Expand All @@ -472,7 +472,7 @@ fn def_id_is_local(def_id: DefId, in_crate: InCrate) -> bool {
}
}

fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
fn ty_is_local_constructor(tcx: TyCtxt<'_>, ty: Ty<'_>, in_crate: InCrate) -> bool {
debug!("ty_is_local_constructor({:?})", ty);

match ty.sty {
Expand Down Expand Up @@ -504,6 +504,15 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {

ty::Adt(def, _) => def_id_is_local(def.did, in_crate),
ty::Foreign(did) => def_id_is_local(did, in_crate),
ty::Opaque(did, _) => {
// Check the underlying type that this opaque
// type resolves to.
// This recursion will eventually terminate,
// since we've already managed to successfully
// resolve all opaque types by this point
let real_ty = tcx.type_of(did);
ty_is_local_constructor(tcx, real_ty, in_crate)
}

ty::Dynamic(ref tt, ..) => {
if let Some(principal) = tt.principal() {
Expand All @@ -518,8 +527,7 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
ty::UnnormalizedProjection(..) |
ty::Closure(..) |
ty::Generator(..) |
ty::GeneratorWitness(..) |
ty::Opaque(..) => {
ty::GeneratorWitness(..) => {
bug!("ty_is_local invoked on unexpected type: {:?}", ty)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/specialize/specialization_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ impl<'tcx> Graph {
/// The parent of a given impl, which is the `DefId` of the trait when the
/// impl is a "specialization root".
pub fn parent(&self, child: DefId) -> DefId {
*self.parent.get(&child).unwrap()
*self.parent.get(&child).unwrap_or_else(|| panic!("Failed to get parent for {:?}", child))
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/librustc_ast_borrowck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ doctest = false

[dependencies]
log = "0.4"
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
# for "clarity", rename the graphviz crate to dot; graphviz within `borrowck`
# refers to the borrowck-specific graphviz adapter traits.
dot = { path = "../libgraphviz", package = "graphviz" }
rustc = { path = "../librustc" }
errors = { path = "../librustc_errors", package = "rustc_errors" }
rustc_data_structures = { path = "../librustc_data_structures" }
1 change: 0 additions & 1 deletion src/librustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ memmap = "0.6"
log = "0.4.5"
libc = "0.2.44"
jobserver = "0.1.11"
parking_lot = "0.9"
tempfile = "3.1"

rustc_serialize = { path = "../libserialize", package = "serialize" }
Expand Down
1 change: 0 additions & 1 deletion src/librustc_codegen_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ path = "lib.rs"
test = false

[dependencies]
flate2 = "1.0"
log = "0.4"
punycode = "0.4.0"
rustc-demangle = "0.1.16"
Expand Down
Loading

0 comments on commit dcd473d

Please sign in to comment.