]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix rustc nightly compiler error.
authorMatt Corallo <git@bluematt.me>
Sun, 19 Jan 2020 05:49:18 +0000 (00:49 -0500)
committerMatt Corallo <git@bluematt.me>
Mon, 3 Feb 2020 02:38:53 +0000 (21:38 -0500)
This works around a regression in nightly rustc that prevents type
inference from working properly.

lightning/src/ln/router.rs

index 592e3cdb3e902ced6b5cb4c12070b6511791bd6e..14ec26c3646aeaef6ec4dd504f60bc01695fea7a 100644 (file)
@@ -1539,7 +1539,7 @@ mod tests {
                        assert_eq!(route.paths[0][0].fee_msat, 200);
                        assert_eq!(route.paths[0][0].cltv_expiry_delta, (13 << 8) | 1);
                        assert_eq!(route.paths[0][0].node_features.le_flags(), &vec![0b11]); // it should also override our view of their features
-                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::new()); // No feature flags will meet the relevant-to-channel conversion
+                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::<u8>::new()); // No feature flags will meet the relevant-to-channel conversion
 
                        assert_eq!(route.paths[0][1].pubkey, node3);
                        assert_eq!(route.paths[0][1].short_channel_id, 13);
@@ -1588,7 +1588,7 @@ mod tests {
                        assert_eq!(route.paths[0][0].fee_msat, 200);
                        assert_eq!(route.paths[0][0].cltv_expiry_delta, (13 << 8) | 1);
                        assert_eq!(route.paths[0][0].node_features.le_flags(), &vec![0b11]); // it should also override our view of their features
-                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::new()); // No feature flags will meet the relevant-to-channel conversion
+                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::<u8>::new()); // No feature flags will meet the relevant-to-channel conversion
 
                        assert_eq!(route.paths[0][1].pubkey, node3);
                        assert_eq!(route.paths[0][1].short_channel_id, 13);
@@ -1655,7 +1655,7 @@ mod tests {
                        assert_eq!(route.paths[0][0].fee_msat, 200);
                        assert_eq!(route.paths[0][0].cltv_expiry_delta, (13 << 8) | 1);
                        assert_eq!(route.paths[0][0].node_features.le_flags(), &vec![0b11]);
-                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::new()); // No feature flags will meet the relevant-to-channel conversion
+                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::<u8>::new()); // No feature flags will meet the relevant-to-channel conversion
 
                        assert_eq!(route.paths[0][1].pubkey, node3);
                        assert_eq!(route.paths[0][1].short_channel_id, 13);
@@ -1726,8 +1726,8 @@ mod tests {
                        assert_eq!(route.paths[0][4].short_channel_id, 8);
                        assert_eq!(route.paths[0][4].fee_msat, 100);
                        assert_eq!(route.paths[0][4].cltv_expiry_delta, 42);
-                       assert_eq!(route.paths[0][4].node_features.le_flags(), &Vec::new()); // We dont pass flags in from invoices yet
-                       assert_eq!(route.paths[0][4].channel_features.le_flags(), &Vec::new()); // We can't learn any flags from invoices, sadly
+                       assert_eq!(route.paths[0][4].node_features.le_flags(), &Vec::<u8>::new()); // We dont pass flags in from invoices yet
+                       assert_eq!(route.paths[0][4].channel_features.le_flags(), &Vec::<u8>::new()); // We can't learn any flags from invoices, sadly
                }
 
                { // Simple test with outbound channel to 4 to test that last_hops and first_hops connect
@@ -1750,14 +1750,14 @@ mod tests {
                        assert_eq!(route.paths[0][0].fee_msat, 0);
                        assert_eq!(route.paths[0][0].cltv_expiry_delta, (8 << 8) | 1);
                        assert_eq!(route.paths[0][0].node_features.le_flags(), &vec![0b11]);
-                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::new()); // No feature flags will meet the relevant-to-channel conversion
+                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::<u8>::new()); // No feature flags will meet the relevant-to-channel conversion
 
                        assert_eq!(route.paths[0][1].pubkey, node7);
                        assert_eq!(route.paths[0][1].short_channel_id, 8);
                        assert_eq!(route.paths[0][1].fee_msat, 100);
                        assert_eq!(route.paths[0][1].cltv_expiry_delta, 42);
-                       assert_eq!(route.paths[0][1].node_features.le_flags(), &Vec::new()); // We dont pass flags in from invoices yet
-                       assert_eq!(route.paths[0][1].channel_features.le_flags(), &Vec::new()); // We can't learn any flags from invoices, sadly
+                       assert_eq!(route.paths[0][1].node_features.le_flags(), &Vec::<u8>::new()); // We dont pass flags in from invoices yet
+                       assert_eq!(route.paths[0][1].channel_features.le_flags(), &Vec::<u8>::new()); // We can't learn any flags from invoices, sadly
                }
 
                last_hops[0].fee_base_msat = 1000;
@@ -1793,8 +1793,8 @@ mod tests {
                        assert_eq!(route.paths[0][3].short_channel_id, 10);
                        assert_eq!(route.paths[0][3].fee_msat, 100);
                        assert_eq!(route.paths[0][3].cltv_expiry_delta, 42);
-                       assert_eq!(route.paths[0][3].node_features.le_flags(), &Vec::new()); // We dont pass flags in from invoices yet
-                       assert_eq!(route.paths[0][3].channel_features.le_flags(), &Vec::new()); // We can't learn any flags from invoices, sadly
+                       assert_eq!(route.paths[0][3].node_features.le_flags(), &Vec::<u8>::new()); // We dont pass flags in from invoices yet
+                       assert_eq!(route.paths[0][3].channel_features.le_flags(), &Vec::<u8>::new()); // We can't learn any flags from invoices, sadly
                }
 
                { // ...but still use 8 for larger payments as 6 has a variable feerate
@@ -1835,8 +1835,8 @@ mod tests {
                        assert_eq!(route.paths[0][4].short_channel_id, 8);
                        assert_eq!(route.paths[0][4].fee_msat, 2000);
                        assert_eq!(route.paths[0][4].cltv_expiry_delta, 42);
-                       assert_eq!(route.paths[0][4].node_features.le_flags(), &Vec::new()); // We dont pass flags in from invoices yet
-                       assert_eq!(route.paths[0][4].channel_features.le_flags(), &Vec::new()); // We can't learn any flags from invoices, sadly
+                       assert_eq!(route.paths[0][4].node_features.le_flags(), &Vec::<u8>::new()); // We dont pass flags in from invoices yet
+                       assert_eq!(route.paths[0][4].channel_features.le_flags(), &Vec::<u8>::new()); // We can't learn any flags from invoices, sadly
                }
 
                { // Test Router serialization/deserialization