From 4897820a16b162ff19f8d8eaf6515732caaf0a35 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 30 Jul 2018 16:43:23 -0600 Subject: [PATCH 01/11] Remove unused arguments --- src/librustc_typeck/check/compare_method.rs | 9 ++------- src/librustc_typeck/coherence/builtin.rs | 16 +++++----------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/librustc_typeck/check/compare_method.rs b/src/librustc_typeck/check/compare_method.rs index 0ca92d724b559..546553ac2455d 100644 --- a/src/librustc_typeck/check/compare_method.rs +++ b/src/librustc_typeck/check/compare_method.rs @@ -68,9 +68,7 @@ pub fn compare_impl_method<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, if let Err(ErrorReported) = compare_synthetic_generics(tcx, impl_m, - impl_m_span, - trait_m, - trait_item_span) { + trait_m) { return; } @@ -729,14 +727,11 @@ fn compare_number_of_method_arguments<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, fn compare_synthetic_generics<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_m: &ty::AssociatedItem, - _impl_m_span: Span, // FIXME necessary? - trait_m: &ty::AssociatedItem, - _trait_item_span: Option) // FIXME necessary? + trait_m: &ty::AssociatedItem) -> Result<(), ErrorReported> { // FIXME(chrisvittal) Clean up this function, list of FIXME items: // 1. Better messages for the span labels // 2. Explanation as to what is going on - // 3. Correct the function signature for what we actually use // If we get here, we already have the same number of generics, so the zip will // be okay. let mut error_found = false; diff --git a/src/librustc_typeck/coherence/builtin.rs b/src/librustc_typeck/coherence/builtin.rs index 4d9a4a03a6b50..ba65d0606b372 100644 --- a/src/librustc_typeck/coherence/builtin.rs +++ b/src/librustc_typeck/coherence/builtin.rs @@ -41,21 +41,19 @@ struct Checker<'a, 'tcx: 'a> { impl<'a, 'tcx> Checker<'a, 'tcx> { fn check(&self, trait_def_id: Option, mut f: F) -> &Self - where F: FnMut(TyCtxt<'a, 'tcx, 'tcx>, DefId, DefId) + where F: FnMut(TyCtxt<'a, 'tcx, 'tcx>, DefId) { if Some(self.trait_def_id) == trait_def_id { for &impl_id in self.tcx.hir.trait_impls(self.trait_def_id) { let impl_def_id = self.tcx.hir.local_def_id(impl_id); - f(self.tcx, self.trait_def_id, impl_def_id); + f(self.tcx, impl_def_id); } } self } } -fn visit_implementation_of_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - _drop_did: DefId, - impl_did: DefId) { +fn visit_implementation_of_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did: DefId) { match tcx.type_of(impl_did).sty { ty::TyAdt(..) => {} _ => { @@ -87,9 +85,7 @@ fn visit_implementation_of_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } } -fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - _copy_did: DefId, - impl_did: DefId) { +fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did: DefId) { debug!("visit_implementation_of_copy: impl_did={:?}", impl_did); let impl_node_id = if let Some(n) = tcx.hir.as_local_node_id(impl_did) { @@ -157,9 +153,7 @@ fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } } -fn visit_implementation_of_coerce_unsized<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - _: DefId, - impl_did: DefId) { +fn visit_implementation_of_coerce_unsized<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did: DefId) { debug!("visit_implementation_of_coerce_unsized: impl_did={:?}", impl_did); From 33483fa0e35b7d8c08d75f4bbc0f54c003e6ec2a Mon Sep 17 00:00:00 2001 From: redroc Date: Sat, 4 Aug 2018 03:36:58 +0200 Subject: [PATCH 02/11] fixed broken links to char --- src/libcore/str/mod.rs | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 86b8349fa3c89..8be4c0babc248 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -2117,7 +2117,7 @@ impl str { /// This length is in bytes, not [`char`]s or graphemes. In other words, /// it may not be what a human considers the length of the string. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Examples /// @@ -2590,7 +2590,7 @@ impl str { /// Value, and may not match your idea of what a 'character' is. Iteration /// over grapheme clusters may be what you actually want. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Examples /// @@ -2643,7 +2643,7 @@ impl str { /// The iterator yields tuples. The position is first, the [`char`] is /// second. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Examples /// @@ -2946,7 +2946,7 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines if /// a character matches. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// [`None`]: option/enum.Option.html#variant.None /// /// # Examples @@ -2994,7 +2994,7 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines if /// a character matches. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// [`None`]: option/enum.Option.html#variant.None /// /// # Examples @@ -3050,7 +3050,7 @@ impl str { /// If the pattern allows a reverse search but its results might differ /// from a forward search, the [`rsplit`] method can be used. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// [`rsplit`]: #method.rsplit /// /// # Examples @@ -3157,7 +3157,7 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines the /// split. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Iterator behavior /// @@ -3224,7 +3224,7 @@ impl str { /// elements. This is true for, eg, [`char`] but not for `&str`. /// /// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// If the pattern allows a reverse search but its results might differ /// from a forward search, the [`rsplit_terminator`] method can be used. @@ -3259,7 +3259,7 @@ impl str { /// Additional libraries might provide more complex patterns like /// regular expressions. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// Equivalent to [`split`], except that the trailing substring is /// skipped if empty. @@ -3306,7 +3306,7 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines the /// split. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Iterator behavior /// @@ -3361,7 +3361,7 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that /// determines the split. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Iterator behavior /// @@ -3407,7 +3407,7 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that /// determines if a character matches. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Iterator behavior /// @@ -3416,7 +3416,7 @@ impl str { /// elements. This is true for, eg, [`char`] but not for `&str`. /// /// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// If the pattern allows a reverse search but its results might differ /// from a forward search, the [`rmatches`] method can be used. @@ -3446,7 +3446,7 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines if /// a character matches. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Iterator behavior /// @@ -3488,7 +3488,7 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines /// if a character matches. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Iterator behavior /// @@ -3532,7 +3532,7 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines if a /// character matches. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Iterator behavior /// @@ -3665,7 +3665,7 @@ impl str { /// The pattern can be a [`char`] or a closure that determines if a /// character matches. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Examples /// @@ -3711,7 +3711,7 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines if /// a character matches. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Text directionality /// @@ -3750,7 +3750,7 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that /// determines if a character matches. /// - /// [`char`]: primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Text directionality /// From 616970758b438322d36bb903fcb6422575b12216 Mon Sep 17 00:00:00 2001 From: redroc Date: Sat, 4 Aug 2018 05:51:02 +0200 Subject: [PATCH 03/11] deleted changed lines --- src/libcore/str/mod.rs | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 8be4c0babc248..356534a91879c 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -2117,8 +2117,6 @@ impl str { /// This length is in bytes, not [`char`]s or graphemes. In other words, /// it may not be what a human considers the length of the string. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Examples /// /// Basic usage: @@ -2590,8 +2588,6 @@ impl str { /// Value, and may not match your idea of what a 'character' is. Iteration /// over grapheme clusters may be what you actually want. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Examples /// /// Basic usage: @@ -2643,8 +2639,6 @@ impl str { /// The iterator yields tuples. The position is first, the [`char`] is /// second. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Examples /// /// Basic usage: @@ -2946,7 +2940,6 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines if /// a character matches. /// - /// [`char`]: ../../std/primitive.char.html /// [`None`]: option/enum.Option.html#variant.None /// /// # Examples @@ -2994,7 +2987,6 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines if /// a character matches. /// - /// [`char`]: ../../std/primitive.char.html /// [`None`]: option/enum.Option.html#variant.None /// /// # Examples @@ -3050,7 +3042,6 @@ impl str { /// If the pattern allows a reverse search but its results might differ /// from a forward search, the [`rsplit`] method can be used. /// - /// [`char`]: ../../std/primitive.char.html /// [`rsplit`]: #method.rsplit /// /// # Examples @@ -3157,8 +3148,6 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines the /// split. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Iterator behavior /// /// The returned iterator requires that the pattern supports a reverse @@ -3224,7 +3213,6 @@ impl str { /// elements. This is true for, eg, [`char`] but not for `&str`. /// /// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html - /// [`char`]: ../../std/primitive.char.html /// /// If the pattern allows a reverse search but its results might differ /// from a forward search, the [`rsplit_terminator`] method can be used. @@ -3259,8 +3247,6 @@ impl str { /// Additional libraries might provide more complex patterns like /// regular expressions. /// - /// [`char`]: ../../std/primitive.char.html - /// /// Equivalent to [`split`], except that the trailing substring is /// skipped if empty. /// @@ -3306,8 +3292,6 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines the /// split. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Iterator behavior /// /// The returned iterator will not be double ended, because it is @@ -3361,8 +3345,6 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that /// determines the split. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Iterator behavior /// /// The returned iterator will not be double ended, because it is not @@ -3407,8 +3389,6 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that /// determines if a character matches. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Iterator behavior /// /// The returned iterator will be a [`DoubleEndedIterator`] if the pattern @@ -3416,7 +3396,6 @@ impl str { /// elements. This is true for, eg, [`char`] but not for `&str`. /// /// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html - /// [`char`]: ../../std/primitive.char.html /// /// If the pattern allows a reverse search but its results might differ /// from a forward search, the [`rmatches`] method can be used. @@ -3446,8 +3425,6 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines if /// a character matches. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Iterator behavior /// /// The returned iterator requires that the pattern supports a reverse @@ -3488,8 +3465,6 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines /// if a character matches. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Iterator behavior /// /// The returned iterator will be a [`DoubleEndedIterator`] if the pattern @@ -3532,8 +3507,6 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines if a /// character matches. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Iterator behavior /// /// The returned iterator requires that the pattern supports a reverse @@ -3665,8 +3638,6 @@ impl str { /// The pattern can be a [`char`] or a closure that determines if a /// character matches. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Examples /// /// Simple patterns: @@ -3711,8 +3682,6 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that determines if /// a character matches. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Text directionality /// /// A string is a sequence of bytes. 'Left' in this context means the first @@ -3750,8 +3719,6 @@ impl str { /// The pattern can be a `&str`, [`char`], or a closure that /// determines if a character matches. /// - /// [`char`]: ../../std/primitive.char.html - /// /// # Text directionality /// /// A string is a sequence of bytes. 'Right' in this context means the last From 79289b954505764d3b1fce55e1770586f116a3fa Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Tue, 31 Jul 2018 01:59:41 +0300 Subject: [PATCH 04/11] cleanup: Remove `Def::GlobalAsm` --- src/librustc/hir/def.rs | 6 +----- src/librustc/hir/map/mod.rs | 2 +- src/librustc/ich/impls_hir.rs | 1 - src/librustc_metadata/decoder.rs | 2 +- src/librustc_save_analysis/lib.rs | 1 - 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/librustc/hir/def.rs b/src/librustc/hir/def.rs index cb5e1e600d3d2..b297accc75fd5 100644 --- a/src/librustc/hir/def.rs +++ b/src/librustc/hir/def.rs @@ -70,8 +70,6 @@ pub enum Def { Macro(DefId, MacroKind), NonMacroAttr, // e.g. `#[inline]` or `#[rustfmt::skip]` - GlobalAsm(DefId), - // Both namespaces Err, } @@ -251,8 +249,7 @@ impl Def { Def::AssociatedTy(id) | Def::TyParam(id) | Def::Struct(id) | Def::StructCtor(id, ..) | Def::Union(id) | Def::Trait(id) | Def::Method(id) | Def::Const(id) | Def::AssociatedConst(id) | Def::Macro(id, ..) | - Def::Existential(id) | Def::AssociatedExistential(id) | - Def::GlobalAsm(id) | Def::TyForeign(id) => { + Def::Existential(id) | Def::AssociatedExistential(id) | Def::TyForeign(id) => { id } @@ -302,7 +299,6 @@ impl Def { Def::Label(..) => "label", Def::SelfTy(..) => "self type", Def::Macro(.., macro_kind) => macro_kind.descr(), - Def::GlobalAsm(..) => "global asm", Def::ToolMod => "tool module", Def::NonMacroAttr => "non-macro attribute", Def::Err => "unresolved item", diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs index 49231e58cf0fc..b05bcadf82649 100644 --- a/src/librustc/hir/map/mod.rs +++ b/src/librustc/hir/map/mod.rs @@ -432,7 +432,6 @@ impl<'hir> Map<'hir> { ItemKind::Const(..) => Some(Def::Const(def_id())), ItemKind::Fn(..) => Some(Def::Fn(def_id())), ItemKind::Mod(..) => Some(Def::Mod(def_id())), - ItemKind::GlobalAsm(..) => Some(Def::GlobalAsm(def_id())), ItemKind::Existential(..) => Some(Def::Existential(def_id())), ItemKind::Ty(..) => Some(Def::TyAlias(def_id())), ItemKind::Enum(..) => Some(Def::Enum(def_id())), @@ -445,6 +444,7 @@ impl<'hir> Map<'hir> { ItemKind::ExternCrate(_) | ItemKind::Use(..) | ItemKind::ForeignMod(..) | + ItemKind::GlobalAsm(..) | ItemKind::Impl(..) => None, } } diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index cac0d182d3a48..923cd1e1f8397 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -1015,7 +1015,6 @@ impl_stable_hash_for!(enum hir::def::Def { Upvar(def_id, index, expr_id), Label(node_id), Macro(def_id, macro_kind), - GlobalAsm(def_id), ToolMod, NonMacroAttr, Err diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index ab566654c389c..cf034d9425759 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -427,10 +427,10 @@ impl<'tcx> EntryKind<'tcx> { EntryKind::Trait(_) => Def::Trait(did), EntryKind::Enum(..) => Def::Enum(did), EntryKind::MacroDef(_) => Def::Macro(did, MacroKind::Bang), - EntryKind::GlobalAsm => Def::GlobalAsm(did), EntryKind::ForeignType => Def::TyForeign(did), EntryKind::ForeignMod | + EntryKind::GlobalAsm | EntryKind::Impl(_) | EntryKind::Field | EntryKind::Generator(_) | diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 240b33c3c9478..f3b71f2641d41 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -810,7 +810,6 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { HirDef::SelfTy(..) | HirDef::Label(..) | HirDef::Macro(..) | - HirDef::GlobalAsm(..) | HirDef::ToolMod | HirDef::NonMacroAttr | HirDef::Err => None, From 3f92ff34b5a2fe8dd1a32aa27d437519e63782f0 Mon Sep 17 00:00:00 2001 From: Mike Boutin Date: Sat, 4 Aug 2018 08:26:37 -0400 Subject: [PATCH 05/11] Change rustdoc style so fully qualified names do not overlap src links A type's fully qualified name will now wrap once it gets to the `[-][src]` link aligned against the right edge of the content area. Previously the two would overlap and the name would only wrap when hitting the edge of the content area. The `[-][src]` link will main at the top of the header. --- src/librustdoc/html/render.rs | 60 +++++++++++++------------- src/librustdoc/html/static/rustdoc.css | 7 +-- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index c2978a62489a0..470aa2c10e977 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1613,7 +1613,6 @@ impl fmt::Display for AllTypes { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "

