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

[intra-doc links] Don't check feature gates of items re-exported across crates #82295

Merged
merged 1 commit into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,10 @@ impl LinkCollector<'_, '_> {
// for discussion on the matter.
verify(kind, id)?;

// FIXME: it would be nice to check that the feature gate was enabled in the original crate, not just ignore it altogether.
// However I'm not sure how to check that across crates.
if prim == PrimitiveType::RawPointer
&& item.def_id.is_local()
&& !self.cx.tcx.features().intra_doc_pointers
{
let span = super::source_span_for_markdown_range(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#![feature(intra_doc_pointers)]
#![crate_name = "inner"]
/// Link to [some pointer](*const::to_raw_parts)
pub fn foo() {}
4 changes: 4 additions & 0 deletions src/test/rustdoc-ui/intra-doc/pointer-reexports-allowed.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// aux-build:pointer-reexports-allowed.rs
// check-pass
extern crate inner;
pub use inner::foo;