Allow mutable borrows in constant bodies
This commit is contained in:
parent
d24ae2577f
commit
1f420b9891
@ -183,6 +183,10 @@ fn emit_error(&self, item: &Item<'_, '_>, span: Span) {
|
||||
#[derive(Debug)]
|
||||
pub struct MutBorrow(pub BorrowKind);
|
||||
impl NonConstOp for MutBorrow {
|
||||
fn feature_gate(tcx: TyCtxt<'_>) -> Option<bool> {
|
||||
Some(tcx.features().const_mut_refs)
|
||||
}
|
||||
|
||||
fn emit_error(&self, item: &Item<'_, '_>, span: Span) {
|
||||
let kind = self.0;
|
||||
if let BorrowKind::Mut { .. } = kind {
|
||||
|
Loading…
Reference in New Issue
Block a user