diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-04-19 14:43:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-19 14:43:17 +0200 |
| commit | 5f10d1312dc53758824bd1da5fdbc4175e8d1c61 (patch) | |
| tree | 575022972881a8172fb26587a838905f446ad306 /compiler/rustc_lint/src | |
| parent | 9a2d14c39a177d04ff1100f7b34de95492d7b868 (diff) | |
| parent | 1be1157d7551d3664b6f55d5eea85fb08b86761b (diff) | |
| download | rust-5f10d1312dc53758824bd1da5fdbc4175e8d1c61.tar.gz rust-5f10d1312dc53758824bd1da5fdbc4175e8d1c61.zip | |
Rollup merge of #96086 - jsgf:remove-extern-location, r=davidtwco
Remove `--extern-location` and all associated code `--extern-location` was an experiment to investigate the best way to generate useful diagnostics for unused dependency warnings by enabling a build system to identify the corresponding build config. While I did successfully use this, I've since been convinced the alternative `--json unused-externs` mechanism is the way to go, and there's no point in having two mechanisms with basically the same functionality. This effectively reverts https://github.com/rust-lang/rust/pull/72603
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/context.rs | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs index 152c53dac7f..0ffa65b79b5 100644 --- a/compiler/rustc_lint/src/context.rs +++ b/compiler/rustc_lint/src/context.rs @@ -33,8 +33,7 @@ use rustc_middle::middle::stability; use rustc_middle::ty::layout::{LayoutError, LayoutOfHelpers, TyAndLayout}; use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_middle::ty::{self, print::Printer, subst::GenericArg, RegisteredTools, Ty, TyCtxt}; -use rustc_serialize::json::Json; -use rustc_session::lint::{BuiltinLintDiagnostics, ExternDepSpec}; +use rustc_session::lint::BuiltinLintDiagnostics; use rustc_session::lint::{FutureIncompatibleInfo, Level, Lint, LintBuffer, LintId}; use rustc_session::Session; use rustc_span::lev_distance::find_best_match_for_name; @@ -728,30 +727,6 @@ pub trait LintContext: Sized { BuiltinLintDiagnostics::LegacyDeriveHelpers(span) => { db.span_label(span, "the attribute is introduced here"); } - BuiltinLintDiagnostics::ExternDepSpec(krate, loc) => { - let json = match loc { - ExternDepSpec::Json(json) => { - db.help(&format!("remove unnecessary dependency `{}`", krate)); - json - } - ExternDepSpec::Raw(raw) => { - db.help(&format!("remove unnecessary dependency `{}` at `{}`", krate, raw)); - db.span_suggestion_with_style( - DUMMY_SP, - "raw extern location", - raw.clone(), - Applicability::Unspecified, - SuggestionStyle::CompletelyHidden, - ); - Json::String(raw) - } - }; - db.tool_only_suggestion_with_metadata( - "json extern location", - Applicability::Unspecified, - json - ); - } BuiltinLintDiagnostics::ProcMacroBackCompat(note) => { db.note(¬e); } |
