Stream: t-compiler/rust-2018

Topic: behavior of #[path] attributes


view this post on Zulip nikomatsakis (Nov 13 2018 at 14:32):

@Taylor Cramer can you briefly summarize to me what's up here? Based on your previous comments, I gather that:

Or did we make some changes?

I guess I should review the issue history

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:37):

That's a good basic summary

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:37):

We did land -a- change

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:38):

Which added the name of the non-mod.rs file to the directory where #[path] starts when it appears in a nested module

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:38):

A crater said no regressions for that change

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:39):

Which made me think that no one was using #[path] from inside nested modules

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:40):

So I was hopeful we could change #[path] to ignore nested modules altogether

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:40):

But that didn't pan out

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:40):

As several crates failed to compile

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:40):

Syn was one of them, so we couldn't even get as far as a crater

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:41):

It's possible we could fix syn and try and track down the remaining usages

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:41):

But failing that early made me not optimistic

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:42):

To clarify, the reason syn didn't break on the previous change is that it only used path inside nested modules in lib.rs

view this post on Zulip Taylor Cramer (Nov 13 2018 at 15:42):

Lib.rs/mod.rs/main.RS were unaffected by the previous change

view this post on Zulip gnzlbg (Nov 13 2018 at 16:27):

Using #[path] often makes crates non publisheable to crates.io - example: stdsimd uses #[path] so that we can include it in libcore and libstd, but publishing fails.

view this post on Zulip nikomatsakis (Nov 13 2018 at 18:00):

It's possible we could fix syn and try and track down the remaining usages

always dubious, as we'd have to fix older versions too

view this post on Zulip nikomatsakis (Nov 13 2018 at 18:00):

anyway it sounds like we are at the "document and live with it" stage of this behavior, @Taylor Cramer ?

view this post on Zulip Taylor Cramer (Nov 13 2018 at 18:58):

Oh geeze sorry I replied to this on mobile but apparently I have no idea how to use the Zulip app, or it doesn't propagate messages correctly or something. Anyways, yes, that's basically the situation. We did make a breaking change to how #[path] is handled inside nested modules inside non-mod.rs/main.rs/lib.rs files.

view this post on Zulip Taylor Cramer (Nov 13 2018 at 18:58):

oh wow

view this post on Zulip Taylor Cramer (Nov 13 2018 at 18:58):

now that I typed that I'm seeing my response above

view this post on Zulip Taylor Cramer (Nov 13 2018 at 18:58):

I clearly don't know how to Zulip XD

view this post on Zulip Taylor Cramer (Nov 13 2018 at 18:59):

@nikomatsakis Yeah, documenting it seems like a good idea. What do you think is the right place for that? The reference?

view this post on Zulip Taylor Cramer (Nov 13 2018 at 18:59):

In general we're not very good about keeping the reference up to date

view this post on Zulip Taylor Cramer (Nov 13 2018 at 18:59):

that needs to change :(

view this post on Zulip Eric Huss (Nov 13 2018 at 19:01):

I had a PR on the reference to document this (https://github.com/rust-lang-nursery/reference/pull/450) but it needs to be rewritten for the recent changes. I've been waiting to see what happened with your latest PR. I can get back and finish it soon.

view this post on Zulip Taylor Cramer (Nov 13 2018 at 19:03):

Oh, great. I was going to close the most recent PR since I think we're not going to be able to land it. Maybe for Rust 2021 :)

view this post on Zulip Eric Huss (Nov 13 2018 at 19:06):

@Taylor Cramer do you mind if I post a PR to restore the non-mod-rs tests? They're currently somewhat broken.

view this post on Zulip Taylor Cramer (Nov 13 2018 at 19:07):

@Eric Huss Not at all! Please do

view this post on Zulip Taylor Cramer (Nov 13 2018 at 19:07):

I've also left a comment on the PR just to be sure: https://github.com/rust-lang-nursery/reference/pull/450#issuecomment-438397300

view this post on Zulip Taylor Cramer (Nov 13 2018 at 19:07):

@Eric Huss sorry that the original PR to clean up the tests got lost

view this post on Zulip Eric Huss (Nov 13 2018 at 19:08):

no worries, I don't think there was a pressing issue, just don't want things to fall through the cracks

view this post on Zulip nikomatsakis (Nov 13 2018 at 20:03):

yep the reference I think is the right place for this

view this post on Zulip nikomatsakis (Nov 13 2018 at 20:03):

and yep we need to do a better job :)

view this post on Zulip RalfJ (Nov 14 2018 at 11:01):

Oh, great. I was going to close the most recent PR since I think we're not going to be able to land it. Maybe for Rust 2021 :)

sure we won't have forgotten by then? ;)


Last updated: Jan 26 2022 at 08:46 UTC