fn parse_optional_matching_ident<P, M1, M2, T>(p: &mut P, name: T, msg: M1, sec: M2)
where
    P: Parser,
    M1: Display,
    M2: Display,
    T: Into<Option<Spanned<Name>>>,
{
    if let Some(n) = try_ident(p) {
        if let Some(name) = name.into() {
            if n.value != name.value {
                p.emit(
                    DiagBuilder2::warning(format!(
                        "`{}` does not match {} name `{}`",
                        n.value, msg, name.value
                    ))
                    .span(n.span)
                    .add_note(format!("see IEEE 1076-2008 {}", sec)),
                );
            }
        } else {
            p.emit(
                DiagBuilder2::warning(format!(
                    "Label `{}` is given at the end of {}, but not at the beginning",
                    n.value, msg
                ))
                .span(n.span)
                .add_note(format!("see IEEE 1076-2008 {}", sec)),
            );
        }
    }
}
/// Parse the optional trailing name after an entity, configuration, etc., which
/// must match the name at the beginning of the declaration.
Parse the optional trailing name after an entity, configuration, etc., which
must match the name at the beginning of the declaration.
Parse the optional trailing name after an entity configuration etc . which must match the name at the beginning of the declaration .
fn parse_optional_matching_ident<P, M1, M2, T>(p: &mut P, name: T, msg: M1, sec: M2)
where
    P: Parser,
    M1: Display,
    M2: Display,
    T: Into<Option<Spanned<Name>>>,
{
    if let Some(n) = try_ident(p) {
        if let Some(name) = name.into() {
            if n.value != name.value {
                p.emit(
                    DiagBuilder2::warning(format!(
                        "`{}` does not match {} name `{}`",
                        n.value, msg, name.value
                    ))
                    .span(n.span)
                    .add_note(format!("see IEEE 1076-2008 {}", sec)),
                );
            }
        } else {
            p.emit(
                DiagBuilder2::warning(format!(
                    "Label `{}` is given at the end of {}, but not at the beginning",
                    n.value, msg
                ))
                .span(n.span)
                .add_note(format!("see IEEE 1076-2008 {}", sec)),
            );
        }
    }
}
fn parse_optional_matching_ident < P , M1 , M2 , T > ( p : & mut P , name : T , msg : M1 , sec : M2 ) where P : Parser , M1 : Display , M2 : Display , T : Into < Option < Spanned < Name > > > , { if let Some ( n ) = try_ident ( p ) { if let Some ( name ) = name . into ( ) { if n . value != name . value { p . emit ( DiagBuilder2 :: warning ( format ! ( " " n value msg name value ) ) . span ( n . span ) . add_note ( format ! ( " " sec ) ) , ) ; } } else { p . emit ( DiagBuilder2 :: warning ( format ! ( " " n value msg ) ) . span ( n . span ) . add_note ( format ! ( " " sec ) ) , ) ; } } }
Parse the optional trailing name after an entity, configuration, etc., which
must match the name at the beginning of the declaration.
Parse the optional trailing name after an entity configuration etc . which must match the name at the beginning of the declaration .
p
&mut P
name
T
msg
M1
sec
M2
p
&mut P
name
T
msg
M1
sec
M2