diff options
author | badumbatish <tanghocle456@gmail.com> | 2024-08-04 12:43:09 -0700 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-19 15:32:05 +0100 |
commit | e2126a193567e97e57c854ef59952c6df3063bbf (patch) | |
tree | 5ba71dac6a275fec48f7e4c7e10f4edbd57aba9f /gcc | |
parent | bb0abd09cf8038bb8c1c0184f2d7ae83b6527540 (diff) | |
download | gcc-e2126a193567e97e57c854ef59952c6df3063bbf.zip gcc-e2126a193567e97e57c854ef59952c6df3063bbf.tar.gz gcc-e2126a193567e97e57c854ef59952c6df3063bbf.tar.bz2 |
gccrs: Fix warnings from const auto& to const auto
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve.cc (NameResolution::go):
Fix warnings from const auto& to const auto
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve.cc b/gcc/rust/resolve/rust-ast-resolve.cc index a467d1e..a093ef7 100644 --- a/gcc/rust/resolve/rust-ast-resolve.cc +++ b/gcc/rust/resolve/rust-ast-resolve.cc @@ -63,7 +63,10 @@ NameResolution::go (AST::Crate &crate) { // lookup current crate name CrateNum cnum = mappings.get_current_crate (); - const auto &crate_name = mappings.get_crate_name (cnum).value (); + + // Clones the crate name instead of references due to gcc's possibly + // dangling references warnings + const auto crate_name = mappings.get_crate_name (cnum).value (); // setup the ribs NodeId scope_node_id = crate.get_node_id (); |