These are chat archives for rust-lang/rust

14th
Feb 2018
Katharina
@spacekookie
Feb 14 2018 01:29
Is there any timeline on making feature(box_syntax) stable?
Maik Klein
@MaikKlein
Feb 14 2018 12:12
Does anyone use vim and knows why the indention is incorrect? https://i.imgur.com/dr65Ofp.gif
Daniel Bischof
@dbischof90
Feb 14 2018 12:13
T
Oups. Damn mobile
Sorry, no idea, just watched the gif. :D
Maik Klein
@MaikKlein
Feb 14 2018 12:14
:D no problem
Daniel Bischof
@dbischof90
Feb 14 2018 12:14
But I have the same problem from time to time
Using vim too
Maik Klein
@MaikKlein
Feb 14 2018 12:14
It drives me crazy, probably is related to the vim plugin.
Daniel Bischof
@dbischof90
Feb 14 2018 12:15
Probably somewhere counting closures wrongly
apiraino
@apiraino
Feb 14 2018 12:19
Hi, I just wanted to share my 5 minutes of miserable frustration when I discovered this:
then I ended up here and understood everything (I think)
Joonas Koivunen
@koivunej
Feb 14 2018 14:08
@MaikKlein i am using some quite old version of rust syntax for vim (using nvim actually) and I've found it to always work reliably; if there's bad indentation it means i've left some parens open, like I always do with pattern matching :) that probably was not the case for you?
Maik Klein
@MaikKlein
Feb 14 2018 15:12
No unclosed delimiters, I even formatted with rustfmt at the end
Nicolas Almy
@almynic
Feb 14 2018 16:43
hi i updated rust on windows 10 with rustup and now i get this error if I run a rust program: error: linking with link.exe failed: exit code: 1
Error 3: Cannot Create File :C:\Users\Nicolas.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\liballoc.natvis
Does anyone know the cause of this ?
Steve Klabnik
@steveklabnik
Feb 14 2018 16:44
:C:\Users\Nicolas.rustup
this looks suspicious
i'm assuming your username is Nicolas not Nicolas.rustup?
Nicolas Almy
@almynic
Feb 14 2018 16:44
yes
Steve Klabnik
@steveklabnik
Feb 14 2018 16:44
so, that is very odd
and i'd imagine where the bug is
are you using the latest rustup?
rustup --version should say 1.10
Nicolas Almy
@almynic
Feb 14 2018 16:46
i use version 1.11
Steve Klabnik
@steveklabnik
Feb 14 2018 16:46
... i did not know a 1.11 is out
... now you have me scared to update, hehe
steveklabnik @steveklabnik tries it
steveklabnik @steveklabnik also uses MSVC on Windows 10
Nicolas Almy
@almynic
Feb 14 2018 16:47
path is correct C:\Users\Nicolas\ .rustup\toolchains\stable-x86_64-pc-windows-msvc\
Steve Klabnik
@steveklabnik
Feb 14 2018 16:47
oh, there is a \ in there?
Nicolas Almy
@almynic
Feb 14 2018 16:47
yes
Steve Klabnik
@steveklabnik
Feb 14 2018 16:47
okay
i do have that file on my system
so
:/
Nicolas Almy
@almynic
Feb 14 2018 16:49
somehow the library file seems to be missing...
i will try to uninstall everthing and install it fresh
Steve Klabnik
@steveklabnik
Feb 14 2018 16:50
good luck
Nicolas Almy
@almynic
Feb 14 2018 16:50
thanks
Nicolas Almy
@almynic
Feb 14 2018 17:13
needed to reinstall the msvc build tools now it works ...
Dylan DPC
@Dylan-DPC
Feb 14 2018 20:47
Is there no function to check if an array is empty? Any reason?
Steve Klabnik
@steveklabnik
Feb 14 2018 20:47
well
arrays are only empty if they have nothing in them
which isn't very useful
that said
David Harvey-Macaulay
@alteous
Feb 14 2018 20:48
@Dylan-DPC size_of_val?
Steve Klabnik
@steveklabnik
Feb 14 2018 20:48
is_empty does work on an array
Dylan DPC
@Dylan-DPC
Feb 14 2018 20:48
ah okay.well it is useful since i hit an API and get back empty data
Steve Klabnik
@steveklabnik
Feb 14 2018 20:49
do you maybe mean vectors, not arrays?
is_empty works there too
Dylan DPC
@Dylan-DPC
Feb 14 2018 20:50
no i'm getting back an empty array. Will try with is_empty. Thanks :smile:
Michal 'vorner' Vaner
@vorner
Feb 14 2018 20:54
@Dylan-DPC I think you may be confusing arrays with something else. The only way an array may be empty if the type is [T; 0] ‒ arrays are fixed sized. It makes sense to check if something is empty if it may or may not be. Things that may be empty are vectors ‒ Vec<T> (arrays that can grow and shrink at runtime) or slices [T] (which is a borrowed part of an array or vector or something similar).
Dylan DPC
@Dylan-DPC
Feb 14 2018 20:54
yes actually i am. The output is a serde_json::Value and I thought it was an array for some reason :laughing:
David Harvey-Macaulay
@alteous
Feb 14 2018 20:55
I need repr(align) and repr(packed) together. :(