@@ -28,8 +28,8 @@ use rustc_ast::visit::{FnCtxt, FnKind};
28
28
use rustc_ast_pretty:: pprust:: { self , expr_to_string} ;
29
29
use rustc_data_structures:: fx:: FxHashSet ;
30
30
use rustc_errors:: { Applicability , DiagnosticBuilder } ;
31
- use rustc_feature:: Stability ;
32
31
use rustc_feature:: { deprecated_attributes, AttributeGate , AttributeTemplate , AttributeType } ;
32
+ use rustc_feature:: { GateIssue , Stability } ;
33
33
use rustc_hir as hir;
34
34
use rustc_hir:: def:: { DefKind , Res } ;
35
35
use rustc_hir:: def_id:: DefId ;
@@ -1817,13 +1817,21 @@ impl EarlyLintPass for IncompleteFeatures {
1817
1817
. map ( |( name, span, _) | ( name, span) )
1818
1818
. chain ( features. declared_lib_features . iter ( ) . map ( |( name, span) | ( name, span) ) )
1819
1819
. filter ( |( name, _) | rustc_feature:: INCOMPLETE_FEATURES . iter ( ) . any ( |f| name == & f) )
1820
- . for_each ( |( name, & span) | {
1820
+ . for_each ( |( & name, & span) | {
1821
1821
cx. struct_span_lint ( INCOMPLETE_FEATURES , span, |lint| {
1822
- lint. build ( & format ! (
1823
- "the feature `{}` is incomplete and may cause the compiler to crash" ,
1822
+ let mut builder = lint. build ( & format ! (
1823
+ "the feature `{}` is incomplete and may not be safe to use \
1824
+ and/or cause compiler crashes",
1824
1825
name,
1825
- ) )
1826
- . emit ( )
1826
+ ) ) ;
1827
+ if let Some ( n) = rustc_feature:: find_feature_issue ( name, GateIssue :: Language ) {
1828
+ builder. note ( & format ! (
1829
+ "see issue #{} <https://github.com/rust-lang/rust/issues/{}> \
1830
+ for more information",
1831
+ n, n,
1832
+ ) ) ;
1833
+ }
1834
+ builder. emit ( ) ;
1827
1835
} )
1828
1836
} ) ;
1829
1837
}
0 commit comments