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

internal compiler error by using a string slice in pattern match #23656

Closed
StephanvanSchaik opened this issue Mar 24, 2015 · 0 comments · Fixed by #23930
Closed

internal compiler error by using a string slice in pattern match #23656

StephanvanSchaik opened this issue Mar 24, 2015 · 0 comments · Fixed by #23930
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@StephanvanSchaik
Copy link

Attempting to get a string slice in a pattern when pattern matching yields the following: "error: internal compiler error: ident only path should have been covered already." As an example, do consider the following code:
http://is.gd/cuYVtu

struct Test(String);

fn main() {
    let x = Test(format!("foo"));
    let Test(&desc[..]) = x;
}

I expected a less serious error, as this was by accident, I intended to do something different. The version I am using is: rustc 1.0.0-dev (ecf8c64 2015-03-21) (built 2015-03-22).

@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Mar 24, 2015
bors added a commit that referenced this issue Apr 3, 2015
Fixes #22757
Fixes #22972
Fixes #23044
Fixes #23151
Fixes #23597
Fixes #23656
Fixes #23929
It also fixes some other corner cases in range patterns, like incorrect spans or not accepting global paths after `...`.

It passes `make check` but needs some additional tests (then it will fix #22546 as well), I'll write them today or tomorrow.
Manishearth added a commit to Manishearth/rust that referenced this issue Apr 3, 2015
Fixes rust-lang#22757
Fixes rust-lang#22972
Fixes rust-lang#23044
Fixes rust-lang#23151
Fixes rust-lang#23597
Fixes rust-lang#23656
Fixes rust-lang#23929
It also fixes some other corner cases in range patterns, like incorrect spans or not accepting global paths after `...`.

It passes `make check` but needs some additional tests (then it will fix rust-lang#22546 as well), I'll write them today or tomorrow.
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

Successfully merging a pull request may close this issue.

2 participants