Upgrade to Rust 1.17.

- Remove some uses of 'static in const and static globals that are no
  longer needed.
- Use the new struct initialization shorthand.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-27 12:28:18 -07:00
parent eaf1ed09fc
commit ee5f035e31
31 changed files with 118 additions and 153 deletions

View File

@@ -17,7 +17,7 @@ mod cat;
mod print_cfg;
mod rsfilecheck;
const USAGE: &'static str = "
const USAGE: &str = "
Cretonne code generator utility
Usage:

View File

@@ -51,8 +51,8 @@ impl ConcurrentRunner {
ConcurrentRunner {
request_tx: Some(request_tx),
reply_rx: reply_rx,
handles: handles,
reply_rx,
handles,
}
}
@@ -120,10 +120,7 @@ fn worker_thread(thread_num: usize,
// Tell them we're starting this job.
// The receiver should always be present for this as long as we have jobs.
replies
.send(Reply::Starting {
jobid: jobid,
thread_num: thread_num,
})
.send(Reply::Starting { jobid, thread_num })
.unwrap();
let result = catch_unwind(|| runone::run(path.as_path())).unwrap_or_else(|e| {
@@ -142,12 +139,7 @@ fn worker_thread(thread_num: usize,
dbg!("FAIL: {}", msg);
}
replies
.send(Reply::Done {
jobid: jobid,
result: result,
})
.unwrap();
replies.send(Reply::Done { jobid, result }).unwrap();
}
})
.unwrap()

View File

@@ -81,7 +81,7 @@ impl TestRunner {
/// Create a new blank TrstRunner.
pub fn new(verbose: bool) -> TestRunner {
TestRunner {
verbose: verbose,
verbose,
dir_stack: Vec::new(),
tests: Vec::new(),
new_tests: 0,

View File

@@ -55,9 +55,9 @@ pub fn run(path: &Path) -> TestResult {
for (func, details) in testfile.functions {
let mut context = Context {
preamble_comments: &testfile.preamble_comments,
details: details,
details,
verified: false,
flags: flags,
flags,
isa: None,
};

View File

@@ -32,7 +32,7 @@ struct CFGPrinter<'a> {
impl<'a> CFGPrinter<'a> {
pub fn new(func: &'a Function) -> CFGPrinter<'a> {
CFGPrinter {
func: func,
func,
cfg: ControlFlowGraph::with_function(func),
}
}