From 9cab312e54efebaa1cc0885fffb7b3a116d6ef9e Mon Sep 17 00:00:00 2001 From: Meziu Date: Tue, 2 Nov 2021 08:26:26 +0100 Subject: [PATCH 1/6] ARMv6K Horizon OS panic change --- compiler/rustc_target/src/spec/armv6k_nintendo_3ds.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_target/src/spec/armv6k_nintendo_3ds.rs b/compiler/rustc_target/src/spec/armv6k_nintendo_3ds.rs index 01f5c197d2023..afe8bbb352886 100644 --- a/compiler/rustc_target/src/spec/armv6k_nintendo_3ds.rs +++ b/compiler/rustc_target/src/spec/armv6k_nintendo_3ds.rs @@ -1,4 +1,4 @@ -use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions}; +use crate::spec::{LinkArgs, LinkerFlavor, RelocModel, Target, TargetOptions}; /// A base target for Nintendo 3DS devices using the devkitARM toolchain. /// @@ -36,7 +36,6 @@ pub fn target() -> Target { features: "+vfp2".to_string(), pre_link_args, exe_suffix: ".elf".to_string(), - panic_strategy: PanicStrategy::Abort, ..Default::default() }, } From d37914721933d96b76d8b3fb1fa70ec980046517 Mon Sep 17 00:00:00 2001 From: Meziu Date: Tue, 2 Nov 2021 12:31:34 +0100 Subject: [PATCH 2/6] Updated backtrace submodule --- library/backtrace | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/backtrace b/library/backtrace index 7f14f76c8ba69..b02ed04a7e915 160000 --- a/library/backtrace +++ b/library/backtrace @@ -1 +1 @@ -Subproject commit 7f14f76c8ba6945c052fab77022e6e768b58e0b4 +Subproject commit b02ed04a7e915659eea6fb1607df469b84a30638 From ed7e438f87a6b2b036db06608d23f23b50d54d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 6 Nov 2021 16:36:23 +0100 Subject: [PATCH 3/6] use filter(|x| matches!(..)) instead of filter_map(|x| match x ... => Some(xy)) --- compiler/rustc_resolve/src/late/lifetimes.rs | 28 ++++++------------- .../rustc_typeck/src/coherence/builtin.rs | 8 +++--- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs index 94563400a8b53..1ed264b2c95f9 100644 --- a/compiler/rustc_resolve/src/late/lifetimes.rs +++ b/compiler/rustc_resolve/src/late/lifetimes.rs @@ -887,10 +887,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { let (lifetimes, binders): (FxIndexMap, Vec<_>) = c .generic_params .iter() - .filter_map(|param| match param.kind { - GenericParamKind::Lifetime { .. } => Some(param), - _ => None, - }) + .filter(|param| matches!(param.kind, GenericParamKind::Lifetime { .. })) .enumerate() .map(|(late_bound_idx, param)| { let pair = Region::late(late_bound_idx as u32, &self.tcx.hir(), param); @@ -1370,9 +1367,8 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { let (lifetimes, binders): (FxIndexMap, Vec<_>) = bound_generic_params .iter() - .filter_map(|param| match param.kind { - GenericParamKind::Lifetime { .. } => Some(param), - _ => None, + .filter(|param| { + matches!(param.kind, GenericParamKind::Lifetime { .. }) }) .enumerate() .map(|(late_bound_idx, param)| { @@ -1469,10 +1465,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { let binders_iter = trait_ref .bound_generic_params .iter() - .filter_map(|param| match param.kind { - GenericParamKind::Lifetime { .. } => Some(param), - _ => None, - }) + .filter(|param| matches!(param.kind, GenericParamKind::Lifetime { .. })) .enumerate() .map(|(late_bound_idx, param)| { let pair = Region::late( @@ -2237,19 +2230,14 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { let binders: Vec<_> = generics .params .iter() - .filter_map(|param| match param.kind { - GenericParamKind::Lifetime { .. } - if self.map.late_bound.contains(¶m.hir_id) => - { - Some(param) - } - _ => None, + .filter(|param| { + matches!(param.kind, GenericParamKind::Lifetime { .. }) + && self.map.late_bound.contains(¶m.hir_id) }) .enumerate() .map(|(late_bound_idx, param)| { let pair = Region::late(late_bound_idx as u32, &self.tcx.hir(), param); - let r = late_region_as_bound_region(self.tcx, &pair.1); - r + late_region_as_bound_region(self.tcx, &pair.1) }) .collect(); self.map.late_bound_vars.insert(hir_id, binders); diff --git a/compiler/rustc_typeck/src/coherence/builtin.rs b/compiler/rustc_typeck/src/coherence/builtin.rs index 8cae61e8c22f6..d818771f7800a 100644 --- a/compiler/rustc_typeck/src/coherence/builtin.rs +++ b/compiler/rustc_typeck/src/coherence/builtin.rs @@ -180,14 +180,14 @@ fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: LocalDef let coerced_fields = fields .iter() - .filter_map(|field| { + .filter(|field| { let ty_a = field.ty(tcx, substs_a); let ty_b = field.ty(tcx, substs_b); if let Ok(layout) = tcx.layout_of(param_env.and(ty_a)) { if layout.is_zst() && layout.align.abi.bytes() == 1 { // ignore ZST fields with alignment of 1 byte - return None; + return false; } } @@ -204,11 +204,11 @@ fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: LocalDef )) .emit(); - return None; + return false; } } - Some(field) + return true; }) .collect::>(); From e8f1d57d8021d51c5b5d5eb17791c680ca770791 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 6 Nov 2021 19:41:33 +0100 Subject: [PATCH 4/6] Fix last doc code comment being removed if it only had one character --- compiler/rustc_ast/src/util/comments.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_ast/src/util/comments.rs b/compiler/rustc_ast/src/util/comments.rs index 542a330a03141..c40aec4b671dd 100644 --- a/compiler/rustc_ast/src/util/comments.rs +++ b/compiler/rustc_ast/src/util/comments.rs @@ -38,7 +38,7 @@ pub fn beautify_doc_string(data: Symbol) -> Symbol { i += 1; } // like the first, a last line of all stars should be omitted - if j > i && lines[j - 1].chars().skip(1).all(|c| c == '*') { + if j > i && !lines[j - 1].is_empty() && lines[j - 1].chars().all(|c| c == '*') { j -= 1; } From aa6f6f47cd7f83e3898b66e53ff30a414b0a0694 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 6 Nov 2021 19:42:43 +0100 Subject: [PATCH 5/6] Add test for removed one character last line in rustdoc --- src/test/rustdoc/include_str_cut.rs | 7 +++++++ src/test/rustdoc/short-line.md | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 src/test/rustdoc/include_str_cut.rs create mode 100644 src/test/rustdoc/short-line.md diff --git a/src/test/rustdoc/include_str_cut.rs b/src/test/rustdoc/include_str_cut.rs new file mode 100644 index 0000000000000..cbc1ba8db7529 --- /dev/null +++ b/src/test/rustdoc/include_str_cut.rs @@ -0,0 +1,7 @@ +#![crate_name = "foo"] +#![no_std] + +// @has 'foo/fn.foo.html' +// @has - '//*[@class="docblock"]' 'inc2 x' +#[doc = include_str!("short-line.md")] +pub fn foo() {} diff --git a/src/test/rustdoc/short-line.md b/src/test/rustdoc/short-line.md new file mode 100644 index 0000000000000..eff713baac4a8 --- /dev/null +++ b/src/test/rustdoc/short-line.md @@ -0,0 +1,2 @@ +inc2 +x From 1e56dd4aef7a8bb276746e14910944cd4d800dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 8 Nov 2021 12:07:03 +0200 Subject: [PATCH 6/6] :arrow_up: rust-analyzer --- src/tools/rust-analyzer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer b/src/tools/rust-analyzer index 04f03a360ab8f..2c0f433fd2e83 160000 --- a/src/tools/rust-analyzer +++ b/src/tools/rust-analyzer @@ -1 +1 @@ -Subproject commit 04f03a360ab8fef3d9c0ff84de2d39b8a196c717 +Subproject commit 2c0f433fd2e838ae181f87019b6f1fefe33c6f54