Skip to content

Rolling up PRs in the queue #12848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Closed
8 changes: 4 additions & 4 deletions mk/docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ SHOULD_BUILD_PDF_DOC_$(1) = 1
endef
$(foreach docname,$(PDF_DOCS),$(eval $(call DEF_SHOULD_BUILD_PDF_DOC,$(docname))))

doc/footer.tex: $(D)/footer.inc | doc/
@$(call E, pandoc: $@)
$(CFG_PANDOC) --from=html --to=latex $< --output=$@

define DEF_DOC

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

doc/footer.tex: $(D)/footer.inc | doc/
@$$(call E, pandoc: $$@)
$$(CFG_PANDOC) --from=html --to=latex $$< --output=$$@

# PDF (md =(pandoc)=> tex =(pdflatex)=> pdf)
DOC_TARGETS += doc/$(1).tex
doc/$(1).tex: $$(D)/$(1).md doc/footer.tex doc/version.tex | doc/
Expand Down
2 changes: 2 additions & 0 deletions src/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ li {list-style-type: none; }
* [The `getopts` argument parsing library](getopts/index.html)
* [The `glob` file path matching library](glob/index.html)
* [The `green` M:N runtime library](green/index.html)
* [The `hexfloat` library for hexadecimal floating-point literals](hexfloat/index.html)
* [The `native` 1:1 threading runtime](native/index.html)
* [The `num` arbitrary precision numerics library](num/index.html)
* [The `rand` library for random numbers and distributions](rand/index.html)
* [The `rustc` compiler](rustc/index.html)
* [The `rustuv` M:N I/O library](rustuv/index.html)
* [The `semver` version collation library](semver/index.html)
Expand Down
1 change: 0 additions & 1 deletion src/doc/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,6 @@ and are instead terminated by a semicolon.

~~~~
# use std::libc::{c_char, FILE};
# #[nolink]

extern {
fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
Expand Down
43 changes: 42 additions & 1 deletion src/etc/emacs/rust-mode-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,11 @@ fn indenting_middle_of_line() {
pull_me_back_in();
}
}

fn indented_already() {

// The previous line already has its spaces
}
"

;; Symbol -> (line column)
Expand All @@ -596,7 +601,15 @@ fn indenting_middle_of_line() {
(after-whitespace-indent-start (13 1))
(after-whitespace-indent-target (13 8))
(middle-pull-indent-start (15 19))
(middle-pull-indent-target (15 12))))
(middle-pull-indent-target (15 12))
(blank-line-indented-already-bol-start (20 0))
(blank-line-indented-already-bol-target (20 4))
(blank-line-indented-already-middle-start (20 2))
(blank-line-indented-already-middle-target (20 4))
(nonblank-line-indented-already-bol-start (21 0))
(nonblank-line-indented-already-bol-target (21 4))
(nonblank-line-indented-already-middle-start (21 2))
(nonblank-line-indented-already-middle-target (21 4))))

(defun rust-get-buffer-pos (pos-symbol)
"Get buffer position from POS-SYMBOL.
Expand Down Expand Up @@ -793,3 +806,31 @@ All positions are position symbols found in `rust-test-positions-alist'."
'middle-pull-indent-start
'middle-pull-indent-target
#'indent-for-tab-command))

(ert-deftest indent-line-blank-line-indented-already-bol ()
(rust-test-motion
rust-test-indent-motion-string
'blank-line-indented-already-bol-start
'blank-line-indented-already-bol-target
#'indent-for-tab-command))

(ert-deftest indent-line-blank-line-indented-already-middle ()
(rust-test-motion
rust-test-indent-motion-string
'blank-line-indented-already-middle-start
'blank-line-indented-already-middle-target
#'indent-for-tab-command))

(ert-deftest indent-line-nonblank-line-indented-already-bol ()
(rust-test-motion
rust-test-indent-motion-string
'nonblank-line-indented-already-bol-start
'nonblank-line-indented-already-bol-target
#'indent-for-tab-command))

(ert-deftest indent-line-nonblank-line-indented-already-middle ()
(rust-test-motion
rust-test-indent-motion-string
'nonblank-line-indented-already-middle-start
'nonblank-line-indented-already-middle-target
#'indent-for-tab-command))
16 changes: 8 additions & 8 deletions src/etc/emacs/rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@
;; Otherwise, we are continuing the same expression from the previous line,
;; so add one additional indent level
(+ baseline rust-indent-offset))))))))))
(when (not (eq (current-indentation) indent))
;; If we're at the beginning of the line (before or at the current
;; indentation), jump with the indentation change. Otherwise, save the
;; excursion so that adding the indentations will leave us at the
;; equivalent position within the line to where we were before.
(if (<= (current-column) (current-indentation))
(indent-line-to indent)
(save-excursion (indent-line-to indent))))))

;; If we're at the beginning of the line (before or at the current
;; indentation), jump with the indentation change. Otherwise, save the
;; excursion so that adding the indentations will leave us at the
;; equivalent position within the line to where we were before.
(if (<= (current-column) (current-indentation))
(indent-line-to indent)
(save-excursion (indent-line-to indent)))))


;; Font-locking definitions and helpers
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/lru_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

use std::cast;
use std::container::Container;
use std::hash::{Hash, sip};
use std::hash::Hash;
use std::fmt;
use std::ptr;

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

impl<K: Hash> Hash for KeyRef<K> {
fn hash(&self, s: &mut sip::SipState) {
unsafe {(*self.k).hash(s)}
impl<S, K: Hash<S>> Hash<S> for KeyRef<K> {
fn hash(&self, state: &mut S) {
unsafe { (*self.k).hash(state) }
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libextra/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Rust extras are part of the standard Rust distribution.
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")];

#[feature(macro_rules, globs, managed_boxes, asm)];
#[feature(macro_rules, globs, managed_boxes, asm, default_type_params)];

#[deny(non_camel_case_types)];
#[deny(missing_doc)];
Expand Down
14 changes: 7 additions & 7 deletions src/libextra/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use std::cmp::Eq;
use std::fmt;
use std::hash::{Hash, sip};
use std::hash::Hash;
use std::io::BufReader;
use std::from_str::FromStr;
use std::uint;
Expand Down Expand Up @@ -849,15 +849,15 @@ impl fmt::Show for Path {
}
}

impl Hash for Url {
fn hash(&self, s: &mut sip::SipState) {
self.to_str().hash(s)
impl<S: Writer> Hash<S> for Url {
fn hash(&self, state: &mut S) {
self.to_str().hash(state)
}
}

impl Hash for Path {
fn hash(&self, s: &mut sip::SipState) {
self.to_str().hash(s)
impl<S: Writer> Hash<S> for Path {
fn hash(&self, state: &mut S) {
self.to_str().hash(state)
}
}

Expand Down
14 changes: 14 additions & 0 deletions src/libgreen/sched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,20 @@ impl Scheduler {
}

pub fn maybe_yield(mut ~self, cur: ~GreenTask) {
// It's possible for sched tasks to possibly call this function, and it
// just means that they're likely sending on channels (which
// occasionally call this function). Sched tasks follow different paths
// when executing yield_now(), which may possibly trip the assertion
// below. For this reason, we just have sched tasks bail out soon.
//
// Sched tasks have no need to yield anyway because as soon as they
// return they'll yield to other threads by falling back to the event
// loop. Additionally, we completely control sched tasks, so we can make
// sure that they never execute more than enough code.
if cur.is_sched() {
return cur.put_with_sched(self)
}

// The number of times to do the yield check before yielding, chosen
// arbitrarily.
rtassert!(self.yield_check_count > 0);
Expand Down
1 change: 0 additions & 1 deletion src/libnative/io/file_win32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ pub fn readdir(p: &CString) -> IoResult<~[Path]> {
}).map(|path| root.join(path)).collect()
}

#[nolink]
extern {
fn rust_list_dir_wfd_size() -> libc::size_t;
fn rust_list_dir_wfd_fp_buf(wfd: *libc::c_void) -> *u16;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ static other_attrs: &'static [&'static str] = &[
"macro_export", "must_use",

//mod-level
"path", "link_name", "link_args", "nolink", "macro_escape", "no_implicit_prelude",
"path", "link_name", "link_args", "macro_escape", "no_implicit_prelude",

// fn-level
"test", "bench", "should_fail", "ignore", "inline", "lang", "main", "start",
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ pub fn render(w: &mut io::Writer, s: &str, print_toc: bool) -> fmt::Result {
};

// Render the HTML
let text = format!(r#"<h{lvl} id="{id}"><a
let text = format!(r#"<h{lvl} id="{id}" class='section-link'><a
href="\#{id}">{sec_len,plural,=0{}other{{sec} }}{}</a></h{lvl}>"#,
s, lvl = level, id = id,
sec_len = sec.len(), sec = sec);
Expand Down
4 changes: 3 additions & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,9 @@ fn item_module(w: &mut Writer, cx: &Context,
clean::ForeignStaticItem(..) => ("ffi-statics", "Foreign Statics"),
clean::MacroItem(..) => ("macros", "Macros"),
};
try!(write!(w, "<h2 id='{id}'><a href=\"\\#{id}\">{name}</a></h2>\n<table>",
try!(write!(w,
"<h2 id='{id}' class='section-link'>\
<a href=\"\\#{id}\">{name}</a></h2>\n<table>",
id = short, name = name));
}

Expand Down
17 changes: 6 additions & 11 deletions src/librustdoc/html/static/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -317,16 +317,11 @@ pre.rust .doccomment { color: #4D4D4C; }
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
pre.rust .lifetime { color: #B76514; }

h1:hover a:after,
h2:hover a:after,
h3:hover a:after,
h4:hover a:after,
h5:hover a:after,
h6:hover a:after {
h1.section-link:hover a:after,
h2.section-link:hover a:after,
h3.section-link:hover a:after,
h4.section-link:hover a:after,
h5.section-link:hover a:after,
h6.section-link:hover a:after {
content: ' § ';
}

h1.fqn:hover a:after,
:hover a.fnname:after {
content: none;
}
Loading