Skip to content

Commit d169408

Browse files
committed
---
yaml --- r: 130716 b: refs/heads/master c: dd626b4 h: refs/heads/master v: v3
1 parent 33b0c52 commit d169408

File tree

14 files changed

+76
-39
lines changed

14 files changed

+76
-39
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 742f49c961426be422c479c7e47957c45e560ba6
2+
refs/heads/master: dd626b48c495cbcfdbac7319641bd74d2ec0b370
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6faa4f33a42de32579e02a8d030db920d360e2b5
55
refs/heads/try: a2473a89da106f7dd3be86e9d52fe23f43d5bfa5

trunk/src/libnative/io/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ pub fn read<T>(fd: sock_t,
959959
// wait for the socket to become readable again.
960960
let _guard = lock();
961961
match retry(|| read(deadline.is_some())) {
962-
-1 if util::wouldblock() => { assert!(deadline.is_some()); }
962+
-1 if util::wouldblock() => {}
963963
-1 => return Err(os::last_error()),
964964
n => { ret = n; break }
965965
}

trunk/src/librustc/back/link.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use util::ppaux;
2828
use util::sha2::{Digest, Sha256};
2929

3030
use std::char;
31-
use std::collections::HashSet;
3231
use std::io::{fs, TempDir, Command};
3332
use std::io;
3433
use std::mem;
@@ -570,10 +569,7 @@ fn link_binary_output(sess: &Session,
570569
fn archive_search_paths(sess: &Session) -> Vec<Path> {
571570
let mut rustpath = filesearch::rust_path();
572571
rustpath.push(sess.target_filesearch().get_lib_path());
573-
// FIXME: Addl lib search paths are an unordered HashSet?
574-
// Shouldn't this search be done in some order?
575-
let addl_lib_paths: HashSet<Path> = sess.opts.addl_lib_search_paths.borrow().clone();
576-
let mut search: Vec<Path> = addl_lib_paths.move_iter().collect();
572+
let mut search: Vec<Path> = sess.opts.addl_lib_search_paths.borrow().clone();
577573
search.push_all(rustpath.as_slice());
578574
return search;
579575
}

trunk/src/librustc/driver/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use syntax::diagnostic::{ColorConfig, Auto, Always, Never};
3030
use syntax::parse;
3131
use syntax::parse::token::InternedString;
3232

33-
use std::collections::{HashSet, HashMap};
33+
use std::collections::HashMap;
3434
use getopts::{optopt, optmulti, optflag, optflagopt};
3535
use getopts;
3636
use std::cell::{RefCell};
@@ -76,7 +76,7 @@ pub struct Options {
7676
// This was mutable for rustpkg, which updates search paths based on the
7777
// parsed code. It remains mutable in case its replacements wants to use
7878
// this.
79-
pub addl_lib_search_paths: RefCell<HashSet<Path>>,
79+
pub addl_lib_search_paths: RefCell<Vec<Path>>,
8080
pub maybe_sysroot: Option<Path>,
8181
pub target_triple: String,
8282
// User-specified cfg meta items. The compiler itself will add additional
@@ -113,7 +113,7 @@ pub fn basic_options() -> Options {
113113
lint_opts: Vec::new(),
114114
describe_lints: false,
115115
output_types: Vec::new(),
116-
addl_lib_search_paths: RefCell::new(HashSet::new()),
116+
addl_lib_search_paths: RefCell::new(Vec::new()),
117117
maybe_sysroot: None,
118118
target_triple: driver::host_triple().to_string(),
119119
cfg: Vec::new(),

trunk/src/librustc/metadata/filesearch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub type pick<'a> = |path: &Path|: 'a -> FileMatch;
3030

3131
pub struct FileSearch<'a> {
3232
pub sysroot: &'a Path,
33-
pub addl_lib_search_paths: &'a RefCell<HashSet<Path>>,
33+
pub addl_lib_search_paths: &'a RefCell<Vec<Path>>,
3434
pub triple: &'a str,
3535
}
3636

@@ -125,7 +125,7 @@ impl<'a> FileSearch<'a> {
125125

126126
pub fn new(sysroot: &'a Path,
127127
triple: &'a str,
128-
addl_lib_search_paths: &'a RefCell<HashSet<Path>>) -> FileSearch<'a> {
128+
addl_lib_search_paths: &'a RefCell<Vec<Path>>) -> FileSearch<'a> {
129129
debug!("using sysroot = {}, triple = {}", sysroot.display(), triple);
130130
FileSearch {
131131
sysroot: sysroot,

trunk/src/librustdoc/core.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -80,7 +80,7 @@ pub struct CrateAnalysis {
8080
pub type Externs = HashMap<String, Vec<String>>;
8181

8282
/// Parses, resolves, and typechecks the given crate
83-
fn get_ast_and_resolve(cpath: &Path, libs: HashSet<Path>, cfgs: Vec<String>,
83+
fn get_ast_and_resolve(cpath: &Path, libs: Vec<Path>, cfgs: Vec<String>,
8484
externs: Externs, triple: Option<String>)
8585
-> (DocContext, CrateAnalysis) {
8686
use syntax::codemap::dummy_spanned;
@@ -153,7 +153,7 @@ fn get_ast_and_resolve(cpath: &Path, libs: HashSet<Path>, cfgs: Vec<String>,
153153
})
154154
}
155155

156-
pub fn run_core(libs: HashSet<Path>, cfgs: Vec<String>, externs: Externs,
156+
pub fn run_core(libs: Vec<Path>, cfgs: Vec<String>, externs: Externs,
157157
path: &Path, triple: Option<String>)
158158
-> (clean::Crate, CrateAnalysis) {
159159
let (ctxt, analysis) = get_ast_and_resolve(path, libs, cfgs, externs, triple);

trunk/src/librustdoc/html/static/main.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
* A function to compute the Levenshtein distance between two strings
119119
* Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported
120120
* Full License can be found at http://creativecommons.org/licenses/by-sa/3.0/legalcode
121-
* This code is an unmodified version of the code written by Marco de Wit
121+
* This code is an unmodified version of the code written by Marco de Wit
122122
* and was found at http://stackoverflow.com/a/18514751/745719
123123
*/
124124
var levenshtein = (function() {
@@ -224,7 +224,7 @@
224224
});
225225
}
226226
} else if (
227-
(lev_distance = levenshtein(searchWords[j], val)) <=
227+
(lev_distance = levenshtein(searchWords[j], val)) <=
228228
MAX_LEV_DISTANCE) {
229229
if (typeFilter < 0 || typeFilter === searchIndex[j].ty) {
230230
results.push({
@@ -350,16 +350,16 @@
350350
function validateResult(name, path, keys, parent) {
351351
for (var i=0; i < keys.length; ++i) {
352352
// each check is for validation so we negate the conditions and invalidate
353-
if (!(
353+
if (!(
354354
// check for an exact name match
355355
name.toLowerCase().indexOf(keys[i]) > -1 ||
356356
// then an exact path match
357357
path.toLowerCase().indexOf(keys[i]) > -1 ||
358358
// next if there is a parent, check for exact parent match
359-
(parent !== undefined &&
359+
(parent !== undefined &&
360360
parent.name.toLowerCase().indexOf(keys[i]) > -1) ||
361361
// lastly check to see if the name was a levenshtein match
362-
levenshtein(name.toLowerCase(), keys[i]) <=
362+
levenshtein(name.toLowerCase(), keys[i]) <=
363363
MAX_LEV_DISTANCE)) {
364364
return false;
365365
}
@@ -757,20 +757,21 @@
757757
});
758758

759759
$(function() {
760-
var toggle = "<a href='javascript:void(0)'"
761-
+ "class='collapse-toggle'>[<span class='inner'>-</span>]</a>";
760+
var toggle = $("<a/>", {'href': 'javascript:void(0)', 'class': 'collapse-toggle'})
761+
.html("[<span class='inner'>-</span>]");
762762

763763
$(".method").each(function() {
764764
if ($(this).next().is(".docblock")) {
765-
$(this).children().first().after(toggle);
765+
$(this).children().first().after(toggle[0]);
766766
}
767767
});
768768

769-
var mainToggle = $(toggle);
770-
mainToggle.append("<span class='toggle-label' style='display:none'>"
771-
+ "&nbsp;Expand&nbsp;description</span></a>")
772-
var wrapper = $("<div class='toggle-wrapper'>");
773-
wrapper.append(mainToggle);
769+
var mainToggle =
770+
$(toggle).append(
771+
$('<span/>', {'class': 'toggle-label'})
772+
.css('display', 'none')
773+
.html('&nbsp;Expand&nbsp;description'));
774+
var wrapper = $("<div class='toggle-wrapper'>").append(mainToggle);
774775
$("#main > .docblock").before(wrapper);
775776
});
776777

trunk/src/librustdoc/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,7 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche
369369
info!("starting to run rustc");
370370
let (mut krate, analysis) = std::task::try(proc() {
371371
let cr = cr;
372-
core::run_core(libs.move_iter().collect(),
373-
cfgs,
374-
externs,
375-
&cr,
376-
triple)
372+
core::run_core(libs, cfgs, externs, &cr, triple)
377373
}).map_err(|boxed_any|format!("{:?}", boxed_any)).unwrap();
378374
info!("finished with rustc");
379375
analysiskey.replace(Some(analysis));

trunk/src/librustdoc/markdown.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::collections::HashSet;
1211
use std::io;
1312
use std::string::String;
1413

@@ -136,7 +135,7 @@ pub fn render(input: &str, mut output: Path, matches: &getopts::Matches,
136135
}
137136

138137
/// Run any tests/code examples in the markdown file `input`.
139-
pub fn test(input: &str, libs: HashSet<Path>, externs: core::Externs,
138+
pub fn test(input: &str, libs: Vec<Path>, externs: core::Externs,
140139
mut test_args: Vec<String>) -> int {
141140
let input_str = load_or_return!(input, 1, 2);
142141

trunk/src/librustdoc/test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use visit_ast::RustdocVisitor;
3939

4040
pub fn run(input: &str,
4141
cfgs: Vec<String>,
42-
libs: HashSet<Path>,
42+
libs: Vec<Path>,
4343
externs: core::Externs,
4444
mut test_args: Vec<String>,
4545
crate_name: Option<String>)
@@ -109,7 +109,7 @@ pub fn run(input: &str,
109109
0
110110
}
111111

112-
fn runtest(test: &str, cratename: &str, libs: HashSet<Path>, externs: core::Externs,
112+
fn runtest(test: &str, cratename: &str, libs: Vec<Path>, externs: core::Externs,
113113
should_fail: bool, no_run: bool, as_test_harness: bool) {
114114
// the test harness wants its own `main` & top level functions, so
115115
// never wrap the test in `fn main() { ... }`
@@ -244,7 +244,7 @@ pub fn maketest(s: &str, cratename: Option<&str>, lints: bool, dont_insert_main:
244244
pub struct Collector {
245245
pub tests: Vec<testing::TestDescAndFn>,
246246
names: Vec<String>,
247-
libs: HashSet<Path>,
247+
libs: Vec<Path>,
248248
externs: core::Externs,
249249
cnt: uint,
250250
use_headers: bool,
@@ -253,7 +253,7 @@ pub struct Collector {
253253
}
254254

255255
impl Collector {
256-
pub fn new(cratename: String, libs: HashSet<Path>, externs: core::Externs,
256+
pub fn new(cratename: String, libs: Vec<Path>, externs: core::Externs,
257257
use_headers: bool) -> Collector {
258258
Collector {
259259
tests: Vec::new(),
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-include ../tools.mk
2+
3+
# Verifies that the -L arguments given to the linker is in the same order
4+
# as the -L arguments on the rustc command line.
5+
6+
CORRECT_DIR=$(TMPDIR)/correct
7+
WRONG_DIR=$(TMPDIR)/wrong
8+
9+
all: $(TMPDIR)/libcorrect.a $(TMPDIR)/libwrong.a
10+
mkdir -p $(CORRECT_DIR) $(WRONG_DIR)
11+
mv $(TMPDIR)/libcorrect.a $(CORRECT_DIR)/libfoo.a
12+
mv $(TMPDIR)/libwrong.a $(WRONG_DIR)/libfoo.a
13+
$(RUSTC) main.rs -o $(TMPDIR)/should_succeed -L $(CORRECT_DIR) -L $(WRONG_DIR)
14+
$(call RUN,should_succeed)
15+
$(RUSTC) main.rs -o $(TMPDIR)/should_fail -L $(WRONG_DIR) -L $(CORRECT_DIR)
16+
$(call FAIL,should_fail)
17+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int should_return_one() { return 1; }
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
extern crate libc;
12+
13+
#[link(name="foo")]
14+
extern {
15+
fn should_return_one() -> libc::c_int;
16+
}
17+
18+
fn main() {
19+
let result = unsafe {
20+
should_return_one()
21+
};
22+
23+
if result != 1 {
24+
std::os::set_exit_status(255);
25+
}
26+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int should_return_one() { return 0; }

0 commit comments

Comments
 (0)