Skip to content

Commit 5488e49

Browse files
committed
and few more
warning: this argument is a mutable reference, but not used mutably --> compiler\rustc_codegen_ssa\src\back\rpath.rs:80:41 | 80 | fn get_rpath_relative_to_output(config: &mut RPathConfig<'_>, lib: &Path) -> OsString { | ^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&RPathConfig<'_>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut warning: this argument is a mutable reference, but not used mutably --> compiler\rustc_codegen_ssa\src\back\rpath.rs:76:42 | 76 | fn get_rpaths_relative_to_output(config: &mut RPathConfig<'_>) -> Vec<OsString> { | ^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&RPathConfig<'_>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut warning: this argument is a mutable reference, but not used mutably --> compiler\rustc_codegen_ssa\src\back\rpath.rs:55:23 | 55 | fn get_rpaths(config: &mut RPathConfig<'_>) -> Vec<OsString> { | ^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&RPathConfig<'_>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut warning: this argument is a mutable reference, but not used mutably --> compiler\rustc_codegen_ssa\src\back\rpath.rs:15:32 | 15 | pub fn get_rpath_flags(config: &mut RPathConfig<'_>) -> Vec<OsString> { | ^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&RPathConfig<'_>` | = warning: changing this function will impact semver compatibility = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
1 parent c64a440 commit 5488e49

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,14 +2089,14 @@ fn add_rpath_args(
20892089
.map(|(path, _)| &**path)
20902090
})
20912091
.collect::<Vec<_>>();
2092-
let mut rpath_config = RPathConfig {
2092+
let rpath_config = RPathConfig {
20932093
libs: &*libs,
20942094
out_filename: out_filename.to_path_buf(),
20952095
has_rpath: sess.target.has_rpath,
20962096
is_like_osx: sess.target.is_like_osx,
20972097
linker_is_gnu: sess.target.linker_flavor.is_gnu(),
20982098
};
2099-
cmd.args(&rpath::get_rpath_flags(&mut rpath_config));
2099+
cmd.args(&rpath::get_rpath_flags(&rpath_config));
21002100
}
21012101
}
21022102

compiler/rustc_codegen_ssa/src/back/rpath.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct RPathConfig<'a> {
1212
pub linker_is_gnu: bool,
1313
}
1414

15-
pub fn get_rpath_flags(config: &mut RPathConfig<'_>) -> Vec<OsString> {
15+
pub fn get_rpath_flags(config: &RPathConfig<'_>) -> Vec<OsString> {
1616
// No rpath on windows
1717
if !config.has_rpath {
1818
return Vec::new();
@@ -52,7 +52,7 @@ fn rpaths_to_flags(rpaths: Vec<OsString>) -> Vec<OsString> {
5252
ret
5353
}
5454

55-
fn get_rpaths(config: &mut RPathConfig<'_>) -> Vec<OsString> {
55+
fn get_rpaths(config: &RPathConfig<'_>) -> Vec<OsString> {
5656
debug!("output: {:?}", config.out_filename.display());
5757
debug!("libs:");
5858
for libpath in config.libs {
@@ -73,11 +73,11 @@ fn get_rpaths(config: &mut RPathConfig<'_>) -> Vec<OsString> {
7373
minimize_rpaths(&rpaths)
7474
}
7575

76-
fn get_rpaths_relative_to_output(config: &mut RPathConfig<'_>) -> Vec<OsString> {
76+
fn get_rpaths_relative_to_output(config: &RPathConfig<'_>) -> Vec<OsString> {
7777
config.libs.iter().map(|a| get_rpath_relative_to_output(config, a)).collect()
7878
}
7979

80-
fn get_rpath_relative_to_output(config: &mut RPathConfig<'_>, lib: &Path) -> OsString {
80+
fn get_rpath_relative_to_output(config: &RPathConfig<'_>, lib: &Path) -> OsString {
8181
// Mac doesn't appear to support $ORIGIN
8282
let prefix = if config.is_like_osx { "@loader_path" } else { "$ORIGIN" };
8383

0 commit comments

Comments
 (0)