Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
30fc601
Tests for field is never read diagnostic
sunjay Mar 11, 2021
321aace
Added suggestion and note for when a field is never used
sunjay Mar 12, 2021
7faaf39
Updating test stderr files
sunjay Mar 12, 2021
789186d
Trying out a new message that works a little better for values *and* …
sunjay Mar 12, 2021
2acd8eb
New shorter diagnostic note that is different for items versus fields
sunjay Mar 13, 2021
3e34eb8
Putting help message only under the identifier that needs to be prefixed
sunjay Mar 25, 2021
539242a
Add a suggestion when using a type alias instead of trait alias
JohnTitor Mar 31, 2021
eea27b8
Mention trait alias on the E0404 note
JohnTitor Mar 31, 2021
115e216
Rename AssociatedItems to AssocItems
0xPoe Apr 24, 2020
6c3f5b8
resolve conflicts
0xPoe Apr 5, 2021
7efba4f
Implement indexing slices with pairs of ops::Bound<usize>
AnthonyMikh Oct 8, 2020
904ee68
Explicitly implement `!Send` and `!Sync` for `sys::{Args, Env}`
CDirkx Apr 14, 2021
2ecc820
Correct typos
CDirkx Apr 14, 2021
98a11e0
Remove closure_tree
camsteffen Apr 19, 2021
c9c14d0
Small refactor
camsteffen Apr 19, 2021
a10d01b
Uses flex to fix formatting of h1 at any width.
Apr 20, 2021
ba3d22e
Precompute inverse binder depth
jackh726 Apr 12, 2021
32942ab
A non-minimal set of TraitRefBoundarys to work on removing from_poly_…
jackh726 Apr 12, 2021
457c4c1
Add BinderScopeType to replace binder_depth and from_poly_trait_ref
jackh726 Apr 13, 2021
9891582
Remove TraitRefHackInner and use the concatenating functionality inst…
jackh726 Apr 20, 2021
4568e7d
Move nested quantification check to ast_validation
jackh726 Apr 21, 2021
259a368
fix name resolution for param defaults
lcnr Apr 18, 2021
7cb1dcd
loosen ordering restricts for `const_generics_defaults`
lcnr Apr 18, 2021
312b4fd
improve wf check for const param defaults
lcnr Apr 18, 2021
d3e0d2f
supply substs to anon consts in defaults
lcnr Apr 18, 2021
de2a460
rustc: Use LLVM's new saturating float-to-int intrinsics
alexcrichton Apr 19, 2021
e34f7e6
Update LLVM submodule
Amanieu Apr 21, 2021
b78c0d8
Review comments
jackh726 Apr 21, 2021
eb9b0f6
Move `sys_common::rwlock::StaticRWLock` etc. to `sys::unix::rwlock`
CDirkx Apr 21, 2021
c78724f
More review changes
jackh726 Apr 21, 2021
bb91805
Replaced flex gap with margin, for compatibility with older browsers.
Apr 21, 2021
6763a40
Bump slice_index_with_ops_bound_pair to 1.53.0
m-ou-se Apr 21, 2021
134b79c
Rollup merge of #71511 - hi-rustin:rustin-patch-rename-assoc, r=eddyb…
Dylan-DPC Apr 22, 2021
1961911
Rollup merge of #77704 - AnthonyMikh:slice_index_with_ops_bound_pair,…
Dylan-DPC Apr 22, 2021
78cb13a
Rollup merge of #83004 - sunjay:field-never-read-issue-81658, r=pnkfelix
Dylan-DPC Apr 22, 2021
8d1e9f2
Rollup merge of #83729 - JohnTitor:issue-43913, r=estebank
Dylan-DPC Apr 22, 2021
4753698
Rollup merge of #84179 - CDirkx:dont_send_sync, r=m-ou-se
Dylan-DPC Apr 22, 2021
29c2464
Rollup merge of #84299 - lcnr:const-generics-defaults-name-res, r=varkor
Dylan-DPC Apr 22, 2021
f82badd
Rollup merge of #84339 - alexcrichton:llvm-fptoint-sat, r=nagisa
Dylan-DPC Apr 22, 2021
0210f83
Rollup merge of #84343 - camsteffen:closure-tree, r=varkor
Dylan-DPC Apr 22, 2021
3d1b81c
Rollup merge of #84376 - torhovland:issue-84534, r=GuillaumeGomez
Dylan-DPC Apr 22, 2021
c5494aa
Rollup merge of #84377 - jackh726:binder-refactor-fix, r=nikomatsakis
Dylan-DPC Apr 22, 2021
c978584
Rollup merge of #84396 - Amanieu:fix_compiler_builtins_llvm, r=cuviper
Dylan-DPC Apr 22, 2021
1476eb9
Rollup merge of #84402 - CDirkx:rwlock, r=dtolnay
Dylan-DPC Apr 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updating test stderr files
  • Loading branch information
