These are chat archives for rust-lang/rust

22nd
Jun 2018
Kelly Thomas Kline
@kellytk
Jun 22 2018 00:56
Could someone please recommend a tutorial or guide for adding LLVM-based cross-compilation support to macOS (host) for FreeBSD (target)?
Manuel Holtgrewe
@holtgrewe
Jun 22 2018 06:42

Hi, Rust 1.27.0 now gives me a lot of warnings such as

warning: lint unused_doc_comment has been renamed to unused_doc_comments
  --> cnvetti/src/main.rs:30:5
   |
30 |     error_chain!{}
   |     ^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

Is there anything that I can do about this?

Paul Masurel
@fulmicoton
Jun 22 2018 06:44
Have you tried updating your version of error_chain ?
Andrey Lesnikov
@ozkriff
Jun 22 2018 06:45
rust-lang-nursery/error-chain#245 i think it's fixed in master branch but isn't published yet on crates.io
Manuel Holtgrewe
@holtgrewe
Jun 22 2018 06:46
OK, so I'll just wait. Thanks.
Andrey Lesnikov
@ozkriff
Jun 22 2018 06:48
it may be a good idea to ping error-chain maintainers about publishing a new version
Dylan DPC
@Dylan-DPC
Jun 22 2018 06:53
the maintainer has said that he doesn't have much time to maintain the crate these days
Zakarum
@omni-viral
Jun 22 2018 11:32
@xoac I use this trick in my Cargo.toml
[target.'cfg(features = "serde")'.dependencies]
chrono = { version = "0.4", features = ["serde"] }

[target.'cfg(not(features = "serde"))'.dependencies]
chrono = { version = "0.4" }
Sylwester Rąpała
@xoac
Jun 22 2018 11:34
Thx :P
Naja Melan
@najamelan
Jun 22 2018 11:39
I'm wondering about a problem... I use a crate which declares an enum. They don't derive clone, copy and so on for the enum. They also have methods which take such an enum, but not by reference, they take ownership. That's fine if you hardcode which enum value you want to pass to these methods, but I would like for a struct to keep a certain enum value as a field and then pass that everytime it needs to call such method. However I don't manage, since I can't give out ownership of the enum, and I can't copy it. Since it's defined in another crate, I can't derive copy/clone for it either....:-( What should I do?
Zakarum
@omni-viral
Jun 22 2018 12:04
If crates declares enum noncopyable and it has some privates in it then you can do nothing
If it is fully public you may craft cloning function. Although you wouldn't be able to use it where Clone is required
If that enum is not Clone by mistake then the best thing you can do is to submit PR :smile:
Naja Melan
@najamelan
Jun 22 2018 12:20
It is a very basic enum (no values), and it's public, so I suppose that it should be Clone, so probably going for PR. I suppose it would also make sense that those methods take params like this by reference to avoid having to clone in the first place.
Sylwester Rąpała
@xoac
Jun 22 2018 13:10
@omni-viral Thx for that trick. But I think it's ugly. There should be better way to do this
Zakarum
@omni-viral
Jun 22 2018 13:10
@xoac Should be. But we have what we have.
¯\_(ツ)_/¯
THEDESIGNER.DESIGN
@iamcharleschege
Jun 22 2018 15:00
Hi! I am trying to update nightly Rust but it keeps on failing with error "info: latest update on 2018-06-22, rust version 1.28.0-nightly (662c70a59 2018-06-21)
info: downloading component 'rustc'
error: failed to parse url: 1.28.0-nightly (662c70a59 2018-06-21)/2018-06-22/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz
info: checking for self-updates" . How can I fix this or is the error on the new nightly. I am using "rustup update nightly"
Fredrik Portström
@portstrom
Jun 22 2018 15:06
@iamcharleschege I get the same problem. I guess it affects everyone and they will quickly fix it. Maybe there's already a thread somewhere to track the issue.
THEDESIGNER.DESIGN
@iamcharleschege
Jun 22 2018 15:06
Thanks
polypus74
@polypus74
Jun 22 2018 18:54
Any recommendations for a simple restful backend?
Libs you have been satisfied with that is.
Tim
@tikue
Jun 22 2018 23:10
Is there a way to reexport a (non-derive) proc macro from another crate?
Hans W. Uhlig
@huhlig
Jun 22 2018 23:14
Can anyone tell me whats wrong with this
huhlig@vm01:~$ rustup install nightly
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2018-06-22, rust version 1.28.0-nightly (662c70a59 2018-06-21)
info: downloading component 'rustc'
error: failed to parse url: 1.28.0-nightly (662c70a59 2018-06-21)/2018-06-22/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz
info: caused by: relative URL without a base
Tim
@tikue
Jun 22 2018 23:25
@huhlig rust-lang/rust#51699