Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ declare_features! (
// unanticipated results, such as compiler crashes. We warn the user about these
// to alert them.
const INCOMPLETE_FEATURES: &[Symbol] = &[
sym::impl_trait_in_bindings,
sym::generic_associated_types,
sym::const_generics
];
Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass/impl-trait-in-bindings.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(impl_trait_in_bindings)]
//~^ WARN the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash

use std::fmt::Debug;

Expand Down
6 changes: 6 additions & 0 deletions src/test/run-pass/impl-trait-in-bindings.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
--> $DIR/impl-trait-in-bindings.rs:1:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^

1 change: 1 addition & 0 deletions src/test/ui/impl-trait/bindings-opaque.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(impl_trait_in_bindings)]
//~^ WARN the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash

const FOO: impl Copy = 42;

Expand Down
12 changes: 9 additions & 3 deletions src/test/ui/impl-trait/bindings-opaque.stderr
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
--> $DIR/bindings-opaque.rs:1:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^

error[E0599]: no method named `count_ones` found for type `impl std::marker::Copy` in the current scope
--> $DIR/bindings-opaque.rs:10:17
--> $DIR/bindings-opaque.rs:11:17
|
LL | let _ = FOO.count_ones();
| ^^^^^^^^^^

error[E0599]: no method named `count_ones` found for type `impl std::marker::Copy` in the current scope
--> $DIR/bindings-opaque.rs:12:17
--> $DIR/bindings-opaque.rs:13:17
|
LL | let _ = BAR.count_ones();
| ^^^^^^^^^^

error[E0599]: no method named `count_ones` found for type `impl std::marker::Copy` in the current scope
--> $DIR/bindings-opaque.rs:14:17
--> $DIR/bindings-opaque.rs:15:17
|
LL | let _ = foo.count_ones();
| ^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/impl-trait/bindings.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(impl_trait_in_bindings)]
//~^ WARN the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash

fn a<T: Clone>(x: T) {
const foo: impl Clone = x;
Expand Down
14 changes: 10 additions & 4 deletions src/test/ui/impl-trait/bindings.stderr
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
--> $DIR/bindings.rs:1:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^

error[E0435]: attempt to use a non-constant value in a constant
--> $DIR/bindings.rs:4:29
--> $DIR/bindings.rs:5:29
|
LL | const foo: impl Clone = x;
| ^ non-constant value

error[E0435]: attempt to use a non-constant value in a constant
--> $DIR/bindings.rs:10:33
--> $DIR/bindings.rs:11:33
|
LL | const foo: impl Clone = x;
| ^ non-constant value

error[E0435]: attempt to use a non-constant value in a constant
--> $DIR/bindings.rs:17:33
--> $DIR/bindings.rs:18:33
|
LL | const foo: impl Clone = x;
| ^ non-constant value

error[E0435]: attempt to use a non-constant value in a constant
--> $DIR/bindings.rs:24:33
--> $DIR/bindings.rs:25:33
|
LL | const foo: impl Clone = x;
| ^ non-constant value
Expand Down