You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 28, 2025. It is now read-only.
letmut err = self.err_handler().struct_span_err(bound.span(),"`~const` is not allowed here");
1434
+
match reason {
1435
+
DisallowTildeConstContext::TraitObject => err.note("trait objects cannot have `~const` trait bounds"),
1436
+
DisallowTildeConstContext::ImplTrait => err.note("`impl Trait`s cannot have `~const` trait bounds"),
1437
+
DisallowTildeConstContext::Fn(FnKind::Closure(..)) => err.note("closures cannot have `~const` trait bounds"),
1438
+
DisallowTildeConstContext::Fn(FnKind::Fn(_, ident, ..)) => err.span_note(ident.span,"this function is not `const`, so it cannot have `~const` trait bounds"),
1439
+
};
1440
+
err.emit();
1421
1441
}
1422
1442
(_,TraitBoundModifier::MaybeConstMaybe) => {
1423
1443
self.err_handler()
@@ -1523,10 +1543,13 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
1523
1543
});
1524
1544
}
1525
1545
1526
-
let tilde_const_allowed = matches!(fk.header(),Some(FnHeader{ .. }))
0 commit comments