-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2d13c6
commit 9ddb85f
Showing
9 changed files
with
173 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#[cfg(any())] | ||
fn test() { | ||
let x: unsafe<> (); | ||
//~^ ERROR unsafe binder types are experimental | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error[E0658]: unsafe binder types are experimental | ||
--> $DIR/feature-gate-unsafe-binders.rs:3:12 | ||
| | ||
LL | let x: unsafe<> (); | ||
| ^^^^^^^^^^^ | ||
| | ||
= note: see issue #130516 <https://github.com/rust-lang/rust/issues/130516> for more information | ||
= help: add `#![feature(unsafe_binders)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#![feature(unsafe_binders)] | ||
//~^ WARN the feature `unsafe_binders` is incomplete | ||
|
||
use std::unsafe_binder::{wrap_binder, unwrap_binder}; | ||
|
||
fn main() { | ||
let x = 1; | ||
let binder: unsafe<'a> &'a i32 = wrap_binder!(x); | ||
//~^ ERROR unsafe binders are not yet implemented | ||
//~| ERROR unsafe binders are not yet implemented | ||
let rx = *unwrap_binder!(binder); | ||
//~^ ERROR unsafe binders are not yet implemented | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
warning: the feature `unsafe_binders` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/expr.rs:1:12 | ||
| | ||
LL | #![feature(unsafe_binders)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #130516 <https://github.com/rust-lang/rust/issues/130516> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: unsafe binders are not yet implemented | ||
--> $DIR/expr.rs:8:17 | ||
| | ||
LL | let binder: unsafe<'a> &'a i32 = wrap_binder!(x); | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error: unsafe binders are not yet implemented | ||
--> $DIR/expr.rs:8:51 | ||
| | ||
LL | let binder: unsafe<'a> &'a i32 = wrap_binder!(x); | ||
| ^ | ||
|
||
error: unsafe binders are not yet implemented | ||
--> $DIR/expr.rs:11:30 | ||
| | ||
LL | let rx = *unwrap_binder!(binder); | ||
| ^^^^^^ | ||
|
||
error: aborting due to 3 previous errors; 1 warning emitted | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#![feature(unsafe_binders)] | ||
//~^ WARN the feature `unsafe_binders` is incomplete | ||
|
||
fn foo<'a>() { | ||
let good: unsafe<'b> &'a &'b (); | ||
//~^ ERROR unsafe binders are not yet implemented | ||
|
||
let missing: unsafe<> &'missing (); | ||
//~^ ERROR unsafe binders are not yet implemented | ||
//~| ERROR use of undeclared lifetime name `'missing` | ||
|
||
fn inner<'b>() { | ||
let outer: unsafe<> &'a &'b (); | ||
//~^ ERROR unsafe binders are not yet implemented | ||
//~| can't use generic parameters from outer item | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
error[E0261]: use of undeclared lifetime name `'missing` | ||
--> $DIR/lifetime-resolution.rs:8:28 | ||
| | ||
LL | let missing: unsafe<> &'missing (); | ||
| ^^^^^^^^ undeclared lifetime | ||
| | ||
= note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html | ||
help: consider making the type lifetime-generic with a new `'missing` lifetime | ||
| | ||
LL | let missing: unsafe<'missing, > &'missing (); | ||
| +++++++++ | ||
help: consider introducing lifetime `'missing` here | ||
| | ||
LL | fn foo<'missing, 'a>() { | ||
| +++++++++ | ||
|
||
error[E0401]: can't use generic parameters from outer item | ||
--> $DIR/lifetime-resolution.rs:13:30 | ||
| | ||
LL | fn foo<'a>() { | ||
| -- lifetime parameter from outer item | ||
... | ||
LL | let outer: unsafe<> &'a &'b (); | ||
| ^^ use of generic parameter from outer item | ||
| | ||
help: consider making the type lifetime-generic with a new `'a` lifetime | ||
| | ||
LL | let outer: unsafe<'a, > &'a &'b (); | ||
| +++ | ||
help: consider introducing lifetime `'a` here | ||
| | ||
LL | fn inner<'a, 'b>() { | ||
| +++ | ||
|
||
warning: the feature `unsafe_binders` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/lifetime-resolution.rs:1:12 | ||
| | ||
LL | #![feature(unsafe_binders)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #130516 <https://github.com/rust-lang/rust/issues/130516> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: unsafe binders are not yet implemented | ||
--> $DIR/lifetime-resolution.rs:5:15 | ||
| | ||
LL | let good: unsafe<'b> &'a &'b (); | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: unsafe binders are not yet implemented | ||
--> $DIR/lifetime-resolution.rs:8:18 | ||
| | ||
LL | let missing: unsafe<> &'missing (); | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: unsafe binders are not yet implemented | ||
--> $DIR/lifetime-resolution.rs:13:20 | ||
| | ||
LL | let outer: unsafe<> &'a &'b (); | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 5 previous errors; 1 warning emitted | ||
|
||
Some errors have detailed explanations: E0261, E0401. | ||
For more information about an error, try `rustc --explain E0261`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#![feature(unsafe_binders)] | ||
//~^ WARN the feature `unsafe_binders` is incomplete | ||
|
||
fn main() { | ||
let x: unsafe<'a> &'a (); | ||
//~^ ERROR unsafe binders are not yet implemented | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
warning: the feature `unsafe_binders` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/simple.rs:1:12 | ||
| | ||
LL | #![feature(unsafe_binders)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #130516 <https://github.com/rust-lang/rust/issues/130516> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: unsafe binders are not yet implemented | ||
--> $DIR/simple.rs:5:12 | ||
| | ||
LL | let x: unsafe<'a> &'a (); | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
|