Add test of trailing comma after mut self

Currently fails with:

    ---- test_mut_self stdout ----
    thread 'test_mut_self' panicked at 'Punctuated::push_punct: cannot
    push punctuation if Punctuated is empty or already has trailing
    punctuation', src/punctuated.rs:181:9
This commit is contained in:
David Tolnay 2022-03-16 11:49:50 -07:00
parent 9a669977be
commit 99510ff0c3
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -9,6 +9,7 @@ use syn::Type;
#[test]
fn test_mut_self() {
syn::parse_str::<Type>("fn(mut self)").unwrap();
syn::parse_str::<Type>("fn(mut self,)").unwrap();
syn::parse_str::<Type>("fn(mut self: ())").unwrap();
syn::parse_str::<Type>("fn(mut self: ...)").unwrap_err();
syn::parse_str::<Type>("fn(mut self: mut self)").unwrap_err();