Skip to content

Commit 5530745

Browse files
committed
core: rename strbuf::StrBuf to string::String
[breaking-change]
1 parent bbb70cd commit 5530745

File tree

395 files changed

+1766
-1766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

395 files changed

+1766
-1766
lines changed

src/compiletest/common.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ impl fmt::Show for Mode {
5656
#[deriving(Clone)]
5757
pub struct Config {
5858
// The library paths required for running the compiler
59-
pub compile_lib_path: StrBuf,
59+
pub compile_lib_path: String,
6060

6161
// The library paths required for running compiled programs
62-
pub run_lib_path: StrBuf,
62+
pub run_lib_path: String,
6363

6464
// The rustc executable
6565
pub rustc_path: Path,
@@ -80,7 +80,7 @@ pub struct Config {
8080
pub aux_base: Path,
8181

8282
// The name of the stage being built (stage1, etc)
83-
pub stage_id: StrBuf,
83+
pub stage_id: String,
8484

8585
// The test mode, compile-fail, run-fail, run-pass
8686
pub mode: Mode,
@@ -113,37 +113,37 @@ pub struct Config {
113113

114114
// A command line to prefix program execution with,
115115
// for running under valgrind
116-
pub runtool: Option<StrBuf>,
116+
pub runtool: Option<String>,
117117

118118
// Flags to pass to the compiler when building for the host
119-
pub host_rustcflags: Option<StrBuf>,
119+
pub host_rustcflags: Option<String>,
120120

121121
// Flags to pass to the compiler when building for the target
122-
pub target_rustcflags: Option<StrBuf>,
122+
pub target_rustcflags: Option<String>,
123123

124124
// Run tests using the JIT
125125
pub jit: bool,
126126

127127
// Target system to be tested
128-
pub target: StrBuf,
128+
pub target: String,
129129

130130
// Host triple for the compiler being invoked
131-
pub host: StrBuf,
131+
pub host: String,
132132

133133
// Path to the android tools
134134
pub android_cross_path: Path,
135135

136136
// Extra parameter to run adb on arm-linux-androideabi
137-
pub adb_path: StrBuf,
137+
pub adb_path: String,
138138

139139
// Extra parameter to run test sute on arm-linux-androideabi
140-
pub adb_test_dir: StrBuf,
140+
pub adb_test_dir: String,
141141

142142
// status whether android device available or not
143143
pub adb_device_status: bool,
144144

145145
// the path containing LLDB's Python module
146-
pub lldb_python_dir: Option<StrBuf>,
146+
pub lldb_python_dir: Option<String>,
147147

148148
// Explain what's going on
149149
pub verbose: bool

src/compiletest/compiletest.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub fn main() {
5656
run_tests(&config);
5757
}
5858

59-
pub fn parse_config(args: Vec<StrBuf> ) -> Config {
59+
pub fn parse_config(args: Vec<String> ) -> Config {
6060

6161
let groups : Vec<getopts::OptGroup> =
6262
vec!(reqopt("", "compile-lib-path", "path to host shared libraries", "PATH"),
@@ -225,14 +225,14 @@ pub fn log_config(config: &Config) {
225225
logv(c, format_strbuf!("\n"));
226226
}
227227

228-
pub fn opt_str<'a>(maybestr: &'a Option<StrBuf>) -> &'a str {
228+
pub fn opt_str<'a>(maybestr: &'a Option<String>) -> &'a str {
229229
match *maybestr {
230230
None => "(none)",
231231
Some(ref s) => s.as_slice(),
232232
}
233233
}
234234

235-
pub fn opt_str2(maybestr: Option<StrBuf>) -> StrBuf {
235+
pub fn opt_str2(maybestr: Option<String>) -> String {
236236
match maybestr {
237237
None => "(none)".to_strbuf(),
238238
Some(s) => s,
@@ -352,7 +352,7 @@ pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
352352
pub fn make_test_name(config: &Config, testfile: &Path) -> test::TestName {
353353

354354
// Try to elide redundant long paths
355-
fn shorten(path: &Path) -> StrBuf {
355+
fn shorten(path: &Path) -> String {
356356
let filename = path.filename_str();
357357
let p = path.dir_path();
358358
let dir = p.filename_str();

src/compiletest/errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use regex::Regex;
1313

1414
pub struct ExpectedError {
1515
pub line: uint,
16-
pub kind: StrBuf,
17-
pub msg: StrBuf,
16+
pub kind: String,
17+
pub msg: String,
1818
}
1919

2020
pub static EXPECTED_PATTERN : &'static str = r"//~(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";

src/compiletest/header.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ use util;
1414

1515
pub struct TestProps {
1616
// Lines that should be expected, in order, on standard out
17-
pub error_patterns: Vec<StrBuf> ,
17+
pub error_patterns: Vec<String> ,
1818
// Extra flags to pass to the compiler
19-
pub compile_flags: Option<StrBuf>,
19+
pub compile_flags: Option<String>,
2020
// Extra flags to pass when the compiled code is run (such as --bench)
21-
pub run_flags: Option<StrBuf>,
21+
pub run_flags: Option<String>,
2222
// If present, the name of a file that this test should match when
2323
// pretty-printed
2424
pub pp_exact: Option<Path>,
2525
// Modules from aux directory that should be compiled
26-
pub aux_builds: Vec<StrBuf> ,
26+
pub aux_builds: Vec<String> ,
2727
// Environment settings to use during execution
28-
pub exec_env: Vec<(StrBuf,StrBuf)> ,
28+
pub exec_env: Vec<(String,String)> ,
2929
// Lines to check if they appear in the expected debugger output
30-
pub check_lines: Vec<StrBuf> ,
30+
pub check_lines: Vec<String> ,
3131
// Flag to force a crate to be built with the host architecture
3232
pub force_host: bool,
3333
// Check stdout for error-pattern output as well as stderr
@@ -119,10 +119,10 @@ pub fn load_props(testfile: &Path) -> TestProps {
119119
}
120120

121121
pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
122-
fn ignore_target(config: &Config) -> StrBuf {
122+
fn ignore_target(config: &Config) -> String {
123123
format_strbuf!("ignore-{}", util::get_os(config.target.as_slice()))
124124
}
125-
fn ignore_stage(config: &Config) -> StrBuf {
125+
fn ignore_stage(config: &Config) -> String {
126126
format_strbuf!("ignore-{}",
127127
config.stage_id.as_slice().split('-').next().unwrap())
128128
}
@@ -169,23 +169,23 @@ fn iter_header(testfile: &Path, it: |&str| -> bool) -> bool {
169169
return true;
170170
}
171171

172-
fn parse_error_pattern(line: &str) -> Option<StrBuf> {
172+
fn parse_error_pattern(line: &str) -> Option<String> {
173173
parse_name_value_directive(line, "error-pattern".to_strbuf())
174174
}
175175

176-
fn parse_aux_build(line: &str) -> Option<StrBuf> {
176+
fn parse_aux_build(line: &str) -> Option<String> {
177177
parse_name_value_directive(line, "aux-build".to_strbuf())
178178
}
179179

180-
fn parse_compile_flags(line: &str) -> Option<StrBuf> {
180+
fn parse_compile_flags(line: &str) -> Option<String> {
181181
parse_name_value_directive(line, "compile-flags".to_strbuf())
182182
}
183183

184-
fn parse_run_flags(line: &str) -> Option<StrBuf> {
184+
fn parse_run_flags(line: &str) -> Option<String> {
185185
parse_name_value_directive(line, "run-flags".to_strbuf())
186186
}
187187

188-
fn parse_check_line(line: &str) -> Option<StrBuf> {
188+
fn parse_check_line(line: &str) -> Option<String> {
189189
parse_name_value_directive(line, "check".to_strbuf())
190190
}
191191

@@ -205,10 +205,10 @@ fn parse_no_pretty_expanded(line: &str) -> bool {
205205
parse_name_directive(line, "no-pretty-expanded")
206206
}
207207

208-
fn parse_exec_env(line: &str) -> Option<(StrBuf, StrBuf)> {
208+
fn parse_exec_env(line: &str) -> Option<(String, String)> {
209209
parse_name_value_directive(line, "exec-env".to_strbuf()).map(|nv| {
210210
// nv is either FOO or FOO=BAR
211-
let mut strs: Vec<StrBuf> = nv.as_slice()
211+
let mut strs: Vec<String> = nv.as_slice()
212212
.splitn('=', 1)
213213
.map(|s| s.to_strbuf())
214214
.collect();
@@ -241,8 +241,8 @@ fn parse_name_directive(line: &str, directive: &str) -> bool {
241241
line.contains(directive)
242242
}
243243

244-
pub fn parse_name_value_directive(line: &str, directive: StrBuf)
245-
-> Option<StrBuf> {
244+
pub fn parse_name_value_directive(line: &str, directive: String)
245+
-> Option<String> {
246246
let keycolon = format_strbuf!("{}:", directive);
247247
match line.find_str(keycolon.as_slice()) {
248248
Some(colon) => {

src/compiletest/procsrv.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::str;
1313
use std::io::process::{ProcessExit, Command, Process, ProcessOutput};
1414
use std::unstable::dynamic_lib::DynamicLibrary;
1515

16-
fn target_env(lib_path: &str, prog: &str) -> Vec<(StrBuf, StrBuf)> {
16+
fn target_env(lib_path: &str, prog: &str) -> Vec<(String, String)> {
1717
let prog = if cfg!(windows) {prog.slice_to(prog.len() - 4)} else {prog};
1818
let mut aux_path = prog.to_strbuf();
1919
aux_path.push_str(".libaux");
@@ -26,7 +26,7 @@ fn target_env(lib_path: &str, prog: &str) -> Vec<(StrBuf, StrBuf)> {
2626

2727
// Remove the previous dylib search path var
2828
let var = DynamicLibrary::envvar();
29-
let mut env: Vec<(StrBuf,StrBuf)> =
29+
let mut env: Vec<(String,String)> =
3030
os::env().move_iter().map(|(a,b)|(a.to_strbuf(), b.to_strbuf())).collect();
3131
match env.iter().position(|&(ref k, _)| k.as_slice() == var) {
3232
Some(i) => { env.remove(i); }
@@ -40,13 +40,13 @@ fn target_env(lib_path: &str, prog: &str) -> Vec<(StrBuf, StrBuf)> {
4040
return env;
4141
}
4242

43-
pub struct Result {pub status: ProcessExit, pub out: StrBuf, pub err: StrBuf}
43+
pub struct Result {pub status: ProcessExit, pub out: String, pub err: String}
4444

4545
pub fn run(lib_path: &str,
4646
prog: &str,
47-
args: &[StrBuf],
48-
env: Vec<(StrBuf, StrBuf)> ,
49-
input: Option<StrBuf>) -> Option<Result> {
47+
args: &[String],
48+
env: Vec<(String, String)> ,
49+
input: Option<String>) -> Option<Result> {
5050

5151
let env = env.clone().append(target_env(lib_path, prog).as_slice());
5252
match Command::new(prog).args(args).env(env.as_slice()).spawn() {
@@ -69,9 +69,9 @@ pub fn run(lib_path: &str,
6969

7070
pub fn run_background(lib_path: &str,
7171
prog: &str,
72-
args: &[StrBuf],
73-
env: Vec<(StrBuf, StrBuf)> ,
74-
input: Option<StrBuf>) -> Option<Process> {
72+
args: &[String],
73+
env: Vec<(String, String)> ,
74+
input: Option<String>) -> Option<Process> {
7575

7676
let env = env.clone().append(target_env(lib_path, prog).as_slice());
7777
match Command::new(prog).args(args).env(env.as_slice()).spawn() {

0 commit comments

Comments
 (0)