Skip to content

Commit

Permalink
Fix CI and force inline for nightly functions
Browse files Browse the repository at this point in the history
  • Loading branch information
xFrednet committed Feb 15, 2022
1 parent fc36a7c commit 0c7e481
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion clippy_dev/src/update_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,13 @@ fn gen_nightly_lint_list<'a>(
internal_lints: impl Iterator<Item = &'a Lint>,
usable_lints: impl Iterator<Item = &'a Lint>,
) -> String {
let details: Vec<_> = internal_lints
let mut details: Vec<_> = internal_lints
.map(|l| (false, l))
.chain(usable_lints.map(|l| (true, l)))
.filter(|(_, l)| l.version.as_ref().map_or(false, |v| v == "nightly"))
.map(|(p, l)| (p, &l.module, l.name.to_uppercase()))
.collect();
details.sort_unstable();

let mut output = GENERATED_FILE_COMMENT.to_string();
output.push_str("clippy_utils::nightly::set_nightly_lints([\n");
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/lib.nightly_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
clippy_utils::nightly::set_nightly_lints([
#[cfg(feature = "internal")]
LintId::of(utils::internal_lints::FOREVER_NIGHTLY_LINT),
LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR),
LintId::of(borrow_as_ptr::BORROW_AS_PTR),
LintId::of(manual_bits::MANUAL_BITS),
LintId::of(default_union_representation::DEFAULT_UNION_REPRESENTATION),
LintId::of(manual_bits::MANUAL_BITS),
LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR),
])
1 change: 1 addition & 0 deletions clippy_utils/src/nightly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub fn is_nightly_lint(lint: &'static Lint) -> bool {

/// This function checks if the given lint is a nightly lint and should be suppressed in the current
/// context.
#[inline]
pub fn suppress_lint<T: LintLevelProvider>(cx: &T, lint: &'static Lint) -> bool {
if !is_nightly_run() && is_nightly_lint(lint) {
let (_, level_src) = cx.get_lint_level(lint);
Expand Down

0 comments on commit 0c7e481

Please sign in to comment.