{"action":"opened","issue":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1220","repository_url":"https://api.github.com/repos/Manishearth/rust-clippy","labels_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1220/labels{/name}","comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1220/comments","events_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1220/events","html_url":"https://github.com/Manishearth/rust-clippy/issues/1220","id":176061396,"number":1220,"title":"`allow(module_inception)` should allow specific occurrences on a case-by-case basis","user":{"login":"crumblingstatue","id":1521976,"avatar_url":"https://avatars.githubusercontent.com/u/1521976?v=3","gravatar_id":"","url":"https://api.github.com/users/crumblingstatue","html_url":"https://github.com/crumblingstatue","followers_url":"https://api.github.com/users/crumblingstatue/followers","following_url":"https://api.github.com/users/crumblingstatue/following{/other_user}","gists_url":"https://api.github.com/users/crumblingstatue/gists{/gist_id}","starred_url":"https://api.github.com/users/crumblingstatue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crumblingstatue/subscriptions","organizations_url":"https://api.github.com/users/crumblingstatue/orgs","repos_url":"https://api.github.com/users/crumblingstatue/repos","events_url":"https://api.github.com/users/crumblingstatue/events{/privacy}","received_events_url":"https://api.github.com/users/crumblingstatue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-09T17:16:25Z","updated_at":"2016-09-09T17:16:25Z","closed_at":null,"body":"<!--\r\nHi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place.\r\n\r\nIf you want to report that Clippy does not compile, please be sure to be using the *latest version* of *Rust nightly*! Compiler plugins are highly unstable and will only work with a nightly Rust for now. If you are but still have a problem, please let us now!\r\n\r\nThank you for using Clippy!\r\n\r\nWrite your comment below this line: -->\r\n\r\nThe following does not work as expected:\r\n```rust\r\nmod foo {\r\n    #[allow(module_inception)]\r\n    mod foo {\r\n    }\r\n}\r\n```\r\n\r\n```\r\nwarning: module has the same name as its containing module, #[warn(module_inception)] on by default\r\n --> src/lib.rs:3:5\r\n  |\r\n3 |     mod foo {\r\n  |     ^\r\n```\r\n\r\nIdeally, one would want to allow `module_inception` on a case-by-case basis, where one deems it acceptable.\r\n\r\nIn my case, it's [here](https://github.com/jeremyletang/rust-sfml/blob/fcc0bd9fbe2b8c351ded42a0cbb860a8d532b46e/src/window/mod.rs#L37), where `window` is the name of an SFML module that contains a variety of classes related to windowing/input, but `Window` is also a class inside that module, and I want to put each class in its own module, and `window` is the most appropriate name, since it's the class name.\r\n\r\nUsing `#![allow(module_inception)]` inside the parent module works, but then it allows `module_inception` everywhere in the module, instead of just a specific occurrence that the user would like to allow."}}
{"actor":{"display_login":"crumblingstatue"}}