]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #55084 - matthiaskrgr:clippy, r=oli-obk
authorbors <bors@rust-lang.org>
Mon, 15 Oct 2018 10:31:48 +0000 (10:31 +0000)
committerbors <bors@rust-lang.org>
Mon, 15 Oct 2018 10:31:48 +0000 (10:31 +0000)
submodules: update clippy from 9d337313 to 5afdf8b7

Should fix toolstate.

Changes:

````
fix for rustc master
mem_forget: fix syntax error in code sample
explicit_counter_loop fix #3308 false positive
new_ret_no_self test remove tool lints cfg flag
Added new_ret_no_self exception to clippy to pass dogfood tests
Removed new_ret_no_self tests from method.rs
new_ret_no_self correctly lint impl return
Removed unused variables
new_ret_no_self fix false positive for impl trait return with associated type self
new_ret_no_self corrected panic and added test stderr
new_ret_no_self added positive test cases
Fix some more `stutter` warnings
unused unit lint
Install Windows SDK 10.0 on travis
cmp_owned refactor
cmp_owned correct error message if rhs is deref
Add a comment reminding to update README if the default changes
Specify which categories are enabled by default
Only run markdown linter on linux
Move Travis Windows build to allowed failures
Add Travis windows build
Fix `doc_markdown` lints
Fix `stutter` lints
Fix `similar_names` warnings
cmp_owned current suggestion for multiple deref
cmp_owned add test for multiple dereference
Corrected single-character string constant used as pattern found in dogfood test
Fixes 3289, cmp_owned wording and false positive
````

src/librustc_codegen_llvm/abi.rs
src/librustc_target/spec/mod.rs
src/librustc_target/spec/wasm32_unknown_unknown.rs
src/tools/miri

index c8e8d0dc84ef038027ffc589c558923721a253d2..7b93d3e795ed8f29c41132a2ba11f65e87b1ccb6 100644 (file)
@@ -536,7 +536,10 @@ fn adjust_for_abi(&mut self,
                     // Note that the platform intrinsic ABI is exempt here as
                     // that's how we connect up to LLVM and it's unstable
                     // anyway, we control all calls to it in libstd.
-                    layout::Abi::Vector { .. } if abi != Abi::PlatformIntrinsic => {
+                    layout::Abi::Vector { .. }
+                        if abi != Abi::PlatformIntrinsic &&
+                            cx.sess().target.target.options.simd_types_indirect =>
+                    {
                         arg.make_indirect();
                         return
                     }
index 9c0f945326d148006c8f9cd54e7412d4ea9d92eb..9ee4582fabf7b3b594f444209a6c31d5d9dc2356 100644 (file)
@@ -680,6 +680,12 @@ pub struct TargetOptions {
     /// typically because the platform needs to unwind for things like stack
     /// unwinders.
     pub requires_uwtable: bool,
+
+    /// Whether or not SIMD types are passed by reference in the Rust ABI,
+    /// typically required if a target can be compiled with a mixed set of
+    /// target features. This is `true` by default, and `false` for targets like
+    /// wasm32 where the whole program either has simd or not.
+    pub simd_types_indirect: bool,
 }
 
 impl Default for TargetOptions {
@@ -760,6 +766,7 @@ fn default() -> TargetOptions {
             embed_bitcode: false,
             emit_debug_gdb_scripts: true,
             requires_uwtable: false,
+            simd_types_indirect: true,
         }
     }
 }
@@ -1041,6 +1048,7 @@ macro_rules! key {
         key!(embed_bitcode, bool);
         key!(emit_debug_gdb_scripts, bool);
         key!(requires_uwtable, bool);
+        key!(simd_types_indirect, bool);
 
         if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) {
             for name in array.iter().filter_map(|abi| abi.as_string()) {
@@ -1250,6 +1258,7 @@ macro_rules! target_option_val {
         target_option_val!(embed_bitcode);
         target_option_val!(emit_debug_gdb_scripts);
         target_option_val!(requires_uwtable);
+        target_option_val!(simd_types_indirect);
 
         if default.abi_blacklist != self.options.abi_blacklist {
             d.insert("abi-blacklist".to_string(), self.options.abi_blacklist.iter()
index c0455ceb8390ce669802e9bc9650153882e9ef08..46353068bd04588840787936f803949adc1d8d17 100644 (file)
@@ -54,6 +54,12 @@ pub fn target() -> Result<Target, String> {
         linker: Some("rust-lld".to_owned()),
         lld_flavor: LldFlavor::Wasm,
 
+        // No need for indirection here, simd types can always be passed by
+        // value as the whole module either has simd or not, which is different
+        // from x86 (for example) where programs can have functions that don't
+        // enable simd features.
+        simd_types_indirect: false,
+
         .. Default::default()
     };
     Ok(Target {
index 26f9d617c347185433b77c481a5c50c55d9b72ce..8b14b03368429e6ee2a8ac0e0c876505606ab1f1 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 26f9d617c347185433b77c481a5c50c55d9b72ce
+Subproject commit 8b14b03368429e6ee2a8ac0e0c876505606ab1f1