Stream: t-compiler/rust-2018

Topic: behavior of #[path] attributes


nikomatsakis (Nov 13 2018 at 14:32, on Zulip):

@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

Taylor Cramer (Nov 13 2018 at 15:37, on Zulip):

That's a good basic summary

Taylor Cramer (Nov 13 2018 at 15:37, on Zulip):

We did land -a- change

Taylor Cramer (Nov 13 2018 at 15:38, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 15:38, on Zulip):

A crater said no regressions for that change

Taylor Cramer (Nov 13 2018 at 15:39, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 15:40, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 15:40, on Zulip):

But that didn't pan out

Taylor Cramer (Nov 13 2018 at 15:40, on Zulip):

As several crates failed to compile

Taylor Cramer (Nov 13 2018 at 15:40, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 15:41, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 15:41, on Zulip):

But failing that early made me not optimistic

Taylor Cramer (Nov 13 2018 at 15:42, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 15:42, on Zulip):

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

gnzlbg (Nov 13 2018 at 16:27, on Zulip):

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.

nikomatsakis (Nov 13 2018 at 18:00, on Zulip):

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

nikomatsakis (Nov 13 2018 at 18:00, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 18:58, on Zulip):

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.

Taylor Cramer (Nov 13 2018 at 18:58, on Zulip):

oh wow

Taylor Cramer (Nov 13 2018 at 18:58, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 18:58, on Zulip):

I clearly don't know how to Zulip XD

Taylor Cramer (Nov 13 2018 at 18:59, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 18:59, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 18:59, on Zulip):

that needs to change :(

Eric Huss (Nov 13 2018 at 19:01, on Zulip):

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.

Taylor Cramer (Nov 13 2018 at 19:03, on Zulip):

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 :)

Eric Huss (Nov 13 2018 at 19:06, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 19:07, on Zulip):

@Eric Huss Not at all! Please do

Taylor Cramer (Nov 13 2018 at 19:07, on Zulip):

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

Taylor Cramer (Nov 13 2018 at 19:07, on Zulip):

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

Eric Huss (Nov 13 2018 at 19:08, on Zulip):

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

nikomatsakis (Nov 13 2018 at 20:03, on Zulip):

yep the reference I think is the right place for this

nikomatsakis (Nov 13 2018 at 20:03, on Zulip):

and yep we need to do a better job :)

RalfJ (Nov 14 2018 at 11:01, on Zulip):

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 update: Nov 15 2019 at 10:35UTC