Skip to content

Commit f00366d

Browse files
committed
Box large enum variants
1 parent 54e1309 commit f00366d

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

compiler/rustc_metadata/src/locator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -762,14 +762,14 @@ impl<'a> CrateLocator<'a> {
762762
}
763763

764764
pub(crate) fn into_error(self, root: Option<CratePaths>) -> CrateError {
765-
CrateError::LocatorCombined(CombinedLocatorError {
765+
CrateError::LocatorCombined(Box::new(CombinedLocatorError {
766766
crate_name: self.crate_name,
767767
root,
768768
triple: self.triple,
769769
dll_prefix: self.target.dll_prefix.to_string(),
770770
dll_suffix: self.target.dll_suffix.to_string(),
771771
crate_rejections: self.crate_rejections,
772-
})
772+
}))
773773
}
774774
}
775775

@@ -958,7 +958,7 @@ pub(crate) enum CrateError {
958958
StableCrateIdCollision(Symbol, Symbol),
959959
DlOpen(String),
960960
DlSym(String),
961-
LocatorCombined(CombinedLocatorError),
961+
LocatorCombined(Box<CombinedLocatorError>),
962962
NonDylibPlugin(Symbol),
963963
}
964964

compiler/rustc_span/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,13 +2051,13 @@ pub type FileLinesResult = Result<FileLines, SpanLinesError>;
20512051

20522052
#[derive(Clone, PartialEq, Eq, Debug)]
20532053
pub enum SpanLinesError {
2054-
DistinctSources(DistinctSources),
2054+
DistinctSources(Box<DistinctSources>),
20552055
}
20562056

20572057
#[derive(Clone, PartialEq, Eq, Debug)]
20582058
pub enum SpanSnippetError {
20592059
IllFormedSpan(Span),
2060-
DistinctSources(DistinctSources),
2060+
DistinctSources(Box<DistinctSources>),
20612061
MalformedForSourcemap(MalformedSourceMapPositions),
20622062
SourceNotAvailable { filename: FileName },
20632063
}

compiler/rustc_span/src/source_map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,10 @@ impl SourceMap {
542542
let hi = self.lookup_char_pos(sp.hi());
543543
trace!(?hi);
544544
if lo.file.start_pos != hi.file.start_pos {
545-
return Err(SpanLinesError::DistinctSources(DistinctSources {
545+
return Err(SpanLinesError::DistinctSources(Box::new(DistinctSources {
546546
begin: (lo.file.name.clone(), lo.file.start_pos),
547547
end: (hi.file.name.clone(), hi.file.start_pos),
548-
}));
548+
})));
549549
}
550550
Ok((lo, hi))
551551
}
@@ -603,10 +603,10 @@ impl SourceMap {
603603
let local_end = self.lookup_byte_offset(sp.hi());
604604

605605
if local_begin.sf.start_pos != local_end.sf.start_pos {
606-
Err(SpanSnippetError::DistinctSources(DistinctSources {
606+
Err(SpanSnippetError::DistinctSources(Box::new(DistinctSources {
607607
begin: (local_begin.sf.name.clone(), local_begin.sf.start_pos),
608608
end: (local_end.sf.name.clone(), local_end.sf.start_pos),
609-
}))
609+
})))
610610
} else {
611611
self.ensure_source_file_source_present(local_begin.sf.clone());
612612

0 commit comments

Comments
 (0)