Skip to content

Commit dcd473d

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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2725
-2323
lines changed

Diff for: Cargo.lock

-13
Original file line numberDiff line numberDiff line change
@@ -3324,8 +3324,6 @@ dependencies = [
33243324
"log",
33253325
"rustc",
33263326
"rustc_data_structures",
3327-
"rustc_errors",
3328-
"syntax",
33293327
"syntax_pos",
33303328
]
33313329

@@ -3347,7 +3345,6 @@ dependencies = [
33473345
"log",
33483346
"memmap",
33493347
"num_cpus",
3350-
"parking_lot 0.9.0",
33513348
"rustc",
33523349
"rustc_apfloat",
33533350
"rustc_codegen_utils",
@@ -3366,7 +3363,6 @@ dependencies = [
33663363
name = "rustc_codegen_utils"
33673364
version = "0.0.0"
33683365
dependencies = [
3369-
"flate2",
33703366
"log",
33713367
"punycode",
33723368
"rustc",
@@ -3561,7 +3557,6 @@ name = "rustc_mir"
35613557
version = "0.0.0"
35623558
dependencies = [
35633559
"arena",
3564-
"byteorder",
35653560
"either",
35663561
"graphviz",
35673562
"log",
@@ -3614,7 +3609,6 @@ name = "rustc_plugin_impl"
36143609
version = "0.0.0"
36153610
dependencies = [
36163611
"rustc",
3617-
"rustc_errors",
36183612
"rustc_metadata",
36193613
"syntax",
36203614
"syntax_pos",
@@ -3638,7 +3632,6 @@ version = "0.0.0"
36383632
dependencies = [
36393633
"arena",
36403634
"bitflags",
3641-
"indexmap",
36423635
"log",
36433636
"rustc",
36443637
"rustc_data_structures",
@@ -3660,7 +3653,6 @@ dependencies = [
36603653
"rustc_codegen_utils",
36613654
"rustc_data_structures",
36623655
"rustc_target",
3663-
"rustc_typeck",
36643656
"serde_json",
36653657
"syntax",
36663658
"syntax_pos",
@@ -3691,9 +3683,7 @@ checksum = "b725dadae9fabc488df69a287f5a99c5eaf5d10853842a8a3dfac52476f544ee"
36913683
name = "rustc_traits"
36923684
version = "0.0.0"
36933685
dependencies = [
3694-
"bitflags",
36953686
"chalk-engine",
3696-
"graphviz",
36973687
"log",
36983688
"rustc",
36993689
"rustc_data_structures",
@@ -4056,7 +4046,6 @@ version = "0.0.0"
40564046
dependencies = [
40574047
"alloc",
40584048
"backtrace",
4059-
"cc",
40604049
"cfg-if",
40614050
"compiler_builtins",
40624051
"core",
@@ -4241,7 +4230,6 @@ dependencies = [
42414230
"rustc_data_structures",
42424231
"rustc_errors",
42434232
"rustc_lexer",
4244-
"rustc_macros",
42454233
"rustc_target",
42464234
"scoped-tls",
42474235
"serialize",
@@ -4257,7 +4245,6 @@ dependencies = [
42574245
"log",
42584246
"rustc_data_structures",
42594247
"rustc_errors",
4260-
"rustc_lexer",
42614248
"rustc_target",
42624249
"smallvec",
42634250
"syntax",

Diff for: RELEASES.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ Misc
7070

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

7878
[60260]: https://github.com/rust-lang/rust/pull/60260/
7979
[61457]: https://github.com/rust-lang/rust/pull/61457/

Diff for: src/liballoc/string.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl String {
429429

430430
/// Converts a vector of bytes to a `String`.
431431
///
432-
/// A string slice ([`&str`]) is made of bytes ([`u8`]), and a vector of bytes
432+
/// A string ([`String`]) is made of bytes ([`u8`]), and a vector of bytes
433433
/// ([`Vec<u8>`]) is made of bytes, so this function converts between the
434434
/// two. Not all byte slices are valid `String`s, however: `String`
435435
/// requires that it is valid UTF-8. `from_utf8()` checks to ensure that
@@ -446,7 +446,7 @@ impl String {
446446
/// If you need a [`&str`] instead of a `String`, consider
447447
/// [`str::from_utf8`].
448448
///
449-
/// The inverse of this method is [`as_bytes`].
449+
/// The inverse of this method is [`into_bytes`].
450450
///
451451
/// # Errors
452452
///
@@ -480,11 +480,11 @@ impl String {
480480
/// with this error.
481481
///
482482
/// [`from_utf8_unchecked`]: struct.String.html#method.from_utf8_unchecked
483-
/// [`&str`]: ../../std/primitive.str.html
483+
/// [`String`]: struct.String.html
484484
/// [`u8`]: ../../std/primitive.u8.html
485485
/// [`Vec<u8>`]: ../../std/vec/struct.Vec.html
486486
/// [`str::from_utf8`]: ../../std/str/fn.from_utf8.html
487-
/// [`as_bytes`]: struct.String.html#method.as_bytes
487+
/// [`into_bytes`]: struct.String.html#method.into_bytes
488488
/// [`FromUtf8Error`]: struct.FromUtf8Error.html
489489
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
490490
#[inline]

Diff for: src/libcore/iter/traits/iterator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2581,7 +2581,7 @@ pub trait Iterator {
25812581
/// assert_eq!(xs.iter().cmp_by(&ys, |&x, &y| (x * x).cmp(&y)), Ordering::Equal);
25822582
/// assert_eq!(xs.iter().cmp_by(&ys, |&x, &y| (2 * x).cmp(&y)), Ordering::Greater);
25832583
/// ```
2584-
#[unstable(feature = "iter_order_by", issue = "0")]
2584+
#[unstable(feature = "iter_order_by", issue = "64295")]
25852585
fn cmp_by<I, F>(mut self, other: I, mut cmp: F) -> Ordering
25862586
where
25872587
Self: Sized,
@@ -2664,7 +2664,7 @@ pub trait Iterator {
26642664
/// Some(Ordering::Greater)
26652665
/// );
26662666
/// ```
2667-
#[unstable(feature = "iter_order_by", issue = "0")]
2667+
#[unstable(feature = "iter_order_by", issue = "64295")]
26682668
fn partial_cmp_by<I, F>(mut self, other: I, mut partial_cmp: F) -> Option<Ordering>
26692669
where
26702670
Self: Sized,
@@ -2729,7 +2729,7 @@ pub trait Iterator {
27292729
///
27302730
/// assert!(xs.iter().eq_by(&ys, |&x, &y| x * x == y));
27312731
/// ```
2732-
#[unstable(feature = "iter_order_by", issue = "0")]
2732+
#[unstable(feature = "iter_order_by", issue = "64295")]
27332733
fn eq_by<I, F>(mut self, other: I, mut eq: F) -> bool
27342734
where
27352735
Self: Sized,

Diff for: src/libcore/mem/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,9 @@ impl<T> fmt::Debug for Discriminant<T> {
818818
///
819819
/// enum Foo { A(&'static str), B(i32), C(i32) }
820820
///
821-
/// assert!(mem::discriminant(&Foo::A("bar")) == mem::discriminant(&Foo::A("baz")));
822-
/// assert!(mem::discriminant(&Foo::B(1)) == mem::discriminant(&Foo::B(2)));
823-
/// assert!(mem::discriminant(&Foo::B(3)) != mem::discriminant(&Foo::C(3)));
821+
/// assert_eq!(mem::discriminant(&Foo::A("bar")), mem::discriminant(&Foo::A("baz")));
822+
/// assert_eq!(mem::discriminant(&Foo::B(1)), mem::discriminant(&Foo::B(2)));
823+
/// assert_ne!(mem::discriminant(&Foo::B(3)), mem::discriminant(&Foo::C(3)));
824824
/// ```
825825
#[stable(feature = "discriminant_value", since = "1.21.0")]
826826
pub fn discriminant<T>(v: &T) -> Discriminant<T> {

Diff for: src/librustc/mir/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ impl<'tcx> Body<'tcx> {
262262
dominators(self)
263263
}
264264

265+
/// Returns `true` if a cycle exists in the control-flow graph that is reachable from the
266+
/// `START_BLOCK`.
267+
pub fn is_cfg_cyclic(&self) -> bool {
268+
graph::is_cyclic(self)
269+
}
270+
265271
#[inline]
266272
pub fn local_kind(&self, local: Local) -> LocalKind {
267273
let index = local.as_usize();

Diff for: src/librustc/session/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ impl Session {
321321
}
322322
pub fn compile_status(&self) -> Result<(), ErrorReported> {
323323
if self.has_errors() {
324+
self.diagnostic().emit_stashed_diagnostics();
324325
Err(ErrorReported)
325326
} else {
326327
Ok(())

Diff for: src/librustc/traits/coherence.rs

+13-5
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ fn orphan_check_trait_ref<'tcx>(
432432
}
433433

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

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

@@ -472,7 +472,7 @@ fn def_id_is_local(def_id: DefId, in_crate: InCrate) -> bool {
472472
}
473473
}
474474

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

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

505505
ty::Adt(def, _) => def_id_is_local(def.did, in_crate),
506506
ty::Foreign(did) => def_id_is_local(did, in_crate),
507+
ty::Opaque(did, _) => {
508+
// Check the underlying type that this opaque
509+
// type resolves to.
510+
// This recursion will eventually terminate,
511+
// since we've already managed to successfully
512+
// resolve all opaque types by this point
513+
let real_ty = tcx.type_of(did);
514+
ty_is_local_constructor(tcx, real_ty, in_crate)
515+
}
507516

508517
ty::Dynamic(ref tt, ..) => {
509518
if let Some(principal) = tt.principal() {
@@ -518,8 +527,7 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
518527
ty::UnnormalizedProjection(..) |
519528
ty::Closure(..) |
520529
ty::Generator(..) |
521-
ty::GeneratorWitness(..) |
522-
ty::Opaque(..) => {
530+
ty::GeneratorWitness(..) => {
523531
bug!("ty_is_local invoked on unexpected type: {:?}", ty)
524532
}
525533
}

Diff for: src/librustc/traits/specialize/specialization_graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ impl<'tcx> Graph {
395395
/// The parent of a given impl, which is the `DefId` of the trait when the
396396
/// impl is a "specialization root".
397397
pub fn parent(&self, child: DefId) -> DefId {
398-
*self.parent.get(&child).unwrap()
398+
*self.parent.get(&child).unwrap_or_else(|| panic!("Failed to get parent for {:?}", child))
399399
}
400400
}
401401

Diff for: src/librustc_ast_borrowck/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ doctest = false
1212

1313
[dependencies]
1414
log = "0.4"
15-
syntax = { path = "../libsyntax" }
1615
syntax_pos = { path = "../libsyntax_pos" }
1716
# for "clarity", rename the graphviz crate to dot; graphviz within `borrowck`
1817
# refers to the borrowck-specific graphviz adapter traits.
1918
dot = { path = "../libgraphviz", package = "graphviz" }
2019
rustc = { path = "../librustc" }
21-
errors = { path = "../librustc_errors", package = "rustc_errors" }
2220
rustc_data_structures = { path = "../librustc_data_structures" }

Diff for: src/librustc_codegen_ssa/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ memmap = "0.6"
1717
log = "0.4.5"
1818
libc = "0.2.44"
1919
jobserver = "0.1.11"
20-
parking_lot = "0.9"
2120
tempfile = "3.1"
2221

2322
rustc_serialize = { path = "../libserialize", package = "serialize" }

Diff for: src/librustc_codegen_utils/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ path = "lib.rs"
1010
test = false
1111

1212
[dependencies]
13-
flate2 = "1.0"
1413
log = "0.4"
1514
punycode = "0.4.0"
1615
rustc-demangle = "0.1.16"

0 commit comments

Comments
 (0)