Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macros: Future proof #[no_link] #37247

Merged
merged 1 commit into from
Oct 21, 2016
Merged

Conversation

jseyfried
Copy link
Contributor

@jseyfried jseyfried commented Oct 18, 2016

This PR future proofs #[no_link] for macro modularization (cc #35896).

First, we resolve all #[no_link] extern crates. #[no_link] crates without #[macro_use] or #[macro_reexport] are not resolved today, this is a [breaking-change]. For example,

#[no_link] extern crate non_existent_crate; //< this becomes a `crate not found` error.

Any breakage can be fixed by simply removing the #[no_link] extern crate.

Second, #[no_link] extern crates will define an empty module in type namespace to eventually allow importing the crate's macros with use. This is a [breaking-change], for example:

#[macro_use] #[no_link] extern crate syntax;
mod syntax {} //< This becomes a duplicate error.

r? @nrc

@bors
Copy link
Contributor

bors commented Oct 19, 2016

☔ The latest upstream changes (presumably #37269) made this pull request unmergeable. Please resolve the merge conflicts.

@nrc
Copy link
Member

nrc commented Oct 21, 2016

@nikomatsakis or @eddyb can we get a crater run for this PR please?

r=me with a clean crater run

@eddyb
Copy link
Member

eddyb commented Oct 21, 2016

On it. Crater report shows 4 build failures, all download errors (cc @brson).

@bors r=nrc

@bors
Copy link
Contributor

bors commented Oct 21, 2016

📌 Commit b283aaf has been approved by nrc

@bors
Copy link
Contributor

bors commented Oct 21, 2016

⌛ Testing commit b283aaf with merge da5b646...

bors added a commit that referenced this pull request Oct 21, 2016
macros: Future proof `#[no_link]`

This PR future proofs `#[no_link]` for macro modularization (cc #35896).

First, we resolve all `#[no_link] extern crate`s. `#[no_link]` crates without `#[macro_use]` or `#[macro_reexport]` are not resolved today, this is a [breaking-change]. For example,
```rust
```
Any breakage can be fixed by simply removing the `#[no_link] extern crate`.

Second, `#[no_link] extern crate`s will define an empty module in type namespace to eventually allow importing the crate's macros with `use`. This is a [breaking-change], for example:
```rust
mod syntax {} //< This becomes a duplicate error.
```

r? @nrc
@bors bors merged commit b283aaf into rust-lang:master Oct 21, 2016
@brson brson added the relnotes Marks issues that should be documented in the release notes of the next release. label Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants