diff options
Diffstat (limited to 'dev-lang/rust/files')
-rw-r--r-- | dev-lang/rust/files/1.29.2-clippy-sysroot.patch | 62 | ||||
-rw-r--r-- | dev-lang/rust/files/1.30.1-clippy-sysroot.patch | 62 | ||||
-rw-r--r-- | dev-lang/rust/files/1.32.0-fix-configure-of-bundled-llvm.patch | 32 | ||||
-rw-r--r-- | dev-lang/rust/files/1.32.0-libressl.patch | 30 | ||||
-rw-r--r-- | dev-lang/rust/files/1.32.0-system-llvm-7-SIGSEGV.patch | 33 | ||||
-rw-r--r-- | dev-lang/rust/files/1.33.0-clippy-sysroot.patch | 62 |
6 files changed, 0 insertions, 281 deletions
diff --git a/dev-lang/rust/files/1.29.2-clippy-sysroot.patch b/dev-lang/rust/files/1.29.2-clippy-sysroot.patch deleted file mode 100644 index 6a527e5a0206..000000000000 --- a/dev-lang/rust/files/1.29.2-clippy-sysroot.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- a/src/tools/clippy/src/driver.rs 2018-10-04 16:30:42.438486058 +0300 -+++ b/src/tools/clippy/src/driver.rs 2018-10-04 16:31:45.044484028 +0300 -@@ -20,54 +20,22 @@ - return; - } - -- let sys_root = option_env!("SYSROOT") -- .map(String::from) -- .or_else(|| std::env::var("SYSROOT").ok()) -- .or_else(|| { -- let home = option_env!("RUSTUP_HOME").or(option_env!("MULTIRUST_HOME")); -- let toolchain = option_env!("RUSTUP_TOOLCHAIN").or(option_env!("MULTIRUST_TOOLCHAIN")); -- home.and_then(|home| toolchain.map(|toolchain| format!("{}/toolchains/{}", home, toolchain))) -- }) -- .or_else(|| { -- Command::new("rustc") -- .arg("--print") -- .arg("sysroot") -- .output() -- .ok() -- .and_then(|out| String::from_utf8(out.stdout).ok()) -- .map(|s| s.trim().to_owned()) -- }) -- .expect("need to specify SYSROOT env var during clippy compilation, or use rustup or multirust"); -- - // Setting RUSTC_WRAPPER causes Cargo to pass 'rustc' as the first argument. - // We're invoking the compiler programmatically, so we ignore this/ -- let mut orig_args: Vec<String> = env::args().collect(); -- if orig_args.len() <= 1 { -+ let mut args: Vec<String> = env::args().collect(); -+ if args.len() <= 1 { - std::process::exit(1); - } -- if orig_args[1] == "rustc" { -+ if args[1] == "rustc" { - // we still want to be able to invoke it normally though -- orig_args.remove(1); -+ args.remove(1); - } -- // this conditional check for the --sysroot flag is there so users can call -- // `clippy_driver` directly -- // without having to pass --sysroot or anything -- let mut args: Vec<String> = if orig_args.iter().any(|s| s == "--sysroot") { -- orig_args.clone() -- } else { -- orig_args -- .clone() -- .into_iter() -- .chain(Some("--sysroot".to_owned())) -- .chain(Some(sys_root)) -- .collect() -- }; - - // this check ensures that dependencies are built but not linted and the final - // crate is - // linted but not built - let clippy_enabled = env::var("CLIPPY_TESTS").ok().map_or(false, |val| val == "true") -- || orig_args.iter().any(|s| s == "--emit=dep-info,metadata"); -+ || args.iter().any(|s| s == "--emit=dep-info,metadata"); - - if clippy_enabled { - args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]); diff --git a/dev-lang/rust/files/1.30.1-clippy-sysroot.patch b/dev-lang/rust/files/1.30.1-clippy-sysroot.patch deleted file mode 100644 index d38f8ba5bae8..000000000000 --- a/dev-lang/rust/files/1.30.1-clippy-sysroot.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- a/src/tools/clippy/src/driver.rs 2018-10-25 20:09:06.143109996 +0300 -+++ b/src/tools/clippy/src/driver.rs 2018-10-25 20:11:09.204106005 +0300 -@@ -29,54 +29,22 @@ - exit(0); - } - -- let sys_root = option_env!("SYSROOT") -- .map(String::from) -- .or_else(|| std::env::var("SYSROOT").ok()) -- .or_else(|| { -- let home = option_env!("RUSTUP_HOME").or(option_env!("MULTIRUST_HOME")); -- let toolchain = option_env!("RUSTUP_TOOLCHAIN").or(option_env!("MULTIRUST_TOOLCHAIN")); -- home.and_then(|home| toolchain.map(|toolchain| format!("{}/toolchains/{}", home, toolchain))) -- }) -- .or_else(|| { -- Command::new("rustc") -- .arg("--print") -- .arg("sysroot") -- .output() -- .ok() -- .and_then(|out| String::from_utf8(out.stdout).ok()) -- .map(|s| s.trim().to_owned()) -- }) -- .expect("need to specify SYSROOT env var during clippy compilation, or use rustup or multirust"); -- - // Setting RUSTC_WRAPPER causes Cargo to pass 'rustc' as the first argument. - // We're invoking the compiler programmatically, so we ignore this/ -- let mut orig_args: Vec<String> = env::args().collect(); -- if orig_args.len() <= 1 { -+ let mut args: Vec<String> = env::args().collect(); -+ if args.len() <= 1 { - std::process::exit(1); - } -- if Path::new(&orig_args[1]).file_stem() == Some("rustc".as_ref()) { -+ if Path::new(&args[1]).file_stem() == Some("rustc".as_ref()) { - // we still want to be able to invoke it normally though -- orig_args.remove(1); -+ args.remove(1); - } -- // this conditional check for the --sysroot flag is there so users can call -- // `clippy_driver` directly -- // without having to pass --sysroot or anything -- let mut args: Vec<String> = if orig_args.iter().any(|s| s == "--sysroot") { -- orig_args.clone() -- } else { -- orig_args -- .clone() -- .into_iter() -- .chain(Some("--sysroot".to_owned())) -- .chain(Some(sys_root)) -- .collect() -- }; - - // this check ensures that dependencies are built but not linted and the final - // crate is - // linted but not built - let clippy_enabled = env::var("CLIPPY_TESTS").ok().map_or(false, |val| val == "true") -- || orig_args.iter().any(|s| s == "--emit=dep-info,metadata"); -+ || args.iter().any(|s| s == "--emit=dep-info,metadata"); - - if clippy_enabled { - args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]); diff --git a/dev-lang/rust/files/1.32.0-fix-configure-of-bundled-llvm.patch b/dev-lang/rust/files/1.32.0-fix-configure-of-bundled-llvm.patch deleted file mode 100644 index eaeab87774eb..000000000000 --- a/dev-lang/rust/files/1.32.0-fix-configure-of-bundled-llvm.patch +++ /dev/null @@ -1,32 +0,0 @@ -Revert "[CMake] Unconditionally add .h and .td files to target sources" - -This reverts commit https://github.com/llvm-mirror/llvm/commit/6fb010f388bb2cb2f00fe039123092308ac4865d. - -Bug: https://bugs.gentoo.org/675752#c7 ---- a/src/llvm/cmake/modules/LLVMProcessSources.cmake -+++ b/src/llvm/cmake/modules/LLVMProcessSources.cmake -@@ -52,15 +52,16 @@ function(llvm_process_sources OUT_VAR) - cmake_parse_arguments(ARG "" "" "ADDITIONAL_HEADERS;ADDITIONAL_HEADER_DIRS" ${ARGN}) - set(sources ${ARG_UNPARSED_ARGUMENTS}) - llvm_check_source_file_list( ${sources} ) -- -- # This adds .td and .h files to the Visual Studio solution: -- add_td_sources(sources) -- find_all_header_files(hdrs "${ARG_ADDITIONAL_HEADER_DIRS}") -- if (hdrs) -- set_source_files_properties(${hdrs} PROPERTIES HEADER_FILE_ONLY ON) -+ if( LLVM_ENABLE_IDE ) -+ # This adds .td and .h files to the Visual Studio solution: -+ add_td_sources(sources) -+ find_all_header_files(hdrs "${ARG_ADDITIONAL_HEADER_DIRS}") -+ if (hdrs) -+ set_source_files_properties(${hdrs} PROPERTIES HEADER_FILE_ONLY ON) -+ endif() -+ set_source_files_properties(${ARG_ADDITIONAL_HEADERS} PROPERTIES HEADER_FILE_ONLY ON) -+ list(APPEND sources ${ARG_ADDITIONAL_HEADERS} ${hdrs}) - endif() -- set_source_files_properties(${ARG_ADDITIONAL_HEADERS} PROPERTIES HEADER_FILE_ONLY ON) -- list(APPEND sources ${ARG_ADDITIONAL_HEADERS} ${hdrs}) - - set( ${OUT_VAR} ${sources} PARENT_SCOPE ) - endfunction(llvm_process_sources) diff --git a/dev-lang/rust/files/1.32.0-libressl.patch b/dev-lang/rust/files/1.32.0-libressl.patch deleted file mode 100644 index 04e7fa8a4f34..000000000000 --- a/dev-lang/rust/files/1.32.0-libressl.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/vendor/openssl-sys/.cargo-checksum.json b/vendor/openssl-sys/.cargo-checksum.json -index 0a703777e..0063f9e9d 100644 ---- a/vendor/openssl-sys/.cargo-checksum.json -+++ b/vendor/openssl-sys/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.toml":"e40f8c3ccf6a2b34f50ae9cee3396ac398944ee253c1e5dabac802ee89732ba2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"96a414be6e7e061a21a9e39a61449039f6791225264032641dd044a1a9b88111","build/cfgs.rs":"fae5176c2b149d190c9611b58c5882312b5c0e483d1a404cfdf850473314a58f","build/main.rs":"f509c63668156ce48b93d05d5483a5bfb112dc8f786ff6296f7801add2db7452","src/aes.rs":"660efd70f809cb2f5dbbf527be8f9592911776bab7dafa1fc4cc72dd9a576b67","src/asn1.rs":"4f12d2f4c2a493888db669d1ecfd55df40861a78cae65957f801ed91dc2cae30","src/bio.rs":"5c6f394a78f258af3babb68330fa3571610476c4c3ba3404359db928f2f706ee","src/bn.rs":"c71b9c79f704a94a889d27bf75e7e5b1f9f10b0df0aeb485aef509cf05d7467f","src/cms.rs":"29aa053b67b47515fd15812aa0a90ff35dd9fa347da2beeba96d6deafeb9d945","src/conf.rs":"511e008c18039f54d856d70b80009426fc7f4ce34fe4304e2c58ebf465031de0","src/crypto.rs":"f6e8a116940755b2b53e3d0d49d1b451fc6e4269831fd1cfcee9d6ed404cf487","src/dh.rs":"520b282b92fa372a75bc16696dc3ee7a9a5752e517a18862182a3e9f5a976d28","src/dsa.rs":"3c294c5c45235497396ac803b723b3a0cb5bd3609f5dec18338b5b014c2adeb9","src/dtls1.rs":"45e1dbf94a42d587fd948d553dc30187aa6aa2b5b82d554cf725ff36df768aa0","src/ec.rs":"b22d27b01a70652384866b3d0d01d2f7a0421b2ba2db9268ed379fef4b1ac034","src/err.rs":"81230711e081277e0b6dae4ff21266052d075688c758c2b0720001849ef9192d","src/evp.rs":"57f094c7fee0a6b0611e7f8829663bff525a607e11a35eb77dc30eb159b2139a","src/hmac.rs":"fa3976d94a1383f300bdec228270afb8b47c97bb019d727c7d59ba783be3c42e","src/lib.rs":"17b5a1faa0fe3ab777c8cb0039a3dffd8922b211bf1330c2cd0c3e02f624353c","src/macros.rs":"a7c95174fd4cfeb42f730c7c0744194009520249888dbf43968571219fd6dfa1","src/obj_mac.rs":"9c20609db7115c9edb99185375426169cb5b7caee839d892b556e92285e65309","src/object.rs":"7539eb2164c3fe2162a339ef5b45f1c835010a1522307803815779a01825eed7","src/ocsp.rs":"1db59566d2f072f7ae981f0c07e1604fcdf60e66845afe0689d588f8e4272115","src/ossl_typ.rs":"619177f939328597e4bcf9c41fdf4d0aa9207d779c6e0dafddbe2eab9b1a6a98","src/pem.rs":"3ae1c53dbc126a04c188575294111cc04c215c2f3e031192d5cc05952f011ddf","src/pkcs12.rs":"93aab2820008ad90dc346a7dcc02f9201d94bff0bb7d1d71031c097850287c50","src/pkcs7.rs":"5370c8d4bfbf1502fa33aff635cb730e7c87814580f1df9bdb1412a492377813","src/rand.rs":"156e605ecb45d4e1b7a7c404003ccd19c4a2226cbfe47938ad1dce240ed4369f","src/rsa.rs":"a0bf64f1f8ff9f6e5dbed6c38d8fa2d3d1c5dfcfe6dd3ff79f7737b072ce4681","src/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/sha.rs":"05044d221d8d205010a4e3760c0b5c0e2e923e165db0d65f9a8c9bcedaad9961","src/srtp.rs":"306047f3f31828fe7d15de154b375f071ae07012a94c0b5c909f5fe57962a11b","src/ssl.rs":"e69d3b9b8f2f8ae1ed3905a4dbe064ad1b7c1eaf21d7eabb86ecdb5b41e2120a","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/tls1.rs":"fd85a1683064def0a9e07d803b90102229adc1d58fa19cf4e56976f0dd7425b9","src/x509.rs":"839be2feb74755ab7df66a024ad27dfa70ce4f7889229d9152ba999f3a54b914","src/x509_vfy.rs":"5609f6300ab37a4d4755c81f7af1e6bb93a2f1a6f333c6e42f1e73ebf83ddc05","src/x509v3.rs":"66fd646ea4caf5ce81e3c881e88d85462519c4e97a7f82e82ca8ac52ea830ad2"},"package":"ff3d1b390ab1b9700f682ad95a30dc9c0f40dd212ca57266012cfc678b0e365a"} -\ No newline at end of file -+{"files":{"Cargo.toml":"e40f8c3ccf6a2b34f50ae9cee3396ac398944ee253c1e5dabac802ee89732ba2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"96a414be6e7e061a21a9e39a61449039f6791225264032641dd044a1a9b88111","build/cfgs.rs":"fae5176c2b149d190c9611b58c5882312b5c0e483d1a404cfdf850473314a58f","build/main.rs":"0fd6fd2d7215f6b4a2065d352708155938f268a51df044fb7bd0b184b7cd122b","src/aes.rs":"660efd70f809cb2f5dbbf527be8f9592911776bab7dafa1fc4cc72dd9a576b67","src/asn1.rs":"4f12d2f4c2a493888db669d1ecfd55df40861a78cae65957f801ed91dc2cae30","src/bio.rs":"5c6f394a78f258af3babb68330fa3571610476c4c3ba3404359db928f2f706ee","src/bn.rs":"c71b9c79f704a94a889d27bf75e7e5b1f9f10b0df0aeb485aef509cf05d7467f","src/cms.rs":"29aa053b67b47515fd15812aa0a90ff35dd9fa347da2beeba96d6deafeb9d945","src/conf.rs":"511e008c18039f54d856d70b80009426fc7f4ce34fe4304e2c58ebf465031de0","src/crypto.rs":"f6e8a116940755b2b53e3d0d49d1b451fc6e4269831fd1cfcee9d6ed404cf487","src/dh.rs":"520b282b92fa372a75bc16696dc3ee7a9a5752e517a18862182a3e9f5a976d28","src/dsa.rs":"3c294c5c45235497396ac803b723b3a0cb5bd3609f5dec18338b5b014c2adeb9","src/dtls1.rs":"45e1dbf94a42d587fd948d553dc30187aa6aa2b5b82d554cf725ff36df768aa0","src/ec.rs":"b22d27b01a70652384866b3d0d01d2f7a0421b2ba2db9268ed379fef4b1ac034","src/err.rs":"81230711e081277e0b6dae4ff21266052d075688c758c2b0720001849ef9192d","src/evp.rs":"57f094c7fee0a6b0611e7f8829663bff525a607e11a35eb77dc30eb159b2139a","src/hmac.rs":"fa3976d94a1383f300bdec228270afb8b47c97bb019d727c7d59ba783be3c42e","src/lib.rs":"17b5a1faa0fe3ab777c8cb0039a3dffd8922b211bf1330c2cd0c3e02f624353c","src/macros.rs":"a7c95174fd4cfeb42f730c7c0744194009520249888dbf43968571219fd6dfa1","src/obj_mac.rs":"9c20609db7115c9edb99185375426169cb5b7caee839d892b556e92285e65309","src/object.rs":"7539eb2164c3fe2162a339ef5b45f1c835010a1522307803815779a01825eed7","src/ocsp.rs":"1db59566d2f072f7ae981f0c07e1604fcdf60e66845afe0689d588f8e4272115","src/ossl_typ.rs":"619177f939328597e4bcf9c41fdf4d0aa9207d779c6e0dafddbe2eab9b1a6a98","src/pem.rs":"3ae1c53dbc126a04c188575294111cc04c215c2f3e031192d5cc05952f011ddf","src/pkcs12.rs":"93aab2820008ad90dc346a7dcc02f9201d94bff0bb7d1d71031c097850287c50","src/pkcs7.rs":"5370c8d4bfbf1502fa33aff635cb730e7c87814580f1df9bdb1412a492377813","src/rand.rs":"156e605ecb45d4e1b7a7c404003ccd19c4a2226cbfe47938ad1dce240ed4369f","src/rsa.rs":"a0bf64f1f8ff9f6e5dbed6c38d8fa2d3d1c5dfcfe6dd3ff79f7737b072ce4681","src/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/sha.rs":"05044d221d8d205010a4e3760c0b5c0e2e923e165db0d65f9a8c9bcedaad9961","src/srtp.rs":"306047f3f31828fe7d15de154b375f071ae07012a94c0b5c909f5fe57962a11b","src/ssl.rs":"e69d3b9b8f2f8ae1ed3905a4dbe064ad1b7c1eaf21d7eabb86ecdb5b41e2120a","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/tls1.rs":"fd85a1683064def0a9e07d803b90102229adc1d58fa19cf4e56976f0dd7425b9","src/x509.rs":"839be2feb74755ab7df66a024ad27dfa70ce4f7889229d9152ba999f3a54b914","src/x509_vfy.rs":"5609f6300ab37a4d4755c81f7af1e6bb93a2f1a6f333c6e42f1e73ebf83ddc05","src/x509v3.rs":"66fd646ea4caf5ce81e3c881e88d85462519c4e97a7f82e82ca8ac52ea830ad2"},"package":"ff3d1b390ab1b9700f682ad95a30dc9c0f40dd212ca57266012cfc678b0e365a"} -diff --git a/vendor/openssl-sys/build/main.rs b/vendor/openssl-sys/build/main.rs -index 2b1691230..024491358 100644 ---- a/vendor/openssl-sys/build/main.rs -+++ b/vendor/openssl-sys/build/main.rs -@@ -500,6 +500,8 @@ See rust-openssl README for more information: - (7, _) => ('7', 'x'), - (8, 0) => ('8', '0'), - (8, 1) => ('8', '1'), -+ (8, _) => ('8', 'x'), -+ (9, 0) => ('9', '0'), - _ => version_error(), - }; - -@@ -540,7 +542,7 @@ fn version_error() -> ! { - " - - This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5 --through 2.8.1, but a different version of OpenSSL was found. The build is now aborting -+through 2.9.0, but a different version of OpenSSL was found. The build is now aborting - due to this version mismatch. - - " diff --git a/dev-lang/rust/files/1.32.0-system-llvm-7-SIGSEGV.patch b/dev-lang/rust/files/1.32.0-system-llvm-7-SIGSEGV.patch deleted file mode 100644 index afc2cabde4b5..000000000000 --- a/dev-lang/rust/files/1.32.0-system-llvm-7-SIGSEGV.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 1c95f5a34c14f08d65cdd198827e3a2fcb63cf39 Mon Sep 17 00:00:00 2001 -From: Tom Tromey <tom@tromey.com> -Date: Tue, 22 Jan 2019 11:13:53 -0700 -Subject: [PATCH] Fix issue 57762 - -Issue 57762 points out a compiler crash when the compiler was built -using a stock LLVM 7. LLVM 7 was released without a necessary fix for -a bug in the DWARF discriminant code. - -This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7. - -Closes #57762 ---- - src/librustc_codegen_llvm/debuginfo/metadata.rs | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs -index 6deedd0b5ea3..a354eef6887a 100644 ---- a/src/librustc_codegen_llvm/debuginfo/metadata.rs -+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs -@@ -1164,7 +1164,11 @@ fn use_enum_fallback(cx: &CodegenCx) -> bool { - // On MSVC we have to use the fallback mode, because LLVM doesn't - // lower variant parts to PDB. - return cx.sess().target.target.options.is_like_msvc -- || llvm_util::get_major_version() < 7; -+ || llvm_util::get_major_version() < 7 -+ // LLVM version 7 did not release with an important bug fix; -+ // but the required patch is in the equivalent Rust LLVM. -+ // See https://github.com/rust-lang/rust/issues/57762. -+ || (llvm_util::get_major_version() == 7 && unsafe { !llvm::LLVMRustIsRustLLVM() }); - } - - // Describes the members of an enum value: An enum is described as a union of diff --git a/dev-lang/rust/files/1.33.0-clippy-sysroot.patch b/dev-lang/rust/files/1.33.0-clippy-sysroot.patch deleted file mode 100644 index c8dc7a8e90df..000000000000 --- a/dev-lang/rust/files/1.33.0-clippy-sysroot.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- a/src/tools/clippy/src/driver.rs 2019-03-01 20:52:40.685331653 +0300 -+++ b/src/tools/clippy/src/driver.rs 2019-03-01 20:54:44.161327649 +0300 -@@ -31,54 +31,22 @@ - exit(0); - } - -- let sys_root = option_env!("SYSROOT") -- .map(String::from) -- .or_else(|| std::env::var("SYSROOT").ok()) -- .or_else(|| { -- let home = option_env!("RUSTUP_HOME").or(option_env!("MULTIRUST_HOME")); -- let toolchain = option_env!("RUSTUP_TOOLCHAIN").or(option_env!("MULTIRUST_TOOLCHAIN")); -- home.and_then(|home| toolchain.map(|toolchain| format!("{}/toolchains/{}", home, toolchain))) -- }) -- .or_else(|| { -- Command::new("rustc") -- .arg("--print") -- .arg("sysroot") -- .output() -- .ok() -- .and_then(|out| String::from_utf8(out.stdout).ok()) -- .map(|s| s.trim().to_owned()) -- }) -- .expect("need to specify SYSROOT env var during clippy compilation, or use rustup or multirust"); -- - // Setting RUSTC_WRAPPER causes Cargo to pass 'rustc' as the first argument. - // We're invoking the compiler programmatically, so we ignore this/ -- let mut orig_args: Vec<String> = env::args().collect(); -- if orig_args.len() <= 1 { -+ let mut args: Vec<String> = env::args().collect(); -+ if args.len() <= 1 { - std::process::exit(1); - } -- if Path::new(&orig_args[1]).file_stem() == Some("rustc".as_ref()) { -+ if Path::new(&args[1]).file_stem() == Some("rustc".as_ref()) { - // we still want to be able to invoke it normally though -- orig_args.remove(1); -+ args.remove(1); - } -- // this conditional check for the --sysroot flag is there so users can call -- // `clippy_driver` directly -- // without having to pass --sysroot or anything -- let mut args: Vec<String> = if orig_args.iter().any(|s| s == "--sysroot") { -- orig_args.clone() -- } else { -- orig_args -- .clone() -- .into_iter() -- .chain(Some("--sysroot".to_owned())) -- .chain(Some(sys_root)) -- .collect() -- }; - - // this check ensures that dependencies are built but not linted and the final - // crate is - // linted but not built - let clippy_enabled = env::var("CLIPPY_TESTS").ok().map_or(false, |val| val == "true") -- || orig_args.iter().any(|s| s == "--emit=dep-info,metadata"); -+ || args.iter().any(|s| s == "--emit=dep-info,metadata"); - - if clippy_enabled { - args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]); |