Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the symbol Visibility enum #134261

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Document the symbol Visibility enum
  • Loading branch information
bjorn3 committed Dec 13, 2024
commit af3721e8132a8d5268a1e263f7058cdb65fbbac2
12 changes: 12 additions & 0 deletions compiler/rustc_middle/src/mir/mono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
Loading