Make bytecode::Location Copy

This commit is contained in:
Noah committed 2020-03-13 21:49:10 -05:00
1 parent b6d155df8b
commit eecb097ae6
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ use std::collections::{HashMap, HashSet};
use std::fmt;
/// Sourcode location.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Location {
row: usize,
column: usize,
+1 -1
View File
@@ -15,7 +15,7 @@ impl From<Vec<InstructionMetadata>> for InstructionMetadata {
fn from(metas: Vec<Self>) -> Self {
debug_assert!(!metas.is_empty(), "`metas` must not be empty");
InstructionMetadata {
loc: metas[0].loc.clone(),
loc: metas[0].loc,
labels: metas
.into_iter()
.flat_map(|meta| meta.labels.into_iter())
+1 -1
View File
@@ -1348,7 +1348,7 @@ impl Frame {
}
pub fn get_lineno(&self) -> bytecode::Location {
self.code.locations[self.lasti.get()].clone()
self.code.locations[self.lasti.get()]
}
fn push_block(&self, typ: BlockType) {