Hard break for rust-lang/rust#46976
This commit is contained in:
parent
8d4da4f4c4
commit
d4077ad621
2 changed files with 17 additions and 1 deletions
|
@ -4130,7 +4130,11 @@ fn get_index_type_name(clean_type: &clean::Type, accept_generic: bool) -> Option
|
||||||
match *clean_type {
|
match *clean_type {
|
||||||
clean::ResolvedPath { ref path, .. } => {
|
clean::ResolvedPath { ref path, .. } => {
|
||||||
let segments = &path.segments;
|
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::Generic(ref s) if accept_generic => Some(s.clone()),
|
||||||
clean::Primitive(ref p) => Some(format!("{:?}", p)),
|
clean::Primitive(ref p) => Some(format!("{:?}", p)),
|
||||||
|
|
12
src/test/rustdoc/issue-46976.rs
Normal file
12
src/test/rustdoc/issue-46976.rs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(universal_impl_trait)]
|
||||||
|
pub fn ice(f: impl Fn()) {}
|
Loading…
Add table
Add a link
Reference in a new issue