How about this:
```rust
                if expand {
                    tcx.sess.bug(format!(
                        "found ty_param with expand=true `{}` in ty::hash_crate_independent",
                        ty_to_str(tcx, t)));
                }
```