diff options
| author | bors <bors@rust-lang.org> | 2023-01-14 20:53:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-01-14 20:53:37 +0000 |
| commit | afaf3e07aaa7ca9873bdb439caec53faffa4230c (patch) | |
| tree | 64e4ad70d0a7b3ca30376a8d88921e7b837e26af /compiler | |
| parent | b8f9cb345ab1401f2fbd14cc23f64dda9dd2314e (diff) | |
| parent | e0eb63a73ccfb9aa7b09b39b3c9fe23287f5cac9 (diff) | |
| download | rust-afaf3e07aaa7ca9873bdb439caec53faffa4230c.tar.gz rust-afaf3e07aaa7ca9873bdb439caec53faffa4230c.zip | |
Auto merge of #106866 - matthiaskrgr:rollup-r063s44, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #105526 (libcore: make result of iter::from_generator Clone) - #106563 (Fix `unused_braces` on generic const expr macro call) - #106661 (Stop probing for statx unless necessary) - #106820 (Deprioritize fulfillment errors that come from expansions.) - #106828 (rustdoc: remove `docblock` class from notable trait popover) - #106849 (Allocate one less vec while parsing arrays) - #106855 (rustdoc: few small cleanups) - #106860 (Remove various double spaces in the libraries.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_lint/src/unused.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs | 8 |
3 files changed, 8 insertions, 6 deletions
diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index ac2b32b44e6..f2ee9ab1a19 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -1105,6 +1105,7 @@ impl UnusedDelimLint for UnusedBraces { || matches!(expr.kind, ast::ExprKind::Lit(_))) && !cx.sess().source_map().is_multiline(value.span) && value.attrs.is_empty() + && !expr.span.from_expansion() && !value.span.from_expansion() && !inner.span.from_expansion() { diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 645f8633941..d58afcd4c9f 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1475,9 +1475,8 @@ impl<'a> Parser<'a> { } else if self.eat(&token::Comma) { // Vector with two or more elements. let sep = SeqSep::trailing_allowed(token::Comma); - let (remaining_exprs, _) = self.parse_seq_to_end(close, sep, |p| p.parse_expr())?; - let mut exprs = vec![first_expr]; - exprs.extend(remaining_exprs); + let (mut exprs, _) = self.parse_seq_to_end(close, sep, |p| p.parse_expr())?; + exprs.insert(0, first_expr); ExprKind::Array(exprs) } else { // Vector with one element diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index b23b3d34d51..1434c072038 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -454,9 +454,11 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { } } - for (error, suppressed) in iter::zip(errors, is_suppressed) { - if !suppressed { - self.report_fulfillment_error(error, body_id); + for from_expansion in [false, true] { + for (error, suppressed) in iter::zip(errors, &is_suppressed) { + if !suppressed && error.obligation.cause.span.from_expansion() == from_expansion { + self.report_fulfillment_error(error, body_id); + } } } |
