Enum slicec::diagnostics::Lint

source ·
pub enum Lint {
    DuplicateFile {
        path: String,
    },
    Deprecated {
        identifier: String,
        reason: Option<String>,
    },
    MalformedDocComment {
        message: String,
    },
    IncorrectDocComment {
        message: String,
    },
    BrokenDocLink {
        message: String,
    },
}

Variants§

§

DuplicateFile

Fields

§path: String

The path of the file that supplied more than once.

An input filename was provided multiple times. Note: it’s valid to specify the same path as a source and reference file (ex: slicec foo.slice -R foo.slice). This is only triggered by specifying it multiple times in the same context: (ex: slicec foo.slice foo.slice).

§

Deprecated

Fields

§identifier: String

The element’s identifier.

§reason: Option<String>

The reason the element was deprecated (if specified).

A deprecated Slice element was used.

§

MalformedDocComment

Fields

§message: String

A syntactical mistake in a doc-comment.

§

IncorrectDocComment

Fields

§message: String

A doc comment contains an incorrect tag. Either:

  • The tag itself is incorrect. Ex: using @throws on an element that can’t or doesn’t throw an exception.
  • The tag describes something incorrect. Ex: specifying @param foo when no parameter named “foo” exists.

Fields

§message: String

A link in a doc-comment couldn’t be resolved. Either:

  • The link pointed to an un-linkable element, e.g. a module, result, sequence, dictionary, or primitive.
  • The link pointed to a non-existent element.

Implementations§

source§

impl Lint

source

pub fn get_default_level(&self) -> DiagnosticLevel

Returns the default diagnostic level this lint should use when reporting violations.

source§

impl Lint

source

pub const ALLOWABLE_LINT_IDENTIFIERS: [&'static str; 6] = _

This array contains all the valid arguments for the ‘allow’ attribute.

source

pub fn code(&self) -> &str

source

pub fn message(&self) -> String

Trait Implementations§

source§

impl Debug for Lint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Lint> for DiagnosticKind

source§

fn from(lint: Lint) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Lint

§

impl RefUnwindSafe for Lint

§

impl Send for Lint

§

impl Sync for Lint

§

impl Unpin for Lint

§

impl UnwindSafe for Lint

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.