2020-10-03 13:45:39 -05:00
|
|
|
//~ NOTE not a function
|
2022-01-09 13:28:40 -06:00
|
|
|
//~| NOTE not a foreign function or static
|
2022-11-04 11:04:47 -05:00
|
|
|
//~| NOTE cannot be applied to crates
|
2022-01-09 13:28:40 -06:00
|
|
|
//~| NOTE not an `extern` block
|
2017-07-11 07:30:10 -05:00
|
|
|
// This test enumerates as many compiler-builtin ungated attributes as
|
|
|
|
// possible (that is, all the mutually compatible ones), and checks
|
|
|
|
// that we get "expected" (*) warnings for each in the various weird
|
|
|
|
// places that users might put them in the syntax.
|
|
|
|
//
|
|
|
|
// (*): The word "expected" is in quotes above because the cases where
|
|
|
|
// warnings are and are not emitted might not match a user's intuition
|
|
|
|
// nor the rustc developers' intent. I am really just trying to
|
|
|
|
// capture today's behavior in a test, not so that it become enshrined
|
|
|
|
// as the absolute behavior going forward, but rather so that we do
|
|
|
|
// not change the behavior in the future without even being *aware* of
|
|
|
|
// the change when it happens.
|
|
|
|
//
|
|
|
|
// At the time of authoring, the attributes here are listed in the
|
2020-01-12 09:51:15 -06:00
|
|
|
// order that they occur in `librustc_feature`.
|
2017-07-11 07:30:10 -05:00
|
|
|
//
|
|
|
|
// Any builtin attributes that:
|
|
|
|
//
|
|
|
|
// - are not stable, or
|
|
|
|
//
|
|
|
|
// - could not be included here covering the same cases as the other
|
|
|
|
// attributes without raising an *error* from rustc (note though
|
|
|
|
// that warnings are of course expected)
|
|
|
|
//
|
|
|
|
// have their own test case referenced by filename in an inline
|
|
|
|
// comment.
|
|
|
|
//
|
|
|
|
// The test feeds numeric inputs to each attribute that accepts them
|
|
|
|
// without error. We do this for two reasons: (1.) to exercise how
|
|
|
|
// inputs are handled by each, and (2.) to ease searching for related
|
|
|
|
// occurrences in the source text.
|
|
|
|
|
2019-06-12 10:18:32 -05:00
|
|
|
// check-pass
|
|
|
|
|
2021-05-14 08:37:53 -05:00
|
|
|
#![feature(test)]
|
2017-07-11 07:30:10 -05:00
|
|
|
#![warn(unused_attributes, unknown_lints)]
|
2020-07-11 09:29:35 -05:00
|
|
|
//~^ NOTE the lint level is defined here
|
|
|
|
//~| NOTE the lint level is defined here
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
// UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#![warn(x5400)] //~ WARN unknown lint: `x5400`
|
|
|
|
#![allow(x5300)] //~ WARN unknown lint: `x5300`
|
|
|
|
#![forbid(x5200)] //~ WARN unknown lint: `x5200`
|
|
|
|
#![deny(x5100)] //~ WARN unknown lint: `x5100`
|
2017-07-11 07:30:10 -05:00
|
|
|
#![macro_use] // (allowed if no argument; see issue-43160-gating-of-macro_use.rs)
|
|
|
|
// skipping testing of cfg
|
|
|
|
// skipping testing of cfg_attr
|
2021-07-29 12:00:41 -05:00
|
|
|
#![should_panic] //~ WARN `#[should_panic]` only has an effect
|
|
|
|
#![ignore] //~ WARN `#[ignore]` only has an effect on functions
|
2019-01-01 17:21:05 -06:00
|
|
|
#![no_implicit_prelude]
|
2017-07-11 07:30:10 -05:00
|
|
|
#![reexport_test_harness_main = "2900"]
|
|
|
|
// see gated-link-args.rs
|
|
|
|
// see issue-43106-gating-of-macro_escape.rs for crate-level; but non crate-level is below at "2700"
|
|
|
|
// (cannot easily test gating of crate-level #[no_std]; but non crate-level is below at "2600")
|
2021-07-29 12:00:41 -05:00
|
|
|
#![proc_macro_derive()] //~ WARN `#[proc_macro_derive]` only has an effect
|
2019-01-01 17:21:05 -06:00
|
|
|
#![doc = "2400"]
|
2020-09-21 09:37:37 -05:00
|
|
|
#![cold] //~ WARN attribute should be applied to a function
|
2022-01-09 13:28:40 -06:00
|
|
|
//~^ WARN this was previously accepted
|
|
|
|
#![link()] //~ WARN attribute should be applied to an `extern` block
|
|
|
|
//~^ WARN this was previously accepted
|
2019-01-01 17:21:05 -06:00
|
|
|
#![link_name = "1900"]
|
2020-09-21 09:37:37 -05:00
|
|
|
//~^ WARN attribute should be applied to a foreign function
|
|
|
|
//~^^ WARN this was previously accepted by the compiler
|
2019-01-01 17:21:05 -06:00
|
|
|
#![link_section = "1800"]
|
2020-09-21 09:37:37 -05:00
|
|
|
//~^ WARN attribute should be applied to a function or static
|
|
|
|
//~^^ WARN this was previously accepted by the compiler
|
2019-01-01 17:21:05 -06:00
|
|
|
#![must_use]
|
2022-02-11 18:21:02 -06:00
|
|
|
//~^ WARN `#[must_use]` has no effect
|
2017-07-11 07:30:10 -05:00
|
|
|
// see issue-43106-gating-of-stable.rs
|
|
|
|
// see issue-43106-gating-of-unstable.rs
|
|
|
|
// see issue-43106-gating-of-deprecated.rs
|
2019-06-12 10:18:32 -05:00
|
|
|
#![windows_subsystem = "windows"]
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
// UNGATED CRATE-LEVEL BUILT-IN ATTRIBUTES
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#![crate_name = "0900"]
|
|
|
|
#![crate_type = "bin"] // cannot pass "0800" here
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2020-07-11 09:29:35 -05:00
|
|
|
#![crate_id = "10"]
|
|
|
|
//~^ WARN use of deprecated attribute
|
|
|
|
//~| HELP remove this attribute
|
2021-05-14 08:37:53 -05:00
|
|
|
//~| NOTE `#[warn(deprecated)]` on by default
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2017-08-31 17:08:34 -05:00
|
|
|
// FIXME(#44232) we should warn that this isn't used.
|
2020-07-11 09:29:35 -05:00
|
|
|
#![feature(rust1)]
|
|
|
|
//~^ WARN no longer requires an attribute to enable
|
|
|
|
//~| NOTE `#[warn(stable_features)]` on by default
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2020-07-11 09:29:35 -05:00
|
|
|
#![no_start]
|
|
|
|
//~^ WARN use of deprecated attribute
|
|
|
|
//~| HELP remove this attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
// (cannot easily gating state of crate-level #[no_main]; but non crate-level is below at "0400")
|
2019-01-01 17:21:05 -06:00
|
|
|
#![no_builtins]
|
|
|
|
#![recursion_limit = "0200"]
|
|
|
|
#![type_length_limit = "0100"]
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
// USES OF BUILT-IN ATTRIBUTES IN OTHER ("UNUSUAL") PLACES
|
|
|
|
|
|
|
|
#[warn(x5400)]
|
|
|
|
//~^ WARN unknown lint: `x5400`
|
|
|
|
mod warn {
|
|
|
|
mod inner { #![warn(x5400)] }
|
|
|
|
//~^ WARN unknown lint: `x5400`
|
|
|
|
|
|
|
|
#[warn(x5400)] fn f() { }
|
|
|
|
//~^ WARN unknown lint: `x5400`
|
|
|
|
|
|
|
|
#[warn(x5400)] struct S;
|
|
|
|
//~^ WARN unknown lint: `x5400`
|
|
|
|
|
|
|
|
#[warn(x5400)] type T = S;
|
|
|
|
//~^ WARN unknown lint: `x5400`
|
|
|
|
|
|
|
|
#[warn(x5400)] impl S { }
|
|
|
|
//~^ WARN unknown lint: `x5400`
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(x5300)]
|
|
|
|
//~^ WARN unknown lint: `x5300`
|
|
|
|
mod allow {
|
|
|
|
mod inner { #![allow(x5300)] }
|
|
|
|
//~^ WARN unknown lint: `x5300`
|
|
|
|
|
|
|
|
#[allow(x5300)] fn f() { }
|
|
|
|
//~^ WARN unknown lint: `x5300`
|
|
|
|
|
|
|
|
#[allow(x5300)] struct S;
|
|
|
|
//~^ WARN unknown lint: `x5300`
|
|
|
|
|
|
|
|
#[allow(x5300)] type T = S;
|
|
|
|
//~^ WARN unknown lint: `x5300`
|
|
|
|
|
|
|
|
#[allow(x5300)] impl S { }
|
|
|
|
//~^ WARN unknown lint: `x5300`
|
|
|
|
}
|
|
|
|
|
|
|
|
#[forbid(x5200)]
|
|
|
|
//~^ WARN unknown lint: `x5200`
|
|
|
|
mod forbid {
|
|
|
|
mod inner { #![forbid(x5200)] }
|
|
|
|
//~^ WARN unknown lint: `x5200`
|
|
|
|
|
|
|
|
#[forbid(x5200)] fn f() { }
|
|
|
|
//~^ WARN unknown lint: `x5200`
|
|
|
|
|
|
|
|
#[forbid(x5200)] struct S;
|
|
|
|
//~^ WARN unknown lint: `x5200`
|
|
|
|
|
|
|
|
#[forbid(x5200)] type T = S;
|
|
|
|
//~^ WARN unknown lint: `x5200`
|
|
|
|
|
|
|
|
#[forbid(x5200)] impl S { }
|
|
|
|
//~^ WARN unknown lint: `x5200`
|
|
|
|
}
|
|
|
|
|
|
|
|
#[deny(x5100)]
|
|
|
|
//~^ WARN unknown lint: `x5100`
|
|
|
|
mod deny {
|
|
|
|
mod inner { #![deny(x5100)] }
|
|
|
|
//~^ WARN unknown lint: `x5100`
|
|
|
|
|
|
|
|
#[deny(x5100)] fn f() { }
|
|
|
|
//~^ WARN unknown lint: `x5100`
|
|
|
|
|
|
|
|
#[deny(x5100)] struct S;
|
|
|
|
//~^ WARN unknown lint: `x5100`
|
|
|
|
|
|
|
|
#[deny(x5100)] type T = S;
|
|
|
|
//~^ WARN unknown lint: `x5100`
|
|
|
|
|
|
|
|
#[deny(x5100)] impl S { }
|
|
|
|
//~^ WARN unknown lint: `x5100`
|
|
|
|
}
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
mod macro_use {
|
|
|
|
mod inner { #![macro_use] }
|
|
|
|
|
|
|
|
#[macro_use] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ `#[macro_use]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[macro_use] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ `#[macro_use]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[macro_use] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ `#[macro_use]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[macro_use] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ `#[macro_use]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[macro_export]
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[macro_export]` only has an effect on macro definitions
|
2017-07-11 07:30:10 -05:00
|
|
|
mod macro_export {
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![macro_export] }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[macro_export]` only has an effect on macro definitions
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[macro_export] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[macro_export]` only has an effect on macro definitions
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[macro_export] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[macro_export]` only has an effect on macro definitions
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[macro_export] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[macro_export]` only has an effect on macro definitions
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[macro_export] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[macro_export]` only has an effect on macro definitions
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// At time of unit test authorship, if compiling without `--test` then
|
|
|
|
// non-crate-level #[test] attributes seem to be ignored.
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[test]
|
|
|
|
mod test { mod inner { #![test] }
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
fn f() { }
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
type T = S;
|
|
|
|
|
|
|
|
impl S { }
|
|
|
|
}
|
|
|
|
|
|
|
|
// At time of unit test authorship, if compiling without `--test` then
|
|
|
|
// non-crate-level #[bench] attributes seem to be ignored.
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[bench]
|
2017-07-11 07:30:10 -05:00
|
|
|
mod bench {
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![bench] }
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[bench]
|
2017-07-11 07:30:10 -05:00
|
|
|
struct S;
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[bench]
|
2017-07-11 07:30:10 -05:00
|
|
|
type T = S;
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[bench]
|
2017-07-11 07:30:10 -05:00
|
|
|
impl S { }
|
|
|
|
}
|
|
|
|
|
|
|
|
#[path = "3800"]
|
|
|
|
mod path {
|
|
|
|
mod inner { #![path="3800"] }
|
|
|
|
|
|
|
|
#[path = "3800"] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[path]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[path = "3800"] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[path]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[path = "3800"] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[path]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[path = "3800"] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[path]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[automatically_derived]
|
2021-08-21 14:11:36 -05:00
|
|
|
//~^ WARN `#[automatically_derived]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
mod automatically_derived {
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![automatically_derived] }
|
2021-08-21 14:11:36 -05:00
|
|
|
//~^ WARN `#[automatically_derived]
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[automatically_derived] fn f() { }
|
2021-08-21 14:11:36 -05:00
|
|
|
//~^ WARN `#[automatically_derived]
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[automatically_derived] struct S;
|
2021-08-21 14:11:36 -05:00
|
|
|
//~^ WARN `#[automatically_derived]
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[automatically_derived] type T = S;
|
2021-08-21 14:11:36 -05:00
|
|
|
//~^ WARN `#[automatically_derived]
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[automatically_derived] impl S { }
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_mangle]
|
2021-08-10 13:41:57 -05:00
|
|
|
//~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
|
2020-09-05 21:12:24 -05:00
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
2017-07-11 07:30:10 -05:00
|
|
|
mod no_mangle {
|
2021-08-10 13:41:57 -05:00
|
|
|
//~^ NOTE not a free function, impl method or static
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![no_mangle] }
|
2021-08-10 13:41:57 -05:00
|
|
|
//~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
|
2020-09-05 21:12:24 -05:00
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
2021-08-10 13:41:57 -05:00
|
|
|
//~| NOTE not a free function, impl method or static
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_mangle] fn f() { }
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_mangle] struct S;
|
2021-08-10 13:41:57 -05:00
|
|
|
//~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
|
2020-09-05 21:12:24 -05:00
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
2021-08-10 13:41:57 -05:00
|
|
|
//~| NOTE not a free function, impl method or static
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_mangle] type T = S;
|
2021-08-10 13:41:57 -05:00
|
|
|
//~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
|
2020-09-05 21:12:24 -05:00
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
2021-08-10 13:41:57 -05:00
|
|
|
//~| NOTE not a free function, impl method or static
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_mangle] impl S { }
|
2021-08-10 13:41:57 -05:00
|
|
|
//~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
|
2020-09-05 21:12:24 -05:00
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
2021-08-10 13:41:57 -05:00
|
|
|
//~| NOTE not a free function, impl method or static
|
|
|
|
|
|
|
|
trait Tr {
|
|
|
|
#[no_mangle] fn foo();
|
|
|
|
//~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a free function, impl method or static
|
|
|
|
|
|
|
|
#[no_mangle] fn bar() {}
|
|
|
|
//~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a free function, impl method or static
|
|
|
|
}
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[should_panic]
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[should_panic]` only has an effect on
|
2017-07-11 07:30:10 -05:00
|
|
|
mod should_panic {
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![should_panic] }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[should_panic]` only has an effect on
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[should_panic] fn f() { }
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[should_panic] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[should_panic]` only has an effect on
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[should_panic] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[should_panic]` only has an effect on
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[should_panic] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[should_panic]` only has an effect on
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[ignore]
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[ignore]` only has an effect on functions
|
2017-07-11 07:30:10 -05:00
|
|
|
mod ignore {
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![ignore] }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[ignore]` only has an effect on functions
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[ignore] fn f() { }
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[ignore] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[ignore]` only has an effect on functions
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[ignore] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[ignore]` only has an effect on functions
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[ignore] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[ignore]` only has an effect on functions
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_implicit_prelude]
|
2017-07-11 07:30:10 -05:00
|
|
|
mod no_implicit_prelude {
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![no_implicit_prelude] }
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_implicit_prelude] fn f() { }
|
2021-08-21 14:11:36 -05:00
|
|
|
//~^ WARN `#[no_implicit_prelude]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_implicit_prelude] struct S;
|
2021-08-21 14:11:36 -05:00
|
|
|
//~^ WARN `#[no_implicit_prelude]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_implicit_prelude] type T = S;
|
2021-08-21 14:11:36 -05:00
|
|
|
//~^ WARN `#[no_implicit_prelude]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_implicit_prelude] impl S { }
|
2021-08-21 14:11:36 -05:00
|
|
|
//~^ WARN `#[no_implicit_prelude]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[reexport_test_harness_main = "2900"]
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be
|
2017-07-11 07:30:10 -05:00
|
|
|
mod reexport_test_harness_main {
|
|
|
|
mod inner { #![reexport_test_harness_main="2900"] }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[reexport_test_harness_main = "2900"] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[reexport_test_harness_main = "2900"] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[reexport_test_harness_main = "2900"] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[reexport_test_harness_main = "2900"] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2018-02-16 08:56:50 -06:00
|
|
|
// Cannot feed "2700" to `#[macro_escape]` without signaling an error.
|
2017-07-11 07:30:10 -05:00
|
|
|
#[macro_escape]
|
2020-01-10 08:57:36 -06:00
|
|
|
//~^ WARN `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
|
2017-07-11 07:30:10 -05:00
|
|
|
mod macro_escape {
|
|
|
|
mod inner { #![macro_escape] }
|
2020-01-10 08:57:36 -06:00
|
|
|
//~^ WARN `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
|
2020-07-11 09:29:35 -05:00
|
|
|
//~| HELP try an outer attribute: `#[macro_use]`
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[macro_escape] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[macro_escape]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[macro_escape] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[macro_escape]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[macro_escape] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[macro_escape]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[macro_escape] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN `#[macro_escape]` only has an effect
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_std]
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
mod no_std {
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![no_std] }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be in the root module
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_std] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_std] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_std] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_std] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// At time of authorship, #[proc_macro_derive = "2500"] signals error
|
|
|
|
// when it occurs on a mod (apart from crate-level). Therefore it goes
|
|
|
|
// into its own file; see issue-43106-gating-of-proc_macro_derive.rs
|
|
|
|
|
|
|
|
#[doc = "2400"]
|
|
|
|
mod doc {
|
|
|
|
mod inner { #![doc="2400"] }
|
|
|
|
|
|
|
|
#[doc = "2400"] fn f() { }
|
|
|
|
|
|
|
|
#[doc = "2400"] struct S;
|
|
|
|
|
|
|
|
#[doc = "2400"] type T = S;
|
|
|
|
|
|
|
|
#[doc = "2400"] impl S { }
|
|
|
|
}
|
|
|
|
|
2020-07-11 09:29:35 -05:00
|
|
|
#[cold]
|
|
|
|
//~^ WARN attribute should be applied to a function
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
mod cold {
|
|
|
|
//~^ NOTE not a function
|
|
|
|
|
|
|
|
mod inner { #![cold] }
|
|
|
|
//~^ WARN attribute should be applied to a function
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a function
|
|
|
|
|
|
|
|
#[cold] fn f() { }
|
|
|
|
|
|
|
|
#[cold] struct S;
|
|
|
|
//~^ WARN attribute should be applied to a function
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a function
|
|
|
|
|
|
|
|
#[cold] type T = S;
|
|
|
|
//~^ WARN attribute should be applied to a function
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a function
|
|
|
|
|
|
|
|
#[cold] impl S { }
|
|
|
|
//~^ WARN attribute should be applied to a function
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a function
|
|
|
|
}
|
|
|
|
|
|
|
|
#[link_name = "1900"]
|
|
|
|
//~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
mod link_name {
|
|
|
|
//~^ NOTE not a foreign function or static
|
|
|
|
|
|
|
|
#[link_name = "1900"]
|
|
|
|
//~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| HELP try `#[link(name = "1900")]` instead
|
2020-09-01 16:12:52 -05:00
|
|
|
extern "C" { }
|
2020-07-11 09:29:35 -05:00
|
|
|
//~^ NOTE not a foreign function or static
|
|
|
|
|
|
|
|
mod inner { #![link_name="1900"] }
|
|
|
|
//~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a foreign function or static
|
|
|
|
|
|
|
|
#[link_name = "1900"] fn f() { }
|
|
|
|
//~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a foreign function or static
|
|
|
|
|
|
|
|
#[link_name = "1900"] struct S;
|
|
|
|
//~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a foreign function or static
|
|
|
|
|
|
|
|
#[link_name = "1900"] type T = S;
|
|
|
|
//~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a foreign function or static
|
|
|
|
|
|
|
|
#[link_name = "1900"] impl S { }
|
|
|
|
//~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a foreign function or static
|
|
|
|
}
|
|
|
|
|
|
|
|
#[link_section = "1800"]
|
|
|
|
//~^ WARN attribute should be applied to a function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
mod link_section {
|
|
|
|
//~^ NOTE not a function or static
|
|
|
|
|
|
|
|
mod inner { #![link_section="1800"] }
|
|
|
|
//~^ WARN attribute should be applied to a function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a function or static
|
|
|
|
|
|
|
|
#[link_section = "1800"] fn f() { }
|
|
|
|
|
|
|
|
#[link_section = "1800"] struct S;
|
|
|
|
//~^ WARN attribute should be applied to a function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a function or static
|
|
|
|
|
|
|
|
#[link_section = "1800"] type T = S;
|
|
|
|
//~^ WARN attribute should be applied to a function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a function or static
|
|
|
|
|
|
|
|
#[link_section = "1800"] impl S { }
|
|
|
|
//~^ WARN attribute should be applied to a function or static [unused_attributes]
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
|
|
|
//~| NOTE not a function or static
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-01-09 13:28:40 -06:00
|
|
|
// Note that this is a `check-pass` test, so it will never invoke the linker.
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[link()]
|
2022-01-09 13:28:40 -06:00
|
|
|
//~^ WARN attribute should be applied to an `extern` block
|
|
|
|
//~| WARN this was previously accepted
|
2017-07-11 07:30:10 -05:00
|
|
|
mod link {
|
2022-01-09 13:28:40 -06:00
|
|
|
//~^ NOTE not an `extern` block
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![link()] }
|
2022-01-09 13:28:40 -06:00
|
|
|
//~^ WARN attribute should be applied to an `extern` block
|
|
|
|
//~| WARN this was previously accepted
|
|
|
|
//~| NOTE not an `extern` block
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[link()] fn f() { }
|
2022-01-09 13:28:40 -06:00
|
|
|
//~^ WARN attribute should be applied to an `extern` block
|
|
|
|
//~| WARN this was previously accepted
|
|
|
|
//~| NOTE not an `extern` block
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[link()] struct S;
|
2022-01-09 13:28:40 -06:00
|
|
|
//~^ WARN attribute should be applied to an `extern` block
|
|
|
|
//~| WARN this was previously accepted
|
|
|
|
//~| NOTE not an `extern` block
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[link()] type T = S;
|
2022-01-09 13:28:40 -06:00
|
|
|
//~^ WARN attribute should be applied to an `extern` block
|
|
|
|
//~| WARN this was previously accepted
|
|
|
|
//~| NOTE not an `extern` block
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[link()] impl S { }
|
2022-01-09 13:28:40 -06:00
|
|
|
//~^ WARN attribute should be applied to an `extern` block
|
|
|
|
//~| WARN this was previously accepted
|
|
|
|
//~| NOTE not an `extern` block
|
2022-03-14 05:28:34 -05:00
|
|
|
|
|
|
|
#[link()] extern "Rust" {}
|
|
|
|
//~^ WARN attribute should be applied to an `extern` block
|
|
|
|
//~| WARN this was previously accepted
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct StructForDeprecated;
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[deprecated]
|
2017-07-11 07:30:10 -05:00
|
|
|
mod deprecated {
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![deprecated] }
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[deprecated] fn f() { }
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[deprecated] struct S1;
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[deprecated] type T = super::StructForDeprecated;
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[deprecated] impl super::StructForDeprecated { }
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2022-02-11 18:21:02 -06:00
|
|
|
#[must_use] //~ WARN `#[must_use]` has no effect
|
2017-07-11 07:30:10 -05:00
|
|
|
mod must_use {
|
2022-02-11 18:21:02 -06:00
|
|
|
mod inner { #![must_use] } //~ WARN `#[must_use]` has no effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[must_use] fn f() { }
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[must_use] struct S;
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2022-02-11 18:21:02 -06:00
|
|
|
#[must_use] type T = S; //~ WARN `#[must_use]` has no effect
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2022-02-11 18:21:02 -06:00
|
|
|
#[must_use] impl S { } //~ WARN `#[must_use]` has no effect
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2019-06-12 10:18:32 -05:00
|
|
|
#[windows_subsystem = "windows"]
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
mod windows_subsystem {
|
2019-06-12 10:18:32 -05:00
|
|
|
mod inner { #![windows_subsystem="windows"] }
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be in the root module
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-06-12 10:18:32 -05:00
|
|
|
#[windows_subsystem = "windows"] fn f() { }
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-06-12 10:18:32 -05:00
|
|
|
#[windows_subsystem = "windows"] struct S;
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-06-12 10:18:32 -05:00
|
|
|
#[windows_subsystem = "windows"] type T = S;
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-06-12 10:18:32 -05:00
|
|
|
#[windows_subsystem = "windows"] impl S { }
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// BROKEN USES OF CRATE-LEVEL BUILT-IN ATTRIBUTES
|
|
|
|
|
|
|
|
#[crate_name = "0900"]
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
mod crate_name {
|
|
|
|
mod inner { #![crate_name="0900"] }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be in the root module
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[crate_name = "0900"] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[crate_name = "0900"] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[crate_name = "0900"] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[crate_name = "0900"] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[crate_type = "0800"]
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
mod crate_type {
|
|
|
|
mod inner { #![crate_type="0800"] }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be in the root module
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[crate_type = "0800"] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[crate_type = "0800"] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[crate_type = "0800"] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[crate_type = "0800"] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[feature(x0600)]
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
mod feature {
|
|
|
|
mod inner { #![feature(x0600)] }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be in the root module
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[feature(x0600)] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[feature(x0600)] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[feature(x0600)] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[feature(x0600)] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_main]
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
mod no_main_1 {
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![no_main] }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be in the root module
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_main] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_main] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_main] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_main] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_builtins]
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
mod no_builtins {
|
2019-01-01 17:21:05 -06:00
|
|
|
mod inner { #![no_builtins] }
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be in the root module
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_builtins] fn f() { }
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_builtins] struct S;
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_builtins] type T = S;
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[no_builtins] impl S { }
|
2022-01-09 15:08:30 -06:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[recursion_limit="0200"]
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
mod recursion_limit {
|
|
|
|
mod inner { #![recursion_limit="0200"] }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be in the root module
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[recursion_limit="0200"] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[recursion_limit="0200"] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[recursion_limit="0200"] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[recursion_limit="0200"] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[type_length_limit="0100"]
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
mod type_length_limit {
|
|
|
|
mod inner { #![type_length_limit="0100"] }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be in the root module
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[type_length_limit="0100"] fn f() { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[type_length_limit="0100"] struct S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[type_length_limit="0100"] type T = S;
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
|
|
|
|
#[type_length_limit="0100"] impl S { }
|
2021-07-29 12:00:41 -05:00
|
|
|
//~^ WARN crate-level attribute should be an inner attribute
|
2017-07-11 07:30:10 -05:00
|
|
|
}
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
fn main() {}
|