[−][src]Struct rune::Warnings
Compilation warnings.
Implementations
impl Warnings
[src]
pub fn disabled() -> Self
[src]
Construct a new, empty collection of compilation warnings that is disabled, i.e. any warnings added to it will be ignored.
Examples
use rune::Warnings; use runestick::Span; let mut warnings = Warnings::disabled(); assert!(warnings.is_empty()); warnings.not_used(0, Span::empty(), None);
pub fn new() -> Self
[src]
Construct a new, empty collection of compilation warnings.
Examples
use rune::{Warnings, Warning, WarningKind}; use runestick::Span; let mut warnings = Warnings::new(); assert!(warnings.is_empty()); warnings.not_used(0, Span::empty(), None); assert!(!warnings.is_empty()); assert!(matches!(warnings.iter().next(), Some(Warning { source_id: 0, kind: WarningKind::NotUsed { .. } })));
pub fn is_empty(&self) -> bool
[src]
Indicate if there are warnings or not.
pub fn iter(&self) -> impl Iterator<Item = &Warning>
[src]
Get an iterator over all the warnings.
pub fn not_used(&mut self, source_id: usize, span: Span, context: Option<Span>)
[src]
Indicate that a value is produced but never used.
pub fn let_pattern_might_panic(
&mut self,
source_id: usize,
span: Span,
context: Option<Span>
)
[src]
&mut self,
source_id: usize,
span: Span,
context: Option<Span>
)
Indicate that a binding pattern might panic.
Like let (a, b) = value
.
pub fn template_without_expansions(
&mut self,
source_id: usize,
span: Span,
context: Option<Span>
)
[src]
&mut self,
source_id: usize,
span: Span,
context: Option<Span>
)
Indicate that we encountered a template string without any expansion groups.
Like `Hello`
.
pub fn remove_tuple_call_parens(
&mut self,
source_id: usize,
span: Span,
variant: Span,
context: Option<Span>
)
[src]
&mut self,
source_id: usize,
span: Span,
variant: Span,
context: Option<Span>
)
Add a warning indicating that the parameters of an empty tuple can be removed when creating it.
Like None()
.
pub fn uneccessary_semi_colon(&mut self, source_id: usize, span: Span)
[src]
Add a warning about an unecessary semi-colon.
Trait Implementations
impl Clone for Warnings
[src]
impl Debug for Warnings
[src]
impl Default for Warnings
[src]
impl<'a> IntoIterator for &'a Warnings
[src]
Auto Trait Implementations
impl RefUnwindSafe for Warnings
impl Send for Warnings
impl Sync for Warnings
impl Unpin for Warnings
impl UnwindSafe for Warnings
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,