Skip to content

Commit de8f4ac

Browse files
committed
clean up leftover FIXME
1 parent d464dd0 commit de8f4ac

File tree

2 files changed

+5
-30
lines changed

2 files changed

+5
-30
lines changed

compiler/rustc_middle/src/ty/generics.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ impl<'tcx> Generics {
326326
own_params.start = 1;
327327
}
328328

329+
let verbose = tcx.sess.verbose();
330+
329331
// Filter the default arguments.
330332
//
331333
// This currently uses structural equality instead
@@ -340,8 +342,8 @@ impl<'tcx> Generics {
340342
param.default_value(tcx).is_some_and(|default| {
341343
default.instantiate(tcx, args) == args[param.index as usize]
342344
})
343-
// filter out trailing effect params
344-
|| matches!(param.kind, GenericParamDefKind::Const { is_host_effect: true, .. })
345+
// filter out trailing effect params, if we're not in `-Zverbose`.
346+
|| (!verbose && matches!(param.kind, GenericParamDefKind::Const { is_host_effect: true, .. }))
345347
})
346348
.count();
347349

compiler/rustc_middle/src/ty/print/pretty.rs

+1-28
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use rustc_hir::LangItem;
1919
use rustc_session::config::TrimmedDefPaths;
2020
use rustc_session::cstore::{ExternCrate, ExternCrateSource};
2121
use rustc_session::Limit;
22-
use rustc_span::sym;
2322
use rustc_span::symbol::{kw, Ident, Symbol};
2423
use rustc_span::FileNameDisplayPreference;
2524
use rustc_target::abi::Size;
@@ -2034,37 +2033,11 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
20342033
) -> Result<(), PrintError> {
20352034
print_prefix(self)?;
20362035

2037-
let tcx = self.tcx;
2038-
2039-
let args = args.iter().copied();
2040-
2041-
let args: Vec<_> = if !tcx.sess.verbose() {
2042-
// skip host param as those are printed as `~const`
2043-
args.filter(|arg| match arg.unpack() {
2044-
// FIXME(effects) there should be a better way than just matching the name
2045-
GenericArgKind::Const(c)
2046-
if tcx.features().effects
2047-
&& matches!(
2048-
c.kind(),
2049-
ty::ConstKind::Param(ty::ParamConst { name: sym::host, .. })
2050-
) =>
2051-
{
2052-
false
2053-
}
2054-
_ => true,
2055-
})
2056-
.collect()
2057-
} else {
2058-
// If -Zverbose is passed, we should print the host parameter instead
2059-
// of eating it.
2060-
args.collect()
2061-
};
2062-
20632036
if !args.is_empty() {
20642037
if self.in_value {
20652038
write!(self, "::")?;
20662039
}
2067-
self.generic_delimiters(|cx| cx.comma_sep(args.into_iter()))
2040+
self.generic_delimiters(|cx| cx.comma_sep(args.iter().copied()))
20682041
} else {
20692042
Ok(())
20702043
}

0 commit comments

Comments
 (0)