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 9 pull requests #98605

Closed
wants to merge 33 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift click to select a range
6ef2033
Fix FFI-unwind unsoundness with mixed panic mode
nbdd0121 May 18, 2022
77fd0cc
Handle panic runtime specially
nbdd0121 May 19, 2022
bc5afd9
Ensure ffi_unwind_calls lint is gated behind c_unwind
nbdd0121 May 19, 2022
1750a2f
Add tests for mixed panic mode restriction and lints
nbdd0121 May 20, 2022
9e6c044
Use is_fn_like instead of matching on DefKind
nbdd0121 May 23, 2022
14d155a
Rename `panic_strategy` query to `required_panic_strategy`
nbdd0121 Jun 8, 2022
ce774e3
Add a explanation about required panic strategy computation
nbdd0121 Jun 8, 2022
4c4152b
remove `span_lint_and_sugg_for_edges` from clippy utils
WaffleLapkin Jun 19, 2022
e251247
remove last use of MAX_SUGGESTION_HIGHLIGHT_LINES
WaffleLapkin Jun 19, 2022
ffb593b
remove MAX_SUGGESTION_HIGHLIGHT_LINES
WaffleLapkin Jun 19, 2022
a0eba66
[RFC 2011] Optimize non-consuming operators
c410-f3r Jun 21, 2022
c416307
Fixed RSS reporting on macOS
rdzhaafar Jun 22, 2022
f954f7b
Hermit: Fix initializing lazy locks
mkroening Jun 26, 2022
0c88602
Hermit: Make Mutex::init a no-op
mkroening Jun 26, 2022
871c879
lint: fix condition in diagnostic lints
davidtwco Jun 22, 2022
ae61224
various: add `rustc_lint_diagnostics` to diag fns
davidtwco Jun 22, 2022
be9ebfd
privacy: port "field is private" diag
davidtwco Jun 22, 2022
cb90a4f
privacy: port "item is private" diag
davidtwco Jun 22, 2022
0557d02
privacy: port unnamed "item is private" diag
davidtwco Jun 22, 2022
74f3a96
privacy: port "in public interface" diag
davidtwco Jun 22, 2022
15d61d7
privacy: deny diagnostic migration lints
davidtwco Jun 22, 2022
c24f063
Remove a back-compat hack on lazy TAIT
JohnTitor May 24, 2022
6400736
Implement `Send` and `Sync` for `ThinBox<T>`
cuviper Jun 27, 2022
f5a38d1
Remove unstable CStr/CString change from 1.62 release note
wwylele Jun 27, 2022
87a3821
Rollup merge of #97235 - nbdd0121:unwind, r=Amanieu
Dylan-DPC Jun 28, 2022
86eb0e5
Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obk
Dylan-DPC Jun 28, 2022
da898bf
Rollup merge of #98261 - WaffleLapkin:attempt_to_remove_max_suggestio…
Dylan-DPC Jun 28, 2022
9ed32b1
Rollup merge of #98337 - c410-f3r:assert-compiler, r=oli-obk
Dylan-DPC Jun 28, 2022
cfda49b
Rollup merge of #98384 - rdzhaafar:fix-macos-rss-reporting, r=davidtw…
Dylan-DPC Jun 28, 2022
a0a5cff
Rollup merge of #98420 - davidtwco:translation-lint-fixes-and-more-mi…
Dylan-DPC Jun 28, 2022
6de107a
Rollup merge of #98555 - mkroening:hermit-lock-init, r=m-ou-se
Dylan-DPC Jun 28, 2022
674c1fc
Rollup merge of #98595 - cuviper:send-sync-thinbox, r=m-ou-se
Dylan-DPC Jun 28, 2022
18c086f
Rollup merge of #98597 - wwylele:patch-1, r=Mark-Simulacrum
Dylan-DPC Jun 28, 2022
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
Prev Previous commit
Next Next commit
lint: fix condition in diagnostic lints
Unfortunately, the diagnostic lints are very broken and trigger much
more often than they should. Correct the conditional which checks if the
function call being made is to a diagnostic function so that it returns
in every intended case.

Signed-off-by: David Wood <[email protected]>
  • Loading branch information
davidtwco committed Jun 27, 2022
commit 871c879bff903d9539c323b719d18d3b61759e62
9 changes: 6 additions & 3 deletions compiler/rustc_lint/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 406,12 @@ impl LateLintPass<'_> for Diagnostics {
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
let Some((span, def_id, substs)) = typeck_results_of_method_fn(cx, expr) else { return };
debug!(?span, ?def_id, ?substs);
if let Ok(Some(instance)) = ty::Instance::resolve(cx.tcx, cx.param_env, def_id, substs) &&
!cx.tcx.has_attr(instance.def_id(), sym::rustc_lint_diagnostics)
{
let has_attr = ty::Instance::resolve(cx.tcx, cx.param_env, def_id, substs)
.ok()
.and_then(|inst| inst)
.map(|inst| cx.tcx.has_attr(inst.def_id(), sym::rustc_lint_diagnostics))
.unwrap_or(false);
if !has_attr {
return;
}

Expand Down