Skip to content

Commit 7dab609

Browse files
committed
Remove useless drop of copy type
1 parent d36e390 commit 7dab609

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

compiler/rustc_builtin_macros/src/format_foreign.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,15 +562,13 @@ pub(crate) mod printf {
562562
}
563563

564564
if let Type = state {
565-
drop(c);
566565
type_ = at.slice_between(next).unwrap();
567566

568567
// Don't use `move_to!` here, as we *can* be at the end of the input.
569568
at = next;
570569
}
571570

572-
drop(c);
573-
drop(next);
571+
let _ = c; // to avoid never used value
574572

575573
end = at;
576574
let position = InnerSpan::new(start.at, end.at);

library/core/src/task/poll.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<T> Poll<T> {
116116
/// let fut = Pin::new(&mut fut);
117117
///
118118
/// let num = fut.poll(cx).ready()?;
119-
/// # drop(num);
119+
/// # let _ = num; // to silence unused warning
120120
/// // ... use num
121121
///
122122
/// Poll::Ready(())

library/core/src/task/ready.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use core::task::Poll;
2222
/// let fut = Pin::new(&mut fut);
2323
///
2424
/// let num = ready!(fut.poll(cx));
25-
/// # drop(num);
25+
/// # let _ = num;
2626
/// // ... use num
2727
///
2828
/// Poll::Ready(())
@@ -44,7 +44,7 @@ use core::task::Poll;
4444
/// Poll::Ready(t) => t,
4545
/// Poll::Pending => return Poll::Pending,
4646
/// };
47-
/// # drop(num);
47+
/// # let _ = num; // to silence unused warning
4848
/// # // ... use num
4949
/// #
5050
/// # Poll::Ready(())

library/std/src/panicking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ pub fn begin_panic_handler(info: &PanicInfo<'_>) -> ! {
541541
// Lazily, the first time this gets called, run the actual string formatting.
542542
self.string.get_or_insert_with(|| {
543543
let mut s = String::new();
544-
drop(s.write_fmt(*inner));
544+
let _err = s.write_fmt(*inner);
545545
s
546546
})
547547
}

0 commit comments

Comments
 (0)