Skip to content

Commit cd97d2f

Browse files
committed
basic declaration of lint i am adding for future incompatible change.
1 parent daef2ea commit cd97d2f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/librustc/lint/builtin.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@
1414
//! compiler code, rather than using their own custom pass. Those
1515
//! lints are all available in `rustc_lint::builtin`.
1616
17+
// Note that declare_lint! alone is not enough; you need to also
18+
// register the lint, which you can do by adding it to the lint_array!
19+
// list in `impl LintPass for HardwiredLints` below.
20+
1721
use lint::{LintPass, LateLintPass, LintArray};
1822

23+
declare_lint! {
24+
pub BORROW_OUTLIVES_OWNER_WITH_DTOR,
25+
Warn,
26+
"borrows that may interfere with destructor of owner"
27+
}
28+
1929
declare_lint! {
2030
pub CONST_ERR,
2131
Warn,
@@ -193,6 +203,7 @@ pub struct HardwiredLints;
193203
impl LintPass for HardwiredLints {
194204
fn get_lints(&self) -> LintArray {
195205
lint_array!(
206+
BORROW_OUTLIVES_OWNER_WITH_DTOR,
196207
UNUSED_IMPORTS,
197208
UNUSED_EXTERN_CRATES,
198209
UNUSED_QUALIFICATIONS,

src/librustc_lint/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
190190
id: LintId::of(ILLEGAL_STRUCT_OR_ENUM_CONSTANT_PATTERN),
191191
reference: "RFC 1445 <https://github.com/rust-lang/rfcs/pull/1445>",
192192
},
193+
FutureIncompatibleInfo {
194+
id: LintId::of(BORROW_OUTLIVES_OWNER_WITH_DTOR),
195+
reference: "issue #33206 <https://github.com/rust-lang/rust/issues/33206>",
196+
},
193197
]);
194198

195199
// We have one lint pass defined specially

0 commit comments

Comments
 (0)