Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async fn should be disallowed entirely on 2015 edition #58652

Closed
nikomatsakis opened this Issue Feb 22, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@nikomatsakis
Copy link
Contributor

nikomatsakis commented Feb 22, 2019

As described in #53714, we currently permit a small amount of async notation in 2015, but we can't extend that to the complete feature set (e.g., await keywords etc). This was done as part of a transitionary tactic (so people could move to Rust 2018) but by now that is not necessary. We should just prohibit async fn in Rust 2015 entirely at this point.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Feb 22, 2019

Note we should also test nested async fn in fns, as described in #51933

@doctorn

This comment has been minimized.

Copy link
Contributor

doctorn commented Feb 22, 2019

Hello, I'd like to have a go at this

Centril added a commit to Centril/rust that referenced this issue Feb 27, 2019

Rollup merge of rust-lang#58678 - doctorn:refuse-async-fn-2015-editio…
…n, r=varkor

Deny `async fn` in 2015 edition

This commit prevents code using `async fn` from being compiled in Rust 2015 edition.

Compiling code of the form:

```rust
async fn foo() {}
```

Will now result in the error:

```
error[E0670]: `async fn` is not permitted in the 2015 edition
 --> async.rs:1:1
  |
1 | async fn foo() {}
  | ^^^^^

error: aborting due to error

For more information about an error, try `rustc --explain E0670`.
```

This resolves rust-lang#58652 and also resolves rust-lang#53714.

r? @varkor

Centril added a commit to Centril/rust that referenced this issue Feb 27, 2019

Rollup merge of rust-lang#58678 - doctorn:refuse-async-fn-2015-editio…
…n, r=varkor

Deny `async fn` in 2015 edition

This commit prevents code using `async fn` from being compiled in Rust 2015 edition.

Compiling code of the form:

```rust
async fn foo() {}
```

Will now result in the error:

```
error[E0670]: `async fn` is not permitted in the 2015 edition
 --> async.rs:1:1
  |
1 | async fn foo() {}
  | ^^^^^

error: aborting due to error

For more information about an error, try `rustc --explain E0670`.
```

This resolves rust-lang#58652 and also resolves rust-lang#53714.

r? @varkor

Centril added a commit to Centril/rust that referenced this issue Feb 27, 2019

Rollup merge of rust-lang#58678 - doctorn:refuse-async-fn-2015-editio…
…n, r=varkor

Deny `async fn` in 2015 edition

This commit prevents code using `async fn` from being compiled in Rust 2015 edition.

Compiling code of the form:

```rust
async fn foo() {}
```

Will now result in the error:

```
error[E0670]: `async fn` is not permitted in the 2015 edition
 --> async.rs:1:1
  |
1 | async fn foo() {}
  | ^^^^^

error: aborting due to error

For more information about an error, try `rustc --explain E0670`.
```

This resolves rust-lang#58652 and also resolves rust-lang#53714.

r? @varkor

Centril added a commit to Centril/rust that referenced this issue Feb 27, 2019

Rollup merge of rust-lang#58678 - doctorn:refuse-async-fn-2015-editio…
…n, r=varkor

Deny `async fn` in 2015 edition

This commit prevents code using `async fn` from being compiled in Rust 2015 edition.

Compiling code of the form:

```rust
async fn foo() {}
```

Will now result in the error:

```
error[E0670]: `async fn` is not permitted in the 2015 edition
 --> async.rs:1:1
  |
1 | async fn foo() {}
  | ^^^^^

error: aborting due to error

For more information about an error, try `rustc --explain E0670`.
```

This resolves rust-lang#58652 and also resolves rust-lang#53714.

r? @varkor

Centril added a commit to Centril/rust that referenced this issue Feb 27, 2019

Rollup merge of rust-lang#58678 - doctorn:refuse-async-fn-2015-editio…
…n, r=varkor

Deny `async fn` in 2015 edition

This commit prevents code using `async fn` from being compiled in Rust 2015 edition.

Compiling code of the form:

```rust
async fn foo() {}
```

Will now result in the error:

```
error[E0670]: `async fn` is not permitted in the 2015 edition
 --> async.rs:1:1
  |
1 | async fn foo() {}
  | ^^^^^

error: aborting due to error

For more information about an error, try `rustc --explain E0670`.
```

This resolves rust-lang#58652 and also resolves rust-lang#53714.

r? @varkor

@bors bors closed this in #58678 Feb 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.