Fix new 'unnecessary trailing semicolon' warnings

This commit is contained in:
Aaron Hill 2020-11-25 17:00:28 -05:00
parent db0d0e8c43
commit 6f91c32da6
No known key found for this signature in database
GPG Key ID: B4087E510E98B164
28 changed files with 39 additions and 39 deletions

View File

@ -451,7 +451,7 @@ enum AssertIntrinsic {
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),

View File

@ -2345,7 +2345,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &hir::Expr<'_>) {
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.

View File

@ -1131,7 +1131,7 @@ fn emit_ffi_unsafe_type_lint(
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>;

View File

@ -254,7 +254,7 @@ fn super_body(
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);
}
@ -275,7 +275,7 @@ macro_rules! basic_blocks {
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(
@ -909,7 +909,7 @@ fn visit_location(
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 {

View File

@ -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> {

View File

@ -15,7 +15,7 @@
struct UsedParamsNeedSubstVisitor<'tcx> {
tcx: TyCtxt<'tcx>,
};
}
impl<'tcx> TypeVisitor<'tcx> for UsedParamsNeedSubstVisitor<'tcx> {
type BreakTy = ();

View File

@ -309,7 +309,7 @@ enum NodeKind {
InherentImpl,
Fn,
Other,
};
}
let node_kind = match node {
Node::TraitItem(item) => match item.kind {

View File

@ -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>>;

View File

@ -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
@ -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) {
@ -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) {

View File

@ -1182,7 +1182,7 @@ fn wrap_buf<'b, 'c, F>(&'b mut self, wrap: F) -> Formatter<'c>
/// ```
/// use std::fmt;
///
/// struct Foo { nb: i32 };
/// struct Foo { nb: i32 }
///
/// impl Foo {
/// fn new(nb: i32) -> Foo {

View File

@ -21,7 +21,7 @@
///
/// 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>

View File

@ -348,7 +348,7 @@ pub const fn uninit() -> 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() };

View File

@ -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;

View File

@ -265,14 +265,14 @@ fn get_timed_out_tests(running_tests: &mut TestMap) -> Vec<TestDesc> {
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() {

View File

@ -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() {

View File

@ -33,7 +33,7 @@ fn assert_forall_tr2<T: for<'a> Tr2<'a>>(_: T) {}
impl Tr1 for A {
type As1 = core::ops::Range<u8>;
fn mk(&self) -> Self::As1 { 0..10 }
};
}
&A
};
pub fn use_et3() {

View File

@ -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

View File

@ -39,7 +39,7 @@ fn assert_forall_tr2<T: for<'a> Tr2<'a>>(_: T) {}
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
};

View File

@ -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
}

View File

@ -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() {

View File

@ -15,14 +15,14 @@ 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() {
@ -30,7 +30,7 @@ fn main() {
#[macro_export]
macro_rules! gimme_a_const {
($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
};
}
gimme_a_const!(run)
}>;
@ -42,13 +42,13 @@ macro_rules! gimme_a_const {
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!()];

View File

@ -5,6 +5,6 @@
pub fn main() {
fn f() {
};
}
let _: Box<fn()> = box (f as fn());
}

View File

@ -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();

View File

@ -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
})
}

View File

@ -8,7 +8,7 @@ mod m {
macro_rules! foo {
($p:path) => ({
fn f() -> $p { 10 };
fn f() -> $p { 10 }
f()
})
}

View File

@ -17,10 +17,10 @@
pub struct Foo;
impl Foo {
pub fn foo() {
enum Panic { Common };
enum Panic { Common }
}
pub fn bar() {
enum Panic { Common };
enum Panic { Common }
}
}

View File

@ -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);
}

View File

@ -10,7 +10,7 @@ impl Drop for Foo {
fn drop(&mut self) {
unsafe { destructions -= 1 };
}
};
}
let _x = [Foo, Foo, Foo];
}