Skip to content

Commit e058179

Browse files
Merge pull request RustPython#458 from ZapAnton/2018_edition
Migrated the project to the Rust 2018 edition
2 parents a2ff87b + f1654cb commit e058179

File tree

14 files changed

+21
-20
lines changed

14 files changed

+21
-20
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "rustpython"
33
version = "0.0.1"
44
authors = ["Windel Bouwman", "Shing Lyu <[email protected]>"]
5+
edition = "2018"
56

67
[workspace]
78
members = [".", "vm", "wasm/lib", "parser"]

parser/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "rustpython_parser"
33
version = "0.0.1"
44
authors = [ "Shing Lyu", "Windel Bouwman" ]
55
build = "build.rs"
6+
edition = "2018"
67

78
[build-dependencies]
89
lalrpop="0.15.1"

parser/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
extern crate lalrpop;
1+
use lalrpop;
22

33
fn main() {
44
lalrpop::process_root().unwrap();

parser/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
extern crate lalrpop_util;
44
use self::lalrpop_util::ParseError as InnerError;
55

6-
use lexer::{LexicalError, Location};
7-
use token::Tok;
6+
use crate::lexer::{LexicalError, Location};
7+
use crate::token::Tok;
88

99
use std::error::Error;
1010
use std::fmt;

parser/src/lexer.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -541,27 +541,27 @@ where
541541

542542
fn is_char(&self) -> bool {
543543
match self.chr0 {
544-
Some('a'...'z') | Some('A'...'Z') | Some('_') | Some('0'...'9') => true,
544+
Some('a'..='z') | Some('A'..='Z') | Some('_') | Some('0'..='9') => true,
545545
_ => false,
546546
}
547547
}
548548

549549
fn is_number(&self, radix: u32) -> bool {
550550
match radix {
551551
2 => match self.chr0 {
552-
Some('0'...'1') => true,
552+
Some('0'..='1') => true,
553553
_ => false,
554554
},
555555
8 => match self.chr0 {
556-
Some('0'...'7') => true,
556+
Some('0'..='7') => true,
557557
_ => false,
558558
},
559559
10 => match self.chr0 {
560-
Some('0'...'9') => true,
560+
Some('0'..='9') => true,
561561
_ => false,
562562
},
563563
16 => match self.chr0 {
564-
Some('0'...'9') | Some('a'...'f') | Some('A'...'F') => true,
564+
Some('0'..='9') | Some('a'..='f') | Some('A'..='F') => true,
565565
_ => false,
566566
},
567567
x => unimplemented!("Radix not implemented: {}", x),
@@ -686,8 +686,8 @@ where
686686
}
687687

688688
match self.chr0 {
689-
Some('0'...'9') => return Some(self.lex_number()),
690-
Some('_') | Some('a'...'z') | Some('A'...'Z') => return Some(self.lex_identifier()),
689+
Some('0'..='9') => return Some(self.lex_number()),
690+
Some('_') | Some('a'..='z') | Some('A'..='Z') => return Some(self.lex_identifier()),
691691
Some('#') => {
692692
self.lex_comment();
693693
continue;

parser/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#[macro_use]
22
extern crate log;
33

4-
extern crate num_bigint;
5-
extern crate num_traits;
6-
74
pub mod ast;
85
pub mod error;
96
pub mod lexer;

parser/src/parser.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate lalrpop_util;
2-
31
use std::iter;
42

53
use super::ast;

py_code_object/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "py_code_object"
33
version = "0.1.0"
44
authors = ["Shing Lyu <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
log = "0.3"

py_code_object/python_compiler/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "python_compiler"
33
version = "0.1.0"
44
authors = ["Shing Lyu <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
cpython = { git = "https://github.com/dgrunwald/rust-cpython.git" }

vm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "rustpython_vm"
33
version = "0.1.0"
44
authors = ["Shing Lyu <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
bitflags = "1.0.4"

vm/src/import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use super::compile;
99
use super::pyobject::{AttributeProtocol, DictProtocol, PyResult};
1010
use super::util;
1111
use super::vm::VirtualMachine;
12-
use obj::{objsequence, objstr};
12+
use crate::obj::{objsequence, objstr};
1313

1414
fn import_uncached_module(
1515
vm: &mut VirtualMachine,

vm/src/stdlib/random.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern crate rand;
55
use super::super::obj::{objfloat, objtype};
66
use super::super::pyobject::{PyContext, PyFuncArgs, PyObjectRef, PyResult, TypeProtocol};
77
use super::super::VirtualMachine;
8-
use stdlib::random::rand::distributions::{Distribution, Normal};
8+
use crate::stdlib::random::rand::distributions::{Distribution, Normal};
99

1010
pub fn mk_module(ctx: &PyContext) -> PyObjectRef {
1111
let py_mod = ctx.new_module(&"random".to_string(), ctx.new_scope(None));

vm/src/sysmodule.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use obj::objtype;
2-
use pyobject::{PyContext, PyFuncArgs, PyObjectRef, PyResult, TypeProtocol};
1+
use crate::obj::objtype;
2+
use crate::pyobject::{PyContext, PyFuncArgs, PyObjectRef, PyResult, TypeProtocol};
3+
use crate::vm::VirtualMachine;
34
use std::rc::Rc;
45
use std::{env, mem};
5-
use vm::VirtualMachine;
66

77
/*
88
* The magic sys module.

wasm/lib/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = ["Ryan Liddle <[email protected]>"]
55
license = "MIT"
66
description = "A Python-3 (CPython >= 3.5.0) Interpreter written in Rust, compiled to WASM"
77
repository = "https://github.com/RustPython/RustPython/tree/master/wasm/lib"
8+
edition = "2018"
89

910
[lib]
1011
crate-type = ["cdylib", "rlib"]

0 commit comments

Comments
 (0)