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

Disallow overriding forbid in same scope #77534

Conversation

Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum commented Oct 4, 2020

Rebased #73379.

Fixes #70819.

…ant in the language.

(Note that the fact this test existed is a slight sign that we may need a crater
run on this bugfix...)
That is, this changes `#[forbid(foo)] #[allow(foo)]` from allowing foo to
forbidding foo.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 4, 2020
@@ -37,13 +37,5 @@ LL | #![deny(clippy::restriction)]
|
= help: try enabling only the lints you really need

error: restriction lints are not meant to be all enabled
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is that the original inclusion here was intended to test that any level of blanket restriction enablement (including forbid) was covered, but given that the code in question blanket covers everything except allow it feels like this should be sufficient (and adding a separate test does not feel worth it).

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 4, 2020

📌 Commit afa2a67 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 4, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 6, 2020
Rollup of 13 pull requests

Successful merges:

 - rust-lang#76388 (Add a note about the panic behavior of math operations on time objects)
 - rust-lang#76855 (Revamp rustdoc docs about documentation using `cfg`)
 - rust-lang#76995 (Reduce boilerplate with the matches! macro)
 - rust-lang#77228 (Add missing examples for MaybeUninit)
 - rust-lang#77528 (Avoid unchecked casts in net parser)
 - rust-lang#77534 (Disallow overriding forbid in same scope)
 - rust-lang#77555 (Allow anyone to set regression labels)
 - rust-lang#77558 (Rename bootstrap/defaults/{config.toml.PROFILE => config.PROFILE.toml})
 - rust-lang#77559 (Fix rustdoc warnings about invalid Rust syntax)
 - rust-lang#77560 (Fix LitKind's byte buffer to use refcounted slice)
 - rust-lang#77573 (Hint doc use convert::identity relative link)
 - rust-lang#77587 (Fix span for unicode escape suggestion.)
 - rust-lang#77591 (Record `expansion_that_defined` into crate metadata)

Failed merges:

r? `@ghost`
@bors bors merged commit bc600c3 into rust-lang:master Oct 6, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 6, 2020
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 9, 2020
…w-override-forbid-in-same-scope, r=petrochenkov

Disallow overriding forbid in same scope

Rebased rust-lang#73379.

Fixes rust-lang#70819.
@Mark-Simulacrum Mark-Simulacrum deleted the issue-70819-disallow-override-forbid-in-same-scope branch December 3, 2020 15:56
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 10, 2020
…ulacrum

[beta] backports

* Revert rust-lang#77534 fixing rust-lang#77713 on beta, principled fix landed on master
* fix soundness issue in `make_contiguous` rust-lang#79814
* Fix exhaustiveness in case a byte string literal is used at slice type rust-lang#79072
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

forbid overwritten by later allow on the same "scope level"
6 participants