Skip to content

Commit af9009f

Browse files
committed
TODO(fmease): Debug-assert that default traits are "simple"
1 parent 91d1ed2 commit af9009f

File tree

1 file changed

+6
-0
lines changed
  • compiler/rustc_hir_analysis/src/hir_ty_lowering

1 file changed

+6
-0
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
339339
let tcx = self.tcx();
340340

341341
if tcx.is_lang_item(def_id, hir::LangItem::Sized) || tcx.is_default_trait(def_id) {
342+
// FIXME(fmease): Debug-assert that the trait doesn't have any generic parameters
343+
// (except `Self`) or associated items since we wouldn't be able to
344+
// wfcheck args & constraints passed to it.
345+
// E.g., `?BadDefaultTrait<Vec<str>`.
346+
// NOTE: Alternatively / additionally, introduce a validation step for
347+
// traits marked `#[default_trait]` in AST validation / lowering.
342348
return;
343349
}
344350

0 commit comments

Comments
 (0)