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

Suppress transmute_ptr_to_ptr pedantic clippy lint in generated code #46

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Dec 13, 2023

warning: transmute from a reference to a reference
  --> tests/test_custom.rs:11:39
   |
11 |         pub fn new(s: &str) -> &Custom;
   |                                       ^ help: try: `&*(s as *const str as *const forbid_unsafe::Custom)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#transmute_ptr_to_ptr
   = note: `-W clippy::transmute-ptr-to-ptr` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::transmute_ptr_to_ptr)]`

    warning: transmute from a reference to a reference
      --> tests/test_custom.rs:11:39
       |
    11 |         pub fn new(s: &str) -> &Custom;
       |                                       ^ help: try: `&*(s as *const str as *const forbid_unsafe::Custom)`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#transmute_ptr_to_ptr
       = note: `-W clippy::transmute-ptr-to-ptr` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::transmute_ptr_to_ptr)]`
@dtolnay dtolnay merged commit 3c0f7fd into master Dec 13, 2023
19 checks passed
@dtolnay dtolnay deleted the transmute branch December 13, 2023 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant