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

"ref" in guarded patterns trips LLVM asserts #3256

Closed
bblum opened this issue Aug 23, 2012 · 2 comments
Closed

"ref" in guarded patterns trips LLVM asserts #3256

bblum opened this issue Aug 23, 2012 · 2 comments
Assignees
Labels
A-codegen Area: Code generation A-lifetimes Area: Lifetimes / regions I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Milestone

Comments

@bblum
Copy link
Contributor

bblum commented Aug 23, 2012

This crashes if you try to compile it:

fn main() {
    let x = some(unsafe::exclusive(false));
    match move x {
        some(ref z) if z.with(|b| *b) => {
            do z.with |b| { assert *b; }
        },
        _ => fail
    }
}

Related #2329, #3255

@nikomatsakis
Copy link
Contributor

problem is that there is apparently an entirely separate code path for making the pattern bindings in the case of guard failures (inlined into compile_submatch) vs entering the arm itself (make_pattern_bindings). these two paths should be consolidated.

@nikomatsakis
Copy link
Contributor

I suspect it also copies twice. This seems... non-ideal. It'd be good if we could re-use the copy we did for the guard in the arm.

@bblum bblum mentioned this issue Aug 24, 2012
@ghost ghost assigned nikomatsakis Aug 31, 2012
RalfJung pushed a commit to RalfJung/rust that referenced this issue Jan 7, 2024
implement the rounding intrinsics using apfloat rounding

No reason to use host floats for these. Also merge two files that were both testing various float things.
jaisnan pushed a commit to jaisnan/rust-dev that referenced this issue Jul 29, 2024
typed_swap needs to be a no-op on ZSTs as pointers to those have an
arbitrary value in Kani.

Resolves: rust-lang#3182
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-lifetimes Area: Lifetimes / regions I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

2 participants