Skip to content

Commit 4d64441

Browse files
committed
auto merge of #12848 : alexcrichton/rust/rollup, r=alexcrichton
2 parents 3316a0e + 3f2434e commit 4d64441

36 files changed

+266
-140
lines changed

mk/docs.mk

+4-4
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ SHOULD_BUILD_PDF_DOC_$(1) = 1
147147
endef
148148
$(foreach docname,$(PDF_DOCS),$(eval $(call DEF_SHOULD_BUILD_PDF_DOC,$(docname))))
149149

150+
doc/footer.tex: $(D)/footer.inc | doc/
151+
@$(call E, pandoc: $@)
152+
$(CFG_PANDOC) --from=html --to=latex $< --output=$@
153+
150154
define DEF_DOC
151155

152156
# HTML (rustdoc)
@@ -163,10 +167,6 @@ doc/$(1).epub: $$(D)/$(1).md | doc/
163167
@$$(call E, pandoc: $$@)
164168
$$(CFG_PANDOC) $$(PANDOC_EPUB_OPTS) $$< --output=$$@
165169

166-
doc/footer.tex: $(D)/footer.inc | doc/
167-
@$$(call E, pandoc: $$@)
168-
$$(CFG_PANDOC) --from=html --to=latex $$< --output=$$@
169-
170170
# PDF (md =(pandoc)=> tex =(pdflatex)=> pdf)
171171
DOC_TARGETS += doc/$(1).tex
172172
doc/$(1).tex: $$(D)/$(1).md doc/footer.tex doc/version.tex | doc/

src/doc/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ li {list-style-type: none; }
3535
* [The `getopts` argument parsing library](getopts/index.html)
3636
* [The `glob` file path matching library](glob/index.html)
3737
* [The `green` M:N runtime library](green/index.html)
38+
* [The `hexfloat` library for hexadecimal floating-point literals](hexfloat/index.html)
3839
* [The `native` 1:1 threading runtime](native/index.html)
3940
* [The `num` arbitrary precision numerics library](num/index.html)
41+
* [The `rand` library for random numbers and distributions](rand/index.html)
4042
* [The `rustc` compiler](rustc/index.html)
4143
* [The `rustuv` M:N I/O library](rustuv/index.html)
4244
* [The `semver` version collation library](semver/index.html)

src/doc/rust.md

-1
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,6 @@ and are instead terminated by a semicolon.
14721472

14731473
~~~~
14741474
# use std::libc::{c_char, FILE};
1475-
# #[nolink]
14761475
14771476
extern {
14781477
fn fopen(filename: *c_char, mode: *c_char) -> *FILE;

src/etc/emacs/rust-mode-tests.el

+42-1
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,11 @@ fn indenting_middle_of_line() {
570570
pull_me_back_in();
571571
}
572572
}
573+
574+
fn indented_already() {
575+
576+
// The previous line already has its spaces
577+
}
573578
"
574579

575580
;; Symbol -> (line column)
@@ -596,7 +601,15 @@ fn indenting_middle_of_line() {
596601
(after-whitespace-indent-start (13 1))
597602
(after-whitespace-indent-target (13 8))
598603
(middle-pull-indent-start (15 19))
599-
(middle-pull-indent-target (15 12))))
604+
(middle-pull-indent-target (15 12))
605+
(blank-line-indented-already-bol-start (20 0))
606+
(blank-line-indented-already-bol-target (20 4))
607+
(blank-line-indented-already-middle-start (20 2))
608+
(blank-line-indented-already-middle-target (20 4))
609+
(nonblank-line-indented-already-bol-start (21 0))
610+
(nonblank-line-indented-already-bol-target (21 4))
611+
(nonblank-line-indented-already-middle-start (21 2))
612+
(nonblank-line-indented-already-middle-target (21 4))))
600613

