Skip to content

Commit cb459fa

Browse files
authored
Rollup merge of #134261 - bjorn3:document_symbol_visibility, r=lqd
Document the symbol Visibility enum
2 parents 0b5003e + af3721e commit cb459fa

File tree

1 file changed

+12
-0
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+12
-0
lines changed

compiler/rustc_middle/src/mir/mono.rs

+12
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,22 @@ pub enum Linkage {
294294
Common,
295295
}
296296

297+
/// Specifies the symbol visibility with regards to dynamic linking.
298+
///
299+
/// Visibility doesn't have any effect when linkage is internal.
300+
///
301+
/// DSO means dynamic shared object, that is a dynamically linked executable or dylib.
297302
#[derive(Copy, Clone, PartialEq, Debug, HashStable)]
298303
pub enum Visibility {
304+
/// Export the symbol from the DSO and apply overrides of the symbol by outside DSOs to within
305+
/// the DSO if the object file format supports this.
299306
Default,
307+
/// Hide the symbol outside of the defining DSO even when external linkage is used to export it
308+
/// from the object file.
300309
Hidden,
310+
/// Export the symbol from the DSO, but don't apply overrides of the symbol by outside DSOs to
311+
/// within the DSO. Equivalent to default visibility with object file formats that don't support
312+
/// overriding exported symbols by another DSO.
301313
Protected,
302314
}
303315

0 commit comments

Comments
 (0)