\ - List of all items\ \ \ \ @@ -1621,6 +1620,7 @@ impl fmt::Display for AllTypes { \ + List of all items\

")?; print_entries(f, &self.structs, "Structs", "structs")?; print_entries(f, &self.enums, "Enums", "enums")?; @@ -2068,7 +2068,34 @@ impl<'a> fmt::Display for Item<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { debug_assert!(!self.item.is_stripped()); // Write the breadcrumb trail header for the top - write!(fmt, "

")?; + write!(fmt, "

")?; + if let Some(version) = self.item.stable_since() { + write!(fmt, "{0}", + version)?; + } + write!(fmt, + "\ + \ + []\ + \ + ")?; + + // Write `src` tag + // + // When this item is part of a `pub use` in a downstream crate, the + // [src] link in the downstream documentation will actually come back to + // this page, and this link will be auto-clicked. The `id` attribute is + // used to find the link to auto-click. + if self.cx.shared.include_sources && !self.item.is_primitive() { + if let Some(l) = self.src_href() { + write!(fmt, "[src]", + l, "goto source code")?; + } + } + + write!(fmt, "")?; // out-of-band + write!(fmt, "")?; match self.item.inner { clean::ModuleItem(ref m) => if m.is_crate { write!(fmt, "Crate ")?; @@ -2105,34 +2132,7 @@ impl<'a> fmt::Display for Item<'a> { write!(fmt, "{}", self.item.type_(), self.item.name.as_ref().unwrap())?; - write!(fmt, "")?; // in-band - write!(fmt, "")?; - if let Some(version) = self.item.stable_since() { - write!(fmt, "{0}", - version)?; - } - write!(fmt, - "\ - \ - []\ - \ - ")?; - - // Write `src` tag - // - // When this item is part of a `pub use` in a downstream crate, the - // [src] link in the downstream documentation will actually come back to - // this page, and this link will be auto-clicked. The `id` attribute is - // used to find the link to auto-click. - if self.cx.shared.include_sources && !self.item.is_primitive() { - if let Some(l) = self.src_href() { - write!(fmt, "[src]", - l, "goto source code")?; - } - } - - write!(fmt, "

")?; // out-of-band + write!(fmt, "

")?; // in-band match self.item.inner { clean::ModuleItem(ref m) => diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 496029e33fc65..57a111daa8977 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -97,7 +97,7 @@ h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important), h4 h1.fqn { border-bottom: 1px dashed; margin-top: 0; - position: relative; + overflow: auto; } h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) { border-bottom: 1px solid; @@ -352,14 +352,11 @@ nav.sub { } .content .out-of-band { + float: right; font-size: 23px; margin: 0px; padding: 0px; - text-align: right; - display: inline-block; font-weight: normal; - position: absolute; - right: 0; } h3.impl > .out-of-band { From 3d44da65cd91a65603676bb2f2bc6b9bdc5775bf Mon Sep 17 00:00:00 2001 From: Matthew Tran <0e4ef622@gmail.com> Date: Sun, 5 Aug 2018 10:37:48 -0500 Subject: [PATCH 06/11] Enable macros to pass $:literal to another macro --- src/libsyntax/parse/token.rs | 4 ++++ src/test/run-pass/issue-52169.rs | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/test/run-pass/issue-52169.rs diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index c449cc0a6525a..1d0c6b5317a38 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -302,6 +302,10 @@ impl Token { BinOp(Minus) => true, Ident(ident, false) if ident.name == keywords::True.name() => true, Ident(ident, false) if ident.name == keywords::False.name() => true, + Interpolated(ref nt) => match nt.0 { + NtLiteral(..) => true, + _ => false, + }, _ => false, } } diff --git a/src/test/run-pass/issue-52169.rs b/src/test/run-pass/issue-52169.rs new file mode 100644 index 0000000000000..f2163416922cd --- /dev/null +++ b/src/test/run-pass/issue-52169.rs @@ -0,0 +1,24 @@ +// Copyright 2018 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. + +#![feature(macro_literal_matcher)] + +macro_rules! a { + ($i:literal) => { "right" }; + ($i:tt) => { "wrong" }; +} + +macro_rules! b { + ($i:literal) => { a!($i) }; +} + +fn main() { + assert_eq!(b!(0), "right"); +} From 60aa11df4c1c4fef9122a025c31819e1cf3e456a Mon Sep 17 00:00:00 2001 From: Josef Reinhard Brandl Date: Mon, 6 Aug 2018 10:22:13 +0200 Subject: [PATCH 07/11] Rename Executor trait to Spawn --- src/liballoc/boxed.rs | 13 ++++--- src/libcore/task/context.rs | 44 ++++++++++++---------- src/libcore/task/mod.rs | 6 +-- src/libcore/task/{executor.rs => spawn.rs} | 15 +++----- src/test/run-pass/async-await.rs | 10 ++--- src/test/run-pass/futures-api.rs | 16 ++++---- 6 files changed, 54 insertions(+), 50 deletions(-) rename src/libcore/task/{executor.rs => spawn.rs} (82%) diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 2cf9b13a67a27..08db5136d0404 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -67,7 +67,7 @@ use core::marker::{Unpin, Unsize}; use core::mem::{self, PinMut}; use core::ops::{CoerceUnsized, Deref, DerefMut, Generator, GeneratorState}; use core::ptr::{self, NonNull, Unique}; -use core::task::{Context, Poll, Executor, SpawnErrorKind, SpawnObjError}; +use core::task::{Context, Poll, Spawn, SpawnErrorKind, SpawnObjError}; use raw_vec::RawVec; use str::from_boxed_utf8_unchecked; @@ -973,11 +973,14 @@ unsafe impl<'a, T, F> UnsafeFutureObj<'a, T> for PinBox } #[unstable(feature = "futures_api", issue = "50547")] -impl Executor for Box - where E: Executor + ?Sized +impl Spawn for Box + where Sp: Spawn + ?Sized { - fn spawn_obj(&mut self, task: FutureObj<'static, ()>) -> Result<(), SpawnObjError> { - (**self).spawn_obj(task) + fn spawn_obj( + &mut self, + future: FutureObj<'static, ()>, + ) -> Result<(), SpawnObjError> { + (**self).spawn_obj(future) } fn status(&self) -> Result<(), SpawnErrorKind> { diff --git a/src/libcore/task/context.rs b/src/libcore/task/context.rs index 121f93b666bce..5a29c8528ef3a 100644 --- a/src/libcore/task/context.rs +++ b/src/libcore/task/context.rs @@ -13,7 +13,7 @@ issue = "50547")] use fmt; -use super::{Executor, Waker, LocalWaker}; +use super::{Spawn, Waker, LocalWaker}; /// Information about the currently-running task. /// @@ -21,7 +21,7 @@ use super::{Executor, Waker, LocalWaker}; /// when performing a single `poll` step on a task. pub struct Context<'a> { local_waker: &'a LocalWaker, - executor: &'a mut dyn Executor, + spawner: &'a mut dyn Spawn, } impl<'a> fmt::Debug for Context<'a> { @@ -32,13 +32,14 @@ impl<'a> fmt::Debug for Context<'a> { } impl<'a> Context<'a> { - /// Create a new task `Context` with the provided `local_waker`, `waker`, and `executor`. + /// Create a new task `Context` with the provided `local_waker`, `waker`, + /// and `spawner`. #[inline] - pub fn new(local_waker: &'a LocalWaker, executor: &'a mut dyn Executor) -> Context<'a> { - Context { - local_waker, - executor, - } + pub fn new( + local_waker: &'a LocalWaker, + spawner: &'a mut dyn Spawn, + ) -> Context<'a> { + Context { local_waker, spawner } } /// Get the `LocalWaker` associated with the current task. @@ -53,40 +54,45 @@ impl<'a> Context<'a> { unsafe { &*(self.local_waker as *const LocalWaker as *const Waker) } } - /// Get the default executor associated with this task. + /// Get the spawner associated with this task. /// /// This method is useful primarily if you want to explicitly handle /// spawn failures. #[inline] - pub fn executor(&mut self) -> &mut dyn Executor { - self.executor + pub fn spawner(&mut self) -> &mut dyn Spawn { + self.spawner } - /// Produce a context like the current one, but using the given waker instead. + /// Produce a context like the current one, but using the given waker + /// instead. /// /// This advanced method is primarily used when building "internal /// schedulers" within a task, where you want to provide some customized /// wakeup logic. #[inline] - pub fn with_waker<'b>(&'b mut self, local_waker: &'b LocalWaker) -> Context<'b> { + pub fn with_waker<'b>( + &'b mut self, + local_waker: &'b LocalWaker, + ) -> Context<'b> { Context { local_waker, - executor: self.executor, + spawner: self.spawner, } } - /// Produce a context like the current one, but using the given executor + /// Produce a context like the current one, but using the given spawner /// instead. /// /// This advanced method is primarily used when building "internal /// schedulers" within a task. #[inline] - pub fn with_executor<'b, E>(&'b mut self, executor: &'b mut E) -> Context<'b> - where E: Executor - { + pub fn with_spawner<'b, Sp: Spawn>( + &'b mut self, + spawner: &'b mut Sp, + ) -> Context<'b> { Context { local_waker: self.local_waker, - executor, + spawner, } } } diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs index c4f075361640f..f51e5f7ce0e31 100644 --- a/src/libcore/task/mod.rs +++ b/src/libcore/task/mod.rs @@ -17,10 +17,8 @@ mod context; pub use self::context::Context; -mod executor; -pub use self::executor::{ - Executor, SpawnErrorKind, SpawnObjError, SpawnLocalObjError -}; +mod spawn; +pub use self::spawn::{Spawn, SpawnErrorKind, SpawnObjError, SpawnLocalObjError}; mod poll; pub use self::poll::Poll; diff --git a/src/libcore/task/executor.rs b/src/libcore/task/spawn.rs similarity index 82% rename from src/libcore/task/executor.rs rename to src/libcore/task/spawn.rs index affcbf464da22..58ee85d232bc4 100644 --- a/src/libcore/task/executor.rs +++ b/src/libcore/task/spawn.rs @@ -15,16 +15,13 @@ use fmt; use future::{FutureObj, LocalFutureObj}; -/// A task executor. +/// Spawns tasks that poll futures to completion onto its associated task +/// executor. /// -/// Futures are polled until completion by tasks, a kind of lightweight -/// "thread". A *task executor* is responsible for the creation of these tasks -/// and the coordination of their execution on real operating system threads. In -/// particular, whenever a task signals that it can make further progress via a -/// wake-up notification, it is the responsibility of the task executor to put -/// the task into a queue to continue executing it, i.e. polling the future in -/// it, later. -pub trait Executor { +/// The term "task" refers to a kind of lightweight "thread". Task executors +/// are responsible for scheduling the execution of tasks on operating system +/// threads. +pub trait Spawn { /// Spawns a new task with the given future. The future will be polled until /// completion. /// diff --git a/src/test/run-pass/async-await.rs b/src/test/run-pass/async-await.rs index 0ac37485d3dc8..99b8ad83bf6cc 100644 --- a/src/test/run-pass/async-await.rs +++ b/src/test/run-pass/async-await.rs @@ -22,7 +22,7 @@ use std::sync::{ use std::future::FutureObj; use std::task::{ Context, Poll, Wake, - Executor, SpawnObjError, + Spawn, SpawnObjError, local_waker_from_nonlocal, }; @@ -36,8 +36,8 @@ impl Wake for Counter { } } -struct NoopExecutor; -impl Executor for NoopExecutor { +struct NoopSpawner; +impl Spawn for NoopSpawner { fn spawn_obj(&mut self, _: FutureObj<'static, ()>) -> Result<(), SpawnObjError> { Ok(()) } @@ -127,8 +127,8 @@ where let mut fut = PinBox::new(f(9)); let counter = Arc::new(Counter { wakes: AtomicUsize::new(0) }); let waker = local_waker_from_nonlocal(counter.clone()); - let executor = &mut NoopExecutor; - let cx = &mut Context::new(&waker, executor); + let spawner = &mut NoopSpawner; + let cx = &mut Context::new(&waker, spawner); assert_eq!(0, counter.wakes.load(atomic::Ordering::SeqCst)); assert_eq!(Poll::Pending, fut.as_pin_mut().poll(cx)); diff --git a/src/test/run-pass/futures-api.rs b/src/test/run-pass/futures-api.rs index 6cb975a9560b9..476cb48c0d2ee 100644 --- a/src/test/run-pass/futures-api.rs +++ b/src/test/run-pass/futures-api.rs @@ -23,7 +23,7 @@ use std::future::FutureObj; use std::task::{ Context, Poll, Wake, Waker, LocalWaker, - Executor, SpawnObjError, + Spawn, SpawnObjError, local_waker, local_waker_from_nonlocal, }; @@ -42,9 +42,9 @@ impl Wake for Counter { } } -struct NoopExecutor; +struct NoopSpawner; -impl Executor for NoopExecutor { +impl Spawn for NoopSpawner { fn spawn_obj(&mut self, _: FutureObj<'static, ()>) -> Result<(), SpawnObjError> { Ok(()) } @@ -59,7 +59,7 @@ impl Future for MyFuture { cx.waker().wake(); cx.waker().wake(); cx.local_waker().wake(); - cx.executor().spawn_obj(PinBox::new(MyFuture).into()).unwrap(); + cx.spawner().spawn_obj(PinBox::new(MyFuture).into()).unwrap(); Poll::Ready(()) } } @@ -70,8 +70,8 @@ fn test_local_waker() { nonlocal_wakes: AtomicUsize::new(0), }); let waker = unsafe { local_waker(counter.clone()) }; - let executor = &mut NoopExecutor; - let cx = &mut Context::new(&waker, executor); + let spawner = &mut NoopSpawner; + let cx = &mut Context::new(&waker, spawner); assert_eq!(Poll::Ready(()), PinMut::new(&mut MyFuture).poll(cx)); assert_eq!(1, counter.local_wakes.load(atomic::Ordering::SeqCst)); assert_eq!(2, counter.nonlocal_wakes.load(atomic::Ordering::SeqCst)); @@ -83,8 +83,8 @@ fn test_local_as_nonlocal_waker() { nonlocal_wakes: AtomicUsize::new(0), }); let waker: LocalWaker = local_waker_from_nonlocal(counter.clone()); - let executor = &mut NoopExecutor; - let cx = &mut Context::new(&waker, executor); + let spawner = &mut NoopSpawner; + let cx = &mut Context::new(&waker, spawner); assert_eq!(Poll::Ready(()), PinMut::new(&mut MyFuture).poll(cx)); assert_eq!(0, counter.local_wakes.load(atomic::Ordering::SeqCst)); assert_eq!(3, counter.nonlocal_wakes.load(atomic::Ordering::SeqCst)); From a92b5cc916a42c6f3425347281bb656d071c26d5 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 6 Aug 2018 12:34:00 +0200 Subject: [PATCH 08/11] Remove references to `StaticMutex` which got removed a while ago --- src/librustc_mir/diagnostics.rs | 4 +--- src/libstd/sync/once.rs | 10 ++++------ src/libstd/sys/unix/mutex.rs | 3 --- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/librustc_mir/diagnostics.rs b/src/librustc_mir/diagnostics.rs index 3c751d52b0664..714218a04178e 100644 --- a/src/librustc_mir/diagnostics.rs +++ b/src/librustc_mir/diagnostics.rs @@ -1281,9 +1281,7 @@ const F: &'static C = &D; // error ``` This is because cell types do operations that are not thread-safe. Due to this, -they don't implement Sync and thus can't be placed in statics. In this -case, `StaticMutex` would work just fine, but it isn't stable yet: -https://doc.rust-lang.org/nightly/std/sync/struct.StaticMutex.html +they don't implement Sync and thus can't be placed in statics. However, if you still wish to use these types, you can achieve this by an unsafe wrapper: diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 3abc260b45868..f6cb8beae8415 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -31,12 +31,10 @@ // initialization closure panics, the Once enters a "poisoned" state which means // that all future calls will immediately panic as well. // -// So to implement this, one might first reach for a `StaticMutex`, but those -// unfortunately need to be deallocated (e.g. call `destroy()`) to free memory -// on all OSes (some of the BSDs allocate memory for mutexes). It also gets a -// lot harder with poisoning to figure out when the mutex needs to be -// deallocated because it's not after the closure finishes, but after the first -// successful closure finishes. +// So to implement this, one might first reach for a `Mutex`, but those cannot +// be put into a `static`. It also gets a lot harder with poisoning to figure +// out when the mutex needs to be deallocated because it's not after the closure +// finishes, but after the first successful closure finishes. // // All in all, this is instead implemented with atomics and lock-free // operations! Whee! Each `Once` has one word of atomic state, and this state is diff --git a/src/libstd/sys/unix/mutex.rs b/src/libstd/sys/unix/mutex.rs index 52cf3f97c5c83..60b03cdbeb0e9 100644 --- a/src/libstd/sys/unix/mutex.rs +++ b/src/libstd/sys/unix/mutex.rs @@ -49,9 +49,6 @@ impl Mutex { // references, we instead create the mutex with type // PTHREAD_MUTEX_NORMAL which is guaranteed to deadlock if we try to // re-lock it from the same thread, thus avoiding undefined behavior. - // - // We can't do anything for StaticMutex, but that type is deprecated - // anyways. let mut attr: libc::pthread_mutexattr_t = mem::uninitialized(); let r = libc::pthread_mutexattr_init(&mut attr); debug_assert_eq!(r, 0); From d8e8a50cf279eab794adbdd9bae819d308a6169f Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Fri, 3 Aug 2018 07:22:42 -0600 Subject: [PATCH 09/11] Building librustc_codegen_llvm in a separate directory This allows clearing it out and building it separately from the compiler. Since it's essentially a different and separate crate this makes sense to do, each cargo invocation should generally happen in its own directory. --- src/Cargo.lock | 20 -------------------- src/bootstrap/check.rs | 6 ++++-- src/bootstrap/compile.rs | 9 +++++---- src/bootstrap/lib.rs | 2 +- src/librustc_codegen_llvm/Cargo.toml | 27 --------------------------- 5 files changed, 10 insertions(+), 54 deletions(-) diff --git a/src/Cargo.lock b/src/Cargo.lock index 7c57cf32d1b14..30d56f7656d7d 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -2184,30 +2184,10 @@ dependencies = [ name = "rustc_codegen_llvm" version = "0.0.0" dependencies = [ - "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc 0.0.0", "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_allocator 0.0.0", - "rustc_apfloat 0.0.0", - "rustc_codegen_utils 0.0.0", - "rustc_data_structures 0.0.0", - "rustc_errors 0.0.0", - "rustc_incremental 0.0.0", "rustc_llvm 0.0.0", - "rustc_mir 0.0.0", - "rustc_platform_intrinsics 0.0.0", - "rustc_target 0.0.0", - "serialize 0.0.0", - "syntax 0.0.0", - "syntax_pos 0.0.0", - "tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index 2f0ae7d9d2cfa..133e5aa37a7db 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -137,8 +137,10 @@ impl Step for CodegenBackend { let target = self.target; let backend = self.backend; + let out_dir = builder.cargo_out(compiler, Mode::Codegen, target); + builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target)); + let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "check"); - let features = builder.rustc_features().to_string(); cargo.arg("--manifest-path").arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml")); rustc_cargo_env(builder, &mut cargo); @@ -146,7 +148,7 @@ impl Step for CodegenBackend { let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage)); run_cargo(builder, - cargo.arg("--features").arg(features), + &mut cargo, &codegen_backend_stamp(builder, compiler, target, backend), true); } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 8c4f2df60fe6f..2f8816d111a9d 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -670,16 +670,17 @@ impl Step for CodegenBackend { return; } + let out_dir = builder.cargo_out(compiler, Mode::Codegen, target); + builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target)); + let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "build"); - let mut features = builder.rustc_features().to_string(); cargo.arg("--manifest-path") .arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml")); rustc_cargo_env(builder, &mut cargo); - features += &build_codegen_backend(&builder, &mut cargo, &compiler, target, backend); + let features = build_codegen_backend(&builder, &mut cargo, &compiler, target, backend); - let tmp_stamp = builder.cargo_out(compiler, Mode::Codegen, target) - .join(".tmp.stamp"); + let tmp_stamp = out_dir.join(".tmp.stamp"); let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage)); let files = run_cargo(builder, diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 1efff19dfb993..38965949bf22f 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -555,8 +555,8 @@ impl Build { let suffix = match mode { Mode::Std => "-std", Mode::Test => "-test", - Mode::Codegen => "-rustc", Mode::Rustc => "-rustc", + Mode::Codegen => "-codegen", Mode::ToolBootstrap => "-bootstrap-tools", Mode::ToolStd => "-tools", Mode::ToolRustc => "-tools", diff --git a/src/librustc_codegen_llvm/Cargo.toml b/src/librustc_codegen_llvm/Cargo.toml index 6ddae57e336ed..28fa49846b736 100644 --- a/src/librustc_codegen_llvm/Cargo.toml +++ b/src/librustc_codegen_llvm/Cargo.toml @@ -10,39 +10,12 @@ crate-type = ["dylib"] test = false [dependencies] -bitflags = "1.0.1" cc = "1.0.1" -flate2 = "1.0" -jobserver = "0.1.5" -libc = "0.2" -log = "0.4" num_cpus = "1.0" -rustc = { path = "../librustc" } rustc-demangle = "0.1.4" -rustc_allocator = { path = "../librustc_allocator" } -rustc_apfloat = { path = "../librustc_apfloat" } -rustc_target = { path = "../librustc_target" } -rustc_data_structures = { path = "../librustc_data_structures" } -rustc_errors = { path = "../librustc_errors" } -rustc_incremental = { path = "../librustc_incremental" } rustc_llvm = { path = "../librustc_llvm" } -rustc_platform_intrinsics = { path = "../librustc_platform_intrinsics" } -rustc_codegen_utils = { path = "../librustc_codegen_utils" } -rustc_mir = { path = "../librustc_mir" } -serialize = { path = "../libserialize" } -syntax = { path = "../libsyntax" } -syntax_pos = { path = "../libsyntax_pos" } -tempfile = "3.0" - -# not actually used but needed to make sure we enable the same feature set as -# winapi used in librustc -env_logger = { version = "0.5", default-features = false } [features] -# Used to communicate the feature to `rustc_target` in the same manner that the -# `rustc` driver script communicate this. -jemalloc = ["rustc_target/jemalloc"] - # This is used to convince Cargo to separately cache builds of `rustc_codegen_llvm` # when this option is enabled or not. That way we can build two, cache two # artifacts, and have nice speedy rebuilds. From 1fd8e57c5b329e253404161bddcf29e0bfc12f0b Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Mon, 6 Aug 2018 14:45:19 -0700 Subject: [PATCH 10/11] Rust 2018: Disable catch_expr, not targeted for 2018 edition Fixes #52604 --- src/libsyntax/feature_gate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 193e560893f37..5ac5064bd035f 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -323,7 +323,7 @@ declare_features! ( (active, abi_x86_interrupt, "1.17.0", Some(40180), None), // Allows the `catch {...}` expression - (active, catch_expr, "1.17.0", Some(31436), Some(Edition::Edition2018)), + (active, catch_expr, "1.17.0", Some(31436), None), // Used to preserve symbols (see llvm.used) (active, used, "1.18.0", Some(40289), None), From ce1def176d97e48dd46fc7a2de2722ab43f2c430 Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Tue, 7 Aug 2018 09:18:23 +1000 Subject: [PATCH 11/11] set emit_debug_gdb_scripts: false for riscv32imac-unknown-none target Same as the other embedded targets, see: https://github.com/rust-lang/rust/pull/49728 This is a temporary workaround for #44993. --- src/librustc_target/spec/riscv32imac_unknown_none_elf.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs b/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs index cfd73e371ddac..f8cd1b5b81207 100644 --- a/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs +++ b/src/librustc_target/spec/riscv32imac_unknown_none_elf.rs @@ -33,6 +33,7 @@ pub fn target() -> TargetResult { executables: true, panic_strategy: PanicStrategy::Abort, relocation_model: "static".to_string(), + emit_debug_gdb_scripts: false, abi_blacklist: vec![ Abi::Cdecl, Abi::Stdcall,