sunjay committed Mar 25, 2021
commit 7faaf396b2828f487bd862cfba53b66612998fa2
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ error: associated constant is never used: `BAR`
--> $DIR/associated-const-dead-code.rs:6:5
|
LL | const BAR: u32 = 1;
| ^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_BAR`
|
= note: the leading underscore helps signal to the reader that the associated constant may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the associated constant
is only used through FFI or used only for its effect when dropped)
note: the lint level is defined here
--> $DIR/associated-const-dead-code.rs:1:9
|
Expand Down
5 changes: 4 additions & 1 deletion src/test/ui/derive-uninhabited-enum-38885.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ warning: variant is never constructed: `Void`
--> $DIR/derive-uninhabited-enum-38885.rs:13:5
|
LL | Void(Void),
| ^^^^^^^^^^
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_Void`
|
= note: the leading underscore helps signal to the reader that the variant may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the variant
is only used through FFI or used only for its effect when dropped)
= note: `-W dead-code` implied by `-W unused`

warning: 1 warning emitted
Expand Down
5 changes: 4 additions & 1 deletion src/test/ui/issues/issue-37515.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ warning: type alias is never used: `Z`
--> $DIR/issue-37515.rs:5:1
|
LL | type Z = dyn for<'x> Send;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_Z`
|
= note: the leading underscore helps signal to the reader that the type alias may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the type alias
is only used through FFI or used only for its effect when dropped)
note: the lint level is defined here
--> $DIR/issue-37515.rs:3:9
|
Expand Down
5 changes: 4 additions & 1 deletion src/test/ui/lint/dead-code/basic.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ error: function is never used: `foo`
--> $DIR/basic.rs:4:4
|
LL | fn foo() {
| ^^^
| ^^^ help: if this is intentional, prefix it with an underscore: `_foo`
|
= note: the leading underscore helps signal to the reader that the function may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the function
is only used through FFI or used only for its effect when dropped)
note: the lint level is defined here
--> $DIR/basic.rs:1:9
|
Expand Down
11 changes: 9 additions & 2 deletions src/test/ui/lint/dead-code/const-and-self.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ warning: variant is never constructed: `B`
--> $DIR/const-and-self.rs:33:5
|
LL | B,
| ^
| ^ help: if this is intentional, prefix it with an underscore: `_B`
|
= note: the leading underscore helps signal to the reader that the variant may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the variant
is only used through FFI or used only for its effect when dropped)
note: the lint level is defined here
--> $DIR/const-and-self.rs:3:9
|
Expand All @@ -14,7 +17,11 @@ warning: variant is never constructed: `C`
--> $DIR/const-and-self.rs:34:5
|
LL | C,
| ^
| ^ help: if this is intentional, prefix it with an underscore: `_C`
|
= note: the leading underscore helps signal to the reader that the variant may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the variant
is only used through FFI or used only for its effect when dropped)

