fix intra-link resolution spans in block comments
This commit improves the calculation of code spans for intra-doc resolution failures. All sugared doc comments should now have the correct spans, including those where the comment is longer than the docs. It also fixes an issue where the spans were calculated incorrectly for certain unsugared doc comments. The diagnostic will now always use the span of the attributes, as originally intended. Fixes #55964.
This commit is contained in:
parent
b755501043
commit
56413ecffc
7 changed files with 237 additions and 59 deletions
|
@ -707,8 +707,6 @@ impl<I: IntoIterator<Item=ast::NestedMetaItem>> NestedAttributesExt for I {
|
|||
/// kept separate because of issue #42760.
|
||||
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Debug, Hash)]
|
||||
pub enum DocFragment {
|
||||
// FIXME #44229 (misdreavus): sugared and raw doc comments can be brought back together once
|
||||
// hoedown is completely removed from rustdoc.
|
||||
/// A doc fragment created from a `///` or `//!` doc comment.
|
||||
SugaredDoc(usize, syntax_pos::Span, String),
|
||||
/// A doc fragment created from a "raw" `#[doc=""]` attribute.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue