# Relative paths and Rust 2018 \`use\` statements

**URL:** <https://internals.rust-lang.org/t/relative-paths-and-rust-2018-use-statements/7875>\
**Category:** language design\
**Created:** [July 4, 2018, 9:46pm UTC](https://internals.rust-lang.org/t/relative-paths-and-rust-2018-use-statements/7875 "2018-07-04T21:46:37Z")\
**Posts on this page:** 4\
**Page:** 3

<div class="post-metadata">

**Author:** ![gbutler](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/gbutler/32/3670_2.png) [@gbutler](https://internals.rust-lang.org/u/gbutler)\
**Post date:** [July 5, 2018, 1:22am UTC](https://internals.rust-lang.org/t/relative-paths-and-rust-2018-use-statements/7875/41 "2018-07-05T01:22:54Z")

</div>

> [@aturon](#):
>
> as long as we have ergonomic unambiguous syntax

Agree. But, I don't agree that syntax that can be interpreted as either referring to the sub-module or an external crate, and that has to have a rule that chooses one over the other (with a lint) is "unambiguous syntax".

Unless I've misunderstood something, the current 2018 proposal and the modified proposal would allow a relative path (not a use) to be interpreted as either an external absolute path within a different crate or a local sub-module path. In either case, you arbitrarily have a rule that says how it should be interpreted. I wouldn't consider that unambiguous.

---

<div class="post-metadata">

**Author:** ![aturon](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/aturon/32/3272_2.png) [@aturon](https://internals.rust-lang.org/u/aturon)\
**Post date:** [July 5, 2018, 1:24am UTC](https://internals.rust-lang.org/t/relative-paths-and-rust-2018-use-statements/7875/42 "2018-07-05T01:24:34Z")

</div>

> [@gbutler](#):
>
> But, I don’t agree that syntax that can be interpreted as either referring to the sub-module or an external crate, and that has to have a rule that chooses one over the other (with a lint) is “unambiguous syntax”.

Oh yes, what I mean is specifically having _some_ syntax you can use to be explicit about exactly this point. That's separate from whether you _always_ have to use that syntax.

---

<div class="post-metadata">

**Author:** ![aturon](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/aturon/32/3272_2.png) [@aturon](https://internals.rust-lang.org/u/aturon)\
**Post date:** [July 5, 2018, 2:59am UTC](https://internals.rust-lang.org/t/relative-paths-and-rust-2018-use-statements/7875/43 "2018-07-05T02:59:20Z")

</div>

Revised proposal/thread [here](https://internals.rust-lang.org/t/relative-paths-in-rust-2018/7883)!

---

<div class="post-metadata">

**Author:** ![aturon](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/aturon/32/3272_2.png) [@aturon](https://internals.rust-lang.org/u/aturon)\
**Post date:** [July 5, 2018, 2:59am UTC](https://internals.rust-lang.org/t/relative-paths-and-rust-2018-use-statements/7875/44 "2018-07-05T02:59:25Z")

</div>



[Previous page](https://internals.rust-lang.org/t/relative-paths-and-rust-2018-use-statements/7875.md?page=2)
