Skip to content

ICE in match expression #14865

Closed
Closed
@nrc

Description

@nrc

The following match expression ICEs with

Basic Block in function '_ZN6middle6typeck9coherence13get_base_type20h0f2d8662897539e9xUv11v0.11.0.preE' does not have terminator!
label %match_case10
LLVM ERROR: Broken function found, compilation aborted!
make: *** [x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.rustc] Error 1

I'm afraid I haven't been able to identify exactly what causes the error, but replacing the _ with ty_uniq(_) | ty_rptr(_, _) | ty_trait(..) fixes the problem, so the error is there somewhere. The offending match is in coherance.rs.

match get(resolved_type).sty {
        ty_enum(..) | ty_struct(..) => {
            debug!("(getting base type) found base type");
            Some(resolved_type)
        }
        _ if ty::type_is_trait(resolved_type) => {
            debug!("(getting base type) found base type (trait)");
            Some(resolved_type)
        }

        ty_nil | ty_bot | ty_bool | ty_char | ty_int(..) | ty_uint(..) | ty_float(..) |
        ty_str(..) | ty_vec(..) | ty_bare_fn(..) | ty_closure(..) | ty_tup(..) |
        ty_infer(..) | ty_param(..) | ty_self(..) | ty_err |
        ty_box(_) | ty_uniq(_) | ty_ptr(_) | ty_rptr(_, _) => {
            debug!("(getting base type) no base type; found {:?}",
                   get(original_type).sty);
            None
        }
        ty_trait(..) => fail!("should have been caught")
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions