diff options
| author | SLASHLogin <loginmlgxd@gmail.com> | 2022-08-25 18:36:15 +0200 |
|---|---|---|
| committer | SLASHLogin <loginmlgxd@gmail.com> | 2022-11-09 14:56:20 +0100 |
| commit | b1647903f86970e4bdedc599ee1af8036a75ef26 (patch) | |
| tree | 0a0851ee7b44e95d2de63dc255b4b0c400cde589 /compiler/rustc_codegen_llvm/src | |
| parent | 21b04265c1bac993227a03ad2a0a50d45386a9b5 (diff) | |
| download | rust-b1647903f86970e4bdedc599ee1af8036a75ef26.tar.gz rust-b1647903f86970e4bdedc599ee1af8036a75ef26.zip | |
Change String in structs to &'a str
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/errors.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm_util.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_llvm/src/errors.rs b/compiler/rustc_codegen_llvm/src/errors.rs index c9af545a818..cf896f38c8c 100644 --- a/compiler/rustc_codegen_llvm/src/errors.rs +++ b/compiler/rustc_codegen_llvm/src/errors.rs @@ -2,9 +2,9 @@ use rustc_errors::fluent; use rustc_errors::DiagnosticBuilder; use rustc_session::SessionDiagnostic; -pub(crate) enum UnknownCTargetFeature { - UnknownFeaturePrefix { feature: String }, - UnknownFeature { feature: String, rust_feature: Option<String> }, +pub(crate) enum UnknownCTargetFeature<'a> { + UnknownFeaturePrefix { feature: &'a str }, + UnknownFeature { feature: &'a str, rust_feature: Option<&'a str> }, } impl SessionDiagnostic<'_, ()> for UnknownCTargetFeature { diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index 81b325fee2d..f0122d5824f 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -436,7 +436,7 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str Some(_) => { if diagnostics { sess.emit_warning(UnknownCTargetFeature::UnknownFeaturePrefix { - feature: s.to_string(), + feature: s, }); } return None; @@ -455,8 +455,8 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str } }); sess.emit_warning(UnknownCTargetFeature::UnknownFeature { - feature: feature.to_string(), - rust_feature: rust_feature.map(|f| f.to_string()), + feature, + rust_feature, }); } |
