Skip to content

Commit c87ed49

Browse files
committed
---
yaml --- r: 273501 b: refs/heads/beta c: 9757516 h: refs/heads/master i: 273499: 663da1c
1 parent 0bbc78a commit c87ed49

File tree

26 files changed

+77
-253
lines changed

26 files changed

+77
-253
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: a3b9b42d44c1b8e613593860cea03a1ef97bf9e4
26+
refs/heads/beta: 9757516f1206e127374b489c44d9ef26db7315b0
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ then
10341034
if [ -n "$CFG_OSX_CLANG_VERSION" ]
10351035
then
10361036
case $CFG_OSX_CLANG_VERSION in
1037-
(7.0* | 7.1* | 7.2* | 7.3*)
1037+
(7.0* | 7.1* | 7.2*)
10381038
step_msg "found ok version of APPLE CLANG: $CFG_OSX_CLANG_VERSION"
10391039
;;
10401040
(*)

branches/beta/src/doc/book/lifetimes.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,14 @@ to it.
282282

283283
## Lifetime Elision
284284

285-
Rust supports powerful local type inference in the bodies of functions but not in their item signatures.
286-
It's forbidden to allow reasoning about types based on the item signature alone.
287-
However, for ergonomic reasons, a very restricted secondary inference algorithm called
288-
“lifetime elision” does apply when judging lifetimes. Lifetime elision is concerned solely to infer
289-
lifetime parameters using three easily memorizable and unambiguous rules. This means lifetime elision
290-
acts as a shorthand for writing an item signature, while not hiding
285+
Rust supports powerful local type inference in function bodies, but it’s
286+
forbidden in item signatures to allow reasoning about the types based on
287+
the item signature alone. However, for ergonomic reasons a very restricted
288+
secondary inference algorithm called “lifetime elision” applies in function
289+
signatures. It infers only based on the signature components themselves and not
290+
based on the body of the function, only infers lifetime parameters, and does
291+
this with only three easily memorizable and unambiguous rules. This makes
292+
lifetime elision a shorthand for writing an item signature, while not hiding
291293
away the actual types involved as full local inference would if applied to it.
292294

293295
When talking about lifetime elision, we use the term *input lifetime* and

branches/beta/src/doc/book/patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Patterns
22

33
Patterns are quite common in Rust. We use them in [variable
4-
bindings][bindings], [match expressions][match], and other places, too. Let’s go
4+
bindings][bindings], [match statements][match], and other places, too. Let’s go
55
on a whirlwind tour of all of the things patterns can do!
66

77
[bindings]: variable-bindings.html

branches/beta/src/libcore/clone.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,6 @@
1818
//! them cheap and safe to copy. For other types copies must be made
1919
//! explicitly, by convention implementing the `Clone` trait and calling
2020
//! the `clone` method.
21-
//!
22-
//! Basic usage example:
23-
//!
24-
//! ```
25-
//! let s = String::new(); // String type implements Clone
26-
//! let copy = s.clone(); // so we can clone it
27-
//! ```
28-
//!
29-
//! To easily implement the Clone trait, you can also use
30-
//! `#[derive(Clone)]`. Example:
31-
//!
32-
//! ```
33-
//! #[derive(Clone)] // we add the Clone trait to Morpheus struct
34-
//! struct Morpheus {
35-
//! blue_pill: f32,
36-
//! red_pill: i64,
37-
//! }
38-
//!
39-
//! fn main() {
40-
//! let f = Morpheus { blue_pill: 0.0, red_pill: 0 };
41-
//! let copy = f.clone(); // and now we can clone it!
42-
//! }
43-
//! ```
4421
4522
#![stable(feature = "rust1", since = "1.0.0")]
4623

