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

issue 1296: implement #[nolink]; deprecate #[link_name = ""] #1309

Closed
wants to merge 2 commits into from
Closed

issue 1296: implement #[nolink]; deprecate #[link_name = ""] #1309

wants to merge 2 commits into from

Conversation

gmfawcett
Copy link
Contributor

The #[link_name = ""] attributes in the standard library will need to be removed later, after new compiler snapshots are generated; I've left fixme notes to take care of that later.

…emove empty link_name.

Can't remove them from stdlib until the snapshotted compiler supports #[nolink].
@brson
Copy link
Contributor

brson commented Dec 15, 2011

This looks great so far. Thanks!

@brson
Copy link
Contributor

brson commented Dec 15, 2011

Actually, I've realized that one of the comments I made about returning early in creader is specifically about #1295, not #1296, so if you address the other comment about the check in back::link we can merge this without addressing #1295.

@gmfawcett
Copy link
Contributor Author

I have a question. Cstore::add_used_library() returns false if a library has already been added by another module. Currently, creader::visit_item() returns early if this is the case, skipping the link_args section. This will change if I rework it to address #1295 as well.

I'm thinking that if two modules specify a library, it's risky to let the second one specify link_args -- they may duplicate or conflict with the first module's link_args. So it probably should throw an error if link_args are specified for a redundant library, or at least generate a warning. Thoughts?

…same lib, and second has link_args.

I think it should undefined to have multiple modules that link in the same
library, but provide different link arguments. Unfortunately we don't track
link_args by module -- they are just appended as discovered into the crate
store -- but for now, it should be an error to provide link_args on a module
that's already been included (with or without link_args).
@brson
Copy link
Contributor

brson commented Dec 16, 2011

Either a warning or error if two native modules with the same name specify different link_args sounds reasonable to me.

@brson
Copy link
Contributor

brson commented Dec 16, 2011

Integrated. Thanks! Closed #1295 & #1296.

@brson brson closed this Dec 16, 2011
@gmfawcett
Copy link
Contributor Author

Thanks, brson, this was fun. :)

@fhahn
Copy link
Contributor

fhahn commented Feb 10, 2014

The src/test/compile-fail/empty-linkname.rs and the src/test/compile-fail/empty-linkname2.rs test cases are ignored at the moment.
According to this patch using #[link_name = ""] should yield a compiler error but it does not in current Rust.

Is #[link_name = ""] considered okay in current Rust or is this a regression?

bjorn3 added a commit to bjorn3/rust that referenced this pull request Jan 24, 2023
These are the last remaining platform intrinsics necessary for portable-simd.
coastalwhite pushed a commit to coastalwhite/rust that referenced this pull request Aug 5, 2023
celinval pushed a commit to celinval/rust-dev that referenced this pull request Jun 4, 2024
* Remove everything related to DocContext

* Remove everything about rustdoc Options

* remove everything related to rustdoc cache

* clean up markdown

* remove clean, fold, and visit from librustdoc

* remove config, core, lint

* Cull cargo deps from librustdoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants