1 //~ NOTE not a function
2 //~| NOTE not a foreign function or static
3 //~| NOTE not a function or static
4 //~| NOTE not an `extern` block
5 // This test enumerates as many compiler-builtin ungated attributes as
6 // possible (that is, all the mutually compatible ones), and checks
7 // that we get "expected" (*) warnings for each in the various weird
8 // places that users might put them in the syntax.
10 // (*): The word "expected" is in quotes above because the cases where
11 // warnings are and are not emitted might not match a user's intuition
12 // nor the rustc developers' intent. I am really just trying to
13 // capture today's behavior in a test, not so that it become enshrined
14 // as the absolute behavior going forward, but rather so that we do
15 // not change the behavior in the future without even being *aware* of
16 // the change when it happens.
18 // At the time of authoring, the attributes here are listed in the
19 // order that they occur in `librustc_feature`.
21 // Any builtin attributes that:
23 // - are not stable, or
25 // - could not be included here covering the same cases as the other
26 // attributes without raising an *error* from rustc (note though
27 // that warnings are of course expected)
29 // have their own test case referenced by filename in an inline
32 // The test feeds numeric inputs to each attribute that accepts them
33 // without error. We do this for two reasons: (1.) to exercise how
34 // inputs are handled by each, and (2.) to ease searching for related
35 // occurrences in the source text.
40 #![warn(unused_attributes, unknown_lints)]
41 //~^ NOTE the lint level is defined here
42 //~| NOTE the lint level is defined here
44 // UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES
46 #![warn(x5400)] //~ WARN unknown lint: `x5400`
47 #![allow(x5300)] //~ WARN unknown lint: `x5300`
48 #![forbid(x5200)] //~ WARN unknown lint: `x5200`
49 #![deny(x5100)] //~ WARN unknown lint: `x5100`
50 #![macro_use] // (allowed if no argument; see issue-43160-gating-of-macro_use.rs)
51 // skipping testing of cfg
52 // skipping testing of cfg_attr
53 #![should_panic] //~ WARN `#[should_panic]` only has an effect
54 #![ignore] //~ WARN `#[ignore]` only has an effect on functions
55 #![no_implicit_prelude]
56 #![reexport_test_harness_main = "2900"]
57 // see gated-link-args.rs
58 // see issue-43106-gating-of-macro_escape.rs for crate-level; but non crate-level is below at "2700"
59 // (cannot easily test gating of crate-level #[no_std]; but non crate-level is below at "2600")
60 #![proc_macro_derive()] //~ WARN `#[proc_macro_derive]` only has an effect
62 #![cold] //~ WARN attribute should be applied to a function
63 //~^ WARN this was previously accepted
64 #![link()] //~ WARN attribute should be applied to an `extern` block
65 //~^ WARN this was previously accepted
66 #![link_name = "1900"]
67 //~^ WARN attribute should be applied to a foreign function
68 //~^^ WARN this was previously accepted by the compiler
69 #![link_section = "1800"]
70 //~^ WARN attribute should be applied to a function or static
71 //~^^ WARN this was previously accepted by the compiler
73 //~^ WARN `#[must_use]` has no effect
74 // see issue-43106-gating-of-stable.rs
75 // see issue-43106-gating-of-unstable.rs
76 // see issue-43106-gating-of-deprecated.rs
77 #![windows_subsystem = "windows"]
79 // UNGATED CRATE-LEVEL BUILT-IN ATTRIBUTES
81 #![crate_name = "0900"]
82 #![crate_type = "bin"] // cannot pass "0800" here
85 //~^ WARN use of deprecated attribute
86 //~| HELP remove this attribute
87 //~| NOTE `#[warn(deprecated)]` on by default
89 // FIXME(#44232) we should warn that this isn't used.
91 //~^ WARN no longer requires an attribute to enable
92 //~| NOTE `#[warn(stable_features)]` on by default
95 //~^ WARN use of deprecated attribute
96 //~| HELP remove this attribute
98 // (cannot easily gating state of crate-level #[no_main]; but non crate-level is below at "0400")
100 #![recursion_limit = "0200"]
101 #![type_length_limit = "0100"]
103 // USES OF BUILT-IN ATTRIBUTES IN OTHER ("UNUSUAL") PLACES
106 //~^ WARN unknown lint: `x5400`
108 mod inner { #![warn(x5400)] }
109 //~^ WARN unknown lint: `x5400`
111 #[warn(x5400)] fn f() { }
112 //~^ WARN unknown lint: `x5400`
114 #[warn(x5400)] struct S;
115 //~^ WARN unknown lint: `x5400`
117 #[warn(x5400)] type T = S;
118 //~^ WARN unknown lint: `x5400`
120 #[warn(x5400)] impl S { }
121 //~^ WARN unknown lint: `x5400`
125 //~^ WARN unknown lint: `x5300`
127 mod inner { #![allow(x5300)] }
128 //~^ WARN unknown lint: `x5300`
130 #[allow(x5300)] fn f() { }
131 //~^ WARN unknown lint: `x5300`
133 #[allow(x5300)] struct S;
134 //~^ WARN unknown lint: `x5300`
136 #[allow(x5300)] type T = S;
137 //~^ WARN unknown lint: `x5300`
139 #[allow(x5300)] impl S { }
140 //~^ WARN unknown lint: `x5300`
144 //~^ WARN unknown lint: `x5200`
146 mod inner { #![forbid(x5200)] }
147 //~^ WARN unknown lint: `x5200`
149 #[forbid(x5200)] fn f() { }
150 //~^ WARN unknown lint: `x5200`
152 #[forbid(x5200)] struct S;
153 //~^ WARN unknown lint: `x5200`
155 #[forbid(x5200)] type T = S;
156 //~^ WARN unknown lint: `x5200`
158 #[forbid(x5200)] impl S { }
159 //~^ WARN unknown lint: `x5200`
163 //~^ WARN unknown lint: `x5100`
165 mod inner { #![deny(x5100)] }
166 //~^ WARN unknown lint: `x5100`
168 #[deny(x5100)] fn f() { }
169 //~^ WARN unknown lint: `x5100`
171 #[deny(x5100)] struct S;
172 //~^ WARN unknown lint: `x5100`
174 #[deny(x5100)] type T = S;
175 //~^ WARN unknown lint: `x5100`
177 #[deny(x5100)] impl S { }
178 //~^ WARN unknown lint: `x5100`
183 mod inner { #![macro_use] }
185 #[macro_use] fn f() { }
186 //~^ `#[macro_use]` only has an effect
188 #[macro_use] struct S;
189 //~^ `#[macro_use]` only has an effect
191 #[macro_use] type T = S;
192 //~^ `#[macro_use]` only has an effect
194 #[macro_use] impl S { }
195 //~^ `#[macro_use]` only has an effect
199 //~^ WARN `#[macro_export]` only has an effect on macro definitions
201 mod inner { #![macro_export] }
202 //~^ WARN `#[macro_export]` only has an effect on macro definitions
204 #[macro_export] fn f() { }
205 //~^ WARN `#[macro_export]` only has an effect on macro definitions
207 #[macro_export] struct S;
208 //~^ WARN `#[macro_export]` only has an effect on macro definitions
210 #[macro_export] type T = S;
211 //~^ WARN `#[macro_export]` only has an effect on macro definitions
213 #[macro_export] impl S { }
214 //~^ WARN `#[macro_export]` only has an effect on macro definitions
217 // At time of unit test authorship, if compiling without `--test` then
218 // non-crate-level #[test] attributes seem to be ignored.
221 mod test { mod inner { #![test] }
232 // At time of unit test authorship, if compiling without `--test` then
233 // non-crate-level #[bench] attributes seem to be ignored.
237 mod inner { #![bench] }
251 mod inner { #![path="3800"] }
253 #[path = "3800"] fn f() { }
254 //~^ WARN `#[path]` only has an effect
256 #[path = "3800"] struct S;
257 //~^ WARN `#[path]` only has an effect
259 #[path = "3800"] type T = S;
260 //~^ WARN `#[path]` only has an effect
262 #[path = "3800"] impl S { }
263 //~^ WARN `#[path]` only has an effect
266 #[automatically_derived]
267 //~^ WARN `#[automatically_derived]` only has an effect
268 mod automatically_derived {
269 mod inner { #![automatically_derived] }
270 //~^ WARN `#[automatically_derived]
272 #[automatically_derived] fn f() { }
273 //~^ WARN `#[automatically_derived]
275 #[automatically_derived] struct S;
276 //~^ WARN `#[automatically_derived]
278 #[automatically_derived] type T = S;
279 //~^ WARN `#[automatically_derived]
281 #[automatically_derived] impl S { }
285 //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
286 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
288 //~^ NOTE not a free function, impl method or static
289 mod inner { #![no_mangle] }
290 //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
291 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
292 //~| NOTE not a free function, impl method or static
294 #[no_mangle] fn f() { }
296 #[no_mangle] struct S;
297 //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
298 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
299 //~| NOTE not a free function, impl method or static
301 #[no_mangle] type T = S;
302 //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
303 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
304 //~| NOTE not a free function, impl method or static
306 #[no_mangle] impl S { }
307 //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
308 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
309 //~| NOTE not a free function, impl method or static
312 #[no_mangle] fn foo();
313 //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
314 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
315 //~| NOTE not a free function, impl method or static
317 #[no_mangle] fn bar() {}
318 //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
319 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
320 //~| NOTE not a free function, impl method or static
325 //~^ WARN `#[should_panic]` only has an effect on
327 mod inner { #![should_panic] }
328 //~^ WARN `#[should_panic]` only has an effect on
330 #[should_panic] fn f() { }
332 #[should_panic] struct S;
333 //~^ WARN `#[should_panic]` only has an effect on
335 #[should_panic] type T = S;
336 //~^ WARN `#[should_panic]` only has an effect on
338 #[should_panic] impl S { }
339 //~^ WARN `#[should_panic]` only has an effect on
343 //~^ WARN `#[ignore]` only has an effect on functions
345 mod inner { #![ignore] }
346 //~^ WARN `#[ignore]` only has an effect on functions
351 //~^ WARN `#[ignore]` only has an effect on functions
353 #[ignore] type T = S;
354 //~^ WARN `#[ignore]` only has an effect on functions
357 //~^ WARN `#[ignore]` only has an effect on functions
360 #[no_implicit_prelude]
361 mod no_implicit_prelude {
362 mod inner { #![no_implicit_prelude] }
364 #[no_implicit_prelude] fn f() { }
365 //~^ WARN `#[no_implicit_prelude]` only has an effect
367 #[no_implicit_prelude] struct S;
368 //~^ WARN `#[no_implicit_prelude]` only has an effect
370 #[no_implicit_prelude] type T = S;
371 //~^ WARN `#[no_implicit_prelude]` only has an effect
373 #[no_implicit_prelude] impl S { }
374 //~^ WARN `#[no_implicit_prelude]` only has an effect
377 #[reexport_test_harness_main = "2900"]
378 //~^ WARN crate-level attribute should be
379 mod reexport_test_harness_main {
380 mod inner { #![reexport_test_harness_main="2900"] }
381 //~^ WARN crate-level attribute should be
383 #[reexport_test_harness_main = "2900"] fn f() { }
384 //~^ WARN crate-level attribute should be
386 #[reexport_test_harness_main = "2900"] struct S;
387 //~^ WARN crate-level attribute should be
389 #[reexport_test_harness_main = "2900"] type T = S;
390 //~^ WARN crate-level attribute should be
392 #[reexport_test_harness_main = "2900"] impl S { }
393 //~^ WARN crate-level attribute should be
396 // Cannot feed "2700" to `#[macro_escape]` without signaling an error.
398 //~^ WARN `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
400 mod inner { #![macro_escape] }
401 //~^ WARN `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
402 //~| HELP try an outer attribute: `#[macro_use]`
404 #[macro_escape] fn f() { }
405 //~^ WARN `#[macro_escape]` only has an effect
407 #[macro_escape] struct S;
408 //~^ WARN `#[macro_escape]` only has an effect
410 #[macro_escape] type T = S;
411 //~^ WARN `#[macro_escape]` only has an effect
413 #[macro_escape] impl S { }
414 //~^ WARN `#[macro_escape]` only has an effect
418 //~^ WARN crate-level attribute should be an inner attribute
420 mod inner { #![no_std] }
421 //~^ WARN crate-level attribute should be in the root module
424 //~^ WARN crate-level attribute should be an inner attribute
427 //~^ WARN crate-level attribute should be an inner attribute
429 #[no_std] type T = S;
430 //~^ WARN crate-level attribute should be an inner attribute
433 //~^ WARN crate-level attribute should be an inner attribute
436 // At time of authorship, #[proc_macro_derive = "2500"] signals error
437 // when it occurs on a mod (apart from crate-level). Therefore it goes
438 // into its own file; see issue-43106-gating-of-proc_macro_derive.rs
442 mod inner { #![doc="2400"] }
444 #[doc = "2400"] fn f() { }
446 #[doc = "2400"] struct S;
448 #[doc = "2400"] type T = S;
450 #[doc = "2400"] impl S { }
454 //~^ WARN attribute should be applied to a function
455 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
457 //~^ NOTE not a function
459 mod inner { #![cold] }
460 //~^ WARN attribute should be applied to a function
461 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
462 //~| NOTE not a function
467 //~^ WARN attribute should be applied to a function
468 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
469 //~| NOTE not a function
472 //~^ WARN attribute should be applied to a function
473 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
474 //~| NOTE not a function
477 //~^ WARN attribute should be applied to a function
478 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
479 //~| NOTE not a function
482 #[link_name = "1900"]
483 //~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
484 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
486 //~^ NOTE not a foreign function or static
488 #[link_name = "1900"]
489 //~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
490 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
491 //~| HELP try `#[link(name = "1900")]` instead
493 //~^ NOTE not a foreign function or static
495 mod inner { #![link_name="1900"] }
496 //~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
497 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
498 //~| NOTE not a foreign function or static
500 #[link_name = "1900"] fn f() { }
501 //~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
502 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
503 //~| NOTE not a foreign function or static
505 #[link_name = "1900"] struct S;
506 //~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
507 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
508 //~| NOTE not a foreign function or static
510 #[link_name = "1900"] type T = S;
511 //~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
512 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
513 //~| NOTE not a foreign function or static
515 #[link_name = "1900"] impl S { }
516 //~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
517 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
518 //~| NOTE not a foreign function or static
521 #[link_section = "1800"]
522 //~^ WARN attribute should be applied to a function or static [unused_attributes]
523 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
525 //~^ NOTE not a function or static
527 mod inner { #![link_section="1800"] }
528 //~^ WARN attribute should be applied to a function or static [unused_attributes]
529 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
530 //~| NOTE not a function or static
532 #[link_section = "1800"] fn f() { }
534 #[link_section = "1800"] struct S;
535 //~^ WARN attribute should be applied to a function or static [unused_attributes]
536 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
537 //~| NOTE not a function or static
539 #[link_section = "1800"] type T = S;
540 //~^ WARN attribute should be applied to a function or static [unused_attributes]
541 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
542 //~| NOTE not a function or static
544 #[link_section = "1800"] impl S { }
545 //~^ WARN attribute should be applied to a function or static [unused_attributes]
546 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
547 //~| NOTE not a function or static
551 // Note that this is a `check-pass` test, so it will never invoke the linker.
554 //~^ WARN attribute should be applied to an `extern` block
555 //~| WARN this was previously accepted
557 //~^ NOTE not an `extern` block
559 mod inner { #![link()] }
560 //~^ WARN attribute should be applied to an `extern` block
561 //~| WARN this was previously accepted
562 //~| NOTE not an `extern` block
565 //~^ WARN attribute should be applied to an `extern` block
566 //~| WARN this was previously accepted
567 //~| NOTE not an `extern` block
570 //~^ WARN attribute should be applied to an `extern` block
571 //~| WARN this was previously accepted
572 //~| NOTE not an `extern` block
574 #[link()] type T = S;
575 //~^ WARN attribute should be applied to an `extern` block
576 //~| WARN this was previously accepted
577 //~| NOTE not an `extern` block
580 //~^ WARN attribute should be applied to an `extern` block
581 //~| WARN this was previously accepted
582 //~| NOTE not an `extern` block
584 #[link()] extern "Rust" {}
585 //~^ WARN attribute should be applied to an `extern` block
586 //~| WARN this was previously accepted
589 struct StructForDeprecated;
593 mod inner { #![deprecated] }
595 #[deprecated] fn f() { }
597 #[deprecated] struct S1;
599 #[deprecated] type T = super::StructForDeprecated;
601 #[deprecated] impl super::StructForDeprecated { }
604 #[must_use] //~ WARN `#[must_use]` has no effect
606 mod inner { #![must_use] } //~ WARN `#[must_use]` has no effect
608 #[must_use] fn f() { }
610 #[must_use] struct S;
612 #[must_use] type T = S; //~ WARN `#[must_use]` has no effect
614 #[must_use] impl S { } //~ WARN `#[must_use]` has no effect
617 #[windows_subsystem = "windows"]
618 //~^ WARN crate-level attribute should be an inner attribute
619 mod windows_subsystem {
620 mod inner { #![windows_subsystem="windows"] }
621 //~^ WARN crate-level attribute should be in the root module
623 #[windows_subsystem = "windows"] fn f() { }
624 //~^ WARN crate-level attribute should be an inner attribute
626 #[windows_subsystem = "windows"] struct S;
627 //~^ WARN crate-level attribute should be an inner attribute
629 #[windows_subsystem = "windows"] type T = S;
630 //~^ WARN crate-level attribute should be an inner attribute
632 #[windows_subsystem = "windows"] impl S { }
633 //~^ WARN crate-level attribute should be an inner attribute
636 // BROKEN USES OF CRATE-LEVEL BUILT-IN ATTRIBUTES
638 #[crate_name = "0900"]
639 //~^ WARN crate-level attribute should be an inner attribute
641 mod inner { #![crate_name="0900"] }
642 //~^ WARN crate-level attribute should be in the root module
644 #[crate_name = "0900"] fn f() { }
645 //~^ WARN crate-level attribute should be an inner attribute
647 #[crate_name = "0900"] struct S;
648 //~^ WARN crate-level attribute should be an inner attribute
650 #[crate_name = "0900"] type T = S;
651 //~^ WARN crate-level attribute should be an inner attribute
653 #[crate_name = "0900"] impl S { }
654 //~^ WARN crate-level attribute should be an inner attribute
657 #[crate_type = "0800"]
658 //~^ WARN crate-level attribute should be an inner attribute
660 mod inner { #![crate_type="0800"] }
661 //~^ WARN crate-level attribute should be in the root module
663 #[crate_type = "0800"] fn f() { }
664 //~^ WARN crate-level attribute should be an inner attribute
666 #[crate_type = "0800"] struct S;
667 //~^ WARN crate-level attribute should be an inner attribute
669 #[crate_type = "0800"] type T = S;
670 //~^ WARN crate-level attribute should be an inner attribute
672 #[crate_type = "0800"] impl S { }
673 //~^ WARN crate-level attribute should be an inner attribute
677 //~^ WARN crate-level attribute should be an inner attribute
679 mod inner { #![feature(x0600)] }
680 //~^ WARN crate-level attribute should be in the root module
682 #[feature(x0600)] fn f() { }
683 //~^ WARN crate-level attribute should be an inner attribute
685 #[feature(x0600)] struct S;
686 //~^ WARN crate-level attribute should be an inner attribute
688 #[feature(x0600)] type T = S;
689 //~^ WARN crate-level attribute should be an inner attribute
691 #[feature(x0600)] impl S { }
692 //~^ WARN crate-level attribute should be an inner attribute
697 //~^ WARN crate-level attribute should be an inner attribute
699 mod inner { #![no_main] }
700 //~^ WARN crate-level attribute should be in the root module
702 #[no_main] fn f() { }
703 //~^ WARN crate-level attribute should be an inner attribute
706 //~^ WARN crate-level attribute should be an inner attribute
708 #[no_main] type T = S;
709 //~^ WARN crate-level attribute should be an inner attribute
711 #[no_main] impl S { }
712 //~^ WARN crate-level attribute should be an inner attribute
716 //~^ WARN crate-level attribute should be an inner attribute
718 mod inner { #![no_builtins] }
719 //~^ WARN crate-level attribute should be in the root module
721 #[no_builtins] fn f() { }
722 //~^ WARN crate-level attribute should be an inner attribute
724 #[no_builtins] struct S;
725 //~^ WARN crate-level attribute should be an inner attribute
727 #[no_builtins] type T = S;
728 //~^ WARN crate-level attribute should be an inner attribute
730 #[no_builtins] impl S { }
731 //~^ WARN crate-level attribute should be an inner attribute
734 #[recursion_limit="0200"]
735 //~^ WARN crate-level attribute should be an inner attribute
736 mod recursion_limit {
737 mod inner { #![recursion_limit="0200"] }
738 //~^ WARN crate-level attribute should be in the root module
740 #[recursion_limit="0200"] fn f() { }
741 //~^ WARN crate-level attribute should be an inner attribute
743 #[recursion_limit="0200"] struct S;
744 //~^ WARN crate-level attribute should be an inner attribute
746 #[recursion_limit="0200"] type T = S;
747 //~^ WARN crate-level attribute should be an inner attribute
749 #[recursion_limit="0200"] impl S { }
750 //~^ WARN crate-level attribute should be an inner attribute
753 #[type_length_limit="0100"]
754 //~^ WARN crate-level attribute should be an inner attribute
755 mod type_length_limit {
756 mod inner { #![type_length_limit="0100"] }
757 //~^ WARN crate-level attribute should be in the root module
759 #[type_length_limit="0100"] fn f() { }
760 //~^ WARN crate-level attribute should be an inner attribute
762 #[type_length_limit="0100"] struct S;
763 //~^ WARN crate-level attribute should be an inner attribute
765 #[type_length_limit="0100"] type T = S;
766 //~^ WARN crate-level attribute should be an inner attribute
768 #[type_length_limit="0100"] impl S { }
769 //~^ WARN crate-level attribute should be an inner attribute