Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ICE in rustdoc when merging generic and where bounds of an Fn with an output #63937

Merged
merged 3 commits into from
Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustdoc/clean/simplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
16 changes: 16 additions & 0 deletions src/test/rustdoc/auxiliary/issue-57180.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// compile-flags: -Cmetadata=aux

pub trait Trait {
}

pub struct Struct<F>
{
_p: ::std::marker::PhantomData<F>,
}

impl<F: Fn() -> u32>
Trait for Struct<F>
where
F: Fn() -> u32,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I run format on this? Also, does this test need a comment saying it's a regression test, or is its existence enough?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existence alone is fine.

{
}
7 changes: 7 additions & 0 deletions src/test/rustdoc/issue-57180.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// aux-build:issue-57180.rs

extern crate issue_57180;
use issue_57180::Trait;

fn main() {
}