Skip to content
Open
Show file tree
Hide file tree
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
24 changes: 10 additions & 14 deletions compiler/rustc_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ use rustc_middle::util::Providers;
use rustc_session::Session;
use rustc_session::config::{OptLevel, OutputFilenames, PrintKind, PrintRequest};
use rustc_span::Symbol;
use rustc_target::spec::{CodeModel, RelocModel, TlsModel};

mod back {
pub(crate) mod archive;
Expand Down Expand Up @@ -267,32 +268,27 @@ impl CodegenBackend for LlvmCodegenBackend {
match req.kind {
PrintKind::RelocationModels => {
writeln!(out, "Available relocation models:").unwrap();
for name in &[
"static",
"pic",
"pie",
"dynamic-no-pic",
"ropi",
"rwpi",
"ropi-rwpi",
"default",
] {
for name in RelocModel::ALL
.iter()
.copied()
.map(RelocModel::as_str)
.into_iter()
.chain(["default"])
{
writeln!(out, " {name}").unwrap();
}
writeln!(out).unwrap();
}
PrintKind::CodeModels => {
writeln!(out, "Available code models:").unwrap();
for name in &["tiny", "small", "kernel", "medium", "large"] {
for name in CodeModel::ALL.iter().copied().map(CodeModel::as_str) {
writeln!(out, " {name}").unwrap();
}
writeln!(out).unwrap();
}
PrintKind::TlsModels => {
writeln!(out, "Available TLS models:").unwrap();
for name in
&["global-dynamic", "local-dynamic", "initial-exec", "local-exec", "emulated"]
{
for name in TlsModel::ALL.iter().copied().map(TlsModel::as_str) {
writeln!(out, " {name}").unwrap();
}
writeln!(out).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/diagnostic_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl IntoDiagArg for PathBuf {

impl IntoDiagArg for PanicStrategy {
fn into_diag_arg(self, _: &mut Option<std::path::PathBuf>) -> DiagArgValue {
DiagArgValue::Str(Cow::Owned(self.desc().to_string()))
DiagArgValue::Str(Cow::Owned(self.as_str().to_string()))
}
}

Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_session/src/config/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,12 @@ impl CheckCfg {

ins!(sym::overflow_checks, no_values);

ins!(sym::panic, empty_values).extend(&PanicStrategy::all());
ins!(sym::panic, empty_values).extend(PanicStrategy::ALL.iter().map(|p| p.desc_symbol()));

ins!(sym::proc_macro, no_values);

ins!(sym::relocation_model, empty_values).extend(RelocModel::all());
ins!(sym::relocation_model, empty_values)
.extend(RelocModel::ALL.iter().map(|m| m.desc_symbol()));

let sanitize_values = SanitizerSet::all()
.into_iter()
Expand Down
Loading
Loading