Skip to content

Commit 1add365

Browse files
committed
---
yaml --- r: 145983 b: refs/heads/try2 c: 6c08cc2 h: refs/heads/master i: 145981: f5f609d 145979: 6b55d62 145975: 2678c3b 145967: bc2230c 145951: 9bc60a9 145919: bdfcab4 v: v3
1 parent 6fb2550 commit 1add365

File tree

145 files changed

+7545
-4404
lines changed

Some content is hidden

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

145 files changed

+7545
-4404
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 75cedf8e62a0c8d8bfd9e15d4a1d3b554eccbdc2
8+
refs/heads/try2: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/tutorial-ffi.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -415,21 +415,18 @@ fn main() {
415415

416416
Most foreign code exposes a C ABI, and Rust uses the platform's C calling convention by default when
417417
calling foreign functions. Some foreign functions, most notably the Windows API, use other calling
418-
conventions. Rust provides the `abi` attribute as a way to hint to the compiler which calling
419-
convention to use:
418+
conventions. Rust provides a way to tell the compiler which convention to use:
420419

421420
~~~~
422421
#[cfg(target_os = "win32")]
423-
#[abi = "stdcall"]
424422
#[link_name = "kernel32"]
425-
extern {
423+
extern "stdcall" {
426424
fn SetEnvironmentVariableA(n: *u8, v: *u8) -> int;
427425
}
428426
~~~~
429427

430-
The `abi` attribute applies to a foreign module (it cannot be applied to a single function within a
431-
module), and must be either `"cdecl"` or `"stdcall"`. The compiler may eventually support other
432-
calling conventions.
428+
This applies to the entire `extern` block, and must be either `"cdecl"` or
429+
`"stdcall"`. The compiler may eventually support other calling conventions.
433430

434431
# Interoperability with foreign code
435432

branches/try2/src/compiletest/compiletest.rs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ pub fn parse_config(args: ~[~str]) -> config {
102102
}
103103

104104
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
105-
Path(m.opt_str(nm).unwrap())
105+
Path::new(m.opt_str(nm).unwrap())
106106
}
107107

108108
config {
109109
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
110110
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
111111
rustc_path: opt_path(matches, "rustc-path"),
112-
clang_path: matches.opt_str("clang-path").map(|s| Path(s)),
113-
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path(s)),
112+
clang_path: matches.opt_str("clang-path").map(|s| Path::new(s)),
113+
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path::new(s)),
114114
src_base: opt_path(matches, "src-base"),
115115
build_base: opt_path(matches, "build-base"),
116116
aux_base: opt_path(matches, "aux-base"),
@@ -123,10 +123,10 @@ pub fn parse_config(args: ~[~str]) -> config {
123123
} else {
124124
None
125125
},
126-
logfile: matches.opt_str("logfile").map(|s| Path(s)),
127-
save_metrics: matches.opt_str("save-metrics").map(|s| Path(s)),
126+
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
127+
save_metrics: matches.opt_str("save-metrics").map(|s| Path::new(s)),
128128
ratchet_metrics:
129-
matches.opt_str("ratchet-metrics").map(|s| Path(s)),
129+
matches.opt_str("ratchet-metrics").map(|s| Path::new(s)),
130130
ratchet_noise_percent:
131131
matches.opt_str("ratchet-noise-percent").and_then(|s| from_str::<f64>(s)),
132132
runtool: matches.opt_str("runtool"),
@@ -155,9 +155,9 @@ pub fn log_config(config: &config) {
155155
logv(c, format!("configuration:"));
156156
logv(c, format!("compile_lib_path: {}", config.compile_lib_path));
157157
logv(c, format!("run_lib_path: {}", config.run_lib_path));
158-
logv(c, format!("rustc_path: {}", config.rustc_path.to_str()));
159-
logv(c, format!("src_base: {}", config.src_base.to_str()));
160-
logv(c, format!("build_base: {}", config.build_base.to_str()));
158+
logv(c, format!("rustc_path: {}", config.rustc_path.display()));
159+
logv(c, format!("src_base: {}", config.src_base.display()));
160+
logv(c, format!("build_base: {}", config.build_base.display()));
161161
logv(c, format!("stage_id: {}", config.stage_id));
162162
logv(c, format!("mode: {}", mode_str(config.mode)));
163163
logv(c, format!("run_ignored: {}", config.run_ignored));
@@ -245,12 +245,12 @@ pub fn test_opts(config: &config) -> test::TestOpts {
245245

246246
pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
247247
debug2!("making tests from {}",
248-
config.src_base.to_str());
248+
config.src_base.display());
249249
let mut tests = ~[];
250250
let dirs = os::list_dir_path(&config.src_base);
251251
for file in dirs.iter() {
252252
let file = file.clone();
253-
debug2!("inspecting file {}", file.to_str());
253+
debug2!("inspecting file {}", file.display());
254254
if is_test(config, &file) {
255255
let t = do make_test(config, &file) {
256256
match config.mode {
@@ -272,7 +272,7 @@ pub fn is_test(config: &config, testfile: &Path) -> bool {
272272
_ => ~[~".rc", ~".rs"]
273273
};
274274
let invalid_prefixes = ~[~".", ~"#", ~"~"];
275-
let name = testfile.filename().unwrap();
275+
let name = testfile.filename_str().unwrap();
276276

277277
let mut valid = false;
278278

@@ -303,9 +303,9 @@ pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
303303

304304
// Try to elide redundant long paths
305305
fn shorten(path: &Path) -> ~str {
306-
let filename = path.filename();
307-
let p = path.pop();
308-
let dir = p.filename();
306+
let filename = path.filename_str();
307+
let p = path.dir_path();
308+
let dir = p.filename_str();
309309
format!("{}/{}", dir.unwrap_or(""), filename.unwrap_or(""))
310310
}
311311

@@ -317,13 +317,15 @@ pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
317317
pub fn make_test_closure(config: &config, testfile: &Path) -> test::TestFn {
318318
use std::cell::Cell;
319319
let config = Cell::new((*config).clone());
320-
let testfile = Cell::new(testfile.to_str());
320+
// FIXME (#9639): This needs to handle non-utf8 paths
321+
let testfile = Cell::new(testfile.as_str().unwrap().to_owned());
321322
test::DynTestFn(|| { runtest::run(config.take(), testfile.take()) })
322323
}
323324

324325
pub fn make_metrics_test_closure(config: &config, testfile: &Path) -> test::TestFn {
325326
use std::cell::Cell;
326327
let config = Cell::new((*config).clone());
327-
let testfile = Cell::new(testfile.to_str());
328+
// FIXME (#9639): This needs to handle non-utf8 paths
329+
let testfile = Cell::new(testfile.as_str().unwrap().to_owned());
328330
test::DynMetricFn(|mm| { runtest::run_metrics(config.take(), testfile.take(), mm) })
329331
}

branches/try2/src/compiletest/header.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ fn parse_exec_env(line: &str) -> Option<(~str, ~str)> {
161161

162162
fn parse_pp_exact(line: &str, testfile: &Path) -> Option<Path> {
163163
match parse_name_value_directive(line, ~"pp-exact") {
164-
Some(s) => Some(Path(s)),
164+
Some(s) => Some(Path::new(s)),
165165
None => {
166166
if parse_name_directive(line, "pp-exact") {
167-
Some(testfile.file_path())
167+
testfile.filename().map(|s| Path::new(s))
168168
} else {
169169
None
170170
}

0 commit comments

Comments
 (0)