These are chat archives for rust-lang/rust

21st
May 2018
Bryan Burgers
@bryanburgers
May 21 2018 01:38
[u8; 256]?
Björn Lindström
@bkhl
May 21 2018 04:14
I think he means using u8/u16 for the index, not the values, which I don't think is possible with built-in arrays.
But should be safe to use 'u8 as usize' or 'u16 as usize' for your lookups.
Matthias Berndt
@mberndt123
May 21 2018 07:03
why not build your own abstraction using unsafe? That's what it's for, building abstractions that you can then use in safe code.
Rafael Villar Burke (Pachi)
@pachi
May 21 2018 11:16
thanks a lot @vorner for your new constructive messages on the try discussion.
Michal 'vorner' Vaner
@vorner
May 21 2018 11:19
I generally try to be constructive. It doesn't always end up as constructive as expected, though.
Chaitanya Munukutla
@munukutla
May 21 2018 11:19
Anyone tried Xi editor?
It has a Rust core with frontends written in native languages for respective platforms.
Do Duy
@juchiast
May 21 2018 17:08
Does anyone having problem with docs.rs like me? I cannot type the 's' character in the search form.
Jesper Håkansson
@drager
May 21 2018 17:12
Works fine for me. Which browser?
Do Duy
@juchiast
May 21 2018 17:14
I'm using firefox 60
Jesper Håkansson
@drager
May 21 2018 17:15
I see, I have 59. There's no addon intefering?
Ryan
@rnleach
May 21 2018 17:17
@juchiast I'm using firefox 60.0.1 on mac and it works fine.
I'm having problems with it compiling things that rely on rustc 1.26 -stable. Any idea when that will be updated?
Do Duy
@juchiast
May 21 2018 17:19
@drager yes, no addon. @rnleach I'm using Fedora.
It's broken on chrome, too.
I think this has something to do with gnome
Jesper Håkansson
@drager
May 21 2018 17:20
Maybe Fedora is broken :wink:
Do Duy
@juchiast
May 21 2018 17:20
yeah, F28 is unstable than usual
Jesper Håkansson
@drager
May 21 2018 17:21
Does gnome happen to use the s key for something?
Ryan
@rnleach
May 21 2018 17:21
@juchiast I jumped into Ubuntu 18.04 with the same version of firefox and it worked OK there.
Jesper Håkansson
@drager
May 21 2018 17:22
Which is gnome now right? So maybe its a Fedora issue
Do Duy
@juchiast
May 21 2018 17:24
yeah, maybe
but it only happen on docs.rs . Local documentation using rustup doc is fine, no bug.
this is weird
I've just checked https://doc.rust-lang.org/std/, no bug here
Denis Lisov
@tanriol
May 21 2018 17:26
@juchiast For any package?
Do Duy
@juchiast
May 21 2018 17:26
so it only happen in docs.rs, @tanriol yes
Jesper Håkansson
@drager
May 21 2018 17:27
Ok, now I got it too :D
Do Duy
@juchiast
May 21 2018 17:27
:D
Denis Lisov
@tanriol
May 21 2018 17:29
How about this page?
Do Duy
@juchiast
May 21 2018 17:29
@tanriol no bug on this page
Denis Lisov
@tanriol
May 21 2018 17:34
Ok, this seems to be rust-lang/rust#49075 causing onur/docs.rs#190 (so broken for releases since March)
I'd expect the next rustc update on docs.rs, probably in onur/docs.rs#207, to fix this.
Do Duy
@juchiast
May 21 2018 17:40
thanks!! :D
Damien Castelltort
@dcastelltort
May 21 2018 20:51

hi,
I’m attempting something like this:

let format_str = match target {
                        &Target::Shell => "export {}{}{}={}",
                        &Target::Salt => "salt '*' environ.setval {}{}{} {}",
                    };
                    let new_decl = format!(
                            format_str,
                            pref,
                            separator,
                            k,
                            val
                        );

And I get the following error:

error: format argument must be a string literal.
   --> src/main.rs:125:29
    |
125 |                             format_str,
    |                             ^^^^^^^^^^

error: aborting due to previous error
because format! is a macro and needs a litteral as told. What could I use instead of format! in such case ?
Andrey Lesnikov
@ozkriff
May 21 2018 20:52
format! works only with string literals at compile-time
Damien Castelltort
@dcastelltort
May 21 2018 20:56
ok, I see, can’t work around the macro which is resolved at compile time, no runtime equivalent available I guess.
Thanks :)
Andrey Lesnikov
@ozkriff
May 21 2018 20:57
You can use https://crates.io/crates/runtime-fmt crate if you really want runtime fmt (note that it requires nightly)
Damien Castelltort
@dcastelltort
May 21 2018 21:03
I won’t in such case, but good to know the alternative exists, I will have a look into it, out of curiosity on how it’s done :) tx
Judson Lester
@nyarly
May 21 2018 21:05
Surely there's a better way to phrase
    |      ^^^^^ expected type parameter, found a different type parameter
    |
    = note: expected type `<impl Future as futures::Future>::Error` (type parameter)
               found type `<impl Future as futures::Future>::Error` (type parameter)
Sean Perry
@shaleh
May 21 2018 22:30
``error: custom attribute panicked --> src/base64.rs:341:1 | 341 | #[lisp_fn(min = "1")] | ^^^^^^^^^^^^^^^^^^^^^ | = help: message: Invalid lisp_fn attribute: Unexpected literal typestring````
We are seeing issues with out proc macros in recent (last 45 days or so) nightly
I am having troubles tracking the cause down through Google
That was working code using February era nightly.