Skip to content

Commit b164790

Browse files
committed
Change String in structs to &'a str
1 parent 21b0426 commit b164790

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/rustc_codegen_llvm/src/errors.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use rustc_errors::fluent;
22
use rustc_errors::DiagnosticBuilder;
33
use rustc_session::SessionDiagnostic;
44

5-
pub(crate) enum UnknownCTargetFeature {
6-
UnknownFeaturePrefix { feature: String },
7-
UnknownFeature { feature: String, rust_feature: Option<String> },
5+
pub(crate) enum UnknownCTargetFeature<'a> {
6+
UnknownFeaturePrefix { feature: &'a str },
7+
UnknownFeature { feature: &'a str, rust_feature: Option<&'a str> },
88
}
99

1010
impl SessionDiagnostic<'_, ()> for UnknownCTargetFeature {

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
436436
Some(_) => {
437437
if diagnostics {
438438
sess.emit_warning(UnknownCTargetFeature::UnknownFeaturePrefix {
439-
feature: s.to_string(),
439+
feature: s,
440440
});
441441
}
442442
return None;
@@ -455,8 +455,8 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
455455
}
456456
});
457457
sess.emit_warning(UnknownCTargetFeature::UnknownFeature {
458-
feature: feature.to_string(),
459-
rust_feature: rust_feature.map(|f| f.to_string()),
458+
feature,
459+
rust_feature,
460460
});
461461
}
462462

0 commit comments

Comments
 (0)