Skip to content

Commit 825b5ae

Browse files
committed
Use &dyn Any rather than &(dyn Any + Send) for panic payload.
The `Send` is useless here, because it's a reference.
1 parent 4b87ed9 commit 825b5ae

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

library/core/src/panic/panic_info.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use crate::panic::Location;
2424
#[stable(feature = "panic_hooks", since = "1.10.0")]
2525
#[derive(Debug)]
2626
pub struct PanicInfo<'a> {
27-
payload: &'a (dyn Any + Send),
27+
payload: &'a dyn Any,
2828
message: Option<&'a fmt::Arguments<'a>>,
2929
location: &'a Location<'a>,
3030
can_unwind: bool,
@@ -81,7 +81,7 @@ impl<'a> PanicInfo<'a> {
8181
/// ```
8282
#[must_use]
8383
#[stable(feature = "panic_hooks", since = "1.10.0")]
84-
pub fn payload(&self) -> &(dyn Any + Send) {
84+
pub fn payload(&self) -> &dyn Any {
8585
self.payload
8686
}
8787

library/test/src/test_result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub enum TestResult {
2727
/// and associated data.
2828
pub fn calc_result<'a>(
2929
desc: &TestDesc,
30-
task_result: Result<(), &'a (dyn Any + 'static + Send)>,
30+
task_result: Result<(), &'a dyn Any>,
3131
time_opts: &Option<time::TestTimeOptions>,
3232
exec_time: &Option<time::TestExecTime>,
3333
) -> TestResult {

0 commit comments

Comments
 (0)