Skip to content

./x.py check failed if incremental builds enabled #58633

Closed
@kenta7777

Description

@kenta7777

This error occurred when running ./x.py check.
Should I remove these unused attributes?

$ ./x.py check
Updating only changed submodules
Submodules updated in 0.04 seconds
    Finished dev [unoptimized] target(s) in 0.58s
Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Checking std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking core v0.0.0 (/home/kenta/rust/src/libcore)
error: unused attribute=======================>                        ] 21/36: core                    
   --> src/libcore/num/mod.rs:50:17
    |
50  |                   #[rustc_layout_scalar_valid_range_start(1)]
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
100 | / nonzero_integers! {
101 | |     #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU8(u8);
102 | |     #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU16(u16);
103 | |     #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU32(u32);
...   |
112 | |     #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroIsize(isize);
113 | | }
    | |_- in this macro invocation
    |
    = note: `-D unused-attributes` implied by `-D warnings`

error: unused attribute
   --> src/libcore/num/mod.rs:50:17
    |
50  |                   #[rustc_layout_scalar_valid_range_start(1)]
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
100 | / nonzero_integers! {
101 | |     #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU8(u8);
102 | |     #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU16(u16);
103 | |     #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU32(u32);
...   |
112 | |     #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroIsize(isize);
113 | | }
    | |_- in this macro invocation

error: unused attribute
    --> src/libcore/ptr.rs:2721:1
     |
2721 | #[rustc_layout_scalar_valid_range_start(1)]
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unused attribute
    --> src/libcore/ptr.rs:2879:1
     |
2879 | #[rustc_layout_scalar_valid_range_start(1)]
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unused attribute
  --> src/libcore/ops/function.rs:59:1
   |
59 | / #[rustc_on_unimplemented(
60 | |     on(Args="()", note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"),
61 | |     message="expected a `{Fn}<{Args}>` closure, found `{Self}`",
62 | |     label="expected an `Fn<{Args}>` closure, found `{Self}`",
63 | | )]
   | |__^

error: unused attribute
   --> src/libcore/ops/function.rs:138:1
    |
138 | / #[rustc_on_unimplemented(
139 | |     on(Args="()", note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"),
140 | |     message="expected a `{FnMut}<{Args}>` closure, found `{Self}`",
141 | |     label="expected an `FnMut<{Args}>` closure, found `{Self}`",
142 | | )]
    | |__^

error: unused attribute
   --> src/libcore/ops/function.rs:217:1
    |
217 | / #[rustc_on_unimplemented(
218 | |     on(Args="()", note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"),
219 | |     message="expected a `{FnOnce}<{Args}>` closure, found `{Self}`",
220 | |     label="expected an `FnOnce<{Args}>` closure, found `{Self}`",
221 | | )]
    | |__^

error: unused attribute
  --> src/libcore/ops/index.rs:53:1
   |
53 | / #[rustc_on_unimplemented(
54 | |     message="the type `{Self}` cannot be indexed by `{Idx}`",
55 | |     label="`{Self}` cannot be indexed by `{Idx}`",
56 | | )]
   | |__^

error: unused attribute
   --> src/libcore/ops/index.rs:143:1
    |
143 | / #[rustc_on_unimplemented(
144 | |     on(
145 | |         _Self="&str",
146 | |         note="you can use `.chars().nth()` or `.bytes().nth()`
...   |
160 | |     label="`{Self}` cannot be mutably indexed by `{Idx}`",
161 | | )]
    | |__^

error: unused attribute
  --> src/libcore/ops/try.rs:8:1
   |
8  | / #[rustc_on_unimplemented(
9  | |    on(all(
10 | |        any(from_method="from_error", from_method="from_ok"),
11 | |        from_desugaring="?"),
...  |
19 | |       label="the `?` operator cannot be applied to type `{Self}`")
20 | | )]
   | |__^

error: unused attribute
   --> src/libcore/cmp.rs:185:1
    |
185 | / #[rustc_on_unimplemented(
186 | |     message="can't compare `{Self}` with `{Rhs}`",
187 | |     label="no implementation for `{Self} == {Rhs}`",
188 | | )]
    | |__^

error: unused attribute
   --> src/libcore/cmp.rs:695:1
    |
695 | / #[rustc_on_unimplemented(
696 | |     message="can't compare `{Self}` with `{Rhs}`",
697 | |     label="no implementation for `{Self} < {Rhs}` and `{Self} > {Rhs}`",
698 | | )]
    | |__^

error: unused attribute
  --> src/libcore/iter/traits/iterator.rs:21:1
   |
21 | / #[rustc_on_unimplemented(
22 | |     on(
23 | |         _Self="[std::ops::Range<Idx>; 1]",
24 | |         label="if you meant to iterate between two values, remove the square brackets",
...  |
87 | |     message="`{Self}` is not an iterator"
88 | | )]
   | |__^

error: unused attribute
  --> src/libcore/iter/traits/collect.rs:93:1
   |
93 | / #[rustc_on_unimplemented(
94 | |     message="a collection of type `{Self}` cannot be built from an iterator \
95 | |              over elements of type `{A}`",
96 | |     label="a collection of type `{Self}` cannot be built from `std::iter::Iterator<Item={A}>`",
97 | | )]
   | |__^

error: aborting due to 14 previous errors

error: Could not compile `core`.

To learn more, run the command again with --verbose.
command did not execute successfully: "/home/kenta/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--features" "panic-unwind backtrace" "--manifest-path" "/home/kenta/rust/src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101
failed to run: /home/kenta/rust/build/bootstrap/debug/bootstrap check
Build completed unsuccessfully in 0:00:15

Metadata

Metadata

Assignees

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)A-incr-compArea: Incremental compilationA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.P-highHigh priorityT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions