Skip to content

Commit 2286888

Browse files
committed
session: remove now-unnecessary lint #[allow]s
In #101230, the internal diagnostic migration lints - `diagnostic_outside_of_impl` and `untranslatable_diagnostic` - were modified so that they wouldn't trigger on functions annotated with `#[rustc_lint_diagnostics]`. However, this change has to make it into the bootstrap compiler before the `#[allow]` annotations that it aims to remove can be removed, which is possible now that #102051 has landed. Signed-off-by: David Wood <[email protected]>
1 parent de0b511 commit 2286888

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

Diff for: compiler/rustc_session/src/parse.rs

-8
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,6 @@ impl ParseSess {
376376
}
377377

378378
#[rustc_lint_diagnostics]
379-
#[allow(rustc::diagnostic_outside_of_impl)]
380-
#[allow(rustc::untranslatable_diagnostic)]
381379
pub fn struct_err(
382380
&self,
383381
msg: impl Into<DiagnosticMessage>,
@@ -386,22 +384,16 @@ impl ParseSess {
386384
}
387385

388386
#[rustc_lint_diagnostics]
389-
#[allow(rustc::diagnostic_outside_of_impl)]
390-
#[allow(rustc::untranslatable_diagnostic)]
391387
pub fn struct_warn(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
392388
self.span_diagnostic.struct_warn(msg)
393389
}
394390

395391
#[rustc_lint_diagnostics]
396-
#[allow(rustc::diagnostic_outside_of_impl)]
397-
#[allow(rustc::untranslatable_diagnostic)]
398392
pub fn struct_fatal(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, !> {
399393
self.span_diagnostic.struct_fatal(msg)
400394
}
401395

402396
#[rustc_lint_diagnostics]
403-
#[allow(rustc::diagnostic_outside_of_impl)]
404-
#[allow(rustc::untranslatable_diagnostic)]
405397
pub fn struct_diagnostic<G: EmissionGuarantee>(
406398
&self,
407399
msg: impl Into<DiagnosticMessage>,

Diff for: compiler/rustc_session/src/session.rs

-44
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,6 @@ impl Session {
288288
}
289289

290290
#[rustc_lint_diagnostics]
291-
#[allow(rustc::untranslatable_diagnostic)]
292-
#[allow(rustc::diagnostic_outside_of_impl)]
293291
pub fn struct_span_warn<S: Into<MultiSpan>>(
294292
&self,
295293
sp: S,
@@ -298,8 +296,6 @@ impl Session {
298296
self.diagnostic().struct_span_warn(sp, msg)
299297
}
300298
#[rustc_lint_diagnostics]
301-
#[allow(rustc::untranslatable_diagnostic)]
302-
#[allow(rustc::diagnostic_outside_of_impl)]
303299
pub fn struct_span_warn_with_expectation<S: Into<MultiSpan>>(
304300
&self,
305301
sp: S,
@@ -309,8 +305,6 @@ impl Session {
309305
self.diagnostic().struct_span_warn_with_expectation(sp, msg, id)
310306
}
311307
#[rustc_lint_diagnostics]
312-
#[allow(rustc::untranslatable_diagnostic)]
313-
#[allow(rustc::diagnostic_outside_of_impl)]
314308
pub fn struct_span_warn_with_code<S: Into<MultiSpan>>(
315309
&self,
316310
sp: S,
@@ -320,14 +314,10 @@ impl Session {
320314
self.diagnostic().struct_span_warn_with_code(sp, msg, code)
321315
}
322316
#[rustc_lint_diagnostics]
323-
#[allow(rustc::untranslatable_diagnostic)]
324-
#[allow(rustc::diagnostic_outside_of_impl)]
325317
pub fn struct_warn(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
326318
self.diagnostic().struct_warn(msg)
327319
}
328320
#[rustc_lint_diagnostics]
329-
#[allow(rustc::untranslatable_diagnostic)]
330-
#[allow(rustc::diagnostic_outside_of_impl)]
331321
pub fn struct_warn_with_expectation(
332322
&self,
333323
msg: impl Into<DiagnosticMessage>,
@@ -336,8 +326,6 @@ impl Session {
336326
self.diagnostic().struct_warn_with_expectation(msg, id)
337327
}
338328
#[rustc_lint_diagnostics]
339-
#[allow(rustc::untranslatable_diagnostic)]
340-
#[allow(rustc::diagnostic_outside_of_impl)]
341329
pub fn struct_span_allow<S: Into<MultiSpan>>(
342330
&self,
343331
sp: S,
@@ -346,14 +334,10 @@ impl Session {
346334
self.diagnostic().struct_span_allow(sp, msg)
347335
}
348336
#[rustc_lint_diagnostics]
349-
#[allow(rustc::untranslatable_diagnostic)]
350-
#[allow(rustc::diagnostic_outside_of_impl)]
351337
pub fn struct_allow(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
352338
self.diagnostic().struct_allow(msg)
353339
}
354340
#[rustc_lint_diagnostics]
355-
#[allow(rustc::untranslatable_diagnostic)]
356-
#[allow(rustc::diagnostic_outside_of_impl)]
357341
pub fn struct_expect(
358342
&self,
359343
msg: impl Into<DiagnosticMessage>,
@@ -362,8 +346,6 @@ impl Session {
362346
self.diagnostic().struct_expect(msg, id)
363347
}
364348
#[rustc_lint_diagnostics]
365-
#[allow(rustc::untranslatable_diagnostic)]
366-
#[allow(rustc::diagnostic_outside_of_impl)]
367349
pub fn struct_span_err<S: Into<MultiSpan>>(
368350
&self,
369351
sp: S,
@@ -372,8 +354,6 @@ impl Session {
372354
self.diagnostic().struct_span_err(sp, msg)
373355
}
374356
#[rustc_lint_diagnostics]
375-
#[allow(rustc::untranslatable_diagnostic)]
376-
#[allow(rustc::diagnostic_outside_of_impl)]
377357
pub fn struct_span_err_with_code<S: Into<MultiSpan>>(
378358
&self,
379359
sp: S,
@@ -384,17 +364,13 @@ impl Session {
384364
}
385365
// FIXME: This method should be removed (every error should have an associated error code).
386366
#[rustc_lint_diagnostics]
387-
#[allow(rustc::untranslatable_diagnostic)]
388-
#[allow(rustc::diagnostic_outside_of_impl)]
389367
pub fn struct_err(
390368
&self,
391369
msg: impl Into<DiagnosticMessage>,
392370
) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
393371
self.parse_sess.struct_err(msg)
394372
}
395373
#[rustc_lint_diagnostics]
396-
#[allow(rustc::untranslatable_diagnostic)]
397-
#[allow(rustc::diagnostic_outside_of_impl)]
398374
pub fn struct_err_with_code(
399375
&self,
400376
msg: impl Into<DiagnosticMessage>,
@@ -403,8 +379,6 @@ impl Session {
403379
self.diagnostic().struct_err_with_code(msg, code)
404380
}
405381
#[rustc_lint_diagnostics]
406-
#[allow(rustc::untranslatable_diagnostic)]
407-
#[allow(rustc::diagnostic_outside_of_impl)]
408382
pub fn struct_warn_with_code(
409383
&self,
410384
msg: impl Into<DiagnosticMessage>,
@@ -413,8 +387,6 @@ impl Session {
413387
self.diagnostic().struct_warn_with_code(msg, code)
414388
}
415389
#[rustc_lint_diagnostics]
416-
#[allow(rustc::untranslatable_diagnostic)]
417-
#[allow(rustc::diagnostic_outside_of_impl)]
418390
pub fn struct_span_fatal<S: Into<MultiSpan>>(
419391
&self,
420392
sp: S,
@@ -423,8 +395,6 @@ impl Session {
423395
self.diagnostic().struct_span_fatal(sp, msg)
424396
}
425397
#[rustc_lint_diagnostics]
426-
#[allow(rustc::untranslatable_diagnostic)]
427-
#[allow(rustc::diagnostic_outside_of_impl)]
428398
pub fn struct_span_fatal_with_code<S: Into<MultiSpan>>(
429399
&self,
430400
sp: S,
@@ -434,21 +404,15 @@ impl Session {
434404
self.diagnostic().struct_span_fatal_with_code(sp, msg, code)
435405
}
436406
#[rustc_lint_diagnostics]
437-
#[allow(rustc::untranslatable_diagnostic)]
438-
#[allow(rustc::diagnostic_outside_of_impl)]
439407
pub fn struct_fatal(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, !> {
440408
self.diagnostic().struct_fatal(msg)
441409
}
442410

443411
#[rustc_lint_diagnostics]
444-
#[allow(rustc::untranslatable_diagnostic)]
445-
#[allow(rustc::diagnostic_outside_of_impl)]
446412
pub fn span_fatal<S: Into<MultiSpan>>(&self, sp: S, msg: impl Into<DiagnosticMessage>) -> ! {
447413
self.diagnostic().span_fatal(sp, msg)
448414
}
449415
#[rustc_lint_diagnostics]
450-
#[allow(rustc::untranslatable_diagnostic)]
451-
#[allow(rustc::diagnostic_outside_of_impl)]
452416
pub fn span_fatal_with_code<S: Into<MultiSpan>>(
453417
&self,
454418
sp: S,
@@ -458,14 +422,10 @@ impl Session {
458422
self.diagnostic().span_fatal_with_code(sp, msg, code)
459423
}
460424
#[rustc_lint_diagnostics]
461-
#[allow(rustc::untranslatable_diagnostic)]
462-
#[allow(rustc::diagnostic_outside_of_impl)]
463425
pub fn fatal(&self, msg: impl Into<DiagnosticMessage>) -> ! {
464426
self.diagnostic().fatal(msg).raise()
465427
}
466428
#[rustc_lint_diagnostics]
467-
#[allow(rustc::untranslatable_diagnostic)]
468-
#[allow(rustc::diagnostic_outside_of_impl)]
469429
pub fn span_err_or_warn<S: Into<MultiSpan>>(
470430
&self,
471431
is_warning: bool,
@@ -479,8 +439,6 @@ impl Session {
479439
}
480440
}
481441
#[rustc_lint_diagnostics]
482-
#[allow(rustc::untranslatable_diagnostic)]
483-
#[allow(rustc::diagnostic_outside_of_impl)]
484442
pub fn span_err<S: Into<MultiSpan>>(
485443
&self,
486444
sp: S,
@@ -489,8 +447,6 @@ impl Session {
489447
self.diagnostic().span_err(sp, msg)
490448
}
491449
#[rustc_lint_diagnostics]
492-
#[allow(rustc::untranslatable_diagnostic)]
493-
#[allow(rustc::diagnostic_outside_of_impl)]
494450
pub fn span_err_with_code<S: Into<MultiSpan>>(
495451
&self,
496452
sp: S,

0 commit comments

Comments
 (0)