[DEV-7086] TAMER: TransitionError::Incompatible: Remove unused
parent
eab47783ab
commit
a4657580ca
|
@ -621,7 +621,11 @@ mod test {
|
|||
// Set up an object to fail redeclaration.
|
||||
let node = sut.declare(&sym, IdentKind::Meta, src.clone())?;
|
||||
let obj = sut.get(node).unwrap();
|
||||
let terr = TransitionError::Incompatible(String::from("test fail"));
|
||||
let terr = TransitionError::ExternResolution {
|
||||
name: String::from("test fail"),
|
||||
expected: IdentKind::Meta,
|
||||
given: IdentKind::Meta,
|
||||
};
|
||||
obj.fail_redeclare.replace(Some(terr.clone()));
|
||||
|
||||
// Should invoke StubIdentObject::redeclare on the above `obj`.
|
||||
|
@ -682,7 +686,11 @@ mod test {
|
|||
|
||||
// It doesn't matter that this isn't the error that'll actually be
|
||||
// returned, as long as it's some sort of TransitionError.
|
||||
let terr = TransitionError::Incompatible(String::from("test fail"));
|
||||
let terr = TransitionError::ExternResolution {
|
||||
name: String::from("test fail"),
|
||||
expected: IdentKind::Meta,
|
||||
given: IdentKind::Meta,
|
||||
};
|
||||
obj.fail_extern.replace(Some(terr.clone()));
|
||||
|
||||
// Should invoke StubIdentObject::extern_ on the above `obj`.
|
||||
|
|
|
@ -390,13 +390,6 @@ impl<'i> IdentObjectState<'i, IdentObject<'i>> for IdentObject<'i> {
|
|||
/// TODO: Provide enough information to construct a useful message.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum TransitionError {
|
||||
/// An attempt to redeclare an identifier with additional information
|
||||
/// has failed because the provided information was not compatible
|
||||
/// with the original declaration.
|
||||
///
|
||||
/// See [`IdentObjectState::resolve`].
|
||||
Incompatible(String),
|
||||
|
||||
/// Extern resolution failure.
|
||||
///
|
||||
/// An extern could not be resolved because the provided identifier had
|
||||
|
@ -417,10 +410,6 @@ pub enum TransitionError {
|
|||
impl std::fmt::Display for TransitionError {
|
||||
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Incompatible(msg) => {
|
||||
write!(fmt, "object incompatible: {}", msg)
|
||||
}
|
||||
|
||||
Self::ExternResolution {
|
||||
name,
|
||||
expected,
|
||||
|
|
Loading…
Reference in New Issue