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

#[stable], #[unstable], #[deprecated] are not errors when used non-#[staged_api] crates #22830

Closed
huonw opened this issue Feb 26, 2015 · 9 comments
Assignees
Labels
P-medium Medium priority
Milestone

Comments

@huonw
Copy link
Member

huonw commented Feb 26, 2015

They are ignored, but silently. It is probably better if we make them errors to give us room to build some future system with those nice names.

This compiles without a peep from rustc:

#![allow(dead_code)]

#[stable]
fn foo() {}
#[deprecated] 
struct Bar;
#[unstable]
type X = i8;

fn main() {}
@nagisa
Copy link
Member

nagisa commented Feb 26, 2015

Willing to pick this up.

One thing to note, that it will 100% cause breakage outside the compiler, and possibly inside as well.

@brson
Copy link
Contributor

brson commented Feb 26, 2015

I did it this way to avoid breakage for people who were using them. We might put in deprecation warnings for a few weeks.

@huonw
Copy link
Member Author

huonw commented Feb 26, 2015

I'm in favour of a smooth deprecation path via warnings! :)

@pnkfelix
Copy link
Member

@alexcrichton asks whether the unused-attribute lint would catch these, or if they are unconditonally marked as used.

Either way, some sort of warning sounds good.

@pnkfelix
Copy link
Member

1.0 polish, P-high.

@pnkfelix pnkfelix added the P-medium Medium priority label Feb 26, 2015
@pnkfelix pnkfelix added this to the 1.0 milestone Feb 26, 2015
@sfackler
Copy link
Member

@pnkfelix they are unconditionally marked as used.

@brson brson self-assigned this Apr 9, 2015
@brson
Copy link
Contributor

brson commented Apr 13, 2015

Ugh, I'm wishing I had done this a lot sooner. Working on a patch for this now, but it's probably going to cause some breakage. I'll see if I can guess how much.

@brson
Copy link
Contributor

brson commented Apr 13, 2015

Here's the list of current out-of-tree usage of stability attributes https://gist.github.com/brson/1dd62761ee8dff6cdcaa

brson added a commit to brson/rust that referenced this issue Apr 21, 2015
brson added a commit to brson/rust that referenced this issue Apr 21, 2015
brson added a commit to brson/rust that referenced this issue Apr 21, 2015
alexcrichton pushed a commit to alexcrichton/rust that referenced this issue Apr 22, 2015
Conflicts:
	src/librustc_data_structures/lib.rs
alexcrichton pushed a commit to alexcrichton/rust that referenced this issue Apr 23, 2015
Conflicts:
	src/librustc_data_structures/lib.rs
@alexcrichton
Copy link
Member

This was fixed and backported to beta recently, yay!

ryansname added a commit to ryansname/dbus-rs that referenced this issue Apr 29, 2015
rust-lang/rust#22830 has caused this.
I've changed the #[deprecated] to doc comments to let it compile. Not sure the best way to tell library users about deprecation now though.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-medium Medium priority
Projects
None yet
Development

No branches or pull requests

6 participants