These are chat archives for rust-lang/rust

22nd
Mar 2019
something like that in case the idea is novel to anyone
you can build up surprisingly long chains this way
and you tend to get small, easily testable functions
Sam Johnson
@sam0x17
Mar 22 17:48
@vlopes11 Azure pipelines supports all 3
Say my package buz depends on foo that depends on bar-sys
In buz's Cargo.toml I add the following:
[target.x86_64-unknown-linux-gnu.bar-sys]
rustc-link-search = ["/usr/lib/x86_64-linux-gnu/"]
rustc-link-lib = ["libbar.so"]
however Cargo warns me of an unused manifest key and errors out?
Ash
@ashthespy
Mar 22 19:27
the package bar-sys has the appropriate links=bar in its Cargo.toml
Denis Lisov
@tanriol
Mar 22 20:06
Overrides like this live not in Cargo.toml, but in .cargo/config
Victor Lopes
@vlopes11
Mar 22 21:44
@sam0x17 they are actually awesome. they offer free service w/ support to build all sort of binaries, up to 5 users. I'll try them, thanks for the tip :)
Riley Cat
@WreckedAvent
Mar 22 21:49
so I've been considering writing a tutorial for rust and I thought I had a pretty good understanding of ownership but something that has been doing my head in is how often rust APIs will accept a borrow to mut self when taking ownership would make way more sense
like in the "learning rust with entirely too many linked lists" https://rust-unofficial.github.io/too-many-lists/first.html
the first chapter is basically nothing but fighting with the borrow checker because the author keeps trying to get around the fact they're borrowing something and trying to move ownership at the same time

and if you just remove the borrows and accept the fact mutating a linked list inherently requires ownership the code becomes straight-forward and the compiler doesn't fight you at all:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=f0ea5a474e619c308ae105a077d65435