@@ -1370,22 +1370,7 @@ impl LinkCollector<'_, '_> {
1370
1370
&& item. def_id . is_local ( )
1371
1371
&& !self . cx . tcx . features ( ) . intra_doc_pointers
1372
1372
{
1373
- let span = super :: source_span_for_markdown_range (
1374
- self . cx . tcx ,
1375
- dox,
1376
- & ori_link. range ,
1377
- & item. attrs ,
1378
- )
1379
- . unwrap_or_else ( || item. attr_span ( self . cx . tcx ) ) ;
1380
-
1381
- rustc_session:: parse:: feature_err (
1382
- & self . cx . tcx . sess . parse_sess ,
1383
- sym:: intra_doc_pointers,
1384
- span,
1385
- "linking to associated items of raw pointers is experimental" ,
1386
- )
1387
- . note ( "rustdoc does not allow disambiguating between `*const` and `*mut`, and pointers are unstable until it does" )
1388
- . emit ( ) ;
1373
+ self . report_rawptr_assoc_feature_gate ( dox, & ori_link, item) ;
1389
1374
}
1390
1375
} else {
1391
1376
match disambiguator {
@@ -1412,6 +1397,20 @@ impl LinkCollector<'_, '_> {
1412
1397
}
1413
1398
}
1414
1399
1400
+ fn report_rawptr_assoc_feature_gate ( & self , dox : & str , ori_link : & MarkdownLink , item : & Item ) {
1401
+ let span =
1402
+ super :: source_span_for_markdown_range ( self . cx . tcx , dox, & ori_link. range , & item. attrs )
1403
+ . unwrap_or_else ( || item. attr_span ( self . cx . tcx ) ) ;
1404
+ rustc_session:: parse:: feature_err (
1405
+ & self . cx . tcx . sess . parse_sess ,
1406
+ sym:: intra_doc_pointers,
1407
+ span,
1408
+ "linking to associated items of raw pointers is experimental" ,
1409
+ )
1410
+ . note ( "rustdoc does not allow disambiguating between `*const` and `*mut`, and pointers are unstable until it does" )
1411
+ . emit ( ) ;
1412
+ }
1413
+
1415
1414
fn resolve_with_disambiguator_cached (
1416
1415
& mut self ,
1417
1416
key : ResolutionInfo ,
0 commit comments