Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5d08a54

Browse files
committed
Detect unused structs which derived Default
1 parentc8170e6 commit5d08a54

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

‎alloc/src/sync/tests.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ fn show_arc() {
396396

397397
// Make sure deriving works with Arc<T>
398398
#[derive(Eq,Ord,PartialEq,PartialOrd,Clone,Debug,Default)]
399-
structFoo{
399+
struct_Foo{
400400
inner:Arc<i32>,
401401
}
402402

‎core/src/default.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ use crate::ascii::Char as AsciiChar;
103103
/// ```
104104
#[cfg_attr(not(test), rustc_diagnostic_item ="Default")]
105105
#[stable(feature ="rust1", since ="1.0.0")]
106+
#[cfg_attr(not(bootstrap), rustc_trivial_field_reads)]
106107
pubtraitDefault:Sized{
107108
/// Returns the "default value" for a type.
108109
///

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp