Auto merge of #131111 - matthiaskrgr:rollup-n6do187, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #130005 (Replace -Z default-hidden-visibility with -Z default-visibility)
 - #130229 (ptr::add/sub: do not claim equivalence with `offset(c as isize)`)
 - #130773 (Update Unicode escapes in `/library/core/src/char/methods.rs`)
 - #130933 (rustdoc: lists items that contain multiple paragraphs are more clear)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2024-10-01 19:29:26 +00:00
commit 06bb8364aa
19 changed files with 270 additions and 127 deletions

View file

@ -1,12 +0,0 @@
# `default-hidden-visibility`
The tracking issue for this feature is: https://github.com/rust-lang/compiler-team/issues/656
------------------------
This flag can be used to override the target's
[`default_hidden_visibility`](https://doc.rust-lang.org/beta/nightly-rustc/rustc_target/spec/struct.TargetOptions.html#structfield.default_hidden_visibility)
setting.
Using `-Zdefault_hidden_visibility=yes` is roughly equivalent to Clang's
[`-fvisibility=hidden`](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fvisibility)
cmdline flag.

View file

@ -0,0 +1,44 @@
# `default-visibility`
The tracking issue for this feature is: https://github.com/rust-lang/rust/issues/131090
------------------------
This flag can be used to override the target's
[`default_visibility`](https://doc.rust-lang.org/beta/nightly-rustc/rustc_target/spec/struct.TargetOptions.html#structfield.default_visibility)
setting.
This option only affects building of shared objects and should have no effect on executables.
Visibility an be set to one of three options:
* protected
* hidden
* interposable
## Hidden visibility
Using `-Zdefault-visibility=hidden` is roughly equivalent to Clang's
[`-fvisibility=hidden`](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fvisibility)
cmdline flag. Hidden symbols will not be exported from the created shared object, so cannot be
referenced from other shared objects or from executables.
## Protected visibility
Using `-Zdefault-visibility=protected` will cause rust-mangled symbols to be emitted with
"protected" visibility. This signals the compiler, the linker and the runtime linker that these
symbols cannot be overridden by the executable or by other shared objects earlier in the load order.
This will allow the compiler to emit direct references to symbols, which may improve performance. It
also removes the need for these symbols to be resolved when a shared object built with this option
is loaded.
Using protected visibility when linking with GNU ld prior to 2.40 will result in linker errors when
building for Linux. Other linkers such as LLD are not affected.
## Interposable
Using `-Zdefault-visibility=interposable` will cause symbols to be emitted with "default"
visibility. On platforms that support it, this makes it so that symbols can be interposed, which
means that they can be overridden by symbols with the same name from the executable or by other
shared objects earier in the load order.

View file

@ -960,6 +960,13 @@ pre, .rustdoc.src .example-wrap, .example-wrap .src-line-numbers {
display: inline-block;
}
.docblock li {
margin-bottom: .8em;
}
.docblock li p {
margin-bottom: .1em;
}
/* "where ..." clauses with block display are also smaller */
div.where {
white-space: pre-wrap;