You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnspan(&self) -> Span{match&self{Attribute::Unparsed(u) => u.span,// FIXME: should not be needed anymore when all attrs are parsedAttribute::Parsed(AttributeKind::Deprecation{ span, .. }) => *span,Attribute::Parsed(AttributeKind::DocComment{ span, .. }) => *span,
a => panic!("can't get the span of an arbitrary parsed attribute: {a:?}"),}}
So the problem is some internal attrs don't contain span, and attr.span() is infallible.
The solution is to extract some kinds of attrs, but most attrs on fns are not useful, except contracts.
The contracts come from two flavours: builtin-Rust, or custom tools
builtin-Rust contracts seems not a kind of attr, it may be converted to some generated code into the function, thus skip this case
#[kanitool::contract] is important, because once the contract content changes, proofs related to this contracts need to rerun
The text was updated successfully, but these errors were encountered:
Seems that it's problematic to query span of some attributes?
panic location: https://github.com/rust-lang/rust/blob/71b68da1bd9fa6afb9f964a731e9c843ab0862bd/compiler/rustc_hir/src/hir.rs#L1204
So the problem is some internal attrs don't contain span, and
attr.span()
is infallible.The solution is to extract some kinds of attrs, but most attrs on fns are not useful, except contracts.
The contracts come from two flavours: builtin-Rust, or custom tools
#[kanitool::contract]
is important, because once the contract content changes, proofs related to this contracts need to rerunThe text was updated successfully, but these errors were encountered: