pub fn abort_on_err<T>(result: Result<T, ErrorReported>, sess: &Session) -> T