@@ -28,8 +28,8 @@ use rustc_ast::visit::{FnCtxt, FnKind};
2828use rustc_ast_pretty:: pprust:: { self , expr_to_string} ;
2929use rustc_data_structures:: fx:: FxHashSet ;
3030use rustc_errors:: { Applicability , DiagnosticBuilder } ;
31- use rustc_feature:: Stability ;
3231use rustc_feature:: { deprecated_attributes, AttributeGate , AttributeTemplate , AttributeType } ;
32+ use rustc_feature:: { GateIssue , Stability } ;
3333use rustc_hir as hir;
3434use rustc_hir:: def:: { DefKind , Res } ;
3535use rustc_hir:: def_id:: DefId ;
@@ -1817,13 +1817,21 @@ impl EarlyLintPass for IncompleteFeatures {
18171817 . map ( |( name, span, _) | ( name, span) )
18181818 . chain ( features. declared_lib_features . iter ( ) . map ( |( name, span) | ( name, span) ) )
18191819 . filter ( |( name, _) | rustc_feature:: INCOMPLETE_FEATURES . iter ( ) . any ( |f| name == & f) )
1820- . for_each ( |( name, & span) | {
1820+ . for_each ( |( & name, & span) | {
18211821 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",
18241825 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 ( ) ;
18271835 } )
18281836 } ) ;
18291837 }
0 commit comments