Skip to content

Commit ec15943

Browse files
committed
Remove -Zthinlto
This explicitly enables thin local LTO. It was added before support for this got stabilized and implicitly enabled when optimizations are enabled. All tests that use it already implicitly enable this option.
1 parent fe75297 commit ec15943

10 files changed

Lines changed: 7 additions & 24 deletions

File tree

compiler/rustc_interface/src/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,6 @@ fn test_unstable_options_tracking_hash() {
872872
tracked!(src_hash_algorithm, Some(SourceFileHashAlgorithm::Sha1));
873873
tracked!(stack_protector, StackProtector::All);
874874
tracked!(teach, true);
875-
tracked!(thinlto, Some(true));
876875
tracked!(tiny_const_eval_limit, true);
877876
tracked!(tls_model, Some(TlsModel::GeneralDynamic));
878877
tracked!(translate_remapped_path_to_local_path, false);

compiler/rustc_session/src/options.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2685,9 +2685,6 @@ written to standard error output)"),
26852685
"the directory the intermediate files are written to"),
26862686
terminal_urls: TerminalUrl = (TerminalUrl::No, parse_terminal_url, [UNTRACKED],
26872687
"use the OSC 8 hyperlink terminal specification to print hyperlinks in the compiler output"),
2688-
#[rustc_lint_opt_deny_field_access("use `Session::lto` instead of this field")]
2689-
thinlto: Option<bool> = (None, parse_opt_bool, [TRACKED],
2690-
"enable ThinLTO when possible"),
26912688
/// We default to 1 here since we want to behave like
26922689
/// a sequential compiler for now. This'll likely be adjusted
26932690
/// in the future. Note that -Zthreads=0 is the way to get

compiler/rustc_session/src/session.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -628,19 +628,6 @@ impl Session {
628628
return config::Lto::No;
629629
}
630630

631-
// If `-Z thinlto` specified process that, but note that this is mostly
632-
// a deprecated option now that `-C lto=thin` exists.
633-
if let Some(enabled) = self.opts.unstable_opts.thinlto {
634-
if enabled {
635-
if !self.thin_lto_supported {
636-
self.dcx().emit_fatal(errors::ThinLtoNotSupportedByBackend);
637-
}
638-
return config::Lto::ThinLocal;
639-
} else {
640-
return config::Lto::No;
641-
}
642-
}
643-
644631
// If there's only one codegen unit and LTO isn't enabled then there's
645632
// no need for ThinLTO so just return false.
646633
if self.codegen_units().as_usize() == 1 {

tests/ui/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ Tests on [AST lowering](https://rustc-dev-guide.rust-lang.org/ast-lowering.html)
903903

904904
## `tests/ui/lto/`
905905

906-
Exercise *Link-Time Optimization* (LTO), involving the flags `-C lto` or `-Z thinlto`.
906+
Exercise *Link-Time Optimization* (LTO), involving the flags `-C lto`.
907907

908908
## `tests/ui/lub-glb/`: LUB/GLB algorithm update
909909

tests/ui/lto/auxiliary/dylib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Z thinlto -C codegen-units=8
1+
//@ compile-flags: -C codegen-units=8
22

33
#[inline]
44
pub fn foo(b: u8) {

tests/ui/lto/auxiliary/msvc-imp-present.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ no-prefer-dynamic
2-
//@ compile-flags: -Z thinlto -C codegen-units=8 -C prefer-dynamic
2+
//@ compile-flags: -C codegen-units=8 -C prefer-dynamic
33

44
#![crate_type = "rlib"]
55
#![crate_type = "dylib"]

tests/ui/lto/msvc-imp-present.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ run-pass
22

33
//@ aux-build:msvc-imp-present.rs
4-
//@ compile-flags: -Z thinlto -C codegen-units=8
4+
//@ compile-flags: -C codegen-units=8
55
//@ no-prefer-dynamic
66

77
// On MSVC we have a "hack" where we emit symbols that look like `_imp_$name`

tests/ui/lto/thin-lto-global-allocator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-pass
2-
//@ compile-flags: -Z thinlto -C codegen-units=2
2+
//@ compile-flags: -C codegen-units=2
33

44
#[global_allocator]
55
static A: std::alloc::System = std::alloc::System;

tests/ui/lto/thin-lto-inlines.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ run-pass
22

3-
//@ compile-flags: -Z thinlto -C codegen-units=8 -O
3+
//@ compile-flags: -C codegen-units=8 -O
44
//@ ignore-emscripten can't inspect instructions on emscripten
55

66
// We want to assert here that ThinLTO will inline across codegen units. There's

tests/ui/lto/weak-works.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ run-pass
22

3-
//@ compile-flags: -C codegen-units=8 -Z thinlto
3+
//@ compile-flags: -C codegen-units=8
44
//@ ignore-i686-pc-windows-gnu
55
//@ ignore-x86_64-pc-windows-gnu
66

0 commit comments

Comments
 (0)