From 08eaf07dbc408fdd3de0374fbef7d142777df657 Mon Sep 17 00:00:00 2001 From: Wangshan Lu Date: Tue, 22 Mar 2016 00:45:08 +0800 Subject: [PATCH 01/13] Implement Default for OsString --- src/libstd/ffi/os_str.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index 46f2d3a6418..246f868e6cb 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -173,6 +173,14 @@ impl ops::Deref for OsString { } } +#[stable(feature = "rust1", since = "1.9.0")] +impl Default for OsString { + #[inline] + fn default() -> OsString { + OsString::new() + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl Debug for OsString { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { @@ -554,6 +562,12 @@ mod tests { assert!(os_string.capacity() >= 33) } + #[test] + fn test_os_string_default() { + let os_string: OsString = Default::default(); + assert_eq!("", &os_string); + } + #[test] fn test_os_str_is_empty() { let mut os_string = OsString::new(); From aa5afb0c1737d39f28a212cdb5ebcb02ffd8dea8 Mon Sep 17 00:00:00 2001 From: Wangshan Lu Date: Tue, 22 Mar 2016 00:45:36 +0800 Subject: [PATCH 02/13] Implement Default for OsStr --- src/libstd/ffi/os_str.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index 246f868e6cb..e50be34e53b 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -310,6 +310,14 @@ impl OsStr { } } +#[stable(feature = "rust1", since = "1.9.0")] +impl<'a> Default for &'a OsStr { + #[inline] + fn default() -> &'a OsStr { + "" + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl PartialEq for OsStr { fn eq(&self, other: &OsStr) -> bool { @@ -591,4 +599,10 @@ mod tests { os_string.clear(); assert_eq!(0, os_string.len()); } + + #[test] + fn test_os_str_default() { + let os_str: &OsStr = Default::default(); + assert_eq!("", os_str); + } } From b5b1d0685e54dc9228757ada714551d7eed121f1 Mon Sep 17 00:00:00 2001 From: Wangshan Lu Date: Tue, 22 Mar 2016 07:38:44 +0800 Subject: [PATCH 03/13] Fix Default for OsString/OsStr --- src/libstd/ffi/os_str.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index e50be34e53b..de840457a01 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -173,7 +173,7 @@ impl ops::Deref for OsString { } } -#[stable(feature = "rust1", since = "1.9.0")] +#[stable(feature = "osstring_default", since = "1.9.0")] impl Default for OsString { #[inline] fn default() -> OsString { @@ -310,11 +310,11 @@ impl OsStr { } } -#[stable(feature = "rust1", since = "1.9.0")] +#[stable(feature = "osstring_default", since = "1.9.0")] impl<'a> Default for &'a OsStr { #[inline] fn default() -> &'a OsStr { - "" + OsStr::new("") } } From 9575fe791c315a833a0adf8a9d6617047704b489 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Mon, 21 Mar 2016 22:40:28 -0400 Subject: [PATCH 04/13] Add regression test for Issue 26997. https://github.com/rust-lang/rust/issues/26997 --- src/test/run-pass/issue-26997.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/run-pass/issue-26997.rs diff --git a/src/test/run-pass/issue-26997.rs b/src/test/run-pass/issue-26997.rs new file mode 100644 index 00000000000..e7ecf68f108 --- /dev/null +++ b/src/test/run-pass/issue-26997.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct Foo { + x: isize, + y: isize +} + +impl Foo { + pub extern fn foo_new() -> Foo { + Foo { x: 21, y: 33 } + } +} + +fn main() {} From 00a32b288442efdf219230147ddcb834827ce65d Mon Sep 17 00:00:00 2001 From: mitaa Date: Tue, 22 Mar 2016 06:59:43 +0100 Subject: [PATCH 05/13] Omit `pub` for inlined variant-struct fields --- src/librustdoc/clean/mod.rs | 2 +- src/test/auxiliary/variant-struct.rs | 15 +++++++++++++++ src/test/rustdoc/issue-32395.rs | 21 +++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/test/auxiliary/variant-struct.rs create mode 100644 src/test/rustdoc/issue-32395.rs diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 54821bd1161..2d3961ee6f4 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1885,7 +1885,7 @@ impl<'tcx> Clean for ty::VariantDefData<'tcx, 'static> { source: Span::empty(), name: Some(field.name.clean(cx)), attrs: Vec::new(), - visibility: Some(hir::Public), + visibility: Some(field.vis), // FIXME: this is not accurate, we need an id for // the specific field but we're using the id // for the whole variant. Thus we read the diff --git a/src/test/auxiliary/variant-struct.rs b/src/test/auxiliary/variant-struct.rs new file mode 100644 index 00000000000..d846c0adf61 --- /dev/null +++ b/src/test/auxiliary/variant-struct.rs @@ -0,0 +1,15 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub enum Foo { + Bar { + qux: (), + } +} diff --git a/src/test/rustdoc/issue-32395.rs b/src/test/rustdoc/issue-32395.rs new file mode 100644 index 00000000000..fba2a6ad487 --- /dev/null +++ b/src/test/rustdoc/issue-32395.rs @@ -0,0 +1,21 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:variant-struct.rs +// build-aux-docs +// ignore-cross-compile + +// @has variant_struct/enum.Foo.html +// @!has - 'pub qux' +extern crate variant_struct; + +// @has issue_32395/enum.Foo.html +// @!has - 'pub qux' +pub use variant_struct::Foo; From 7d626e9f55f0503a5e0324a4172f80d3281d6ae0 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 22 Mar 2016 08:29:55 +0200 Subject: [PATCH 06/13] doc: small char improvements --- src/libstd/primitive_docs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index 65ed879c4ad..c8ea28c5ca3 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -77,7 +77,7 @@ mod prim_bool { } /// # Representation /// /// `char` is always four bytes in size. This is a different representation than -/// a given character would have as part of a [`String`], for example: +/// a given character would have as part of a [`String`]. For example: /// /// ``` /// let v = vec!['h', 'e', 'l', 'l', 'o']; @@ -116,8 +116,8 @@ mod prim_bool { } /// ^~ /// ``` /// -/// Another implication of the 4-byte fixed size of a `char`, is that -/// per-`char`acter processing can end up using a lot more memory: +/// Another implication of the 4-byte fixed size of a `char` is that +/// per-`char` processing can end up using a lot more memory: /// /// ``` /// let s = String::from("love: ❤️"); From 79da64a63799542bd28c00442d7abb5ecfdeeaab Mon Sep 17 00:00:00 2001 From: ituxbag Date: Tue, 22 Mar 2016 13:44:33 +0100 Subject: [PATCH 07/13] Added version 7.3* for Apple's clang compiler --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 34132b7e5f5..9a0143a3532 100755 --- a/configure +++ b/configure @@ -1034,7 +1034,7 @@ then if [ -n "$CFG_OSX_CLANG_VERSION" ] then case $CFG_OSX_CLANG_VERSION in - (7.0* | 7.1* | 7.2*) + (7.0* | 7.1* | 7.2* | 7.3*) step_msg "found ok version of APPLE CLANG: $CFG_OSX_CLANG_VERSION" ;; (*) From 88506ce5cdc7a5e3eeb9e121184f8a1c2e40819e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 22 Mar 2016 09:33:36 -0700 Subject: [PATCH 08/13] std: Store flowinfo/scope_id in host byte order Apparently these aren't supposed to be stored in network byte order, so doing so ends up causing failures when it would otherwise succeed when stored in the host byte order. Closes #32424 --- src/libstd/net/addr.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libstd/net/addr.rs b/src/libstd/net/addr.rs index 78da9412212..649094a7493 100644 --- a/src/libstd/net/addr.rs +++ b/src/libstd/net/addr.rs @@ -143,8 +143,8 @@ impl SocketAddrV6 { sin6_family: c::AF_INET6 as c::sa_family_t, sin6_port: hton(port), sin6_addr: *ip.as_inner(), - sin6_flowinfo: hton(flowinfo), - sin6_scope_id: hton(scope_id), + sin6_flowinfo: flowinfo, + sin6_scope_id: scope_id, .. unsafe { mem::zeroed() } }, } @@ -173,23 +173,23 @@ impl SocketAddrV6 { /// Returns the flow information associated with this address, /// corresponding to the `sin6_flowinfo` field in C. #[stable(feature = "rust1", since = "1.0.0")] - pub fn flowinfo(&self) -> u32 { ntoh(self.inner.sin6_flowinfo) } + pub fn flowinfo(&self) -> u32 { self.inner.sin6_flowinfo } /// Change the flow information associated with this socket address. #[unstable(feature = "sockaddr_setters", reason = "recent addition", issue = "31572")] pub fn set_flowinfo(&mut self, new_flowinfo: u32) { - self.inner.sin6_flowinfo = hton(new_flowinfo) + self.inner.sin6_flowinfo = new_flowinfo; } /// Returns the scope ID associated with this address, /// corresponding to the `sin6_scope_id` field in C. #[stable(feature = "rust1", since = "1.0.0")] - pub fn scope_id(&self) -> u32 { ntoh(self.inner.sin6_scope_id) } + pub fn scope_id(&self) -> u32 { self.inner.sin6_scope_id } /// Change the scope ID associated with this socket address. #[unstable(feature = "sockaddr_setters", reason = "recent addition", issue = "31572")] pub fn set_scope_id(&mut self, new_scope_id: u32) { - self.inner.sin6_scope_id = hton(new_scope_id) + self.inner.sin6_scope_id = new_scope_id; } } From 308dc55f788ad884393604d461b81de4e4bf3e98 Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Wed, 23 Mar 2016 02:10:09 +0900 Subject: [PATCH 09/13] Fix const trans Const was dereferenced when autoderefs is zero. --- src/librustc_trans/trans/consts.rs | 2 +- src/test/run-pass/issue-30615.rs | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/test/run-pass/issue-30615.rs diff --git a/src/librustc_trans/trans/consts.rs b/src/librustc_trans/trans/consts.rs index 82cd6aace0a..3aafcdf203a 100644 --- a/src/librustc_trans/trans/consts.rs +++ b/src/librustc_trans/trans/consts.rs @@ -381,7 +381,7 @@ pub fn const_expr<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, llconst = addr_of(cx, llconst, type_of::align_of(cx, ty), "autoref"); ty = cx.tcx().mk_imm_ref(cx.tcx().mk_region(ty::ReStatic), ty); } - } else { + } else if adj.autoderefs > 0 { let (dv, dt) = const_deref(cx, llconst, ty); llconst = dv; diff --git a/src/test/run-pass/issue-30615.rs b/src/test/run-pass/issue-30615.rs new file mode 100644 index 00000000000..a26509d1982 --- /dev/null +++ b/src/test/run-pass/issue-30615.rs @@ -0,0 +1,14 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + &0u8 as *const u8 as *const PartialEq; + &[0u8] as *const [u8; 1] as *const [u8]; +} From 45c72d5f5bdec4827d539fc12e52297248f1d1ec Mon Sep 17 00:00:00 2001 From: nicholasf Date: Wed, 23 Mar 2016 04:58:59 +1100 Subject: [PATCH 10/13] Simplifying some of the phrasing explaining lifetime elision --- src/doc/book/lifetimes.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/doc/book/lifetimes.md b/src/doc/book/lifetimes.md index 4193c93c894..e7a4045d9b2 100644 --- a/src/doc/book/lifetimes.md +++ b/src/doc/book/lifetimes.md @@ -282,14 +282,12 @@ to it. ## Lifetime Elision -Rust supports powerful local type inference in function bodies, but it’s -forbidden in item signatures to allow reasoning about the types based on -the item signature alone. However, for ergonomic reasons a very restricted -secondary inference algorithm called “lifetime elision” applies in function -signatures. It infers only based on the signature components themselves and not -based on the body of the function, only infers lifetime parameters, and does -this with only three easily memorizable and unambiguous rules. This makes -lifetime elision a shorthand for writing an item signature, while not hiding +Rust supports powerful local type inference in the bodies of functions but not in their item signatures. +It's forbidden to allow reasoning about types based on the item signature alone. +However, for ergonomic reasons, a very restricted secondary inference algorithm called +“lifetime elision” does apply when judging lifetimes. Lifetime elision is concerned solely to infer +lifetime parameters using three easily memorizable and unambiguous rules. This means lifetime elision +acts as a shorthand for writing an item signature, while not hiding away the actual types involved as full local inference would if applied to it. When talking about lifetime elision, we use the term *input lifetime* and From 4c71347e94a420ea063a17f017ee20d516919091 Mon Sep 17 00:00:00 2001 From: mitaa Date: Tue, 22 Mar 2016 20:26:33 +0100 Subject: [PATCH 11/13] Consider `doc(no_inline)` in crate-local inlining --- src/librustdoc/clean/inline.rs | 4 +-- src/librustdoc/clean/mod.rs | 6 ++-- src/librustdoc/html/render.rs | 5 +-- src/librustdoc/lib.rs | 2 +- src/librustdoc/passes.rs | 2 +- src/librustdoc/visit_ast.rs | 7 +++-- src/test/rustdoc/inline_local/issue-32343.rs | 33 ++++++++++++++++++++ 7 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 src/test/rustdoc/inline_local/issue-32343.rs diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 49091a6c2bc..e9c55c56a9d 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -256,7 +256,7 @@ pub fn build_impls(cx: &DocContext, cstore::DlImpl(did) => build_impl(cx, tcx, did, impls), cstore::DlDef(Def::Mod(did)) => { // Don't recurse if this is a #[doc(hidden)] module - if load_attrs(cx, tcx, did).list_def("doc").has_word("hidden") { + if load_attrs(cx, tcx, did).list("doc").has_word("hidden") { return; } @@ -299,7 +299,7 @@ pub fn build_impl(cx: &DocContext, if let Some(ref t) = associated_trait { // If this is an impl for a #[doc(hidden)] trait, be sure to not inline let trait_attrs = load_attrs(cx, tcx, t.def_id); - if trait_attrs.list_def("doc").has_word("hidden") { + if trait_attrs.list("doc").has_word("hidden") { return } } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 54821bd1161..651294a8e27 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -418,7 +418,7 @@ impl Clean for doctree::Module { pub trait Attributes { fn has_word(&self, &str) -> bool; fn value<'a>(&'a self, &str) -> Option<&'a str>; - fn list_def<'a>(&'a self, &str) -> &'a [Attribute]; + fn list<'a>(&'a self, &str) -> &'a [Attribute]; } impl Attributes for [Attribute] { @@ -447,7 +447,7 @@ impl Attributes for [Attribute] { } /// Finds an attribute as List and returns the list of attributes nested inside. - fn list_def<'a>(&'a self, name: &str) -> &'a [Attribute] { + fn list<'a>(&'a self, name: &str) -> &'a [Attribute] { for attr in self { if let List(ref x, ref list) = *attr { if name == *x { @@ -1535,7 +1535,7 @@ impl PrimitiveType { } fn find(attrs: &[Attribute]) -> Option { - for attr in attrs.list_def("doc") { + for attr in attrs.list("doc") { if let NameValue(ref k, ref v) = *attr { if "primitive" == *k { if let ret@Some(..) = PrimitiveType::from_str(v) { diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index eb2d7868945..1e59920d66d 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -432,7 +432,7 @@ pub fn run(mut krate: clean::Crate, // Crawl the crate attributes looking for attributes which control how we're // going to emit HTML - if let Some(attrs) = krate.module.as_ref().map(|m| m.attrs.list_def("doc")) { + if let Some(attrs) = krate.module.as_ref().map(|m| m.attrs.list("doc")) { for attr in attrs { match *attr { clean::NameValue(ref x, ref s) @@ -832,7 +832,7 @@ fn extern_location(e: &clean::ExternalCrate, dst: &Path) -> ExternalLocation { // Failing that, see if there's an attribute specifying where to find this // external crate - e.attrs.list_def("doc").value("html_root_url").map(|url| { + e.attrs.list("doc").value("html_root_url").map(|url| { let mut url = url.to_owned(); if !url.ends_with("/") { url.push('/') @@ -1846,6 +1846,7 @@ fn item_static(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, f: &clean::Function) -> fmt::Result { + // FIXME(#24111): remove when `const_fn` is stabilized let vis_constness = match get_unstable_features_setting() { UnstableFeatures::Allow => f.constness, _ => hir::Constness::NotConst diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 8a0ad987e21..a68f0a39ca9 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -383,7 +383,7 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche // Process all of the crate attributes, extracting plugin metadata along // with the passes which we are supposed to run. - for attr in krate.module.as_ref().unwrap().attrs.list_def("doc") { + for attr in krate.module.as_ref().unwrap().attrs.list("doc") { match *attr { clean::Word(ref w) if "no_default_passes" == *w => { default_passes = false; diff --git a/src/librustdoc/passes.rs b/src/librustdoc/passes.rs index 2eb82dec6da..154b812cdff 100644 --- a/src/librustdoc/passes.rs +++ b/src/librustdoc/passes.rs @@ -33,7 +33,7 @@ pub fn strip_hidden(krate: clean::Crate) -> plugins::PluginResult { } impl<'a> fold::DocFolder for Stripper<'a> { fn fold_item(&mut self, i: Item) -> Option { - if i.attrs.list_def("doc").has_word("hidden") { + if i.attrs.list("doc").has_word("hidden") { debug!("found one in strip_hidden; removing"); self.stripped.insert(i.def_id); diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 4c03abac9e8..e4ef0c1a4d6 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -229,7 +229,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { while let Some(id) = cx.map.get_enclosing_scope(node) { node = id; let attrs = cx.map.attrs(node).clean(cx); - if attrs.list_def("doc").has_word("hidden") { + if attrs.list("doc").has_word("hidden") { return true; } if node == ast::CRATE_NODE_ID { @@ -251,11 +251,14 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { Some(analysis) => analysis, None => return false }; + let use_attrs = tcx.map.attrs(id).clean(self.cx); + let is_private = !analysis.access_levels.is_public(def); let is_hidden = inherits_doc_hidden(self.cx, def_node_id); + let is_no_inline = use_attrs.list("doc").has_word("no_inline"); // Only inline if requested or if the item would otherwise be stripped - if !please_inline && !is_private && !is_hidden { + if (!please_inline && !is_private && !is_hidden) || is_no_inline { return false } diff --git a/src/test/rustdoc/inline_local/issue-32343.rs b/src/test/rustdoc/inline_local/issue-32343.rs new file mode 100644 index 00000000000..a045c9624b1 --- /dev/null +++ b/src/test/rustdoc/inline_local/issue-32343.rs @@ -0,0 +1,33 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// @!has issue_32343/struct.Foo.html +// @has issue_32343/index.html +// @has - '//code' 'pub use foo::Foo' +// @!has - '//code/a' 'Foo' +#[doc(no_inline)] +pub use foo::Foo; + +// @!has issue_32343/struct.Bar.html +// @has issue_32343/index.html +// @has - '//code' 'pub use foo::Bar' +// @has - '//code/a' 'Bar' +#[doc(no_inline)] +pub use foo::Bar; + +mod foo { + pub struct Foo; + pub struct Bar; +} + +pub mod bar { + // @has issue_32343/bar/struct.Bar.html + pub use ::foo::Bar; +} From 424fa432d4fd15d1bbf9f6b4fa3ed56074f81cde Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Wed, 23 Mar 2016 02:59:02 +0200 Subject: [PATCH 12/13] Annotate run-pass/backtrace with #[rustc_no_mir] on MSVC. --- src/test/run-pass/backtrace.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/run-pass/backtrace.rs b/src/test/run-pass/backtrace.rs index 3fb52f8c8b4..2a98706351a 100644 --- a/src/test/run-pass/backtrace.rs +++ b/src/test/run-pass/backtrace.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(rustc_attrs)] + // no-pretty-expanded FIXME #15189 // ignore-android FIXME #17520 // compile-flags:-g @@ -16,6 +18,8 @@ use std::env; use std::process::{Command, Stdio}; use std::str; +// FIXME #31005 MIR missing debuginfo currently. +#[cfg_attr(target_env = "msvc", rustc_no_mir)] #[inline(never)] fn foo() { let _v = vec![1, 2, 3]; @@ -24,6 +28,8 @@ fn foo() { } } +// FIXME #31005 MIR missing debuginfo currently. +#[cfg_attr(target_env = "msvc", rustc_no_mir)] #[inline(never)] fn double() { struct Double; From ea9ae486627fec2ff613bef73ccda612996d8f6f Mon Sep 17 00:00:00 2001 From: Tang Chenglong Date: Wed, 23 Mar 2016 12:03:41 +0800 Subject: [PATCH 13/13] Docs: Change "statements" to "expressions" on `match` I apt to use `expressions` over `statements`, because `match` is a expression in essence, though it can become a statement when followed a semicolon. --- src/doc/book/patterns.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/book/patterns.md b/src/doc/book/patterns.md index 7325d448962..7ecfdcfcc1e 100644 --- a/src/doc/book/patterns.md +++ b/src/doc/book/patterns.md @@ -1,7 +1,7 @@ % Patterns Patterns are quite common in Rust. We use them in [variable -bindings][bindings], [match statements][match], and other places, too. Let’s go +bindings][bindings], [match expressions][match], and other places, too. Let’s go on a whirlwind tour of all of the things patterns can do! [bindings]: variable-bindings.html