diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-12-06 12:46:10 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-12-07 20:30:02 +0000 |
| commit | d30848b30a4ba328b482e2e601de7517be2e5397 (patch) | |
| tree | be88050d57283774710d336c54c0e9961209ba39 /compiler/rustc_metadata/src/creader.rs | |
| parent | e60fbaf4ce768d13a6abc048bd34ee12995d18dc (diff) | |
| download | rust-d30848b30a4ba328b482e2e601de7517be2e5397.tar.gz rust-d30848b30a4ba328b482e2e601de7517be2e5397.zip | |
Use `Symbol` for the crate name instead of `String`/`str`
Diffstat (limited to 'compiler/rustc_metadata/src/creader.rs')
| -rw-r--r-- | compiler/rustc_metadata/src/creader.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_metadata/src/creader.rs b/compiler/rustc_metadata/src/creader.rs index 1a2389c7a84..efeaac8fe9a 100644 --- a/compiler/rustc_metadata/src/creader.rs +++ b/compiler/rustc_metadata/src/creader.rs @@ -245,7 +245,7 @@ impl<'a> CrateLoader<'a> { pub fn new( sess: &'a Session, metadata_loader: Box<MetadataLoaderDyn>, - local_crate_name: &str, + local_crate_name: Symbol, ) -> Self { let mut stable_crate_ids = FxHashMap::default(); stable_crate_ids.insert(sess.local_stable_crate_id(), LOCAL_CRATE); @@ -253,7 +253,7 @@ impl<'a> CrateLoader<'a> { CrateLoader { sess, metadata_loader, - local_crate_name: Symbol::intern(local_crate_name), + local_crate_name, cstore: CStore { // We add an empty entry for LOCAL_CRATE (which maps to zero) in // order to make array indices in `metas` match with the @@ -1000,7 +1000,7 @@ impl<'a> CrateLoader<'a> { ); let name = match orig_name { Some(orig_name) => { - validate_crate_name(self.sess, orig_name.as_str(), Some(item.span)); + validate_crate_name(self.sess, orig_name, Some(item.span)); orig_name } None => item.ident.name, |
