Skip to content
  • Josh Stone's avatar
    Never return uninhabited values at all · c2e0d7f1
    Josh Stone authored
    Functions with uninhabited return values are already marked `noreturn`,
    but we were still generating return instructions for this. When running
    with `-C passes=lint`, LLVM prints:
    
        Unusual: Return statement in function with noreturn attribute
    
    The LLVM manual makes a stronger statement about `noreturn` though:
    
    > This produces undefined behavior at runtime if the function ever does
    dynamically return.
    
    We now emit an `abort` anywhere that would have tried to return an
    uninhabited value.
    c2e0d7f1