mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-16 05:56:56 +00:00
Remove useless drop of copy type
This commit is contained in:
parent
d36e390d81
commit
7dab6094bb
@ -562,15 +562,13 @@ pub(crate) mod printf {
|
||||
}
|
||||
|
||||
if let Type = state {
|
||||
drop(c);
|
||||
type_ = at.slice_between(next).unwrap();
|
||||
|
||||
// Don't use `move_to!` here, as we *can* be at the end of the input.
|
||||
at = next;
|
||||
}
|
||||
|
||||
drop(c);
|
||||
drop(next);
|
||||
let _ = c; // to avoid never used value
|
||||
|
||||
end = at;
|
||||
let position = InnerSpan::new(start.at, end.at);
|
||||
|
@ -116,7 +116,7 @@ impl<T> Poll<T> {
|
||||
/// let fut = Pin::new(&mut fut);
|
||||
///
|
||||
/// let num = fut.poll(cx).ready()?;
|
||||
/// # drop(num);
|
||||
/// # let _ = num; // to silence unused warning
|
||||
/// // ... use num
|
||||
///
|
||||
/// Poll::Ready(())
|
||||
|
@ -22,7 +22,7 @@ use core::task::Poll;
|
||||
/// let fut = Pin::new(&mut fut);
|
||||
///
|
||||
/// let num = ready!(fut.poll(cx));
|
||||
/// # drop(num);
|
||||
/// # let _ = num;
|
||||
/// // ... use num
|
||||
///
|
||||
/// Poll::Ready(())
|
||||
@ -44,7 +44,7 @@ use core::task::Poll;
|
||||
/// Poll::Ready(t) => t,
|
||||
/// Poll::Pending => return Poll::Pending,
|
||||
/// };
|
||||
/// # drop(num);
|
||||
/// # let _ = num; // to silence unused warning
|
||||
/// # // ... use num
|
||||
/// #
|
||||
/// # Poll::Ready(())
|
||||
|
@ -541,7 +541,7 @@ pub fn begin_panic_handler(info: &PanicInfo<'_>) -> ! {
|
||||
// Lazily, the first time this gets called, run the actual string formatting.
|
||||
self.string.get_or_insert_with(|| {
|
||||
let mut s = String::new();
|
||||
drop(s.write_fmt(*inner));
|
||||
let _err = s.write_fmt(*inner);
|
||||
s
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user