+Version 1.29.2 (2018-10-11)
+===========================
+
+- [Workaround for an aliasing-related LLVM bug, which caused miscompilation.][54639]
+- The `rls-preview` component on the windows-gnu targets has been restored.
+
+[54639]: https://github.com/rust-lang/rust/pull/54639
+
Version 1.29.1 (2018-09-25)
===========================
#TOC { display: none; }
.header-section-number { display: none; }
li {list-style-type: none; }
+#search-input {
+ width: calc(100% - 100px);
+}
+#search-but {
+ cursor: pointer;
+}
+#search-but, #search-input {
+ padding: 4px;
+ border: 1px solid #ccc;
+ border-radius: 3px;
+ outline: none;
+ font-size: 0.7em;
+ background-color: #fff;
+}
+#search-but:hover, #search-input:focus {
+ border-color: #55a9ff;
+}
+#search-from {
+ border: none;
+ padding: 0;
+ font-size: 0.7em;
+}
</style>
Looks like you've taken a wrong turn.
# Search
-<form action="https://duckduckgo.com/">
- <input type="text" id="site-search" name="q" size="80"></input>
- <input type="submit" value="Search DuckDuckGo"></form>
-
-Rust doc search: <span id="core-search"></span>
+<div>
+ <form id="search-form" action="https://duckduckgo.com/">
+ <input id="search-input" type="search" name="q"></input>
+ <input type="submit" value="Search" id="search-but">
+ <!--
+ Don't show the options by default,
+ since "From the Standary Library" doesn't work without JavaScript
+ -->
+ <fieldset id="search-from" style="display:none">
+ <label><input name="from" value="library" type="radio"> From the Standard Library</label>
+ <label><input name="from" value="duckduckgo" type="radio" checked> From DuckDuckGo</label>
+ </fieldset>
+ </form>
+</div>
# Reference
return op;
}
-function populate_site_search() {
- var op = get_url_fragments();
+function on_submit(event) {
+ var form = event.target;
+ var q = form['q'].value;
+
+ event.preventDefault();
- var search = document.getElementById('site-search');
- search.value = op.join(' ') + " site:doc.rust-lang.org";
+ if (form['from'].value === 'duckduckgo') {
+ document.location.href = form.action + '?q=' + encodeURIComponent(q + ' site:doc.rust-lang.org');
+ } else if (form['from'].value === 'library') {
+ document.location.href = 'std/index.html?search=' + encodeURIComponent(q);
+ }
}
-function populate_rust_search() {
- var op = get_url_fragments();
- var lt = op.pop();
+function populate_search() {
+ var form = document.getElementById('search-form');
+ form.addEventListener('submit', on_submit);
+ document.getElementById('search-from').style.display = '';
- // #18540, use a single token
+ form['from'].value = 'library';
- var a = document.createElement("a");
- a.href = "https://doc.rust-lang.org/core/?search=" + encodeURIComponent(lt);
- a.textContent = lt;
- var search = document.getElementById('core-search');
- search.innerHTML = "";
- search.appendChild(a);
+ var op = get_url_fragments();
+ document.getElementById('search-input').value = op.join(' ');
}
-populate_site_search();
-populate_rust_search();
+populate_search();
</script>
/// Binary searches this sorted slice for a given element.
///
- /// If the value is found then `Ok` is returned, containing the
- /// index of the matching element; if the value is not found then
- /// `Err` is returned, containing the index where a matching
+ /// If the value is found then [`Result::Ok`] is returned, containing the
+ /// index of the matching element. If there are multiple matches, then any
+ /// one of the matches could be returned. If the value is not found then
+ /// [`Result::Err`] is returned, containing the index where a matching
/// element could be inserted while maintaining sorted order.
///
/// # Examples
/// order code that indicates whether its argument is `Less`,
/// `Equal` or `Greater` the desired target.
///
- /// If a matching value is found then returns `Ok`, containing
- /// the index for the matched element; if no match is found then
- /// `Err` is returned, containing the index where a matching
+ /// If the value is found then [`Result::Ok`] is returned, containing the
+ /// index of the matching element. If there are multiple matches, then any
+ /// one of the matches could be returned. If the value is not found then
+ /// [`Result::Err`] is returned, containing the index where a matching
/// element could be inserted while maintaining sorted order.
///
/// # Examples
/// Assumes that the slice is sorted by the key, for instance with
/// [`sort_by_key`] using the same key extraction function.
///
- /// If a matching value is found then returns `Ok`, containing the
- /// index for the matched element; if no match is found then `Err`
- /// is returned, containing the index where a matching element could
- /// be inserted while maintaining sorted order.
+ /// If the value is found then [`Result::Ok`] is returned, containing the
+ /// index of the matching element. If there are multiple matches, then any
+ /// one of the matches could be returned. If the value is not found then
+ /// [`Result::Err`] is returned, containing the index where a matching
+ /// element could be inserted while maintaining sorted order.
///
/// [`sort_by_key`]: #method.sort_by_key
///
//! ```rust
//! #![feature(rustc_private)]
//!
-//! use graphviz::IntoCow;
//! use std::io::Write;
//! use graphviz as dot;
//!
//! }
//! nodes.sort();
//! nodes.dedup();
-//! nodes.into_cow()
+//! nodes.into()
//! }
//!
//! fn edges(&'a self) -> dot::Edges<'a,Ed> {
//! let &Edges(ref edges) = self;
-//! (&edges[..]).into_cow()
+//! (&edges[..]).into()
//! }
//!
//! fn source(&self, e: &Ed) -> Nd { let &(s,_) = e; s }
//! Since both the set of nodes and the set of edges are always
//! constructed from scratch via iterators, we use the `collect()` method
//! from the `Iterator` trait to collect the nodes and edges into freshly
-//! constructed growable `Vec` values (rather use the `into_cow`
-//! from the `IntoCow` trait as was used in the first example
-//! above).
+//! constructed growable `Vec` values (rather than using `Cow` as in the
+//! first example above).
//!
//! The output from this example renders four nodes that make up the
//! Hasse-diagram for the subsets of the set `{x, y}`. Each edge is
use self::LabelText::*;
-use std::borrow::{Cow, ToOwned};
+use std::borrow::Cow;
use std::io::prelude::*;
use std::io;
///
/// Passing an invalid string (containing spaces, brackets,
/// quotes, ...) will return an empty `Err` value.
- pub fn new<Name: IntoCow<'a, str>>(name: Name) -> Result<Id<'a>, ()> {
- let name = name.into_cow();
+ pub fn new<Name: Into<Cow<'a, str>>>(name: Name) -> Result<Id<'a>, ()> {
+ let name = name.into();
match name.chars().next() {
Some(c) if c.is_ascii_alphabetic() || c == '_' => {}
_ => return Err(()),
/// The label need not be unique, and may be the empty string; the
/// default is in fact the empty string.
fn edge_label(&'a self, _e: &Self::Edge) -> LabelText<'a> {
- LabelStr("".into_cow())
+ LabelStr("".into())
}
/// Maps `n` to a style that will be used in the rendered output.
}
impl<'a> LabelText<'a> {
- pub fn label<S: IntoCow<'a, str>>(s: S) -> LabelText<'a> {
- LabelStr(s.into_cow())
+ pub fn label<S: Into<Cow<'a, str>>>(s: S) -> LabelText<'a> {
+ LabelStr(s.into())
}
- pub fn escaped<S: IntoCow<'a, str>>(s: S) -> LabelText<'a> {
- EscStr(s.into_cow())
+ pub fn escaped<S: Into<Cow<'a, str>>>(s: S) -> LabelText<'a> {
+ EscStr(s.into())
}
- pub fn html<S: IntoCow<'a, str>>(s: S) -> LabelText<'a> {
- HtmlStr(s.into_cow())
+ pub fn html<S: Into<Cow<'a, str>>>(s: S) -> LabelText<'a> {
+ HtmlStr(s.into())
}
fn escape_char<F>(c: char, mut f: F)
EscStr(s) => s,
LabelStr(s) => {
if s.contains('\\') {
- (&*s).escape_default().into_cow()
+ (&*s).escape_default().into()
} else {
s
}
let suffix = suffix.pre_escaped_content();
prefix.push_str(r"\n\n");
prefix.push_str(&suffix);
- EscStr(prefix.into_cow())
+ EscStr(prefix.into())
}
}
writeln!(w, "}}")
}
-pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
- fn into_cow(self) -> Cow<'a, B>;
-}
-
-impl<'a> IntoCow<'a, str> for String {
- fn into_cow(self) -> Cow<'a, str> {
- Cow::Owned(self)
- }
-}
-
-impl<'a> IntoCow<'a, str> for &'a str {
- fn into_cow(self) -> Cow<'a, str> {
- Cow::Borrowed(self)
- }
-}
-
-impl<'a> IntoCow<'a, str> for Cow<'a, str> {
- fn into_cow(self) -> Cow<'a, str> {
- self
- }
-}
-
-impl<'a, T: Clone> IntoCow<'a, [T]> for Vec<T> {
- fn into_cow(self) -> Cow<'a, [T]> {
- Cow::Owned(self)
- }
-}
-
-impl<'a, T: Clone> IntoCow<'a, [T]> for &'a [T] {
- fn into_cow(self) -> Cow<'a, [T]> {
- Cow::Borrowed(self)
- }
-}
-
#[cfg(test)]
mod tests {
use self::NodeLabels::*;
use super::LabelText::{self, LabelStr, EscStr, HtmlStr};
use std::io;
use std::io::prelude::*;
- use IntoCow;
/// each node is an index in a vector in the graph.
type Node = usize;
}
fn node_label(&'a self, n: &Node) -> LabelText<'a> {
match self.node_labels[*n] {
- Some(ref l) => LabelStr(l.into_cow()),
+ Some(l) => LabelStr(l.into()),
None => LabelStr(id_name(n).name()),
}
}
fn edge_label(&'a self, e: &&'a Edge) -> LabelText<'a> {
- LabelStr(e.label.into_cow())
+ LabelStr(e.label.into())
}
fn node_style(&'a self, n: &Node) -> Style {
self.node_styles[*n]
// For clarity, rename the graphviz crate locally to dot.
use graphviz as dot;
-use graphviz::IntoCow;
use cfg;
use hir;
fn node_label(&'a self, &(i, n): &Node<'a>) -> dot::LabelText<'a> {
if i == self.cfg.entry {
- dot::LabelText::LabelStr("entry".into_cow())
+ dot::LabelText::LabelStr("entry".into())
} else if i == self.cfg.exit {
- dot::LabelText::LabelStr("exit".into_cow())
+ dot::LabelText::LabelStr("exit".into())
} else if n.data.id() == hir::DUMMY_ITEM_LOCAL_ID {
- dot::LabelText::LabelStr("(dummy_node)".into_cow())
+ dot::LabelText::LabelStr("(dummy_node)".into())
} else {
let s = self.local_id_to_string(n.data.id());
- dot::LabelText::EscStr(s.into_cow())
+ dot::LabelText::EscStr(s.into())
}
}
fn edge_label(&self, e: &Edge<'a>) -> dot::LabelText<'a> {
let mut label = String::new();
if !self.labelled_edges {
- return dot::LabelText::EscStr(label.into_cow());
+ return dot::LabelText::EscStr(label.into());
}
let mut put_one = false;
for (i, &id) in e.data.exiting_scopes.iter().enumerate() {
i,
&s[..]));
}
- dot::LabelText::EscStr(label.into_cow())
+ dot::LabelText::EscStr(label.into())
}
}
fn nodes(&'a self) -> dot::Nodes<'a, Node<'a>> {
let mut v = Vec::new();
self.graph.each_node(|i, nd| { v.push((i, nd)); true });
- v.into_cow()
+ v.into()
}
fn edges(&'a self) -> dot::Edges<'a, Edge<'a>> {
self.graph.all_edges().iter().collect()
use rustc::cfg::CFGIndex;
use dataflow::{DataFlowOperator, DataFlowContext, EntryOrExit};
use std::rc::Rc;
-use dot::IntoCow;
#[derive(Debug, Copy, Clone)]
pub enum Variant {
let suffix = self.dataflow_for(EntryOrExit::Exit, n);
let inner_label = self.inner.node_label(n);
inner_label
- .prefix_line(dot::LabelText::LabelStr(prefix.into_cow()))
- .suffix_line(dot::LabelText::LabelStr(suffix.into_cow()))
+ .prefix_line(dot::LabelText::LabelStr(prefix.into()))
+ .suffix_line(dot::LabelText::LabelStr(suffix.into()))
}
fn edge_label(&'a self, e: &Edge<'a>) -> dot::LabelText<'a> { self.inner.edge_label(e) }
}
use rustc::hir;
use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc::ich::{ATTR_IF_THIS_CHANGED, ATTR_THEN_THIS_WOULD_NEED};
-use graphviz::IntoCow;
use std::env;
use std::fs::{self, File};
use std::io::Write;
type Edge = (&'q DepNode, &'q DepNode);
fn nodes(&self) -> dot::Nodes<&'q DepNode> {
let nodes: Vec<_> = self.0.iter().cloned().collect();
- nodes.into_cow()
+ nodes.into()
}
fn edges(&self) -> dot::Edges<(&'q DepNode, &'q DepNode)> {
- self.1[..].into_cow()
+ self.1[..].into()
}
fn source(&self, edge: &(&'q DepNode, &'q DepNode)) -> &'q DepNode {
edge.0
use super::*;
use borrow_check::nll::constraints::OutlivesConstraint;
-use dot::{self, IntoCow};
+use dot;
use std::borrow::Cow;
use std::io::{self, Write};
type Edge = OutlivesConstraint;
fn graph_id(&'this self) -> dot::Id<'this> {
- dot::Id::new("RegionInferenceContext".to_string()).unwrap()
+ dot::Id::new("RegionInferenceContext").unwrap()
}
fn node_id(&'this self, n: &RegionVid) -> dot::Id<'this> {
dot::Id::new(format!("r{}", n.index())).unwrap()
Some(dot::LabelText::LabelStr(Cow::Borrowed("box")))
}
fn node_label(&'this self, n: &RegionVid) -> dot::LabelText<'this> {
- dot::LabelText::LabelStr(format!("{:?}", n).into_cow())
+ dot::LabelText::LabelStr(format!("{:?}", n).into())
}
fn edge_label(&'this self, e: &OutlivesConstraint) -> dot::LabelText<'this> {
- dot::LabelText::LabelStr(format!("{:?}", e.locations).into_cow())
+ dot::LabelText::LabelStr(format!("{:?}", e.locations).into())
}
}
fn nodes(&'this self) -> dot::Nodes<'this, RegionVid> {
let vids: Vec<RegionVid> = self.regioncx.definitions.indices().collect();
- vids.into_cow()
+ vids.into()
}
fn edges(&'this self) -> dot::Edges<'this, OutlivesConstraint> {
- (&self.regioncx.constraints.raw[..]).into_cow()
+ (&self.regioncx.constraints.raw[..]).into()
}
// Render `a: b` as `a -> b`, indicating the flow
}
fn node_label(&'this self, n: &ConstraintSccIndex) -> dot::LabelText<'this> {
let nodes = &self.nodes_per_scc[*n];
- dot::LabelText::LabelStr(format!("{:?} = {:?}", n, nodes).into_cow())
+ dot::LabelText::LabelStr(format!("{:?} = {:?}", n, nodes).into())
}
}
fn nodes(&'this self) -> dot::Nodes<'this, ConstraintSccIndex> {
let vids: Vec<ConstraintSccIndex> = self.regioncx.constraint_sccs.all_sccs().collect();
- vids.into_cow()
+ vids.into()
}
fn edges(&'this self) -> dot::Edges<'this, (ConstraintSccIndex, ConstraintSccIndex)> {
let edges: Vec<_> = self.regioncx
})
.collect();
- edges.into_cow()
+ edges.into()
}
// Render `a: b` as `a -> b`, indicating the flow
use rustc::mir::{BasicBlock, Mir};
use dot;
-use dot::IntoCow;
use std::fs;
use std::io;
.basic_blocks()
.indices()
.collect::<Vec<_>>()
- .into_cow()
+ .into()
}
fn edges(&self) -> dot::Edges<Edge> {
.indices()
.flat_map(|bb| outgoing(mir, bb))
.collect::<Vec<_>>()
- .into_cow()
+ .into()
}
fn source(&self, edge: &Edge) -> Node {
/// Thus the pattern of `yield`ing after a failed poll is rather common when
/// implementing low-level shared resources or synchronization primitives.
///
-/// However programmers will usually prefer to use, [`channel`]s, [`Condvar`]s,
+/// However programmers will usually prefer to use [`channel`]s, [`Condvar`]s,
/// [`Mutex`]es or [`join`] for their synchronization routines, as they avoid
/// thinking about thread scheduling.
///