601614
(defun rust-get-buffer-pos (pos-symbol)
602615
"Get buffer position from POS-SYMBOL.
@@ -793,3 +806,31 @@ All positions are position symbols found in `rust-test-positions-alist'."
793806
'middle-pull-indent-start
794807
'middle-pull-indent-target
795808
#'indent-for-tab-command))
809+
810+
(ert-deftest indent-line-blank-line-indented-already-bol ()
811+
(rust-test-motion
812+
rust-test-indent-motion-string
813+
'blank-line-indented-already-bol-start
814+
'blank-line-indented-already-bol-target
815+
#'indent-for-tab-command))
816+
817+
(ert-deftest indent-line-blank-line-indented-already-middle ()
818+
(rust-test-motion
819+
rust-test-indent-motion-string
820+
'blank-line-indented-already-middle-start
821+
'blank-line-indented-already-middle-target
822+
#'indent-for-tab-command))
823+
824+
(ert-deftest indent-line-nonblank-line-indented-already-bol ()
825+
(rust-test-motion
826+
rust-test-indent-motion-string
827+
'nonblank-line-indented-already-bol-start
828+
'nonblank-line-indented-already-bol-target
829+
#'indent-for-tab-command))
830+
831+
(ert-deftest indent-line-nonblank-line-indented-already-middle ()
832+
(rust-test-motion
833+
rust-test-indent-motion-string
834+
'nonblank-line-indented-already-middle-start
835+
'nonblank-line-indented-already-middle-target
836+
#'indent-for-tab-command))

src/etc/emacs/rust-mode.el

+8-8
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@
140140
;; Otherwise, we are continuing the same expression from the previous line,
141141
;; so add one additional indent level
142142
(+ baseline rust-indent-offset))))))))))
143-
(when (not (eq (current-indentation) indent))
144-
;; If we're at the beginning of the line (before or at the current
145-
;; indentation), jump with the indentation change. Otherwise, save the
146-
;; excursion so that adding the indentations will leave us at the
147-
;; equivalent position within the line to where we were before.
148-
(if (<= (current-column) (current-indentation))
149-
(indent-line-to indent)
150-
(save-excursion (indent-line-to indent))))))
143+
144+
;; If we're at the beginning of the line (before or at the current
145+
;; indentation), jump with the indentation change. Otherwise, save the
146+
;; excursion so that adding the indentations will leave us at the
147+
;; equivalent position within the line to where we were before.
148+
(if (<= (current-column) (current-indentation))
149+
(indent-line-to indent)
150+
(save-excursion (indent-line-to indent)))))
151151

152152

153153
;; Font-locking definitions and helpers

src/libcollections/lru_cache.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
4040
use std::cast;
4141
use std::container::Container;
42-
use std::hash::{Hash, sip};
42+
use std::hash::Hash;
4343
use std::fmt;
4444
use std::ptr;
4545

@@ -62,9 +62,9 @@ pub struct LruCache<K, V> {
6262
priv tail: *mut LruEntry<K, V>,
6363
}
6464

65-
impl<K: Hash> Hash for KeyRef<K> {
66-
fn hash(&self, s: &mut sip::SipState) {
67-
unsafe {(*self.k).hash(s)}
65+
impl<S, K: Hash<S>> Hash<S> for KeyRef<K> {
66+
fn hash(&self, state: &mut S) {
67+
unsafe { (*self.k).hash(state) }
6868
}
6969
}
7070

src/libextra/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Rust extras are part of the standard Rust distribution.
2929
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
3030
html_root_url = "http://static.rust-lang.org/doc/master")];
3131

32-
#[feature(macro_rules, globs, managed_boxes, asm)];
32+
#[feature(macro_rules, globs, managed_boxes, asm, default_type_params)];
3333

3434
#[deny(non_camel_case_types)];
3535
#[deny(missing_doc)];

src/libextra/url.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use std::cmp::Eq;
1616
use std::fmt;
17-
use std::hash::{Hash, sip};
17+
use std::hash::Hash;
1818
use std::io::BufReader;
1919
use std::from_str::FromStr;
2020
use std::uint;
@@ -849,15 +849,15 @@ impl fmt::Show for Path {
849849
}
850850
}
851851

852-
impl Hash for Url {
853-
fn hash(&self, s: &mut sip::SipState) {
854-
self.to_str().hash(s)
852+
impl<S: Writer> Hash<S> for Url {
853+
fn hash(&self, state: &mut S) {
854+
self.to_str().hash(state)
855855
}
856856
}
857857

858-
impl Hash for Path {
859-
fn hash(&self, s: &mut sip::SipState) {
860-
self.to_str().hash(s)
858+
impl<S: Writer> Hash<S> for Path {
859+
fn hash(&self, state: &mut S) {
860+
self.to_str().hash(state)
861861
}
862862
}
863863

src/libgreen/sched.rs

+14
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,20 @@ impl Scheduler {
832832
}
833833

834834
pub fn maybe_yield(mut ~self, cur: ~GreenTask) {
835+
// It's possible for sched tasks to possibly call this function, and it
836+
// just means that they're likely sending on channels (which
837+
// occasionally call this function). Sched tasks follow different paths
838+
// when executing yield_now(), which may possibly trip the assertion
839+
// below. For this reason, we just have sched tasks bail out soon.
840+
//
841+
// Sched tasks have no need to yield anyway because as soon as they
842+
// return they'll yield to other threads by falling back to the event
843+
// loop. Additionally, we completely control sched tasks, so we can make
844+
// sure that they never execute more than enough code.
845+
if cur.is_sched() {
846+
return cur.put_with_sched(self)
847+
}
848+
835849
// The number of times to do the yield check before yielding, chosen
836850
// arbitrarily.
837851
rtassert!(self.yield_check_count > 0);

src/libnative/io/file_win32.rs

-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ pub fn readdir(p: &CString) -> IoResult<~[Path]> {
335335
}).map(|path| root.join(path)).collect()
336336
}
337337

338-
#[nolink]
339338
extern {
340339
fn rust_list_dir_wfd_size() -> libc::size_t;
341340
fn rust_list_dir_wfd_fp_buf(wfd: *libc::c_void) -> *u16;

src/librustc/middle/lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ static other_attrs: &'static [&'static str] = &[
979979
"macro_export", "must_use",
980980

981981
//mod-level
982-
"path", "link_name", "link_args", "nolink", "macro_escape", "no_implicit_prelude",
982+
"path", "link_name", "link_args", "macro_escape", "no_implicit_prelude",
983983

984984
// fn-level
985985
"test", "bench", "should_fail", "ignore", "inline", "lang", "main", "start",

src/librustdoc/html/markdown.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub fn render(w: &mut io::Writer, s: &str, print_toc: bool) -> fmt::Result {
209209
};
210210

211211
// Render the HTML
212-
let text = format!(r#"<h{lvl} id="{id}"><a
212+
let text = format!(r#"<h{lvl} id="{id}" class='section-link'><a
213213
href="\#{id}">{sec_len,plural,=0{}other{{sec} }}{}</a></h{lvl}>"#,
214214
s, lvl = level, id = id,
215215
sec_len = sec.len(), sec = sec);

src/librustdoc/html/render.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,9 @@ fn item_module(w: &mut Writer, cx: &Context,
10641064
clean::ForeignStaticItem(..) => ("ffi-statics", "Foreign Statics"),
10651065
clean::MacroItem(..) => ("macros", "Macros"),
10661066
};
1067-
try!(write!(w, "<h2 id='{id}'><a href=\"\\#{id}\">{name}</a></h2>\n<table>",
1067+
try!(write!(w,
1068+
"<h2 id='{id}' class='section-link'>\
1069+
<a href=\"\\#{id}\">{name}</a></h2>\n<table>",
10681070
id = short, name = name));
10691071
}
10701072

src/librustdoc/html/static/main.css

+6-11
Original file line numberDiff line numberDiff line change
@@ -317,16 +317,11 @@ pre.rust .doccomment { color: #4D4D4C; }
317317
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
318318
pre.rust .lifetime { color: #B76514; }
319319

320-
h1:hover a:after,
321-
h2:hover a:after,
322-
h3:hover a:after,
323-
h4:hover a:after,
324-
h5:hover a:after,
325-
h6:hover a:after {
320+
h1.section-link:hover a:after,
321+
h2.section-link:hover a:after,
322+
h3.section-link:hover a:after,
323+
h4.section-link:hover a:after,
324+
h5.section-link:hover a:after,
325+
h6.section-link:hover a:after {
326326
content: ' § ';
327327
}
328-
329-
h1.fqn:hover a:after,
330-
:hover a.fnname:after {
331-
content: none;
332-
}

0 commit comments

Comments
 (0)