Commit Graph

91060 Commits

Author SHA1 Message Date
Eduard-Mihai Burtescu
381fa7aa18 rustc: move ty::print::PrintConfig's fields to FmtPrinter. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
1a0f3a2856 rustc: streamline the Print/fmt::Display impls in ppaux and move them to ty::print::pretty. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
030cdc9729 rustc: remove obsolete hacks from ppaux, relating to normalization under HRTB. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
fb53bb9e2b rustc: move Debug impls from ppaux to ty::structural_impls. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
9c424850e8 rustc: disconnect all the Debug functionality from ty::print. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
d0a1bf5c88 rustc: make util::ppaux private. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
800ddb367e rustc: remove fields from ty::print::PrintConfig available from tcx. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
55871aad9a rustc: split out the pretty-printing parts of ty::print into a separate module. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
26f180705a rustc: move ty/print.rs to ty/print/mod.rs. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
6d67d6846c rustc_codegen_utils: print all nominal types as paths, in symbol names. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
5211e37b1d rustc: don't pass Namespace explicitly, but rather track it in FmtPrinter. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
ab26b26d34 rustc: introduce a ty::print::PrettyPrinter helper for printing "<...>". 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
35e5123f51 rustc: support overriding type printing in ty::print::Printer. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
88d96b269c rustc: support overriding region printing in ty::print::Printer. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
fc914aa88a rustc: centralize region printing in ty::RegionKind's Print impl. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
cafd83d1d5 rustc: don't keep RegionHighlightMode in a thread-local. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
7c4eecef0b rustc: pass ty::print::PrintCx by value. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
ab5d6fb302 rustc: remove the closure from ppaux's p! macro (by making ? implicit). 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
37e918526a rustc: split off most of ty::print::PrintCx's fields into a separate struct. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
5616ca857d rustc: uniformize ty::print's error handling by requiring Result. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
972af5e808 rustc: rename ppaux' print macro to just p and make its cx input implicit. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
387ea61ec1 rustc: make ppaux' print macro use only one closure. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
27ddf2cec8 rustc: replace node_path_str with uses of def_path_str. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
36f64f15fc rustc: remove ty::print::FORCE_ABSOLUTE altogether. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
66cc029dd7 rustc: assert ty::print::FORCE_ABSOLUTE isn't needed anymore. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
df6650f38c rustc: move ...::<impl ...> printing into pretty_path_qualified. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
39fd54a418 rustc: move the FORCE_IMPL_FILENAME_LINE hack into print_def_path. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
aec5a48481 rustc: move <...>-less impl path special-case to pretty_path_qualified. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
a15bfc6f48 rustc: merge PrintCx::parameterized and def_path printing. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
b0fbca953f rustc: integrate LocalPathPrinter's behavior into FmtPrinter. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
9f8aaa04e0 rustc: move the contents of ty::item_path to ty::print. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
e0c75ff40d rustc: rename item_path to def_path (except the module in ty). 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
f1af5a77a0 rustc: remove TyCtxt::parent_def_id in favor of TyCtxt::parent. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
6ca6c1a6cc rustc_mir: adjust the type_length_limit diagnostic to be more useful. 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
3e1cef7007 rustc: pass Option<&Substs> and Namespace around in ty::item_path. 2019-03-15 13:25:10 +02:00
sntdevco
e9e5a75fd2 Improved test output for estr-slice 2019-03-15 16:38:51 +05:30
sntdevco
2f52388671 Improved test output for libcore/num/int_macros 2019-03-15 16:38:37 +05:30
sntdevco
8ff2198bc7 Improved test output for libcore/ops 2019-03-15 16:38:23 +05:30
sntdevco
6d73a8f753 Improved test output for libcore/cell 2019-03-15 16:38:07 +05:30
sntdevco
9445f2bf71 Improved test output for liballoc/str 2019-03-15 16:37:53 +05:30
bors
16e7e05e95 Auto merge of #58575 - mati865:musl_toolchain, r=alexcrichton
Musl host toolchain

Based on https://github.com/rust-lang/rust/pull/55163 and https://github.com/rust-lang/rust/pull/57359
Depends on https://github.com/rust-lang/rust/pull/55566

CC https://github.com/rust-lang/rust/issues/57439

### How it works

Tested compiler made by `dist` on glibc and musl based distributions and verified binaries it produces:
* Ubuntu (glibc) - installed it as a target for host toolchain and observed no regressions for static (default) linking, dynamic linking apparently requires musl build libgcc so I didn't test it.
* Alpine (musl) - installed as the host toolchain, by default it links statically (executables are portable and work on glibc distributions) but with `-C target-feature=-crt-static` Rust flag it links dynamically (executables require musl built libraries).

