Generic trait with lifetimes and functions

I would like to merge the two implementations of Printable into one below. Also, I'm concerned by the warning.

One implementation deals with references, the other without references. Anyone knows how to achieve one implementation for both? ChatGPT is hopeless.
In the long term, my framework should support function with multiple parameters, so being able to merge the two implementation will avoid exponential blowup. Thanks for your help.

use std::rc::Rc;

pub struct AStruct { pub i: i32 }

pub trait Printable {
    fn print(&self);
}

impl<A, B> Printable for Rc<dyn for<'a> Fn(&'a A) -> B> {
    fn print(&self) {
        println!("function")
    }
}

impl<A, B> Printable for Rc<dyn Fn(A) -> B> {
    fn print(&self) {
        println!("function")
    }
}


pub fn test<T: Printable>() {}

pub fn call_test() {
    test::<Rc<dyn for<'a> Fn(&'a AStruct) -> i32>>();
    test::<Rc<dyn Fn(AStruct) -> i32>>();
}

AFAIK, the plan is to keep accepting this, but since they're still issuing the warning and there has been no FCP on the matter, I can't blame you for being concerned. Ideally you could avoid the warning (but I don't know that it is possible).

One deals with a higher-ranked type, and the other with a non-higher-ranked type. The latter can still involve references; it's a supertype of the former.

Anyway, pedantry aside, I don't know of a way to combine the two implementations.

Side note: these implementations would be more general

//                              vvvv
impl<A, B> Printable for Rc<dyn '_ + for<'a> Fn(&'a A) -> B> { ... }
impl<A, B> Printable for Rc<dyn '_ + Fn(A) -> B> { ... }