Let me see if I can explain it correctly. According to anchor_lang doc, below is definition of UncheckedAccount
#[derive(Debug, Clone)]
pub struct UncheckedAccount<'info>(&'info AccountInfo<'info>);
So according to this, the lifetime of param passed (AccountInfo) should match the lifetime of object UncheckedAccount.
Lets see the below code
pub fn test(ctx: Context<InstructionTest>) {
let account_info = ctx.accounts.account.to_account_info();
let unchecked_account = UncheckedAccount::try_from(&account_info);//report error
}
The lifetime of account_info is the lifetime of function which calls test function. So we can assume lifetime of ctx is longer than the test function at the minimum. The variable unchecked_account will die at the end of the function test, so unchecked_account and account_info lifetimes do not match
But according to the definition of UncheckedAccount the lifetime of inner param should match the lifetime of UncheckedAccount, so this gives an error