Skip to content

Commit c5e85f4

Browse files
bors[bot]xFrednet
andauthored
Merge #166
166: Rustc: Enable `non_exhaustive_omitted_patterns_lint` feature and lint r=xFrednet a=xFrednet Closes #25 Co-authored-by: xFrednet <[email protected]>
2 parents 5776895 + 82534da commit c5e85f4

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed

marker_rustc_driver/src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl<'ast, 'tcx: 'ast> DriverContext<'ast> for RustcContext<'ast, 'tcx> {
117117
self.rustc_converter.to_applicability(*app),
118118
);
119119
},
120-
_ => todo!(),
120+
_ => unreachable!(),
121121
}
122122
}
123123
builder

marker_rustc_driver/src/conversion/marker/common.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,9 @@ impl<'ast, 'tcx> MarkerConverterInner<'ast, 'tcx> {
138138
pub fn to_lint_level(&self, level: rustc_lint::Level) -> Level {
139139
match level {
140140
rustc_lint::Level::Allow => Level::Allow,
141-
rustc_lint::Level::Warn => Level::Warn,
141+
rustc_lint::Level::Warn | rustc_lint::Level::ForceWarn(_) | rustc_lint::Level::Expect(_) => Level::Warn,
142142
rustc_lint::Level::Deny => Level::Deny,
143143
rustc_lint::Level::Forbid => Level::Forbid,
144-
_ => unreachable!(),
145144
}
146145
}
147146

marker_rustc_driver/src/conversion/rustc/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<'ast, 'tcx> RustcConverter<'ast, 'tcx> {
141141
},
142142
EmissionNode::Field(id) => return Some(self.to_hir_id(id)),
143143
EmissionNode::Variant(id) => self.to_def_id(id),
144-
_ => todo!(),
144+
_ => unreachable!(),
145145
};
146146

147147
def_id
@@ -179,7 +179,7 @@ impl<'ast, 'tcx> RustcConverter<'ast, 'tcx> {
179179
Applicability::MaybeIncorrect => rustc_errors::Applicability::MaybeIncorrect,
180180
Applicability::HasPlaceholders => rustc_errors::Applicability::HasPlaceholders,
181181
Applicability::Unspecified => rustc_errors::Applicability::Unspecified,
182-
_ => todo!(),
182+
_ => unreachable!(),
183183
}
184184
}
185185

marker_rustc_driver/src/conversion/rustc/unstable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ impl<'ast, 'tcx> RustcConverter<'ast, 'tcx> {
99
let report_in_external_macro = match api_lint.report_in_macro {
1010
MacroReport::No | MacroReport::Local => false,
1111
MacroReport::All => true,
12-
_ => unreachable!("added variant to lint::MacroReport"),
12+
_ => unreachable!(),
1313
};
1414

1515
Box::leak(Box::new(rustc_lint::Lint {

marker_rustc_driver/src/main.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
#![doc = include_str!("../README.md")]
22
#![feature(rustc_private)]
3-
#![feature(lint_reasons)]
43
#![feature(let_chains)]
4+
#![feature(lint_reasons)]
55
#![feature(iter_collect_into)]
6+
#![feature(non_exhaustive_omitted_patterns_lint)]
67
#![warn(rustc::internal)]
78
#![warn(clippy::pedantic)]
9+
#![warn(non_exhaustive_omitted_patterns)]
810
#![allow(clippy::missing_panics_doc)]
911
#![allow(clippy::module_name_repetitions)]
10-
#![allow(
11-
clippy::needless_lifetimes,
12-
reason = "some lifetimes will be required to fix ICEs, <'ast, '_> also looks weird"
13-
)]
14-
#![allow(clippy::needless_collect, reason = "it has false positives for `alloc_slice_iter`")]
15-
#![allow(
16-
clippy::too_many_lines,
17-
reason = "long functions are sometimes unavoidable for matches"
18-
)]
12+
#![allow(clippy::needless_lifetimes, reason = "lifetimes will be required to fix ICEs")]
13+
#![allow(clippy::needless_collect, reason = "false positives for `alloc_slice`")]
14+
#![allow(clippy::too_many_lines, reason = "long functions are unavoidable for matches")]
1915

2016
extern crate rustc_ast;
2117
extern crate rustc_data_structures;

0 commit comments

Comments
 (0)