rust/src/test/codegen-units/partitioning/regular-modules.rs
David Wood 6ff471b1cf
ty: remove obsolete printer
This commit removes the obsolete printer and replaces all uses of it
with `FmtPrinter`. Of the replaced uses, all but one use was in `debug!`
logging, two cases were notable:

- `MonoItem::to_string` is used in `-Z print-mono-items` and therefore
  affects the output of all codegen-units tests.
- `DefPathBasedNames` was used in `librustc_codegen_llvm/type_of.rs`
  with `LLVMStructCreateNamed` and that'll now get different values, but
  this should result in no functional change.

Signed-off-by: David Wood <david@davidtw.co>
2020-08-30 18:59:07 +01:00

71 lines
2.3 KiB
Rust

// We specify -C incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=eager -Cincremental=tmp/partitioning-tests/regular-modules
#![allow(dead_code)]
#![crate_type="lib"]
//~ MONO_ITEM fn foo @@ regular_modules[Internal]
fn foo() {}
//~ MONO_ITEM fn bar @@ regular_modules[Internal]
fn bar() {}
//~ MONO_ITEM static BAZ @@ regular_modules[Internal]
static BAZ: u64 = 0;
mod mod1 {
//~ MONO_ITEM fn mod1::foo @@ regular_modules-mod1[Internal]
fn foo() {}
//~ MONO_ITEM fn mod1::bar @@ regular_modules-mod1[Internal]
fn bar() {}
//~ MONO_ITEM static mod1::BAZ @@ regular_modules-mod1[Internal]
static BAZ: u64 = 0;
mod mod1 {
//~ MONO_ITEM fn mod1::mod1::foo @@ regular_modules-mod1-mod1[Internal]
fn foo() {}
//~ MONO_ITEM fn mod1::mod1::bar @@ regular_modules-mod1-mod1[Internal]
fn bar() {}
//~ MONO_ITEM static mod1::mod1::BAZ @@ regular_modules-mod1-mod1[Internal]
static BAZ: u64 = 0;
}
mod mod2 {
//~ MONO_ITEM fn mod1::mod2::foo @@ regular_modules-mod1-mod2[Internal]
fn foo() {}
//~ MONO_ITEM fn mod1::mod2::bar @@ regular_modules-mod1-mod2[Internal]
fn bar() {}
//~ MONO_ITEM static mod1::mod2::BAZ @@ regular_modules-mod1-mod2[Internal]
static BAZ: u64 = 0;
}
}
mod mod2 {
//~ MONO_ITEM fn mod2::foo @@ regular_modules-mod2[Internal]
fn foo() {}
//~ MONO_ITEM fn mod2::bar @@ regular_modules-mod2[Internal]
fn bar() {}
//~ MONO_ITEM static mod2::BAZ @@ regular_modules-mod2[Internal]
static BAZ: u64 = 0;
mod mod1 {
//~ MONO_ITEM fn mod2::mod1::foo @@ regular_modules-mod2-mod1[Internal]
fn foo() {}
//~ MONO_ITEM fn mod2::mod1::bar @@ regular_modules-mod2-mod1[Internal]
fn bar() {}
//~ MONO_ITEM static mod2::mod1::BAZ @@ regular_modules-mod2-mod1[Internal]
static BAZ: u64 = 0;
}
mod mod2 {
//~ MONO_ITEM fn mod2::mod2::foo @@ regular_modules-mod2-mod2[Internal]
fn foo() {}
//~ MONO_ITEM fn mod2::mod2::bar @@ regular_modules-mod2-mod2[Internal]
fn bar() {}
//~ MONO_ITEM static mod2::mod2::BAZ @@ regular_modules-mod2-mod2[Internal]
static BAZ: u64 = 0;
}
}