pub struct CompileReport {
pub unreachable_clauses: Vec<usize>,
}Expand description
What the compiler noticed on the way through, beyond the term itself.
Fields§
§unreachable_clauses: Vec<usize>Clause indices no input can ever select, because an earlier clause already covers everything they do. First-match semantics makes them dead rather than wrong, so this is information for the surface to surface.
★ WHAT LEAN DOES WITH THE SAME FACT, and it is not what the previous sentence here
claimed. Lean does NOT quietly accept a redundant alternative: Lean/Elab/Match.lean:999
calls logError "redundant alternative" for every index in result.unusedAltIdxs, and
the run on this box confirms it — def h : Hue → Bool | .ruby => true | .jade => false | _ => true answers error: redundant alternative. The error is non-fatal (#eval h Hue.ruby still prints true, so the declaration is added), and
Lean/Elab/Match.lean:985-988 declares the option that turns it off:
match.ignoreUnusedAlts, default false.
So the MEANING is the same in both compilers and only the default severity differs: LOGOS
behaves as Lean does under set_option match.ignoreUnusedAlts true. What is still missing
is the report reaching a reader — literate_parser::parse_consider discards this census,
so a dead clause is silent rather than merely non-fatal. That needs a warning channel on
Command, which this module does not own.
Trait Implementations§
Source§impl Clone for CompileReport
impl Clone for CompileReport
Source§fn clone(&self) -> CompileReport
fn clone(&self) -> CompileReport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompileReport
impl Debug for CompileReport
Source§impl Default for CompileReport
impl Default for CompileReport
Source§fn default() -> CompileReport
fn default() -> CompileReport
Source§impl PartialEq for CompileReport
impl PartialEq for CompileReport
impl Eq for CompileReport
impl StructuralPartialEq for CompileReport
Auto Trait Implementations§
impl Freeze for CompileReport
impl RefUnwindSafe for CompileReport
impl Send for CompileReport
impl Sync for CompileReport
impl Unpin for CompileReport
impl UnsafeUnpin for CompileReport
impl UnwindSafe for CompileReport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.