Update toolchain

This commit is contained in:
Imbris 2021-05-16 04:03:09 -04:00
parent 9637d874ab
commit 48ebb10d50
24 changed files with 83 additions and 84 deletions

View File

@ -13,3 +13,5 @@ test-voxygen = "run --bin veloren-voxygen --no-default-features --features gl,si
tracy-voxygen = "-Zunstable-options run --bin veloren-voxygen --no-default-features --features tracy,gl,simd --profile no_overflow" tracy-voxygen = "-Zunstable-options run --bin veloren-voxygen --no-default-features --features tracy,gl,simd --profile no_overflow"
server = "run --bin veloren-server-cli" server = "run --bin veloren-server-cli"
[env]
RUSTC_FORCE_INCREMENTAL = "1"

4
Cargo.lock generated
View File

@ -3562,9 +3562,9 @@ dependencies = [
[[package]] [[package]]
name = "packed_simd_2" name = "packed_simd_2"
version = "0.3.4" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3278e0492f961fd4ae70909f56b2723a7e8d01a228427294e19cdfdebda89a17" checksum = "0e64858a2d3733fdd61adfdd6da89aa202f7ff0e741d2fc7ed1e452ba9dc99d7"
dependencies = [ dependencies = [
"cfg-if 0.1.10", "cfg-if 0.1.10",
"libm 0.1.4", "libm 0.1.4",

View File

@ -34,8 +34,7 @@ panic = "abort"
debug = false debug = false
codegen-units = 8 codegen-units = 8
lto = false lto = false
# TEMP false to avoid fingerprints bug incremental = true
incremental = false
# All dependencies (but not this crate itself) # All dependencies (but not this crate itself)
[profile.dev.package."*"] [profile.dev.package."*"]
opt-level = 3 opt-level = 3
@ -52,7 +51,6 @@ opt-level = 2
[profile.dev.package."veloren-server-cli"] [profile.dev.package."veloren-server-cli"]
opt-level = 2 opt-level = 2
[profile.dev.package."veloren-voxygen"] [profile.dev.package."veloren-voxygen"]
incremental = true
opt-level = 2 opt-level = 2
[profile.dev.package."veloren-world"] [profile.dev.package."veloren-world"]
opt-level = 2 opt-level = 2

View File

@ -12,7 +12,7 @@ use vek::*;
/// streams though). It's used to verify the correctness of the state in /// streams though). It's used to verify the correctness of the state in
/// debug_assertions /// debug_assertions
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
#[allow(clippy::clippy::large_enum_variant)] #[allow(clippy::large_enum_variant)] // TODO: this is used for pings so we should probably look into lowering enum size (doesn't effect bandwidth but could effect CPU costs)
pub enum ClientMsg { pub enum ClientMsg {
///Send on the first connection ONCE to identify client intention for ///Send on the first connection ONCE to identify client intention for
/// server /// server

View File

@ -49,7 +49,7 @@ pub struct ServerInfo {
/// Reponse To ClientType /// Reponse To ClientType
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[allow(clippy::clippy::large_enum_variant)] #[allow(clippy::large_enum_variant)]
pub enum ServerInit { pub enum ServerInit {
TooManyPlayers, TooManyPlayers,
GameSync { GameSync {

View File

@ -172,7 +172,7 @@ impl From<Body> for super::Body {
} }
impl Body { impl Body {
pub fn to_string(&self) -> &str { pub fn to_string(self) -> &'static str {
match self { match self {
Body::Arrow => "arrow", Body::Arrow => "arrow",
Body::Bomb => "bomb", Body::Bomb => "bomb",

View File

@ -607,6 +607,7 @@ impl Inventory {
/// Unequip an item from slot and place into inventory. Will leave the item /// Unequip an item from slot and place into inventory. Will leave the item
/// equipped if inventory has no slots available. /// equipped if inventory has no slots available.
#[must_use = "Returned items will be lost if not used"] #[must_use = "Returned items will be lost if not used"]
#[allow(clippy::needless_collect)] // This is a false positive, the collect is needed
pub fn unequip(&mut self, equip_slot: EquipSlot) -> Result<Option<Vec<Item>>, SlotError> { pub fn unequip(&mut self, equip_slot: EquipSlot) -> Result<Option<Vec<Item>>, SlotError> {
// Ensure there is enough space in the inventory to place the unequipped item // Ensure there is enough space in the inventory to place the unequipped item
if self.free_slots_minus_equipped_item(equip_slot) == 0 { if self.free_slots_minus_equipped_item(equip_slot) == 0 {

View File

@ -130,9 +130,7 @@ fn free_slots_minus_equipped_item_items_only_present_in_equipped_bag_slots() {
inv.loadout inv.loadout
.swap(bag1_slot, Some(bag.duplicate(ability_map, msm))); .swap(bag1_slot, Some(bag.duplicate(ability_map, msm)));
inv.insert_at(InvSlotId::new(15, 0), bag) assert!(inv.insert_at(InvSlotId::new(15, 0), bag).unwrap().is_none());
.unwrap()
.unwrap_none();
let result = inv.free_slots_minus_equipped_item(bag1_slot); let result = inv.free_slots_minus_equipped_item(bag1_slot);
@ -156,9 +154,7 @@ fn free_slots_minus_equipped_item() {
Some(bag.duplicate(ability_map, msm)), Some(bag.duplicate(ability_map, msm)),
); );
inv.insert_at(InvSlotId::new(16, 0), bag) assert!(inv.insert_at(InvSlotId::new(16, 0), bag).unwrap().is_none());
.unwrap()
.unwrap_none();
let result = inv.free_slots_minus_equipped_item(bag1_slot); let result = inv.free_slots_minus_equipped_item(bag1_slot);
@ -247,7 +243,7 @@ fn unequip_items_both_hands() {
// We have space in the inventory, so this should have unequipped // We have space in the inventory, so this should have unequipped
assert_eq!(None, inv.equipped(EquipSlot::ActiveMainhand)); assert_eq!(None, inv.equipped(EquipSlot::ActiveMainhand));
assert_eq!(18, inv.populated_slots()); assert_eq!(18, inv.populated_slots());
assert_eq!(true, result.is_ok()); assert!(result.is_ok());
let result = inv.unequip(EquipSlot::InactiveMainhand).unwrap_err(); let result = inv.unequip(EquipSlot::InactiveMainhand).unwrap_err();
assert_eq!(SlotError::InventoryFull, result); assert_eq!(SlotError::InventoryFull, result);
@ -303,9 +299,11 @@ fn equip_equipping_smaller_bag_from_last_slot_of_big_bag() {
let small_bag = get_test_bag(9); let small_bag = get_test_bag(9);
let large_bag = Item::new_from_asset_expect(LARGE_BAG_ID); let large_bag = Item::new_from_asset_expect(LARGE_BAG_ID);
assert!(
inv.loadout inv.loadout
.swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(large_bag)) .swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(large_bag))
.unwrap_none(); .is_none()
);
inv.insert_at(InvSlotId::new(15, 15), small_bag).unwrap(); inv.insert_at(InvSlotId::new(15, 15), small_bag).unwrap();
@ -326,9 +324,11 @@ fn unequip_unequipping_bag_into_its_own_slot_with_no_other_free_slots() {
let mut inv = Inventory::new_empty(); let mut inv = Inventory::new_empty();
let bag = get_test_bag(9); let bag = get_test_bag(9);
assert!(
inv.loadout inv.loadout
.swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag)) .swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag))
.unwrap_none(); .is_none()
);
// Fill all inventory built-in slots // Fill all inventory built-in slots
fill_inv_slots(&mut inv, 18); fill_inv_slots(&mut inv, 18);
@ -345,12 +345,14 @@ fn equip_one_bag_equipped_equip_second_bag() {
let mut inv = Inventory::new_empty(); let mut inv = Inventory::new_empty();
let bag = get_test_bag(9); let bag = get_test_bag(9);
assert!(
inv.loadout inv.loadout
.swap( .swap(
EquipSlot::Armor(ArmorSlot::Bag1), EquipSlot::Armor(ArmorSlot::Bag1),
Some(bag.duplicate(ability_map, msm)), Some(bag.duplicate(ability_map, msm)),
) )
.unwrap_none(); .is_none()
);
inv.push(bag).unwrap(); inv.push(bag).unwrap();
@ -364,9 +366,11 @@ fn free_after_swap_equipped_item_has_more_slots() {
let mut inv = Inventory::new_empty(); let mut inv = Inventory::new_empty();
let bag = get_test_bag(18); let bag = get_test_bag(18);
assert!(
inv.loadout inv.loadout
.swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag)) .swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag))
.unwrap_none(); .is_none()
);
let small_bag = get_test_bag(9); let small_bag = get_test_bag(9);
inv.push(small_bag).unwrap(); inv.push(small_bag).unwrap();
@ -385,9 +389,11 @@ fn free_after_swap_equipped_item_has_less_slots() {
let mut inv = Inventory::new_empty(); let mut inv = Inventory::new_empty();
let bag = get_test_bag(9); let bag = get_test_bag(9);
assert!(
inv.loadout inv.loadout
.swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag)) .swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag))
.unwrap_none(); .is_none()
);
let small_bag = get_test_bag(18); let small_bag = get_test_bag(18);
inv.push(small_bag).unwrap(); inv.push(small_bag).unwrap();
@ -406,9 +412,11 @@ fn free_after_swap_equipped_item_with_slots_swapped_with_empty_inv_slot() {
let mut inv = Inventory::new_empty(); let mut inv = Inventory::new_empty();
let bag = get_test_bag(9); let bag = get_test_bag(9);
assert!(
inv.loadout inv.loadout
.swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag)) .swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag))
.unwrap_none(); .is_none()
);
// Add 5 items to the inventory // Add 5 items to the inventory
fill_inv_slots(&mut inv, 5); fill_inv_slots(&mut inv, 5);

View File

@ -670,7 +670,7 @@ mod tests {
assert_eq!(skillset.skill_groups[1].available_sp, 0); assert_eq!(skillset.skill_groups[1].available_sp, 0);
assert_eq!(skillset.skills.len(), 1); assert_eq!(skillset.skills.len(), 1);
assert_eq!(skillset.has_skill(Skill::Axe(AxeSkill::UnlockLeap)), true); assert!(skillset.has_skill(Skill::Axe(AxeSkill::UnlockLeap)));
skillset.refund_skill(Skill::Axe(AxeSkill::UnlockLeap)); skillset.refund_skill(Skill::Axe(AxeSkill::UnlockLeap));
@ -705,7 +705,7 @@ mod tests {
assert_eq!(skillset.skill_groups[1].available_sp, 0); assert_eq!(skillset.skill_groups[1].available_sp, 0);
assert_eq!(skillset.skills.len(), 1); assert_eq!(skillset.skills.len(), 1);
assert_eq!(skillset.has_skill(Skill::Axe(AxeSkill::UnlockLeap)), true); assert!(skillset.has_skill(Skill::Axe(AxeSkill::UnlockLeap)));
// Try unlocking a skill without enough skill points // Try unlocking a skill without enough skill points
skillset.unlock_skill(Skill::Axe(AxeSkill::DsCombo)); skillset.unlock_skill(Skill::Axe(AxeSkill::DsCombo));

View File

@ -204,7 +204,7 @@ impl<E> EventBus<E> {
pub fn emit_now(&self, event: E) { self.queue.lock().unwrap().push_back(event); } pub fn emit_now(&self, event: E) { self.queue.lock().unwrap().push_back(event); }
pub fn recv_all(&self) -> impl ExactSizeIterator<Item = E> { pub fn recv_all(&self) -> impl ExactSizeIterator<Item = E> {
std::mem::replace(self.queue.lock().unwrap().deref_mut(), VecDeque::new()).into_iter() std::mem::take(self.queue.lock().unwrap().deref_mut()).into_iter()
} }
} }

View File

@ -11,8 +11,6 @@
fundamental, fundamental,
iter_map_while, iter_map_while,
label_break_value, label_break_value,
option_expect_none,
option_unwrap_none,
option_zip, option_zip,
or_patterns, or_patterns,
trait_alias, trait_alias,

View File

@ -91,7 +91,7 @@ pub struct TerrainChunkMeta {
contains_dungeon: bool, contains_dungeon: bool,
} }
#[allow(clippy::clippy::too_many_arguments)] #[allow(clippy::too_many_arguments)]
impl TerrainChunkMeta { impl TerrainChunkMeta {
pub fn new( pub fn new(
name: Option<String>, name: Option<String>,

View File

@ -1,4 +1,4 @@
#![feature(bool_to_option, option_unwrap_none, array_map)] #![feature(bool_to_option, array_map)]
#![allow(clippy::option_map_unit_fn)] #![allow(clippy::option_map_unit_fn)]
mod aura; mod aura;

View File

@ -112,7 +112,7 @@ impl Pid {
} }
#[inline] #[inline]
pub(crate) fn to_bytes(&self, bytes: &mut BytesMut) { bytes.put_u128_le(self.internal) } pub(crate) fn to_bytes(self, bytes: &mut BytesMut) { bytes.put_u128_le(self.internal) }
} }
impl Sid { impl Sid {
@ -128,7 +128,7 @@ impl Sid {
} }
#[inline] #[inline]
pub(crate) fn to_bytes(&self, bytes: &mut BytesMut) { bytes.put_u64_le(self.internal) } pub(crate) fn to_bytes(self, bytes: &mut BytesMut) { bytes.put_u64_le(self.internal) }
} }
impl std::fmt::Debug for Pid { impl std::fmt::Debug for Pid {

View File

@ -1159,10 +1159,11 @@ impl Drop for Participant {
impl Drop for Stream { impl Drop for Stream {
#[instrument(name="remote", skip(self), fields(p = %self.remote_pid))] #[instrument(name="remote", skip(self), fields(p = %self.remote_pid))]
#[instrument(name="network", skip(self), fields(p = %self.local_pid))] #[instrument(name="network", skip(self), fields(p = %self.local_pid))]
fn drop(&mut self) { fn drop(&mut self) {
// send if closed is unnecessary but doesn't hurt, we must not crash // send if closed is unnecessary but doesn't hurt, we must not crash
if !self.send_closed.load(Ordering::Relaxed) {
let sid = self.sid; let sid = self.sid;
if !self.send_closed.load(Ordering::Relaxed) {
debug!(?sid, "Shutting down Stream"); debug!(?sid, "Shutting down Stream");
if let Err(e) = self.a2b_close_stream_s.take().unwrap().send(self.sid) { if let Err(e) = self.a2b_close_stream_s.take().unwrap().send(self.sid) {
debug!( debug!(
@ -1171,7 +1172,6 @@ impl Drop for Stream {
); );
} }
} else { } else {
let sid = self.sid;
trace!(?sid, "Stream Drop not needed"); trace!(?sid, "Stream Drop not needed");
} }
} }

View File

@ -1 +1 @@
nightly-2021-03-22 nightly-2021-05-18

View File

@ -7,7 +7,6 @@
bool_to_option, bool_to_option,
drain_filter, drain_filter,
never_type, never_type,
option_unwrap_none,
option_zip, option_zip,
unwrap_infallible unwrap_infallible
)] )]

View File

@ -1,5 +1,4 @@
#![feature(const_generics)] #![feature(const_generics)]
#![feature(or_patterns)]
#![feature(generic_associated_types)] #![feature(generic_associated_types)]
#![allow(incomplete_features)] #![allow(incomplete_features)]
#[cfg(all(feature = "be-dyn-lib", feature = "use-dyn-lib"))] #[cfg(all(feature = "be-dyn-lib", feature = "use-dyn-lib"))]

View File

@ -2,14 +2,7 @@
#![allow(incomplete_features)] #![allow(incomplete_features)]
#![allow(clippy::option_map_unit_fn)] #![allow(clippy::option_map_unit_fn)]
#![deny(clippy::clone_on_ref_ptr)] #![deny(clippy::clone_on_ref_ptr)]
#![feature( #![feature(array_map, bool_to_option, const_generics, drain_filter, once_cell)]
array_map,
bool_to_option,
const_generics,
drain_filter,
once_cell,
or_patterns
)]
#![recursion_limit = "2048"] #![recursion_limit = "2048"]
#[macro_use] #[macro_use]

View File

@ -981,7 +981,8 @@ impl Window {
controls, controls,
&mut self.remapping_keybindings, &mut self.remapping_keybindings,
), ),
) { )
{
for game_input in game_inputs { for game_input in game_inputs {
self.events.push(Event::InputUpdate( self.events.push(Event::InputUpdate(
*game_input, *game_input,

View File

@ -31,7 +31,7 @@ tracing = { version = "0.1", default-features = false }
rand = "0.8" rand = "0.8"
rand_chacha = "0.3" rand_chacha = "0.3"
arr_macro = "0.1.2" arr_macro = "0.1.2"
packed_simd = { version = "0.3.4", package = "packed_simd_2" } packed_simd = { package = "packed_simd_2", version = "0.3.5" }
rayon = "1.5" rayon = "1.5"
serde = { version = "1.0.110", features = ["derive"] } serde = { version = "1.0.110", features = ["derive"] }
ron = { version = "0.6", default-features = false } ron = { version = "0.6", default-features = false }

View File

@ -12,7 +12,6 @@
const_generics, const_generics,
const_panic, const_panic,
label_break_value, label_break_value,
or_patterns,
array_map array_map
)] )]

View File

@ -116,17 +116,18 @@ pub(crate) struct GenCtx {
pub warp_nz: FastNoise, pub warp_nz: FastNoise,
pub tree_nz: BasicMulti, pub tree_nz: BasicMulti,
pub cave_0_nz: SuperSimplex, // TODO: unused, remove??? @zesterer
pub cave_1_nz: SuperSimplex, pub _cave_0_nz: SuperSimplex,
pub _cave_1_nz: SuperSimplex,
pub structure_gen: StructureGen2d, pub structure_gen: StructureGen2d,
pub big_structure_gen: StructureGen2d, pub _big_structure_gen: StructureGen2d,
pub region_gen: StructureGen2d, pub _region_gen: StructureGen2d,
pub fast_turb_x_nz: FastNoise, pub _fast_turb_x_nz: FastNoise,
pub fast_turb_y_nz: FastNoise, pub _fast_turb_y_nz: FastNoise,
pub town_gen: StructureGen2d, pub _town_gen: StructureGen2d,
pub river_seed: RandomField, pub river_seed: RandomField,
pub rock_strength_nz: Fbm, pub rock_strength_nz: Fbm,
pub uplift_nz: Worley, pub uplift_nz: Worley,
@ -521,22 +522,22 @@ impl WorldSim {
.set_octaves(12) .set_octaves(12)
.set_persistence(0.75) .set_persistence(0.75)
.set_seed(rng.gen()), .set_seed(rng.gen()),
cave_0_nz: SuperSimplex::new().set_seed(rng.gen()), _cave_0_nz: SuperSimplex::new().set_seed(rng.gen()),
cave_1_nz: SuperSimplex::new().set_seed(rng.gen()), _cave_1_nz: SuperSimplex::new().set_seed(rng.gen()),
structure_gen: StructureGen2d::new(rng.gen(), 24, 10), structure_gen: StructureGen2d::new(rng.gen(), 24, 10),
big_structure_gen: StructureGen2d::new(rng.gen(), 768, 512), _big_structure_gen: StructureGen2d::new(rng.gen(), 768, 512),
region_gen: StructureGen2d::new(rng.gen(), 400, 96), _region_gen: StructureGen2d::new(rng.gen(), 400, 96),
humid_nz: Billow::new() humid_nz: Billow::new()
.set_octaves(9) .set_octaves(9)
.set_persistence(0.4) .set_persistence(0.4)
.set_frequency(0.2) .set_frequency(0.2)
.set_seed(rng.gen()), .set_seed(rng.gen()),
fast_turb_x_nz: FastNoise::new(rng.gen()), _fast_turb_x_nz: FastNoise::new(rng.gen()),
fast_turb_y_nz: FastNoise::new(rng.gen()), _fast_turb_y_nz: FastNoise::new(rng.gen()),
town_gen: StructureGen2d::new(rng.gen(), 2048, 1024), _town_gen: StructureGen2d::new(rng.gen(), 2048, 1024),
river_seed: RandomField::new(rng.gen()), river_seed: RandomField::new(rng.gen()),
rock_strength_nz: Fbm::new() rock_strength_nz: Fbm::new()
.set_octaves(10) .set_octaves(10)

View File

@ -581,12 +581,12 @@ pub struct HybridMulti {
impl HybridMulti { impl HybridMulti {
pub const DEFAULT_FREQUENCY: f64 = 2.0; pub const DEFAULT_FREQUENCY: f64 = 2.0;
pub const DEFAULT_LACUNARITY: f64 = /* std::f64::consts::PI * 2.0 / 3.0 */2.0; pub const DEFAULT_LACUNARITY: f64 = /* std::f64::consts::PI * 2.0 / 3.0 */ 2.0;
pub const DEFAULT_OCTAVES: usize = 6; pub const DEFAULT_OCTAVES: usize = 6;
pub const DEFAULT_OFFSET: f64 = /* 0.25 *//* 0.5*/ 0.7; pub const DEFAULT_OFFSET: f64 = /* 0.25 *//* 0.5 */ 0.7;
// -ln(2^(-0.25))/ln(2) = 0.25 // -ln(2^(-0.25))/ln(2) = 0.25
// 2^(-0.25) ~ 13/16 // 2^(-0.25) ~ 13/16
pub const DEFAULT_PERSISTENCE: f64 = /* 0.25 *//* 0.5*/ 13.0 / 16.0; pub const DEFAULT_PERSISTENCE: f64 = /* 0.25 *//* 0.5 */ 13.0 / 16.0;
pub const DEFAULT_SEED: u32 = 0; pub const DEFAULT_SEED: u32 = 0;
pub const MAX_OCTAVES: usize = 32; pub const MAX_OCTAVES: usize = 32;