-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
duplicate note on platform_intrinsics
feature gate
#116293
Comments
feature, not a bug: we want people to be very strongly discouraged, so we say it twice. |
the more repetions, the more discouraged. lang_items should go up to 10. |
Maybe we should print it in an infinite loop, just to be on the save side? 😇 |
This is happening on |
@rustbot claim The source of the problem is the decorator for rust/compiler/rustc_macros/src/diagnostics/diagnostic.rs Lines 122 to 134 in 2e7e0fb
I also noticed that the behaviour seems to differ across gates. E.g. building this: #![feature(custom_mir)]
#![feature(platform_intrinsics)]
pub fn main() {} emits one note for
Not sure what's different about these gates. I'm new to this area, so if you can provide any pointers based on the above, please do. |
This program tests all the internal gates: #![feature(allocator_internals)]
#![feature(allow_internal_unsafe)]
#![feature(allow_internal_unstable)]
#![feature(compiler_builtins)]
#![feature(custom_mir)]
#![feature(intrinsics)]
#![feature(lang_items)]
#![feature(omit_gdb_pretty_printer_section)]
#![feature(prelude_import)]
#![feature(profiler_runtime)]
#![feature(rustc_attrs)]
#![feature(staged_api)]
#![feature(test_2018_feature)]
#![feature(test_unstable_lint)]
#![feature(unsafe_pin_internals)]
#![feature(link_llvm_intrinsics)]
#![feature(needs_panic_runtime)]
#![feature(panic_runtime)]
#![feature(platform_intrinsics)]
#![feature(rustc_allow_const_fn_unstable)]
#![feature(rustdoc_internals)]
pub fn main() {} It produces the following output:
Of the 21 internal gates, only the last 6 result in duplicate notes. |
These should be more, there's a file somewhere that defines all the features but I can't check it right now on mobile |
I think that should be all of them. This is super weird indeed, no idea |
Thanks @matthiaskrgr & @Nilstrieb. I found what's different about gates with duplicate notes: they all have an associated issue. Here's the full list grepped from (internal, allocator_internals, "1.20.0", None, None),
(internal, allow_internal_unsafe, "1.0.0", None, None),
(internal, allow_internal_unstable, "1.0.0", None, None),
(internal, compiler_builtins, "1.13.0", None, None),
(internal, custom_mir, "1.65.0", None, None),
(internal, intrinsics, "1.0.0", None, None),
(internal, lang_items, "1.0.0", None, None),
(internal, omit_gdb_pretty_printer_section, "1.5.0", None, None),
(internal, prelude_import, "1.2.0", None, None),
(internal, profiler_runtime, "1.18.0", None, None),
(internal, rustc_attrs, "1.0.0", None, None),
(internal, staged_api, "1.0.0", None, None),
(internal, test_2018_feature, "1.31.0", None, Some(Edition::Edition2018)),
(internal, test_unstable_lint, "1.60.0", None, None),
(internal, unsafe_pin_internals, "1.60.0", None, None),
(internal, link_llvm_intrinsics, "1.0.0", Some(29602), None),
(internal, needs_panic_runtime, "1.10.0", Some(32837), None),
(internal, panic_runtime, "1.10.0", Some(32837), None),
(internal, platform_intrinsics, "1.4.0", Some(27731), None),
(internal, rustc_allow_const_fn_unstable, "1.49.0", Some(69399), None),
(internal, rustdoc_internals, "1.58.0", Some(90418), None), Notice that the second last field in the last 6 lines is |
The root cause is the rust/compiler/rustc_lint/src/builtin.rs Line 2276 in 2e7e0fb
Its value is rust/compiler/rustc_lint/src/lints.rs Line 412 in 2e7e0fb
this results in duplicates. The solution is to always pass |
I tried this code:
note the duplicate
= note: using it is strongly discouraged
The text was updated successfully, but these errors were encountered: