Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/52334.sh: fixed with no errors #1619

Merged
merged 1 commit into from
Jul 8, 2023
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jul 4, 2023

Issue: rust-lang/rust#52334

#!/bin/sh

rustc -Z mir-opt-level=0 - << EOF
type Foo = extern "C" fn(::std::ffi::CStr);
extern "C" {
    fn meh(blah: Foo);
}

fn main() {
    meh as usize;
}
EOF
=== stdout ===
=== stderr ===
warning: `extern` fn uses type `CStr`, which is not FFI-safe
 --> <anon>:1:12
  |
1 | type Foo = extern "C" fn(::std::ffi::CStr);
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
  |
  = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
  = note: this struct has unspecified layout
  = note: `#[warn(improper_ctypes_definitions)]` on by default

warning: `extern` block uses type `CStr`, which is not FFI-safe
 --> <anon>:3:18
  |
3 |     fn meh(blah: Foo);
  |                  ^^^ not FFI-safe
  |
  = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
  = note: this struct has unspecified layout
  = note: `#[warn(improper_ctypes)]` on by default

warning: 2 warnings emitted

==============

=== stdout ===
=== stderr ===
warning: `extern` fn uses type `CStr`, which is not FFI-safe
 --> <anon>:1:12
  |
1 | type Foo = extern "C" fn(::std::ffi::CStr);
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
  |
  = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
  = note: this struct has unspecified layout
  = note: `#[warn(improper_ctypes_definitions)]` on by default

warning: `extern` block uses type `CStr`, which is not FFI-safe
 --> <anon>:3:18
  |
3 |     fn meh(blah: Foo);
  |                  ^^^ not FFI-safe
  |
  = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
  = note: this struct has unspecified layout
  = note: `#[warn(improper_ctypes)]` on by default

warning: 2 warnings emitted

==============
@JohnTitor JohnTitor merged commit ea3f055 into master Jul 8, 2023
@JohnTitor JohnTitor deleted the autofix/ices/52334.sh branch July 8, 2023 02:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants