Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
error: `[const]` is not allowed here
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^
|
note: this trait is not `const`, so it cannot have `[const]` trait bounds
--> $DIR/const-supertrait-unstable.rs:25:1
--> $DIR/const-supertrait-unstable.rs:26:1
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
Expand All @@ -22,7 +22,7 @@ LL | const trait Foo {
| +++++

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
Expand All @@ -34,7 +34,7 @@ LL | const trait Foo {
| +++++

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
Expand All @@ -46,7 +46,7 @@ LL | const trait Foo {
| +++++

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:32:17
--> $DIR/const-supertrait-unstable.rs:33:17
|
LL | const fn foo<T: [const] Bar>(x: &T) {
| ^^^^^^^ can't be applied to `Bar`
Expand All @@ -57,7 +57,7 @@ LL | const trait Bar: [const] Foo {}
| +++++

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:32:17
--> $DIR/const-supertrait-unstable.rs:33:17
|
LL | const fn foo<T: [const] Bar>(x: &T) {
| ^^^^^^^ can't be applied to `Bar`
Expand All @@ -69,13 +69,13 @@ LL | const trait Bar: [const] Foo {}
| +++++

error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
--> $DIR/const-supertrait-unstable.rs:36:7
--> $DIR/const-supertrait-unstable.rs:37:7
|
LL | x.a();
| ^^^
|
note: method `a` is not const because trait `Foo` is not const
--> $DIR/const-supertrait-unstable.rs:21:1
--> $DIR/const-supertrait-unstable.rs:22:1
|
LL | trait Foo {
| ^^^^^^^^^ this trait is not const
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
error: `[const]` is not allowed here
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^
|
note: this trait is not `const`, so it cannot have `[const]` trait bounds
--> $DIR/const-supertrait-unstable.rs:25:1
--> $DIR/const-supertrait-unstable.rs:26:1
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: const trait impls are experimental
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^
Expand All @@ -21,7 +21,7 @@ LL | trait Bar: [const] Foo {}
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: const trait impls are experimental
--> $DIR/const-supertrait-unstable.rs:32:17
--> $DIR/const-supertrait-unstable.rs:33:17
|
LL | const fn foo<T: [const] Bar>(x: &T) {
| ^^^^^^^
Expand All @@ -31,7 +31,7 @@ LL | const fn foo<T: [const] Bar>(x: &T) {
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
Expand All @@ -42,7 +42,7 @@ LL | const trait Foo {
| +++++

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
Expand All @@ -54,7 +54,7 @@ LL | const trait Foo {
| +++++

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
Expand All @@ -66,7 +66,7 @@ LL | const trait Foo {
| +++++

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:32:17
--> $DIR/const-supertrait-unstable.rs:33:17
|
LL | const fn foo<T: [const] Bar>(x: &T) {
| ^^^^^^^ can't be applied to `Bar`
Expand All @@ -77,7 +77,7 @@ LL | const trait Bar: [const] Foo {}
| +++++

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:32:17
--> $DIR/const-supertrait-unstable.rs:33:17
|
LL | const fn foo<T: [const] Bar>(x: &T) {
| ^^^^^^^ can't be applied to `Bar`
Expand All @@ -89,13 +89,13 @@ LL | const trait Bar: [const] Foo {}
| +++++

error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
--> $DIR/const-supertrait-unstable.rs:36:7
--> $DIR/const-supertrait-unstable.rs:37:7
|
LL | x.a();
| ^^^
|
note: method `a` is not const because trait `Foo` is not const
--> $DIR/const-supertrait-unstable.rs:21:1
--> $DIR/const-supertrait-unstable.rs:22:1
|
LL | trait Foo {
| ^^^^^^^^^ this trait is not const
Expand Down
1 change: 1 addition & 0 deletions tests/ui/traits/const-traits/const-supertrait-unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//@ needs-target-std

//@ normalize-stderr: "dev release channel" -> "nightly release channel"
//@ normalize-stderr: "beta release channel" -> "nightly release channel"
//@ normalize-stderr: "stable release channel" -> "nightly release channel"
//@ compile-flags: --check-cfg=cfg(feature_enabled)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
error: `[const]` is not allowed here
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^
|
note: this trait is not `const`, so it cannot have `[const]` trait bounds
--> $DIR/const-supertrait-unstable.rs:25:1
--> $DIR/const-supertrait-unstable.rs:26:1
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the nightly release channel
--> $DIR/const-supertrait-unstable.rs:18:30
--> $DIR/const-supertrait-unstable.rs:19:30
|
LL | #![cfg_attr(feature_enabled, feature(const_trait_impl))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
|
note: `Foo` can't be used with `[const]` because it isn't `const`
--> $DIR/const-supertrait-unstable.rs:21:1
--> $DIR/const-supertrait-unstable.rs:22:1
|
LL | trait Foo {
| ^^^^^^^^^

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
|
note: `Foo` can't be used with `[const]` because it isn't `const`
--> $DIR/const-supertrait-unstable.rs:21:1
--> $DIR/const-supertrait-unstable.rs:22:1
|
LL | trait Foo {
| ^^^^^^^^^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
|
note: `Foo` can't be used with `[const]` because it isn't `const`
--> $DIR/const-supertrait-unstable.rs:21:1
--> $DIR/const-supertrait-unstable.rs:22:1
|
LL | trait Foo {
| ^^^^^^^^^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:32:17
--> $DIR/const-supertrait-unstable.rs:33:17
|
LL | const fn foo<T: [const] Bar>(x: &T) {
| ^^^^^^^ can't be applied to `Bar`
|
note: `Bar` can't be used with `[const]` because it isn't `const`
--> $DIR/const-supertrait-unstable.rs:25:1
--> $DIR/const-supertrait-unstable.rs:26:1
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:32:17
--> $DIR/const-supertrait-unstable.rs:33:17
|
LL | const fn foo<T: [const] Bar>(x: &T) {
| ^^^^^^^ can't be applied to `Bar`
|
note: `Bar` can't be used with `[const]` because it isn't `const`
--> $DIR/const-supertrait-unstable.rs:25:1
--> $DIR/const-supertrait-unstable.rs:26:1
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
--> $DIR/const-supertrait-unstable.rs:36:7
--> $DIR/const-supertrait-unstable.rs:37:7
|
LL | x.a();
| ^^^
|
note: method `a` is not const because trait `Foo` is not const
--> $DIR/const-supertrait-unstable.rs:21:1
--> $DIR/const-supertrait-unstable.rs:22:1
|
LL | trait Foo {
| ^^^^^^^^^ this trait is not const
Expand Down
Original file line number Diff line number Diff line change
@@ -1,102 +1,102 @@
error: `[const]` is not allowed here
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^
|
note: this trait is not `const`, so it cannot have `[const]` trait bounds
--> $DIR/const-supertrait-unstable.rs:25:1
--> $DIR/const-supertrait-unstable.rs:26:1
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: const trait impls are experimental
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^
|
= note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information

error[E0658]: const trait impls are experimental
--> $DIR/const-supertrait-unstable.rs:32:17
--> $DIR/const-supertrait-unstable.rs:33:17
|
LL | const fn foo<T: [const] Bar>(x: &T) {
| ^^^^^^^
|
= note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
|
note: `Foo` can't be used with `[const]` because it isn't `const`
--> $DIR/const-supertrait-unstable.rs:21:1
--> $DIR/const-supertrait-unstable.rs:22:1
|
LL | trait Foo {
| ^^^^^^^^^

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
|
note: `Foo` can't be used with `[const]` because it isn't `const`
--> $DIR/const-supertrait-unstable.rs:21:1
--> $DIR/const-supertrait-unstable.rs:22:1
|
LL | trait Foo {
| ^^^^^^^^^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:25:12
--> $DIR/const-supertrait-unstable.rs:26:12
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
|
note: `Foo` can't be used with `[const]` because it isn't `const`
--> $DIR/const-supertrait-unstable.rs:21:1
--> $DIR/const-supertrait-unstable.rs:22:1
|
LL | trait Foo {
| ^^^^^^^^^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:32:17
--> $DIR/const-supertrait-unstable.rs:33:17
|
LL | const fn foo<T: [const] Bar>(x: &T) {
| ^^^^^^^ can't be applied to `Bar`
|
note: `Bar` can't be used with `[const]` because it isn't `const`
--> $DIR/const-supertrait-unstable.rs:25:1
--> $DIR/const-supertrait-unstable.rs:26:1
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^

error: `[const]` can only be applied to `const` traits
--> $DIR/const-supertrait-unstable.rs:32:17
--> $DIR/const-supertrait-unstable.rs:33:17
|
LL | const fn foo<T: [const] Bar>(x: &T) {
| ^^^^^^^ can't be applied to `Bar`
|
note: `Bar` can't be used with `[const]` because it isn't `const`
--> $DIR/const-supertrait-unstable.rs:25:1
--> $DIR/const-supertrait-unstable.rs:26:1
|
LL | trait Bar: [const] Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
--> $DIR/const-supertrait-unstable.rs:36:7
--> $DIR/const-supertrait-unstable.rs:37:7
|
LL | x.a();
| ^^^
|
note: method `a` is not const because trait `Foo` is not const
--> $DIR/const-supertrait-unstable.rs:21:1
--> $DIR/const-supertrait-unstable.rs:22:1
|
LL | trait Foo {
| ^^^^^^^^^ this trait is not const
Expand Down
Loading