You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't narrow this down to anything in particular; the only way to make the warning go away is to make the bridge mod empty. It's also not related to the (namespace = …) thing, because removing it doesn't make the warning go away.
The warning advises to "run with -Z macro-backtrace for more info", but doing so makes the warning go away (I tried both cargo +nightly … and rustup override set nightly).
The result of macro expansion:
$ cargo +nightly rustc --package libnewsboat-ffi --profile=check -- -Zunstable-options --pretty=expanded
#![feature(prelude_import)]// Each function in this crate is used in a single place: a corresponding C++ wrapper. It doesn't// make sense to document these functions because they are basically an internal detail and don't// stand on their own.#![allow(clippy :: missing_safety_doc)]// This lint is nitpicky, I don't think it's really important how the literals are written.#![allow(clippy :: unreadable_literal)]#[prelude_import]use std::prelude::rust_2018::*;#[macro_use]externcrate std;use libc::c_char;use std::ffi::CString;use std::panic::{catch_unwind,UnwindSafe};use std::process::abort;// SNIP: some unrelated modulespubmod logger {use libnewsboat::logger;#[deny(improper_ctypes, improper_ctypes_definitions)]#[allow(non_camel_case_types, non_snake_case, clippy :: upper_case_acronyms)]mod ffi {#[repr(transparent)]pubstructLevel{#[allow(missing_docs)]pubrepr:u8,}impl::core::marker::StructuralEqforLevel{}#[automatically_derived]#[allow(unused_qualifications)]impl::core::cmp::EqforLevel{#[inline]#[doc(hidden)]fnassert_receiver_is_total_eq(&self) -> (){{let _:::core::cmp::AssertParamIsEq<u8>;}}}impl::core::marker::StructuralPartialEqforLevel{}#[automatically_derived]#[allow(unused_qualifications)]impl::core::cmp::PartialEqforLevel{#[inline]fneq(&self,other:&Level) -> bool{match*other {Level{repr:ref __self_1_0 } =>
match*self{Level{repr:ref __self_0_0 } =>
(*__self_0_0) == (*__self_1_0),},}}#[inline]fnne(&self,other:&Level) -> bool{match*other {Level{repr:ref __self_1_0 } =>
match*self{Level{repr:ref __self_0_0 } =>
(*__self_0_0) != (*__self_1_0),},}}}#[allow(non_upper_case_globals)]implLevel{pubconstUSERERROR:Self = Level{repr:1,};pubconstCRITICAL:Self = Level{repr:2,};pubconstERROR:Self = Level{repr:3,};pubconstWARN:Self = Level{repr:4,};pubconstINFO:Self = Level{repr:5,};pubconstDEBUG:Self = Level{repr:6,};}unsafeimpl::cxx::ExternTypeforLevel{#[doc(hidden)]typeId =
(::cxx::n,::cxx::e,::cxx::w,::cxx::s,::cxx::b,::cxx::o,::cxx::a,::cxx::t,(),::cxx::L,::cxx::o,::cxx::g,::cxx::g,::cxx::e,::cxx::r,(),::cxx::L,::cxx::e,::cxx::v,::cxx::e,::cxx::l);typeKind = ::cxx::kind::Trivial;}impl::std::marker::CopyforLevel{}impl::std::clone::CloneforLevel{fnclone(&self) -> Self{*self}}#[doc(hidden)]const _:() =
{#[doc(hidden)]#[export_name = "newsboat$Logger$cxxbridge1$unset_loglevel"]unsafeextern"C"fn__unset_loglevel(){let __fn = "newsboat::logger::ffi::unset_loglevel";fn__unset_loglevel(){super::unset_loglevel()}::cxx::private::catch_unwind(__fn,move || __unset_loglevel())}#[doc(hidden)]#[export_name = "newsboat$Logger$cxxbridge1$set_logfile"]unsafeextern"C"fn__set_logfile(logfile:::cxx::private::RustStr){let __fn = "newsboat::logger::ffi::set_logfile";fn__set_logfile(logfile:&str){super::set_logfile(logfile)}::cxx::private::catch_unwind(__fn,move ||
__set_logfile(logfile.as_str()))}#[doc(hidden)]#[export_name = "newsboat$Logger$cxxbridge1$get_loglevel"]unsafeextern"C"fn__get_loglevel() -> i64{let __fn = "newsboat::logger::ffi::get_loglevel";fn__get_loglevel() -> i64{super::get_loglevel()}::cxx::private::catch_unwind(__fn,move || __get_loglevel())}#[doc(hidden)]#[export_name = "newsboat$Logger$cxxbridge1$set_loglevel"]unsafeextern"C"fn__set_loglevel(level:Level){let __fn = "newsboat::logger::ffi::set_loglevel";fn__set_loglevel(level:Level){super::set_loglevel(level)}::cxx::private::catch_unwind(__fn,move ||
__set_loglevel(level))}#[doc(hidden)]#[export_name = "newsboat$Logger$cxxbridge1$log_internal"]unsafeextern"C"fn__log_internal(level:Level,message:::cxx::private::RustStr){let __fn = "newsboat::logger::ffi::log_internal";fn__log_internal(level:Level,message:&str){super::log_internal(level, message)}::cxx::private::catch_unwind(__fn,move ||
__log_internal(level,
message.as_str()))}#[doc(hidden)]#[export_name ="newsboat$Logger$cxxbridge1$set_user_error_logfile"]unsafeextern"C"fn__set_user_error_logfile(user_error_logfile:::cxx::private::RustStr){let __fn =
"newsboat::logger::ffi::set_user_error_logfile";fn__set_user_error_logfile(user_error_logfile:&str){super::set_user_error_logfile(user_error_logfile)}::cxx::private::catch_unwind(__fn,move ||
__set_user_error_logfile(user_error_logfile.as_str()))}};}fnffi_level_to_log_level(level: ffi::Level) -> logger::Level{match level {
ffi::Level::USERERROR => logger::Level::UserError,
ffi::Level::CRITICAL => logger::Level::Critical,
ffi::Level::ERROR => logger::Level::Error,
ffi::Level::WARN => logger::Level::Warn,
ffi::Level::INFO => logger::Level::Info,
ffi::Level::DEBUG => logger::Level::Debug,
_ => {::std::rt::begin_panic("Unknown log level")}}}fnunset_loglevel(){ logger::get_instance().unset_loglevel();}fnset_logfile(logfile:&str){
logger::get_instance().set_logfile(logfile);}fnget_loglevel() -> i64{ logger::get_instance().get_loglevel()asi64}fnset_loglevel(level: ffi::Level){let level = ffi_level_to_log_level(level);
logger::get_instance().set_loglevel(level);}fnlog_internal(level: ffi::Level,message:&str){let level = ffi_level_to_log_level(level);
logger::get_instance().log(level, message);}fnset_user_error_logfile(user_error_logfile:&str){
logger::get_instance().set_user_error_logfile(user_error_logfile);}}// SNIP: a few more modules
The only closures that I can see are the ones passed to ::cxx::private::catch_unwind, but these were present even in 1.0.41 (which didn't produce the warning).
I'm okay with suppressing this warning on my end, but I thought I'd let you know about this and see if you have some insights.
Hi! Starting with cxx 1.0.43, I'm getting this Clippy warning for my project (Rust 1.48 and Rust 1.51):
I couldn't narrow this down to anything in particular; the only way to make the warning go away is to make the bridge mod empty. It's also not related to the
(namespace = …)
thing, because removing it doesn't make the warning go away.The warning advises to "run with -Z macro-backtrace for more info", but doing so makes the warning go away (I tried both
cargo +nightly …
andrustup override set nightly
).The result of macro expansion:
The only closures that I can see are the ones passed to
::cxx::private::catch_unwind
, but these were present even in 1.0.41 (which didn't produce the warning).I'm okay with suppressing this warning on my end, but I thought I'd let you know about this and see if you have some insights.
If you'd like to experiment locally:
cargo clippy
(my CI adds-D warnings
and more flags, but none of it is required to get the warning)The text was updated successfully, but these errors were encountered: