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

ICE matching borrowed strings #3574

Closed
jesse99 opened this issue Sep 25, 2012 · 4 comments
Closed

ICE matching borrowed strings #3574

jesse99 opened this issue Sep 25, 2012 · 4 comments
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Milestone

Comments

@jesse99
Copy link
Contributor

jesse99 commented Sep 25, 2012

Following ICEs with rust from Sep 22, 2012:

// rustc --test match_borrowed_str.rs.rs && ./match_borrowed_str.rs
extern mod std;

fn compare(x: &str, y: &str) -> bool
{
    match x
    {
        "foo" => y == "foo",
        _ => y == "bar",
    }
}

#[test]
fn tester()
{
    assert compare("foo", "foo");
}

May be related to some of the other pattern matching bugs such as #2869.

@jesse99
Copy link
Contributor Author

jesse99 commented Sep 25, 2012

I guess the best work around is to match using x.to_unique().

@catamorphism
Copy link
Contributor

Still an issue as of d2ad028

@catamorphism
Copy link
Contributor

I have a fix for this -- just testing now.

@catamorphism
Copy link
Contributor

Pending review.

bors added a commit to rust-lang-ci/rust that referenced this issue Oct 24, 2020
… r=ebroto

Identical arguments on assert macro family

Lint when identical args are used on `assert_eq!`, `debug_assert_eq!`, `assert_ne!` and `debug_assert_ne!` macros.

Added to the lint `eq_op`.

Common functions added to `utils/higher.rs`

Fixes: rust-lang#3574
Fixes: rust-lang#4694

changelog: Lint on identical args when calling `assert_eq!`, `debug_assert_eq!`, `assert_ne!` and `debug_assert_ne!` macros
RalfJung pushed a commit to RalfJung/rust that referenced this issue May 11, 2024
reduce test_dependencies

Also add comments for why we need all these 3 random functions for Windows, and the old Linux syscall interface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants