@@ -16,7 +16,6 @@ use rustc_ast::{self as ast, AttrStyle};
1616use rustc_attr:: { ConstStability , Deprecation , Stability , StabilityLevel } ;
1717use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
1818use rustc_data_structures:: thin_vec:: ThinVec ;
19- use rustc_feature:: UnstableFeatures ;
2019use rustc_hir as hir;
2120use rustc_hir:: def:: { CtorKind , Res } ;
2221use rustc_hir:: def_id:: { CrateNum , DefId , DefIndex } ;
@@ -228,14 +227,9 @@ impl Item {
228227 "../" . repeat ( depth)
229228 }
230229 Some ( & ( _, _, ExternalLocation :: Remote ( ref s) ) ) => s. to_string ( ) ,
231- Some ( & ( _, _, ExternalLocation :: Unknown ) ) | None => String :: from (
232- // NOTE: intentionally doesn't pass crate name to avoid having
233- // different primitive links between crates
234- if UnstableFeatures :: from_environment ( None ) . is_nightly_build ( ) {
235- "https://doc.rust-lang.org/nightly"
236- } else {
237- "https://doc.rust-lang.org"
238- } ,
230+ Some ( & ( _, _, ExternalLocation :: Unknown ) ) | None => format ! (
231+ "https://doc.rust-lang.org/{}" ,
232+ crate :: doc_rust_lang_org_channel( ) ,
239233 ) ,
240234 } ;
241235 // This is a primitive so the url is done "by hand".
0 commit comments