### What's debatable

It should be decided whether this toolchain should link dynamically or statically when using it on musl distribution. I believe the distributions would prefer dynamic linking but it'd be misleading because `$ARCH-unknown-linux-musl` target links statically on the other hosts.
Another problem is using `RUSTFLAGS='-C target-feature=-crt-static'` for dynamic builds which is really uncomfortable.

To address both issues I suggest leaving `$ARCH-unknown-linux-musl` static for both host and cross target and introducing "alias triple" `$ARCH-unknown-linux-dynmusl`. It'd be the same as `$ARCH-unknown-linux-musl` (and use the same libraries to avoid duplication) but it'd link dynamically.

<del>
### Why it's still WIP (help wanted)

I'm having a hard time getting all tests to pass and I'd appreciate help.

Non-verbose error:
<details>

```
Testing proc_macro stage1 (x86_64-unknown-linux-musl -> x86_64-unknown-linux-musl)
   Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
error[E0463]: can't find crate for `std`

error[E0463]: can't find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
[RUSTC-TIMING] proc_macro test:true 0.529
[RUSTC-TIMING] proc_macro test:false 0.530
error: Could not compile `proc_macro`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `proc_macro`.

To learn more, run the command again with --verbose.

command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-musl" "-j" "16" "--release" "--locked" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "-p" "proc_macro" "--"
expected success, got: exit code: 101

failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --host x86_64-unknown-linux-musl --target x86_64-unknown-linux-musl
```
</details>

Verbose error:
<details>

```
Testing proc_macro stage1 (x86_64-unknown-linux-musl -> x86_64-unknown-linux-musl)
   Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
     Running `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=09ddd3ecc930ab63 -C extra-filename=-09ddd3ecc930ab63 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static`
     Running `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --emit=dep-info,link -C opt-level=2 --test -C metadata=a564d363930469c8 -C extra-filename=-a564d363930469c8 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static`
error[E0463]: can't find crate for `std`
error[E0463]: can't find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
[RUSTC-TIMING] proc_macro test:false 0.248
error: Could not compile `proc_macro`.

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=09ddd3ecc930ab63 -C extra-filename=-09ddd3ecc930ab63 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] proc_macro test:true 0.248
error: Could not compile `proc_macro`.

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --emit=dep-info,link -C opt-level=2 --test -C metadata=a564d363930469c8 -C extra-filename=-a564d363930469c8 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static` (exit code: 1)

command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-musl" "-j" "16" "--release" "--locked" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "--verbose" "-p" "proc_macro" "--"
expected success, got: exit code: 101

failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --host x86_64-unknown-linux-musl --target x86_64-unknown-linux-musl
```

</details>

Whole tests non-verbose output: [rust-tests.log](https://github.com/rust-lang/rust/files/2879945/rust-tests.log)

I think the error is because build system (correctly?) tries to use `obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps` which is empty but `obj/build/x86_64-unknown-linux-gnu/stage1-test/x86_64-unknown-linux-musl/release/deps` contains required libs.
</del>
2019-03-15 11:00:13 +00:00
Eduard-Mihai Burtescu
ed2be6fa89 rustc: move the FORCE_IMPL_FILENAME_LINE handling into LocalPathPrinter. 2019-03-15 09:26:14 +02:00
Eduard-Mihai Burtescu
2386168139 rustc: explicitly pass the namespace to PrintCx::parameterized. 2019-03-15 09:26:13 +02:00
Eduard-Mihai Burtescu
08d27441ec rustc: move the formatter into ty::print::PrintCx. 2019-03-15 09:26:13 +02:00
Eduard-Mihai Burtescu
732b71a1ba rustc: add a ty::RegionKind::display_outputs_anything method to avoid printing to a string. 2019-03-15 09:26:13 +02:00
Eduard-Mihai Burtescu
329b8ca818 rustc: always rely on '_ to be not printed by ty::Region itself. 2019-03-15 09:26:13 +02:00
Eduard-Mihai Burtescu
387cacf76b rustc: remove ty::item_path::RootMode by moving local logic into the printer. 2019-03-15 09:26:13 +02:00
Eduard-Mihai Burtescu
7d211e5b12 rustc: rewrite ty::item_path to be more functional than mutation-oriented. 2019-03-15 09:26:13 +02:00
Eduard-Mihai Burtescu
7505bb6bbb rustc_codegen_utils: revert some symbol_names refactors (while keeping the functional changes). 2019-03-15 09:26:13 +02:00
Eduard-Mihai Burtescu
1c2a3c5d79 rustc: support impl's in PrintCx::parameterized. 2019-03-15 09:26:13 +02:00