atom-community / atom-community/atom-script

Unable to run rust files begin with #![...]

Open
#524 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
730
Forks
264
PR merge metrics
No merged PRs in 30d

Description

A rust file usually begin with #![...]. But script can run it.

Here is my case:

```
#![feature(fnbox)]

use std::boxed::FnBox;

// Return a closure taking no inputs and returning nothing
// which implements `FnBox` (capture by value).
fn create_fn() -> Box {
let text = "Fn".to_owned();

Box::new(move || println!("This is a: {}", text))
}

fn create_fnmut() -> Box {
let text = "FnMut".to_owned();

Box::new(move || println!("This is a: {}", text))
}

fn create_fnbox() -> Box {
let text = "FnBox".to_owned();

Box::new(move || println!("This is a: {}", text))
}

fn main() {
let fn_plain = create_fn();
let mut fn_mut = create_fnmut();
let fn_box = create_fnbox();

fn_plain();
fn_mut();
fn_box();
}
```

Script reports that:

```
Unable to run

[feature(fnbox)]
Is it in your PATH?
...
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.