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

matching on &'static str triggers "assertion failed" #11237

Closed
pfalabella opened this issue Dec 31, 2013 · 1 comment
Closed

matching on &'static str triggers "assertion failed" #11237

pfalabella opened this issue Dec 31, 2013 · 1 comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@pfalabella
Copy link
Contributor

I was trying to get a hang of how pattern matching works with constants and I may have hit a bug.

Rust nighlty on windows: rustc.exe 0.9-pre (b5b570b 2013-12-29
18:46:57 -0800)
host: i686-pc-mingw32

static TEST: &'static str = &"paolo";
let myVar = "paolo";

let rt = match myVar {  
    TEST => "it's me",
    _ => "not me"
};

println(rt);

I get
$ rustc test.rs
Assertion failed: (i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]-> getType()) && "Calling a function with a bad signature!", file d:/Heather/Contrib/P/rust/src/llvm/lib/IR/Instructions.cpp, line 281

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
@huonw
Copy link
Member

huonw commented Dec 31, 2013

Thanks for the report; however, this appears to be a dupe of #8315, so I'm closing in favour of that one.

@huonw huonw closed this as completed Dec 31, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 8, 2024
…p1995

Add `lint_groups_priority` lint

Warns when a lint group in Cargo.toml's `[lints]` section shares the same priority as a lint. This is in the cargo section but is categorised as `correctness` so it's on by default, it doesn't call `cargo metadata` though and parses the `Cargo.toml` directly

The lint should be temporary until rust-lang/cargo#12918 is resolved, but in the meanwhile this is an common issue to run into

- rust-lang#11237
- rust-lang#11751
- rust-lang#11830

changelog: Add [`lint_groups_priority`] lint

r? `@flip1995`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants