Skip to content

Commit

Permalink
Fix new 'unnecessary trailing semicolon' warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Nov 26, 2020
1 parent db0d0e8 commit 6f91c32
Show file tree
Hide file tree
Showing 28 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/mir/block.rs
Expand Up @@ -451,7 +451,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
Inhabited,
ZeroValid,
UninitValid,
};
}
let panic_intrinsic = intrinsic.and_then(|i| match i {
sym::assert_inhabited => Some(AssertIntrinsic::Inhabited),
sym::assert_zero_valid => Some(AssertIntrinsic::ZeroValid),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/builtin.rs
Expand Up @@ -2345,7 +2345,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
enum InitKind {
Zeroed,
Uninit,
};
}

/// Information about why a type cannot be initialized this way.
/// Contains an error message and optionally a span to point at.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/types.rs
Expand Up @@ -1131,7 +1131,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
fn check_for_opaque_ty(&mut self, sp: Span, ty: Ty<'tcx>) -> bool {
struct ProhibitOpaqueTypes<'a, 'tcx> {
cx: &'a LateContext<'tcx>,
};
}

impl<'a, 'tcx> ty::fold::TypeVisitor<'tcx> for ProhibitOpaqueTypes<'a, 'tcx> {
type BreakTy = Ty<'tcx>;
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/mir/visit.rs
Expand Up @@ -254,7 +254,7 @@ macro_rules! make_mir_visitor {
macro_rules! basic_blocks {
(mut) => (body.basic_blocks_mut().iter_enumerated_mut());
() => (body.basic_blocks().iter_enumerated());
};
}
for (bb, data) in basic_blocks!($($mutability)?) {
self.visit_basic_block_data(bb, data);
}
Expand All @@ -275,7 +275,7 @@ macro_rules! make_mir_visitor {
macro_rules! type_annotations {
(mut) => (body.user_type_annotations.iter_enumerated_mut());
() => (body.user_type_annotations.iter_enumerated());
};
}

for (index, annotation) in type_annotations!($($mutability)?) {
self.visit_user_type_annotation(
Expand Down Expand Up @@ -909,7 +909,7 @@ macro_rules! make_mir_visitor {
macro_rules! basic_blocks {
(mut) => (body.basic_blocks_mut());
() => (body.basic_blocks());
};
}
let basic_block = & $($mutability)? basic_blocks!($($mutability)?)[location.block];
if basic_block.statements.len() == location.statement_index {
if let Some(ref $($mutability)? terminator) = basic_block.terminator {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/instance.rs
Expand Up @@ -540,7 +540,7 @@ fn polymorphize<'tcx>(

struct PolymorphizationFolder<'tcx> {
tcx: TyCtxt<'tcx>,
};
}

impl ty::TypeFolder<'tcx> for PolymorphizationFolder<'tcx> {
fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/interpret/util.rs
Expand Up @@ -15,7 +15,7 @@ where

struct UsedParamsNeedSubstVisitor<'tcx> {
tcx: TyCtxt<'tcx>,
};
}

impl<'tcx> TypeVisitor<'tcx> for UsedParamsNeedSubstVisitor<'tcx> {
type BreakTy = ();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ty_utils/src/ty.rs
Expand Up @@ -309,7 +309,7 @@ fn well_formed_types_in_env<'tcx>(
InherentImpl,
Fn,
Other,
};
}

let node_kind = match node {
Node::TraitItem(item) => match item.kind {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/check.rs
Expand Up @@ -477,7 +477,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
struct ProhibitOpaqueVisitor<'tcx> {
opaque_identity_ty: Ty<'tcx>,
generics: &'tcx ty::Generics,
};
}

