Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in improper_ctypes suggestion #52346

Merged
merged 1 commit into from
Jul 13, 2018
Merged

Conversation

hanna-kruppe
Copy link
Contributor

closes #52345

@rust-highfive
Copy link
Collaborator

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 13, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:42:32] ....................................................................................................
[00:42:36] ....................................................................................................
[00:42:39] ....................................................................................................
[00:42:42] ....................................................................................................
[00:42:45] ................................................F...................................................
[00:42:52] ...........................i........................................................................
[00:42:56] ....................................................................................................
[00:42:59] ....................................................................................................
[00:43:04] ...........................................................................i........................
[00:43:04] ...........................................................................i........................
[00:43:06] .............................................................
[00:43:06] failures:
[00:43:06] 
[00:43:06] ---- [ui] ui/lint-ctypes.rs stdout ----
[00:43:06] diff of stderr:
[00:43:06] 
[00:43:06] 126 LL |     pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific
[00:43:06] 128    |
[00:43:06] 128    |
[00:43:06] -    = help: consider using an `fn "extern"(...) -> ...` function pointer instead
[00:43:06] +    = help: consider using an `extern fn(...) -> ...` function pointer instead
[00:43:06] 130 
[00:43:06] 131 error: `extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention
[00:43:06] 
[00:43:06] 
[00:43:06] 134 LL |     pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific
[00:43:06] 136    |
[00:43:06] 136    |
[00:43:06] -    = help: consider using an `fn "extern"(...) -> ...` function pointer instead
[00:43:06] +    = help: consider using an `extern fn(...) -> ...` function pointer instead
[00:43:06] 138 
[00:43:06] 139 error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout
[00:43:06] 
[00:43:06] 
[00:43:06] The actual stderr differed from the expected stderr.
[00:43:06] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint-ctypes/lint-ctypes.stderr
[00:43:06] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint-ctypes/lint-ctypes.stderr
[00:43:06] To update references, rerun the tests and pass the `--bless` flag
[00:43:06] To only update this specific test, also pass `--test-args lint-ctypes.rs`
[00:43:06] error: 1 errors occurred comparing output.
[00:43:06] status: exit code: 101
[00:43:06] status: exit code: 101
[00:43:06] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/lint-ctypes.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint-ctypes/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint-ctypes/auxiliary" "-A" "unused"
[00:43:06] ------------------------------------------
[00:43:06] 
[00:43:06] ------------------------------------------
[00:43:06] stderr:
[00:43:06] stderr:
[00:43:06] ------------------------------------------
[00:43:06] {"message":"`extern` block uses type `Foo` which is not FFI-safe: this struct has unspecified layout","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":1686,"byte_end":1696,"line_start":54,"line_end":54,"column_start":28,"column_end":38,"is_primary":true,"text":[{"text":"    pub fn ptr_type1(size: *const Foo); //~ ERROR: uses type `Foo`","highlight_start":28,"highlight_end":38}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"lint level defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":475,"byte_end":490,"line_start":11,"line_end":11,"column_start":9,"column_end":24,"is_primary":true,"text":[{"text":"#![deny(improper_ctypes)]","highlight_start":9,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"type defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":1017,"byte_end":1032,"line_start":32,"line_end":32,"column_start":1,"column_end":16,"is_primary":true,"text":[{"text":"pub struct Foo;","highlight_start":1,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `Foo` which is not FFI-safe: this struct has unspecified layout\n  --> /checkout/src/test/ui/lint-ctypes.rs:54:28\n   |\nLL |     pub fn ptr_type1(size: *const Foo); //~ ERROR: uses type `Foo`\n   |                            ^^^^^^^^^^\n   |\nnote: lint level defined here\n  --> /checkout/src/test/ui/lint-ctypes.rs:11:9\n   |\nLL | #![deny(improper_ctypes)]\n   |         ^^^^^^^^^^^^^^^\n   = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct\nnote: type defined here\n  --> /checkout/src/test/ui/lint-ctypes.rs:32:1\n   |\nLL | pub struct Foo;\n   | ^^^^^^^^^^^^^^^\n\n"}
[00:43:06] {"message":"`extern` block uses type `Foo` which is not FFI-safe: this struct has unspecified layout","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":1753,"byte_end":1763,"line_start":55,"line_end":55,"column_start":28,"column_end":38,"is_primary":true,"text":[{"text":"    pub fn ptr_type2(size: *const Foo); //~ ERROR: uses type `Foo`","highlight_start":28,"highlight_end":38}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"type defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":1017,"byte_end":1032,"line_start":32,"line_end":32,"column_start":1,"column_end":16,"is_primary":true,"text":[{"text":"pub struct Foo;","highlight_start":1,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `Foo` which is not FFI-safe: this struct has unspecified layout\n  --> /checkout/src/test/ui/lint-ctypes.rs:55:28\n   |\nLL |     pub fn ptr_type2(size: *const Foo); //~ ERROR: uses type `Foo`\n   |                            ^^^^^^^^^^\n   |\n   = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct\nnote: type defined here\n  --> /checkout/src/test/ui/lint-ctypes.rs:32:1\n   |\nLL | pub struct Foo;\n   | ^^^^^^^^^^^^^^^\n\n"}
[00:43:06] {"message":"`extern` block uses type `[u32]` which is not FFI-safe: slices have no C equivalent","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":1818,"byte_end":1824,"line_start":56,"line_end":56,"column_start":26,"column_end":32,"is_primary":true,"text":[{"text":"    pub fn slice_type(p: &[u32]); //~ ERROR: uses type `[u32]`","highlight_start":26,"highlight_end":32}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider using a raw pointer instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `[u32]` which is not FFI-safe: slices have no C equivalent\n  --> /checkout/src/test/ui/lint-ctypes.rs:56:26\n   |\nLL |     pub fn slice_type(p: &[u32]); //~ ERROR: uses type `[u32]`\n   |                          ^^^^^^\n   |\n   = help: consider using a raw pointer instead\n\n"}
[00:43:06] {"message":"`extern` block uses type `str` which is not FFI-safe: string slices have no C equivalent","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":1879,"byte_end":1883,"line_start":57,"line_end":57,"column_start":24,"column_end":28,"is_primary":true,"text":[{"text":"    pub fn str_type(p: &str); //~ ERROR: uses type `str`","highlight_start":24,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider using `*const u8` and a length instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `str` which is not FFI-safe: string slices have no C equivalent\n  --> /checkout/src/test/ui/lint-ctypes.rs:57:24\n   |\nLL |     pub fn str_type(p: &str); //~ ERROR: uses type `str`\n   |                        ^^^^\n   |\n   = help: consider using `*const u8` and a length instead\n\n"}
[00:43:06] {"message":"`extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":1936,"byte_end":1944,"line_start":58,"line_end":58,"column_start":24,"column_end":32,"is_primary":true,"text":[{"text":"    pub fn box_type(p: Box<u32>); //~ ERROR uses type `std::boxed::Box<u32>`","highlight_start":24,"highlight_end":32}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout\n  --> /checkout/src/test/ui/lint-ctypes.rs:58:24\n   |\nLL |     pub fn box_type(p: Box<u32>); //~ ERROR uses type `std::boxed::Box<u32>`\n   |                        ^^^^^^^^\n   |\n   = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct\n\n"}
[00:43:06] {"message":"`extern` block uses type `char` which is not FFI-safe: the `char` type has no C equivalent","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2014,"byte_end":2018,"line_start":59,"line_end":59,"column_start":25,"column_end":29,"is_primary":true,"text":[{"text":"    pub fn char_type(p: char); //~ ERROR uses type `char`","highlight_start":25,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider using `u32` or `libc::wchar_t` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `char` which is not FFI-safe: the `char` type has no C equivalent\n  --> /checkout/src/test/ui/lint-ctypes.rs:59:25\n   |\nLL |     pub fn char_type(p: char); //~ ERROR uses type `char`\n   |                         ^^^^\n   |\n   = help: consider using `u32` or `libc::wchar_t` instead\n\n"}
[00:43:06] {"message":"`extern` block uses type `i128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2072,"byte_end":2076,"line_start":60,"line_end":60,"column_start":25,"column_end":29,"is_primary":true,"text":[{"text":"    pub fn i128_type(p: i128); //~ ERROR uses type `i128`","highlight_start":25,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: `extern` block uses type `i128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI\n  --> /checkout/src/test/ui/lint-ctypes.rs:60:25\n   |\nLL |     pub fn i128_type(p: i128); //~ ERROR uses type `i128`\n   |                         ^^^^\n\n"}
[00:43:06] {"message":"`extern` block uses type `u128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2130,"byte_end":2134,"line_start":61,"line_end":61,"column_start":25,"column_end":29,"is_primary":true,"text":[{"text":"    pub fn u128_type(p: u128); //~ ERROR uses type `u128`","highlight_start":25,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: `extern` block uses type `u128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI\n  --> /checkout/src/test/ui/lint-ctypes.rs:61:25\n   |\nLL |     pub fn u128_type(p: u128); //~ ERROR uses type `u128`\n   |                         ^^^^\n\n"}
[00:43:06] {"message":"`extern` block uses type `dyn std::clone::Clone` which is not FFI-safe: trait objects have no C equivalent","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2189,"byte_end":2195,"line_start":62,"line_end":62,"column_start":26,"column_end":32,"is_primary":true,"text":[{"text":"    pub fn trait_type(p: &Clone); //~ ERROR uses type `dyn std::clone::Clone`","highlight_start":26,"highlight_end":32}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: `extern` block uses type `dyn std::clone::Clone` which is not FFI-safe: trait objects have no C equivalent\n  --> /checkout/src/test/ui/lint-ctypes.rs:62:26\n   |\nLL |     pub fn trait_type(p: &Clone); //~ ERROR uses type `dyn std::clone::Clone`\n   |                          ^^^^^^\n\n"}
[00:43:06] {"message":"`extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2267,"byte_end":2277,"line_start":63,"line_end":63,"column_start":26,"column_end":36,"is_primary":true,"text":[{"text":"    pub fn tuple_type(p: (i32, i32)); //~ ERROR uses type `(i32, i32)`","highlight_start":26,"highlight_end":36}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider using a struct instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout\n  --> /checkout/src/test/ui/lint-ctypes.rs:63:26\n   |\nLL |     pub fn tuple_type(p: (i32, i32)); //~ ERROR uses type `(i32, i32)`\n   |                          ^^^^^^^^^^\n   |\n   = help: consider using a struct instead\n\n"}
[00:43:06] {"message":"`extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2339,"byte_end":2346,"line_start":64,"line_end":64,"column_start":27,"column_end":34,"is_primary":true,"text":[{"text":"    pub fn tuple_type2(p: I32Pair); //~ ERROR uses type `(i32, i32)`","highlight_start":27,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider using a struct instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout\n  --> /checkout/src/test/ui/lint-ctypes.rs:64:27\n   |\nLL |     pub fn tuple_type2(p: I32Pair); //~ ERROR uses type `(i32, i32)`\n   |                           ^^^^^^^\n   |\n   = help: consider using a struct instead\n\n"}
[00:43:06] {"message":"`extern` block uses type `ZeroSize` which is not FFI-safe: this struct has no fields","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2406,"byte_end":2414,"line_start":65,"line_end":65,"column_start":25,"column_end":33,"is_primary":true,"text":[{"text":"    pub fn zero_size(p: ZeroSize); //~ ERROR struct has no fields","highlight_start":25,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding a member to this struct","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"type defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":901,"byte_end":921,"line_start":28,"line_end":28,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"pub struct ZeroSize;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `ZeroSize` which is not FFI-safe: this struct has no fields\n  --> /checkout/src/test/ui/lint-ctypes.rs:65:25\n   |\nLL |     pub fn zero_size(p: ZeroSize); //~ ERROR struct has no fields\n   |                         ^^^^^^^^\n   |\n   = help: consider adding a member to this struct\nnote: type defined here\n  --> /checkout/src/test/ui/lint-ctypes.rs:28:1\n   |\nLL | pub struct ZeroSize;\n   | ^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:43:06] {"message":"`extern` block uses type `ZeroSizeWithPhantomData` which is not FFI-safe: composed only of PhantomData","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2480,"byte_end":2503,"line_start":66,"line_end":66,"column_start":33,"column_end":56,"is_primary":true,"text":[{"text":"    pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); //~ ERROR composed only of PhantomData","highlight_start":33,"highlight_end":56}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: `extern` block uses type `ZeroSizeWithPhantomData` which is not FFI-safe: composed only of PhantomData\n  --> /checkout/src/test/ui/lint-ctypes.rs:66:33\n   |\nLL |     pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); //~ ERROR composed only of PhantomData\n   |                                 ^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:43:06] {"message":"`extern` block uses type `std::marker::PhantomData<bool>` which is not FFI-safe: composed only of PhantomData","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2596,"byte_end":2628,"line_start":68,"line_end":68,"column_start":12,"column_end":44,"is_primary":true,"text":[{"text":"        -> ::std::marker::PhantomData<bool>; //~ ERROR: composed only of PhantomData","highlight_start":12,"highlight_end":44}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: `extern` block uses type `std::marker::PhantomData<bool>` which is not FFI-safe: composed only of PhantomData\n  --> /checkout/src/test/ui/lint-ctypes.rs:68:12\n   |\nLL |         -> ::std::marker::PhantomData<bool>; //~ ERROR: composed only of PhantomData\n   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:43:06] {"message":"`extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2692,"byte_end":2698,"line_start":69,"line_end":69,"column_start":23,"column_end":29,"is_primary":true,"text":[{"text":"    pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific","highlight_start":23,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider using an `extern fn(...) -> ...` function pointer instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention\n  --> /checkout/src/test/ui/lint-ctypes.rs:69:23\n   |\nLL |     pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific\n   |                       ^^^^^^\n   |\n   = help: consider using an `extern fn(...) -> ...` function pointer instead\n\n"}
[00:43:06] {"message":"`extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2769,"byte_end":2773,"line_start":70,"line_end":70,"column_start":24,"column_end":28,"is_primary":true,"text":[{"text":"    pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific","highlight_start":24,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider using an `extern fn(...) -> ...` function pointer instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention\n  --> /checkout/src/test/ui/lint-ctypes.rs:70:24\n   |\nLL |     pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific\n   |                        ^^^^\n   |\n   = help: consider using an `extern fn(...) -> ...` function pointer instead\n\n"}
[00:43:06] {"message":"`extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2848,"byte_end":2858,"line_start":71,"line_end":71,"column_start":28,"column_end":38,"is_primary":true,"text":[{"text":"    pub fn fn_contained(p: RustBadRet); //~ ERROR: uses type `std::boxed::Box<u32>`","highlight_start":28,"highlight_end":38}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout\n  --> /checkout/src/test/ui/lint-ctypes.rs:71:28\n   |\nLL |     pub fn fn_contained(p: RustBadRet); //~ ERROR: uses type `std::boxed::Box<u32>`\n   |                            ^^^^^^^^^^\n   |\n   = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct\n\n"}
[00:43:06] {"message":"`extern` block uses type `i128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":2936,"byte_end":2951,"line_start":72,"line_end":72,"column_start":32,"column_end":47,"is_primary":true,"text":[{"text":"    pub fn transparent_i128(p: TransparentI128); //~ ERROR: uses type `i128`","highlight_start":32,"highlight_end":47}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: `extern` block uses type `i128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI\n  --> /checkout/src/test/ui/lint-ctypes.rs:72:32\n   |\nLL |     pub fn transparent_i128(p: TransparentI128); //~ ERROR: uses type `i128`\n   |                                ^^^^^^^^^^^^^^^\n\n"}
[00:43:06] {"message":"`extern` block uses type `str` which is not FFI-safe: string slices have no C equivalent","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":3012,"byte_end":3026,"line_start":73,"line_end":73,"column_start":31,"column_end":45,"is_primary":true,"text":[{"text":"    pub fn transparent_str(p: TransparentStr); //~ ERROR: uses type `str`","highlight_start":31,"highlight_end":45}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider using `*const u8` and a length instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `str` which is not FFI-safe: string slices have no C equivalent\n  --> /checkout/src/test/ui/lint-ctypes.rs:73:31\n   |\nLL |     pub fn transparent_str(p: TransparentStr); //~ ERROR: uses type `str`\n   |                               ^^^^^^^^^^^^^^\n   |\n   = help: consider using `*const u8` and a length instead\n\n"}
[00:43:06] {"message":"`extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout","code":{"code":"improper_ctypes","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint-ctypes.rs","byte_start":3085,"byte_end":3101,"line_start":74,"line_end":74,"column_start":30,"column_end":46,"is_primary":true,"text":[{"text":"    pub fn transparent_fn(p: TransparentBadFn); //~ ERROR: uses type `std::boxed::Box<u32>`","highlight_start":30,"highlight_end":46}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout\n  --> /checkout/src/test/ui/lint-ctypes.rs:74:30\n   |\nLL |     pub fn transparent_fn(p: TransparentBadFn); //~ ERROR: uses type `std::boxed::Box<u32>`\n   |                              ^^^^^^^^^^^^^^^^\n   |\n   = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct\n\n"}
[00:43:06] {"message":"aborting due to 20 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 20 previous errors\n\n"}
[00:43:06] ------------------------------------------
[00:43:06] 
[00:43:06] thread '[ui] ui/lint-ctypes.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3139:9
[00:43:06] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[00:43:06] 
[00:43:06] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:43:06] 
[00:43:06] 
[00:43:06] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:43:06] 
[00:43:06] 
[00:43:06] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:43:06] Build completed unsuccessfully in 0:01:25
[00:43:06] Build completed unsuccessfully in 0:01:25
[00:43:06] make: *** [check] Error 1
[00:43:06] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0532edb2
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:1a6d50a0:start=1531492567348736449,finish=1531492567354653536,duration=5917087
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:00a5fde0
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:133a409c
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@cramertj
Copy link
Member

r=me with travis.

@kennytm
Copy link
Member

kennytm commented Jul 13, 2018

@bors r=cramertj rollup

@bors
Copy link
Contributor

bors commented Jul 13, 2018

📌 Commit e20f1d1 has been approved by cramertj

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 13, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Jul 13, 2018
Fix typo in improper_ctypes suggestion

closes rust-lang#52345
bors added a commit that referenced this pull request Jul 13, 2018
Rollup of 17 pull requests

Successful merges:

 - #51962 (Provide llvm-strip in llvm-tools component)
 - #52003 (Implement `Option::replace` in the core library)
 - #52156 (Update std::ascii::ASCIIExt deprecation notes)
 - #52280 (llvm-tools-preview: fix build-manifest)
 - #52290 (Deny bare trait objects in src/librustc_save_analysis)
 - #52293 (Deny bare trait objects in librustc_typeck)
 - #52299 (Deny bare trait objects in src/libserialize)
 - #52300 (Deny bare trait objects in librustc_target and libtest)
 - #52302 (Deny bare trait objects in the rest of rust)
 - #52310 (Backport 1.27.1 release notes to master)
 - #52315 (Resolve FIXME(#27942))
 - #52316 (task: remove wrong comments about non-existent LocalWake trait)
 - #52322 (Update llvm-rebuild-trigger in light of LLVM 7 upgrade)
 - #52330 (Don't silently ignore invalid data in target spec)
 - #52333 (CI: Enable core dump on Linux, and print their stack trace on segfault. )
 - #52346 (Fix typo in improper_ctypes suggestion)
 - #52350 (Bump bootstrap compiler to 1.28.0-beta.10)

Failed merges:

r? @ghost
@bors bors merged commit e20f1d1 into rust-lang:master Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion in warning for extern function pointers broken
5 participants