Don't use unnormalized type in Ty::fn_sig call in rustdoc clean_middle_ty#102831
Don't use unnormalized type in Ty::fn_sig call in rustdoc clean_middle_ty#102831bors merged 1 commit intorust-lang:masterfrom
Ty::fn_sig call in rustdoc clean_middle_ty#102831Conversation
|
r? @CraftSpider (rust-highfive has picked a reviewer for you, use r? to override) |
|
|
||
| pub(crate) fn clean_middle_ty<'tcx>( | ||
| this: Ty<'tcx>, | ||
| ty: Ty<'tcx>, |
There was a problem hiding this comment.
Intentionally renaming this -> ty so that the normalized let ty = ... below shadows the unnormalized type, so this doesn't happen again.
| type_: Box::new(clean_middle_ty(ty, cx, None)), | ||
| }, | ||
| ty::FnDef(..) | ty::FnPtr(_) => { | ||
| let ty = cx.tcx.lift(this).expect("FnPtr lift failed"); |
There was a problem hiding this comment.
But technically this is the only fix needed -- this should've been cx.tcx.lift(ty), but also isn't needed at all.
|
I didn't find this self explanatory at first - the problem here is that we were using a normalized and unnormalized type inconsistently, not just that it was unnormalized. The fix is to consistently use one or the other, and @compiler-errors chose the normalized version (which is what I'd prefer, thanks, otherwise -Znormalize-docs does nothing). @bors r+ rollup |
… r=jyn514 Don't use unnormalized type in `Ty::fn_sig` call in rustdoc `clean_middle_ty` Self-explanatory Fixes rust-lang#102828
Rollup of 8 pull requests Successful merges: - rust-lang#101118 (fs::get_mode enable getting the data via fcntl/F_GETFL on major BSD) - rust-lang#102072 (Add `ptr::Alignment` type) - rust-lang#102799 (rustdoc: remove hover gap in file picker) - rust-lang#102820 (Show let-else suggestion on stable.) - rust-lang#102829 (rename `ImplItemKind::TyAlias` to `ImplItemKind::Type`) - rust-lang#102831 (Don't use unnormalized type in `Ty::fn_sig` call in rustdoc `clean_middle_ty`) - rust-lang#102834 (Remove unnecessary `lift`/`lift_to_tcx` calls from rustdoc) - rust-lang#102838 (remove cfg(bootstrap) from Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 8 pull requests Successful merges: - rust-lang#101118 (fs::get_mode enable getting the data via fcntl/F_GETFL on major BSD) - rust-lang#102072 (Add `ptr::Alignment` type) - rust-lang#102799 (rustdoc: remove hover gap in file picker) - rust-lang#102820 (Show let-else suggestion on stable.) - rust-lang#102829 (rename `ImplItemKind::TyAlias` to `ImplItemKind::Type`) - rust-lang#102831 (Don't use unnormalized type in `Ty::fn_sig` call in rustdoc `clean_middle_ty`) - rust-lang#102834 (Remove unnecessary `lift`/`lift_to_tcx` calls from rustdoc) - rust-lang#102838 (remove cfg(bootstrap) from Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Self-explanatory
Fixes #102828