impl<'tcx> ty::fold::TypeVisitor<'tcx> for ProhibitOpaqueVisitor<'tcx> {
type BreakTy = Option<Ty<'tcx>>;
Expand Down
6 changes: 3 additions & 3 deletions library/alloc/tests/vec.rs
Expand Up @@ -919,7 +919,7 @@ fn test_from_iter_partially_drained_in_place_specialization() {

#[test]
fn test_from_iter_specialization_with_iterator_adapters() {
fn assert_in_place_trait<T: InPlaceIterable>(_: &T) {};
fn assert_in_place_trait<T: InPlaceIterable>(_: &T) {}
let src: Vec<usize> = vec![0usize; 256];
let srcptr = src.as_ptr();
let iter = src
Expand Down Expand Up @@ -1198,7 +1198,7 @@ fn drain_filter_consumed_panic() {
struct Check {
index: usize,
drop_counts: Rc<Mutex<Vec<usize>>>,
};
}

impl Drop for Check {
fn drop(&mut self) {
Expand Down Expand Up @@ -1250,7 +1250,7 @@ fn drain_filter_unconsumed_panic() {
struct Check {
index: usize,
drop_counts: Rc<Mutex<Vec<usize>>>,
};
}

impl Drop for Check {
fn drop(&mut self) {
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/fmt/mod.rs
Expand Up @@ -1182,7 +1182,7 @@ impl<'a> Formatter<'a> {
/// ```
/// use std::fmt;
///
/// struct Foo { nb: i32 };
/// struct Foo { nb: i32 }
///
/// impl Foo {
/// fn new(nb: i32) -> Foo {
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/future/poll_fn.rs
Expand Up @@ -21,7 +21,7 @@ use crate::task::{Context, Poll};
///
/// let read_future = poll_fn(read_line);
/// assert_eq!(read_future.await, "Hello, World!".to_owned());
/// # };
/// # }
/// ```
#[unstable(feature = "future_poll_fn", issue = "72302")]
pub fn poll_fn<T, F>(f: F) -> PollFn<F>
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/mem/maybe_uninit.rs
Expand Up @@ -348,7 +348,7 @@ impl<T> MaybeUninit<T> {
/// ```rust,no_run
/// use std::mem::MaybeUninit;
///
/// enum NotZero { One = 1, Two = 2 };
/// enum NotZero { One = 1, Two = 2 }
///
/// let x = MaybeUninit::<(u8, NotZero)>::zeroed();
/// let x = unsafe { x.assume_init() };
Expand Down
2 changes: 1 addition & 1 deletion library/core/tests/ptr.rs
Expand Up @@ -18,7 +18,7 @@ fn test() {
struct Pair {
fst: isize,
snd: isize,
};
}
let mut p = Pair { fst: 10, snd: 20 };
let pptr: *mut Pair = &mut p;
let iptr: *mut isize = pptr as *mut isize;
Expand Down
4 changes: 2 additions & 2 deletions library/test/src/lib.rs
Expand Up @@ -265,14 +265,14 @@ where
running_tests.remove(test);
}
timed_out
};
}

fn calc_timeout(running_tests: &TestMap) -> Option<Duration> {
running_tests.values().min().map(|next_timeout| {
let now = Instant::now();
if *next_timeout >= now { *next_timeout - now } else { Duration::new(0, 0) }
})
};
}

if concurrency == 1 {
while !remaining.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/associated-type-bounds/dyn-impl-trait-type.rs
Expand Up @@ -30,7 +30,7 @@ fn def_et3() -> Et3 {
impl Tr1 for A {
type As1 = core::ops::Range<u8>;
fn mk(&self) -> Self::As1 { 0..10 }
};
}
Box::new(A)
}
pub fn use_et3() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/associated-type-bounds/dyn-lcsit.rs
Expand Up @@ -33,7 +33,7 @@ const cdef_et3: &dyn Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>
impl Tr1 for A {
type As1 = core::ops::Range<u8>;
fn mk(&self) -> Self::As1 { 0..10 }
};
}
&A
};
pub fn use_et3() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/associated-type-bounds/dyn-rpit-and-let.rs
Expand Up @@ -35,7 +35,7 @@ fn def_et3() -> Box<dyn Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>
impl Tr1 for A {
type As1 = core::ops::Range<u8>;
fn mk(&self) -> Self::As1 { 0..10 }
};
}
let x /* : Box<dyn Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>> */
= Box::new(A);
x
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/associated-type-bounds/lcsit.rs
Expand Up @@ -39,7 +39,7 @@ const cdef_et3: impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>
impl Tr1 for A {
type As1 = core::ops::Range<u8>;
fn mk(&self) -> Self::As1 { 0..10 }
};
}
let x: impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>> = A;
x
};
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/associated-type-bounds/rpit.rs
Expand Up @@ -27,7 +27,7 @@ fn def_et3() -> impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>
impl Tr1 for A {
type As1 = core::ops::Range<u8>;
fn mk(self) -> Self::As1 { 0..10 }
};
}
A
}