warning: 2 warnings emitted

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ error: field is never read: `guard`
--> $DIR/drop-only-field-issue-81658.rs:15:5
|
LL | guard: MutexGuard<'a, T>,
| ^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_guard`
|
= note: the leading underscore helps signal to the reader that the field may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the field
is only used through FFI or used only for its effect when dropped)
note: the lint level is defined here
--> $DIR/drop-only-field-issue-81658.rs:8:9
|
Expand Down
5 changes: 4 additions & 1 deletion src/test/ui/lint/dead-code/empty-unused-enum.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ error: enum is never used: `E`
--> $DIR/empty-unused-enum.rs:3:6
|
LL | enum E {}
| ^
| ^ help: if this is intentional, prefix it with an underscore: `_E`
|
= note: the leading underscore helps signal to the reader that the enum may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the enum
is only used through FFI or used only for its effect when dropped)
note: the lint level is defined here
--> $DIR/empty-unused-enum.rs:1:9
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ error: field is never read: `items`
--> $DIR/field-used-in-ffi-issue-81658.rs:13:5
|
LL | items: Option<Vec<T>>,
| ^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_items`
|
= note: the leading underscore helps signal to the reader that the field may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the field
is only used through FFI or used only for its effect when dropped)
note: the lint level is defined here
--> $DIR/field-used-in-ffi-issue-81658.rs:7:9
|
Expand Down
5 changes: 4 additions & 1 deletion src/test/ui/lint/dead-code/impl-trait.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ error: type alias is never used: `Unused`
--> $DIR/impl-trait.rs:12:1
|
LL | type Unused = ();
| ^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_Unused`
|
= note: the leading underscore helps signal to the reader that the type alias may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the type alias
is only used through FFI or used only for its effect when dropped)
note: the lint level is defined here
--> $DIR/impl-trait.rs:1:9
|
Expand Down
59 changes: 49 additions & 10 deletions src/test/ui/lint/dead-code/lint-dead-code-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ error: struct is never constructed: `Bar`
--> $DIR/lint-dead-code-1.rs:12:16
|
LL | pub struct Bar;
| ^^^
| ^^^ help: if this is intentional, prefix it with an underscore: `_Bar`
|
= note: the leading underscore helps signal to the reader that the struct may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the struct
is only used through FFI or used only for its effect when dropped)
note: the lint level is defined here
--> $DIR/lint-dead-code-1.rs:5:9
|
Expand All @@ -14,55 +17,91 @@ error: static is never used: `priv_static`
--> $DIR/lint-dead-code-1.rs:20:1
|
LL | static priv_static: isize = 0;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_static`
|
= note: the leading underscore helps signal to the reader that the static may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the static
is only used through FFI or used only for its effect when dropped)

error: constant is never used: `priv_const`
--> $DIR/lint-dead-code-1.rs:27:1
|
LL | const priv_const: isize = 0;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_const`
|
= note: the leading underscore helps signal to the reader that the constant may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the constant
is only used through FFI or used only for its effect when dropped)

error: struct is never constructed: `PrivStruct`
--> $DIR/lint-dead-code-1.rs:35:8
|
LL | struct PrivStruct;
| ^^^^^^^^^^
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_PrivStruct`
|
= note: the leading underscore helps signal to the reader that the struct may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the struct
is only used through FFI or used only for its effect when dropped)

error: enum is never used: `priv_enum`
--> $DIR/lint-dead-code-1.rs:64:6
|
LL | enum priv_enum { foo2, bar2 }
| ^^^^^^^^^
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_enum`
|
= note: the leading underscore helps signal to the reader that the enum may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the enum
is only used through FFI or used only for its effect when dropped)

error: variant is never constructed: `bar3`
--> $DIR/lint-dead-code-1.rs:67:5
|
LL | bar3
| ^^^^
| ^^^^ help: if this is intentional, prefix it with an underscore: `_bar3`
|
= note: the leading underscore helps signal to the reader that the variant may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the variant
is only used through FFI or used only for its effect when dropped)

error: function is never used: `priv_fn`
--> $DIR/lint-dead-code-1.rs:88:4
|
LL | fn priv_fn() {
| ^^^^^^^
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_fn`
|
= note: the leading underscore helps signal to the reader that the function may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the function
is only used through FFI or used only for its effect when dropped)

