Skip to content

Commit e6edc34

Browse files
committed
Remove Visibility::Protected.
Because it's unused.
1 parent dc25fbe commit e6edc34

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

compiler/rustc_codegen_gcc/src/base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pub fn visibility_to_gcc(linkage: Visibility) -> gccjit::Visibility {
2727
match linkage {
2828
Visibility::Default => gccjit::Visibility::Default,
2929
Visibility::Hidden => gccjit::Visibility::Hidden,
30-
Visibility::Protected => gccjit::Visibility::Protected,
3130
}
3231
}
3332

compiler/rustc_codegen_llvm/src/base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,5 @@ pub fn visibility_to_llvm(linkage: Visibility) -> llvm::Visibility {
171171
match linkage {
172172
Visibility::Default => llvm::Visibility::Default,
173173
Visibility::Hidden => llvm::Visibility::Hidden,
174-
Visibility::Protected => llvm::Visibility::Protected,
175174
}
176175
}

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,6 @@ extern "C" bool LLVMRustConstInt128Get(LLVMValueRef CV, bool sext, uint64_t *hig
16321632
enum class LLVMRustVisibility {
16331633
Default = 0,
16341634
Hidden = 1,
1635-
Protected = 2,
16361635
};
16371636

16381637
static LLVMRustVisibility toRust(LLVMVisibility Vis) {
@@ -1641,8 +1640,6 @@ static LLVMRustVisibility toRust(LLVMVisibility Vis) {
16411640
return LLVMRustVisibility::Default;
16421641
case LLVMHiddenVisibility:
16431642
return LLVMRustVisibility::Hidden;
1644-
case LLVMProtectedVisibility:
1645-
return LLVMRustVisibility::Protected;
16461643
}
16471644
report_fatal_error("Invalid LLVMRustVisibility value!");
16481645
}
@@ -1653,8 +1650,6 @@ static LLVMVisibility fromRust(LLVMRustVisibility Vis) {
16531650
return LLVMDefaultVisibility;
16541651
case LLVMRustVisibility::Hidden:
16551652
return LLVMHiddenVisibility;
1656-
case LLVMRustVisibility::Protected:
1657-
return LLVMProtectedVisibility;
16581653
}
16591654
report_fatal_error("Invalid LLVMRustVisibility value!");
16601655
}

compiler/rustc_middle/src/mir/mono.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,15 @@ pub enum Linkage {
256256
Common,
257257
}
258258

259+
/// Specifies the visibility style for a `MonoItem`.
260+
///
261+
/// See <https://llvm.org/docs/LangRef.html#visibility-styles> for more details.
259262
#[derive(Copy, Clone, PartialEq, Debug, HashStable)]
260263
pub enum Visibility {
261264
Default,
262265
Hidden,
263-
Protected,
266+
// Unused within rustc. If it's ever needed, revert the commit in #112451.
267+
//Protected,
264268
}
265269

266270
impl<'tcx> CodegenUnit<'tcx> {

0 commit comments

Comments
 (0)