diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-12-14 04:09:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-14 04:09:34 +0100 |
| commit | cb459fa4275f702524c93b8f3f61d15ccdfd4ef9 (patch) | |
| tree | db9032a4e49f53af39091f880e2c49142a39e402 | |
| parent | 0b5003eaf083a3525a7b2ee8b4745b8c95344afe (diff) | |
| parent | af3721e8132a8d5268a1e263f7058cdb65fbbac2 (diff) | |
| download | rust-cb459fa4275f702524c93b8f3f61d15ccdfd4ef9.tar.gz rust-cb459fa4275f702524c93b8f3f61d15ccdfd4ef9.zip | |
Rollup merge of #134261 - bjorn3:document_symbol_visibility, r=lqd
Document the symbol Visibility enum
| -rw-r--r-- | compiler/rustc_middle/src/mir/mono.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/mono.rs b/compiler/rustc_middle/src/mir/mono.rs index 1f50b67cb50..266dc7ad2b3 100644 --- a/compiler/rustc_middle/src/mir/mono.rs +++ b/compiler/rustc_middle/src/mir/mono.rs @@ -294,10 +294,22 @@ pub enum Linkage { Common, } +/// Specifies the symbol visibility with regards to dynamic linking. +/// +/// Visibility doesn't have any effect when linkage is internal. +/// +/// DSO means dynamic shared object, that is a dynamically linked executable or dylib. #[derive(Copy, Clone, PartialEq, Debug, HashStable)] pub enum Visibility { + /// Export the symbol from the DSO and apply overrides of the symbol by outside DSOs to within + /// the DSO if the object file format supports this. Default, + /// Hide the symbol outside of the defining DSO even when external linkage is used to export it + /// from the object file. Hidden, + /// Export the symbol from the DSO, but don't apply overrides of the symbol by outside DSOs to + /// within the DSO. Equivalent to default visibility with object file formats that don't support + /// overriding exported symbols by another DSO. Protected, } |
