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
Auto merge of #103322 - matthiaskrgr:rollup-m9zgpft, r=matthiaskrgr
Rollup of 9 pull requests
Successful merges:
- #103221 (Fix `SelfVisitor::is_self_ty` ICE)
- #103230 (Clarify startup)
- #103281 (Adjust `transmute{,_copy}` to be clearer about which of `T` and `U` is input vs output)
- #103288 (Fixed docs typo in `library/std/src/time.rs`)
- #103296 (+/- shortcut now only expand/collapse, not both)
- #103297 (fix typo)
- #103313 (Don't label `src/test` tests as `A-testsuite`)
- #103315 (interpret: remove an incorrect assertion)
- #103319 (Improve "`~const` is not allowed here" message)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
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