These are chat archives for rust-lang/rust

13th
Jan 2018
dunnousername
@dunnousername
Jan 13 2018 00:12
This may be a stupid question, but does inline assembly of 64-bit register clobbering not also include their 32-bit parts? Is it me using isize and not usize?
Sathya Narrayanan
@sourcepirate
Jan 13 2018 05:06

I saw this while i was browsing into github.


impl SegmentComponent {
    /// Iterates through the components.
    pub fn iterator() -> impl Iterator<Item = &'static SegmentComponent> {
        static SEGMENT_COMPONENTS: [SegmentComponent; 7] = [
            SegmentComponent::POSTINGS,
            SegmentComponent::POSITIONS,
            SegmentComponent::FASTFIELDS,
            SegmentComponent::FIELDNORMS,
            SegmentComponent::TERMS,
            SegmentComponent::STORE,
            SegmentComponent::DELETE,
        ];
        SEGMENT_COMPONENTS.into_iter()
    }
}

Can impl block be returned ? Why return a impl block ? What is the advantage in doing so ?

Peter Atashian
@retep998
Jan 13 2018 05:08
Its not returning an impl block
rather it is using a fancy new feature where it is returning an unnamed type that happens to impl Iterator
Sathya Narrayanan
@sourcepirate
Jan 13 2018 05:09
Oh! what feature is it ?
Ryan
@rnleach
Jan 13 2018 05:09
This is still nightly only right?
Peter Atashian
@retep998
Jan 13 2018 05:09
rust-lang/rust#34511
Christopher Andronikos
@candronikos
Jan 13 2018 21:39

Hi all,

Is there a nice, sane way to visualise lifetimes in Rust?

Getting errors for which no sense can be made!

Denis Lisov
@tanriol
Jan 13 2018 22:01
I don't know any way to visualize, but for some errors there's better visualization in the works...