rust/compiler/rustc_lint/src
bors 8422e27b27 Auto merge of #129670 - est31:cfg_attr_crate_type_name_error, r=Urgau
Make deprecated_cfg_attr_crate_type_name a hard error

Turns the forward compatibility lint added by #83744 into a hard error, so now, while the `#![crate_name]` and `#![crate_type]` attributes are still allowed in raw form, they are now forbidden to be nested inside a `#![cfg_attr()]` attribute.

The following will now be an error:

```Rust
#![cfg_attr(foo, crate_name = "foobar")]
#![cfg_attr(foo, crate_type = "bin")]
```

This code will continue working and is not deprecated:

```Rust
#![crate_name = "foobar"]
#![crate_type = "lib"]
```

The reasoning for this is explained in #83744: it allows us to not have to cfg-expand in order to determine the crate's type and name.

As of filing the PR, exactly two years have passed since #99784 has been merged, which has turned the lint's default warning level into an error, so there has been ample time to move off the now-forbidden syntax.

cc #91632 - tracking issue for the lint
2024-10-06 17:00:02 +00:00
..
context Make deprecated_cfg_attr_crate_type_name a hard error 2024-10-05 04:29:46 +02:00
nonstandard_style mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
types Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
async_closures.rs docs: Enable required feature for 'closure_returning_async_block' lint 2024-09-14 10:43:26 +02:00
async_fn_in_trait.rs rm ItemKind::OpaqueTy 2024-10-04 23:28:22 +00:00
builtin.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
context.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
deref_into_dyn_supertrait.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
drop_forget_useless.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
early.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
enum_intrinsics_non_enums.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
errors.rs Add warn(unreachable_pub) to rustc_lint. 2024-08-27 15:24:11 +10:00
expect.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
for_loops_over_fallibles.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
foreign_modules.rs Make clashing_extern_declarations considering generic args for ADT field 2024-09-27 16:37:43 +08:00
hidden_unicode_codepoints.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
if_let_rescope.rs Rollup merge of #131035 - dingxiangfei2009:tweak-if-let-rescope-lint, r=jieyouxu 2024-09-30 18:25:14 +02:00
impl_trait_overcaptures.rs rm ItemKind::OpaqueTy 2024-10-04 23:28:22 +00:00
internal.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
invalid_from_utf8.rs Remove extern crate rustc_session from rustc_lint. 2024-04-29 13:57:41 +10:00
late.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
let_underscore.rs Fix the misleading diagnostic for let_underscore_drop on type without Drop implementation 2024-09-26 10:18:18 +08:00
levels.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
lib.rs Auto merge of #129670 - est31:cfg_attr_crate_type_name_error, r=Urgau 2024-10-06 17:00:02 +00:00
lints.rs Auto merge of #129670 - est31:cfg_attr_crate_type_name_error, r=Urgau 2024-10-06 17:00:02 +00:00
macro_expr_fragment_specifier_2024_migration.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
map_unit_fn.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
methods.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
multiple_supertrait_upcastable.rs Compiler: Rename "object safe" to "dyn compatible" 2024-09-25 13:26:48 +02:00
non_ascii_idents.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
non_fmt_panic.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
non_local_def.rs Remove with/without trait and bounds consideration 2024-09-23 10:01:59 +02:00
nonstandard_style.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
noop_method_call.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
opaque_hidden_inferred_bound.rs rm ItemKind::OpaqueTy 2024-10-04 23:28:22 +00:00
pass_by_value.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
passes.rs add unqualified_local_imports lint 2024-09-23 11:57:28 +02:00
precedence.rs Temporarily switch ambiguous_negative_literals lint to allow 2024-07-31 19:36:47 +02:00
ptr_nulls.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
redundant_semicolon.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
reference_casting.rs Use bool in favor of Option<()> for diagnostics 2024-08-21 01:31:11 -04:00
shadowed_into_iter.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
static_mut_refs.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
tail_expr_drop_order.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
tests.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
traits.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
types.rs rm ItemKind::OpaqueTy 2024-10-04 23:28:22 +00:00
unit_bindings.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
unqualified_local_imports.rs add unqualified_local_imports lint 2024-09-23 11:57:28 +02:00
unused.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00