Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
c2e517e0
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c2e517e0
编写于
2月 26, 2019
作者:
L
ljedrz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ty: HirIdify some lints
上级
e72584c3
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
62 addition
and
89 deletion
+62
-89
src/librustc/lint/context.rs
src/librustc/lint/context.rs
+1
-2
src/librustc/middle/stability.rs
src/librustc/middle/stability.rs
+2
-3
src/librustc/traits/specialize/mod.rs
src/librustc/traits/specialize/mod.rs
+2
-2
src/librustc/ty/context.rs
src/librustc/ty/context.rs
+6
-27
src/librustc_mir/hair/pattern/check_match.rs
src/librustc_mir/hair/pattern/check_match.rs
+8
-8
src/librustc_mir/hair/pattern/mod.rs
src/librustc_mir/hair/pattern/mod.rs
+1
-2
src/librustc_mir/lints.rs
src/librustc_mir/lints.rs
+5
-5
src/librustc_mir/transform/check_unsafety.rs
src/librustc_mir/transform/check_unsafety.rs
+6
-8
src/librustc_mir/transform/const_prop.rs
src/librustc_mir/transform/const_prop.rs
+4
-4
src/librustc_privacy/lib.rs
src/librustc_privacy/lib.rs
+8
-8
src/librustc_typeck/check_unused.rs
src/librustc_typeck/check_unused.rs
+8
-9
src/librustc_typeck/coherence/inherent_impls_overlap.rs
src/librustc_typeck/coherence/inherent_impls_overlap.rs
+4
-4
src/librustdoc/passes/collect_intra_doc_links.rs
src/librustdoc/passes/collect_intra_doc_links.rs
+2
-2
src/librustdoc/passes/mod.rs
src/librustdoc/passes/mod.rs
+5
-5
未找到文件。
src/librustc/lint/context.rs
浏览文件 @
c2e517e0
...
...
@@ -729,8 +729,7 @@ fn lookup<S: Into<MultiSpan>>(&self,
match
span
{
Some
(
s
)
=>
self
.tcx
.struct_span_lint_hir
(
lint
,
hir_id
,
s
,
msg
),
None
=>
{
let
node_id
=
self
.tcx
.hir
()
.hir_to_node_id
(
hir_id
);
// FIXME(@ljedrz): remove later
self
.tcx
.struct_lint_node
(
lint
,
node_id
,
msg
)
self
.tcx
.struct_lint_node
(
lint
,
hir_id
,
msg
)
},
}
}
...
...
src/librustc/middle/stability.rs
浏览文件 @
c2e517e0
...
...
@@ -13,7 +13,6 @@
use
crate
::
session
::{
DiagnosticMessageId
,
Session
};
use
syntax
::
symbol
::
Symbol
;
use
syntax_pos
::{
Span
,
MultiSpan
};
use
syntax
::
ast
;
use
syntax
::
ast
::
Attribute
;
use
syntax
::
errors
::
Applicability
;
use
syntax
::
feature_gate
::{
GateIssue
,
emit_feature_err
};
...
...
@@ -922,8 +921,8 @@ fn unnecessary_stable_feature_lint<'a, 'tcx>(
feature
:
Symbol
,
since
:
Symbol
)
{
tcx
.lint_
node
(
lint
::
builtin
::
STABLE_FEATURES
,
ast
::
CRATE_NODE
_ID
,
tcx
.lint_
hir
(
lint
::
builtin
::
STABLE_FEATURES
,
hir
::
CRATE_HIR
_ID
,
span
,
&
format!
(
"the feature `{}` has been stable since {} and no longer requires
\
an attribute to enable"
,
feature
,
since
));
...
...
src/librustc/traits/specialize/mod.rs
浏览文件 @
c2e517e0
...
...
@@ -334,9 +334,9 @@ pub(super) fn specialization_graph_provider<'a, 'tcx>(
FutureCompatOverlapErrorKind
::
Issue33140
=>
lint
::
builtin
::
ORDER_DEPENDENT_TRAIT_OBJECTS
,
};
tcx
.struct_span_lint_
node
(
tcx
.struct_span_lint_
hir
(
lint
,
tcx
.hir
()
.as_local_
node
_id
(
impl_def_id
)
.unwrap
(),
tcx
.hir
()
.as_local_
hir
_id
(
impl_def_id
)
.unwrap
(),
impl_span
,
&
msg
)
}
else
{
...
...
src/librustc/ty/context.rs
浏览文件 @
c2e517e0
...
...
@@ -65,7 +65,7 @@
use
std
::
sync
::
Arc
;
use
std
::
marker
::
PhantomData
;
use
rustc_target
::
spec
::
abi
;
use
syntax
::
ast
::{
self
,
NodeId
}
;
use
syntax
::
ast
;
use
syntax
::
attr
;
use
syntax
::
source_map
::
MultiSpan
;
use
syntax
::
edition
::
Edition
;
...
...
@@ -2836,14 +2836,6 @@ pub fn lint_hir<S: Into<MultiSpan>>(self,
self
.struct_span_lint_hir
(
lint
,
hir_id
,
span
.into
(),
msg
)
.emit
()
}
pub
fn
lint_node
<
S
:
Into
<
MultiSpan
>>
(
self
,
lint
:
&
'static
Lint
,
id
:
NodeId
,
span
:
S
,
msg
:
&
str
)
{
self
.struct_span_lint_node
(
lint
,
id
,
span
.into
(),
msg
)
.emit
()
}
pub
fn
lint_hir_note
<
S
:
Into
<
MultiSpan
>>
(
self
,
lint
:
&
'static
Lint
,
hir_id
:
HirId
,
...
...
@@ -2866,7 +2858,7 @@ pub fn lint_node_note<S: Into<MultiSpan>>(self,
err
.emit
()
}
pub
fn
lint_level_at_node
(
self
,
lint
:
&
'static
Lint
,
mut
id
:
Node
Id
)
pub
fn
lint_level_at_node
(
self
,
lint
:
&
'static
Lint
,
mut
id
:
hir
::
Hir
Id
)
->
(
lint
::
Level
,
lint
::
LintSource
)
{
// Right now we insert a `with_ignore` node in the dep graph here to
...
...
@@ -2880,11 +2872,10 @@ pub fn lint_level_at_node(self, lint: &'static Lint, mut id: NodeId)
self
.dep_graph
.with_ignore
(||
{
let
sets
=
self
.lint_levels
(
LOCAL_CRATE
);
loop
{
let
hir_id
=
self
.hir
()
.definitions
()
.node_to_hir_id
(
id
);
if
let
Some
(
pair
)
=
sets
.level_and_source
(
lint
,
hir_id
,
self
.sess
)
{
if
let
Some
(
pair
)
=
sets
.level_and_source
(
lint
,
id
,
self
.sess
)
{
return
pair
}
let
next
=
self
.hir
()
.get_parent_node
(
id
);
let
next
=
self
.hir
()
.get_parent_node
_by_hir_id
(
id
);
if
next
==
id
{
bug!
(
"lint traversal reached the root of the crate"
);
}
...
...
@@ -2900,23 +2891,11 @@ pub fn struct_span_lint_hir<S: Into<MultiSpan>>(self,
msg
:
&
str
)
->
DiagnosticBuilder
<
'tcx
>
{
let
node_id
=
self
.hir
()
.hir_to_node_id
(
hir_id
);
let
(
level
,
src
)
=
self
.lint_level_at_node
(
lint
,
node_id
);
lint
::
struct_lint_level
(
self
.sess
,
lint
,
level
,
src
,
Some
(
span
.into
()),
msg
)
}
pub
fn
struct_span_lint_node
<
S
:
Into
<
MultiSpan
>>
(
self
,
lint
:
&
'static
Lint
,
id
:
NodeId
,
span
:
S
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'tcx
>
{
let
(
level
,
src
)
=
self
.lint_level_at_node
(
lint
,
id
);
let
(
level
,
src
)
=
self
.lint_level_at_node
(
lint
,
hir_id
);
lint
::
struct_lint_level
(
self
.sess
,
lint
,
level
,
src
,
Some
(
span
.into
()),
msg
)
}
pub
fn
struct_lint_node
(
self
,
lint
:
&
'static
Lint
,
id
:
Node
Id
,
msg
:
&
str
)
pub
fn
struct_lint_node
(
self
,
lint
:
&
'static
Lint
,
id
:
Hir
Id
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'tcx
>
{
let
(
level
,
src
)
=
self
.lint_level_at_node
(
lint
,
id
);
...
...
src/librustc_mir/hair/pattern/check_match.rs
浏览文件 @
c2e517e0
...
...
@@ -346,9 +346,9 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
NotUseful
=>
{
match
source
{
hir
::
MatchSource
::
IfLetDesugar
{
..
}
=>
{
cx
.tcx
.lint_
node
(
cx
.tcx
.lint_
hir
(
lint
::
builtin
::
IRREFUTABLE_LET_PATTERNS
,
hir_pat
.id
,
hir_pat
.
hir_
id
,
pat
.span
,
"irrefutable if-let pattern"
,
);
...
...
@@ -359,16 +359,16 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
match
arm_index
{
// The arm with the user-specified pattern.
0
=>
{
cx
.tcx
.lint_
node
(
cx
.tcx
.lint_
hir
(
lint
::
builtin
::
UNREACHABLE_PATTERNS
,
hir_pat
.id
,
pat
.span
,
hir_pat
.
hir_
id
,
pat
.span
,
"unreachable pattern"
);
},
// The arm with the wildcard pattern.
1
=>
{
cx
.tcx
.lint_
node
(
cx
.tcx
.lint_
hir
(
lint
::
builtin
::
IRREFUTABLE_LET_PATTERNS
,
hir_pat
.id
,
hir_pat
.
hir_
id
,
pat
.span
,
"irrefutable while-let pattern"
,
);
...
...
@@ -379,9 +379,9 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
hir
::
MatchSource
::
ForLoopDesugar
|
hir
::
MatchSource
::
Normal
=>
{
let
mut
err
=
cx
.tcx
.struct_span_lint_
node
(
let
mut
err
=
cx
.tcx
.struct_span_lint_
hir
(
lint
::
builtin
::
UNREACHABLE_PATTERNS
,
hir_pat
.id
,
hir_pat
.
hir_
id
,
pat
.span
,
"unreachable pattern"
,
);
...
...
src/librustc_mir/hair/pattern/mod.rs
浏览文件 @
c2e517e0
...
...
@@ -955,8 +955,7 @@ fn const_to_pat(
debug!
(
"const_to_pat: cv.ty={:?} span={:?}"
,
cv
.ty
,
span
);
let
kind
=
match
cv
.ty.sty
{
ty
::
Float
(
_
)
=>
{
let
id
=
self
.tcx
.hir
()
.hir_to_node_id
(
id
);
self
.tcx
.lint_node
(
self
.tcx
.lint_hir
(
::
rustc
::
lint
::
builtin
::
ILLEGAL_FLOATING_POINT_LITERAL_PATTERN
,
id
,
span
,
...
...
src/librustc_mir/lints.rs
浏览文件 @
c2e517e0
...
...
@@ -129,12 +129,12 @@ fn check_fn_for_unconditional_recursion(tcx: TyCtxt<'a, 'tcx, 'tcx>,
// no break */ }`) shouldn't be linted unless it actually
// recurs.
if
!
reached_exit_without_self_call
&&
!
self_call_locations
.is_empty
()
{
let
node_id
=
tcx
.hir
()
.as_local_node
_id
(
def_id
)
.unwrap
();
let
hir_id
=
tcx
.hir
()
.as_local_hir
_id
(
def_id
)
.unwrap
();
let
sp
=
tcx
.sess
.source_map
()
.def_span
(
tcx
.hir
()
.span_by_hir_id
(
hir_id
));
let
mut
db
=
tcx
.struct_span_lint_
node
(
UNCONDITIONAL_RECURSION
,
node
_id
,
sp
,
"function cannot return without recursing"
);
let
mut
db
=
tcx
.struct_span_lint_
hir
(
UNCONDITIONAL_RECURSION
,
hir
_id
,
sp
,
"function cannot return without recursing"
);
db
.span_label
(
sp
,
"cannot return without recursing"
);
// offer some help to the programmer.
for
location
in
&
self_call_locations
{
...
...
src/librustc_mir/transform/check_unsafety.rs
浏览文件 @
c2e517e0
...
...
@@ -553,10 +553,8 @@ fn unsafety_check_result<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId)
}
fn
unsafe_derive_on_repr_packed
<
'a
,
'tcx
>
(
tcx
:
TyCtxt
<
'a
,
'tcx
,
'tcx
>
,
def_id
:
DefId
)
{
let
lint_node_id
=
match
tcx
.hir
()
.as_local_node_id
(
def_id
)
{
Some
(
node_id
)
=>
node_id
,
None
=>
bug!
(
"checking unsafety for non-local def id {:?}"
,
def_id
)
};
let
lint_hir_id
=
tcx
.hir
()
.as_local_hir_id
(
def_id
)
.unwrap_or_else
(||
bug!
(
"checking unsafety for non-local def id {:?}"
,
def_id
));
// FIXME: when we make this a hard error, this should have its
// own error code.
...
...
@@ -567,10 +565,10 @@ fn unsafe_derive_on_repr_packed<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: D
"#[derive] can't be used on a #[repr(packed)] struct that
\
does not derive Copy (error E0133)"
.to_string
()
};
tcx
.lint_
node
(
SAFE_PACKED_BORROWS
,
lint_node
_id
,
tcx
.def_span
(
def_id
),
&
message
);
tcx
.lint_
hir
(
SAFE_PACKED_BORROWS
,
lint_hir
_id
,
tcx
.def_span
(
def_id
),
&
message
);
}
/// Returns the `HirId` for an enclosing scope that is also `unsafe`.
...
...
src/librustc_mir/transform/const_prop.rs
浏览文件 @
c2e517e0
...
...
@@ -603,10 +603,10 @@ fn visit_terminator_kind(
.unwrap
()
.source_info
.span
;
let
node
_id
=
self
let
hir
_id
=
self
.tcx
.hir
()
.as_local_
node
_id
(
self
.source
.def_id
())
.as_local_
hir
_id
(
self
.source
.def_id
())
.expect
(
"some part of a failing const eval must be local"
);
use
rustc
::
mir
::
interpret
::
EvalErrorKind
::
*
;
let
msg
=
match
msg
{
...
...
@@ -643,9 +643,9 @@ fn visit_terminator_kind(
// Need proper const propagator for these
_
=>
return
,
};
self
.tcx
.lint_
node
(
self
.tcx
.lint_
hir
(
::
rustc
::
lint
::
builtin
::
CONST_ERR
,
node
_id
,
hir
_id
,
span
,
&
msg
,
);
...
...
src/librustc_privacy/lib.rs
浏览文件 @
c2e517e0
...
...
@@ -1539,12 +1539,12 @@ fn ty(&mut self) -> &mut Self {
fn
check_def_id
(
&
mut
self
,
def_id
:
DefId
,
kind
:
&
str
,
descr
:
&
dyn
fmt
::
Display
)
->
bool
{
if
self
.leaks_private_dep
(
def_id
)
{
self
.tcx
.lint_
node
(
lint
::
builtin
::
EXPORTED_PRIVATE_DEPENDENCIES
,
self
.item_id
,
self
.span
,
&
format!
(
"{} `{}` from private dependency '{}' in public
\
interface"
,
kind
,
descr
,
self
.tcx
.crate_name
(
def_id
.krate
)));
self
.tcx
.lint_
hir
(
lint
::
builtin
::
EXPORTED_PRIVATE_DEPENDENCIES
,
self
.item_id
,
self
.span
,
&
format!
(
"{} `{}` from private dependency '{}' in public
\
interface"
,
kind
,
descr
,
self
.tcx
.crate_name
(
def_id
.krate
)));
}
...
...
@@ -1567,8 +1567,8 @@ fn check_def_id(&mut self, def_id: DefId, kind: &str, descr: &dyn fmt::Display)
err
.emit
();
}
else
{
let
err_code
=
if
kind
==
"trait"
{
"E0445"
}
else
{
"E0446"
};
self
.tcx
.lint_
node
(
lint
::
builtin
::
PRIVATE_IN_PUBLIC
,
node
_id
,
self
.span
,
&
format!
(
"{} (error {})"
,
msg
,
err_code
));
self
.tcx
.lint_
hir
(
lint
::
builtin
::
PRIVATE_IN_PUBLIC
,
hir
_id
,
self
.span
,
&
format!
(
"{} (error {})"
,
msg
,
err_code
));
}
}
...
...
src/librustc_typeck/check_unused.rs
浏览文件 @
c2e517e0
...
...
@@ -51,14 +51,13 @@ struct CheckVisitor<'a, 'tcx: 'a> {
}
impl
<
'a
,
'tcx
>
CheckVisitor
<
'a
,
'tcx
>
{
fn
check_import
(
&
self
,
id
:
ast
::
Node
Id
,
span
:
Span
)
{
let
def_id
=
self
.tcx
.hir
()
.local_def_id
(
id
);
fn
check_import
(
&
self
,
id
:
hir
::
Hir
Id
,
span
:
Span
)
{
let
def_id
=
self
.tcx
.hir
()
.local_def_id
_from_hir_id
(
id
);
if
!
self
.tcx
.maybe_unused_trait_import
(
def_id
)
{
return
;
}
let
import_def_id
=
self
.tcx
.hir
()
.local_def_id
(
id
);
if
self
.used_trait_imports
.contains
(
&
import_def_id
)
{
if
self
.used_trait_imports
.contains
(
&
def_id
)
{
return
;
}
...
...
@@ -67,7 +66,7 @@ fn check_import(&self, id: ast::NodeId, span: Span) {
}
else
{
"unused import"
.to_owned
()
};
self
.tcx
.lint_
node
(
lint
::
builtin
::
UNUSED_IMPORTS
,
id
,
span
,
&
msg
);
self
.tcx
.lint_
hir
(
lint
::
builtin
::
UNUSED_IMPORTS
,
id
,
span
,
&
msg
);
}
}
...
...
@@ -121,8 +120,8 @@ fn unused_crates_lint<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>) {
});
for
extern_crate
in
&
crates_to_lint
{
let
id
=
tcx
.hir
()
.as_local_
node
_id
(
extern_crate
.def_id
)
.unwrap
();
let
item
=
tcx
.hir
()
.expect_item
(
id
);
let
id
=
tcx
.hir
()
.as_local_
hir
_id
(
extern_crate
.def_id
)
.unwrap
();
let
item
=
tcx
.hir
()
.expect_item
_by_hir_id
(
id
);
// If the crate is fully unused, we suggest removing it altogether.
// We do this in any edition.
...
...
@@ -135,7 +134,7 @@ fn unused_crates_lint<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>) {
.map
(|
attr
|
attr
.span
)
.fold
(
span
,
|
acc
,
attr_span
|
acc
.to
(
attr_span
));
tcx
.struct_span_lint_
node
(
lint
,
id
,
span
,
msg
)
tcx
.struct_span_lint_
hir
(
lint
,
id
,
span
,
msg
)
.span_suggestion_short
(
span_with_attrs
,
"remove it"
,
...
...
@@ -177,7 +176,7 @@ fn unused_crates_lint<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>) {
None
=>
format!
(
"use {};"
,
item
.ident.name
),
};
let
replacement
=
visibility_qualified
(
&
item
.vis
,
base_replacement
);
tcx
.struct_span_lint_
node
(
lint
,
id
,
extern_crate
.span
,
msg
)
tcx
.struct_span_lint_
hir
(
lint
,
id
,
extern_crate
.span
,
msg
)
.span_suggestion_short
(
extern_crate
.span
,
&
help
,
...
...
src/librustc_typeck/coherence/inherent_impls_overlap.rs
浏览文件 @
c2e517e0
...
...
@@ -36,11 +36,11 @@ fn check_for_common_items_in_impls(&self, impl1: DefId, impl2: DefId,
for
&
item2
in
&
impl_items2
[
..
]
{
if
(
name
,
namespace
)
==
name_and_namespace
(
item2
)
{
let
node_id
=
self
.tcx
.hir
()
.as_local_node
_id
(
impl1
);
let
mut
err
=
if
used_to_be_allowed
&&
node
_id
.is_some
()
{
self
.tcx
.struct_span_lint_
node
(
let
hir_id
=
self
.tcx
.hir
()
.as_local_hir
_id
(
impl1
);
let
mut
err
=
if
used_to_be_allowed
&&
hir
_id
.is_some
()
{
self
.tcx
.struct_span_lint_
hir
(
lint
::
builtin
::
INCOHERENT_FUNDAMENTAL_IMPLS
,
node
_id
.unwrap
(),
hir
_id
.unwrap
(),
self
.tcx
.span_of_impl
(
item1
)
.unwrap
(),
&
format!
(
"duplicate definitions with name `{}` (E0592)"
,
name
)
)
...
...
src/librustdoc/passes/collect_intra_doc_links.rs
浏览文件 @
c2e517e0
...
...
@@ -473,9 +473,9 @@ fn resolution_failure(
)
{
let
sp
=
span_of_attrs
(
attrs
);
let
mut
diag
=
cx
.tcx
.struct_span_lint_
node
(
let
mut
diag
=
cx
.tcx
.struct_span_lint_
hir
(
lint
::
builtin
::
INTRA_DOC_LINK_RESOLUTION_FAILURE
,
NodeId
::
from_u32
(
0
)
,
hir
::
CRATE_HIR_ID
,
sp
,
&
format!
(
"`[{}]` cannot be resolved, ignoring it..."
,
path_str
),
);
...
...
src/librustdoc/passes/mod.rs
浏览文件 @
c2e517e0
//! Contains information about "passes", used to modify crate information during the documentation
//! process.
use
rustc
::
hir
;
use
rustc
::
hir
::
def_id
::
DefId
;
use
rustc
::
lint
as
lint
;
use
rustc
::
middle
::
privacy
::
AccessLevels
;
use
rustc
::
util
::
nodemap
::
DefIdSet
;
use
std
::
mem
;
use
syntax
::
ast
::
NodeId
;
use
syntax_pos
::{
DUMMY_SP
,
Span
};
use
std
::
ops
::
Range
;
...
...
@@ -312,18 +312,18 @@ fn add_test(&mut self, _: String, _: LangString, _: usize) {
if
find_testable_code
(
&
dox
,
&
mut
tests
,
ErrorCodes
::
No
)
.is_ok
()
{
if
check_missing_code
==
true
&&
tests
.found_tests
==
0
{
let
mut
diag
=
cx
.tcx
.struct_span_lint_
node
(
let
mut
diag
=
cx
.tcx
.struct_span_lint_
hir
(
lint
::
builtin
::
MISSING_DOC_CODE_EXAMPLES
,
NodeId
::
from_u32
(
0
)
,
hir
::
CRATE_HIR_ID
,
span_of_attrs
(
&
item
.attrs
),
"Missing code example in this documentation"
);
diag
.emit
();
}
else
if
check_missing_code
==
false
&&
tests
.found_tests
>
0
&&
!
cx
.renderinfo
.borrow
()
.access_levels
.is_doc_reachable
(
item
.def_id
)
{
let
mut
diag
=
cx
.tcx
.struct_span_lint_
node
(
let
mut
diag
=
cx
.tcx
.struct_span_lint_
hir
(
lint
::
builtin
::
PRIVATE_DOC_TESTS
,
NodeId
::
from_u32
(
0
)
,
hir
::
CRATE_HIR_ID
,
span_of_attrs
(
&
item
.attrs
),
"Documentation test in private item"
);
diag
.emit
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录