charon icon indicating copy to clipboard operation
charon copied to clipboard

The name pattern `{_}` doesn't work as expected

Open sonmarcho opened this issue 1 year ago • 5 comments

The pattern alloc::vec::{_}::set_len is expected to match alloc::vec::Vec<T, ...>::set_len (when using the Rust name pattern matcher) but doesn't (note that alloc::vec::_::set_len does).

sonmarcho avatar Oct 02 '24 12:10 sonmarcho

the rust name matcher doesn't actually handle inherent impl blocks at all at the moment :sweat_smile:

Nadrieril avatar Oct 02 '24 13:10 Nadrieril

Oh I see ^^ I'm surprised those are in the syntax at all for the moment: maybe we should (temporarily) panic if an impl block appears in a pattern after parsing?

sonmarcho avatar Oct 03 '24 15:10 sonmarcho

I can't distinguish impl blocks from trait impls because we allow {Trait<Self>} syntax

Nadrieril avatar Oct 03 '24 15:10 Nadrieril

What is the {Trait<Self>} syntax? (I'm not sure the Charon-ML name matcher allows the same)

sonmarcho avatar Oct 03 '24 15:10 sonmarcho

it's equivalent to {impl Trait for Self} (where Self is some type)

Nadrieril avatar Oct 03 '24 17:10 Nadrieril