@@ -14,7 +14,6 @@ use rustc_ast::util::comments::beautify_doc_string;
14
14
use rustc_ast:: { self as ast, AttrStyle } ;
15
15
use rustc_attr:: { ConstStability , Deprecation , Stability , StabilityLevel } ;
16
16
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
17
- use rustc_feature:: UnstableFeatures ;
18
17
use rustc_hir as hir;
19
18
use rustc_hir:: def:: { CtorKind , Res } ;
20
19
use rustc_hir:: def_id:: { CrateNum , DefId , DefIndex } ;
@@ -882,14 +881,9 @@ impl Attributes {
882
881
"../" . repeat ( depth)
883
882
}
884
883
Some ( & ( _, _, ExternalLocation :: Remote ( ref s) ) ) => s. to_string ( ) ,
885
- Some ( & ( _, _, ExternalLocation :: Unknown ) ) | None => String :: from (
886
- // NOTE: intentionally doesn't pass crate name to avoid having
887
- // different primitive links between crates
888
- if UnstableFeatures :: from_environment ( None ) . is_nightly_build ( ) {
889
- "https://doc.rust-lang.org/nightly"
890
- } else {
891
- "https://doc.rust-lang.org"
892
- } ,
884
+ Some ( & ( _, _, ExternalLocation :: Unknown ) ) | None => format ! (
885
+ "https://doc.rust-lang.org/{}" ,
886
+ crate :: doc_rust_lang_org_channel( ) ,
893
887
) ,
894
888
} ;
895
889
// This is a primitive so the url is done "by hand".
0 commit comments