These are chat archives for rust-lang/rust

12th
Dec 2016
xialvjun
@xialvjun
Dec 12 2016 05:39
@jplatte , forgot to say thanks. Thanks.
Matanel Levi
@matanelevi
Dec 12 2016 06:10
Lifetimes question - why there is a lifetime next to impl? impl<'a> MyStruct<'a> and not just next to the struct?
Sergey Noskov
@Albibek
Dec 12 2016 06:47
lifetime is some special kind of generic type, so it's used as other generic type, i.e., in this case it must be declared before being used
Aleksey Kladov
@matklad
Dec 12 2016 08:16
@matanelevi you can also do stuff like impl<'a> MyTwoParameterStruct<'a, 'a>
Matanel Levi
@matanelevi
Dec 12 2016 09:06
@Albibek amm... Do you know what it's required?
@matklad what is actually the meaning of this? :smile:
Aleksey Kladov
@matklad
Dec 12 2016 09:13
@matanelevi it's easier to explain using type parameters: http://play.integer32.com/?gist=72d33f14c06d2174b17ab532f0696531&version=stable
basically, you can constrain methods to only be available if some type/lifetime parameters coinside
Matanel Levi
@matanelevi
Dec 12 2016 10:00
@matklad oh yes, but what is the meaning of this, specifically with lifetimes? It seems meaningless (with two 'a)
Aleksey Kladov
@matklad
Dec 12 2016 10:01
I can't remember any examples from real life, but you can imagine, for example
Sergey Noskov
@Albibek
Dec 12 2016 10:01
struct declaration may have different ones
Aleksey Kladov
@matklad
Dec 12 2016 10:02
struct Pair<'a, 'b> { first: &'a i32, second: &'b i32 }
Jeffrin Jose T
@ahiliation
Dec 12 2016 16:48
hello all
Aleksey Kladov
@matklad
Dec 12 2016 16:50
Hi!
Jeffrin Jose T
@ahiliation
Dec 12 2016 16:52
can i be of some help to rust
any CSS work that i can do
or correcting typo related errors
Peter Atashian
@retep998
Dec 12 2016 20:08
@ahiliation Feel free to browse the code in the repo, finding any typos you can in any of the comments anywhere and then submit a PR to fix them
@ahiliation As for CSS work, one thing that a lot of people would like is a dark theme for rustdoc
boats
@withoutboats
Dec 12 2016 22:56
I would love a dark theme for rustdoc