servo/components/plugins/lints/mod.rs
Anthony Ramine a6d59d8714 Replace inheritance_integrity by trait shenanigans
For each derived DomObject impl, we also generate a dummy trait
ShouldNotImplDomObject that is implemented for all T: DomObject.
We then try to implement it for each field type except the first one.
If compilation succeed, this means that field type doesn't implement
DomObject itself otherwise it would break coherence rules.

error[E0119]: conflicting implementations of trait `dom::xmlhttprequest::_IMPL_DOMOBJECT_FOR_XMLHttpRequest::ShouldNotImplDomObject` for type `((), SomeFieldTypeThatShouldNotImplementDomObject)`:
   --> /Users/nox/src/servo/components/script/dom/xmlhttprequest.rs:120:1
    |
120 | #[dom_struct]
    | ^^^^^^^^^^^^^
    | |
    | first implementation here
    | conflicting implementation for `((), SomeFieldTypeThatShouldNotImplementDomObject)`
2017-02-15 22:11:20 +01:00

6 lines
247 B
Rust

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
pub mod ban;
pub mod unrooted_must_root;