mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-16 09:43:52 +00:00
Add tests
This commit is contained in:
parent
5e44a65517
commit
b656e24130
@ -0,0 +1,12 @@
|
||||
// check-pass
|
||||
|
||||
#![deny(multiple_supertrait_upcastable)]
|
||||
//~^ WARNING unknown lint: `multiple_supertrait_upcastable`
|
||||
//~| WARNING unknown lint: `multiple_supertrait_upcastable`
|
||||
//~| WARNING unknown lint: `multiple_supertrait_upcastable`
|
||||
#![warn(multiple_supertrait_upcastable)]
|
||||
//~^ WARNING unknown lint: `multiple_supertrait_upcastable`
|
||||
//~| WARNING unknown lint: `multiple_supertrait_upcastable`
|
||||
//~| WARNING unknown lint: `multiple_supertrait_upcastable`
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,57 @@
|
||||
warning: unknown lint: `multiple_supertrait_upcastable`
|
||||
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:3:1
|
||||
|
|
||||
LL | #![deny(multiple_supertrait_upcastable)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the `multiple_supertrait_upcastable` lint is unstable
|
||||
= help: add `#![feature(multiple_supertrait_upcastable)]` to the crate attributes to enable
|
||||
= note: `#[warn(unknown_lints)]` on by default
|
||||
|
||||
warning: unknown lint: `multiple_supertrait_upcastable`
|
||||
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:7:1
|
||||
|
|
||||
LL | #![warn(multiple_supertrait_upcastable)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the `multiple_supertrait_upcastable` lint is unstable
|
||||
= help: add `#![feature(multiple_supertrait_upcastable)]` to the crate attributes to enable
|
||||
|
||||
warning: unknown lint: `multiple_supertrait_upcastable`
|
||||
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:3:1
|
||||
|
|
||||
LL | #![deny(multiple_supertrait_upcastable)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the `multiple_supertrait_upcastable` lint is unstable
|
||||
= help: add `#![feature(multiple_supertrait_upcastable)]` to the crate attributes to enable
|
||||
|
||||
warning: unknown lint: `multiple_supertrait_upcastable`
|
||||
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:7:1
|
||||
|
|
||||
LL | #![warn(multiple_supertrait_upcastable)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the `multiple_supertrait_upcastable` lint is unstable
|
||||
= help: add `#![feature(multiple_supertrait_upcastable)]` to the crate attributes to enable
|
||||
|
||||
warning: unknown lint: `multiple_supertrait_upcastable`
|
||||
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:3:1
|
||||
|
|
||||
LL | #![deny(multiple_supertrait_upcastable)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the `multiple_supertrait_upcastable` lint is unstable
|
||||
= help: add `#![feature(multiple_supertrait_upcastable)]` to the crate attributes to enable
|
||||
|
||||
warning: unknown lint: `multiple_supertrait_upcastable`
|
||||
--> $DIR/feature-gate-multiple_supertrait_upcastable.rs:7:1
|
||||
|
|
||||
LL | #![warn(multiple_supertrait_upcastable)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: the `multiple_supertrait_upcastable` lint is unstable
|
||||
= help: add `#![feature(multiple_supertrait_upcastable)]` to the crate attributes to enable
|
||||
|
||||
warning: 6 warnings emitted
|
||||
|
@ -0,0 +1,10 @@
|
||||
#![feature(multiple_supertrait_upcastable)]
|
||||
#![deny(multiple_supertrait_upcastable)]
|
||||
|
||||
trait A {}
|
||||
trait B {}
|
||||
|
||||
trait C: A + B {}
|
||||
//~^ ERROR `C` is object-safe and has multiple supertraits
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,14 @@
|
||||
error: `C` is object-safe and has multiple supertraits
|
||||
--> $DIR/multiple_supertrait_upcastable.rs:7:1
|
||||
|
|
||||
LL | trait C: A + B {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/multiple_supertrait_upcastable.rs:2:9
|
||||
|
|
||||
LL | #![deny(multiple_supertrait_upcastable)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in New Issue
Block a user