]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix trailing semicolon warnings on latest rustc nightly 2021-08-nightly-warnings
authorMatt Corallo <git@bluematt.me>
Wed, 18 Aug 2021 00:33:56 +0000 (00:33 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 18 Aug 2021 00:34:13 +0000 (00:34 +0000)
Latest rustc nightly compiles are filled with warnings like the
following, which we fix here:

```
warning: trailing semicolon in macro used in expression position
   --> lightning/src/util/macro_logger.rs:163:114
    |
163 |         $logger.log(&$crate::util::logger::Record::new($lvl, format_args!($($arg)+), module_path!(), file!(), line!()));
    |                                                                                                                        ^
    |
   ::: lightning/src/chain/chainmonitor.rs:165:9
    |
165 |         log_debug!(self.logger, "New best block {} at height {} provided via block_connected", header.block_hash(), height);
    |         -------------------------------------------------------------------------------------------------------------------- in this macro invocation
    |
    = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
    = note: this warning originates in the macro `log_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
```

lightning/src/ln/functional_tests.rs
lightning/src/ln/peer_handler.rs
lightning/src/util/macro_logger.rs

index 980c6ea40f1f0e812d99fbeca432421cf9cc5744..1328939570eb9204b31153597841fbda151f2ef3 100644 (file)
@@ -4048,7 +4048,7 @@ fn test_invalid_channel_announcement() {
                                bitcoin_key_1: if were_node_one { as_bitcoin_key } else { bs_bitcoin_key },
                                bitcoin_key_2: if were_node_one { bs_bitcoin_key } else { as_bitcoin_key },
                                excess_data: Vec::new(),
-                       };
+                       }
                }
        }
 
index 234b509564dc2b7440eb4d1f0fd1028cf995d0a6..8ca7532aef930a4a8cf5df4d86abf311c84ef344 100644 (file)
@@ -739,7 +739,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref> PeerManager<D
                                                                                                },
                                                                                        }
                                                                                }
-                                                                       };
+                                                                       }
                                                                }
                                                        }
 
index 3ac294fbff9097686d4d28df669bcab76c402f5e..9644411bc147310b51a506e9a6634adcdb98bfc3 100644 (file)
@@ -160,7 +160,7 @@ macro_rules! log_spendable {
 #[macro_export]
 macro_rules! log_internal {
        ($logger: expr, $lvl:expr, $($arg:tt)+) => (
-               $logger.log(&$crate::util::logger::Record::new($lvl, format_args!($($arg)+), module_path!(), file!(), line!()));
+               $logger.log(&$crate::util::logger::Record::new($lvl, format_args!($($arg)+), module_path!(), file!(), line!()))
        );
 }