1
Fork 0

Auto merge of #47083 - CAD97:issue-46976, r=nikomatsakis

Issue 46976

ICE is due to an empty path segments, so I set the path to be the same as the in band ty params symbol. (I think this is how regular generics end up being handled?)

Pinging @cramertj, this is your code I'm editing here.
This commit is contained in:
bors 2018-01-06 09:22:16 +00:00
commit 90e019bacd
3 changed files with 21 additions and 4 deletions

View file

@ -4136,7 +4136,11 @@ fn get_index_type_name(clean_type: &clean::Type, accept_generic: bool) -> Option
match *clean_type {
clean::ResolvedPath { ref path, .. } => {
let segments = &path.segments;
Some(segments[segments.len() - 1].name.clone())
let path_segment = segments.into_iter().last().unwrap_or_else(|| panic!(
"get_index_type_name(clean_type: {:?}, accept_generic: {:?}) had length zero path",
clean_type, accept_generic
));
Some(path_segment.name.clone())
}
clean::Generic(ref s) if accept_generic => Some(s.clone()),
clean::Primitive(ref p) => Some(format!("{:?}", p)),