From 143b83a3c1e3a03d9795b891e4f2298c5e59f66a Mon Sep 17 00:00:00 2001 From: Paul Daniel Faria Date: Wed, 28 Aug 2019 00:21:30 -0400 Subject: [PATCH] Add regression test for issue, apply suggestion to convert to assert_eq --- src/librustdoc/clean/simplify.rs | 2 +- src/test/rustdoc/auxiliary/issue-57180.rs | 16 ++++++++++++++++ src/test/rustdoc/issue-57180.rs | 7 +++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/test/rustdoc/auxiliary/issue-57180.rs create mode 100644 src/test/rustdoc/issue-57180.rs diff --git a/src/librustdoc/clean/simplify.rs b/src/librustdoc/clean/simplify.rs index 73bc0386326ce..853170542e083 100644 --- a/src/librustdoc/clean/simplify.rs +++ b/src/librustdoc/clean/simplify.rs @@ -118,7 +118,7 @@ pub fn merge_bounds( }); } PP::Parenthesized { ref mut output, .. } => match output { - Some(o) => assert!(o == rhs), + Some(o) => assert_eq!(o, rhs), None => if *rhs != clean::Type::Tuple(Vec::new()) { *output = Some(rhs.clone()); } diff --git a/src/test/rustdoc/auxiliary/issue-57180.rs b/src/test/rustdoc/auxiliary/issue-57180.rs new file mode 100644 index 0000000000000..4e2f4b87c020e --- /dev/null +++ b/src/test/rustdoc/auxiliary/issue-57180.rs @@ -0,0 +1,16 @@ +// compile-flags: -Cmetadata=aux + +pub trait Trait { +} + +pub struct Struct +{ + _p: ::std::marker::PhantomData, +} + +impl u32> +Trait for Struct + where + F: Fn() -> u32, +{ +} diff --git a/src/test/rustdoc/issue-57180.rs b/src/test/rustdoc/issue-57180.rs new file mode 100644 index 0000000000000..14bd2b0fec0d5 --- /dev/null +++ b/src/test/rustdoc/issue-57180.rs @@ -0,0 +1,7 @@ +// aux-build:issue-57180.rs + +extern crate issue_57180; +use issue_57180::Trait; + +fn main() { +}