branches/beta/src/librustc_trans/trans/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ pub fn const_expr<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
381381
llconst = addr_of(cx, llconst, type_of::align_of(cx, ty), "autoref");
382382
ty = cx.tcx().mk_imm_ref(cx.tcx().mk_region(ty::ReStatic), ty);
383383
}
384-
} else if adj.autoderefs > 0 {
384+
} else {
385385
let (dv, dt) = const_deref(cx, llconst, ty);
386386
llconst = dv;
387387

branches/beta/src/librustdoc/clean/inline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ pub fn build_impls(cx: &DocContext,
256256
cstore::DlImpl(did) => build_impl(cx, tcx, did, impls),
257257
cstore::DlDef(Def::Mod(did)) => {
258258
// Don't recurse if this is a #[doc(hidden)] module
259-
if load_attrs(cx, tcx, did).list("doc").has_word("hidden") {
259+
if load_attrs(cx, tcx, did).list_def("doc").has_word("hidden") {
260260
return;
261261
}
262262

@@ -299,7 +299,7 @@ pub fn build_impl(cx: &DocContext,
299299
if let Some(ref t) = associated_trait {
300300
// If this is an impl for a #[doc(hidden)] trait, be sure to not inline
301301
let trait_attrs = load_attrs(cx, tcx, t.def_id);
302-
if trait_attrs.list("doc").has_word("hidden") {
302+
if trait_attrs.list_def("doc").has_word("hidden") {
303303
return
304304
}
305305
}

branches/beta/src/librustdoc/clean/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ impl Clean<Item> for doctree::Module {
418418
pub trait Attributes {
419419
fn has_word(&self, &str) -> bool;
420420
fn value<'a>(&'a self, &str) -> Option<&'a str>;
421-
fn list<'a>(&'a self, &str) -> &'a [Attribute];
421+
fn list_def<'a>(&'a self, &str) -> &'a [Attribute];
422422
}
423423

424424
impl Attributes for [Attribute] {
@@ -447,7 +447,7 @@ impl Attributes for [Attribute] {
447447
}
448448

449449
/// Finds an attribute as List and returns the list of attributes nested inside.
450-
fn list<'a>(&'a self, name: &str) -> &'a [Attribute] {
450+
fn list_def<'a>(&'a self, name: &str) -> &'a [Attribute] {
451451
for attr in self {
452452
if let List(ref x, ref list) = *attr {
453453
if name == *x {
@@ -1535,7 +1535,7 @@ impl PrimitiveType {
15351535
}
15361536

15371537
fn find(attrs: &[Attribute]) -> Option<PrimitiveType> {
1538-
for attr in attrs.list("doc") {
1538+
for attr in attrs.list_def("doc") {
15391539
if let NameValue(ref k, ref v) = *attr {
15401540
if "primitive" == *k {
15411541
if let ret@Some(..) = PrimitiveType::from_str(v) {
@@ -1885,7 +1885,7 @@ impl<'tcx> Clean<Item> for ty::VariantDefData<'tcx, 'static> {
18851885
source: Span::empty(),
18861886
name: Some(field.name.clean(cx)),
18871887
attrs: Vec::new(),
1888-
visibility: Some(field.vis),
1888+
visibility: Some(hir::Public),
18891889
// FIXME: this is not accurate, we need an id for
18901890
// the specific field but we're using the id
18911891
// for the whole variant. Thus we read the

branches/beta/src/librustdoc/html/render.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ pub fn run(mut krate: clean::Crate,
432432

433433
// Crawl the crate attributes looking for attributes which control how we're
434434
// going to emit HTML
435-
if let Some(attrs) = krate.module.as_ref().map(|m| m.attrs.list("doc")) {
435+
if let Some(attrs) = krate.module.as_ref().map(|m| m.attrs.list_def("doc")) {
436436
for attr in attrs {
437437
match *attr {
438438
clean::NameValue(ref x, ref s)
@@ -832,7 +832,7 @@ fn extern_location(e: &clean::ExternalCrate, dst: &Path) -> ExternalLocation {
832832

833833
// Failing that, see if there's an attribute specifying where to find this
834834
// external crate
835-
e.attrs.list("doc").value("html_root_url").map(|url| {
835+
e.attrs.list_def("doc").value("html_root_url").map(|url| {
836836
let mut url = url.to_owned();
837837
if !url.ends_with("/") {
838838
url.push('/')
@@ -1845,7 +1845,6 @@ fn item_static(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
18451845

18461846
fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
18471847
f: &clean::Function) -> fmt::Result {
1848-
// FIXME(#24111): remove when `const_fn` is stabilized
18491848
let vis_constness = match get_unstable_features_setting() {
18501849
UnstableFeatures::Allow => f.constness,
18511850
_ => hir::Constness::NotConst

branches/beta/src/librustdoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche
384384

385385
// Process all of the crate attributes, extracting plugin metadata along
386386
// with the passes which we are supposed to run.
387-
for attr in krate.module.as_ref().unwrap().attrs.list("doc") {
387+
for attr in krate.module.as_ref().unwrap().attrs.list_def("doc") {
388388
match *attr {
389389
clean::Word(ref w) if "no_default_passes" == *w => {
390390
default_passes = false;

branches/beta/src/librustdoc/passes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn strip_hidden(krate: clean::Crate) -> plugins::PluginResult {
3333
}
3434
impl<'a> fold::DocFolder for Stripper<'a> {
3535
fn fold_item(&mut self, i: Item) -> Option<Item> {
36-
if i.attrs.list("doc").has_word("hidden") {
36+
if i.attrs.list_def("doc").has_word("hidden") {
3737
debug!("found one in strip_hidden; removing");
3838
self.stripped.insert(i.def_id);
3939

branches/beta/src/librustdoc/visit_ast.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
229229
while let Some(id) = cx.map.get_enclosing_scope(node) {
230230
node = id;
231231
let attrs = cx.map.attrs(node).clean(cx);
232-
if attrs.list("doc").has_word("hidden") {
232+
if attrs.list_def("doc").has_word("hidden") {
233233
return true;
234234
}
235235
if node == ast::CRATE_NODE_ID {
@@ -251,14 +251,11 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
251251
Some(analysis) => analysis, None => return false
252252
};
253253

254-
let use_attrs = tcx.map.attrs(id).clean(self.cx);
255-
256254
let is_private = !analysis.access_levels.is_public(def);
257255
let is_hidden = inherits_doc_hidden(self.cx, def_node_id);
258-
let is_no_inline = use_attrs.list("doc").has_word("no_inline");
259256

260257
// Only inline if requested or if the item would otherwise be stripped
261-
if (!please_inline && !is_private && !is_hidden) || is_no_inline {
258+
if !please_inline && !is_private && !is_hidden {
262259
return false
263260
}
264261

branches/beta/src/libstd/ffi/os_str.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,6 @@ impl ops::Deref for OsString {
173173
}
174174
}
175175

176-
#[stable(feature = "osstring_default", since = "1.9.0")]
177-
impl Default for OsString {
178-
#[inline]
179-
fn default() -> OsString {
180-
OsString::new()
181-
}
182-
}
183-
184176
#[stable(feature = "rust1", since = "1.0.0")]
185177
impl Debug for OsString {
186178
fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
@@ -310,14 +302,6 @@ impl OsStr {
310302
}
311303
}
312304

313-
#[stable(feature = "osstring_default", since = "1.9.0")]
314-
impl<'a> Default for &'a OsStr {
315-
#[inline]
316-
fn default() -> &'a OsStr {
317-
OsStr::new("")
318-
}
319-
}
320-
321305
#[stable(feature = "rust1", since = "1.0.0")]
322306
impl PartialEq for OsStr {
323307
fn eq(&self, other: &OsStr) -> bool {
@@ -570,12 +554,6 @@ mod tests {
570554
assert!(os_string.capacity() >= 33)
571555
}
572556

573-
#[test]
574-
fn test_os_string_default() {
575-
let os_string: OsString = Default::default();
576-
assert_eq!("", &os_string);
577-
}
578-
579557
#[test]
580558
fn test_os_str_is_empty() {
581559
let mut os_string = OsString::new();
@@ -599,10 +577,4 @@ mod tests {
599577
os_string.clear();
600578
assert_eq!(0, os_string.len());
601579
}
602-
603-
#[test]
604-
fn test_os_str_default() {
605-
let os_str: &OsStr = Default::default();
606-
assert_eq!("", os_str);
607-
}
608580
}

branches/beta/src/libstd/io/stdio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ fn handle_ebadf<T>(r: io::Result<T>, default: T) -> io::Result<T> {
141141
///
142142
/// Each handle is a shared reference to a global buffer of input data to this
143143
/// process. A handle can be `lock`'d to gain full access to [`BufRead`] methods
144-
/// (e.g. `.lines()`). Reads to this handle are otherwise locked with respect
145-
/// to other reads.
144+
/// (e.g. `.lines()`). Writes to this handle are otherwise locked with respect
145+
/// to other writes.
146146
///
147147
/// This handle implements the `Read` trait, but beware that concurrent reads
148148
/// of `Stdin` must be executed with care.

branches/beta/src/libstd/net/addr.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ impl SocketAddrV6 {
143143
sin6_family: c::AF_INET6 as c::sa_family_t,
144144
sin6_port: hton(port),
145145
sin6_addr: *ip.as_inner(),
146-
sin6_flowinfo: flowinfo,
147-
sin6_scope_id: scope_id,
146+
sin6_flowinfo: hton(flowinfo),
147+
sin6_scope_id: hton(scope_id),
148148
.. unsafe { mem::zeroed() }
149149
},
150150
}
@@ -173,23 +173,23 @@ impl SocketAddrV6 {
173173
/// Returns the flow information associated with this address,
174174
/// corresponding to the `sin6_flowinfo` field in C.
175175
#[stable(feature = "rust1", since = "1.0.0")]
176-
pub fn flowinfo(&self) -> u32 { self.inner.sin6_flowinfo }
176+
pub fn flowinfo(&self) -> u32 { ntoh(self.inner.sin6_flowinfo) }
177177

178178
/// Change the flow information associated with this socket address.
179179
#[unstable(feature = "sockaddr_setters", reason = "recent addition", issue = "31572")]
180180
pub fn set_flowinfo(&mut self, new_flowinfo: u32) {
181-
self.inner.sin6_flowinfo = new_flowinfo;
181+
self.inner.sin6_flowinfo = hton(new_flowinfo)
182182
}
183183

184184
/// Returns the scope ID associated with this address,
185185
/// corresponding to the `sin6_scope_id` field in C.
186186
#[stable(feature = "rust1", since = "1.0.0")]
187-
pub fn scope_id(&self) -> u32 { self.inner.sin6_scope_id }
187+
pub fn scope_id(&self) -> u32 { ntoh(self.inner.sin6_scope_id) }
188188

189189
/// Change the scope ID associated with this socket address.
190190
#[unstable(feature = "sockaddr_setters", reason = "recent addition", issue = "31572")]
191191
pub fn set_scope_id(&mut self, new_scope_id: u32) {
192-
self.inner.sin6_scope_id = new_scope_id;
192+
self.inner.sin6_scope_id = hton(new_scope_id)
193193
}
194194
}
195195

branches/beta/src/libstd/primitive_docs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ mod prim_bool { }
7777
/// # Representation
7878
///
7979
/// `char` is always four bytes in size. This is a different representation than
80-
/// a given character would have as part of a [`String`]. For example:
80+
/// a given character would have as part of a [`String`], for example:
8181
///
8282
/// ```
8383
/// let v = vec!['h', 'e', 'l', 'l', 'o'];
@@ -116,8 +116,8 @@ mod prim_bool { }
116116
/// ^~
117117
/// ```
118118
///
119-
/// Another implication of the 4-byte fixed size of a `char` is that
120-
/// per-`char` processing can end up using a lot more memory:
119+
/// Another implication of the 4-byte fixed size of a `char`, is that
120+
/// per-`char`acter processing can end up using a lot more memory:
121121
///
122122
/// ```
123123
/// let s = String::from("love: ❤️");

0 commit comments

Comments
 (0)