Skip to content

Commit 2b44a6c

Browse files
committed
move {rustc -> rustc_session}::lint::builtin
1 parent 45f2764 commit 2b44a6c

File tree

4 files changed

+29
-28
lines changed

4 files changed

+29
-28
lines changed

src/librustc/lint/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub use crate::lint::context::{
3838
LintContext, LintStore,
3939
};
4040

41+
pub use rustc_session::lint::builtin;
4142
pub use rustc_session::lint::{BufferedEarlyLint, FutureIncompatibleInfo, Level, Lint, LintId};
4243
pub use rustc_session::lint::{LintArray, LintPass};
4344

@@ -331,7 +332,6 @@ pub enum LintSource {
331332

332333
pub type LevelSource = (Level, LintSource);
333334

334-
pub mod builtin;
335335
mod context;
336336
pub mod internal;
337337
mod levels;

src/librustc_session/lint.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHas
44
use rustc_span::edition::Edition;
55
use rustc_span::{sym, symbol::Ident, MultiSpan, Span, Symbol};
66

7+
pub mod builtin;
8+
79
/// Setting for how to handle a lint.
810
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
911
pub enum Level {

src/librustc/lint/builtin.rs renamed to src/librustc_session/lint/builtin.rs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,31 @@
44
//! compiler code, rather than using their own custom pass. Those
55
//! lints are all available in `rustc_lint::builtin`.
66
7-
use rustc_session::lint::FutureIncompatibleInfo;
8-
use rustc_session::{declare_lint, declare_lint_pass};
7+
use crate::lint::FutureIncompatibleInfo;
8+
use crate::{declare_lint, declare_lint_pass};
99
use rustc_span::edition::Edition;
10-
use syntax::early_buffered_lints::{ILL_FORMED_ATTRIBUTE_INPUT, META_VARIABLE_MISUSE};
10+
11+
declare_lint! {
12+
pub ILL_FORMED_ATTRIBUTE_INPUT,
13+
Deny,
14+
"ill-formed attribute inputs that were previously accepted and used in practice",
15+
@future_incompatible = FutureIncompatibleInfo {
16+
reference: "issue #57571 <https://github.com/rust-lang/rust/issues/57571>",
17+
edition: None,
18+
};
19+
}
20+
21+
declare_lint! {
22+
pub META_VARIABLE_MISUSE,
23+
Allow,
24+
"possible meta-variable misuse at macro definition"
25+
}
26+
27+
declare_lint! {
28+
pub INCOMPLETE_INCLUDE,
29+
Deny,
30+
"trailing content in included file"
31+
}
1132

1233
declare_lint! {
1334
pub EXCEEDING_BITSHIFTS,

src/libsyntax/early_buffered_lints.rs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,6 @@
33
//! Since we cannot have a dependency on `librustc`, we implement some types here that are somewhat
44
//! redundant. Later, these types can be converted to types for use by the rest of the compiler.
55
6-
use rustc_session::declare_lint;
6+
pub use rustc_session::lint::builtin::ILL_FORMED_ATTRIBUTE_INPUT;
7+
pub use rustc_session::lint::builtin::{INCOMPLETE_INCLUDE, META_VARIABLE_MISUSE};
78
pub use rustc_session::lint::BufferedEarlyLint;
8-
use rustc_session::lint::FutureIncompatibleInfo;
9-
10-
declare_lint! {
11-
pub ILL_FORMED_ATTRIBUTE_INPUT,
12-
Deny,
13-
"ill-formed attribute inputs that were previously accepted and used in practice",
14-
@future_incompatible = FutureIncompatibleInfo {
15-
reference: "issue #57571 <https://github.com/rust-lang/rust/issues/57571>",
16-
edition: None,
17-
};
18-
}
19-
20-
declare_lint! {
21-
pub META_VARIABLE_MISUSE,
22-
Allow,
23-
"possible meta-variable misuse at macro definition"
24-
}
25-
26-
declare_lint! {
27-
pub INCOMPLETE_INCLUDE,
28-
Deny,
29-
"trailing content in included file"
30-
}

0 commit comments

Comments
 (0)