@@ -300,212 +300,184 @@ error: derive(Diagnostic): no nested attribute expected here
300300LL | #[label("with a label", foo("..."))]
301301 | ^^^
302302
303- error: derive(Diagnostic): `#[primary_span]` is not a valid attribute
304- --> $DIR/diagnostic-derive-inline.rs:505:5
305- |
306- LL | #[primary_span]
307- | ^
308- |
309- = help: the `primary_span` field attribute is not valid for lint diagnostics
310-
311303error: derive(Diagnostic): `#[error(...)]` is not a valid attribute
312- --> $DIR/diagnostic-derive-inline.rs:525 :1
304+ --> $DIR/diagnostic-derive-inline.rs:513 :1
313305 |
314306LL | #[error("this is an example message", code = E0123)]
315307 | ^
316308
317309error: derive(Diagnostic): diagnostic message not specified
318- --> $DIR/diagnostic-derive-inline.rs:525 :1
310+ --> $DIR/diagnostic-derive-inline.rs:513 :1
319311 |
320312LL | #[error("this is an example message", code = E0123)]
321313 | ^
322314 |
323315 = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
324316
325317error: derive(Diagnostic): `#[warn_(...)]` is not a valid attribute
326- --> $DIR/diagnostic-derive-inline.rs:532 :1
318+ --> $DIR/diagnostic-derive-inline.rs:520 :1
327319 |
328320LL | #[warn_("this is an example message", code = E0123)]
329321 | ^
330322
331323error: derive(Diagnostic): diagnostic message not specified
332- --> $DIR/diagnostic-derive-inline.rs:532 :1
324+ --> $DIR/diagnostic-derive-inline.rs:520 :1
333325 |
334326LL | #[warn_("this is an example message", code = E0123)]
335327 | ^
336328 |
337329 = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
338330
339331error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
340- --> $DIR/diagnostic-derive-inline.rs:539:1
341- |
342- LL | #[lint("this is an example message", code = E0123)]
343- | ^
344-
345- error: derive(Diagnostic): diagnostic message not specified
346- --> $DIR/diagnostic-derive-inline.rs:539:1
347- |
348- LL | #[lint("this is an example message", code = E0123)]
349- | ^
350- |
351- = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
352-
353- error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
354- --> $DIR/diagnostic-derive-inline.rs:546:1
332+ --> $DIR/diagnostic-derive-inline.rs:527:1
355333 |
356334LL | #[lint("this is an example message", code = E0123)]
357335 | ^
358336
359337error: derive(Diagnostic): diagnostic message not specified
360- --> $DIR/diagnostic-derive-inline.rs:546 :1
338+ --> $DIR/diagnostic-derive-inline.rs:527 :1
361339 |
362340LL | #[lint("this is an example message", code = E0123)]
363341 | ^
364342 |
365343 = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`
366344
367345error: derive(Diagnostic): attribute specified multiple times
368- --> $DIR/diagnostic-derive-inline.rs:555 :53
346+ --> $DIR/diagnostic-derive-inline.rs:536 :53
369347 |
370348LL | #[suggestion("with a suggestion", code = "...", code = ",,,")]
371349 | ^^^^
372350 |
373351note: previously specified here
374- --> $DIR/diagnostic-derive-inline.rs:555 :39
352+ --> $DIR/diagnostic-derive-inline.rs:536 :39
375353 |
376354LL | #[suggestion("with a suggestion", code = "...", code = ",,,")]
377355 | ^^^^
378356
379357error: derive(Diagnostic): wrong types for suggestion
380- --> $DIR/diagnostic-derive-inline.rs:564 :24
358+ --> $DIR/diagnostic-derive-inline.rs:545 :24
381359 |
382360LL | suggestion: (Span, usize),
383361 | ^^^^^
384362 |
385363 = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
386364
387365error: derive(Diagnostic): wrong types for suggestion
388- --> $DIR/diagnostic-derive-inline.rs:572 :17
366+ --> $DIR/diagnostic-derive-inline.rs:553 :17
389367 |
390368LL | suggestion: (Span,),
391369 | ^^^^^^^
392370 |
393371 = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
394372
395373error: derive(Diagnostic): suggestion without `code = "..."`
396- --> $DIR/diagnostic-derive-inline.rs:579 :5
374+ --> $DIR/diagnostic-derive-inline.rs:560 :5
397375 |
398376LL | #[suggestion("with a suggestion")]
399377 | ^
400378
401379error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
402- --> $DIR/diagnostic-derive-inline.rs:586 :1
380+ --> $DIR/diagnostic-derive-inline.rs:567 :1
403381 |
404382LL | #[multipart_suggestion("with a suggestion")]
405383 | ^
406384 |
407385 = help: consider creating a `Subdiagnostic` instead
408386
409387error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
410- --> $DIR/diagnostic-derive-inline.rs:589 :1
388+ --> $DIR/diagnostic-derive-inline.rs:570 :1
411389 |
412390LL | #[multipart_suggestion()]
413391 | ^
414392 |
415393 = help: consider creating a `Subdiagnostic` instead
416394
417395error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
418- --> $DIR/diagnostic-derive-inline.rs:593 :5
396+ --> $DIR/diagnostic-derive-inline.rs:574 :5
419397 |
420398LL | #[multipart_suggestion("with a suggestion")]
421399 | ^
422400 |
423401 = help: consider creating a `Subdiagnostic` instead
424402
425403error: derive(Diagnostic): `#[suggestion(...)]` is not a valid attribute
426- --> $DIR/diagnostic-derive-inline.rs:601 :1
404+ --> $DIR/diagnostic-derive-inline.rs:582 :1
427405 |
428406LL | #[suggestion("with a suggestion", code = "...")]
429407 | ^
430408 |
431409 = help: `#[label]` and `#[suggestion]` can only be applied to fields
432410
433411error: derive(Diagnostic): `#[label]` is not a valid attribute
434- --> $DIR/diagnostic-derive-inline.rs:610 :1
412+ --> $DIR/diagnostic-derive-inline.rs:591 :1
435413 |
436414LL | #[label]
437415 | ^
438416 |
439417 = help: subdiagnostic message is missing
440418
441419error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
442- --> $DIR/diagnostic-derive-inline.rs:644 :5
420+ --> $DIR/diagnostic-derive-inline.rs:625 :5
443421 |
444422LL | #[subdiagnostic(bad)]
445423 | ^
446424
447425error: derive(Diagnostic): `#[subdiagnostic = ...]` is not a valid attribute
448- --> $DIR/diagnostic-derive-inline.rs:652 :5
426+ --> $DIR/diagnostic-derive-inline.rs:633 :5
449427 |
450428LL | #[subdiagnostic = "bad"]
451429 | ^
452430
453431error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
454- --> $DIR/diagnostic-derive-inline.rs:660 :5
432+ --> $DIR/diagnostic-derive-inline.rs:641 :5
455433 |
456434LL | #[subdiagnostic(bad, bad)]
457435 | ^
458436
459437error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
460- --> $DIR/diagnostic-derive-inline.rs:668 :5
438+ --> $DIR/diagnostic-derive-inline.rs:649 :5
461439 |
462440LL | #[subdiagnostic("bad")]
463441 | ^
464442
465443error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
466- --> $DIR/diagnostic-derive-inline.rs:676 :5
444+ --> $DIR/diagnostic-derive-inline.rs:657 :5
467445 |
468446LL | #[subdiagnostic(eager)]
469447 | ^
470448
471449error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
472- --> $DIR/diagnostic-derive-inline.rs:684:5
473- |
474- LL | #[subdiagnostic(eager)]
475- | ^
476-
477- error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
478- --> $DIR/diagnostic-derive-inline.rs:705:5
450+ --> $DIR/diagnostic-derive-inline.rs:678:5
479451 |
480452LL | #[subdiagnostic(eager)]
481453 | ^
482454
483455error: derive(Diagnostic): expected at least one string literal for `code(...)`
484- --> $DIR/diagnostic-derive-inline.rs:736 :44
456+ --> $DIR/diagnostic-derive-inline.rs:709 :44
485457 |
486458LL | #[suggestion("with a suggestion", code())]
487459 | ^
488460
489461error: derive(Diagnostic): `code(...)` must contain only string literals
490- --> $DIR/diagnostic-derive-inline.rs:744 :44
462+ --> $DIR/diagnostic-derive-inline.rs:717 :44
491463 |
492464LL | #[suggestion("with a suggestion", code(foo))]
493465 | ^^^
494466
495467error: unexpected token, expected `)`
496- --> $DIR/diagnostic-derive-inline.rs:744 :44
468+ --> $DIR/diagnostic-derive-inline.rs:717 :44
497469 |
498470LL | #[suggestion("with a suggestion", code(foo))]
499471 | ^^^
500472
501473error: expected string literal
502- --> $DIR/diagnostic-derive-inline.rs:753 :46
474+ --> $DIR/diagnostic-derive-inline.rs:726 :46
503475 |
504476LL | #[suggestion("with a suggestion", code = 3)]
505477 | ^
506478
507479error: derive(Diagnostic): `#[suggestion(...)]` is not a valid attribute
508- --> $DIR/diagnostic-derive-inline.rs:768 :5
480+ --> $DIR/diagnostic-derive-inline.rs:741 :5
509481 |
510482LL | #[suggestion("with a suggestion", code = "")]
511483 | ^
@@ -515,7 +487,7 @@ LL | #[suggestion("with a suggestion", code = "")]
515487 = help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]`
516488
517489error: derive(Diagnostic): Variable `nosub` not found in diagnostic
518- --> $DIR/diagnostic-derive-inline.rs:780 :8
490+ --> $DIR/diagnostic-derive-inline.rs:753 :8
519491 |
520492LL | #[diag("does not exist: {$nosub}")]
521493 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -535,7 +507,7 @@ LL | #[nonsense]
535507 | ^^^^^^^^
536508
537509error: cannot find attribute `error` in this scope
538- --> $DIR/diagnostic-derive-inline.rs:525 :3
510+ --> $DIR/diagnostic-derive-inline.rs:513 :3
539511 |
540512LL | #[error("this is an example message", code = E0123)]
541513 | ^^^^^
@@ -547,7 +519,7 @@ LL | struct ErrorAttribute {}
547519 |
548520
549521error: cannot find attribute `warn_` in this scope
550- --> $DIR/diagnostic-derive-inline.rs:532 :3
522+ --> $DIR/diagnostic-derive-inline.rs:520 :3
551523 |
552524LL | #[warn_("this is an example message", code = E0123)]
553525 | ^^^^^
@@ -559,19 +531,7 @@ LL + #[warn("this is an example message", code = E0123)]
559531 |
560532
561533error: cannot find attribute `lint` in this scope
562- --> $DIR/diagnostic-derive-inline.rs:539:3
563- |
564- LL | #[lint("this is an example message", code = E0123)]
565- | ^^^^
566- |
567- help: a built-in attribute with a similar name exists
568- |
569- LL - #[lint("this is an example message", code = E0123)]
570- LL + #[link("this is an example message", code = E0123)]
571- |
572-
573- error: cannot find attribute `lint` in this scope
574- --> $DIR/diagnostic-derive-inline.rs:546:3
534+ --> $DIR/diagnostic-derive-inline.rs:527:3
575535 |
576536LL | #[lint("this is an example message", code = E0123)]
577537 | ^^^^
@@ -583,7 +543,7 @@ LL + #[link("this is an example message", code = E0123)]
583543 |
584544
585545error: cannot find attribute `multipart_suggestion` in this scope
586- --> $DIR/diagnostic-derive-inline.rs:586 :3
546+ --> $DIR/diagnostic-derive-inline.rs:567 :3
587547 |
588548LL | #[multipart_suggestion("with a suggestion")]
589549 | ^^^^^^^^^^^^^^^^^^^^
@@ -595,7 +555,7 @@ LL | struct MultipartSuggestion {
595555 |
596556
597557error: cannot find attribute `multipart_suggestion` in this scope
598- --> $DIR/diagnostic-derive-inline.rs:589 :3
558+ --> $DIR/diagnostic-derive-inline.rs:570 :3
599559 |
600560LL | #[multipart_suggestion()]
601561 | ^^^^^^^^^^^^^^^^^^^^
@@ -607,7 +567,7 @@ LL | struct MultipartSuggestion {
607567 |
608568
609569error: cannot find attribute `multipart_suggestion` in this scope
610- --> $DIR/diagnostic-derive-inline.rs:593 :7
570+ --> $DIR/diagnostic-derive-inline.rs:574 :7
611571 |
612572LL | #[multipart_suggestion("with a suggestion")]
613573 | ^^^^^^^^^^^^^^^^^^^^
@@ -636,6 +596,6 @@ note: required by a bound in `Diag::<'a, G>::arg`
636596 = note: in this macro invocation
637597 = note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
638598
639- error: aborting due to 81 previous errors
599+ error: aborting due to 76 previous errors
640600
641601For more information about this error, try `rustc --explain E0277`.
0 commit comments