Struct rustc_lint::unused::UnusedBraces[−][src]

pub struct UnusedBraces;

Implementations

impl UnusedBraces[src]

Trait Implementations

impl Clone for UnusedBraces[src]

fn clone(&self) -> UnusedBraces[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl EarlyLintPass for UnusedBraces[src]

fn check_stmt(&mut self, cx: &EarlyContext<'_>, s: &Stmt)[src]

fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &Expr)[src]

fn check_generic_arg(&mut self, cx: &EarlyContext<'_>, arg: &GenericArg)[src]

fn check_variant(&mut self, cx: &EarlyContext<'_>, v: &Variant)[src]

fn check_ty(&mut self, cx: &EarlyContext<'_>, ty: &Ty)[src]

fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item)[src]

fn check_param(&mut self, _: &EarlyContext<'_>, _: &Param)[src]

fn check_ident(&mut self, _: &EarlyContext<'_>, _: Ident)[src]

fn check_crate(&mut self, _: &EarlyContext<'_>, _: &Crate)[src]

fn check_crate_post(&mut self, _: &EarlyContext<'_>, _: &Crate)[src]

fn check_foreign_item(&mut self, _: &EarlyContext<'_>, _: &ForeignItem)[src]

fn check_foreign_item_post(&mut self, _: &EarlyContext<'_>, _: &ForeignItem)[src]

fn check_item_post(&mut self, _: &EarlyContext<'_>, _: &Item)[src]

fn check_local(&mut self, _: &EarlyContext<'_>, _: &Local)[src]

fn check_block(&mut self, _: &EarlyContext<'_>, _: &Block)[src]

fn check_block_post(&mut self, _: &EarlyContext<'_>, _: &Block)[src]

fn check_arm(&mut self, _: &EarlyContext<'_>, _: &Arm)[src]

fn check_pat(&mut self, _: &EarlyContext<'_>, _: &Pat)[src]

fn check_anon_const(&mut self, _: &EarlyContext<'_>, _: &AnonConst)[src]

fn check_pat_post(&mut self, _: &EarlyContext<'_>, _: &Pat)[src]

fn check_expr_post(&mut self, _: &EarlyContext<'_>, _: &Expr)[src]

fn check_generic_param(&mut self, _: &EarlyContext<'_>, _: &GenericParam)[src]

fn check_generics(&mut self, _: &EarlyContext<'_>, _: &Generics)[src]

fn check_where_predicate(&mut self, _: &EarlyContext<'_>, _: &WherePredicate)[src]

fn check_poly_trait_ref(
    &mut self,
    _: &EarlyContext<'_>,
    _: &PolyTraitRef,
    _: &TraitBoundModifier
)
[src]

fn check_fn(&mut self, _: &EarlyContext<'_>, _: FnKind<'_>, _: Span, _: NodeId)[src]

fn check_fn_post(
    &mut self,
    _: &EarlyContext<'_>,
    _: FnKind<'_>,
    _: Span,
    _: NodeId
)
[src]

fn check_trait_item(&mut self, _: &EarlyContext<'_>, _: &AssocItem)[src]

fn check_trait_item_post(&mut self, _: &EarlyContext<'_>, _: &AssocItem)[src]

fn check_impl_item(&mut self, _: &EarlyContext<'_>, _: &AssocItem)[src]

fn check_impl_item_post(&mut self, _: &EarlyContext<'_>, _: &AssocItem)[src]

fn check_struct_def(&mut self, _: &EarlyContext<'_>, _: &VariantData)[src]

fn check_struct_def_post(&mut self, _: &EarlyContext<'_>, _: &VariantData)[src]

fn check_field_def(&mut self, _: &EarlyContext<'_>, _: &FieldDef)[src]

fn check_variant_post(&mut self, _: &EarlyContext<'_>, _: &Variant)[src]

fn check_lifetime(&mut self, _: &EarlyContext<'_>, _: &Lifetime)[src]

fn check_path(&mut self, _: &EarlyContext<'_>, _: &Path, _: NodeId)[src]

fn check_attribute(&mut self, _: &EarlyContext<'_>, _: &Attribute)[src]

fn check_mac_def(&mut self, _: &EarlyContext<'_>, _: &MacroDef, _: NodeId)[src]

fn check_mac(&mut self, _: &EarlyContext<'_>, _: &MacCall)[src]

fn enter_lint_attrs(&mut self, _: &EarlyContext<'_>, _: &[Attribute])[src]

fn exit_lint_attrs(&mut self, _: &EarlyContext<'_>, _: &[Attribute])[src]

impl LintPass for UnusedBraces[src]

fn name(&self) -> &'static str[src]

impl UnusedDelimLint for UnusedBraces[src]

const DELIM_STR: &'static str[src]

const LINT_EXPR_IN_PATTERN_MATCHING_CTX: bool[src]

Due to ref pattern, there can be a difference between using { expr } and expr in pattern-matching contexts. This means that we should only lint unused_parens and not unused_braces in this case. Read more

fn lint(&self) -> &'static Lint[src]

fn check_unused_delims_expr(
    &self,
    cx: &EarlyContext<'_>,
    value: &Expr,
    ctx: UnusedDelimsCtx,
    followed_by_block: bool,
    left_pos: Option<BytePos>,
    right_pos: Option<BytePos>
)
[src]

fn is_expr_delims_necessary(inner: &Expr, followed_by_block: bool) -> bool[src]

fn emit_unused_delims_expr(
    &self,
    cx: &EarlyContext<'_>,
    value: &Expr,
    ctx: UnusedDelimsCtx,
    left_pos: Option<BytePos>,
    right_pos: Option<BytePos>
)
[src]

fn emit_unused_delims(
    &self,
    cx: &EarlyContext<'_>,
    span: Span,
    pattern: &str,
    msg: &str,
    keep_space: (bool, bool)
)
[src]

fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &Expr)[src]

fn check_stmt(&mut self, cx: &EarlyContext<'_>, s: &Stmt)[src]

fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item)[src]

impl Copy for UnusedBraces[src]

Auto Trait Implementations

impl RefUnwindSafe for UnusedBraces

impl Send for UnusedBraces

impl Sync for UnusedBraces

impl Unpin for UnusedBraces

impl UnwindSafe for UnusedBraces

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.