Skip to content
Permalink
Browse files

put back macro redirect

  • Loading branch information...
GuillaumeGomez committed Feb 9, 2019
1 parent 397eb4f commit d26475505b4c2bfc6299d3c6c38b1963c3bd86e0
Showing with 10 additions and 1 deletion.
  1. +9 −0 src/librustdoc/html/render.rs
  2. +1 −1 src/test/rustdoc/without-redirect.rs
@@ -2245,6 +2245,15 @@ impl Context {
try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
}
}
// If the item is a macro, redirect from the old macro URL (with !)
// to the new one (without).
if item_type == ItemType::Macro {
let redir_name = format!("{}.{}!.html", item_type, name);
let redir_dst = self.dst.join(redir_name);
let redirect_out = try_err!(File::create(&redir_dst), &redir_dst);
let mut redirect_out = BufWriter::new(redirect_out);
try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
}
}
}
Ok(())
@@ -1,7 +1,7 @@
#![crate_name = "foo"]

// @has foo/macro.bar.html
// @!has foo/macro.bar!.html
// @has foo/macro.bar!.html
// @!has foo/bar.m.html
#[macro_export]
macro_rules! bar {

0 comments on commit d264755

Please sign in to comment.
You can’t perform that action at this time.