Stream: t-compiler/help

Topic: IsPrefixOf trait worth?


Santiago Pastorino (Jan 22 2019 at 18:15, on Zulip):

I was wondering what's the reason of this trait https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/prefixes.rs

Santiago Pastorino (Jan 22 2019 at 18:15, on Zulip):

and btw trying out how help stream works :)

Santiago Pastorino (Jan 22 2019 at 18:15, on Zulip):

I mean, if the other argument is a Place that doesn't seem to worth that much or am I not seeing something?

nagisa (Jan 22 2019 at 18:22, on Zulip):

That link is 404

nikomatsakis (Jan 22 2019 at 18:25, on Zulip):

@Santiago Pastorino I presume the IsPrefixOf trait is just a way to get to use method notation

Santiago Pastorino (Jan 22 2019 at 18:44, on Zulip):

That link is 404

fixed

Santiago Pastorino (Jan 22 2019 at 18:44, on Zulip):

@Santiago Pastorino I presume the IsPrefixOf trait is just a way to get to use method notation

what do you mean by method notation?

nikomatsakis (Jan 22 2019 at 20:22, on Zulip):

@Santiago Pastorino I mean writing foo.bar() instead of bar(foo)

nikomatsakis (Jan 22 2019 at 20:23, on Zulip):

i.e., since Place is defined in the librustc crate, if we want to add methods to Place from the librustc_mir crate, we need to add them via a trait

Santiago Pastorino (Jan 22 2019 at 20:23, on Zulip):

ahh, got it

Santiago Pastorino (Jan 22 2019 at 20:24, on Zulip):

(deleted)

Last update: Nov 11 2019 at 21:55UTC