]> git.lizzy.rs Git - rust.git/commit
Auto merge of #64882 - ehuss:stabilize-bare-extern, r=eddyb
authorbors <bors@rust-lang.org>
Fri, 8 Nov 2019 01:15:50 +0000 (01:15 +0000)
committerbors <bors@rust-lang.org>
Fri, 8 Nov 2019 01:15:50 +0000 (01:15 +0000)
commitd2574403b31508be9cfed468e352467043d2354d
tree7a38c5553a3ae0102ab6c304260076c696d73b1f
parente8f43b72eb2596f360004f6cdf9cdde4b9e789e1
parentee459c6200c6384ac83ffd7f33de12f123134c30
Auto merge of #64882 - ehuss:stabilize-bare-extern, r=eddyb

Stabilize --extern flag without a path.

This stabilizes the `--extern` flag without a path, implemented in #54116.

This flag is used to add a crate that may be found in the search path to the extern prelude. The intent of stabilizing this now is to change Cargo to emit this flag for `proc_macro` when building a proc-macro crate. This will allow the ability to elide `extern crate proc_macro;` for proc-macros, one of the few places where it is still necessary.

It is intended that Cargo may also use this flag for other cases in the future as part of the [std-aware work](https://github.com/rust-lang/wg-cargo-std-aware/). There will likely be some kind of syntax where users may declare dependencies on other crates (such as `alloc`), and Cargo will use this flag so that they may be used like any other crate. At this time there are no short-term plans to use it for anything other than proc-macro.

This will not help for non-proc-macro crates that use `proc_macro`, which I believe is not too common?

An alternate approach for proc-macro is to use the `meta` crate, but from my inquiries there doesn't appear to be anyone interested in pushing that forward. The `meta` crate also doesn't help with things like `alloc` or `test`.

cc #57288