rtic_core/
errors.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#[derive(thiserror::Error, Debug)]
pub enum ParseError {
    #[error("`device = [ path::to:pac ]` argument must be provided.")]
    DeviceArg,

    #[error("The number of elements provided to the `device` argument doesn't match the number of cores.")]
    DevicesCoresMismatch,

    #[cfg_attr(feature = "multipac", error("The value passed to the `device` argument must be either a path to a PAC crate or a list of paths in case of multiple cores."))]
    #[cfg_attr(
        not(feature = "multipac"),
        error("The value passed to the `device` argument must be a path to a PAC crate.")
    )]
    DeviceNotPath,
}
impl ParseError {
    pub fn to_syn(&self, span: proc_macro2::Span) -> syn::Error {
        syn::Error::new(span, self)
    }
}