Skip to content

Commit 6f91c32

Browse files
committed
Fix new 'unnecessary trailing semicolon' warnings
1 parent db0d0e8 commit 6f91c32

File tree

28 files changed

+39
-39
lines changed

28 files changed

+39
-39
lines changed

compiler/rustc_codegen_ssa/src/mir/block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
451451
Inhabited,
452452
ZeroValid,
453453
UninitValid,
454-
};
454+
}
455455
let panic_intrinsic = intrinsic.and_then(|i| match i {
456456
sym::assert_inhabited => Some(AssertIntrinsic::Inhabited),
457457
sym::assert_zero_valid => Some(AssertIntrinsic::ZeroValid),

compiler/rustc_lint/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2345,7 +2345,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
23452345
enum InitKind {
23462346
Zeroed,
23472347
Uninit,
2348-
};
2348+
}
23492349

23502350
/// Information about why a type cannot be initialized this way.
23512351
/// Contains an error message and optionally a span to point at.

compiler/rustc_lint/src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
11311131
fn check_for_opaque_ty(&mut self, sp: Span, ty: Ty<'tcx>) -> bool {
11321132
struct ProhibitOpaqueTypes<'a, 'tcx> {
11331133
cx: &'a LateContext<'tcx>,
1134-
};
1134+
}
11351135

11361136
impl<'a, 'tcx> ty::fold::TypeVisitor<'tcx> for ProhibitOpaqueTypes<'a, 'tcx> {
11371137
type BreakTy = Ty<'tcx>;

compiler/rustc_middle/src/mir/visit.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ macro_rules! make_mir_visitor {
254254
macro_rules! basic_blocks {
255255
(mut) => (body.basic_blocks_mut().iter_enumerated_mut());
256256
() => (body.basic_blocks().iter_enumerated());
257-
};
257+
}
258258
for (bb, data) in basic_blocks!($($mutability)?) {
259259
self.visit_basic_block_data(bb, data);
260260
}
@@ -275,7 +275,7 @@ macro_rules! make_mir_visitor {
275275
macro_rules! type_annotations {
276276
(mut) => (body.user_type_annotations.iter_enumerated_mut());
277277
() => (body.user_type_annotations.iter_enumerated());
278-
};
278+
}
279279

280280
for (index, annotation) in type_annotations!($($mutability)?) {
281281
self.visit_user_type_annotation(
@@ -909,7 +909,7 @@ macro_rules! make_mir_visitor {
909909
macro_rules! basic_blocks {
910910
(mut) => (body.basic_blocks_mut());
911911
() => (body.basic_blocks());
912-
};
912+
}
913913
let basic_block = & $($mutability)? basic_blocks!($($mutability)?)[location.block];
914914
if basic_block.statements.len() == location.statement_index {
915915
if let Some(ref $($mutability)? terminator) = basic_block.terminator {

compiler/rustc_middle/src/ty/instance.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ fn polymorphize<'tcx>(
540540

541541
struct PolymorphizationFolder<'tcx> {
542542
tcx: TyCtxt<'tcx>,
543-
};
543+
}
544544

545545
impl ty::TypeFolder<'tcx> for PolymorphizationFolder<'tcx> {
546546
fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {

compiler/rustc_mir/src/interpret/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ where
1515

1616
struct UsedParamsNeedSubstVisitor<'tcx> {
1717
tcx: TyCtxt<'tcx>,
18-
};
18+
}
1919

2020
impl<'tcx> TypeVisitor<'tcx> for UsedParamsNeedSubstVisitor<'tcx> {
2121
type BreakTy = ();

compiler/rustc_ty_utils/src/ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ fn well_formed_types_in_env<'tcx>(
309309
InherentImpl,
310310
Fn,
311311
Other,
312-
};
312+
}
313313

314314
let node_kind = match node {
315315
Node::TraitItem(item) => match item.kind {

compiler/rustc_typeck/src/check/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
477477
struct ProhibitOpaqueVisitor<'tcx> {
478478
opaque_identity_ty: Ty<'tcx>,
479479
generics: &'tcx ty::Generics,
480-
};
480+
}
481481

482482
impl<'tcx> ty::fold::TypeVisitor<'tcx> for ProhibitOpaqueVisitor<'tcx> {
483483
type BreakTy = Option<Ty<'tcx>>;

library/alloc/tests/vec.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ fn test_from_iter_partially_drained_in_place_specialization() {
919919

920920
#[test]
921921
fn test_from_iter_specialization_with_iterator_adapters() {
922-
fn assert_in_place_trait<T: InPlaceIterable>(_: &T) {};
922+
fn assert_in_place_trait<T: InPlaceIterable>(_: &T) {}
923923
let src: Vec<usize> = vec![0usize; 256];
924924
let srcptr = src.as_ptr();
925925
let iter = src
@@ -1198,7 +1198,7 @@ fn drain_filter_consumed_panic() {
11981198
struct Check {
11991199
index: usize,
12001200
drop_counts: Rc<Mutex<Vec<usize>>>,
1201-
};
1201+
}
12021202

12031203
impl Drop for Check {
12041204
fn drop(&mut self) {
@@ -1250,7 +1250,7 @@ fn drain_filter_unconsumed_panic() {
12501250
struct Check {
12511251
index: usize,
12521252
drop_counts: Rc<Mutex<Vec<usize>>>,
1253-
};
1253+
}
12541254

12551255
impl Drop for Check {
12561256
fn drop(&mut self) {

library/core/src/fmt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ impl<'a> Formatter<'a> {
11821182
/// ```
11831183
/// use std::fmt;
11841184
///
1185-
/// struct Foo { nb: i32 };
1185+
/// struct Foo { nb: i32 }
11861186
///
11871187
/// impl Foo {
11881188
/// fn new(nb: i32) -> Foo {

library/core/src/future/poll_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::task::{Context, Poll};
2121
///
2222
/// let read_future = poll_fn(read_line);
2323
/// assert_eq!(read_future.await, "Hello, World!".to_owned());
24-
/// # };
24+
/// # }
2525
/// ```
2626
#[unstable(feature = "future_poll_fn", issue = "72302")]
2727
pub fn poll_fn<T, F>(f: F) -> PollFn<F>

library/core/src/mem/maybe_uninit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ impl<T> MaybeUninit<T> {
348348
/// ```rust,no_run
349349
/// use std::mem::MaybeUninit;
350350
///
351-
/// enum NotZero { One = 1, Two = 2 };
351+
/// enum NotZero { One = 1, Two = 2 }
352352
///
353353
/// let x = MaybeUninit::<(u8, NotZero)>::zeroed();
354354
/// let x = unsafe { x.assume_init() };

library/core/tests/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn test() {
1818
struct Pair {
1919
fst: isize,
2020
snd: isize,
21-
};
21+
}
2222
let mut p = Pair { fst: 10, snd: 20 };
2323
let pptr: *mut Pair = &mut p;
2424
let iptr: *mut isize = pptr as *mut isize;

library/test/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,14 @@ where
265265
running_tests.remove(test);
266266
}
267267
timed_out
268-
};
268+
}
269269

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

277277
if concurrency == 1 {
278278
while !remaining.is_empty() {

src/test/ui/associated-type-bounds/dyn-impl-trait-type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn def_et3() -> Et3 {
3030
impl Tr1 for A {
3131
type As1 = core::ops::Range<u8>;
3232
fn mk(&self) -> Self::As1 { 0..10 }
33-
};
33+
}
3434
Box::new(A)
3535
}
3636
pub fn use_et3() {

src/test/ui/associated-type-bounds/dyn-lcsit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const cdef_et3: &dyn Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>
3333
impl Tr1 for A {
3434
type As1 = core::ops::Range<u8>;
3535
fn mk(&self) -> Self::As1 { 0..10 }
36-
};
36+
}
3737
&A
3838
};
3939
pub fn use_et3() {

src/test/ui/associated-type-bounds/dyn-rpit-and-let.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn def_et3() -> Box<dyn Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>
3535
impl Tr1 for A {
3636
type As1 = core::ops::Range<u8>;
3737
fn mk(&self) -> Self::As1 { 0..10 }
38-
};
38+
}
3939
let x /* : Box<dyn Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>> */
4040
= Box::new(A);
4141
x

src/test/ui/associated-type-bounds/lcsit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const cdef_et3: impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>
3939
impl Tr1 for A {
4040
type As1 = core::ops::Range<u8>;
4141
fn mk(&self) -> Self::As1 { 0..10 }
42-
};
42+
}
4343
let x: impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>> = A;
4444
x
4545
};

src/test/ui/associated-type-bounds/rpit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn def_et3() -> impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>
2727
impl Tr1 for A {
2828
type As1 = core::ops::Range<u8>;
2929
fn mk(self) -> Self::As1 { 0..10 }
30-
};
30+
}
3131
A
3232
}
3333

src/test/ui/associated-type-bounds/trait-alias-impl-trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn def_et3() -> Et3 {
3131
impl Tr1 for A {
3232
type As1 = core::ops::Range<u8>;
3333
fn mk(self) -> Self::As1 { 0..10 }
34-
};
34+
}
3535
A
3636
}
3737
pub fn use_et3() {

src/test/ui/const-generics/min_const_generics/macro.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ impl<const N: usize> Marker<N> for Example<N> {}
1515

1616
fn make_marker() -> impl Marker<{
1717
#[macro_export]
18-
macro_rules! const_macro { () => {{ 3 }} }; inline!()
18+
macro_rules! const_macro { () => {{ 3 }} } inline!()
1919
}> {
2020
Example::<{ const_macro!() }>
2121
}
2222

2323
fn from_marker(_: impl Marker<{
2424
#[macro_export]
25-
macro_rules! inline { () => {{ 3 }} }; inline!()
25+
macro_rules! inline { () => {{ 3 }} } inline!()
2626
}>) {}
2727

2828
fn main() {
2929
let _ok = Example::<{
3030
#[macro_export]
3131
macro_rules! gimme_a_const {
3232
($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
33-
};
33+
}
3434
gimme_a_const!(run)
3535
}>;
3636

@@ -42,13 +42,13 @@ fn main() {
4242

4343
let _ok: [u8; {
4444
#[macro_export]
45-
macro_rules! const_two { () => {{ 2 }} };
45+
macro_rules! const_two { () => {{ 2 }} }
4646
const_two!()
4747
}];
4848

4949
let _ok = [0; {
5050
#[macro_export]
51-
macro_rules! const_three { () => {{ 3 }} };
51+
macro_rules! const_three { () => {{ 3 }} }
5252
const_three!()
5353
}];
5454
let _ok = [0; const_three!()];

src/test/ui/issues/issue-10767.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
pub fn main() {
77
fn f() {
8-
};
8+
}
99
let _: Box<fn()> = box (f as fn());
1010
}

src/test/ui/issues/issue-2074.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
pub fn main() {
77
let one = || {
8-
enum r { a };
8+
enum r { a }
99
r::a as usize
1010
};
1111
let two = || {
12-
enum r { a };
12+
enum r { a }
1313
r::a as usize
1414
};
1515
one(); two();

src/test/ui/macros/macro-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pub fn main() {
33

44
macro_rules! mylambda_tt {
55
($x:ident, $body:expr) => ({
6-
fn f($x: isize) -> isize { return $body; };
6+
fn f($x: isize) -> isize { return $body; }
77
f
88
})
99
}

src/test/ui/macros/macro-path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod m {
88

99
macro_rules! foo {
1010
($p:path) => ({
11-
fn f() -> $p { 10 };
11+
fn f() -> $p { 10 }
1212
f()
1313
})
1414
}

src/test/ui/structs-enums/nested-enum-same-names.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ as it does not include the method name in the symbol name.
1717
pub struct Foo;
1818
impl Foo {
1919
pub fn foo() {
20-
enum Panic { Common };
20+
enum Panic { Common }
2121
}
2222
pub fn bar() {
23-
enum Panic { Common };
23+
enum Panic { Common }
2424
}
2525
}
2626

src/test/ui/try-is-identifier-edition2015.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
fn main() {
77
let try = 2;
8-
struct try { try: u32 };
8+
struct try { try: u32 }
99
let try: try = try { try };
1010
assert_eq!(try.try, 2);
1111
}

src/test/ui/zero-sized/zero-size-type-destructors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn foo() {
1010
fn drop(&mut self) {
1111
unsafe { destructions -= 1 };
1212
}
13-
};
13+
}
1414

1515
let _x = [Foo, Foo, Foo];
1616
}

0 commit comments

Comments
 (0)