error: function is never used: `foo`
--> $DIR/lint-dead-code-1.rs:93:4
|
LL | fn foo() {
| ^^^
| ^^^ help: if this is intentional, prefix it with an underscore: `_foo`
|
= note: the leading underscore helps signal to the reader that the function may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the function
is only used through FFI or used only for its effect when dropped)

error: function is never used: `bar`
--> $DIR/lint-dead-code-1.rs:98:4
|
LL | fn bar() {
| ^^^
| ^^^ help: if this is intentional, prefix it with an underscore: `_bar`
|
= note: the leading underscore helps signal to the reader that the function may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the function
is only used through FFI or used only for its effect when dropped)

error: function is never used: `baz`
--> $DIR/lint-dead-code-1.rs:102:4
|
LL | fn baz() -> impl Copy {
| ^^^
| ^^^ help: if this is intentional, prefix it with an underscore: `_baz`
|
= note: the leading underscore helps signal to the reader that the function may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the function
is only used through FFI or used only for its effect when dropped)

error: aborting due to 10 previous errors

17 changes: 14 additions & 3 deletions src/test/ui/lint/dead-code/lint-dead-code-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ error: function is never used: `dead_fn`
--> $DIR/lint-dead-code-2.rs:22:4
|
LL | fn dead_fn() {}
| ^^^^^^^
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_dead_fn`
|
= note: the leading underscore helps signal to the reader that the function may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the function
is only used through FFI or used only for its effect when dropped)
note: the lint level is defined here
--> $DIR/lint-dead-code-2.rs:2:9
|
Expand All @@ -14,13 +17,21 @@ error: function is never used: `dead_fn2`
--> $DIR/lint-dead-code-2.rs:25:4
|
LL | fn dead_fn2() {}
| ^^^^^^^^
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_dead_fn2`
|
= note: the leading underscore helps signal to the reader that the function may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the function
is only used through FFI or used only for its effect when dropped)

error: function is never used: `main`
--> $DIR/lint-dead-code-2.rs:38:4
|
LL | fn main() {
| ^^^^
| ^^^^ help: if this is intentional, prefix it with an underscore: `_main`
|
= note: the leading underscore helps signal to the reader that the function may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the function
is only used through FFI or used only for its effect when dropped)

error: aborting due to 3 previous errors

29 changes: 24 additions & 5 deletions src/test/ui/lint/dead-code/lint-dead-code-3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ error: struct is never constructed: `Foo`
--> $DIR/lint-dead-code-3.rs:14:8
|
LL | struct Foo;
| ^^^
| ^^^ help: if this is intentional, prefix it with an underscore: `_Foo`
|
= note: the leading underscore helps signal to the reader that the struct may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the struct
is only used through FFI or used only for its effect when dropped)
note: the lint level is defined here
--> $DIR/lint-dead-code-3.rs:4:9
|
Expand All @@ -14,25 +17,41 @@ error: associated function is never used: `foo`
--> $DIR/lint-dead-code-3.rs:16:8
|
LL | fn foo(&self) {
| ^^^
| ^^^ help: if this is intentional, prefix it with an underscore: `_foo`
|
= note: the leading underscore helps signal to the reader that the associated function may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the associated function
is only used through FFI or used only for its effect when dropped)

error: function is never used: `bar`
--> $DIR/lint-dead-code-3.rs:21:4
|
LL | fn bar() {
| ^^^
| ^^^ help: if this is intentional, prefix it with an underscore: `_bar`
|
= note: the leading underscore helps signal to the reader that the function may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the function
is only used through FFI or used only for its effect when dropped)

error: enum is never used: `c_void`
--> $DIR/lint-dead-code-3.rs:60:6
|
LL | enum c_void {}
| ^^^^^^
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_void`
|
= note: the leading underscore helps signal to the reader that the enum may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the enum
is only used through FFI or used only for its effect when dropped)

error: function is never used: `free`
--> $DIR/lint-dead-code-3.rs:62:5
|
LL | fn free(p: *const c_void);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_free`
|
= note: the leading underscore helps signal to the reader that the function may still serve
a purpose even if it isn't used in a way that we can detect (e.g. the function
is only used through FFI or used only for its effect when dropped)

error: aborting due to 5 previous errors

Loading