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
Show file tree
Hide file tree
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
privacy: port unnamed "item is private" diag
Signed-off-by: David Wood <[email protected]>
  • Loading branch information
davidtwco committed Jun 27, 2022
commit 0557d02a9dcca2d0f2e3c6a5a0a69935da4cf1f5
2 changes: 2 additions & 0 deletions compiler/rustc_error_messages/locales/en-US/privacy.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 4,5 @@ privacy-field-is-private-label = private field

privacy-item-is-private = {$kind} `{$descr}` is private
.label = private {$kind}
privacy-unnamed-item-is-private = {$kind} is private
.label = private {$kind}
8 changes: 8 additions & 0 deletions compiler/rustc_privacy/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 37,11 @@ pub struct ItemIsPrivate<'a> {
pub kind: &'a str,
pub descr: String,
}

#[derive(SessionDiagnostic)]
#[error(privacy::unnamed_item_is_private)]
pub struct UnnamedItemIsPrivate {
#[primary_span]
pub span: Span,
pub kind: &'static str,
}
11 changes: 4 additions & 7 deletions compiler/rustc_privacy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 36,7 @@ use std::marker::PhantomData;
use std::ops::ControlFlow;
use std::{cmp, fmt, mem};

use errors::{FieldIsPrivate, FieldIsPrivateLabel, ItemIsPrivate};
use errors::{FieldIsPrivate, FieldIsPrivateLabel, ItemIsPrivate, UnnamedItemIsPrivate};

////////////////////////////////////////////////////////////////////////////////
/// Generic infrastructure used to implement specific visitors below.
Expand Down Expand Up @@ -1248,13 1248,10 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> {
hir::QPath::TypeRelative(_, segment) => Some(segment.ident.to_string()),
};
let kind = kind.descr(def_id);
let msg = match name {
Some(name) => format!("{} `{}` is private", kind, name),
None => format!("{} is private", kind),
let _ = match name {
Some(name) => sess.emit_err(ItemIsPrivate { span, kind, descr: name }),
None => sess.emit_err(UnnamedItemIsPrivate { span, kind }),
};
sess.struct_span_err(span, &msg)
.span_label(span, &format!("private {}", kind))
.emit();
return;
}
}
Expand Down