Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for duplicate attributes. #88681

Merged
merged 3 commits into from
Nov 22, 2021
Merged

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Sep 6, 2021

This adds some checks for duplicate attributes. In many cases, the duplicates were being ignored without error or warning. This adds several kinds of checks (see AttributeDuplicates enum).

The motivation here is to issue unused warnings with similar reasoning for any unused lint, and to error for cases where there are conflicts.

This also adds a check for empty attribute lists in a few attributes where this causes the attribute to be ignored.

Closes #55112.

@rust-highfive
Copy link
Collaborator

r? @wesleywiser

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 6, 2021
@ehuss
Copy link
Contributor Author

ehuss commented Sep 6, 2021

cc @Aaron1011, since you recently worked on this in #87739. I'm not sure I fully understood the macro_use check, as it didn't seem to be working as I would expect. macro_use(..) duplicates were already handled by unused_imports. This changes it so that bare #[macro_use] duplicates are warned, and #[macro_use()] is warned since it has no effect.

cc @petrochenkov who has written a lot of attribute validation.

@bors

This comment has been minimized.

@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 13, 2021
@bors

This comment has been minimized.

@ehuss ehuss force-pushed the duplicate-attributes branch 2 times, most recently from fcf77a6 to d026e19 Compare September 22, 2021 18:05
@bors

This comment has been minimized.

@ehuss
Copy link
Contributor Author

ehuss commented Oct 6, 2021

@wesleywiser I was wondering if you'd have a chance to take a look at this.

@bors

This comment has been minimized.

@bors

This comment has been minimized.

@bors

This comment has been minimized.

@bors

This comment has been minimized.

@jackh726
Copy link
Member

Going to r? @petrochenkov here for review. But feel free to reassign.

src/test/ui/lint/unused/unused-attr-duplicate.rs Outdated Show resolved Hide resolved
compiler/rustc_lint/src/builtin.rs Outdated Show resolved Hide resolved
compiler/rustc_feature/src/lib.rs Outdated Show resolved Hide resolved
compiler/rustc_feature/src/builtin_attrs.rs Outdated Show resolved Hide resolved
compiler/rustc_feature/src/builtin_attrs.rs Outdated Show resolved Hide resolved
compiler/rustc_feature/src/builtin_attrs.rs Outdated Show resolved Hide resolved
compiler/rustc_feature/src/builtin_attrs.rs Outdated Show resolved Hide resolved
compiler/rustc_feature/src/builtin_attrs.rs Outdated Show resolved Hide resolved
compiler/rustc_feature/src/builtin_attrs.rs Outdated Show resolved Hide resolved
/// This is the same as `ErrorFollowing`, except the last attribute is the
/// one that is "used". This is typically used in cases like codegen
/// attributes which usually only honor the last attribute.
ErrorPreceding,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't make this distinction, IMO, and should merge ErrorFollowing into this variant, and always use the last specified value. (And error on the previously specified values.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I was a little uneasy with having different following/preceding behaviors.

I can easily remove ErrorFollowing, but I feel like that emphasizes the inconsistencies:

  • Normally when there are duplicate definitions (like items), the compiler generates an error about the following entries. Why would attributes have the opposite behavior?
  • It seems inconsistent to have WarnFollowing and ErrorPreceding. Why have one behavior for warning and the opposite for errors?
    • Comparing to unused_variables, if you have let x = 1; let x = 2; ..., it will warn about the first x.

So, perhaps it would be better to remove ErrorPreceding instead? At least, I feel like that would be more consistent with the rest of the language. That would also match the behavior of things like the proc-macro check which generates errors for following duplicates.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean if

#[key = "value1"]
#[key = "value2"]
NODE

was intentionally allowed, then value2 would probably override value1, similarly to how later let or macro_rules "override" (shadow) earlier let or macro_rules, or how later command line options override earlier command line options.
So value1 would be unused.

But this requires changing other parts of the compiler to harmonize the errors and the actual behavior after the error is reported, so it's probably not a material for this PR.

This removes the duplicate check, as this is now handled in a
centralized location.
@ehuss
Copy link
Contributor Author

ehuss commented Nov 21, 2021

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Nov 21, 2021

📌 Commit 36dcd4c has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 21, 2021
@bors
Copy link
Contributor

bors commented Nov 22, 2021

⌛ Testing commit 36dcd4c with merge b5197d2f158d95cf05009aaa8a684814d7442878...

@bors
Copy link
Contributor

bors commented Nov 22, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 22, 2021
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-msvc-cargo failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test workspaces::simple_primary_package_env_var ... ok

failures:

---- lto::complicated stdout ----
running `D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\release\cargo.exe build -v --release`
thread 'lto::complicated' panicked at '
test failed running `D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\release\cargo.exe build -v --release`
error: process exited with code 101 (expected 0)

--- stderr
--- stderr
    Updating `dummy-registry` index
---
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
   Compiling dep-shared v0.0.1
   Compiling dep-build2 v0.0.1
   Compiling dep-proc-macro2 v0.0.1
   Compiling dep-normal2 v0.0.1
     Running `rustc --crate-name dep_shared D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\home\.cargo\registry\src\-5df8a1ccca24ba7a\dep-shared-0.0.1\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=815663fa4ca118de -C extra-filename=-815663fa4ca118de --out-dir D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps -L dependency=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps --cap-lints allow`
     Running `rustc --crate-name dep_proc_macro2 D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\home\.cargo\registry\src\-5df8a1ccca24ba7a\dep-proc-macro2-0.0.1\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=f829152b9eb79c53 -C extra-filename=-f829152b9eb79c53 --out-dir D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps -L dependency=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps --cap-lints allow`
     Running `rustc --crate-name dep_build2 D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\home\.cargo\registry\src\-5df8a1ccca24ba7a\dep-build2-0.0.1\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=df572682f4638748 -C extra-filename=-df572682f4638748 --out-dir D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps -L dependency=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps --cap-lints allow`
     Running `rustc --crate-name dep_normal2 D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\home\.cargo\registry\src\-5df8a1ccca24ba7a\dep-normal2-0.0.1\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linker-plugin-lto -C metadata=8cf56e81cc7e8007 -C extra-filename=-8cf56e81cc7e8007 --out-dir D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps -L dependency=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps --cap-lints allow`
   Compiling dep-normal v0.0.1
   Compiling dep-build v0.0.1
     Running `rustc --crate-name dep_normal D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\home\.cargo\registry\src\-5df8a1ccca24ba7a\dep-normal-0.0.1\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linker-plugin-lto -C metadata=06ea447f8e785b1a -C extra-filename=-06ea447f8e785b1a --out-dir D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps -L dependency=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps --extern dep_normal2=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\libdep_normal2-8cf56e81cc7e8007.rmeta --extern dep_shared=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\libdep_shared-815663fa4ca118de.rmeta --cap-lints allow`
     Running `rustc --crate-name dep_build D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\home\.cargo\registry\src\-5df8a1ccca24ba7a\dep-build-0.0.1\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=4b7343fd1f9e1e57 -C extra-filename=-4b7343fd1f9e1e57 --out-dir D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps -L dependency=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps --extern dep_build2=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\libdep_build2-df572682f4638748.rmeta --extern dep_shared=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\libdep_shared-815663fa4ca118de.rmeta --cap-lints allow`
   Compiling dep-proc-macro v0.0.1
     Running `rustc --crate-name dep_proc_macro D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\home\.cargo\registry\src\-5df8a1ccca24ba7a\dep-proc-macro-0.0.1\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C opt-level=3 -C embed-bitcode=no -C metadata=92b443923583e648 -C extra-filename=-92b443923583e648 --out-dir D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps -L dependency=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps --extern dep_proc_macro2=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\libdep_proc_macro2-f829152b9eb79c53.rlib --extern dep_shared=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\libdep_shared-815663fa4ca118de.rlib --extern proc_macro --cap-lints allow`
   Compiling test v0.0.0 (D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo)
     Running `rustc --crate-name build_script_build build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=1132ccd72abf6ae6 -C extra-filename=-1132ccd72abf6ae6 --out-dir D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\build\test-1132ccd72abf6ae6 -L dependency=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps --extern dep_build=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\libdep_build-4b7343fd1f9e1e57.rlib`
     Running `D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\build\test-1132ccd72abf6ae6\build-script-build`
     Running `rustc --crate-name test src\main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C metadata=f9bd7972e02c2e3b --out-dir D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps -L dependency=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps --extern dep_normal=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\libdep_normal-06ea447f8e785b1a.rlib --extern dep_proc_macro=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\dep_proc_macro-92b443923583e648.dll`
     Running `rustc --crate-name test src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type cdylib --crate-type staticlib --emit=dep-info,link -C opt-level=3 -C lto -C metadata=10d13534f609fec7 --out-dir D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps -L dependency=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps --extern dep_normal=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\libdep_normal-06ea447f8e785b1a.rlib --extern dep_proc_macro=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\dep_proc_macro-92b443923583e648.dll`
