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

Compiler-internal lint for public libcore items not reexported in libstd #60479

Open
meithecatte opened this issue May 2, 2019 · 11 comments
Open
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@meithecatte
Copy link
Contributor

Inspired by #60185.

@jonas-schievink jonas-schievink added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 2, 2019
@Centril Centril added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. I-nominated labels May 2, 2019
@Centril
Copy link
Contributor

Centril commented May 2, 2019

This sounds great to me; would love to save us the collective embarrassment =P

@nikomatsakis
Copy link
Contributor

I'm not sure why this is tagged as T-compiler, removing that tag.

@nikomatsakis nikomatsakis removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 9, 2019
@nikomatsakis
Copy link
Contributor

Also, it'd be great if somebody could elaborate on exactly what change is being suggested here =)

@jonas-schievink
Copy link
Contributor

The idea is to have another internal lint in rustc that runs on libstd/libcore, and reject any public items in libcore that don't also exist in libstd at the same path.

The motivation is that 1.34.0 contained many stabilizations for libcore items, where the libstd reexport was forgotten (which can happen very easily).

(I tagged this as T-compiler since this lint would be implemented in rustc; the nomination makes more sense for T-libs to answer "do we even want this?")

@SimonSapin
Copy link
Contributor

The libs team discussed this at yesterday’s triage meeting. We agreed that this sounds good to have, but none of us volunteered to implement it :)

@pnkfelix
Copy link
Member

Tagging as T-compiler and nominating for discussion at the T-compiler meeting, in order to determine priority and maybe try to find a mentor?

@pnkfelix pnkfelix added I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 16, 2019
@jonas-schievink
Copy link
Contributor

Perhaps the Clippy folks may be interested in mentoring this?

@alexcrichton
Copy link
Member

The libs team agrees that this would be a nice-to-have, but we don't have much more to say about it.

@alexcrichton alexcrichton removed the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label May 16, 2019
@pnkfelix
Copy link
Member

discussed briefly at T-compiler meeting. P-medium. Un-nominating.

@pnkfelix pnkfelix added P-medium Medium priority and removed I-nominated labels May 16, 2019
@oli-obk
Copy link
Contributor

oli-obk commented May 16, 2019

Doing this as a lint seems... very hard. There's no (nice?) way to iterate over the public API of a crate afaik. So when compiling libstd, I don't know how we can find out what is missing.

@SimonSapin
Copy link
Contributor

This doesn’t have to be in rustc’s actual linting infrastructure. It could be any code that we can run from ./x.py test, for example a script that looks at rustdoc output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants