Remove 'pat
lifetime from some match-lowering data structures
By storing `PatRange` in an Arc, and copying a few fields out of `Pat`, we can greatly simplify the lifetimes involved in match lowering.
This commit is contained in:
parent
ee17c3bc4d
commit
849e0364c1
8 changed files with 107 additions and 99 deletions
|
@ -11,6 +11,7 @@
|
|||
use std::cmp::Ordering;
|
||||
use std::fmt;
|
||||
use std::ops::Index;
|
||||
use std::sync::Arc;
|
||||
|
||||
use rustc_abi::{FieldIdx, Integer, Size, VariantIdx};
|
||||
use rustc_ast::{AsmMacro, InlineAsmOptions, InlineAsmTemplatePiece};
|
||||
|
@ -846,7 +847,7 @@ pub enum PatKind<'tcx> {
|
|||
subpattern: Box<Pat<'tcx>>,
|
||||
},
|
||||
|
||||
Range(Box<PatRange<'tcx>>),
|
||||
Range(Arc<PatRange<'tcx>>),
|
||||
|
||||
/// Matches against a slice, checking the length and extracting elements.
|
||||
/// irrefutable when there is a slice pattern and both `prefix` and `suffix` are empty.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue