Deprecated function alias? Can `#[deprecated] use` work?

Hi! I have a crate that generates code in a build script (ructe). Now I wan't to change the name of generated functions, but provide the old name as a deprecated alias. I try to do it like this:

pub fn new_name(... args ...) -> ReturnType {
   ... code ...
}
#[deprecated(since="0.7.4", note="please use `new_name` instead")]
pub use self::new_name as old_name;

But that deprecation doesn't seem to have any effect. Maybe a use clause simply can't be deprecated?

I could of course do:

pub fn new_name(... args ...) -> ReturnType {
   ... code ...
}
#[deprecated(since="0.7.4", note="please use `new_name` instead")]
pub fn old_name(... args ...) -> ReturnType {
   new_name(... args ...)
}

... but since my args often is rather long, it would make my code generation more complicated than I would like to.

Is there another way to provide a deprecated alias for a function?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.