Box large enum variants
This commit is contained in:
parent
54e1309c65
commit
f00366d191
3 changed files with 9 additions and 9 deletions
|
@ -762,14 +762,14 @@ impl<'a> CrateLocator<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn into_error(self, root: Option<CratePaths>) -> CrateError {
|
pub(crate) fn into_error(self, root: Option<CratePaths>) -> CrateError {
|
||||||
CrateError::LocatorCombined(CombinedLocatorError {
|
CrateError::LocatorCombined(Box::new(CombinedLocatorError {
|
||||||
crate_name: self.crate_name,
|
crate_name: self.crate_name,
|
||||||
root,
|
root,
|
||||||
triple: self.triple,
|
triple: self.triple,
|
||||||
dll_prefix: self.target.dll_prefix.to_string(),
|
dll_prefix: self.target.dll_prefix.to_string(),
|
||||||
dll_suffix: self.target.dll_suffix.to_string(),
|
dll_suffix: self.target.dll_suffix.to_string(),
|
||||||
crate_rejections: self.crate_rejections,
|
crate_rejections: self.crate_rejections,
|
||||||
})
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -958,7 +958,7 @@ pub(crate) enum CrateError {
|
||||||
StableCrateIdCollision(Symbol, Symbol),
|
StableCrateIdCollision(Symbol, Symbol),
|
||||||
DlOpen(String),
|
DlOpen(String),
|
||||||
DlSym(String),
|
DlSym(String),
|
||||||
LocatorCombined(CombinedLocatorError),
|
LocatorCombined(Box<CombinedLocatorError>),
|
||||||
NonDylibPlugin(Symbol),
|
NonDylibPlugin(Symbol),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2051,13 +2051,13 @@ pub type FileLinesResult = Result<FileLines, SpanLinesError>;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||||
pub enum SpanLinesError {
|
pub enum SpanLinesError {
|
||||||
DistinctSources(DistinctSources),
|
DistinctSources(Box<DistinctSources>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||||
pub enum SpanSnippetError {
|
pub enum SpanSnippetError {
|
||||||
IllFormedSpan(Span),
|
IllFormedSpan(Span),
|
||||||
DistinctSources(DistinctSources),
|
DistinctSources(Box<DistinctSources>),
|
||||||
MalformedForSourcemap(MalformedSourceMapPositions),
|
MalformedForSourcemap(MalformedSourceMapPositions),
|
||||||
SourceNotAvailable { filename: FileName },
|
SourceNotAvailable { filename: FileName },
|
||||||
}
|
}
|
||||||
|
|
|
@ -542,10 +542,10 @@ impl SourceMap {
|
||||||
let hi = self.lookup_char_pos(sp.hi());
|
let hi = self.lookup_char_pos(sp.hi());
|
||||||
trace!(?hi);
|
trace!(?hi);
|
||||||
if lo.file.start_pos != hi.file.start_pos {
|
if lo.file.start_pos != hi.file.start_pos {
|
||||||
return Err(SpanLinesError::DistinctSources(DistinctSources {
|
return Err(SpanLinesError::DistinctSources(Box::new(DistinctSources {
|
||||||
begin: (lo.file.name.clone(), lo.file.start_pos),
|
begin: (lo.file.name.clone(), lo.file.start_pos),
|
||||||
end: (hi.file.name.clone(), hi.file.start_pos),
|
end: (hi.file.name.clone(), hi.file.start_pos),
|
||||||
}));
|
})));
|
||||||
}
|
}
|
||||||
Ok((lo, hi))
|
Ok((lo, hi))
|
||||||
}
|
}
|
||||||
|
@ -603,10 +603,10 @@ impl SourceMap {
|
||||||
let local_end = self.lookup_byte_offset(sp.hi());
|
let local_end = self.lookup_byte_offset(sp.hi());
|
||||||
|
|
||||||
if local_begin.sf.start_pos != local_end.sf.start_pos {
|
if local_begin.sf.start_pos != local_end.sf.start_pos {
|
||||||
Err(SpanSnippetError::DistinctSources(DistinctSources {
|
Err(SpanSnippetError::DistinctSources(Box::new(DistinctSources {
|
||||||
begin: (local_begin.sf.name.clone(), local_begin.sf.start_pos),
|
begin: (local_begin.sf.name.clone(), local_begin.sf.start_pos),
|
||||||
end: (local_end.sf.name.clone(), local_end.sf.start_pos),
|
end: (local_end.sf.name.clone(), local_end.sf.start_pos),
|
||||||
}))
|
})))
|
||||||
} else {
|
} else {
|
||||||
self.ensure_source_file_source_present(local_begin.sf.clone());
|
self.ensure_source_file_source_present(local_begin.sf.clone());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue