Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 11 pull requests #90188

Merged
merged 117 commits into from
Oct 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
e4b8714
Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-r…
calebcartwright Jul 26, 2021
778f035
ci: remove unnecessary cargo-make install on windows jobs
calebcartwright Jul 27, 2021
e7fa070
fix: make --edition 2021 visible in --help
outloudvi Jul 22, 2021
0b21ea2
Unyeet const param defaults
BoxyUwU Apr 28, 2021
8c52aae
Bump deps
klensy Jun 3, 2021
e9038b8
rfc3052: Remove authors field from Cargo manifests
lf- Jul 27, 2021
8cbee56
ci: functionally delete appveyor
calebcartwright Jul 30, 2021
2323cbc
Auto merge of #87535 - lf-:authors, r=Mark-Simulacrum
bors Aug 2, 2021
fefb542
fix: handle GAT types in impls with self bounds
calebcartwright Aug 7, 2021
5d8eb8d
fix: don't drop drop generic args on assoc ty constraints
calebcartwright Aug 8, 2021
1d6002a
Enable triagebot assignment in rustfmt
nipunn1313 Aug 8, 2021
64bf8df
Introduce hir::ExprKind::Let - Take 2
c410-f3r Aug 8, 2021
7769ed0
Document private items for rustfmt
jyn514 Jul 14, 2021
e1dac88
Auto merge of #87119 - jyn514:rustfmt-doc-private, r=Mark-Simulacrum
bors Aug 17, 2021
667a2da
Fix stable toggle on gh pages configuration site
ayazhafiz May 31, 2020
6959d03
Show configs from different versions on github pages
ayazhafiz Jun 1, 2020
916c238
fixup! Show configs from different versions on github pages
ayazhafiz Jun 1, 2020
1045c62
Add github-style highlighting for code blocks (#4224)
ayazhafiz Jun 1, 2020
c5f1d96
Adds direct linking using header ids (#4272)
aszenz Jun 23, 2020
31c97ce
Adds query param for version no (#4270)
aszenz Jun 23, 2020
3195d6c
docs: Preserve updated query param content and add config option links
ayazhafiz Jul 3, 2020
bf47fc1
Ensure that doc url hash IDs are scrolled to on page load
ayazhafiz Jul 16, 2020
f5c782f
fixup! Ensure that doc url hash IDs are scrolled to on page load
ayazhafiz Jul 16, 2020
5c7ac69
Warn when rate limit is on docs page
ayazhafiz Jul 16, 2020
3c36a0c
Exluding v0.8.1 and v0.7 from the config dropdown
jdollar Oct 3, 2020
042c2ec
Added Updated default version to Rustfmt docs config
gunadhya Jan 15, 2021
ec86cfd
Fix redirect issue
gunadhya Jan 21, 2021
f787288
Fix for version config option anchor
davidBar-On Mar 3, 2021
25ebc35
Fix more “a”/“an” typos
steffahn Aug 22, 2021
9bc0dbe
Fix typos “an”→“a” and a few different ones that appeared in the same…
steffahn Aug 22, 2021
c8bd550
Add test for visibility on a trait item (currently wrong)
dtolnay Aug 20, 2021
fd6b025
Preserve visibility on trait items inside trait and impl
dtolnay Aug 20, 2021
c4d4699
Stabilise unix_process_await_more, extra ExitStatusExt methods
ijackson Aug 24, 2021
e81c393
fix: remove wrong reformatting of qualified paths in struct patterns
ashvin021 Aug 25, 2021
076916f
Introduce `~const`
fee1-dead Aug 25, 2021
20ddab3
Fix rustfmt test
fee1-dead Aug 27, 2021
a603756
Temporary fix rustfmt for let-else
camsteffen Jul 25, 2021
ca9b050
Implement `One` option for imports_granularity (#4669)
magurotuna Jan 30, 2021
c71c68c
Add <title> to docs
akiomik Sep 1, 2021
d19f69c
test: add missing source for #4943
cowboy-bebug Aug 30, 2021
33d1368
test: add test for #4257
cowboy-bebug Aug 30, 2021
bfc6046
test: add test for #4954
cowboy-bebug Aug 30, 2021
ae5696a
test: add test for #4322
cowboy-bebug Aug 30, 2021
48b8e45
Detect bare blocks with type ascription that were meant to be a `stru…
estebank Sep 2, 2021
1674eea
Fix #88256, remove duplicated diagnostic
chenyukang Sep 4, 2021
6271ded
Auto merge of #88493 - chenyukang:fix-duplicated-diagnostic, r=estebank
bors Sep 6, 2021
59063e8
fix: newline width calc in combine w/ comments (#4123)
calebcartwright Apr 16, 2020
a59cac2
fix: use correct spans for params with attrs
calebcartwright Sep 6, 2021
c2f0e99
try to write the parameter on a new line in case the attribute/parame…
scampi Oct 6, 2020
3d8cd57
tests: add files for issue 4579
calebcartwright Sep 6, 2021
57548aa
fix: resolve idempotency issue in extern body elements
calebcartwright Sep 8, 2021
a806883
fix: handle param doc comments for macro scenarios
calebcartwright Sep 8, 2021
b10ab51
rustfmt doc code blocks with multiple comma-separated attributes
nipunn1313 Aug 8, 2021
d647ebf
Revert "Allow formatting `Anonymous{Struct, Union}` declarations"
pnkfelix Sep 8, 2021
e014277
Ignore automatically derived impls of `Clone` and `Debug` in dead cod…
FabianWolff May 21, 2021
127ec9a
Keep a parent LocalDefId in SpanData.
cjgillot Apr 18, 2021
8743472
Auto merge of #84373 - cjgillot:resolve-span, r=michaelwoerister,petr…
bors Sep 11, 2021
67a59f6
opts: rephrase wording for --all and -p
lnicola Nov 8, 2019
d4ffd1e
Support @generated marker to skip code formatting
topecongiro Jul 10, 2020
9d65b7d
feat: upper- or lowercase hexadecimal literals
ArjenL Jul 15, 2021
52e1a52
Rollup merge of #88775 - pnkfelix:revert-anon-union-parsing, r=davidtwco
Manishearth Sep 15, 2021
17cb2b1
feat: add --check flag to cargo fmt (#3890)
calebcartwright Oct 27, 2019
7aa69e5
refactor: use iter workaround for contains() gap
calebcartwright Sep 17, 2021
dd445ab
Trailing comma on match block goes missing when guard is on its own line
ulyssa Sep 15, 2021
9060bc5
Migrate to 2021
Mark-Simulacrum Sep 19, 2021
74df7b3
deps: update cargo_metadata to include 'path'
calebcartwright Sep 20, 2021
7f6229b
tests: restructure and extend cargo-fmt tests
calebcartwright Sep 20, 2021
4b9d637
refactor: simplify local dep lookups
calebcartwright Sep 21, 2021
cb144c3
In Configurations.md demonstrate both cases for noop selections
rukai Sep 10, 2021
a5138b3
Prevent removal of qualified path for tuple struct inside macro
ytmimi Sep 27, 2021
e3203ef
Add tests for binop_separator = Back
ulyssa Sep 20, 2021
041212f
Report fatal lexer errors in `--cfg` command line arguments
FabianWolff Oct 2, 2021
f0f449d
Wrap long array and slice patterns.
pcwalton Sep 18, 2021
0866b96
Apply suggestions from code review
yaahc Oct 5, 2021
40f4993
Update derive attibute span to start after opening '('
ytmimi Sep 24, 2021
365a2f8
Add additional test cases for issue 4984
ytmimi Sep 29, 2021
8b58cce
Stabilize match_block_trailing_comma. (#4145)
emilio May 16, 2020
d418057
Prevent structs with ".." from being rewritten with alignment
ytmimi Oct 11, 2021
f7c4a44
Adjust non-empty tuple struct span to start before fields
ytmimi Oct 5, 2021
f2fb3c9
Update connector search in ControlFlow::rewrite_pat_expr for for loops
ytmimi Oct 6, 2021
c9c1932
feat: stabilize disable_all_formatting
calebcartwright Oct 14, 2021
a9a1393
Add -Z location-detail flag
hudson-ayers Oct 14, 2021
0cff306
ci: fix release asset upload job
calebcartwright Oct 14, 2021
5f4811e
Handle DefinitiveListTactic::SpecialMacro when writing pre-comments
ytmimi Oct 14, 2021
1ae5c35
Replace match expression with match! macro
ytmimi Oct 19, 2021
9231263
Merge branch 'master' into 1.4.38-subtree
calebcartwright Oct 20, 2021
5f79583
chore: bump toolchain, fix conflict
calebcartwright Oct 20, 2021
b9178dc
Merge pull request #5036 from calebcartwright/1.4.38-subtree
calebcartwright Oct 20, 2021
efa8f55
chore: bump version and changelog
calebcartwright Oct 20, 2021
714e904
Merge commit 'efa8f5521d3813cc897ba29ea0ef98c7aef66bb6' into rustfmt-…
calebcartwright Oct 20, 2021
0697f56
update rustfmt
calebcartwright Oct 20, 2021
d3ecb02
ensure cargo-fmt tests are excluded from root workspace
calebcartwright Oct 20, 2021
65b3c85
Add edition configuration to compiletest
llogiq Oct 19, 2021
e1e273f
CI: make cache download attempt time out after 10 minutes
hkratz Oct 21, 2021
838e673
Debug output before loading docker images as that might hang.
hkratz Oct 21, 2021
e1d94b8
Configure saved panic locations based on location-detail flag
hudson-ayers Oct 14, 2021
8090f67
document the unstable location-detail flag
hudson-ayers Oct 14, 2021
b802629
add tests for -Zlocation-detail
hudson-ayers Oct 15, 2021
3e6a695
Time out docker load after 10 minutes, kill after 12 due to CI hangs.
hkratz Oct 21, 2021
170214f
fix doc issue in rustfmt
calebcartwright Oct 21, 2021
afcee19
Make RSplit<T, P>: Clone not require T: Clone
calebsander Oct 21, 2021
4a43976
Implement split_array and split_array_mut
Mar 17, 2021
c736c2a
Add comment documenting why we can't use a simpler solution
smmalis37 Oct 22, 2021
7d7ebf8
add feature flag for `type_changing_struct_update`
crlf0710 Oct 10, 2021
2ed5665
Apply suggestions from code review
yaahc Oct 22, 2021
98ed554
nice_region_error: Include lifetime placeholders in error output
notriddle Oct 1, 2021
5ea0274
Rollup merge of #83233 - jethrogb:split_array, r=yaahc
matthiaskrgr Oct 23, 2021
df43062
Rollup merge of #88300 - ijackson:exitstatusext-methods, r=yaahc
matthiaskrgr Oct 23, 2021
d64b3a7
Rollup merge of #89416 - notriddle:notriddle/do-not-elide-lifetimes-i…
matthiaskrgr Oct 23, 2021
0f81c7f
Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726
matthiaskrgr Oct 23, 2021
736e8eb
Rollup merge of #89730 - crlf0710:type_changing_feature, r=jackh726
matthiaskrgr Oct 23, 2021
8fb194c
Rollup merge of #89920 - hudson-ayers:location-detail-control, r=davi…
matthiaskrgr Oct 23, 2021
1782d13
Rollup merge of #90070 - llogiq:compiletest-config-edition, r=Mark-Si…
matthiaskrgr Oct 23, 2021
c400fee
Rollup merge of #90087 - calebcartwright:rustfmt-subtree, r=calebcart…
matthiaskrgr Oct 23, 2021
270c800
Rollup merge of #90117 - calebsander:fix/rsplit-clone, r=yaahc
matthiaskrgr Oct 23, 2021
1ea34fb
Rollup merge of #90122 - rusticstuff:ci_curl_max_time, r=Mark-Simulacrum
matthiaskrgr Oct 23, 2021
a05a129
Rollup merge of #90166 - smmalis37:patch-1, r=joshtriplett
matthiaskrgr Oct 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 37 additions & 43 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,23 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81a18687293a1546b67c246452202bbbf143d239cb43494cc163da14979082da"

[[package]]
name = "camino"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52d74260d9bf6944e2208aa46841b4b8f0d7ffc0849a06837b2f510337f86b2b"
dependencies = [
"serde",
]

[[package]]
name = "cargo"
version = "0.58.0"
dependencies = [
"anyhow",
"atty",
"bytesize",
"cargo-platform",
"cargo-platform 0.1.2",
"cargo-test-macro",
"cargo-test-support",
"cargo-util",
Expand Down Expand Up @@ -374,6 +383,15 @@ dependencies = [
"serde",
]

[[package]]
name = "cargo-platform"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27"
dependencies = [
"serde",
]

[[package]]
name = "cargo-test-macro"
version = "0.1.0"
Expand Down Expand Up @@ -421,23 +439,24 @@ dependencies = [

[[package]]
name = "cargo_metadata"
version = "0.8.2"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "700b3731fd7d357223d0000f4dbf1808401b694609035c3c411fbc0cd375c426"
checksum = "d5a5f7b42f606b7f23674f6f4d877628350682bc40687d3fae65679a58d55345"
dependencies = [
"semver 0.9.0",
"semver 0.11.0",
"serde",
"serde_derive",
"serde_json",
]

[[package]]
name = "cargo_metadata"
version = "0.12.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5a5f7b42f606b7f23674f6f4d877628350682bc40687d3fae65679a58d55345"
checksum = "c297bd3135f558552f99a0daa180876984ea2c4ffa7470314540dff8c654109a"
dependencies = [
"semver 0.11.0",
"camino",
"cargo-platform 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 1.0.3",
"serde",
"serde_json",
]
Expand Down Expand Up @@ -1070,9 +1089,9 @@ dependencies = [

[[package]]
name = "env_logger"
version = "0.6.2"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3"
checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
dependencies = [
"atty",
"humantime 1.3.0",
Expand All @@ -1083,12 +1102,12 @@ dependencies = [

[[package]]
name = "env_logger"
version = "0.7.1"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3"
dependencies = [
"atty",
"humantime 1.3.0",
"humantime 2.0.1",
"log",
"regex",
"termcolor",
Expand Down Expand Up @@ -1698,15 +1717,6 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485"

[[package]]
name = "itertools"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484"
dependencies = [
"either",
]

[[package]]
name = "itertools"
version = "0.9.0"
Expand Down Expand Up @@ -4673,19 +4683,19 @@ dependencies = [

[[package]]
name = "rustfmt-nightly"
version = "1.4.37"
version = "1.4.38"
dependencies = [
"annotate-snippets",
"anyhow",
"bytecount",
"cargo_metadata 0.8.2",
"cargo_metadata 0.14.0",
"derive-new",
"diff",
"dirs",
"env_logger 0.6.2",
"env_logger 0.8.4",
"getopts",
"ignore",
"itertools 0.8.2",
"itertools 0.9.0",
"lazy_static",
"log",
"regex",
Expand Down Expand Up @@ -4768,23 +4778,13 @@ dependencies = [
"libc",
]

[[package]]
name = "semver"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
dependencies = [
"semver-parser 0.7.0",
"serde",
]

[[package]]
name = "semver"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6"
dependencies = [
"semver-parser 0.10.2",
"semver-parser",
"serde",
]

Expand All @@ -4797,12 +4797,6 @@ dependencies = [
"serde",
]

[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"

[[package]]
name = "semver-parser"
version = "0.10.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,17 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
line: u32,
col: u32,
) -> MPlaceTy<'tcx, M::PointerTag> {
let file =
self.allocate_str(&filename.as_str(), MemoryKind::CallerLocation, Mutability::Not);
let line = Scalar::from_u32(line);
let col = Scalar::from_u32(col);
let loc_details = &self.tcx.sess.opts.debugging_opts.location_detail;
let file = if loc_details.file {
self.allocate_str(&filename.as_str(), MemoryKind::CallerLocation, Mutability::Not)
} else {
// FIXME: This creates a new allocation each time. It might be preferable to
// perform this allocation only once, and re-use the `MPlaceTy`.
// See https://github.com/rust-lang/rust/pull/89920#discussion_r730012398
self.allocate_str("<redacted>", MemoryKind::CallerLocation, Mutability::Not)
};
let line = if loc_details.line { Scalar::from_u32(line) } else { Scalar::from_u32(0) };
let col = if loc_details.column { Scalar::from_u32(col) } else { Scalar::from_u32(0) };

// Allocate memory for `CallerLocation` struct.
let loc_ty = self
Expand Down
21 changes: 17 additions & 4 deletions compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use rustc_span::{MultiSpan, SourceFile, Span};
use crate::snippet::{Annotation, AnnotationType, Line, MultilineAnnotation, Style, StyledString};
use crate::styled_buffer::StyledBuffer;
use crate::{
CodeSuggestion, Diagnostic, DiagnosticId, Level, SubDiagnostic, SubstitutionHighlight,
CodeSuggestion, Diagnostic, DiagnosticId, Handler, Level, SubDiagnostic, SubstitutionHighlight,
SuggestionStyle,
};

Expand Down Expand Up @@ -523,14 +523,27 @@ impl Emitter for EmitterWriter {
}
}

/// An emitter that does nothing when emitting a diagnostic.
pub struct SilentEmitter;
/// An emitter that does nothing when emitting a non-fatal diagnostic.
/// Fatal diagnostics are forwarded to `fatal_handler` to avoid silent
/// failures of rustc, as witnessed e.g. in issue #89358.
pub struct SilentEmitter {
pub fatal_handler: Handler,
pub fatal_note: Option<String>,
}

impl Emitter for SilentEmitter {
fn source_map(&self) -> Option<&Lrc<SourceMap>> {
None
}
fn emit_diagnostic(&mut self, _: &Diagnostic) {}
fn emit_diagnostic(&mut self, d: &Diagnostic) {
if d.level == Level::Fatal {
let mut d = d.clone();
if let Some(ref note) = self.fatal_note {
d.note(note);
}
self.fatal_handler.emit_diagnostic(&d);
}
}
}

/// Maximum number of lines we will print for a multiline suggestion; arbitrary.
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,10 @@ declare_features! (
/// Allows using the `non_exhaustive_omitted_patterns` lint.
(active, non_exhaustive_omitted_patterns_lint, "1.57.0", Some(89554), None),

/// Allows creation of instances of a struct by moving fields that have
/// not changed from prior instances of the same struct (RFC #2528)
(incomplete, type_changing_struct_update, "1.58.0", Some(86555), None),

// -------------------------------------------------------------------------
// feature-group-end: actual feature gates
// -------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ use rustc_hir as hir;
use rustc_hir::def::Res;
use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::Visitor;
use rustc_middle::ty::error::ExpectedFound;
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_middle::ty::print::RegionHighlightMode;
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeVisitor};

use rustc_span::{MultiSpan, Span, Symbol};

use std::ops::ControlFlow;

impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
/// Print the error message for lifetime errors when the `impl` doesn't conform to the `trait`.
pub(super) fn try_report_impl_not_conforming_to_trait(&self) -> Option<ErrorReported> {
Expand Down Expand Up @@ -69,6 +72,47 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
.tcx()
.sess
.struct_span_err(sp, "`impl` item signature doesn't match `trait` item signature");

// Mark all unnamed regions in the type with a number.
// This diagnostic is called in response to lifetime errors, so be informative.
struct HighlightBuilder<'tcx> {
highlight: RegionHighlightMode,
tcx: TyCtxt<'tcx>,
counter: usize,
}

impl HighlightBuilder<'tcx> {
fn build(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> RegionHighlightMode {
let mut builder =
HighlightBuilder { highlight: RegionHighlightMode::default(), counter: 1, tcx };
builder.visit_ty(ty);
builder.highlight
}
}

impl<'tcx> ty::fold::TypeVisitor<'tcx> for HighlightBuilder<'tcx> {
fn tcx_for_anon_const_substs(&self) -> Option<TyCtxt<'tcx>> {
Some(self.tcx)
}

fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
if !r.has_name() && self.counter <= 3 {
self.highlight.highlighting_region(r, self.counter);
self.counter += 1;
}
r.super_visit_with(self)
}
}

let expected_highlight = HighlightBuilder::build(self.tcx(), expected);
let expected = self
.infcx
.extract_inference_diagnostics_data(expected.into(), Some(expected_highlight))
.name;
let found_highlight = HighlightBuilder::build(self.tcx(), found);
let found =
self.infcx.extract_inference_diagnostics_data(found.into(), Some(found_highlight)).name;

err.span_label(sp, &format!("found `{}`", found));
err.span_label(trait_sp, &format!("expected `{}`", expected));

Expand Down Expand Up @@ -96,15 +140,8 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
);
}

if let Some((expected, found)) =
self.infcx.expected_found_str_ty(ExpectedFound { expected, found })
{
// Highlighted the differences when showing the "expected/found" note.
err.note_expected_found(&"", expected, &"", found);
} else {
// This fallback shouldn't be necessary, but let's keep it in just in case.
err.note(&format!("expected `{}`\n found `{}`", expected, found));
}
err.note(&format!("expected `{}`\n found `{}`", expected, found));

err.span_help(
type_param_span,
"the lifetime requirements from the `impl` do not correspond to the requirements in \
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_interface/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> FxHashSet<(String, Option<String
let cfg = cfgspecs
.into_iter()
.map(|s| {
let sess = ParseSess::with_silent_emitter();
let sess = ParseSess::with_silent_emitter(Some(format!(
"this error occurred on the command line: `--cfg={}`",
s
)));
let filename = FileName::cfg_spec_source_code(&s);
let mut parser = new_parser_from_source_str(&sess, filename, s.to_string());

Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use rustc_errors::{emitter::HumanReadableErrorType, registry, ColorConfig};
use rustc_session::config::InstrumentCoverage;
use rustc_session::config::Strip;
use rustc_session::config::{build_configuration, build_session_options, to_crate_config};
use rustc_session::config::{rustc_optgroups, ErrorOutputType, ExternLocation, Options, Passes};
use rustc_session::config::{
rustc_optgroups, ErrorOutputType, ExternLocation, LocationDetail, Options, Passes,
};
use rustc_session::config::{CFGuard, ExternEntry, LinkerPluginLto, LtoCli, SwitchWithOptPath};
use rustc_session::config::{
Externs, OutputType, OutputTypes, SymbolManglingVersion, WasiExecModel,
Expand Down Expand Up @@ -733,6 +735,7 @@ fn test_debugging_options_tracking_hash() {
tracked!(instrument_mcount, true);
tracked!(link_only, true);
tracked!(llvm_plugins, vec![String::from("plugin_name")]);
tracked!(location_detail, LocationDetail { file: true, line: false, column: false });
tracked!(merge_functions, Some(MergeFunctions::Disabled));
tracked!(mir_emit_retag, true);
tracked!(mir_opt_level, Some(4));
Expand Down
Loading