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"
server = "run --bin veloren-server-cli"
[env]
RUSTC_FORCE_INCREMENTAL = "1"

4
Cargo.lock generated
View File

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

View File

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

View File

@ -12,7 +12,7 @@ use vek::*;
/// streams though). It's used to verify the correctness of the state in
/// debug_assertions
#[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 {
///Send on the first connection ONCE to identify client intention for
/// server

View File

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

View File

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

View File

@ -607,6 +607,7 @@ impl Inventory {
/// Unequip an item from slot and place into inventory. Will leave the item
/// equipped if inventory has no slots available.
#[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> {
// Ensure there is enough space in the inventory to place the unequipped item
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
.swap(bag1_slot, Some(bag.duplicate(ability_map, msm)));
inv.insert_at(InvSlotId::new(15, 0), bag)
.unwrap()
.unwrap_none();
assert!(inv.insert_at(InvSlotId::new(15, 0), bag).unwrap().is_none());
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)),
);
inv.insert_at(InvSlotId::new(16, 0), bag)
.unwrap()
.unwrap_none();
assert!(inv.insert_at(InvSlotId::new(16, 0), bag).unwrap().is_none());
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
assert_eq!(None, inv.equipped(EquipSlot::ActiveMainhand));
assert_eq!(18, inv.populated_slots());
assert_eq!(true, result.is_ok());
assert!(result.is_ok());
let result = inv.unequip(EquipSlot::InactiveMainhand).unwrap_err();
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 large_bag = Item::new_from_asset_expect(LARGE_BAG_ID);
assert!(
inv.loadout
.swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(large_bag))
.unwrap_none();
.is_none()
);
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 bag = get_test_bag(9);
assert!(
inv.loadout
.swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag))
.unwrap_none();
.is_none()
);
// Fill all inventory built-in slots
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 bag = get_test_bag(9);
assert!(
inv.loadout
.swap(
EquipSlot::Armor(ArmorSlot::Bag1),
Some(bag.duplicate(ability_map, msm)),
)
.unwrap_none();
.is_none()
);
inv.push(bag).unwrap();
@ -364,9 +366,11 @@ fn free_after_swap_equipped_item_has_more_slots() {
let mut inv = Inventory::new_empty();
let bag = get_test_bag(18);
assert!(
inv.loadout
.swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag))
.unwrap_none();
.is_none()
);
let small_bag = get_test_bag(9);
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 bag = get_test_bag(9);
assert!(
inv.loadout
.swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag))
.unwrap_none();
.is_none()
);
let small_bag = get_test_bag(18);
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 bag = get_test_bag(9);
assert!(
inv.loadout
.swap(EquipSlot::Armor(ArmorSlot::Bag1), Some(bag))
.unwrap_none();
.is_none()
);
// Add 5 items to the inventory
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.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));
@ -705,7 +705,7 @@ mod tests {
assert_eq!(skillset.skill_groups[1].available_sp, 0);
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
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 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,
iter_map_while,
label_break_value,
option_expect_none,
option_unwrap_none,
option_zip,
or_patterns,
trait_alias,

View File

@ -91,7 +91,7 @@ pub struct TerrainChunkMeta {
contains_dungeon: bool,
}
#[allow(clippy::clippy::too_many_arguments)]
#[allow(clippy::too_many_arguments)]
impl TerrainChunkMeta {
pub fn new(
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)]
mod aura;

View File

@ -112,7 +112,7 @@ impl Pid {
}
#[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 {
@ -128,7 +128,7 @@ impl Sid {
}
#[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 {

View File

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

View File

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

View File

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

View File

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

View File

@ -31,7 +31,7 @@ tracing = { version = "0.1", default-features = false }
rand = "0.8"
rand_chacha = "0.3"
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"
serde = { version = "1.0.110", features = ["derive"] }
ron = { version = "0.6", default-features = false }

View File

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

View File

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

View File

@ -581,12 +581,12 @@ pub struct HybridMulti {
impl HybridMulti {
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_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
// 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 MAX_OCTAVES: usize = 32;