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

Error messages still mention "impure" #9920

Closed
kmcallister opened this issue Oct 18, 2013 · 1 comment
Closed

Error messages still mention "impure" #9920

kmcallister opened this issue Oct 18, 2013 · 1 comment

Comments

@kmcallister
Copy link
Contributor

unsafe fn f() {
}

fn g(h: extern "Rust" fn()) {
}

fn main() {
    g(f);
}

produces

foo.rs:8:6: 8:7 error: mismatched types: expected extern "Rust" fn() but found extern "Rust" unsafe fn() (expected impure fn but found unsafe fn)

(emphasis mine)

@sanxiyn
Copy link
Member

sanxiyn commented May 16, 2014

This was fixed by #13371.

@sanxiyn sanxiyn closed this as completed May 16, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 17, 2022
…ednet

add `suppress_restriction_lint_in_const` config

According to rust-lang#9808 , add a new lint `suppress_lint_in_const` to report even in const context. BTW, i am not good at naming either, if anyone have a better idea, i am happy to change it.

This PR is still in progress, so i keep it draft.

- \[x] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[x] Added lint documentation
- \[x] Run `cargo dev fmt`

changelog: Enhancement: [`indexing_slicing`]: add new config `suppress-restriction-lint-in-const` to enable restriction lints, even if the suggestion might not be applicable

r? `@xFrendet`
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

No branches or pull requests

2 participants