Skip to content

Commit d07e03b

Browse files
committed
review
1 parent 2e34783 commit d07e03b

File tree

21 files changed

+62
-40
lines changed

21 files changed

+62
-40
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
499499
ty::Adt(def, ..) if !def.is_box() => {
500500
// Again, only create type information if full debuginfo is enabled
501501
if cx.sess().opts.debuginfo == DebugInfo::Full
502-
&& !impl_self_ty.needs_subst(cx.tcx)
502+
&& !impl_self_ty.definitely_needs_subst(cx.tcx)
503503
{
504504
Some(type_metadata(cx, impl_self_ty, rustc_span::DUMMY_SP))
505505
} else {

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
470470
{
471471
let needs_canonical_flags = if canonicalize_region_mode.any() {
472472
TypeFlags::NEEDS_INFER |
473-
TypeFlags::HAS_POTENTIAL_FREE_REGIONS | // `HAS_RE_PLACEHOLDER` implies `HAS_xxx_FREE_REGIONS`
473+
TypeFlags::HAS_POTENTIAL_FREE_REGIONS | // `HAS_RE_PLACEHOLDER` implies `HAS_POTENTIAL_FREE_REGIONS`
474474
TypeFlags::HAS_TY_PLACEHOLDER |
475475
TypeFlags::HAS_CT_PLACEHOLDER
476476
} else {

compiler/rustc_lint/src/noop_method_call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
6262
_ => return,
6363
};
6464
let substs = cx.typeck_results().node_substs(expr.hir_id);
65-
if substs.needs_subst(cx.tcx) {
65+
if substs.definitely_needs_subst(cx.tcx) {
6666
// We can't resolve on types that require monomorphization, so we don't handle them if
6767
// we need to perfom substitution.
6868
return;

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl<'tcx> Body<'tcx> {
285285
predecessor_cache: PredecessorCache::new(),
286286
is_cyclic: GraphIsCyclicCache::new(),
287287
};
288-
body.is_polymorphic = body.has_param_types_or_consts(tcx);
288+
body.is_polymorphic = body.definitely_has_param_types_or_consts(tcx);
289289
body
290290
}
291291

compiler/rustc_middle/src/ty/flags.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,20 @@ impl FlagComputation {
307307
}
308308

309309
fn add_unevaluated_const<P>(&mut self, ct: ty::Unevaluated<'tcx, P>) {
310+
// The generic arguments of unevaluated consts are a bit special,
311+
// see the `rustc-dev-guide` for more information.
312+
//
313+
// FIXME(@lcnr): Actually add a link here.
310314
if let Some(substs) = ct.substs_ {
315+
// If they are available, we treat them as ordinary generic arguments.
311316
self.add_substs(substs);
312317
} else {
318+
// Otherwise, we add `HAS_UNKNOWN_DEFAULT_CONST_SUBSTS` to signify
319+
// that our const may potentially refer to generic parameters.
320+
//
321+
// Note that depending on which generic parameters are actually
322+
// used in this constant, we may not actually refer to any generic
323+
// parameters at all.
313324
self.add_flags(TypeFlags::STILL_FURTHER_SPECIALIZABLE);
314325
self.add_flags(TypeFlags::HAS_UNKNOWN_DEFAULT_CONST_SUBSTS);
315326
}

compiler/rustc_middle/src/ty/fold.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ pub trait TypeFoldable<'tcx>: fmt::Debug + Clone {
9292
fn references_error(&self) -> bool {
9393
self.has_type_flags(TypeFlags::HAS_ERROR)
9494
}
95-
fn has_potential_param_types_or_consts(&self) -> bool {
95+
fn potentially_has_param_types_or_consts(&self) -> bool {
9696
self.has_type_flags(
9797
TypeFlags::HAS_KNOWN_TY_PARAM
9898
| TypeFlags::HAS_KNOWN_CT_PARAM
9999
| TypeFlags::HAS_UNKNOWN_DEFAULT_CONST_SUBSTS,
100100
)
101101
}
102-
fn has_param_types_or_consts(&self, tcx: TyCtxt<'tcx>) -> bool {
102+
fn definitely_has_param_types_or_consts(&self, tcx: TyCtxt<'tcx>) -> bool {
103103
self.definitely_has_type_flags(
104104
tcx,
105105
TypeFlags::HAS_KNOWN_TY_PARAM | TypeFlags::HAS_KNOWN_CT_PARAM,
@@ -129,7 +129,7 @@ pub trait TypeFoldable<'tcx>: fmt::Debug + Clone {
129129
TypeFlags::KNOWN_NEEDS_SUBST | TypeFlags::HAS_UNKNOWN_DEFAULT_CONST_SUBSTS,
130130
)
131131
}
132-
fn needs_subst(&self, tcx: TyCtxt<'tcx>) -> bool {
132+
fn definitely_needs_subst(&self, tcx: TyCtxt<'tcx>) -> bool {
133133
self.definitely_has_type_flags(tcx, TypeFlags::KNOWN_NEEDS_SUBST)
134134
}
135135
/// "Free" regions in this context means that it has any region
@@ -227,10 +227,13 @@ pub trait TypeVisitor<'tcx>: Sized {
227227
/// Supplies the `tcx` for an unevaluated anonymous constant in case its default substs
228228
/// are not yet supplied.
229229
///
230-
/// Visitors which do not look into these substs may return `None` here, in which case
231-
/// `super_visit_with` completely skips the default substs. Incorrectly returning
232-
/// `None` can very quickly lead to ICE or other critical bugs, so be careful and
233-
/// try to return an actual `tcx` if at all possible.
230+
/// Returning `None` for this method is only recommended if the `TypeVisitor`
231+
/// does not care about default anon const substs, as it ignores generic parameters,
232+
/// and fetching the default substs would cause a query cycle.
233+
///
234+
/// For visitors which return `None` we completely skip the default substs in `ty::Unevaluated::super_visit_with`.
235+
/// This means that incorrectly returning `None` can very quickly lead to ICE or other critical bugs, so be careful and
236+
/// try to return an actual `tcx` if possible.
234237
fn tcx_for_anon_const_substs(&self) -> Option<TyCtxt<'tcx>>;
235238

236239
fn visit_binder<T: TypeFoldable<'tcx>>(

compiler/rustc_middle/src/ty/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
17181718
// Ignore layouts that are done with non-empty environments or
17191719
// non-monomorphic layouts, as the user only wants to see the stuff
17201720
// resulting from the final codegen session.
1721-
if layout.ty.has_param_types_or_consts(self.tcx)
1721+
if layout.ty.definitely_has_param_types_or_consts(self.tcx)
17221722
|| !self.param_env.caller_bounds().is_empty()
17231723
{
17241724
return;
@@ -1887,7 +1887,7 @@ impl<'tcx> SizeSkeleton<'tcx> {
18871887
let tail = tcx.struct_tail_erasing_lifetimes(pointee, param_env);
18881888
match tail.kind() {
18891889
ty::Param(_) | ty::Projection(_) => {
1890-
debug_assert!(tail.has_param_types_or_consts(tcx));
1890+
debug_assert!(tail.definitely_has_param_types_or_consts(tcx));
18911891
Ok(SizeSkeleton::Pointer { non_zero, tail: tcx.erase_regions(tail) })
18921892
}
18931893
_ => bug!(

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ pub trait PrettyPrinter<'tcx>:
11931193

11941194
// Aggregates, printed as array/tuple/struct/variant construction syntax.
11951195
//
1196-
// NB: the `has_param_types_or_consts` check ensures that we can use
1196+
// NB: the `definitely_has_param_types_or_consts` check ensures that we can use
11971197
// the `destructure_const` query with an empty `ty::ParamEnv` without
11981198
// introducing ICEs (e.g. via `layout_of`) from missing bounds.
11991199
// E.g. `transmute([0usize; 2]): (u8, *mut T)` needs to know `T: Sized`
@@ -1202,7 +1202,7 @@ pub trait PrettyPrinter<'tcx>:
12021202
// FIXME(eddyb) for `--emit=mir`/`-Z dump-mir`, we should provide the
12031203
// correct `ty::ParamEnv` to allow printing *all* constant values.
12041204
(_, ty::Array(..) | ty::Tuple(..) | ty::Adt(..))
1205-
if !ty.has_potential_param_types_or_consts() =>
1205+
if !ty.potentially_has_param_types_or_consts() =>
12061206
{
12071207
let contents = self.tcx().destructure_const(
12081208
ty::ParamEnv::reveal_all()

compiler/rustc_mir/src/interpret/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ where
4343
let is_used = unused_params.contains(index).map_or(true, |unused| !unused);
4444
// Only recurse when generic parameters in fns, closures and generators
4545
// are used and require substitution.
46-
match (is_used, subst.needs_subst(self.tcx)) {
46+
match (is_used, subst.definitely_needs_subst(self.tcx)) {
4747
// Just in case there are closures or generators within this subst,
4848
// recurse.
4949
(true, true) => return subst.super_visit_with(self),

compiler/rustc_mir/src/monomorphize/polymorphize.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
292292
}
293293
#[instrument(skip(self))]
294294
fn visit_const(&mut self, c: &'tcx Const<'tcx>) -> ControlFlow<Self::BreakTy> {
295-
if !c.has_potential_param_types_or_consts() {
295+
if !c.potentially_has_param_types_or_consts() {
296296
return ControlFlow::CONTINUE;
297297
}
298298

@@ -325,7 +325,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
325325

326326
#[instrument(skip(self))]
327327
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
328-
if !ty.has_potential_param_types_or_consts() {
328+
if !ty.potentially_has_param_types_or_consts() {
329329
return ControlFlow::CONTINUE;
330330
}
331331

@@ -367,7 +367,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for HasUsedGenericParams<'a, 'tcx> {
367367

368368
#[instrument(skip(self))]
369369
fn visit_const(&mut self, c: &'tcx Const<'tcx>) -> ControlFlow<Self::BreakTy> {
370-
if !c.has_potential_param_types_or_consts() {
370+
if !c.potentially_has_param_types_or_consts() {
371371
return ControlFlow::CONTINUE;
372372
}
373373

@@ -385,7 +385,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for HasUsedGenericParams<'a, 'tcx> {
385385

386386
#[instrument(skip(self))]
387387
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
388-
if !ty.has_potential_param_types_or_consts() {
388+
if !ty.potentially_has_param_types_or_consts() {
389389
return ControlFlow::CONTINUE;
390390
}
391391

compiler/rustc_mir/src/transform/const_prop.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
469469
/// Returns the value, if any, of evaluating `c`.
470470
fn eval_constant(&mut self, c: &Constant<'tcx>, source_info: SourceInfo) -> Option<OpTy<'tcx>> {
471471
// FIXME we need to revisit this for #67176
472-
if c.needs_subst(self.tcx) {
472+
if c.definitely_needs_subst(self.tcx) {
473473
return None;
474474
}
475475

@@ -489,9 +489,9 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
489489
}) => true,
490490
// Out of backwards compatibility we cannot report hard errors in unused
491491
// generic functions using associated constants of the generic parameters.
492-
_ => c.literal.needs_subst(*tcx),
492+
_ => c.literal.definitely_needs_subst(*tcx),
493493
},
494-
ConstantKind::Val(_, ty) => ty.needs_subst(*tcx),
494+
ConstantKind::Val(_, ty) => ty.definitely_needs_subst(*tcx),
495495
};
496496
if lint_only {
497497
// Out of backwards compatibility we cannot report hard errors in unused
@@ -721,7 +721,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
721721
}
722722

723723
// FIXME we need to revisit this for #67176
724-
if rvalue.needs_subst(self.tcx) {
724+
if rvalue.definitely_needs_subst(self.tcx) {
725725
return None;
726726
}
727727

compiler/rustc_mir/src/transform/inline/cycle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ crate fn mir_callgraph_reachable(
8989
// FIXME: A not fully substituted drop shim can cause ICEs if one attempts to
9090
// have its MIR built. Likely oli-obk just screwed up the `ParamEnv`s, so this
9191
// needs some more analysis.
92-
if callee.needs_subst(tcx) {
92+
if callee.definitely_needs_subst(tcx) {
9393
continue;
9494
}
9595
}

compiler/rustc_symbol_mangling/src/legacy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fn get_symbol_hash<'tcx>(
107107
tcx.def_path_hash(def_id).hash_stable(&mut hcx, &mut hasher);
108108

109109
// Include the main item-type. Note that, in this case, the
110-
// assertions about `needs_subst` may not hold, but this item-type
110+
// assertions about `definitely_needs_subst` may not hold, but this item-type
111111
// ought to be the same for every reference anyway.
112112
assert!(!item_type.has_erasable_regions(tcx));
113113
hcx.while_hashing_spans(false, |hcx| {

compiler/rustc_symbol_mangling/src/v0.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ impl Printer<'tcx> for &mut SymbolMangler<'tcx> {
277277

278278
// Encode impl generic params if the substitutions contain parameters (implying
279279
// polymorphization is enabled) and this isn't an inherent impl.
280-
if impl_trait_ref.is_some() && substs.iter().any(|a| a.has_param_types_or_consts(self.tcx))
280+
if impl_trait_ref.is_some()
281+
&& substs.iter().any(|a| a.definitely_has_param_types_or_consts(self.tcx))
281282
{
282283
self = self.path_generic_args(
283284
|this| {

compiler/rustc_trait_selection/src/traits/coherence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ fn orphan_check_trait_ref<'tcx>(
391391
) -> Result<(), OrphanCheckErr<'tcx>> {
392392
debug!("orphan_check_trait_ref(trait_ref={:?}, in_crate={:?})", trait_ref, in_crate);
393393

394-
if trait_ref.needs_infer() && trait_ref.needs_subst(tcx) {
394+
if trait_ref.needs_infer() && trait_ref.definitely_needs_subst(tcx) {
395395
bug!(
396396
"can't orphan check a trait ref with both params and inference variables {:?}",
397397
trait_ref

compiler/rustc_trait_selection/src/traits/const_evaluatable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
8585
let leaf = leaf.subst(tcx, ct.substs);
8686
if leaf.has_infer_types_or_consts() {
8787
failure_kind = FailureKind::MentionsInfer;
88-
} else if leaf.has_param_types_or_consts(tcx) {
88+
} else if leaf.definitely_has_param_types_or_consts(tcx) {
8989
failure_kind = cmp::min(failure_kind, FailureKind::MentionsParam);
9090
}
9191

@@ -95,7 +95,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
9595
let ty = ty.subst(tcx, ct.substs);
9696
if ty.has_infer_types_or_consts() {
9797
failure_kind = FailureKind::MentionsInfer;
98-
} else if ty.has_param_types_or_consts(tcx) {
98+
} else if ty.definitely_has_param_types_or_consts(tcx) {
9999
failure_kind = cmp::min(failure_kind, FailureKind::MentionsParam);
100100
}
101101

@@ -151,7 +151,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
151151
// See #74595 for more details about this.
152152
let concrete = infcx.const_eval_resolve(param_env, uv.expand(), Some(span));
153153

154-
if concrete.is_ok() && uv.substs(infcx.tcx).has_param_types_or_consts(infcx.tcx) {
154+
if concrete.is_ok() && uv.substs(infcx.tcx).definitely_has_param_types_or_consts(infcx.tcx) {
155155
match infcx.tcx.def_kind(uv.def.did) {
156156
DefKind::AnonConst => {
157157
let mir_body = infcx.tcx.mir_for_ctfe_opt_const_arg(uv.def);

compiler/rustc_trait_selection/src/traits/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ fn subst_and_check_impossible_predicates<'tcx>(
449449
debug!("subst_and_check_impossible_predicates(key={:?})", key);
450450

451451
let mut predicates = tcx.predicates_of(key.0).instantiate(tcx, key.1).predicates;
452-
predicates.retain(|predicate| !predicate.needs_subst(tcx));
452+
predicates.retain(|predicate| !predicate.definitely_needs_subst(tcx));
453453
let result = impossible_predicates(tcx, predicates);
454454

455455
debug!("subst_and_check_impossible_predicates(key={:?}) = {:?}", key, result);

compiler/rustc_trait_selection/src/traits/select/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
680680
.param_env
681681
.caller_bounds()
682682
.iter()
683-
.all(|bound| bound.needs_subst(self.tcx()))
683+
.all(|bound| bound.definitely_needs_subst(self.tcx()))
684684
{
685685
// If a param env has no global bounds, global obligations do not
686686
// depend on its particular value in order to work, so we can clear

compiler/rustc_typeck/src/astconv/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
22042204
self.prohibit_generics(path.segments);
22052205
// Try to evaluate any array length constants.
22062206
let normalized_ty = self.normalize_ty(span, tcx.at(span).type_of(def_id));
2207-
if forbid_generic && normalized_ty.needs_subst(tcx) {
2207+
if forbid_generic && normalized_ty.definitely_needs_subst(tcx) {
22082208
let mut err = tcx.sess.struct_span_err(
22092209
path.span,
22102210
"generic `Self` types are currently not permitted in anonymous constants",

compiler/rustc_typeck/src/check/wfcheck.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ fn check_where_clauses<'tcx, 'fcx>(
746746
// Ignore dependent defaults -- that is, where the default of one type
747747
// parameter includes another (e.g., `<T, U = T>`). In those cases, we can't
748748
// be sure if it will error or not as user might always specify the other.
749-
if !ty.needs_subst(tcx) {
749+
if !ty.definitely_needs_subst(tcx) {
750750
fcx.register_wf_obligation(
751751
ty.into(),
752752
tcx.def_span(param.def_id),
@@ -762,7 +762,7 @@ fn check_where_clauses<'tcx, 'fcx>(
762762
// for `struct Foo<const N: usize, const M: usize = { 1 - 2 }>`
763763
// we should eagerly error.
764764
let default_ct = tcx.const_param_default(param.def_id);
765-
if !default_ct.needs_subst(tcx) {
765+
if !default_ct.definitely_needs_subst(tcx) {
766766
fcx.register_wf_obligation(
767767
default_ct.into(),
768768
tcx.def_span(param.def_id),
@@ -796,7 +796,7 @@ fn check_where_clauses<'tcx, 'fcx>(
796796
if is_our_default(param) {
797797
let default_ty = tcx.type_of(param.def_id);
798798
// ... and it's not a dependent default, ...
799-
if !default_ty.needs_subst(tcx) {
799+
if !default_ty.definitely_needs_subst(tcx) {
800800
// ... then substitute it with the default.
801801
return default_ty.into();
802802
}
@@ -809,7 +809,7 @@ fn check_where_clauses<'tcx, 'fcx>(
809809
if is_our_default(param) {
810810
let default_ct = tcx.const_param_default(param.def_id);
811811
// ... and it's not a dependent default, ...
812-
if !default_ct.needs_subst(tcx) {
812+
if !default_ct.definitely_needs_subst(tcx) {
813813
// ... then substitute it with the default.
814814
return default_ct.into();
815815
}
@@ -858,7 +858,7 @@ fn check_where_clauses<'tcx, 'fcx>(
858858
let substituted_pred = pred.subst(tcx, substs);
859859
// Don't check non-defaulted params, dependent defaults (including lifetimes)
860860
// or preds with multiple params.
861-
if substituted_pred.has_param_types_or_consts(tcx)
861+
if substituted_pred.definitely_has_param_types_or_consts(tcx)
862862
|| param_count.params.len() > 1
863863
|| has_region
864864
{

compiler/rustc_typeck/src/collect/type_of.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,21 @@ fn get_path_containing_arg_in_pat<'hir>(
277277
pub(super) fn default_anon_const_substs(tcx: TyCtxt<'_>, def_id: DefId) -> SubstsRef<'_> {
278278
let generics = tcx.generics_of(def_id);
279279
if let Some(parent) = generics.parent {
280+
// This is the reason we bother with having optional anon const substs.
281+
//
282+
// In the future the substs of an anon const will depend on its parents predicates
283+
// at which point eagerly looking at them will cause a query cycle.
284+
//
285+
// So for now this is only an assurance that this approach won't cause cycle errors in
286+
// the future.
280287
let _cycle_check = tcx.predicates_of(parent);
281288
}
282289

283290
let substs = InternalSubsts::identity_for_item(tcx, def_id);
284291
// We only expect substs with the following type flags as default substs.
285292
//
286293
// Getting this wrong can lead to ICE and unsoundness, so we assert it here.
287-
for arg in substs.iter().flat_map(|s| s.walk(tcx)) {
294+
for arg in substs.iter() {
288295
let allowed_flags = ty::TypeFlags::MAY_NEED_DEFAULT_CONST_SUBSTS
289296
| ty::TypeFlags::STILL_FURTHER_SPECIALIZABLE;
290297
assert!(!arg.has_type_flags(!allowed_flags));

0 commit comments

Comments
 (0)