Fix new 'unnecessary trailing semicolon' warnings
This commit is contained in:
parent
db0d0e8c43
commit
6f91c32da6
28 changed files with 39 additions and 39 deletions
|
@ -451,7 +451,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||||
Inhabited,
|
Inhabited,
|
||||||
ZeroValid,
|
ZeroValid,
|
||||||
UninitValid,
|
UninitValid,
|
||||||
};
|
}
|
||||||
let panic_intrinsic = intrinsic.and_then(|i| match i {
|
let panic_intrinsic = intrinsic.and_then(|i| match i {
|
||||||
sym::assert_inhabited => Some(AssertIntrinsic::Inhabited),
|
sym::assert_inhabited => Some(AssertIntrinsic::Inhabited),
|
||||||
sym::assert_zero_valid => Some(AssertIntrinsic::ZeroValid),
|
sym::assert_zero_valid => Some(AssertIntrinsic::ZeroValid),
|
||||||
|
|
|
@ -2345,7 +2345,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
|
||||||
enum InitKind {
|
enum InitKind {
|
||||||
Zeroed,
|
Zeroed,
|
||||||
Uninit,
|
Uninit,
|
||||||
};
|
}
|
||||||
|
|
||||||
/// Information about why a type cannot be initialized this way.
|
/// Information about why a type cannot be initialized this way.
|
||||||
/// Contains an error message and optionally a span to point at.
|
/// Contains an error message and optionally a span to point at.
|
||||||
|
|
|
@ -1131,7 +1131,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
|
||||||
fn check_for_opaque_ty(&mut self, sp: Span, ty: Ty<'tcx>) -> bool {
|
fn check_for_opaque_ty(&mut self, sp: Span, ty: Ty<'tcx>) -> bool {
|
||||||
struct ProhibitOpaqueTypes<'a, 'tcx> {
|
struct ProhibitOpaqueTypes<'a, 'tcx> {
|
||||||
cx: &'a LateContext<'tcx>,
|
cx: &'a LateContext<'tcx>,
|
||||||
};
|
}
|
||||||
|
|
||||||
impl<'a, 'tcx> ty::fold::TypeVisitor<'tcx> for ProhibitOpaqueTypes<'a, 'tcx> {
|
impl<'a, 'tcx> ty::fold::TypeVisitor<'tcx> for ProhibitOpaqueTypes<'a, 'tcx> {
|
||||||
type BreakTy = Ty<'tcx>;
|
type BreakTy = Ty<'tcx>;
|
||||||
|
|
|
@ -254,7 +254,7 @@ macro_rules! make_mir_visitor {
|
||||||
macro_rules! basic_blocks {
|
macro_rules! basic_blocks {
|
||||||
(mut) => (body.basic_blocks_mut().iter_enumerated_mut());
|
(mut) => (body.basic_blocks_mut().iter_enumerated_mut());
|
||||||
() => (body.basic_blocks().iter_enumerated());
|
() => (body.basic_blocks().iter_enumerated());
|
||||||
};
|
}
|
||||||
for (bb, data) in basic_blocks!($($mutability)?) {
|
for (bb, data) in basic_blocks!($($mutability)?) {
|
||||||
self.visit_basic_block_data(bb, data);
|
self.visit_basic_block_data(bb, data);
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ macro_rules! make_mir_visitor {
|
||||||
macro_rules! type_annotations {
|
macro_rules! type_annotations {
|
||||||
(mut) => (body.user_type_annotations.iter_enumerated_mut());
|
(mut) => (body.user_type_annotations.iter_enumerated_mut());
|
||||||
() => (body.user_type_annotations.iter_enumerated());
|
() => (body.user_type_annotations.iter_enumerated());
|
||||||
};
|
}
|
||||||
|
|
||||||
for (index, annotation) in type_annotations!($($mutability)?) {
|
for (index, annotation) in type_annotations!($($mutability)?) {
|
||||||
self.visit_user_type_annotation(
|
self.visit_user_type_annotation(
|
||||||
|
@ -909,7 +909,7 @@ macro_rules! make_mir_visitor {
|
||||||
macro_rules! basic_blocks {
|
macro_rules! basic_blocks {
|
||||||
(mut) => (body.basic_blocks_mut());
|
(mut) => (body.basic_blocks_mut());
|
||||||
() => (body.basic_blocks());
|
() => (body.basic_blocks());
|
||||||
};
|
}
|
||||||
let basic_block = & $($mutability)? basic_blocks!($($mutability)?)[location.block];
|
let basic_block = & $($mutability)? basic_blocks!($($mutability)?)[location.block];
|
||||||
if basic_block.statements.len() == location.statement_index {
|
if basic_block.statements.len() == location.statement_index {
|
||||||
if let Some(ref $($mutability)? terminator) = basic_block.terminator {
|
if let Some(ref $($mutability)? terminator) = basic_block.terminator {
|
||||||
|
|
|
@ -540,7 +540,7 @@ fn polymorphize<'tcx>(
|
||||||
|
|
||||||
struct PolymorphizationFolder<'tcx> {
|
struct PolymorphizationFolder<'tcx> {
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
};
|
}
|
||||||
|
|
||||||
impl ty::TypeFolder<'tcx> for PolymorphizationFolder<'tcx> {
|
impl ty::TypeFolder<'tcx> for PolymorphizationFolder<'tcx> {
|
||||||
fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {
|
fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {
|
||||||
|
|
|
@ -15,7 +15,7 @@ where
|
||||||
|
|
||||||
struct UsedParamsNeedSubstVisitor<'tcx> {
|
struct UsedParamsNeedSubstVisitor<'tcx> {
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
};
|
}
|
||||||
|
|
||||||
impl<'tcx> TypeVisitor<'tcx> for UsedParamsNeedSubstVisitor<'tcx> {
|
impl<'tcx> TypeVisitor<'tcx> for UsedParamsNeedSubstVisitor<'tcx> {
|
||||||
type BreakTy = ();
|
type BreakTy = ();
|
||||||
|
|
|
@ -309,7 +309,7 @@ fn well_formed_types_in_env<'tcx>(
|
||||||
InherentImpl,
|
InherentImpl,
|
||||||
Fn,
|
Fn,
|
||||||
Other,
|
Other,
|
||||||
};
|
}
|
||||||
|
|
||||||
let node_kind = match node {
|
let node_kind = match node {
|
||||||
Node::TraitItem(item) => match item.kind {
|
Node::TraitItem(item) => match item.kind {
|
||||||
|
|
|
@ -477,7 +477,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
|
||||||
struct ProhibitOpaqueVisitor<'tcx> {
|
struct ProhibitOpaqueVisitor<'tcx> {
|
||||||
opaque_identity_ty: Ty<'tcx>,
|
opaque_identity_ty: Ty<'tcx>,
|
||||||
generics: &'tcx ty::Generics,
|
generics: &'tcx ty::Generics,
|
||||||
};
|
}
|
||||||
|
|
||||||
impl<'tcx> ty::fold::TypeVisitor<'tcx> for ProhibitOpaqueVisitor<'tcx> {
|
impl<'tcx> ty::fold::TypeVisitor<'tcx> for ProhibitOpaqueVisitor<'tcx> {
|
||||||
type BreakTy = Option<Ty<'tcx>>;
|
type BreakTy = Option<Ty<'tcx>>;
|
||||||
|
|
|
@ -919,7 +919,7 @@ fn test_from_iter_partially_drained_in_place_specialization() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_from_iter_specialization_with_iterator_adapters() {
|
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 src: Vec<usize> = vec![0usize; 256];
|
||||||
let srcptr = src.as_ptr();
|
let srcptr = src.as_ptr();
|
||||||
let iter = src
|
let iter = src
|
||||||
|
@ -1198,7 +1198,7 @@ fn drain_filter_consumed_panic() {
|
||||||
struct Check {
|
struct Check {
|
||||||
index: usize,
|
index: usize,
|
||||||
drop_counts: Rc<Mutex<Vec<usize>>>,
|
drop_counts: Rc<Mutex<Vec<usize>>>,
|
||||||
};
|
}
|
||||||
|
|
||||||
impl Drop for Check {
|
impl Drop for Check {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
|
@ -1250,7 +1250,7 @@ fn drain_filter_unconsumed_panic() {
|
||||||
struct Check {
|
struct Check {
|
||||||
index: usize,
|
index: usize,
|
||||||
drop_counts: Rc<Mutex<Vec<usize>>>,
|
drop_counts: Rc<Mutex<Vec<usize>>>,
|
||||||
};
|
}
|
||||||
|
|
||||||
impl Drop for Check {
|
impl Drop for Check {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
|
|
|
@ -1182,7 +1182,7 @@ impl<'a> Formatter<'a> {
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::fmt;
|
/// use std::fmt;
|
||||||
///
|
///
|
||||||
/// struct Foo { nb: i32 };
|
/// struct Foo { nb: i32 }
|
||||||
///
|
///
|
||||||
/// impl Foo {
|
/// impl Foo {
|
||||||
/// fn new(nb: i32) -> Foo {
|
/// fn new(nb: i32) -> Foo {
|
||||||
|
|
|
@ -21,7 +21,7 @@ use crate::task::{Context, Poll};
|
||||||
///
|
///
|
||||||
/// let read_future = poll_fn(read_line);
|
/// let read_future = poll_fn(read_line);
|
||||||
/// assert_eq!(read_future.await, "Hello, World!".to_owned());
|
/// assert_eq!(read_future.await, "Hello, World!".to_owned());
|
||||||
/// # };
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable(feature = "future_poll_fn", issue = "72302")]
|
#[unstable(feature = "future_poll_fn", issue = "72302")]
|
||||||
pub fn poll_fn<T, F>(f: F) -> PollFn<F>
|
pub fn poll_fn<T, F>(f: F) -> PollFn<F>
|
||||||
|
|
|
@ -348,7 +348,7 @@ impl<T> MaybeUninit<T> {
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// use std::mem::MaybeUninit;
|
/// use std::mem::MaybeUninit;
|
||||||
///
|
///
|
||||||
/// enum NotZero { One = 1, Two = 2 };
|
/// enum NotZero { One = 1, Two = 2 }
|
||||||
///
|
///
|
||||||
/// let x = MaybeUninit::<(u8, NotZero)>::zeroed();
|
/// let x = MaybeUninit::<(u8, NotZero)>::zeroed();
|
||||||
/// let x = unsafe { x.assume_init() };
|
/// let x = unsafe { x.assume_init() };
|
||||||
|
|
|
@ -18,7 +18,7 @@ fn test() {
|
||||||
struct Pair {
|
struct Pair {
|
||||||
fst: isize,
|
fst: isize,
|
||||||
snd: isize,
|
snd: isize,
|
||||||
};
|
}
|
||||||
let mut p = Pair { fst: 10, snd: 20 };
|
let mut p = Pair { fst: 10, snd: 20 };
|
||||||
let pptr: *mut Pair = &mut p;
|
let pptr: *mut Pair = &mut p;
|
||||||
let iptr: *mut isize = pptr as *mut isize;
|
let iptr: *mut isize = pptr as *mut isize;
|
||||||
|
|
|
@ -265,14 +265,14 @@ where
|
||||||
running_tests.remove(test);
|
running_tests.remove(test);
|
||||||
}
|
}
|
||||||
timed_out
|
timed_out
|
||||||
};
|
}
|
||||||
|
|
||||||
fn calc_timeout(running_tests: &TestMap) -> Option<Duration> {
|
fn calc_timeout(running_tests: &TestMap) -> Option<Duration> {
|
||||||
running_tests.values().min().map(|next_timeout| {
|
running_tests.values().min().map(|next_timeout| {
|
||||||
let now = Instant::now();
|
let now = Instant::now();
|
||||||
if *next_timeout >= now { *next_timeout - now } else { Duration::new(0, 0) }
|
if *next_timeout >= now { *next_timeout - now } else { Duration::new(0, 0) }
|
||||||
})
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
if concurrency == 1 {
|
if concurrency == 1 {
|
||||||
while !remaining.is_empty() {
|
while !remaining.is_empty() {
|
||||||
|
|
|
@ -30,7 +30,7 @@ fn def_et3() -> Et3 {
|
||||||
impl Tr1 for A {
|
impl Tr1 for A {
|
||||||
type As1 = core::ops::Range<u8>;
|
type As1 = core::ops::Range<u8>;
|
||||||
fn mk(&self) -> Self::As1 { 0..10 }
|
fn mk(&self) -> Self::As1 { 0..10 }
|
||||||
};
|
}
|
||||||
Box::new(A)
|
Box::new(A)
|
||||||
}
|
}
|
||||||
pub fn use_et3() {
|
pub fn use_et3() {
|
||||||
|
|
|
@ -33,7 +33,7 @@ const cdef_et3: &dyn Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>
|
||||||
impl Tr1 for A {
|
impl Tr1 for A {
|
||||||
type As1 = core::ops::Range<u8>;
|
type As1 = core::ops::Range<u8>;
|
||||||
fn mk(&self) -> Self::As1 { 0..10 }
|
fn mk(&self) -> Self::As1 { 0..10 }
|
||||||
};
|
}
|
||||||
&A
|
&A
|
||||||
};
|
};
|
||||||
pub fn use_et3() {
|
pub fn use_et3() {
|
||||||
|
|
|
@ -35,7 +35,7 @@ fn def_et3() -> Box<dyn Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>
|
||||||
impl Tr1 for A {
|
impl Tr1 for A {
|
||||||
type As1 = core::ops::Range<u8>;
|
type As1 = core::ops::Range<u8>;
|
||||||
fn mk(&self) -> Self::As1 { 0..10 }
|
fn mk(&self) -> Self::As1 { 0..10 }
|
||||||
};
|
}
|
||||||
let x /* : Box<dyn Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>> */
|
let x /* : Box<dyn Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>> */
|
||||||
= Box::new(A);
|
= Box::new(A);
|
||||||
x
|
x
|
||||||
|
|
|
@ -39,7 +39,7 @@ const cdef_et3: impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>
|
||||||
impl Tr1 for A {
|
impl Tr1 for A {
|
||||||
type As1 = core::ops::Range<u8>;
|
type As1 = core::ops::Range<u8>;
|
||||||
fn mk(&self) -> Self::As1 { 0..10 }
|
fn mk(&self) -> Self::As1 { 0..10 }
|
||||||
};
|
}
|
||||||
let x: impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>> = A;
|
let x: impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>> = A;
|
||||||
x
|
x
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,7 +27,7 @@ fn def_et3() -> impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>
|
||||||
impl Tr1 for A {
|
impl Tr1 for A {
|
||||||
type As1 = core::ops::Range<u8>;
|
type As1 = core::ops::Range<u8>;
|
||||||
fn mk(self) -> Self::As1 { 0..10 }
|
fn mk(self) -> Self::As1 { 0..10 }
|
||||||
};
|
}
|
||||||
A
|
A
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ fn def_et3() -> Et3 {
|
||||||
impl Tr1 for A {
|
impl Tr1 for A {
|
||||||
type As1 = core::ops::Range<u8>;
|
type As1 = core::ops::Range<u8>;
|
||||||
fn mk(self) -> Self::As1 { 0..10 }
|
fn mk(self) -> Self::As1 { 0..10 }
|
||||||
};
|
}
|
||||||
A
|
A
|
||||||
}
|
}
|
||||||
pub fn use_et3() {
|
pub fn use_et3() {
|
||||||
|
|
|
@ -15,14 +15,14 @@ impl<const N: usize> Marker<N> for Example<N> {}
|
||||||
|
|
||||||
fn make_marker() -> impl Marker<{
|
fn make_marker() -> impl Marker<{
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! const_macro { () => {{ 3 }} }; inline!()
|
macro_rules! const_macro { () => {{ 3 }} } inline!()
|
||||||
}> {
|
}> {
|
||||||
Example::<{ const_macro!() }>
|
Example::<{ const_macro!() }>
|
||||||
}
|
}
|
||||||
|
|
||||||
fn from_marker(_: impl Marker<{
|
fn from_marker(_: impl Marker<{
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! inline { () => {{ 3 }} }; inline!()
|
macro_rules! inline { () => {{ 3 }} } inline!()
|
||||||
}>) {}
|
}>) {}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -30,7 +30,7 @@ fn main() {
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! gimme_a_const {
|
macro_rules! gimme_a_const {
|
||||||
($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
|
($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
|
||||||
};
|
}
|
||||||
gimme_a_const!(run)
|
gimme_a_const!(run)
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
@ -42,13 +42,13 @@ fn main() {
|
||||||
|
|
||||||
let _ok: [u8; {
|
let _ok: [u8; {
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! const_two { () => {{ 2 }} };
|
macro_rules! const_two { () => {{ 2 }} }
|
||||||
const_two!()
|
const_two!()
|
||||||
}];
|
}];
|
||||||
|
|
||||||
let _ok = [0; {
|
let _ok = [0; {
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! const_three { () => {{ 3 }} };
|
macro_rules! const_three { () => {{ 3 }} }
|
||||||
const_three!()
|
const_three!()
|
||||||
}];
|
}];
|
||||||
let _ok = [0; const_three!()];
|
let _ok = [0; const_three!()];
|
||||||
|
|
|
@ -5,6 +5,6 @@
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
fn f() {
|
fn f() {
|
||||||
};
|
}
|
||||||
let _: Box<fn()> = box (f as fn());
|
let _: Box<fn()> = box (f as fn());
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let one = || {
|
let one = || {
|
||||||
enum r { a };
|
enum r { a }
|
||||||
r::a as usize
|
r::a as usize
|
||||||
};
|
};
|
||||||
let two = || {
|
let two = || {
|
||||||
enum r { a };
|
enum r { a }
|
||||||
r::a as usize
|
r::a as usize
|
||||||
};
|
};
|
||||||
one(); two();
|
one(); two();
|
||||||
|
|
|
@ -3,7 +3,7 @@ pub fn main() {
|
||||||
|
|
||||||
macro_rules! mylambda_tt {
|
macro_rules! mylambda_tt {
|
||||||
($x:ident, $body:expr) => ({
|
($x:ident, $body:expr) => ({
|
||||||
fn f($x: isize) -> isize { return $body; };
|
fn f($x: isize) -> isize { return $body; }
|
||||||
f
|
f
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ mod m {
|
||||||
|
|
||||||
macro_rules! foo {
|
macro_rules! foo {
|
||||||
($p:path) => ({
|
($p:path) => ({
|
||||||
fn f() -> $p { 10 };
|
fn f() -> $p { 10 }
|
||||||
f()
|
f()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,10 +17,10 @@ as it does not include the method name in the symbol name.
|
||||||
pub struct Foo;
|
pub struct Foo;
|
||||||
impl Foo {
|
impl Foo {
|
||||||
pub fn foo() {
|
pub fn foo() {
|
||||||
enum Panic { Common };
|
enum Panic { Common }
|
||||||
}
|
}
|
||||||
pub fn bar() {
|
pub fn bar() {
|
||||||
enum Panic { Common };
|
enum Panic { Common }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let try = 2;
|
let try = 2;
|
||||||
struct try { try: u32 };
|
struct try { try: u32 }
|
||||||
let try: try = try { try };
|
let try: try = try { try };
|
||||||
assert_eq!(try.try, 2);
|
assert_eq!(try.try, 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ pub fn foo() {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe { destructions -= 1 };
|
unsafe { destructions -= 1 };
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
let _x = [Foo, Foo, Foo];
|
let _x = [Foo, Foo, Foo];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue