about summary refs log tree commit diff
path: root/compiler/rustc_builtin_macros/src/source_util.rs
diff options
context:
space:
mode:
authorklensy <klensy@users.noreply.github.com>2022-04-05 15:52:53 +0300
committerklensy <klensy@users.noreply.github.com>2022-04-08 11:45:57 +0300
commitd0cc98689e3db7841c54c0ad1104dea87f811ff5 (patch)
tree9b577f2fe457711704db64063c5fd64d43b61850 /compiler/rustc_builtin_macros/src/source_util.rs
parentf262ca12aac76152c4b46cefcf8300f0249a5eb2 (diff)
downloadrust-d0cc98689e3db7841c54c0ad1104dea87f811ff5.tar.gz
rust-d0cc98689e3db7841c54c0ad1104dea87f811ff5.zip
check_doc_keyword: don't alloc string for emptiness check
check_doc_alias_value: get argument as Symbol to prevent needless string convertions

check_doc_attrs: don't alloc vec, iterate over slice. Vec introduced in #83149, but no perf run posted on merge

replace as_str() check with symbol check

get_single_str_from_tts: don't prealloc string

trivial string to str replace

LifetimeScopeForPath::NonElided use Vec<Symbol> instead of Vec<String>

AssertModuleSource use BTreeSet<Symbol> instead of BTreeSet<String>

CrateInfo.crate_name replace FxHashMap<CrateNum, String> with FxHashMap<CrateNum, Symbol>
Diffstat (limited to 'compiler/rustc_builtin_macros/src/source_util.rs')
-rw-r--r--compiler/rustc_builtin_macros/src/source_util.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_builtin_macros/src/source_util.rs b/compiler/rustc_builtin_macros/src/source_util.rs
index be628c9202c..41871f303b0 100644
--- a/compiler/rustc_builtin_macros/src/source_util.rs
+++ b/compiler/rustc_builtin_macros/src/source_util.rs
@@ -104,7 +104,7 @@ pub fn expand_include<'cx>(
         return DummyResult::any(sp);
     };
     // The file will be added to the code map by the parser
-    let file = match resolve_path(cx, file, sp) {
+    let file = match resolve_path(cx, file.as_str(), sp) {
         Ok(f) => f,
         Err(mut err) => {
             err.emit();
@@ -173,7 +173,7 @@ pub fn expand_include_str(
     let Some(file) = get_single_str_from_tts(cx, sp, tts, "include_str!") else {
         return DummyResult::any(sp);
     };
-    let file = match resolve_path(cx, file, sp) {
+    let file = match resolve_path(cx, file.as_str(), sp) {
         Ok(f) => f,
         Err(mut err) => {
             err.emit();
@@ -207,7 +207,7 @@ pub fn expand_include_bytes(
     let Some(file) = get_single_str_from_tts(cx, sp, tts, "include_bytes!") else {
         return DummyResult::any(sp);
     };
-    let file = match resolve_path(cx, file, sp) {
+    let file = match resolve_path(cx, file.as_str(), sp) {
         Ok(f) => f,
         Err(mut err) => {
             err.emit();