Rollup merge of #70344 - Centril:hir-pretty, r=eddyb

Decouple `rustc_hir::print` into `rustc_hir_pretty`

High level summary:
- The HIR pretty printer, `rustc_hir::print` is moved into a new crate `rustc_hir_pretty`.
- `rustc_ast_pretty` and `rustc_errors` are dropped as `rustc_hir` dependencies.
- The dependence on HIR pretty is generally reduced, leaving `rustc_save_analysis`, `rustdoc`, `rustc_metadata`, and `rustc_driver` as the remaining clients.

The main goal here is to reduce `rustc_hir`'s dependencies and its size such that it can start and finish earlier, thereby working towards https://github.com/rust-lang/rust/issues/65031.

r? @Zoxc
This commit is contained in:
Dylan DPC 2020-03-27 01:23:53 +01:00 committed by GitHub
commit 7041efcfc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 288 additions and 313 deletions

View file

@ -4,13 +4,13 @@ error[E0533]: expected unit struct, unit variant or constant, found associated f
LL | Foo::bar => {}
| ^^^^^^^^
error[E0533]: expected unit struct, unit variant or constant, found associated function `Foo::bar`
error[E0533]: expected unit struct, unit variant or constant, found associated function `<Foo>::bar`
--> $DIR/method-path-in-pattern.rs:19:9
|
LL | <Foo>::bar => {}
| ^^^^^^^^^^
error[E0533]: expected unit struct, unit variant or constant, found associated function `Foo::trait_bar`
error[E0533]: expected unit struct, unit variant or constant, found associated function `<Foo>::trait_bar`
--> $DIR/method-path-in-pattern.rs:23:9
|
LL | <Foo>::trait_bar => {}
@ -22,7 +22,7 @@ error[E0533]: expected unit struct, unit variant or constant, found associated f
LL | if let Foo::bar = 0u32 {}
| ^^^^^^^^
error[E0533]: expected unit struct, unit variant or constant, found associated function `Foo::bar`
error[E0533]: expected unit struct, unit variant or constant, found associated function `<Foo>::bar`
--> $DIR/method-path-in-pattern.rs:28:12
|
LL | if let <Foo>::bar = 0u32 {}

View file

@ -21,9 +21,9 @@ mod priv_trait {
Pub.method();
//~^ ERROR type `for<'r> fn(&'r Self) {<Self as priv_trait::PrivTr>::method}` is private
<Pub as PrivTr>::CONST;
//~^ ERROR associated constant `PrivTr::CONST` is private
//~^ ERROR associated constant `<Pub as PrivTr>::CONST` is private
let _: <Pub as PrivTr>::AssocTy;
//~^ ERROR associated type `PrivTr::AssocTy` is private
//~^ ERROR associated type `<Pub as PrivTr>::AssocTy` is private
pub type InSignatureTy = <Pub as PrivTr>::AssocTy;
//~^ ERROR trait `priv_trait::PrivTr` is private
pub trait InSignatureTr: PrivTr {}
@ -115,7 +115,7 @@ mod priv_parent_substs {
<Priv as PubTr<_>>::CONST;
//~^ ERROR type `priv_parent_substs::Priv` is private
let _: <Pub as PubTr>::AssocTy; // FIXME no longer an error?!
let _: <Pub as PubTr>::AssocTy; // FIXME no longer an error?!
let _: <Pub as PubTr<_>>::AssocTy;
//~^ ERROR type `priv_parent_substs::Priv` is private
let _: <Priv as PubTr<_>>::AssocTy;

View file

@ -31,7 +31,7 @@ LL | priv_trait::mac!();
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: associated constant `PrivTr::CONST` is private
error: associated constant `<Pub as PrivTr>::CONST` is private
--> $DIR/associated-item-privacy-trait.rs:23:9
|
LL | <Pub as PrivTr>::CONST;
@ -42,7 +42,7 @@ LL | priv_trait::mac!();
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: associated type `PrivTr::AssocTy` is private
error: associated type `<Pub as PrivTr>::AssocTy` is private
--> $DIR/associated-item-privacy-trait.rs:25:16
|
LL | let _: <Pub as PrivTr>::AssocTy;

View file

@ -1,4 +1,4 @@
error[E0533]: expected unit struct, unit variant or constant, found associated function `<<S as Tr>::A>::f<u8>`
error[E0533]: expected unit struct, unit variant or constant, found associated function `<S as Tr>::A::f::<u8>`
--> $DIR/qualified-path-params.rs:20:9
|
LL | <S as Tr>::A::f::<u8> => {}