diff options
| author | ljedrz <ljedrz@gmail.com> | 2018-10-06 11:37:28 +0200 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2018-11-10 19:22:37 +0100 |
| commit | 1d1dc48407e9feb5443173aefb3fd0db252e82c7 (patch) | |
| tree | ef96548349f1650735bbf670a3e49a505c335453 /src/librustc_codegen_utils | |
| parent | 06118eac4c602a22d2004c98756a95f2c5ec95d5 (diff) | |
| download | rust-1d1dc48407e9feb5443173aefb3fd0db252e82c7.tar.gz rust-1d1dc48407e9feb5443173aefb3fd0db252e82c7.zip | |
codegen_llvm_back: whitespace & formatting fixes
Diffstat (limited to 'src/librustc_codegen_utils')
| -rw-r--r-- | src/librustc_codegen_utils/linker.rs | 11 | ||||
| -rw-r--r-- | src/librustc_codegen_utils/symbol_export.rs | 11 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/librustc_codegen_utils/linker.rs b/src/librustc_codegen_utils/linker.rs index c1f41fd509a..501166af906 100644 --- a/src/librustc_codegen_utils/linker.rs +++ b/src/librustc_codegen_utils/linker.rs @@ -224,9 +224,9 @@ impl<'a> GccLinker<'a> { } impl<'a> Linker for GccLinker<'a> { - fn link_dylib(&mut self, lib: &str) { self.hint_dynamic(); self.cmd.arg(format!("-l{}",lib)); } + fn link_dylib(&mut self, lib: &str) { self.hint_dynamic(); self.cmd.arg(format!("-l{}", lib)); } fn link_staticlib(&mut self, lib: &str) { - self.hint_static(); self.cmd.arg(format!("-l{}",lib)); + self.hint_static(); self.cmd.arg(format!("-l{}", lib)); } fn link_rlib(&mut self, lib: &Path) { self.hint_static(); self.cmd.arg(lib); } fn include_path(&mut self, path: &Path) { self.cmd.arg("-L").arg(path); } @@ -243,7 +243,7 @@ impl<'a> Linker for GccLinker<'a> { fn link_rust_dylib(&mut self, lib: &str, _path: &Path) { self.hint_dynamic(); - self.cmd.arg(format!("-l{}",lib)); + self.cmd.arg(format!("-l{}", lib)); } fn link_framework(&mut self, framework: &str) { @@ -261,7 +261,7 @@ impl<'a> Linker for GccLinker<'a> { self.hint_static(); let target = &self.sess.target.target; if !target.options.is_like_osx { - self.linker_arg("--whole-archive").cmd.arg(format!("-l{}",lib)); + self.linker_arg("--whole-archive").cmd.arg(format!("-l{}", lib)); self.linker_arg("--no-whole-archive"); } else { // -force_load is the macOS equivalent of --whole-archive, but it @@ -373,8 +373,7 @@ impl<'a> Linker for GccLinker<'a> { // purely to support rustbuild right now, we should get a more // principled solution at some point to force the compiler to pass // the right `-Wl,-install_name` with an `@rpath` in it. - if self.sess.opts.cg.rpath || - self.sess.opts.debugging_opts.osx_rpath_install_name { + if self.sess.opts.cg.rpath || self.sess.opts.debugging_opts.osx_rpath_install_name { self.linker_arg("-install_name"); let mut v = OsString::from("@rpath/"); v.push(out_filename.file_name().unwrap()); diff --git a/src/librustc_codegen_utils/symbol_export.rs b/src/librustc_codegen_utils/symbol_export.rs index 6c40296b2ef..dff7e518630 100644 --- a/src/librustc_codegen_utils/symbol_export.rs +++ b/src/librustc_codegen_utils/symbol_export.rs @@ -47,11 +47,10 @@ fn crate_export_threshold(crate_type: config::CrateType) -> SymbolExportLevel { } } -pub fn crates_export_threshold(crate_types: &[config::CrateType]) - -> SymbolExportLevel { - if crate_types.iter().any(|&crate_type| { - crate_export_threshold(crate_type) == SymbolExportLevel::Rust - }) { +pub fn crates_export_threshold(crate_types: &[config::CrateType]) -> SymbolExportLevel { + if crate_types.iter().any(|&crate_type| + crate_export_threshold(crate_type) == SymbolExportLevel::Rust) + { SymbolExportLevel::Rust } else { SymbolExportLevel::C @@ -359,7 +358,7 @@ fn is_unreachable_local_definition_provider(tcx: TyCtxt, def_id: DefId) -> bool !tcx.reachable_set(LOCAL_CRATE).0.contains(&node_id) } else { bug!("is_unreachable_local_definition called with non-local DefId: {:?}", - def_id) + def_id) } } |
