jinxdash / prettier-plugin-rust

Prettier Rust is an opinionated code formatter that autocorrects bad syntax.
MIT License
178 stars 7 forks source link

it return error on some code but rustfmt works well. #30

Open asukaminato0721 opened 1 year ago

asukaminato0721 commented 1 year ago

Input code

type a = Map<Zip<Zip<Zip<Zip<IterMut<'_, f64, Dim<[usize; 2]>>, Iter<'_, f64, Dim<[usize; 2]>>>, Iter<'_, f64, Dim<[usize; 1]>>>, Iter<'_, f64, Dim<[usize; 2]>>>, Iter<'_, bool, {unknown}>>, impl Fn(((((&mut f64, &f64), &f64), &f64), &bool)) -> (&mut f64, &bool, &bool, &bool, &bool)> ;

Output code

type a = Map<
    Zip<
        Zip<
            Zip<
                Zip<IterMut<'_, f64, Dim<[usize; 2]>>, Iter<'_, f64, Dim<[usize; 2]>>>,
                Iter<'_, f64, Dim<[usize; 1]>>,
            >,
            Iter<'_, f64, Dim<[usize; 2]>>,
        >,
        Iter<'_, bool, { unknown }>,
    >,
    impl Fn(((((&mut f64, &f64), &f64), &f64), &bool)) -> (&mut f64, &bool, &bool, &bool, &bool),
>;

Additional context

return error

SyntaxError: Unexpected token, expected "," (1:71)

SyntaxError: Unexpected token, expected "," (1:71)
> 1 | type a = Map<Zip<Zip<Zip<Zip<IterMut<'_, f64, Dim<[usize; 2]>>, Iter<'_, f64, Dim<[usize; 2]>>>, Iter<'_, f64, Dim<[usize; 1]>>>, Iter<'_, f64, Dim<[usize; 2]>>>, Iter<'_, bool, {unknown}>>, impl Fn(((((&mut f64, &f64), &f64), &f64), &bool)) -> (&mut f64, &bool, &bool, &bool, &bool)> ;
    |                                                                       ^

loc: { start: { line: 1, column: 71 } },