X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=library%2Fstd%2Fsrc%2Ferror%2Ftests.rs;h=ee999bd65c3c94cefc7035bca80961648456a98e;hb=20f124a1934cf833467ccfbe6c31daff160fec56;hp=a2a35d96ec918a5b91ead9e51053df3524fb24fa;hpb=837cd9e26c5f741d57c19d4ae35253f26b654a1e;p=rust.git diff --git a/library/std/src/error/tests.rs b/library/std/src/error/tests.rs index a2a35d96ec9..ee999bd65c3 100644 --- a/library/std/src/error/tests.rs +++ b/library/std/src/error/tests.rs @@ -1,5 +1,6 @@ use super::Error; use crate::fmt; +use core::any::Demand; #[derive(Debug, PartialEq)] struct A; @@ -198,8 +199,8 @@ fn source(&self) -> Option<&(dyn Error + 'static)> { self.source.as_deref() } - fn backtrace(&self) -> Option<&Backtrace> { - self.backtrace.as_ref() + fn provide<'a>(&'a self, req: &mut Demand<'a>) { + self.backtrace.as_ref().map(|bt| req.provide_ref::(bt)); } }