Skip to content

Commit 2815f40

Browse files
committed
Recommend -Zshare-generics=false
opt-level=z|s implicitly enables -Zshare-generics=true, which sometimes has a positive and sometimes has a negative impact.
1 parent f1db29c commit 2815f40

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ opt-level = "z" # Optimize for size.
7272
> It is recommended to experiment with different levels to find the right balance for your project.
7373
> There may be surprising results, such as ... the `"s"` and `"z"` levels not being necessarily
7474
> smaller.
75+
>
76+
> When using `"z"`, you can also try the `-Zshare-generics=false` rustc flag with the nightly toolchain
77+
> (via RUSTFLAGS).
7578
7679
# Enable Link Time Optimization (LTO)
7780

@@ -438,4 +441,4 @@ use std::alloc::System;
438441

439442
#[global_allocator]
440443
static A: System = System;
441-
```
444+
```

0 commit comments

Comments
 (0)