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 #119837

Merged
merged 39 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
98d3012
Use version-sorting for all sorting
joshtriplett Aug 21, 2023
127e052
Make an implementation note on version-sorting accurate
joshtriplett Aug 21, 2023
47bb076
Clarify that version-sorting looks for the *longest* sequence of digits
joshtriplett Aug 21, 2023
95eb1e2
Streamline description of versionsort (incorporate suggestion from Ralf)
joshtriplett Aug 22, 2023
f06df22
Clarify "as normal" -> "lexicographically"
joshtriplett Aug 28, 2023
2e931b5
style-guide: Rework version-sorting algorithm
joshtriplett Dec 23, 2023
c9276ea
Pass LLVM error message back to pass wrapper.
aoli-al Jan 5, 2024
07d5f19
Add an error path to the algorithm
Nadrieril Jan 7, 2024
4b2e8bc
Abort analysis on type error
Nadrieril Jan 1, 2024
f051185
Don't mix combinators and `let else`
Nadrieril Jan 9, 2024
894d1d4
change function name in comments
mj10021 Jan 9, 2024
af3c2c9
Fix all_trait* methods to return all trait available
celinval Jan 9, 2024
ba27e22
Use a ty::Error instead of patching up a type after erroring
oli-obk Jan 9, 2024
972c95a
Turn some free functions into methods
oli-obk Jan 9, 2024
0e82aae
Avoid follow up errors
oli-obk Jan 9, 2024
1ed855d
Stabilize mutex_unpoison feature
tmccombs Jan 10, 2024
dee657f
Add test case for #119778
Nadrieril Jan 10, 2024
f49b0dc
Check reveal and can_define_opaque_ty in try_normalize_ty_recur
compiler-errors Jan 10, 2024
3799568
More comments
compiler-errors Jan 10, 2024
427c55c
Simplify some redundant names
compiler-errors Dec 13, 2023
7d61535
Add project const traits to triagebot config
fmease Jan 10, 2024
06cf881
Rename `TRACK_DIAGNOSTICS` as `TRACK_DIAGNOSTIC`.
nnethercote Jan 9, 2024
0e388f2
Change how `force-warn` lint diagnostics are recorded.
nnethercote Jan 9, 2024
12ba450
Reset `lint_err_count` in `DiagCtxt::reset_err_count`.
nnethercote Jan 9, 2024
8866780
Move `DiagCtxtInner::deduplicated_warn_count`.
nnethercote Jan 9, 2024
56c3265
Replace `warn_count`.
nnethercote Jan 9, 2024
dd61eba
Simplify lint error counting.
nnethercote Jan 9, 2024
4621357
Make is_global/is_unicast_global special address handling complete
jstasiak Dec 16, 2023
3cc4e02
Rollup merge of #115046 - joshtriplett:master, r=compiler-errors
matthiaskrgr Jan 11, 2024
859874f
Rollup merge of #118915 - compiler-errors:alias-nits, r=lcnr
matthiaskrgr Jan 11, 2024
0f2d12e
Rollup merge of #119006 - jstasiak:fix-special-ip-ranges, r=cuviper
matthiaskrgr Jan 11, 2024
b6ef8b6
Rollup merge of #119637 - aoli-al:master, r=cuviper
matthiaskrgr Jan 11, 2024
4dcc5a0
Rollup merge of #119715 - Nadrieril:graceful-type-error, r=compiler-e…
matthiaskrgr Jan 11, 2024
88493fc
Rollup merge of #119763 - nnethercote:cleanup-Diagnostic, r=oli-obk
matthiaskrgr Jan 11, 2024
6238698
Rollup merge of #119788 - mj10021:issue-119787-fix, r=oli-obk
matthiaskrgr Jan 11, 2024
d93df41
Rollup merge of #119790 - celinval:smir-all-traits, r=oli-obk
matthiaskrgr Jan 11, 2024
d37de53
Rollup merge of #119803 - oli-obk:even_more_follow_up_errors, r=compi…
matthiaskrgr Jan 11, 2024
f92cde4
Rollup merge of #119804 - tmccombs:stabilize-unpoison, r=cuviper
matthiaskrgr Jan 11, 2024
1189d23
Rollup merge of #119832 - fmease:project-const-traits-triagebot, r=co…
matthiaskrgr Jan 11, 2024
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
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ impl<'tcx> BorrowExplanation<'tcx> {
let mut failed = false;

let elaborated_args = std::iter::zip(*args, &generics.params).map(|(arg, param)| {
if let Some(ty::Dynamic(obj, _, ty::DynKind::Dyn)) = arg.as_type().map(Ty::kind) {
if let Some(ty::Dynamic(obj, _, ty::Dyn)) = arg.as_type().map(Ty::kind) {
let default = tcx.object_lifetime_default(param.def_id);

let re_static = tcx.lifetimes.re_static;
Expand All @@ -339,7 +339,7 @@ impl<'tcx> BorrowExplanation<'tcx> {

has_dyn = true;

Ty::new_dynamic(tcx, obj, implied_region, ty::DynKind::Dyn).into()
Ty::new_dynamic(tcx, obj, implied_region, ty::Dyn).into()
} else {
arg
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ fn not_testable_error(cx: &ExtCtxt<'_>, attr_sp: Span, item: Option<&ast::Item>)
let level = match item.map(|i| &i.kind) {
// These were a warning before #92959 and need to continue being that to avoid breaking
// stable user code (#94508).
Some(ast::ItemKind::MacCall(_)) => Level::Warning(None),
Some(ast::ItemKind::MacCall(_)) => Level::Warning,
_ => Level::Error,
};
let mut err = DiagnosticBuilder::<()>::new(dcx, level, msg);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ fn report_inline_asm(
}
let level = match level {
llvm::DiagnosticLevel::Error => Level::Error,
llvm::DiagnosticLevel::Warning => Level::Warning(None),
llvm::DiagnosticLevel::Warning => Level::Warning,
llvm::DiagnosticLevel::Note | llvm::DiagnosticLevel::Remark => Level::Note,
};
cgcx.diag_emitter.inline_asm_error(cookie as u32, msg, level, source);
Expand Down
9 changes: 2 additions & 7 deletions compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1847,14 +1847,9 @@ impl SharedEmitterMain {
dcx.emit_diagnostic(d);
}
Ok(SharedEmitterMessage::InlineAsmError(cookie, msg, level, source)) => {
let err_level = match level {
Level::Error => Level::Error,
Level::Warning(_) => Level::Warning(None),
Level::Note => Level::Note,
_ => bug!("Invalid inline asm diagnostic level"),
};
assert!(matches!(level, Level::Error | Level::Warning | Level::Note));
let msg = msg.strip_prefix("error: ").unwrap_or(&msg).to_string();
let mut err = DiagnosticBuilder::<()>::new(sess.dcx(), err_level, msg);
let mut err = DiagnosticBuilder::<()>::new(sess.dcx(), level, msg);

// If the cookie is 0 then we don't have span information.
if cookie != 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fn source_string(file: Lrc<SourceFile>, line: &Line) -> String {
fn annotation_type_for_level(level: Level) -> AnnotationType {
match level {
Level::Bug | Level::DelayedBug | Level::Fatal | Level::Error => AnnotationType::Error,
Level::Warning(_) => AnnotationType::Warning,
Level::ForceWarning(_) | Level::Warning => AnnotationType::Warning,
Level::Note | Level::OnceNote => AnnotationType::Note,
Level::Help | Level::OnceHelp => AnnotationType::Help,
// FIXME(#59346): Not sure how to map this level
Expand Down
17 changes: 10 additions & 7 deletions compiler/rustc_errors/src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ pub enum DiagnosticId {
name: String,
/// Indicates whether this lint should show up in cargo's future breakage report.
has_future_breakage: bool,
is_force_warn: bool,
},
}

Expand Down Expand Up @@ -248,7 +247,8 @@ impl Diagnostic {
true
}

Level::Warning(_)
Level::ForceWarning(_)
| Level::Warning
| Level::Note
| Level::OnceNote
| Level::Help
Expand All @@ -262,7 +262,7 @@ impl Diagnostic {
&mut self,
unstable_to_stable: &FxIndexMap<LintExpectationId, LintExpectationId>,
) {
if let Level::Expect(expectation_id) | Level::Warning(Some(expectation_id)) =
if let Level::Expect(expectation_id) | Level::ForceWarning(Some(expectation_id)) =
&mut self.level
{
if expectation_id.is_stable() {
Expand Down Expand Up @@ -292,8 +292,11 @@ impl Diagnostic {
}

pub(crate) fn is_force_warn(&self) -> bool {
match self.code {
Some(DiagnosticId::Lint { is_force_warn, .. }) => is_force_warn,
match self.level {
Level::ForceWarning(_) => {
assert!(self.is_lint);
true
}
_ => false,
}
}
Expand Down Expand Up @@ -472,7 +475,7 @@ impl Diagnostic {
/// Add a warning attached to this diagnostic.
#[rustc_lint_diagnostics]
pub fn warn(&mut self, msg: impl Into<SubdiagnosticMessage>) -> &mut Self {
self.sub(Level::Warning(None), msg, MultiSpan::new());
self.sub(Level::Warning, msg, MultiSpan::new());
self
}

Expand All @@ -484,7 +487,7 @@ impl Diagnostic {
sp: S,
msg: impl Into<SubdiagnosticMessage>,
) -> &mut Self {
self.sub(Level::Warning(None), msg, sp.into());
self.sub(Level::Warning, msg, sp.into());
self
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl Emitter for JsonEmitter {
.into_iter()
.map(|mut diag| {
if diag.level == crate::Level::Allow {
diag.level = crate::Level::Warning(None);
diag.level = crate::Level::Warning;
}
FutureBreakageItem {
diagnostic: EmitTyped::Diagnostic(Diagnostic::from_errors_diagnostic(
Expand Down
Loading