/src/test/rustdoc/issue-78701.rs

https://gitlab.com/rust-lang/rust · Rust · 20 lines · 7 code · 7 blank · 6 comment · 3 complexity · ad2f1ef426e30fc1125d3320059ddbd9 MD5 · raw file

  1. #![crate_name = "foo"]
  2. // This test ensures that if a blanket impl has the same ID as another impl, it'll
  3. // link to the blanket impl and not the other impl. Basically, we're checking if
  4. // the ID is correctly derived.
  5. // @has 'foo/struct.AnotherStruct.html'
  6. // @count - '//*[@class="sidebar"]//a[@href="#impl-AnAmazingTrait"]' 1
  7. // @count - '//*[@class="sidebar"]//a[@href="#impl-AnAmazingTrait-1"]' 1
  8. pub trait Something {}
  9. pub trait AnAmazingTrait {}
  10. impl<T: Something> AnAmazingTrait for T {}
  11. pub struct AnotherStruct<T>(T);
  12. impl<T: Something> Something for AnotherStruct<T> {}
  13. impl AnAmazingTrait for AnotherStruct<()> {}