Expand Down
Expand Up @@ -31,7 +31,7 @@ fn def_et3() -> Et3 {
impl Tr1 for A {
type As1 = core::ops::Range<u8>;
fn mk(self) -> Self::As1 { 0..10 }
};
}
A
}
pub fn use_et3() {
Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/const-generics/min_const_generics/macro.rs
Expand Up @@ -15,22 +15,22 @@ impl<const N: usize> Marker<N> for Example<N> {}

fn make_marker() -> impl Marker<{
#[macro_export]
macro_rules! const_macro { () => {{ 3 }} }; inline!()
macro_rules! const_macro { () => {{ 3 }} } inline!()
}> {
Example::<{ const_macro!() }>
}

fn from_marker(_: impl Marker<{
#[macro_export]
macro_rules! inline { () => {{ 3 }} }; inline!()
macro_rules! inline { () => {{ 3 }} } inline!()
}>) {}

fn main() {
let _ok = Example::<{
#[macro_export]
macro_rules! gimme_a_const {
($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
};
}
gimme_a_const!(run)
}>;

Expand All @@ -42,13 +42,13 @@ fn main() {

let _ok: [u8; {
#[macro_export]
macro_rules! const_two { () => {{ 2 }} };
macro_rules! const_two { () => {{ 2 }} }
const_two!()
}];

let _ok = [0; {
#[macro_export]
macro_rules! const_three { () => {{ 3 }} };
macro_rules! const_three { () => {{ 3 }} }
const_three!()
}];
let _ok = [0; const_three!()];
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-10767.rs
Expand Up @@ -5,6 +5,6 @@

pub fn main() {
fn f() {
};
}
let _: Box<fn()> = box (f as fn());
}
4 changes: 2 additions & 2 deletions src/test/ui/issues/issue-2074.rs
Expand Up @@ -5,11 +5,11 @@

pub fn main() {
let one = || {
enum r { a };
enum r { a }
r::a as usize
};
let two = || {
enum r { a };
enum r { a }
r::a as usize
};
one(); two();
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/macros/macro-2.rs
Expand Up @@ -3,7 +3,7 @@ pub fn main() {

macro_rules! mylambda_tt {
($x:ident, $body:expr) => ({
fn f($x: isize) -> isize { return $body; };
fn f($x: isize) -> isize { return $body; }
f
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/macros/macro-path.rs
Expand Up @@ -8,7 +8,7 @@ mod m {

macro_rules! foo {
($p:path) => ({
fn f() -> $p { 10 };
fn f() -> $p { 10 }
f()
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/structs-enums/nested-enum-same-names.rs
Expand Up @@ -17,10 +17,10 @@ as it does not include the method name in the symbol name.
pub struct Foo;
impl Foo {
pub fn foo() {
enum Panic { Common };
enum Panic { Common }
}
pub fn bar() {
enum Panic { Common };
enum Panic { Common }
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/try-is-identifier-edition2015.rs
Expand Up @@ -5,7 +5,7 @@

fn main() {
let try = 2;
struct try { try: u32 };
struct try { try: u32 }
let try: try = try { try };
assert_eq!(try.try, 2);
}
2 changes: 1 addition & 1 deletion src/test/ui/zero-sized/zero-size-type-destructors.rs
Expand Up @@ -10,7 +10,7 @@ pub fn foo() {
fn drop(&mut self) {
unsafe { destructions -= 1 };
}
};
}

let _x = [Foo, Foo, Foo];
}
Expand Down

0 comments on commit 6f91c32

Please sign in to comment.