error: linking with `link.exe` failed: exit code: 1201
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\tmp\\cit\\t1298\\foo\\target\\release\\deps\\test.test.1ec84935-cgu.1.rcgu.o" "/LIBPATH:D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\tmp\\cit\\t1298\\foo\\target\\release\\deps" "/LIBPATH:D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-2e46b64d42824fd5.rlib" "kernel32.lib" "ws2_32.lib" "bcrypt.lib" "advapi32.lib" "userenv.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LIBPATH:D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "/OUT:D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\tmp\\cit\\t1298\\foo\\target\\release\\deps\\test.exe" "/OPT:REF,ICF" "/DEBUG"
  = note: LINK : fatal error LNK1201: error writing to program database 'D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\test.pdb'; check for insufficient disk space, invalid path, or insufficient privilege

error: could not compile `test` due to previous error

Caused by:
Caused by:
  process didn't exit successfully: `rustc --crate-name test src\main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C metadata=f9bd7972e02c2e3b --out-dir D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps -L dependency=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps --extern dep_normal=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\libdep_normal-06ea447f8e785b1a.rlib --extern dep_proc_macro=D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\x86_64-pc-windows-msvc\tmp\cit\t1298\foo\target\release\deps\dep_proc_macro-92b443923583e648.dll` (exit code: 1)
error: build failed
', src\tools\cargo\tests\testsuite\lto.rs:217:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@ehuss
Copy link
Contributor Author

ehuss commented Nov 22, 2021

@bors retry

#81890

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 22, 2021
@bors
Copy link
Contributor

bors commented Nov 22, 2021

⌛ Testing commit 36dcd4c with merge f7c4829...

@bors
Copy link
Contributor

bors commented Nov 22, 2021

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing f7c4829 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 22, 2021
@bors bors merged commit f7c4829 into rust-lang:master Nov 22, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 22, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f7c4829): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

jhpratt added a commit to jhpratt/rust that referenced this pull request Dec 28, 2021
This resolves the concern in favor of prohibiting multiple instances of
the attribute. This is similar to non-helper attributes as introduced in
rust-lang#88681.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 16, 2022
…-Simulacrum

Resolve concern of `derive_default_enum`

This resolves the concern in favor of prohibiting multiple instances of
the attribute. This is similar to non-helper attributes as introduced in
rust-lang#88681.

`@rustbot` label +S-waiting-on-review +T-libs-api
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 16, 2022
…-Simulacrum

Resolve concern of `derive_default_enum`

This resolves the concern in favor of prohibiting multiple instances of
the attribute. This is similar to non-helper attributes as introduced in
rust-lang#88681.

``@rustbot`` label +S-waiting-on-review +T-libs-api
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 12, 2022
…ylan-DPC

Fix crate_type attribute to not warn on duplicates

In rust-lang#88681 I accidentally marked the `crate_type` attribute as only allowing a single attribute. However, multiple attributes are allowed (they are joined together [here](https://github.com/rust-lang/rust/blob/027a232755fa9728e9699337267f6675dfd0a8ba/compiler/rustc_interface/src/util.rs#L530-L542)). This fixes it to not report a warning if duplicates are found.

Closes rust-lang#95902
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 12, 2022
…ylan-DPC

Fix crate_type attribute to not warn on duplicates

In rust-lang#88681 I accidentally marked the `crate_type` attribute as only allowing a single attribute. However, multiple attributes are allowed (they are joined together [here](https://github.com/rust-lang/rust/blob/027a232755fa9728e9699337267f6675dfd0a8ba/compiler/rustc_interface/src/util.rs#L530-L542)). This fixes it to not report a warning if duplicates are found.

Closes rust-lang#95902
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

emit unused_attributes lint for silly attributes