From d7d4e670ed53883672d8c4458226d91dcc731569 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 22 Mar 2017 00:01:37 +0100 Subject: [PATCH 01/10] Added core::cmp::Reverse for sort_by_key reverse sorting --- src/libcore/cmp.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index cb39796eecd7d..d87615ad9a2c2 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -322,6 +322,40 @@ impl Ordering { } } +/// A helper struct for reverse ordering. +/// +/// This struct is a helper to be used with functions like `Vec::sort_by_key` and +/// can be used to reverse order a part of a key. +/// +/// Example usage: +/// +/// ``` +/// use std::cmp::Reverse; +/// +/// let mut v = vec![1, 2, 3, 4, 5, 6]; +/// v.sort_by_key(|&num| (num >= 3, Reverse(num))); +/// assert_eq!(v, vec![3, 2, 1, 6, 5, 4]); +/// ``` +#[derive(PartialEq, Eq, Debug)] +#[stable(feature = "rust1", since = "1.8.0")] +pub struct Reverse(pub T); + +#[stable(feature = "rust1", since = "1.8.0")] +impl PartialOrd for Reverse { + #[inline] + fn partial_cmp(&self, other: &Reverse) -> Option { + other.0.partial_cmp(&self.0) + } +} + +#[stable(feature = "rust1", since = "1.8.0")] +impl Ord for Reverse { + #[inline] + fn cmp(&self, other: &Reverse) -> Ordering { + other.0.cmp(&self.0) + } +} + /// Trait for types that form a [total order](https://en.wikipedia.org/wiki/Total_order). /// /// An order is a total order if it is (for all `a`, `b` and `c`): From dabff151426d0cf6f8a779c15be459f7bd457a4c Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 22 Mar 2017 09:04:42 +0100 Subject: [PATCH 02/10] Fix the test for cmp::Reverse --- src/libcore/cmp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index d87615ad9a2c2..d787a0833c7ab 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -333,7 +333,7 @@ impl Ordering { /// use std::cmp::Reverse; /// /// let mut v = vec![1, 2, 3, 4, 5, 6]; -/// v.sort_by_key(|&num| (num >= 3, Reverse(num))); +/// v.sort_by_key(|&num| (num > 3, Reverse(num))); /// assert_eq!(v, vec![3, 2, 1, 6, 5, 4]); /// ``` #[derive(PartialEq, Eq, Debug)] From d005d917783b8f753b4ee2f79f03e2212e519d01 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 22 Mar 2017 14:16:41 +0100 Subject: [PATCH 03/10] Improved bounds for cmp::Reverse --- src/libcore/cmp.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index d787a0833c7ab..751932a6105ae 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -337,19 +337,19 @@ impl Ordering { /// assert_eq!(v, vec![3, 2, 1, 6, 5, 4]); /// ``` #[derive(PartialEq, Eq, Debug)] -#[stable(feature = "rust1", since = "1.8.0")] -pub struct Reverse(pub T); +#[stable(feature = "rust1", since = "1.18.0")] +pub struct Reverse(pub T); -#[stable(feature = "rust1", since = "1.8.0")] -impl PartialOrd for Reverse { +#[stable(feature = "rust1", since = "1.18.0")] +impl PartialOrd for Reverse { #[inline] fn partial_cmp(&self, other: &Reverse) -> Option { other.0.partial_cmp(&self.0) } } -#[stable(feature = "rust1", since = "1.8.0")] -impl Ord for Reverse { +#[stable(feature = "rust1", since = "1.18.0")] +impl Ord for Reverse { #[inline] fn cmp(&self, other: &Reverse) -> Ordering { other.0.cmp(&self.0) From 50728e52455804143e5cc601004381e395a1e2f7 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Sun, 26 Mar 2017 19:35:46 +0300 Subject: [PATCH 04/10] borrowck: consolidate `mut` suggestions This converts all of borrowck's `mut` suggestions to a new `mc::ImmutabilityBlame` API instead of the current mix of various hacks. Fixes #35937. Fixes #40823. --- src/librustc/middle/mem_categorization.rs | 140 +++++------- .../borrowck/gather_loans/mod.rs | 9 - src/librustc_borrowck/borrowck/mod.rs | 208 ++++++++++-------- src/librustc_borrowck/diagnostics.rs | 6 +- .../compile-fail/augmented-assignments.rs | 2 +- .../borrowck/borrowck-issue-14498.rs | 6 +- src/test/compile-fail/issue-33819.rs | 2 +- src/test/compile-fail/mut-suggestion.rs | 4 +- .../huge_multispan_highlight.stderr | 2 +- src/test/ui/did_you_mean/issue-31424.stderr | 2 + src/test/ui/did_you_mean/issue-35937.rs | 31 +++ src/test/ui/did_you_mean/issue-35937.stderr | 26 +++ src/test/ui/did_you_mean/issue-38147-2.stderr | 2 +- src/test/ui/did_you_mean/issue-38147-3.stderr | 4 +- src/test/ui/did_you_mean/issue-39544.rs | 11 +- src/test/ui/did_you_mean/issue-39544.stderr | 19 +- src/test/ui/did_you_mean/issue-40823.rs | 14 ++ src/test/ui/did_you_mean/issue-40823.stderr | 8 + ...ck-borrow-overloaded-auto-deref-mut.stderr | 8 +- ...orrowck-borrow-overloaded-deref-mut.stderr | 4 +- .../ui/span/borrowck-object-mutability.stderr | 3 + 21 files changed, 304 insertions(+), 207 deletions(-) create mode 100644 src/test/ui/did_you_mean/issue-35937.rs create mode 100644 src/test/ui/did_you_mean/issue-35937.stderr create mode 100644 src/test/ui/did_you_mean/issue-40823.rs create mode 100644 src/test/ui/did_you_mean/issue-40823.stderr diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 0cf53826dd427..3b52e85e08e32 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -194,76 +194,75 @@ pub struct cmt_<'tcx> { pub type cmt<'tcx> = Rc>; +pub enum ImmutabilityBlame<'tcx> { + ImmLocal(ast::NodeId), + ClosureEnv(ast::NodeId), + LocalDeref(ast::NodeId), + AdtFieldDeref(&'tcx ty::AdtDef, &'tcx ty::FieldDef) +} + impl<'tcx> cmt_<'tcx> { - pub fn get_def(&self) -> Option { - match self.cat { - Categorization::Deref(ref cmt, ..) | - Categorization::Interior(ref cmt, _) | - Categorization::Downcast(ref cmt, _) => { - if let Categorization::Local(nid) = cmt.cat { - Some(nid) - } else { - None - } + fn resolve_field(&self, field_name: FieldName) -> (&'tcx ty::AdtDef, &'tcx ty::FieldDef) + { + let adt_def = self.ty.ty_adt_def().unwrap_or_else(|| { + bug!("interior cmt {:?} is not an ADT", self) + }); + let variant_def = match self.cat { + Categorization::Downcast(_, variant_did) => { + adt_def.variant_with_id(variant_did) } - _ => None - } + _ => { + assert!(adt_def.is_univariant()); + &adt_def.variants[0] + } + }; + let field_def = match field_name { + NamedField(name) => variant_def.field_named(name), + PositionalField(idx) => &variant_def.fields[idx] + }; + (adt_def, field_def) } - pub fn get_field(&self, name: ast::Name) -> Option { + pub fn immutability_blame(&self) -> Option> { match self.cat { - Categorization::Deref(ref cmt, ..) | - Categorization::Interior(ref cmt, _) | - Categorization::Downcast(ref cmt, _) => { - if let Categorization::Local(_) = cmt.cat { - if let ty::TyAdt(def, _) = self.ty.sty { - if def.is_struct() { - return def.struct_variant().find_field_named(name).map(|x| x.did); + Categorization::Deref(ref base_cmt, _, BorrowedPtr(ty::ImmBorrow, _)) | + Categorization::Deref(ref base_cmt, _, Implicit(ty::ImmBorrow, _)) => { + // try to figure out where the immutable reference came from + match base_cmt.cat { + Categorization::Local(node_id) => + Some(ImmutabilityBlame::LocalDeref(node_id)), + Categorization::Interior(ref base_cmt, InteriorField(field_name)) => { + let (adt_def, field_def) = base_cmt.resolve_field(field_name); + Some(ImmutabilityBlame::AdtFieldDeref(adt_def, field_def)) + } + Categorization::Upvar(Upvar { id, .. }) => { + if let NoteClosureEnv(..) = self.note { + Some(ImmutabilityBlame::ClosureEnv(id.closure_expr_id)) + } else { + None } } - None - } else { - cmt.get_field(name) + _ => None } } - _ => None - } - } - - pub fn get_field_name(&self) -> Option { - match self.cat { - Categorization::Interior(_, ref ik) => { - if let InteriorKind::InteriorField(FieldName::NamedField(name)) = *ik { - Some(name) - } else { - None - } + Categorization::Local(node_id) => { + Some(ImmutabilityBlame::ImmLocal(node_id)) } - Categorization::Deref(ref cmt, ..) | - Categorization::Downcast(ref cmt, _) => { - cmt.get_field_name() + Categorization::Rvalue(..) | + Categorization::Upvar(..) | + Categorization::Deref(.., UnsafePtr(..)) => { + // This should not be reachable up to inference limitations. + None } - _ => None, - } - } - - pub fn get_arg_if_immutable(&self, map: &hir_map::Map) -> Option { - match self.cat { - Categorization::Deref(ref cmt, ..) | - Categorization::Interior(ref cmt, _) | - Categorization::Downcast(ref cmt, _) => { - if let Categorization::Local(nid) = cmt.cat { - if let ty::TyAdt(_, _) = self.ty.sty { - if let ty::TyRef(_, ty::TypeAndMut{mutbl: MutImmutable, ..}) = cmt.ty.sty { - return Some(nid); - } - } - None - } else { - cmt.get_arg_if_immutable(map) - } + Categorization::Interior(ref base_cmt, _) | + Categorization::Downcast(ref base_cmt, _) | + Categorization::Deref(ref base_cmt, _, _) => { + base_cmt.immutability_blame() + } + Categorization::StaticItem => { + // Do we want to do something here? + None } - _ => None } } } @@ -1282,9 +1281,6 @@ pub enum Aliasability { #[derive(Copy, Clone, Debug)] pub enum AliasableReason { AliasableBorrowed, - AliasableClosure(ast::NodeId), // Aliasable due to capture Fn closure env - AliasableOther, - UnaliasableImmutable, // Created as needed upon seeing ImmutableUnique AliasableStatic, AliasableStaticMut, } @@ -1324,23 +1320,13 @@ impl<'tcx> cmt_<'tcx> { Categorization::Deref(ref b, _, Implicit(ty::MutBorrow, _)) | Categorization::Deref(ref b, _, BorrowedPtr(ty::UniqueImmBorrow, _)) | Categorization::Deref(ref b, _, Implicit(ty::UniqueImmBorrow, _)) | + Categorization::Deref(ref b, _, Unique) | Categorization::Downcast(ref b, _) | Categorization::Interior(ref b, _) => { // Aliasability depends on base cmt b.freely_aliasable() } - Categorization::Deref(ref b, _, Unique) => { - let sub = b.freely_aliasable(); - if b.mutbl.is_mutable() { - // Aliasability depends on base cmt alone - sub - } else { - // Do not allow mutation through an immutable box. - ImmutableUnique(Box::new(sub)) - } - } - Categorization::Rvalue(..) | Categorization::Local(..) | Categorization::Upvar(..) | @@ -1356,13 +1342,9 @@ impl<'tcx> cmt_<'tcx> { } } - Categorization::Deref(ref base, _, BorrowedPtr(ty::ImmBorrow, _)) | - Categorization::Deref(ref base, _, Implicit(ty::ImmBorrow, _)) => { - match base.cat { - Categorization::Upvar(Upvar{ id, .. }) => - FreelyAliasable(AliasableClosure(id.closure_expr_id)), - _ => FreelyAliasable(AliasableBorrowed) - } + Categorization::Deref(_, _, BorrowedPtr(ty::ImmBorrow, _)) | + Categorization::Deref(_, _, Implicit(ty::ImmBorrow, _)) => { + FreelyAliasable(AliasableBorrowed) } } } diff --git a/src/librustc_borrowck/borrowck/gather_loans/mod.rs b/src/librustc_borrowck/borrowck/gather_loans/mod.rs index 28b6c7a13f171..cedb9e1cd1cff 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/mod.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/mod.rs @@ -188,14 +188,6 @@ fn check_aliasability<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>, // user knows what they're doing in these cases. Ok(()) } - (mc::Aliasability::ImmutableUnique(_), ty::MutBorrow) => { - bccx.report_aliasability_violation( - borrow_span, - loan_cause, - mc::AliasableReason::UnaliasableImmutable, - cmt); - Err(()) - } (mc::Aliasability::FreelyAliasable(alias_cause), ty::UniqueImmBorrow) | (mc::Aliasability::FreelyAliasable(alias_cause), ty::MutBorrow) => { bccx.report_aliasability_violation( @@ -510,4 +502,3 @@ impl<'a, 'tcx> GatherLoanCtxt<'a, 'tcx> { self.move_error_collector.report_potential_errors(self.bccx); } } - diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index 20d495976b05f..0981369ace5c1 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -34,6 +34,7 @@ use rustc::hir::def_id::DefId; use rustc::middle::expr_use_visitor as euv; use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization::Categorization; +use rustc::middle::mem_categorization::ImmutabilityBlame; use rustc::middle::region; use rustc::ty::{self, TyCtxt}; @@ -41,6 +42,7 @@ use std::fmt; use std::rc::Rc; use std::hash::{Hash, Hasher}; use syntax::ast; +use syntax::symbol::keywords; use syntax_pos::{MultiSpan, Span}; use errors::DiagnosticBuilder; @@ -659,12 +661,10 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { self.tcx.sess.span_err_with_code(s, msg, code); } - pub fn bckerr_to_diag(&self, err: &BckError<'tcx>) -> DiagnosticBuilder<'a> { + fn bckerr_to_diag(&self, err: &BckError<'tcx>) -> DiagnosticBuilder<'a> { let span = err.span.clone(); - let mut immutable_field = None; - let mut local_def = None; - let msg = &match err.code { + let msg = match err.code { err_mutbl => { let descr = match err.cmt.note { mc::NoteClosureEnv(_) | mc::NoteUpvarRef(_) => { @@ -700,27 +700,6 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { BorrowViolation(euv::AutoUnsafe) | BorrowViolation(euv::ForLoop) | BorrowViolation(euv::MatchDiscriminant) => { - // Check for this field's definition to see if it is an immutable reference - // and suggest making it mutable if that is the case. - immutable_field = err.cmt.get_field_name() - .and_then(|name| err.cmt.get_field(name)) - .and_then(|did| self.tcx.hir.as_local_node_id(did)) - .and_then(|nid| { - if let hir_map::Node::NodeField(ref field) = self.tcx.hir.get(nid) { - return self.suggest_mut_for_immutable(&field.ty) - .map(|msg| (self.tcx.hir.span(nid), msg)); - } - None - }); - local_def = err.cmt.get_def() - .and_then(|nid| { - if !self.tcx.hir.is_argument(nid) { - Some(self.tcx.hir.span(nid)) - } else { - None - } - }); - format!("cannot borrow {} as mutable", descr) } BorrowViolation(euv::ClosureInvocation) => { @@ -746,16 +725,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { } }; - let mut db = self.struct_span_err(span, msg); - if let Some((span, msg)) = immutable_field { - db.span_label(span, &msg); - } - if let Some(let_span) = local_def { - if let Ok(snippet) = self.tcx.sess.codemap().span_to_snippet(let_span) { - db.span_label(let_span, &format!("consider changing this to `mut {}`", snippet)); - } - } - db + self.struct_span_err(span, &msg) } pub fn report_aliasability_violation(&self, @@ -788,55 +758,49 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { } }; - let mut err = match cause { - mc::AliasableOther => { - struct_span_err!( - self.tcx.sess, span, E0385, - "{} in an aliasable location", prefix) - } - mc::AliasableReason::UnaliasableImmutable => { - struct_span_err!( - self.tcx.sess, span, E0386, - "{} in an immutable container", prefix) + match cause { + mc::AliasableStatic | + mc::AliasableStaticMut => { + // This path cannot occur. It happens when we have an + // `&mut` or assignment to a static. But in the case + // of `static X`, we get a mutability violation first, + // and never get here. In the case of `static mut X`, + // that is unsafe and hence the aliasability error is + // ignored. + span_bug!(span, "aliasability violation for static `{}`", prefix) } - mc::AliasableClosure(id) => { + mc::AliasableBorrowed => {} + }; + let blame = cmt.immutability_blame(); + let mut err = match blame { + Some(ImmutabilityBlame::ClosureEnv(id)) => { let mut err = struct_span_err!( self.tcx.sess, span, E0387, "{} in a captured outer variable in an `Fn` closure", prefix); - if let BorrowViolation(euv::ClosureCapture(_)) = kind { + + // FIXME: the distinction between these 2 messages looks wrong. + let help = if let BorrowViolation(euv::ClosureCapture(_)) = kind { // The aliasability violation with closure captures can // happen for nested closures, so we know the enclosing // closure incorrectly accepts an `Fn` while it needs to // be `FnMut`. - span_help!(&mut err, self.tcx.hir.span(id), - "consider changing this to accept closures that implement `FnMut`"); + "consider changing this to accept closures that implement `FnMut`" + } else { - span_help!(&mut err, self.tcx.hir.span(id), - "consider changing this closure to take self by mutable reference"); - } + "consider changing this closure to take self by mutable reference" + }; + err.span_help(self.tcx.hir.span(id), help); err } - mc::AliasableStatic | - mc::AliasableStaticMut => { - // This path cannot occur. It happens when we have an - // `&mut` or assignment to a static. But in the case - // of `static X`, we get a mutability violation first, - // and never get here. In the case of `static mut X`, - // that is unsafe and hence the aliasability error is - // ignored. - span_bug!(span, "aliasability violation for static `{}`", prefix) - } - mc::AliasableBorrowed => { - let mut e = struct_span_err!( + _ => { + let mut err = struct_span_err!( self.tcx.sess, span, E0389, "{} in a `&` reference", prefix); - e.span_label(span, &"assignment into an immutable reference"); - if let Some(nid) = cmt.get_arg_if_immutable(&self.tcx.hir) { - self.immutable_argument_should_be_mut(nid, &mut e); - } - e + err.span_label(span, &"assignment into an immutable reference"); + err } }; + self.note_immutability_blame(&mut err, blame); if is_closure { err.help("closures behind references must be called via `&mut`"); @@ -873,8 +837,20 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { None } - fn immutable_argument_should_be_mut(&self, nid: ast::NodeId, db: &mut DiagnosticBuilder) { - let parent = self.tcx.hir.get_parent_node(nid); + fn local_binding_mode(&self, node_id: ast::NodeId) -> hir::BindingMode { + let pat = match self.tcx.hir.get(node_id) { + hir_map::Node::NodeLocal(pat) => pat, + node => bug!("bad node for local: {:?}", node) + }; + + match pat.node { + hir::PatKind::Binding(mode, ..) => mode, + _ => bug!("local is not a binding: {:?}", pat) + } + } + + fn local_ty(&self, node_id: ast::NodeId) -> Option<&hir::Ty> { + let parent = self.tcx.hir.get_parent_node(node_id); let parent_node = self.tcx.hir.get(parent); // The parent node is like a fn @@ -882,12 +858,72 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { // `nid`'s parent's `Body` let fn_body = self.tcx.hir.body(fn_like.body()); // Get the position of `nid` in the arguments list - let arg_pos = fn_body.arguments.iter().position(|arg| arg.pat.id == nid); + let arg_pos = fn_body.arguments.iter().position(|arg| arg.pat.id == node_id); if let Some(i) = arg_pos { // The argument's `Ty` - let arg_ty = &fn_like.decl().inputs[i]; - if let Some(msg) = self.suggest_mut_for_immutable(&arg_ty) { - db.span_label(arg_ty.span, &msg); + Some(&fn_like.decl().inputs[i]) + } else { + None + } + } else { + None + } + } + + fn note_immutability_blame(&self, + db: &mut DiagnosticBuilder, + blame: Option) { + match blame { + None => {} + Some(ImmutabilityBlame::ClosureEnv(_)) => {} + Some(ImmutabilityBlame::ImmLocal(node_id)) => { + let let_span = self.tcx.hir.span(node_id); + if let hir::BindingMode::BindByValue(..) = self.local_binding_mode(node_id) { + if let Ok(snippet) = self.tcx.sess.codemap().span_to_snippet(let_span) { + if self.tcx.hir.name(node_id) == keywords::SelfValue.name() && + snippet != "self" { + // avoid suggesting `mut &self`. + return + } + db.span_label( + let_span, + &format!("consider changing this to `mut {}`", snippet) + ); + } + } + } + Some(ImmutabilityBlame::LocalDeref(node_id)) => { + let let_span = self.tcx.hir.span(node_id); + match self.local_binding_mode(node_id) { + hir::BindingMode::BindByRef(..) => { + let snippet = self.tcx.sess.codemap().span_to_snippet(let_span); + if let Ok(snippet) = snippet { + db.span_label( + let_span, + &format!("consider changing this to `{}`", + snippet.replace("ref ", "ref mut ")) + ); + } + } + hir::BindingMode::BindByValue(..) => { + if let Some(local_ty) = self.local_ty(node_id) { + if let Some(msg) = self.suggest_mut_for_immutable(local_ty) { + db.span_label(local_ty.span, &msg); + } + } + } + } + } + Some(ImmutabilityBlame::AdtFieldDeref(_, field)) => { + let node_id = match self.tcx.hir.as_local_node_id(field.did) { + Some(node_id) => node_id, + None => return + }; + + if let hir_map::Node::NodeField(ref field) = self.tcx.hir.get(node_id) { + if let Some(msg) = self.suggest_mut_for_immutable(&field.ty) { + db.span_label(field.ty.span, &msg); + } } } } @@ -941,10 +977,13 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { } } - pub fn note_and_explain_bckerr(&self, db: &mut DiagnosticBuilder, err: BckError<'tcx>) { + fn note_and_explain_bckerr(&self, db: &mut DiagnosticBuilder, err: BckError<'tcx>) { let error_span = err.span.clone(); match err.code { - err_mutbl => self.note_and_explain_mutbl_error(db, &err, &error_span), + err_mutbl => { + self.note_and_explain_mutbl_error(db, &err, &error_span); + self.note_immutability_blame(db, err.cmt.immutability_blame()); + } err_out_of_scope(super_scope, sub_scope, cause) => { let (value_kind, value_msg) = match err.cmt.cat { mc::Categorization::Rvalue(..) => @@ -1096,13 +1135,6 @@ before rustc 1.16, this temporary lived longer - see issue #39283 \ _ => { if let Categorization::Deref(..) = err.cmt.cat { db.span_label(*error_span, &"cannot borrow as mutable"); - if let Some(local_id) = err.cmt.get_arg_if_immutable(&self.tcx.hir) { - self.immutable_argument_should_be_mut(local_id, db); - } else if let Categorization::Deref(ref inner_cmt, ..) = err.cmt.cat { - if let Categorization::Local(local_id) = inner_cmt.cat { - self.immutable_argument_should_be_mut(local_id, db); - } - } } else if let Categorization::Local(local_id) = err.cmt.cat { let span = self.tcx.hir.span(local_id); if let Ok(snippet) = self.tcx.sess.codemap().span_to_snippet(span) { @@ -1110,14 +1142,6 @@ before rustc 1.16, this temporary lived longer - see issue #39283 \ db.span_label(*error_span, &format!("cannot reborrow mutably")); db.span_label(*error_span, &format!("try removing `&mut` here")); } else { - if snippet.starts_with("ref ") { - db.span_label(span, &format!("use `{}` here to make mutable", - snippet.replace("ref ", "ref mut "))); - } else if snippet != "self" { - db.span_label(span, - &format!("use `mut {}` here to make mutable", - snippet)); - } db.span_label(*error_span, &format!("cannot borrow mutably")); } } else { diff --git a/src/librustc_borrowck/diagnostics.rs b/src/librustc_borrowck/diagnostics.rs index db4a1701e976b..bfd342a9f2134 100644 --- a/src/librustc_borrowck/diagnostics.rs +++ b/src/librustc_borrowck/diagnostics.rs @@ -198,7 +198,7 @@ fn main() { ``` "##, -E0386: r##" +/*E0386: r##" This error occurs when an attempt is made to mutate the target of a mutable reference stored inside an immutable container. @@ -228,7 +228,7 @@ let x: i64 = 1; let y: Box> = Box::new(Cell::new(x)); y.set(2); ``` -"##, +"##,*/ E0387: r##" This error occurs when an attempt is made to mutate or mutably reference data @@ -1117,6 +1117,6 @@ fn main() { } register_diagnostics! { - E0385, // {} in an aliasable location +// E0385, // {} in an aliasable location E0524, // two closures require unique access to `..` at the same time } diff --git a/src/test/compile-fail/augmented-assignments.rs b/src/test/compile-fail/augmented-assignments.rs index 92a8b10669cee..736aa465aa732 100644 --- a/src/test/compile-fail/augmented-assignments.rs +++ b/src/test/compile-fail/augmented-assignments.rs @@ -27,7 +27,7 @@ fn main() { x; //~ value moved here let y = Int(2); - //~^use `mut y` here to make mutable + //~^ consider changing this to `mut y` y //~ error: cannot borrow immutable local variable `y` as mutable //~| cannot borrow += diff --git a/src/test/compile-fail/borrowck/borrowck-issue-14498.rs b/src/test/compile-fail/borrowck/borrowck-issue-14498.rs index 64033623fe2d1..8b7ccedd6974f 100644 --- a/src/test/compile-fail/borrowck/borrowck-issue-14498.rs +++ b/src/test/compile-fail/borrowck/borrowck-issue-14498.rs @@ -23,7 +23,7 @@ fn indirect_write_to_imm_box() { let mut x: isize = 1; let y: Box<_> = box &mut x; let p = &y; - ***p = 2; //~ ERROR cannot assign to data in an immutable container + ***p = 2; //~ ERROR cannot assign to data in a `&` reference drop(p); } @@ -43,7 +43,6 @@ fn borrow_in_var_from_var_via_imm_box() { let p = &y; let q = &***p; **y = 2; //~ ERROR cannot assign to `**y` because it is borrowed - //~^ ERROR cannot assign to data in an immutable container drop(p); drop(q); } @@ -64,7 +63,6 @@ fn borrow_in_var_from_field_via_imm_box() { let p = &y; let q = &***p; **y = 2; //~ ERROR cannot assign to `**y` because it is borrowed - //~^ ERROR cannot assign to data in an immutable container drop(p); drop(q); } @@ -85,7 +83,6 @@ fn borrow_in_field_from_var_via_imm_box() { let p = &y.a; let q = &***p; **y.a = 2; //~ ERROR cannot assign to `**y.a` because it is borrowed - //~^ ERROR cannot assign to data in an immutable container drop(p); drop(q); } @@ -106,7 +103,6 @@ fn borrow_in_field_from_field_via_imm_box() { let p = &y.a; let q = &***p; **y.a = 2; //~ ERROR cannot assign to `**y.a` because it is borrowed - //~^ ERROR cannot assign to data in an immutable container drop(p); drop(q); } diff --git a/src/test/compile-fail/issue-33819.rs b/src/test/compile-fail/issue-33819.rs index 9c9677c1e9863..499e7e54947b7 100644 --- a/src/test/compile-fail/issue-33819.rs +++ b/src/test/compile-fail/issue-33819.rs @@ -12,7 +12,7 @@ fn main() { match op { Some(ref v) => { let a = &mut v; }, //~^ ERROR:cannot borrow immutable - //~| use `ref mut v` here to make mutable + //~| cannot borrow mutably None => {}, } } diff --git a/src/test/compile-fail/mut-suggestion.rs b/src/test/compile-fail/mut-suggestion.rs index 242ad7aee8d12..0015c8e5c00a1 100644 --- a/src/test/compile-fail/mut-suggestion.rs +++ b/src/test/compile-fail/mut-suggestion.rs @@ -17,7 +17,7 @@ impl S { } fn func(arg: S) { - //~^ here to make mutable + //~^ consider changing this to `mut arg` arg.mutate(); //~^ ERROR cannot borrow immutable argument //~| cannot borrow mutably @@ -25,7 +25,7 @@ fn func(arg: S) { fn main() { let local = S; - //~^ here to make mutable + //~^ consider changing this to `mut local` local.mutate(); //~^ ERROR cannot borrow immutable local variable //~| cannot borrow mutably diff --git a/src/test/ui/codemap_tests/huge_multispan_highlight.stderr b/src/test/ui/codemap_tests/huge_multispan_highlight.stderr index edbfd72df615f..7bb69caa1024a 100644 --- a/src/test/ui/codemap_tests/huge_multispan_highlight.stderr +++ b/src/test/ui/codemap_tests/huge_multispan_highlight.stderr @@ -2,7 +2,7 @@ error: cannot borrow immutable local variable `x` as mutable --> $DIR/huge_multispan_highlight.rs:100:18 | 12 | let x = "foo"; - | - use `mut x` here to make mutable + | - consider changing this to `mut x` ... 100 | let y = &mut x; | ^ cannot borrow mutably diff --git a/src/test/ui/did_you_mean/issue-31424.stderr b/src/test/ui/did_you_mean/issue-31424.stderr index 4873acf551ebc..60fa06d314ff7 100644 --- a/src/test/ui/did_you_mean/issue-31424.stderr +++ b/src/test/ui/did_you_mean/issue-31424.stderr @@ -10,6 +10,8 @@ error: cannot borrow immutable argument `self` as mutable error: cannot borrow immutable argument `self` as mutable --> $DIR/issue-31424.rs:23:15 | +22 | fn bar(self: &mut Self) { + | ---- consider changing this to `mut self` 23 | (&mut self).bar(); | ^^^^ cannot borrow mutably diff --git a/src/test/ui/did_you_mean/issue-35937.rs b/src/test/ui/did_you_mean/issue-35937.rs new file mode 100644 index 0000000000000..9ec8728fd32c1 --- /dev/null +++ b/src/test/ui/did_you_mean/issue-35937.rs @@ -0,0 +1,31 @@ +// Copyright 2017 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. + +struct Foo { + pub v: Vec +} + +fn main() { + let f = Foo { v: Vec::new() }; + f.v.push("cat".to_string()); +} + + +struct S { + x: i32, +} +fn foo() { + let s = S { x: 42 }; + s.x += 1; +} + +fn bar(s: S) { + s.x += 1; +} diff --git a/src/test/ui/did_you_mean/issue-35937.stderr b/src/test/ui/did_you_mean/issue-35937.stderr new file mode 100644 index 0000000000000..bea3d1291433d --- /dev/null +++ b/src/test/ui/did_you_mean/issue-35937.stderr @@ -0,0 +1,26 @@ +error: cannot borrow immutable field `f.v` as mutable + --> $DIR/issue-35937.rs:17:5 + | +16 | let f = Foo { v: Vec::new() }; + | - consider changing this to `mut f` +17 | f.v.push("cat".to_string()); + | ^^^ cannot mutably borrow immutable field + +error: cannot assign to immutable field `s.x` + --> $DIR/issue-35937.rs:26:5 + | +25 | let s = S { x: 42 }; + | - consider changing this to `mut s` +26 | s.x += 1; + | ^^^^^^^^ cannot mutably borrow immutable field + +error: cannot assign to immutable field `s.x` + --> $DIR/issue-35937.rs:30:5 + | +29 | fn bar(s: S) { + | - consider changing this to `mut s` +30 | s.x += 1; + | ^^^^^^^^ cannot mutably borrow immutable field + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/did_you_mean/issue-38147-2.stderr b/src/test/ui/did_you_mean/issue-38147-2.stderr index fdaf0cd44d9d4..855feaf7d2d5e 100644 --- a/src/test/ui/did_you_mean/issue-38147-2.stderr +++ b/src/test/ui/did_you_mean/issue-38147-2.stderr @@ -2,7 +2,7 @@ error: cannot borrow immutable borrowed content `*self.s` as mutable --> $DIR/issue-38147-2.rs:17:9 | 12 | s: &'a String - | ------------- use `&'a mut String` here to make mutable + | ---------- use `&'a mut String` here to make mutable ... 17 | self.s.push('x'); | ^^^^^^ cannot borrow as mutable diff --git a/src/test/ui/did_you_mean/issue-38147-3.stderr b/src/test/ui/did_you_mean/issue-38147-3.stderr index d2280fa561bde..d970d078df8d9 100644 --- a/src/test/ui/did_you_mean/issue-38147-3.stderr +++ b/src/test/ui/did_you_mean/issue-38147-3.stderr @@ -2,10 +2,8 @@ error: cannot borrow immutable borrowed content `*self.s` as mutable --> $DIR/issue-38147-3.rs:17:9 | 12 | s: &'a String - | ------------- use `&'a mut String` here to make mutable + | ---------- use `&'a mut String` here to make mutable ... -16 | fn f(&self) { - | ----- use `&mut self` here to make mutable 17 | self.s.push('x'); | ^^^^^^ cannot borrow as mutable diff --git a/src/test/ui/did_you_mean/issue-39544.rs b/src/test/ui/did_you_mean/issue-39544.rs index bcdafefa2472b..c98fed3c3c3c7 100644 --- a/src/test/ui/did_you_mean/issue-39544.rs +++ b/src/test/ui/did_you_mean/issue-39544.rs @@ -8,15 +8,20 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -enum X { +pub enum X { Y } -struct Z { +pub struct Z { x: X } -fn main() { +pub fn main() { let z = Z { x: X::Y }; let _ = &mut z.x; } + +pub fn with_arg(z: Z, w: &Z) { + let _ = &mut z.x; + let _ = &mut w.x; +} diff --git a/src/test/ui/did_you_mean/issue-39544.stderr b/src/test/ui/did_you_mean/issue-39544.stderr index 7f124e6d34d35..bcd55fd744bb6 100644 --- a/src/test/ui/did_you_mean/issue-39544.stderr +++ b/src/test/ui/did_you_mean/issue-39544.stderr @@ -6,5 +6,22 @@ error: cannot borrow immutable field `z.x` as mutable 21 | let _ = &mut z.x; | ^^^ cannot mutably borrow immutable field -error: aborting due to previous error +error: cannot borrow immutable field `z.x` as mutable + --> $DIR/issue-39544.rs:25:18 + | +24 | pub fn with_arg(z: Z, w: &Z) { + | - consider changing this to `mut z` +25 | let _ = &mut z.x; + | ^^^ cannot mutably borrow immutable field + +error: cannot borrow immutable field `w.x` as mutable + --> $DIR/issue-39544.rs:26:18 + | +24 | pub fn with_arg(z: Z, w: &Z) { + | -- use `&mut Z` here to make mutable +25 | let _ = &mut z.x; +26 | let _ = &mut w.x; + | ^^^ cannot mutably borrow immutable field + +error: aborting due to 3 previous errors diff --git a/src/test/ui/did_you_mean/issue-40823.rs b/src/test/ui/did_you_mean/issue-40823.rs new file mode 100644 index 0000000000000..f4ae325727982 --- /dev/null +++ b/src/test/ui/did_you_mean/issue-40823.rs @@ -0,0 +1,14 @@ +// Copyright 2017 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() { + let mut buf = &[1, 2, 3, 4]; + buf.iter_mut(); +} diff --git a/src/test/ui/did_you_mean/issue-40823.stderr b/src/test/ui/did_you_mean/issue-40823.stderr new file mode 100644 index 0000000000000..8e77ebd9b6da3 --- /dev/null +++ b/src/test/ui/did_you_mean/issue-40823.stderr @@ -0,0 +1,8 @@ +error: cannot borrow immutable borrowed content `*buf` as mutable + --> $DIR/issue-40823.rs:13:5 + | +13 | buf.iter_mut(); + | ^^^ cannot borrow as mutable + +error: aborting due to previous error + diff --git a/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr b/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr index b83a6aaebf323..edf1635a6b84f 100644 --- a/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr +++ b/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr @@ -2,7 +2,7 @@ error: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:63:24 | 62 | fn deref_mut_field1(x: Own) { - | - use `mut x` here to make mutable + | - consider changing this to `mut x` 63 | let __isize = &mut x.y; //~ ERROR cannot borrow | ^ cannot borrow mutably @@ -28,7 +28,7 @@ error: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:98:5 | 97 | fn assign_field1<'a>(x: Own) { - | - use `mut x` here to make mutable + | - consider changing this to `mut x` 98 | x.y = 3; //~ ERROR cannot borrow | ^ cannot borrow mutably @@ -54,7 +54,7 @@ error: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:119:5 | 118 | fn deref_mut_method1(x: Own) { - | - use `mut x` here to make mutable + | - consider changing this to `mut x` 119 | x.set(0, 0); //~ ERROR cannot borrow | ^ cannot borrow mutably @@ -70,7 +70,7 @@ error: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:139:6 | 138 | fn assign_method1<'a>(x: Own) { - | - use `mut x` here to make mutable + | - consider changing this to `mut x` 139 | *x.y_mut() = 3; //~ ERROR cannot borrow | ^ cannot borrow mutably diff --git a/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.stderr b/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.stderr index af954a4d7924f..2ec0116872179 100644 --- a/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.stderr +++ b/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.stderr @@ -2,7 +2,7 @@ error: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:39:25 | 38 | fn deref_mut1(x: Own) { - | - use `mut x` here to make mutable + | - consider changing this to `mut x` 39 | let __isize = &mut *x; //~ ERROR cannot borrow | ^ cannot borrow mutably @@ -18,7 +18,7 @@ error: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:59:6 | 58 | fn assign1<'a>(x: Own) { - | - use `mut x` here to make mutable + | - consider changing this to `mut x` 59 | *x = 3; //~ ERROR cannot borrow | ^ cannot borrow mutably diff --git a/src/test/ui/span/borrowck-object-mutability.stderr b/src/test/ui/span/borrowck-object-mutability.stderr index 4ef1cb9c239e4..0abdbdc3a21b5 100644 --- a/src/test/ui/span/borrowck-object-mutability.stderr +++ b/src/test/ui/span/borrowck-object-mutability.stderr @@ -10,6 +10,9 @@ error: cannot borrow immutable borrowed content `*x` as mutable error: cannot borrow immutable `Box` content `*x` as mutable --> $DIR/borrowck-object-mutability.rs:29:5 | +27 | fn owned_receiver(x: Box) { + | - consider changing this to `mut x` +28 | x.borrowed(); 29 | x.borrowed_mut(); //~ ERROR cannot borrow | ^ cannot borrow as mutable From 39011f8590b69d5ee9037c4ac9b863a516ae2e1e Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Mon, 27 Mar 2017 01:35:50 +0300 Subject: [PATCH 05/10] fix handling of `self` --- src/librustc/hir/lowering.rs | 7 ++ src/librustc/hir/mod.rs | 3 + src/librustc_borrowck/borrowck/mod.rs | 60 ++++++++------- src/test/ui/did_you_mean/issue-39544.rs | 28 ++++++- src/test/ui/did_you_mean/issue-39544.stderr | 83 +++++++++++++++++++-- 5 files changed, 143 insertions(+), 38 deletions(-) diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 2ac1a036f99e1..726c305e90304 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -907,6 +907,13 @@ impl<'a> LoweringContext<'a> { FunctionRetTy::Default(span) => hir::DefaultReturn(span), }, variadic: decl.variadic, + has_implicit_self: decl.inputs.get(0).map_or(false, |arg| { + match arg.ty.node { + TyKind::ImplicitSelf => true, + TyKind::Rptr(_, ref mt) => mt.ty.node == TyKind::ImplicitSelf, + _ => false + } + }) }) } diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 1c79a02d3da0e..43b7deb5b90e3 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -1379,6 +1379,9 @@ pub struct FnDecl { pub inputs: HirVec>, pub output: FunctionRetTy, pub variadic: bool, + /// True if this function has an `self`, `&self` or `&mut self` receiver + /// (but not a `self: Xxx` one). + pub has_implicit_self: bool, } #[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index 0981369ace5c1..558a835be1884 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -42,7 +42,6 @@ use std::fmt; use std::rc::Rc; use std::hash::{Hash, Hasher}; use syntax::ast; -use syntax::symbol::keywords; use syntax_pos::{MultiSpan, Span}; use errors::DiagnosticBuilder; @@ -809,32 +808,33 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { } /// Given a type, if it is an immutable reference, return a suggestion to make it mutable - fn suggest_mut_for_immutable(&self, pty: &hir::Ty) -> Option { + fn suggest_mut_for_immutable(&self, pty: &hir::Ty, is_implicit_self: bool) -> Option { // Check wether the argument is an immutable reference + debug!("suggest_mut_for_immutable({:?}, {:?})", pty, is_implicit_self); if let hir::TyRptr(lifetime, hir::MutTy { mutbl: hir::Mutability::MutImmutable, ref ty }) = pty.node { // Account for existing lifetimes when generating the message - if !lifetime.is_elided() { - if let Ok(snippet) = self.tcx.sess.codemap().span_to_snippet(ty.span) { - if let Ok(lifetime_snippet) = self.tcx.sess.codemap() - .span_to_snippet(lifetime.span) { - return Some(format!("use `&{} mut {}` here to make mutable", - lifetime_snippet, - snippet)); - } - } - } else if let Ok(snippet) = self.tcx.sess.codemap().span_to_snippet(pty.span) { - if snippet.starts_with("&") { - return Some(format!("use `{}` here to make mutable", - snippet.replace("&", "&mut "))); - } + let pointee_snippet = match self.tcx.sess.codemap().span_to_snippet(ty.span) { + Ok(snippet) => snippet, + _ => return None + }; + + let lifetime_snippet = if !lifetime.is_elided() { + format!("{} ", match self.tcx.sess.codemap().span_to_snippet(lifetime.span) { + Ok(lifetime_snippet) => lifetime_snippet, + _ => return None + }) } else { - bug!("couldn't find a snippet for span: {:?}", pty.span); - } + String::new() + }; + Some(format!("use `&{}mut {}` here to make mutable", + lifetime_snippet, + if is_implicit_self { "self" } else { &*pointee_snippet })) + } else { + None } - None } fn local_binding_mode(&self, node_id: ast::NodeId) -> hir::BindingMode { @@ -849,7 +849,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { } } - fn local_ty(&self, node_id: ast::NodeId) -> Option<&hir::Ty> { + fn local_ty(&self, node_id: ast::NodeId) -> (Option<&hir::Ty>, bool) { let parent = self.tcx.hir.get_parent_node(node_id); let parent_node = self.tcx.hir.get(parent); @@ -857,16 +857,17 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { if let Some(fn_like) = FnLikeNode::from_node(parent_node) { // `nid`'s parent's `Body` let fn_body = self.tcx.hir.body(fn_like.body()); - // Get the position of `nid` in the arguments list + // Get the position of `node_id` in the arguments list let arg_pos = fn_body.arguments.iter().position(|arg| arg.pat.id == node_id); if let Some(i) = arg_pos { // The argument's `Ty` - Some(&fn_like.decl().inputs[i]) + (Some(&fn_like.decl().inputs[i]), + i == 0 && fn_like.decl().has_implicit_self) } else { - None + (None, false) } } else { - None + (None, false) } } @@ -880,8 +881,8 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { let let_span = self.tcx.hir.span(node_id); if let hir::BindingMode::BindByValue(..) = self.local_binding_mode(node_id) { if let Ok(snippet) = self.tcx.sess.codemap().span_to_snippet(let_span) { - if self.tcx.hir.name(node_id) == keywords::SelfValue.name() && - snippet != "self" { + let (_, is_implicit_self) = self.local_ty(node_id); + if is_implicit_self && snippet != "self" { // avoid suggesting `mut &self`. return } @@ -906,8 +907,9 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { } } hir::BindingMode::BindByValue(..) => { - if let Some(local_ty) = self.local_ty(node_id) { - if let Some(msg) = self.suggest_mut_for_immutable(local_ty) { + if let (Some(local_ty), is_implicit_self) = self.local_ty(node_id) { + if let Some(msg) = + self.suggest_mut_for_immutable(local_ty, is_implicit_self) { db.span_label(local_ty.span, &msg); } } @@ -921,7 +923,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { }; if let hir_map::Node::NodeField(ref field) = self.tcx.hir.get(node_id) { - if let Some(msg) = self.suggest_mut_for_immutable(&field.ty) { + if let Some(msg) = self.suggest_mut_for_immutable(&field.ty, false) { db.span_label(field.ty.span, &msg); } } diff --git a/src/test/ui/did_you_mean/issue-39544.rs b/src/test/ui/did_you_mean/issue-39544.rs index c98fed3c3c3c7..6331fc5771fcb 100644 --- a/src/test/ui/did_you_mean/issue-39544.rs +++ b/src/test/ui/did_you_mean/issue-39544.rs @@ -16,11 +16,37 @@ pub struct Z { x: X } -pub fn main() { +fn main() { let z = Z { x: X::Y }; let _ = &mut z.x; } +impl Z { + fn foo<'z>(&'z self) { + let _ = &mut self.x; + } + + fn foo1(&self, other: &Z) { + let _ = &mut self.x; + let _ = &mut other.x; + } + + fn foo2<'a>(&'a self, other: &Z) { + let _ = &mut self.x; + let _ = &mut other.x; + } + + fn foo3<'a>(self: &'a Self, other: &Z) { + let _ = &mut self.x; + let _ = &mut other.x; + } + + fn foo4(other: &Z) { + let _ = &mut other.x; + } + +} + pub fn with_arg(z: Z, w: &Z) { let _ = &mut z.x; let _ = &mut w.x; diff --git a/src/test/ui/did_you_mean/issue-39544.stderr b/src/test/ui/did_you_mean/issue-39544.stderr index bcd55fd744bb6..e1e229a8b0572 100644 --- a/src/test/ui/did_you_mean/issue-39544.stderr +++ b/src/test/ui/did_you_mean/issue-39544.stderr @@ -6,22 +6,89 @@ error: cannot borrow immutable field `z.x` as mutable 21 | let _ = &mut z.x; | ^^^ cannot mutably borrow immutable field +error: cannot borrow immutable field `self.x` as mutable + --> $DIR/issue-39544.rs:26:22 + | +25 | fn foo<'z>(&'z self) { + | -------- use `&'z mut self` here to make mutable +26 | let _ = &mut self.x; + | ^^^^^^ cannot mutably borrow immutable field + +error: cannot borrow immutable field `self.x` as mutable + --> $DIR/issue-39544.rs:30:22 + | +29 | fn foo1(&self, other: &Z) { + | ----- use `&mut self` here to make mutable +30 | let _ = &mut self.x; + | ^^^^^^ cannot mutably borrow immutable field + +error: cannot borrow immutable field `other.x` as mutable + --> $DIR/issue-39544.rs:31:22 + | +29 | fn foo1(&self, other: &Z) { + | -- use `&mut Z` here to make mutable +30 | let _ = &mut self.x; +31 | let _ = &mut other.x; + | ^^^^^^^ cannot mutably borrow immutable field + +error: cannot borrow immutable field `self.x` as mutable + --> $DIR/issue-39544.rs:35:22 + | +34 | fn foo2<'a>(&'a self, other: &Z) { + | -------- use `&'a mut self` here to make mutable +35 | let _ = &mut self.x; + | ^^^^^^ cannot mutably borrow immutable field + +error: cannot borrow immutable field `other.x` as mutable + --> $DIR/issue-39544.rs:36:22 + | +34 | fn foo2<'a>(&'a self, other: &Z) { + | -- use `&mut Z` here to make mutable +35 | let _ = &mut self.x; +36 | let _ = &mut other.x; + | ^^^^^^^ cannot mutably borrow immutable field + +error: cannot borrow immutable field `self.x` as mutable + --> $DIR/issue-39544.rs:40:22 + | +39 | fn foo3<'a>(self: &'a Self, other: &Z) { + | -------- use `&'a mut Self` here to make mutable +40 | let _ = &mut self.x; + | ^^^^^^ cannot mutably borrow immutable field + +error: cannot borrow immutable field `other.x` as mutable + --> $DIR/issue-39544.rs:41:22 + | +39 | fn foo3<'a>(self: &'a Self, other: &Z) { + | -- use `&mut Z` here to make mutable +40 | let _ = &mut self.x; +41 | let _ = &mut other.x; + | ^^^^^^^ cannot mutably borrow immutable field + +error: cannot borrow immutable field `other.x` as mutable + --> $DIR/issue-39544.rs:45:22 + | +44 | fn foo4(other: &Z) { + | -- use `&mut Z` here to make mutable +45 | let _ = &mut other.x; + | ^^^^^^^ cannot mutably borrow immutable field + error: cannot borrow immutable field `z.x` as mutable - --> $DIR/issue-39544.rs:25:18 + --> $DIR/issue-39544.rs:51:18 | -24 | pub fn with_arg(z: Z, w: &Z) { +50 | pub fn with_arg(z: Z, w: &Z) { | - consider changing this to `mut z` -25 | let _ = &mut z.x; +51 | let _ = &mut z.x; | ^^^ cannot mutably borrow immutable field error: cannot borrow immutable field `w.x` as mutable - --> $DIR/issue-39544.rs:26:18 + --> $DIR/issue-39544.rs:52:18 | -24 | pub fn with_arg(z: Z, w: &Z) { +50 | pub fn with_arg(z: Z, w: &Z) { | -- use `&mut Z` here to make mutable -25 | let _ = &mut z.x; -26 | let _ = &mut w.x; +51 | let _ = &mut z.x; +52 | let _ = &mut w.x; | ^^^ cannot mutably borrow immutable field -error: aborting due to 3 previous errors +error: aborting due to 11 previous errors From 7efbb69b99cf6b88027b3ec0a3d12771703831e7 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 29 Mar 2017 01:18:39 +0200 Subject: [PATCH 06/10] Changed cmp::Reverse to unstable --- src/libcore/cmp.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 751932a6105ae..a43c85328731f 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -330,6 +330,7 @@ impl Ordering { /// Example usage: /// /// ``` +/// #![feature(reverse_cmp_key)] /// use std::cmp::Reverse; /// /// let mut v = vec![1, 2, 3, 4, 5, 6]; @@ -337,10 +338,10 @@ impl Ordering { /// assert_eq!(v, vec![3, 2, 1, 6, 5, 4]); /// ``` #[derive(PartialEq, Eq, Debug)] -#[stable(feature = "rust1", since = "1.18.0")] +#[unstable(feature = "reverse_cmp_key", issue = "40720")] pub struct Reverse(pub T); -#[stable(feature = "rust1", since = "1.18.0")] +#[unstable(feature = "reverse_cmp_key", issue = "40720")] impl PartialOrd for Reverse { #[inline] fn partial_cmp(&self, other: &Reverse) -> Option { @@ -348,7 +349,7 @@ impl PartialOrd for Reverse { } } -#[stable(feature = "rust1", since = "1.18.0")] +#[unstable(feature = "reverse_cmp_key", issue = "40720")] impl Ord for Reverse { #[inline] fn cmp(&self, other: &Reverse) -> Ordering { From 589e01fbfa840baac1517fd981b10db923931b97 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sun, 19 Mar 2017 10:45:05 -0400 Subject: [PATCH 07/10] Add all unstable features to Unstable Book. Add all unstable features to the Unstable Book, also remove a few that either no longer exist or were promoted to stable. These changes were extracted out of https://github.com/rust-lang/rust/pull/40694 --- src/doc/unstable-book/src/SUMMARY.md | 121 +++++++++++++++++- src/doc/unstable-book/src/alloc.md | 7 + src/doc/unstable-book/src/as-unsafe-cell.md | 7 + src/doc/unstable-book/src/ascii-ctype.md | 5 + .../unstable-book/src/binary-heap-extras.md | 7 + .../src/binary-heap-peek-mut-pop.md | 7 + src/doc/unstable-book/src/borrow-state.md | 7 + src/doc/unstable-book/src/box-heap.md | 7 + src/doc/unstable-book/src/c-void-variant.md | 5 + src/doc/unstable-book/src/catch-expr.md | 7 + .../unstable-book/src/char-escape-debug.md | 7 + .../src/closure-to-fn-coercion.md | 7 + src/doc/unstable-book/src/coerce-unsized.md | 7 + .../unstable-book/src/collection-placement.md | 7 + .../unstable-book/src/collections-range.md | 7 + src/doc/unstable-book/src/collections.md | 5 + src/doc/unstable-book/src/command-envs.md | 7 + .../src/compiler-builtins-lib.md | 5 + .../unstable-book/src/concat-idents-macro.md | 7 + src/doc/unstable-book/src/core-char-ext.md | 7 + src/doc/unstable-book/src/core-float.md | 7 + src/doc/unstable-book/src/core-intrinsics.md | 5 + src/doc/unstable-book/src/core-panic.md | 5 + .../unstable-book/src/core-private-bignum.md | 5 + .../src/core-private-diy-float.md | 5 + src/doc/unstable-book/src/core-slice-ext.md | 7 + src/doc/unstable-book/src/core-str-ext.md | 7 + src/doc/unstable-book/src/dec2flt.md | 5 + src/doc/unstable-book/src/decode-utf8.md | 7 + .../unstable-book/src/derive-clone-copy.md | 5 + src/doc/unstable-book/src/derive-eq.md | 5 + .../unstable-book/src/discriminant-value.md | 7 + src/doc/unstable-book/src/enumset.md | 7 + src/doc/unstable-book/src/error-type-id.md | 7 + .../unstable-book/src/exact-size-is-empty.md | 7 + src/doc/unstable-book/src/fd-read.md | 5 + src/doc/unstable-book/src/fd.md | 5 + .../unstable-book/src/field-init-shorthand.md | 10 -- src/doc/unstable-book/src/fixed-size-array.md | 7 + src/doc/unstable-book/src/float-extras.md | 7 + src/doc/unstable-book/src/flt2dec.md | 5 + src/doc/unstable-book/src/fmt-flags-align.md | 7 + src/doc/unstable-book/src/fmt-internals.md | 5 + src/doc/unstable-book/src/fn-traits.md | 7 + src/doc/unstable-book/src/fnbox.md | 7 + src/doc/unstable-book/src/fused.md | 7 + .../src/future-atomic-orderings.md | 5 + src/doc/unstable-book/src/get-type-id.md | 7 + src/doc/unstable-book/src/heap-api.md | 7 + src/doc/unstable-book/src/i128.md | 7 + src/doc/unstable-book/src/inclusive-range.md | 7 + .../unstable-book/src/int-error-internals.md | 5 + src/doc/unstable-book/src/integer-atomics.md | 7 + src/doc/unstable-book/src/into-boxed-c-str.md | 7 + .../unstable-book/src/into-boxed-os-str.md | 7 + src/doc/unstable-book/src/into-boxed-path.md | 7 + .../unstable-book/src/io-error-internals.md | 5 + src/doc/unstable-book/src/io.md | 7 + src/doc/unstable-book/src/ip.md | 7 + src/doc/unstable-book/src/is-unique.md | 7 + src/doc/unstable-book/src/iter-rfind.md | 7 + .../unstable-book/src/libstd-io-internals.md | 5 + .../unstable-book/src/libstd-sys-internals.md | 5 + .../src/libstd-thread-internals.md | 5 + .../unstable-book/src/linked-list-extras.md | 7 + src/doc/unstable-book/src/lookup-host.md | 7 + .../src/map-entry-recover-keys.md | 5 + src/doc/unstable-book/src/mpsc-select.md | 5 + src/doc/unstable-book/src/n16.md | 5 + src/doc/unstable-book/src/never-type-impls.md | 7 + src/doc/unstable-book/src/nonzero.md | 7 + src/doc/unstable-book/src/once-poison.md | 7 + src/doc/unstable-book/src/oom.md | 7 + src/doc/unstable-book/src/option-entry.md | 7 + .../src/osstring-shrink-to-fit.md | 7 + src/doc/unstable-book/src/panic-abort.md | 7 + src/doc/unstable-book/src/panic-unwind.md | 7 + src/doc/unstable-book/src/pattern.md | 7 + src/doc/unstable-book/src/peek.md | 7 + src/doc/unstable-book/src/placement-in.md | 7 + .../src/placement-new-protocol.md | 7 + src/doc/unstable-book/src/print.md | 5 + .../unstable-book/src/proc-macro-internals.md | 7 + src/doc/unstable-book/src/process-try-wait.md | 7 + src/doc/unstable-book/src/pub-restricted.md | 7 + .../src/question-mark-carrier.md | 7 + src/doc/unstable-book/src/rand.md | 5 + src/doc/unstable-book/src/range-contains.md | 7 + src/doc/unstable-book/src/raw.md | 7 + src/doc/unstable-book/src/rc-would-unwrap.md | 5 + .../src/retain-hash-collection.md | 7 + src/doc/unstable-book/src/rt.md | 5 + src/doc/unstable-book/src/rustc-private.md | 7 + src/doc/unstable-book/src/rustdoc.md | 7 + .../src/sanitizer-runtime-lib.md | 5 + src/doc/unstable-book/src/set-stdio.md | 5 + src/doc/unstable-book/src/shared.md | 7 + src/doc/unstable-book/src/sip-hash-13.md | 7 + src/doc/unstable-book/src/slice-concat-ext.md | 7 + src/doc/unstable-book/src/slice-get-slice.md | 7 + src/doc/unstable-book/src/sort-internals.md | 5 + src/doc/unstable-book/src/static-recursion.md | 10 -- src/doc/unstable-book/src/step-by.md | 7 + src/doc/unstable-book/src/step-trait.md | 7 + src/doc/unstable-book/src/str-escape.md | 7 + src/doc/unstable-book/src/str-internals.md | 5 + src/doc/unstable-book/src/thread-id.md | 7 + .../src/thread-local-internals.md | 5 + .../unstable-book/src/thread-local-state.md | 7 + src/doc/unstable-book/src/trusted-len.md | 7 + src/doc/unstable-book/src/try-from.md | 7 + src/doc/unstable-book/src/unicode.md | 7 + src/doc/unstable-book/src/unique.md | 7 + src/doc/unstable-book/src/unsize.md | 7 + .../unstable-book/src/update-panic-count.md | 5 + .../unstable-book/src/utf8-error-error-len.md | 7 + src/doc/unstable-book/src/vec-remove-item.md | 7 + src/doc/unstable-book/src/windows-c.md | 5 + src/doc/unstable-book/src/windows-handle.md | 5 + src/doc/unstable-book/src/windows-net.md | 5 + src/doc/unstable-book/src/windows-stdio.md | 5 + src/doc/unstable-book/src/zero-one.md | 7 + 122 files changed, 876 insertions(+), 22 deletions(-) create mode 100644 src/doc/unstable-book/src/alloc.md create mode 100644 src/doc/unstable-book/src/as-unsafe-cell.md create mode 100644 src/doc/unstable-book/src/ascii-ctype.md create mode 100644 src/doc/unstable-book/src/binary-heap-extras.md create mode 100644 src/doc/unstable-book/src/binary-heap-peek-mut-pop.md create mode 100644 src/doc/unstable-book/src/borrow-state.md create mode 100644 src/doc/unstable-book/src/box-heap.md create mode 100644 src/doc/unstable-book/src/c-void-variant.md create mode 100644 src/doc/unstable-book/src/catch-expr.md create mode 100644 src/doc/unstable-book/src/char-escape-debug.md create mode 100644 src/doc/unstable-book/src/closure-to-fn-coercion.md create mode 100644 src/doc/unstable-book/src/coerce-unsized.md create mode 100644 src/doc/unstable-book/src/collection-placement.md create mode 100644 src/doc/unstable-book/src/collections-range.md create mode 100644 src/doc/unstable-book/src/collections.md create mode 100644 src/doc/unstable-book/src/command-envs.md create mode 100644 src/doc/unstable-book/src/compiler-builtins-lib.md create mode 100644 src/doc/unstable-book/src/concat-idents-macro.md create mode 100644 src/doc/unstable-book/src/core-char-ext.md create mode 100644 src/doc/unstable-book/src/core-float.md create mode 100644 src/doc/unstable-book/src/core-intrinsics.md create mode 100644 src/doc/unstable-book/src/core-panic.md create mode 100644 src/doc/unstable-book/src/core-private-bignum.md create mode 100644 src/doc/unstable-book/src/core-private-diy-float.md create mode 100644 src/doc/unstable-book/src/core-slice-ext.md create mode 100644 src/doc/unstable-book/src/core-str-ext.md create mode 100644 src/doc/unstable-book/src/dec2flt.md create mode 100644 src/doc/unstable-book/src/decode-utf8.md create mode 100644 src/doc/unstable-book/src/derive-clone-copy.md create mode 100644 src/doc/unstable-book/src/derive-eq.md create mode 100644 src/doc/unstable-book/src/discriminant-value.md create mode 100644 src/doc/unstable-book/src/enumset.md create mode 100644 src/doc/unstable-book/src/error-type-id.md create mode 100644 src/doc/unstable-book/src/exact-size-is-empty.md create mode 100644 src/doc/unstable-book/src/fd-read.md create mode 100644 src/doc/unstable-book/src/fd.md delete mode 100644 src/doc/unstable-book/src/field-init-shorthand.md create mode 100644 src/doc/unstable-book/src/fixed-size-array.md create mode 100644 src/doc/unstable-book/src/float-extras.md create mode 100644 src/doc/unstable-book/src/flt2dec.md create mode 100644 src/doc/unstable-book/src/fmt-flags-align.md create mode 100644 src/doc/unstable-book/src/fmt-internals.md create mode 100644 src/doc/unstable-book/src/fn-traits.md create mode 100644 src/doc/unstable-book/src/fnbox.md create mode 100644 src/doc/unstable-book/src/fused.md create mode 100644 src/doc/unstable-book/src/future-atomic-orderings.md create mode 100644 src/doc/unstable-book/src/get-type-id.md create mode 100644 src/doc/unstable-book/src/heap-api.md create mode 100644 src/doc/unstable-book/src/i128.md create mode 100644 src/doc/unstable-book/src/inclusive-range.md create mode 100644 src/doc/unstable-book/src/int-error-internals.md create mode 100644 src/doc/unstable-book/src/integer-atomics.md create mode 100644 src/doc/unstable-book/src/into-boxed-c-str.md create mode 100644 src/doc/unstable-book/src/into-boxed-os-str.md create mode 100644 src/doc/unstable-book/src/into-boxed-path.md create mode 100644 src/doc/unstable-book/src/io-error-internals.md create mode 100644 src/doc/unstable-book/src/io.md create mode 100644 src/doc/unstable-book/src/ip.md create mode 100644 src/doc/unstable-book/src/is-unique.md create mode 100644 src/doc/unstable-book/src/iter-rfind.md create mode 100644 src/doc/unstable-book/src/libstd-io-internals.md create mode 100644 src/doc/unstable-book/src/libstd-sys-internals.md create mode 100644 src/doc/unstable-book/src/libstd-thread-internals.md create mode 100644 src/doc/unstable-book/src/linked-list-extras.md create mode 100644 src/doc/unstable-book/src/lookup-host.md create mode 100644 src/doc/unstable-book/src/map-entry-recover-keys.md create mode 100644 src/doc/unstable-book/src/mpsc-select.md create mode 100644 src/doc/unstable-book/src/n16.md create mode 100644 src/doc/unstable-book/src/never-type-impls.md create mode 100644 src/doc/unstable-book/src/nonzero.md create mode 100644 src/doc/unstable-book/src/once-poison.md create mode 100644 src/doc/unstable-book/src/oom.md create mode 100644 src/doc/unstable-book/src/option-entry.md create mode 100644 src/doc/unstable-book/src/osstring-shrink-to-fit.md create mode 100644 src/doc/unstable-book/src/panic-abort.md create mode 100644 src/doc/unstable-book/src/panic-unwind.md create mode 100644 src/doc/unstable-book/src/pattern.md create mode 100644 src/doc/unstable-book/src/peek.md create mode 100644 src/doc/unstable-book/src/placement-in.md create mode 100644 src/doc/unstable-book/src/placement-new-protocol.md create mode 100644 src/doc/unstable-book/src/print.md create mode 100644 src/doc/unstable-book/src/proc-macro-internals.md create mode 100644 src/doc/unstable-book/src/process-try-wait.md create mode 100644 src/doc/unstable-book/src/pub-restricted.md create mode 100644 src/doc/unstable-book/src/question-mark-carrier.md create mode 100644 src/doc/unstable-book/src/rand.md create mode 100644 src/doc/unstable-book/src/range-contains.md create mode 100644 src/doc/unstable-book/src/raw.md create mode 100644 src/doc/unstable-book/src/rc-would-unwrap.md create mode 100644 src/doc/unstable-book/src/retain-hash-collection.md create mode 100644 src/doc/unstable-book/src/rt.md create mode 100644 src/doc/unstable-book/src/rustc-private.md create mode 100644 src/doc/unstable-book/src/rustdoc.md create mode 100644 src/doc/unstable-book/src/sanitizer-runtime-lib.md create mode 100644 src/doc/unstable-book/src/set-stdio.md create mode 100644 src/doc/unstable-book/src/shared.md create mode 100644 src/doc/unstable-book/src/sip-hash-13.md create mode 100644 src/doc/unstable-book/src/slice-concat-ext.md create mode 100644 src/doc/unstable-book/src/slice-get-slice.md create mode 100644 src/doc/unstable-book/src/sort-internals.md delete mode 100644 src/doc/unstable-book/src/static-recursion.md create mode 100644 src/doc/unstable-book/src/step-by.md create mode 100644 src/doc/unstable-book/src/step-trait.md create mode 100644 src/doc/unstable-book/src/str-escape.md create mode 100644 src/doc/unstable-book/src/str-internals.md create mode 100644 src/doc/unstable-book/src/thread-id.md create mode 100644 src/doc/unstable-book/src/thread-local-internals.md create mode 100644 src/doc/unstable-book/src/thread-local-state.md create mode 100644 src/doc/unstable-book/src/trusted-len.md create mode 100644 src/doc/unstable-book/src/try-from.md create mode 100644 src/doc/unstable-book/src/unicode.md create mode 100644 src/doc/unstable-book/src/unique.md create mode 100644 src/doc/unstable-book/src/unsize.md create mode 100644 src/doc/unstable-book/src/update-panic-count.md create mode 100644 src/doc/unstable-book/src/utf8-error-error-len.md create mode 100644 src/doc/unstable-book/src/vec-remove-item.md create mode 100644 src/doc/unstable-book/src/windows-c.md create mode 100644 src/doc/unstable-book/src/windows-handle.md create mode 100644 src/doc/unstable-book/src/windows-net.md create mode 100644 src/doc/unstable-book/src/windows-stdio.md create mode 100644 src/doc/unstable-book/src/zero-one.md diff --git a/src/doc/unstable-book/src/SUMMARY.md b/src/doc/unstable-book/src/SUMMARY.md index 456c76d43a6ec..fe491d7f9018e 100644 --- a/src/doc/unstable-book/src/SUMMARY.md +++ b/src/doc/unstable-book/src/SUMMARY.md @@ -7,90 +7,207 @@ - [abi_vectorcall](abi-vectorcall.md) - [abi_x86_interrupt](abi-x86-interrupt.md) - [advanced_slice_patterns](advanced-slice-patterns.md) +- [alloc](alloc.md) - [alloc_jemalloc](alloc-jemalloc.md) - [alloc_system](alloc-system.md) - [allocator](allocator.md) - [allow_internal_unstable](allow-internal-unstable.md) +- [as_unsafe_cell](as-unsafe-cell.md) +- [ascii_ctype](ascii-ctype.md) - [asm](asm.md) - [associated_consts](associated-consts.md) - [associated_type_defaults](associated-type-defaults.md) - [attr_literals](attr-literals.md) +- [binary_heap_extras](binary-heap-extras.md) +- [binary_heap_peek_mut_pop](binary-heap-peek-mut-pop.md) +- [borrow_state](borrow-state.md) +- [box_heap](box-heap.md) - [box_patterns](box-patterns.md) - [box_syntax](box-syntax.md) +- [c_void_variant](c-void-variant.md) +- [catch_expr](catch-expr.md) - [cfg_target_feature](cfg-target-feature.md) - [cfg_target_has_atomic](cfg-target-has-atomic.md) - [cfg_target_thread_local](cfg-target-thread-local.md) - [cfg_target_vendor](cfg-target-vendor.md) +- [char_escape_debug](char-escape-debug.md) +- [closure_to_fn_coercion](closure-to-fn-coercion.md) +- [coerce_unsized](coerce-unsized.md) +- [collection_placement](collection-placement.md) +- [collections](collections.md) +- [collections_range](collections-range.md) +- [command_envs](command-envs.md) - [compiler_builtins](compiler-builtins.md) +- [compiler_builtins_lib](compiler-builtins-lib.md) - [concat_idents](concat-idents.md) +- [concat_idents_macro](concat-idents-macro.md) - [conservative_impl_trait](conservative-impl-trait.md) - [const_fn](const-fn.md) - [const_indexing](const-indexing.md) +- [core_char_ext](core-char-ext.md) +- [core_float](core-float.md) +- [core_intrinsics](core-intrinsics.md) +- [core_panic](core-panic.md) +- [core_private_bignum](core-private-bignum.md) +- [core_private_diy_float](core-private-diy-float.md) +- [core_slice_ext](core-slice-ext.md) +- [core_str_ext](core-str-ext.md) - [custom_attribute](custom-attribute.md) - [custom_derive](custom-derive.md) +- [dec2flt](dec2flt.md) +- [decode_utf8](decode-utf8.md) - [default_type_parameter_fallback](default-type-parameter-fallback.md) +- [derive_clone_copy](derive-clone-copy.md) +- [derive_eq](derive-eq.md) +- [discriminant_value](discriminant-value.md) - [drop_types_in_const](drop-types-in-const.md) - [dropck_eyepatch](dropck-eyepatch.md) - [dropck_parametricity](dropck-parametricity.md) +- [enumset](enumset.md) +- [error_type_id](error-type-id.md) +- [exact_size_is_empty](exact-size-is-empty.md) - [exclusive_range_pattern](exclusive-range-pattern.md) -- [field_init_shorthand](field-init-shorthand.md) +- [fd](fd.md) +- [fd_read](fd-read.md) +- [fixed_size_array](fixed-size-array.md) +- [float_extras](float-extras.md) +- [flt2dec](flt2dec.md) +- [fmt_flags_align](fmt-flags-align.md) +- [fmt_internals](fmt-internals.md) +- [fn_traits](fn-traits.md) +- [fnbox](fnbox.md) - [fundamental](fundamental.md) +- [fused](fused.md) +- [future_atomic_orderings](future-atomic-orderings.md) - [generic_param_attrs](generic-param-attrs.md) +- [get_type_id](get-type-id.md) +- [heap_api](heap-api.md) +- [i128](i128.md) - [i128_type](i128-type.md) +- [inclusive_range](inclusive-range.md) - [inclusive_range_syntax](inclusive-range-syntax.md) +- [int_error_internals](int-error-internals.md) +- [integer_atomics](integer-atomics.md) +- [into_boxed_c_str](into-boxed-c-str.md) +- [into_boxed_os_str](into-boxed-os-str.md) +- [into_boxed_path](into-boxed-path.md) - [intrinsics](intrinsics.md) +- [io](io.md) +- [io_error_internals](io-error-internals.md) +- [ip](ip.md) +- [is_unique](is-unique.md) +- [iter_rfind](iter-rfind.md) - [lang_items](lang-items.md) +- [libstd_io_internals](libstd-io-internals.md) +- [libstd_sys_internals](libstd-sys-internals.md) +- [libstd_thread_internals](libstd-thread-internals.md) - [link_args](link-args.md) - [link_cfg](link-cfg.md) - [link_llvm_intrinsics](link-llvm-intrinsics.md) - [linkage](linkage.md) +- [linked_list_extras](linked-list-extras.md) - [log_syntax](log-syntax.md) +- [lookup_host](lookup-host.md) - [loop_break_value](loop-break-value.md) - [macro_reexport](macro-reexport.md) - [main](main.md) +- [map_entry_recover_keys](map-entry-recover-keys.md) +- [mpsc_select](mpsc-select.md) +- [n16](n16.md) - [naked_functions](naked-functions.md) - [needs_allocator](needs-allocator.md) - [needs_panic_runtime](needs-panic-runtime.md) - [never_type](never-type.md) +- [never_type_impls](never-type-impls.md) - [no_core](no-core.md) - [no_debug](no-debug.md) - [non_ascii_idents](non-ascii-idents.md) +- [nonzero](nonzero.md) - [omit_gdb_pretty_printer_section](omit-gdb-pretty-printer-section.md) - [on_unimplemented](on-unimplemented.md) +- [once_poison](once-poison.md) +- [oom](oom.md) - [optin_builtin_traits](optin-builtin-traits.md) +- [option_entry](option-entry.md) +- [osstring_shrink_to_fit](osstring-shrink-to-fit.md) +- [panic_abort](panic-abort.md) - [panic_runtime](panic-runtime.md) +- [panic_unwind](panic-unwind.md) +- [pattern](pattern.md) +- [peek](peek.md) +- [placement_in](placement-in.md) - [placement_in_syntax](placement-in-syntax.md) +- [placement_new_protocol](placement-new-protocol.md) - [platform_intrinsics](platform-intrinsics.md) - [plugin](plugin.md) - [plugin_registrar](plugin-registrar.md) - [prelude_import](prelude-import.md) +- [print](print.md) - [proc_macro](proc-macro.md) +- [proc_macro_internals](proc-macro-internals.md) +- [process_try_wait](process-try-wait.md) +- [pub_restricted](pub-restricted.md) +- [question_mark_carrier](question-mark-carrier.md) - [quote](quote.md) +- [rand](rand.md) +- [range_contains](range-contains.md) +- [raw](raw.md) +- [rc_would_unwrap](rc-would-unwrap.md) - [relaxed_adts](relaxed-adts.md) - [repr_simd](repr-simd.md) +- [retain_hash_collection](retain-hash-collection.md) +- [rt](rt.md) - [rustc_attrs](rustc-attrs.md) - [rustc_diagnostic_macros](rustc-diagnostic-macros.md) +- [rustc_private](rustc-private.md) +- [rustdoc](rustdoc.md) - [rvalue_static_promotion](rvalue-static-promotion.md) - [sanitizer_runtime](sanitizer-runtime.md) +- [sanitizer_runtime_lib](sanitizer-runtime-lib.md) +- [set_stdio](set-stdio.md) +- [shared](shared.md) - [simd](simd.md) - [simd_ffi](simd-ffi.md) +- [sip_hash_13](sip-hash-13.md) +- [slice_concat_ext](slice-concat-ext.md) +- [slice_get_slice](slice-get-slice.md) - [slice_patterns](slice-patterns.md) +- [sort_internals](sort-internals.md) - [sort_unstable](sort-unstable.md) - [specialization](specialization.md) - [staged_api](staged-api.md) - [start](start.md) - [static_nobundle](static-nobundle.md) -- [static_recursion](static-recursion.md) +- [step_by](step-by.md) +- [step_trait](step-trait.md) - [stmt_expr_attributes](stmt-expr-attributes.md) +- [str_escape](str-escape.md) +- [str_internals](str-internals.md) - [struct_field_attributes](struct-field-attributes.md) - [structural_match](structural-match.md) - [target_feature](target-feature.md) - [test](test.md) +- [thread_id](thread-id.md) - [thread_local](thread-local.md) +- [thread_local_internals](thread-local-internals.md) +- [thread_local_state](thread-local-state.md) - [trace_macros](trace-macros.md) +- [trusted_len](trusted-len.md) +- [try_from](try-from.md) - [type_ascription](type-ascription.md) - [unboxed_closures](unboxed-closures.md) +- [unicode](unicode.md) +- [unique](unique.md) +- [unsize](unsize.md) - [untagged_unions](untagged-unions.md) - [unwind_attributes](unwind-attributes.md) +- [update_panic_count](update-panic-count.md) - [use_extern_macros](use-extern-macros.md) +- [utf8_error_error_len](utf8-error-error-len.md) +- [vec_remove_item](vec-remove-item.md) +- [windows_c](windows-c.md) +- [windows_handle](windows-handle.md) +- [windows_net](windows-net.md) +- [windows_stdio](windows-stdio.md) - [windows_subsystem](windows-subsystem.md) +- [zero_one](zero-one.md) diff --git a/src/doc/unstable-book/src/alloc.md b/src/doc/unstable-book/src/alloc.md new file mode 100644 index 0000000000000..47eeb0874fba1 --- /dev/null +++ b/src/doc/unstable-book/src/alloc.md @@ -0,0 +1,7 @@ +# `alloc` + +The tracking issue for this feature is: [#27783] + +[#27783]: https://github.com/rust-lang/rust/issues/27783 + +------------------------ diff --git a/src/doc/unstable-book/src/as-unsafe-cell.md b/src/doc/unstable-book/src/as-unsafe-cell.md new file mode 100644 index 0000000000000..79d7a7cad0b6e --- /dev/null +++ b/src/doc/unstable-book/src/as-unsafe-cell.md @@ -0,0 +1,7 @@ +# `as_unsafe_cell` + +The tracking issue for this feature is: [#27708] + +[#27708]: https://github.com/rust-lang/rust/issues/27708 + +------------------------ diff --git a/src/doc/unstable-book/src/ascii-ctype.md b/src/doc/unstable-book/src/ascii-ctype.md new file mode 100644 index 0000000000000..e253b4dcd9b5a --- /dev/null +++ b/src/doc/unstable-book/src/ascii-ctype.md @@ -0,0 +1,5 @@ +# `ascii_ctype` + +The tracking issue for this feature is: [#39658] + +[#39658]: https://github.com/rust-lang/rust/issues/39658 diff --git a/src/doc/unstable-book/src/binary-heap-extras.md b/src/doc/unstable-book/src/binary-heap-extras.md new file mode 100644 index 0000000000000..aa535f3b67840 --- /dev/null +++ b/src/doc/unstable-book/src/binary-heap-extras.md @@ -0,0 +1,7 @@ +# `binary_heap_extras` + +The tracking issue for this feature is: [#28147] + +[#28147]: https://github.com/rust-lang/rust/issues/28147 + +------------------------ diff --git a/src/doc/unstable-book/src/binary-heap-peek-mut-pop.md b/src/doc/unstable-book/src/binary-heap-peek-mut-pop.md new file mode 100644 index 0000000000000..f3863ab2a2abb --- /dev/null +++ b/src/doc/unstable-book/src/binary-heap-peek-mut-pop.md @@ -0,0 +1,7 @@ +# `binary_heap_peek_mut_pop` + +The tracking issue for this feature is: [#38863] + +[#38863]: https://github.com/rust-lang/rust/issues/38863 + +------------------------ diff --git a/src/doc/unstable-book/src/borrow-state.md b/src/doc/unstable-book/src/borrow-state.md new file mode 100644 index 0000000000000..304b8dffe9867 --- /dev/null +++ b/src/doc/unstable-book/src/borrow-state.md @@ -0,0 +1,7 @@ +# `borrow_state` + +The tracking issue for this feature is: [#27733] + +[#27733]: https://github.com/rust-lang/rust/issues/27733 + +------------------------ diff --git a/src/doc/unstable-book/src/box-heap.md b/src/doc/unstable-book/src/box-heap.md new file mode 100644 index 0000000000000..0f3f01ba0e164 --- /dev/null +++ b/src/doc/unstable-book/src/box-heap.md @@ -0,0 +1,7 @@ +# `box_heap` + +The tracking issue for this feature is: [#27779] + +[#27779]: https://github.com/rust-lang/rust/issues/27779 + +------------------------ diff --git a/src/doc/unstable-book/src/c-void-variant.md b/src/doc/unstable-book/src/c-void-variant.md new file mode 100644 index 0000000000000..a2fdc99363007 --- /dev/null +++ b/src/doc/unstable-book/src/c-void-variant.md @@ -0,0 +1,5 @@ +# `c_void_variant` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/catch-expr.md b/src/doc/unstable-book/src/catch-expr.md new file mode 100644 index 0000000000000..44eb2a6dd4fdb --- /dev/null +++ b/src/doc/unstable-book/src/catch-expr.md @@ -0,0 +1,7 @@ +# `catch_expr` + +The tracking issue for this feature is: [#31436] + +[#31436]: https://github.com/rust-lang/rust/issues/31436 + +------------------------ diff --git a/src/doc/unstable-book/src/char-escape-debug.md b/src/doc/unstable-book/src/char-escape-debug.md new file mode 100644 index 0000000000000..21aa486219e0d --- /dev/null +++ b/src/doc/unstable-book/src/char-escape-debug.md @@ -0,0 +1,7 @@ +# `char_escape_debug` + +The tracking issue for this feature is: [#35068] + +[#35068]: https://github.com/rust-lang/rust/issues/35068 + +------------------------ diff --git a/src/doc/unstable-book/src/closure-to-fn-coercion.md b/src/doc/unstable-book/src/closure-to-fn-coercion.md new file mode 100644 index 0000000000000..4e3b735e24fb6 --- /dev/null +++ b/src/doc/unstable-book/src/closure-to-fn-coercion.md @@ -0,0 +1,7 @@ +# `closure_to_fn_coercion` + +The tracking issue for this feature is: [#39817] + +[#39817]: https://github.com/rust-lang/rust/issues/39817 + +------------------------ diff --git a/src/doc/unstable-book/src/coerce-unsized.md b/src/doc/unstable-book/src/coerce-unsized.md new file mode 100644 index 0000000000000..078d3faf42a7b --- /dev/null +++ b/src/doc/unstable-book/src/coerce-unsized.md @@ -0,0 +1,7 @@ +# `coerce_unsized` + +The tracking issue for this feature is: [#27732] + +[#27732]: https://github.com/rust-lang/rust/issues/27732 + +------------------------ diff --git a/src/doc/unstable-book/src/collection-placement.md b/src/doc/unstable-book/src/collection-placement.md new file mode 100644 index 0000000000000..268ca6ea590d5 --- /dev/null +++ b/src/doc/unstable-book/src/collection-placement.md @@ -0,0 +1,7 @@ +# `collection_placement` + +The tracking issue for this feature is: [#30172] + +[#30172]: https://github.com/rust-lang/rust/issues/30172 + +------------------------ diff --git a/src/doc/unstable-book/src/collections-range.md b/src/doc/unstable-book/src/collections-range.md new file mode 100644 index 0000000000000..ea4f999ba0f9a --- /dev/null +++ b/src/doc/unstable-book/src/collections-range.md @@ -0,0 +1,7 @@ +# `collections_range` + +The tracking issue for this feature is: [#30877] + +[#30877]: https://github.com/rust-lang/rust/issues/30877 + +------------------------ diff --git a/src/doc/unstable-book/src/collections.md b/src/doc/unstable-book/src/collections.md new file mode 100644 index 0000000000000..5c937833c9e26 --- /dev/null +++ b/src/doc/unstable-book/src/collections.md @@ -0,0 +1,5 @@ +# `collections` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/command-envs.md b/src/doc/unstable-book/src/command-envs.md new file mode 100644 index 0000000000000..0ab89e278cdf7 --- /dev/null +++ b/src/doc/unstable-book/src/command-envs.md @@ -0,0 +1,7 @@ +# `command_envs` + +The tracking issue for this feature is: [#38526] + +[#38526]: https://github.com/rust-lang/rust/issues/38526 + +------------------------ diff --git a/src/doc/unstable-book/src/compiler-builtins-lib.md b/src/doc/unstable-book/src/compiler-builtins-lib.md new file mode 100644 index 0000000000000..8986b968ca6c4 --- /dev/null +++ b/src/doc/unstable-book/src/compiler-builtins-lib.md @@ -0,0 +1,5 @@ +# `compiler_builtins_lib` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/concat-idents-macro.md b/src/doc/unstable-book/src/concat-idents-macro.md new file mode 100644 index 0000000000000..ac2fdd4fceb6d --- /dev/null +++ b/src/doc/unstable-book/src/concat-idents-macro.md @@ -0,0 +1,7 @@ +# `concat_idents_macro` + +The tracking issue for this feature is: [#29599] + +[#29599]: https://github.com/rust-lang/rust/issues/29599 + +------------------------ diff --git a/src/doc/unstable-book/src/core-char-ext.md b/src/doc/unstable-book/src/core-char-ext.md new file mode 100644 index 0000000000000..d37d6b5c6d0ba --- /dev/null +++ b/src/doc/unstable-book/src/core-char-ext.md @@ -0,0 +1,7 @@ +# `core_char_ext` + +The tracking issue for this feature is: [#32110] + +[#32110]: https://github.com/rust-lang/rust/issues/32110 + +------------------------ diff --git a/src/doc/unstable-book/src/core-float.md b/src/doc/unstable-book/src/core-float.md new file mode 100644 index 0000000000000..194b2608dd02b --- /dev/null +++ b/src/doc/unstable-book/src/core-float.md @@ -0,0 +1,7 @@ +# `core_float` + +The tracking issue for this feature is: [#32110] + +[#32110]: https://github.com/rust-lang/rust/issues/32110 + +------------------------ diff --git a/src/doc/unstable-book/src/core-intrinsics.md b/src/doc/unstable-book/src/core-intrinsics.md new file mode 100644 index 0000000000000..28ad3525ef7a6 --- /dev/null +++ b/src/doc/unstable-book/src/core-intrinsics.md @@ -0,0 +1,5 @@ +# `core_intrinsics` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/core-panic.md b/src/doc/unstable-book/src/core-panic.md new file mode 100644 index 0000000000000..c197588404c93 --- /dev/null +++ b/src/doc/unstable-book/src/core-panic.md @@ -0,0 +1,5 @@ +# `core_panic` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/core-private-bignum.md b/src/doc/unstable-book/src/core-private-bignum.md new file mode 100644 index 0000000000000..f85811c545e43 --- /dev/null +++ b/src/doc/unstable-book/src/core-private-bignum.md @@ -0,0 +1,5 @@ +# `core_private_bignum` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/core-private-diy-float.md b/src/doc/unstable-book/src/core-private-diy-float.md new file mode 100644 index 0000000000000..8465921d673b1 --- /dev/null +++ b/src/doc/unstable-book/src/core-private-diy-float.md @@ -0,0 +1,5 @@ +# `core_private_diy_float` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/core-slice-ext.md b/src/doc/unstable-book/src/core-slice-ext.md new file mode 100644 index 0000000000000..c50d44ac0ce3e --- /dev/null +++ b/src/doc/unstable-book/src/core-slice-ext.md @@ -0,0 +1,7 @@ +# `core_slice_ext` + +The tracking issue for this feature is: [#32110] + +[#32110]: https://github.com/rust-lang/rust/issues/32110 + +------------------------ diff --git a/src/doc/unstable-book/src/core-str-ext.md b/src/doc/unstable-book/src/core-str-ext.md new file mode 100644 index 0000000000000..08c68f11c6eca --- /dev/null +++ b/src/doc/unstable-book/src/core-str-ext.md @@ -0,0 +1,7 @@ +# `core_str_ext` + +The tracking issue for this feature is: [#32110] + +[#32110]: https://github.com/rust-lang/rust/issues/32110 + +------------------------ diff --git a/src/doc/unstable-book/src/dec2flt.md b/src/doc/unstable-book/src/dec2flt.md new file mode 100644 index 0000000000000..311ab4adcfd75 --- /dev/null +++ b/src/doc/unstable-book/src/dec2flt.md @@ -0,0 +1,5 @@ +# `dec2flt` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/decode-utf8.md b/src/doc/unstable-book/src/decode-utf8.md new file mode 100644 index 0000000000000..b96854ebcd461 --- /dev/null +++ b/src/doc/unstable-book/src/decode-utf8.md @@ -0,0 +1,7 @@ +# `decode_utf8` + +The tracking issue for this feature is: [#27783] + +[#27783]: https://github.com/rust-lang/rust/issues/27783 + +------------------------ diff --git a/src/doc/unstable-book/src/derive-clone-copy.md b/src/doc/unstable-book/src/derive-clone-copy.md new file mode 100644 index 0000000000000..cc603911cbd29 --- /dev/null +++ b/src/doc/unstable-book/src/derive-clone-copy.md @@ -0,0 +1,5 @@ +# `derive_clone_copy` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/derive-eq.md b/src/doc/unstable-book/src/derive-eq.md new file mode 100644 index 0000000000000..68a275f5419d4 --- /dev/null +++ b/src/doc/unstable-book/src/derive-eq.md @@ -0,0 +1,5 @@ +# `derive_eq` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/discriminant-value.md b/src/doc/unstable-book/src/discriminant-value.md new file mode 100644 index 0000000000000..2f99f5ecab39f --- /dev/null +++ b/src/doc/unstable-book/src/discriminant-value.md @@ -0,0 +1,7 @@ +# `discriminant_value` + +The tracking issue for this feature is: [#24263] + +[#24263]: https://github.com/rust-lang/rust/issues/24263 + +------------------------ diff --git a/src/doc/unstable-book/src/enumset.md b/src/doc/unstable-book/src/enumset.md new file mode 100644 index 0000000000000..24c8d8fa7dbb9 --- /dev/null +++ b/src/doc/unstable-book/src/enumset.md @@ -0,0 +1,7 @@ +# `enumset` + +The tracking issue for this feature is: [#37966] + +[#37966]: https://github.com/rust-lang/rust/issues/37966 + +------------------------ diff --git a/src/doc/unstable-book/src/error-type-id.md b/src/doc/unstable-book/src/error-type-id.md new file mode 100644 index 0000000000000..be7a3ffd4dc43 --- /dev/null +++ b/src/doc/unstable-book/src/error-type-id.md @@ -0,0 +1,7 @@ +# `error_type_id` + +The tracking issue for this feature is: [#27745] + +[#27745]: https://github.com/rust-lang/rust/issues/27745 + +------------------------ diff --git a/src/doc/unstable-book/src/exact-size-is-empty.md b/src/doc/unstable-book/src/exact-size-is-empty.md new file mode 100644 index 0000000000000..200ec38725176 --- /dev/null +++ b/src/doc/unstable-book/src/exact-size-is-empty.md @@ -0,0 +1,7 @@ +# `exact_size_is_empty` + +The tracking issue for this feature is: [#35428] + +[#35428]: https://github.com/rust-lang/rust/issues/35428 + +------------------------ diff --git a/src/doc/unstable-book/src/fd-read.md b/src/doc/unstable-book/src/fd-read.md new file mode 100644 index 0000000000000..e78d4330abfc0 --- /dev/null +++ b/src/doc/unstable-book/src/fd-read.md @@ -0,0 +1,5 @@ +# `fd_read` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/fd.md b/src/doc/unstable-book/src/fd.md new file mode 100644 index 0000000000000..0414244285ba7 --- /dev/null +++ b/src/doc/unstable-book/src/fd.md @@ -0,0 +1,5 @@ +# `fd` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/field-init-shorthand.md b/src/doc/unstable-book/src/field-init-shorthand.md deleted file mode 100644 index e737dbaa4ec02..0000000000000 --- a/src/doc/unstable-book/src/field-init-shorthand.md +++ /dev/null @@ -1,10 +0,0 @@ -# `field_init_shorthand` - -The tracking issue for this feature is: [#37340] - -[#37340]: https://github.com/rust-lang/rust/issues/37340 - ------------------------- - - - diff --git a/src/doc/unstable-book/src/fixed-size-array.md b/src/doc/unstable-book/src/fixed-size-array.md new file mode 100644 index 0000000000000..9e24e6a0850d1 --- /dev/null +++ b/src/doc/unstable-book/src/fixed-size-array.md @@ -0,0 +1,7 @@ +# `fixed_size_array` + +The tracking issue for this feature is: [#27778] + +[#27778]: https://github.com/rust-lang/rust/issues/27778 + +------------------------ diff --git a/src/doc/unstable-book/src/float-extras.md b/src/doc/unstable-book/src/float-extras.md new file mode 100644 index 0000000000000..ff2d20a545fe5 --- /dev/null +++ b/src/doc/unstable-book/src/float-extras.md @@ -0,0 +1,7 @@ +# `float_extras` + +The tracking issue for this feature is: [#27752] + +[#27752]: https://github.com/rust-lang/rust/issues/27752 + +------------------------ diff --git a/src/doc/unstable-book/src/flt2dec.md b/src/doc/unstable-book/src/flt2dec.md new file mode 100644 index 0000000000000..15e62a3a7dad0 --- /dev/null +++ b/src/doc/unstable-book/src/flt2dec.md @@ -0,0 +1,5 @@ +# `flt2dec` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/fmt-flags-align.md b/src/doc/unstable-book/src/fmt-flags-align.md new file mode 100644 index 0000000000000..755263bd9a61f --- /dev/null +++ b/src/doc/unstable-book/src/fmt-flags-align.md @@ -0,0 +1,7 @@ +# `fmt_flags_align` + +The tracking issue for this feature is: [#27726] + +[#27726]: https://github.com/rust-lang/rust/issues/27726 + +------------------------ diff --git a/src/doc/unstable-book/src/fmt-internals.md b/src/doc/unstable-book/src/fmt-internals.md new file mode 100644 index 0000000000000..7cbe3c89a6441 --- /dev/null +++ b/src/doc/unstable-book/src/fmt-internals.md @@ -0,0 +1,5 @@ +# `fmt_internals` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/fn-traits.md b/src/doc/unstable-book/src/fn-traits.md new file mode 100644 index 0000000000000..3942cda553889 --- /dev/null +++ b/src/doc/unstable-book/src/fn-traits.md @@ -0,0 +1,7 @@ +# `fn_traits` + +The tracking issue for this feature is: [#29625] + +[#29625]: https://github.com/rust-lang/rust/issues/29625 + +------------------------ diff --git a/src/doc/unstable-book/src/fnbox.md b/src/doc/unstable-book/src/fnbox.md new file mode 100644 index 0000000000000..a9b74d4f00470 --- /dev/null +++ b/src/doc/unstable-book/src/fnbox.md @@ -0,0 +1,7 @@ +# `fnbox` + +The tracking issue for this feature is: [#28796] + +[#28796]: https://github.com/rust-lang/rust/issues/28796 + +------------------------ diff --git a/src/doc/unstable-book/src/fused.md b/src/doc/unstable-book/src/fused.md new file mode 100644 index 0000000000000..460555bf1b0db --- /dev/null +++ b/src/doc/unstable-book/src/fused.md @@ -0,0 +1,7 @@ +# `fused` + +The tracking issue for this feature is: [#35602] + +[#35602]: https://github.com/rust-lang/rust/issues/35602 + +------------------------ diff --git a/src/doc/unstable-book/src/future-atomic-orderings.md b/src/doc/unstable-book/src/future-atomic-orderings.md new file mode 100644 index 0000000000000..40c2ef2db0551 --- /dev/null +++ b/src/doc/unstable-book/src/future-atomic-orderings.md @@ -0,0 +1,5 @@ +# `future_atomic_orderings` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/get-type-id.md b/src/doc/unstable-book/src/get-type-id.md new file mode 100644 index 0000000000000..afdb030c406dd --- /dev/null +++ b/src/doc/unstable-book/src/get-type-id.md @@ -0,0 +1,7 @@ +# `get_type_id` + +The tracking issue for this feature is: [#27745] + +[#27745]: https://github.com/rust-lang/rust/issues/27745 + +------------------------ diff --git a/src/doc/unstable-book/src/heap-api.md b/src/doc/unstable-book/src/heap-api.md new file mode 100644 index 0000000000000..01404e49dbda3 --- /dev/null +++ b/src/doc/unstable-book/src/heap-api.md @@ -0,0 +1,7 @@ +# `heap_api` + +The tracking issue for this feature is: [#27700] + +[#27700]: https://github.com/rust-lang/rust/issues/27700 + +------------------------ diff --git a/src/doc/unstable-book/src/i128.md b/src/doc/unstable-book/src/i128.md new file mode 100644 index 0000000000000..a1a7ce8e63f44 --- /dev/null +++ b/src/doc/unstable-book/src/i128.md @@ -0,0 +1,7 @@ +# `i128` + +The tracking issue for this feature is: [#35118] + +[#35118]: https://github.com/rust-lang/rust/issues/35118 + +------------------------ diff --git a/src/doc/unstable-book/src/inclusive-range.md b/src/doc/unstable-book/src/inclusive-range.md new file mode 100644 index 0000000000000..2e88e2047868d --- /dev/null +++ b/src/doc/unstable-book/src/inclusive-range.md @@ -0,0 +1,7 @@ +# `inclusive_range` + +The tracking issue for this feature is: [#28237] + +[#28237]: https://github.com/rust-lang/rust/issues/28237 + +------------------------ diff --git a/src/doc/unstable-book/src/int-error-internals.md b/src/doc/unstable-book/src/int-error-internals.md new file mode 100644 index 0000000000000..402e4fa5ef6d7 --- /dev/null +++ b/src/doc/unstable-book/src/int-error-internals.md @@ -0,0 +1,5 @@ +# `int_error_internals` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/integer-atomics.md b/src/doc/unstable-book/src/integer-atomics.md new file mode 100644 index 0000000000000..50db9fd4ca45c --- /dev/null +++ b/src/doc/unstable-book/src/integer-atomics.md @@ -0,0 +1,7 @@ +# `integer_atomics` + +The tracking issue for this feature is: [#32976] + +[#32976]: https://github.com/rust-lang/rust/issues/32976 + +------------------------ diff --git a/src/doc/unstable-book/src/into-boxed-c-str.md b/src/doc/unstable-book/src/into-boxed-c-str.md new file mode 100644 index 0000000000000..0d94b4fc56057 --- /dev/null +++ b/src/doc/unstable-book/src/into-boxed-c-str.md @@ -0,0 +1,7 @@ +# `into_boxed_c_str` + +The tracking issue for this feature is: [#40380] + +[#40380]: https://github.com/rust-lang/rust/issues/40380 + +------------------------ diff --git a/src/doc/unstable-book/src/into-boxed-os-str.md b/src/doc/unstable-book/src/into-boxed-os-str.md new file mode 100644 index 0000000000000..7636e20b14d88 --- /dev/null +++ b/src/doc/unstable-book/src/into-boxed-os-str.md @@ -0,0 +1,7 @@ +# `into_boxed_os_str` + +The tracking issue for this feature is: [#into_boxed_os_str] + +[#into_boxed_os_str]: https://github.com/rust-lang/rust/issues/40380 + +------------------------ diff --git a/src/doc/unstable-book/src/into-boxed-path.md b/src/doc/unstable-book/src/into-boxed-path.md new file mode 100644 index 0000000000000..754c6042f07f6 --- /dev/null +++ b/src/doc/unstable-book/src/into-boxed-path.md @@ -0,0 +1,7 @@ +# `into_boxed_path` + +The tracking issue for this feature is: [#40380] + +[#40380]: https://github.com/rust-lang/rust/issues/40380 + +------------------------ diff --git a/src/doc/unstable-book/src/io-error-internals.md b/src/doc/unstable-book/src/io-error-internals.md new file mode 100644 index 0000000000000..5bee18d33d61b --- /dev/null +++ b/src/doc/unstable-book/src/io-error-internals.md @@ -0,0 +1,5 @@ +# `io_error_internals` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/io.md b/src/doc/unstable-book/src/io.md new file mode 100644 index 0000000000000..ed6cae24e32de --- /dev/null +++ b/src/doc/unstable-book/src/io.md @@ -0,0 +1,7 @@ +# `io` + +The tracking issue for this feature is: [#27802] + +[#27802]: https://github.com/rust-lang/rust/issues/27802 + +------------------------ diff --git a/src/doc/unstable-book/src/ip.md b/src/doc/unstable-book/src/ip.md new file mode 100644 index 0000000000000..7e7d52adbdb0f --- /dev/null +++ b/src/doc/unstable-book/src/ip.md @@ -0,0 +1,7 @@ +# `ip` + +The tracking issue for this feature is: [#27709] + +[#27709]: https://github.com/rust-lang/rust/issues/27709 + +------------------------ diff --git a/src/doc/unstable-book/src/is-unique.md b/src/doc/unstable-book/src/is-unique.md new file mode 100644 index 0000000000000..6070006758b7a --- /dev/null +++ b/src/doc/unstable-book/src/is-unique.md @@ -0,0 +1,7 @@ +# `is_unique` + +The tracking issue for this feature is: [#28356] + +[#28356]: https://github.com/rust-lang/rust/issues/28356 + +------------------------ diff --git a/src/doc/unstable-book/src/iter-rfind.md b/src/doc/unstable-book/src/iter-rfind.md new file mode 100644 index 0000000000000..444714490345b --- /dev/null +++ b/src/doc/unstable-book/src/iter-rfind.md @@ -0,0 +1,7 @@ +# `iter_rfind` + +The tracking issue for this feature is: [#39480] + +[#39480]: https://github.com/rust-lang/rust/issues/39480 + +------------------------ diff --git a/src/doc/unstable-book/src/libstd-io-internals.md b/src/doc/unstable-book/src/libstd-io-internals.md new file mode 100644 index 0000000000000..8bcc2769db71e --- /dev/null +++ b/src/doc/unstable-book/src/libstd-io-internals.md @@ -0,0 +1,5 @@ +# `libstd_io_internals` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/libstd-sys-internals.md b/src/doc/unstable-book/src/libstd-sys-internals.md new file mode 100644 index 0000000000000..1b53faa8a0071 --- /dev/null +++ b/src/doc/unstable-book/src/libstd-sys-internals.md @@ -0,0 +1,5 @@ +# `libstd_sys_internals` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/libstd-thread-internals.md b/src/doc/unstable-book/src/libstd-thread-internals.md new file mode 100644 index 0000000000000..b682d12e7cdd1 --- /dev/null +++ b/src/doc/unstable-book/src/libstd-thread-internals.md @@ -0,0 +1,5 @@ +# `libstd_thread_internals` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/linked-list-extras.md b/src/doc/unstable-book/src/linked-list-extras.md new file mode 100644 index 0000000000000..be3b96aea70d8 --- /dev/null +++ b/src/doc/unstable-book/src/linked-list-extras.md @@ -0,0 +1,7 @@ +# `linked_list_extras` + +The tracking issue for this feature is: [#27794] + +[#27794]: https://github.com/rust-lang/rust/issues/27794 + +------------------------ diff --git a/src/doc/unstable-book/src/lookup-host.md b/src/doc/unstable-book/src/lookup-host.md new file mode 100644 index 0000000000000..b60e7a010945a --- /dev/null +++ b/src/doc/unstable-book/src/lookup-host.md @@ -0,0 +1,7 @@ +# `lookup_host` + +The tracking issue for this feature is: [#27705] + +[#27705]: https://github.com/rust-lang/rust/issues/27705 + +------------------------ diff --git a/src/doc/unstable-book/src/map-entry-recover-keys.md b/src/doc/unstable-book/src/map-entry-recover-keys.md new file mode 100644 index 0000000000000..2d15aa0e90de8 --- /dev/null +++ b/src/doc/unstable-book/src/map-entry-recover-keys.md @@ -0,0 +1,5 @@ +# `map_entry_recover_keys` + +The tracking issue for this feature is: [#34285] + +[#34285]: https://github.com/rust-lang/rust/issues/34285 diff --git a/src/doc/unstable-book/src/mpsc-select.md b/src/doc/unstable-book/src/mpsc-select.md new file mode 100644 index 0000000000000..1405b6c5cb245 --- /dev/null +++ b/src/doc/unstable-book/src/mpsc-select.md @@ -0,0 +1,5 @@ +# `mpsc_select` + +The tracking issue for this feature is: [#27800] + +[#27800]: https://github.com/rust-lang/rust/issues/27800 diff --git a/src/doc/unstable-book/src/n16.md b/src/doc/unstable-book/src/n16.md new file mode 100644 index 0000000000000..e556adaa13ea7 --- /dev/null +++ b/src/doc/unstable-book/src/n16.md @@ -0,0 +1,5 @@ +# `n16` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/never-type-impls.md b/src/doc/unstable-book/src/never-type-impls.md new file mode 100644 index 0000000000000..4063cd0db01d6 --- /dev/null +++ b/src/doc/unstable-book/src/never-type-impls.md @@ -0,0 +1,7 @@ +# `never_type_impls` + +The tracking issue for this feature is: [#35121] + +[#35121]: https://github.com/rust-lang/rust/issues/35121 + +------------------------ diff --git a/src/doc/unstable-book/src/nonzero.md b/src/doc/unstable-book/src/nonzero.md new file mode 100644 index 0000000000000..f200f8e2786fa --- /dev/null +++ b/src/doc/unstable-book/src/nonzero.md @@ -0,0 +1,7 @@ +# `nonzero` + +The tracking issue for this feature is: [#27730] + +[#27730]: https://github.com/rust-lang/rust/issues/27730 + +------------------------ diff --git a/src/doc/unstable-book/src/once-poison.md b/src/doc/unstable-book/src/once-poison.md new file mode 100644 index 0000000000000..3c16cafae5014 --- /dev/null +++ b/src/doc/unstable-book/src/once-poison.md @@ -0,0 +1,7 @@ +# `once_poison` + +The tracking issue for this feature is: [#33577] + +[#33577]: https://github.com/rust-lang/rust/issues/33577 + +------------------------ diff --git a/src/doc/unstable-book/src/oom.md b/src/doc/unstable-book/src/oom.md new file mode 100644 index 0000000000000..908caeb75c601 --- /dev/null +++ b/src/doc/unstable-book/src/oom.md @@ -0,0 +1,7 @@ +# `oom` + +The tracking issue for this feature is: [#27700] + +[#27700]: https://github.com/rust-lang/rust/issues/27700 + +------------------------ diff --git a/src/doc/unstable-book/src/option-entry.md b/src/doc/unstable-book/src/option-entry.md new file mode 100644 index 0000000000000..edb4efc09e587 --- /dev/null +++ b/src/doc/unstable-book/src/option-entry.md @@ -0,0 +1,7 @@ +# `option_entry` + +The tracking issue for this feature is: [#39288] + +[#39288]: https://github.com/rust-lang/rust/issues/39288 + +------------------------ diff --git a/src/doc/unstable-book/src/osstring-shrink-to-fit.md b/src/doc/unstable-book/src/osstring-shrink-to-fit.md new file mode 100644 index 0000000000000..21dc7d095c808 --- /dev/null +++ b/src/doc/unstable-book/src/osstring-shrink-to-fit.md @@ -0,0 +1,7 @@ +# `osstring_shrink_to_fit` + +The tracking issue for this feature is: [#40421] + +[#40421]: https://github.com/rust-lang/rust/issues/40421 + +------------------------ diff --git a/src/doc/unstable-book/src/panic-abort.md b/src/doc/unstable-book/src/panic-abort.md new file mode 100644 index 0000000000000..07a957626905e --- /dev/null +++ b/src/doc/unstable-book/src/panic-abort.md @@ -0,0 +1,7 @@ +# `panic_abort` + +The tracking issue for this feature is: [#32837] + +[#32837]: https://github.com/rust-lang/rust/issues/32837 + +------------------------ diff --git a/src/doc/unstable-book/src/panic-unwind.md b/src/doc/unstable-book/src/panic-unwind.md new file mode 100644 index 0000000000000..840e492597b54 --- /dev/null +++ b/src/doc/unstable-book/src/panic-unwind.md @@ -0,0 +1,7 @@ +# `panic_unwind` + +The tracking issue for this feature is: [#32837] + +[#32837]: https://github.com/rust-lang/rust/issues/32837 + +------------------------ diff --git a/src/doc/unstable-book/src/pattern.md b/src/doc/unstable-book/src/pattern.md new file mode 100644 index 0000000000000..e76ee6beb675b --- /dev/null +++ b/src/doc/unstable-book/src/pattern.md @@ -0,0 +1,7 @@ +# `pattern` + +The tracking issue for this feature is: [#27721] + +[#27721]: https://github.com/rust-lang/rust/issues/27721 + +------------------------ diff --git a/src/doc/unstable-book/src/peek.md b/src/doc/unstable-book/src/peek.md new file mode 100644 index 0000000000000..c42b4e995ec58 --- /dev/null +++ b/src/doc/unstable-book/src/peek.md @@ -0,0 +1,7 @@ +# `peek` + +The tracking issue for this feature is: [#38980] + +[#38980]: https://github.com/rust-lang/rust/issues/38980 + +------------------------ diff --git a/src/doc/unstable-book/src/placement-in.md b/src/doc/unstable-book/src/placement-in.md new file mode 100644 index 0000000000000..6ff010b7e3855 --- /dev/null +++ b/src/doc/unstable-book/src/placement-in.md @@ -0,0 +1,7 @@ +# `placement_in` + +The tracking issue for this feature is: [#27779] + +[#27779]: https://github.com/rust-lang/rust/issues/27779 + +------------------------ diff --git a/src/doc/unstable-book/src/placement-new-protocol.md b/src/doc/unstable-book/src/placement-new-protocol.md new file mode 100644 index 0000000000000..d53225f0a352e --- /dev/null +++ b/src/doc/unstable-book/src/placement-new-protocol.md @@ -0,0 +1,7 @@ +# `placement_new_protocol` + +The tracking issue for this feature is: [#27779] + +[#27779]: https://github.com/rust-lang/rust/issues/27779 + +------------------------ diff --git a/src/doc/unstable-book/src/print.md b/src/doc/unstable-book/src/print.md new file mode 100644 index 0000000000000..dc25cb237e3b5 --- /dev/null +++ b/src/doc/unstable-book/src/print.md @@ -0,0 +1,5 @@ +# `print` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/proc-macro-internals.md b/src/doc/unstable-book/src/proc-macro-internals.md new file mode 100644 index 0000000000000..ea087c0a4f7b0 --- /dev/null +++ b/src/doc/unstable-book/src/proc-macro-internals.md @@ -0,0 +1,7 @@ +# `proc_macro_internals` + +The tracking issue for this feature is: [#27812] + +[#27812]: https://github.com/rust-lang/rust/issues/27812 + +------------------------ diff --git a/src/doc/unstable-book/src/process-try-wait.md b/src/doc/unstable-book/src/process-try-wait.md new file mode 100644 index 0000000000000..3593b6423495a --- /dev/null +++ b/src/doc/unstable-book/src/process-try-wait.md @@ -0,0 +1,7 @@ +# `process_try_wait` + +The tracking issue for this feature is: [#38903] + +[#38903]: https://github.com/rust-lang/rust/issues/38903 + +------------------------ diff --git a/src/doc/unstable-book/src/pub-restricted.md b/src/doc/unstable-book/src/pub-restricted.md new file mode 100644 index 0000000000000..6b1e88b860301 --- /dev/null +++ b/src/doc/unstable-book/src/pub-restricted.md @@ -0,0 +1,7 @@ +# `pub_restricted` + +The tracking issue for this feature is: [#32409] + +[#38356]: https://github.com/rust-lang/rust/issues/32409 + +------------------------ diff --git a/src/doc/unstable-book/src/question-mark-carrier.md b/src/doc/unstable-book/src/question-mark-carrier.md new file mode 100644 index 0000000000000..56154acc02bbf --- /dev/null +++ b/src/doc/unstable-book/src/question-mark-carrier.md @@ -0,0 +1,7 @@ +# `question_mark_carrier` + +The tracking issue for this feature is: [#31436] + +[#31436]: https://github.com/rust-lang/rust/issues/31436 + +------------------------ diff --git a/src/doc/unstable-book/src/rand.md b/src/doc/unstable-book/src/rand.md new file mode 100644 index 0000000000000..d0229d94c20bf --- /dev/null +++ b/src/doc/unstable-book/src/rand.md @@ -0,0 +1,5 @@ +# `rand` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/range-contains.md b/src/doc/unstable-book/src/range-contains.md new file mode 100644 index 0000000000000..ac4581faf2ae4 --- /dev/null +++ b/src/doc/unstable-book/src/range-contains.md @@ -0,0 +1,7 @@ +# `range_contains` + +The tracking issue for this feature is: [#32311] + +[#32311]: https://github.com/rust-lang/rust/issues/32311 + +------------------------ diff --git a/src/doc/unstable-book/src/raw.md b/src/doc/unstable-book/src/raw.md new file mode 100644 index 0000000000000..d7caf22813dc7 --- /dev/null +++ b/src/doc/unstable-book/src/raw.md @@ -0,0 +1,7 @@ +# `raw` + +The tracking issue for this feature is: [#27751] + +[#27751]: https://github.com/rust-lang/rust/issues/27751 + +------------------------ diff --git a/src/doc/unstable-book/src/rc-would-unwrap.md b/src/doc/unstable-book/src/rc-would-unwrap.md new file mode 100644 index 0000000000000..462387dfdcc40 --- /dev/null +++ b/src/doc/unstable-book/src/rc-would-unwrap.md @@ -0,0 +1,5 @@ +# `rc_would_unwrap` + +The tracking issue for this feature is: [#28356] + +[#28356]: https://github.com/rust-lang/rust/issues/28356 diff --git a/src/doc/unstable-book/src/retain-hash-collection.md b/src/doc/unstable-book/src/retain-hash-collection.md new file mode 100644 index 0000000000000..c9ba5acf02003 --- /dev/null +++ b/src/doc/unstable-book/src/retain-hash-collection.md @@ -0,0 +1,7 @@ +# `retain_hash_collection` + +The tracking issue for this feature is: [#36648] + +[#36648]: https://github.com/rust-lang/rust/issues/36648 + +------------------------ diff --git a/src/doc/unstable-book/src/rt.md b/src/doc/unstable-book/src/rt.md new file mode 100644 index 0000000000000..007acc207a655 --- /dev/null +++ b/src/doc/unstable-book/src/rt.md @@ -0,0 +1,5 @@ +# `rt` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/rustc-private.md b/src/doc/unstable-book/src/rustc-private.md new file mode 100644 index 0000000000000..2453475efe599 --- /dev/null +++ b/src/doc/unstable-book/src/rustc-private.md @@ -0,0 +1,7 @@ +# `rustc_private` + +The tracking issue for this feature is: [#27812] + +[#27812]: https://github.com/rust-lang/rust/issues/27812 + +------------------------ diff --git a/src/doc/unstable-book/src/rustdoc.md b/src/doc/unstable-book/src/rustdoc.md new file mode 100644 index 0000000000000..c7491ab034bff --- /dev/null +++ b/src/doc/unstable-book/src/rustdoc.md @@ -0,0 +1,7 @@ +# `rustdoc` + +The tracking issue for this feature is: [#27812] + +[#27812]: https://github.com/rust-lang/rust/issues/27812 + +------------------------ diff --git a/src/doc/unstable-book/src/sanitizer-runtime-lib.md b/src/doc/unstable-book/src/sanitizer-runtime-lib.md new file mode 100644 index 0000000000000..82ae67fc05ac3 --- /dev/null +++ b/src/doc/unstable-book/src/sanitizer-runtime-lib.md @@ -0,0 +1,5 @@ +# `sanitizer_runtime_lib` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/set-stdio.md b/src/doc/unstable-book/src/set-stdio.md new file mode 100644 index 0000000000000..7dbdcdaa1a2ff --- /dev/null +++ b/src/doc/unstable-book/src/set-stdio.md @@ -0,0 +1,5 @@ +# `set_stdio` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/shared.md b/src/doc/unstable-book/src/shared.md new file mode 100644 index 0000000000000..b79d1212c62f0 --- /dev/null +++ b/src/doc/unstable-book/src/shared.md @@ -0,0 +1,7 @@ +# `shared` + +The tracking issue for this feature is: [#27730] + +[#27730]: https://github.com/rust-lang/rust/issues/27730 + +------------------------ diff --git a/src/doc/unstable-book/src/sip-hash-13.md b/src/doc/unstable-book/src/sip-hash-13.md new file mode 100644 index 0000000000000..8f69c3ab2def7 --- /dev/null +++ b/src/doc/unstable-book/src/sip-hash-13.md @@ -0,0 +1,7 @@ +# `sip_hash_13` + +The tracking issue for this feature is: [#34767] + +[#34767]: https://github.com/rust-lang/rust/issues/34767 + +------------------------ diff --git a/src/doc/unstable-book/src/slice-concat-ext.md b/src/doc/unstable-book/src/slice-concat-ext.md new file mode 100644 index 0000000000000..9ba2de5adc726 --- /dev/null +++ b/src/doc/unstable-book/src/slice-concat-ext.md @@ -0,0 +1,7 @@ +# `slice_concat_ext` + +The tracking issue for this feature is: [#27747] + +[#27747]: https://github.com/rust-lang/rust/issues/27747 + +------------------------ diff --git a/src/doc/unstable-book/src/slice-get-slice.md b/src/doc/unstable-book/src/slice-get-slice.md new file mode 100644 index 0000000000000..57e2c148e7963 --- /dev/null +++ b/src/doc/unstable-book/src/slice-get-slice.md @@ -0,0 +1,7 @@ +# `slice_get_slice` + +The tracking issue for this feature is: [#35729] + +[#35729]: https://github.com/rust-lang/rust/issues/35729 + +------------------------ diff --git a/src/doc/unstable-book/src/sort-internals.md b/src/doc/unstable-book/src/sort-internals.md new file mode 100644 index 0000000000000..6f2385e53008a --- /dev/null +++ b/src/doc/unstable-book/src/sort-internals.md @@ -0,0 +1,5 @@ +# `sort_internals` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/static-recursion.md b/src/doc/unstable-book/src/static-recursion.md deleted file mode 100644 index d419ea41c6ffb..0000000000000 --- a/src/doc/unstable-book/src/static-recursion.md +++ /dev/null @@ -1,10 +0,0 @@ -# `static_recursion` - -The tracking issue for this feature is: [#29719] - -[#29719]: https://github.com/rust-lang/rust/issues/29719 - ------------------------- - - - diff --git a/src/doc/unstable-book/src/step-by.md b/src/doc/unstable-book/src/step-by.md new file mode 100644 index 0000000000000..b649496cdd80b --- /dev/null +++ b/src/doc/unstable-book/src/step-by.md @@ -0,0 +1,7 @@ +# `step_by` + +The tracking issue for this feature is: [#27741] + +[#27741]: https://github.com/rust-lang/rust/issues/27741 + +------------------------ diff --git a/src/doc/unstable-book/src/step-trait.md b/src/doc/unstable-book/src/step-trait.md new file mode 100644 index 0000000000000..e53ca13f7b6f5 --- /dev/null +++ b/src/doc/unstable-book/src/step-trait.md @@ -0,0 +1,7 @@ +# `step_trait` + +The tracking issue for this feature is: [#27741] + +[#27741]: https://github.com/rust-lang/rust/issues/27741 + +------------------------ diff --git a/src/doc/unstable-book/src/str-escape.md b/src/doc/unstable-book/src/str-escape.md new file mode 100644 index 0000000000000..61e31c8944326 --- /dev/null +++ b/src/doc/unstable-book/src/str-escape.md @@ -0,0 +1,7 @@ +# `str_escape` + +The tracking issue for this feature is: [#27791] + +[#27791]: https://github.com/rust-lang/rust/issues/27791 + +------------------------ diff --git a/src/doc/unstable-book/src/str-internals.md b/src/doc/unstable-book/src/str-internals.md new file mode 100644 index 0000000000000..af8ef056dbe27 --- /dev/null +++ b/src/doc/unstable-book/src/str-internals.md @@ -0,0 +1,5 @@ +# `str_internals` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/thread-id.md b/src/doc/unstable-book/src/thread-id.md new file mode 100644 index 0000000000000..af3ea991025f7 --- /dev/null +++ b/src/doc/unstable-book/src/thread-id.md @@ -0,0 +1,7 @@ +# `thread_id` + +The tracking issue for this feature is: [#21507] + +[#21507]: https://github.com/rust-lang/rust/issues/21507 + +------------------------ diff --git a/src/doc/unstable-book/src/thread-local-internals.md b/src/doc/unstable-book/src/thread-local-internals.md new file mode 100644 index 0000000000000..e1cdcc339d229 --- /dev/null +++ b/src/doc/unstable-book/src/thread-local-internals.md @@ -0,0 +1,5 @@ +# `thread_local_internals` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/thread-local-state.md b/src/doc/unstable-book/src/thread-local-state.md new file mode 100644 index 0000000000000..113c1e910dca3 --- /dev/null +++ b/src/doc/unstable-book/src/thread-local-state.md @@ -0,0 +1,7 @@ +# `thread_local_state` + +The tracking issue for this feature is: [#27716] + +[#27716]: https://github.com/rust-lang/rust/issues/27716 + +------------------------ diff --git a/src/doc/unstable-book/src/trusted-len.md b/src/doc/unstable-book/src/trusted-len.md new file mode 100644 index 0000000000000..80213cf1fdbb9 --- /dev/null +++ b/src/doc/unstable-book/src/trusted-len.md @@ -0,0 +1,7 @@ +# `trusted_len` + +The tracking issue for this feature is: [#37572] + +[#37572]: https://github.com/rust-lang/rust/issues/37572 + +------------------------ diff --git a/src/doc/unstable-book/src/try-from.md b/src/doc/unstable-book/src/try-from.md new file mode 100644 index 0000000000000..d763caff5aacb --- /dev/null +++ b/src/doc/unstable-book/src/try-from.md @@ -0,0 +1,7 @@ +# `try_from` + +The tracking issue for this feature is: [#33417] + +[#33417]: https://github.com/rust-lang/rust/issues/33417 + +------------------------ diff --git a/src/doc/unstable-book/src/unicode.md b/src/doc/unstable-book/src/unicode.md new file mode 100644 index 0000000000000..9fecec2ac36d3 --- /dev/null +++ b/src/doc/unstable-book/src/unicode.md @@ -0,0 +1,7 @@ +# `unicode` + +The tracking issue for this feature is: [#27783] + +[#27783]: https://github.com/rust-lang/rust/issues/27783 + +------------------------ diff --git a/src/doc/unstable-book/src/unique.md b/src/doc/unstable-book/src/unique.md new file mode 100644 index 0000000000000..99a3490d106bb --- /dev/null +++ b/src/doc/unstable-book/src/unique.md @@ -0,0 +1,7 @@ +# `unique` + +The tracking issue for this feature is: [#27730] + +[#27730]: https://github.com/rust-lang/rust/issues/27730 + +------------------------ diff --git a/src/doc/unstable-book/src/unsize.md b/src/doc/unstable-book/src/unsize.md new file mode 100644 index 0000000000000..92807e2858ffd --- /dev/null +++ b/src/doc/unstable-book/src/unsize.md @@ -0,0 +1,7 @@ +# `unsize` + +The tracking issue for this feature is: [#27732] + +[#27732]: https://github.com/rust-lang/rust/issues/27732 + +------------------------ diff --git a/src/doc/unstable-book/src/update-panic-count.md b/src/doc/unstable-book/src/update-panic-count.md new file mode 100644 index 0000000000000..d315647ba1049 --- /dev/null +++ b/src/doc/unstable-book/src/update-panic-count.md @@ -0,0 +1,5 @@ +# `update_panic_count` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/utf8-error-error-len.md b/src/doc/unstable-book/src/utf8-error-error-len.md new file mode 100644 index 0000000000000..1c14a5a9fa08b --- /dev/null +++ b/src/doc/unstable-book/src/utf8-error-error-len.md @@ -0,0 +1,7 @@ +# `utf8_error_error_len` + +The tracking issue for this feature is: [#40494] + +[#40494]: https://github.com/rust-lang/rust/issues/40494 + +------------------------ diff --git a/src/doc/unstable-book/src/vec-remove-item.md b/src/doc/unstable-book/src/vec-remove-item.md new file mode 100644 index 0000000000000..2b8c9f046eefd --- /dev/null +++ b/src/doc/unstable-book/src/vec-remove-item.md @@ -0,0 +1,7 @@ +# `vec_remove_item` + +The tracking issue for this feature is: [#40062] + +[#40062]: https://github.com/rust-lang/rust/issues/40062 + +------------------------ diff --git a/src/doc/unstable-book/src/windows-c.md b/src/doc/unstable-book/src/windows-c.md new file mode 100644 index 0000000000000..3f833eb3d093e --- /dev/null +++ b/src/doc/unstable-book/src/windows-c.md @@ -0,0 +1,5 @@ +# `windows_c` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/windows-handle.md b/src/doc/unstable-book/src/windows-handle.md new file mode 100644 index 0000000000000..f47a8425045b9 --- /dev/null +++ b/src/doc/unstable-book/src/windows-handle.md @@ -0,0 +1,5 @@ +# `windows_handle` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/windows-net.md b/src/doc/unstable-book/src/windows-net.md new file mode 100644 index 0000000000000..174960d4f0048 --- /dev/null +++ b/src/doc/unstable-book/src/windows-net.md @@ -0,0 +1,5 @@ +# `windows_net` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/windows-stdio.md b/src/doc/unstable-book/src/windows-stdio.md new file mode 100644 index 0000000000000..4d361442386a2 --- /dev/null +++ b/src/doc/unstable-book/src/windows-stdio.md @@ -0,0 +1,5 @@ +# `windows_stdio` + +This feature is internal to the Rust compiler and is not intended for general use. + +------------------------ diff --git a/src/doc/unstable-book/src/zero-one.md b/src/doc/unstable-book/src/zero-one.md new file mode 100644 index 0000000000000..4d1cf38c3c2ea --- /dev/null +++ b/src/doc/unstable-book/src/zero-one.md @@ -0,0 +1,7 @@ +# `zero_one` + +The tracking issue for this feature is: [#27739] + +[#27739]: https://github.com/rust-lang/rust/issues/27739 + +------------------------ From 3207657d12951df71c30f6e5e26e2f70f7b07d2e Mon Sep 17 00:00:00 2001 From: projektir Date: Mon, 27 Mar 2017 16:10:44 -0400 Subject: [PATCH 08/10] Adding linking for Once docs #29377 --- src/libstd/sync/once.rs | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 1e7394c0b09e7..d9edf5d125489 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -72,9 +72,11 @@ use thread::{self, Thread}; /// A synchronization primitive which can be used to run a one-time global /// initialization. Useful for one-time initialization for FFI or related -/// functionality. This type can only be constructed with the `ONCE_INIT` +/// functionality. This type can only be constructed with the [`ONCE_INIT`] /// value. /// +/// [`ONCE_INIT`]: constant.ONCE_INIT.html +/// /// # Examples /// /// ``` @@ -101,15 +103,28 @@ unsafe impl Sync for Once {} #[stable(feature = "rust1", since = "1.0.0")] unsafe impl Send for Once {} -/// State yielded to the `call_once_force` method which can be used to query -/// whether the `Once` was previously poisoned or not. +/// State yielded to the [`call_once_force`] method which can be used to query +/// whether the [`Once`] was previously poisoned or not. +/// +/// [`call_once_force`]: struct.Once.html#method.call_once_force +/// [`Once`]: struct.Once.html #[unstable(feature = "once_poison", issue = "33577")] #[derive(Debug)] pub struct OnceState { poisoned: bool, } -/// Initialization value for static `Once` values. +/// Initialization value for static [`Once`] values. +/// +/// [`Once`]: struct.Once.html +/// +/// # Examples +/// +/// ``` +/// use std::sync::{Once, ONCE_INIT}; +/// +/// static START: Once = ONCE_INIT; +/// ``` #[stable(feature = "rust1", since = "1.0.0")] pub const ONCE_INIT: Once = Once::new(); @@ -212,15 +227,19 @@ impl Once { self.call_inner(false, &mut |_| f.take().unwrap()()); } - /// Performs the same function as `call_once` except ignores poisoning. + /// Performs the same function as [`call_once`] except ignores poisoning. + /// + /// [`call_once`]: struct.Once.html#method.call_once /// /// If this `Once` has been poisoned (some initialization panicked) then /// this function will continue to attempt to call initialization functions /// until one of them doesn't panic. /// - /// The closure `f` is yielded a structure which can be used to query the + /// The closure `f` is yielded a [`OnceState`] structure which can be used to query the /// state of this `Once` (whether initialization has previously panicked or /// not). + /// + /// [`OnceState`]: struct.OnceState.html #[unstable(feature = "once_poison", issue = "33577")] pub fn call_once_force(&'static self, f: F) where F: FnOnce(&OnceState) { // same as above, just with a different parameter to `call_inner`. @@ -366,10 +385,12 @@ impl Drop for Finish { } impl OnceState { - /// Returns whether the associated `Once` has been poisoned. + /// Returns whether the associated [`Once`] has been poisoned. /// - /// Once an initalization routine for a `Once` has panicked it will forever + /// Once an initalization routine for a [`Once`] has panicked it will forever /// indicate to future forced initialization routines that it is poisoned. + /// + /// [`Once`]: struct.Once.html #[unstable(feature = "once_poison", issue = "33577")] pub fn poisoned(&self) -> bool { self.poisoned From 5d3695362f795a45947e92c77f910dcacba575ea Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 29 Mar 2017 09:06:52 +0200 Subject: [PATCH 09/10] Updated tracking issue for cmp::Reverse --- src/libcore/cmp.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index a43c85328731f..bdfd55b100289 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -338,10 +338,10 @@ impl Ordering { /// assert_eq!(v, vec![3, 2, 1, 6, 5, 4]); /// ``` #[derive(PartialEq, Eq, Debug)] -#[unstable(feature = "reverse_cmp_key", issue = "40720")] +#[unstable(feature = "reverse_cmp_key", issue = "40893")] pub struct Reverse(pub T); -#[unstable(feature = "reverse_cmp_key", issue = "40720")] +#[unstable(feature = "reverse_cmp_key", issue = "40893")] impl PartialOrd for Reverse { #[inline] fn partial_cmp(&self, other: &Reverse) -> Option { @@ -349,7 +349,7 @@ impl PartialOrd for Reverse { } } -#[unstable(feature = "reverse_cmp_key", issue = "40720")] +#[unstable(feature = "reverse_cmp_key", issue = "40893")] impl Ord for Reverse { #[inline] fn cmp(&self, other: &Reverse) -> Ordering { From 3783c44eac713028969ac3cbdad6f30a3dbbbf97 Mon Sep 17 00:00:00 2001 From: Irfan Hudda Date: Wed, 29 Mar 2017 16:50:09 +0530 Subject: [PATCH 10/10] Fix typo in libcore/char.rs --- src/libcore/char.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/char.rs b/src/libcore/char.rs index 19e69ca296d8f..b27c801cf89d5 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -187,7 +187,7 @@ impl From for u32 { /// with the character encoding that IANA calls ISO-8859-1. /// This encoding is compatible with ASCII. /// -/// Note that this is different from ISO/IEC 8859-1 a.k.a. ISO 8859-1 (with one less hypen), +/// Note that this is different from ISO/IEC 8859-1 a.k.a. ISO 8859-1 (with one less hyphen), /// which leaves some "blanks", byte values that are not assigned to any character. /// ISO-8859-1 (the IANA one) assigns them to the C0 and C1 control codes. ///