Skip to content

Commit d0babd8

Browse files
committed
Auto merge of #159350 - JonathanBrouwer:rollup-V056aOq, r=JonathanBrouwer
Rollup of 2 pull requests Successful merges: - #158764 (Improve E0277 for imperfect derives) - #159345 (std: upgrade `addr2line`, `object`, `miniz_oxide`)
2 parents 2118366 + abc46f4 commit d0babd8

11 files changed

Lines changed: 42 additions & 28 deletions

File tree

compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4258,9 +4258,11 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
42584258
err.span_note(spans, msg);
42594259
if derived && trait_name != "Copy" {
42604260
err.help(format!(
4261-
"consider manually implementing `{trait_name}` to avoid undesired \
4262-
bounds",
4261+
"consider manually implementing `{trait_name}` to avoid undesired bounds caused by \"imperfect derives\"",
42634262
));
4263+
err.note(
4264+
"to learn more, visit <https://github.com/rust-lang/rust/issues/26925>",
4265+
);
42644266
}
42654267
point_at_assoc_type_restriction(
42664268
tcx,

library/Cargo.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ version = 4
44

55
[[package]]
66
name = "addr2line"
7-
version = "0.25.1"
7+
version = "0.27.0"
88
source = "registry+https://github.com/rust-lang/crates.io-index"
9-
checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b"
9+
checksum = "efe1709241908a54ef1925c6018f41d3f523d0cfe174719761eb39e7b7bf086a"
1010
dependencies = [
1111
"gimli",
1212
"rustc-std-workspace-alloc",
@@ -115,9 +115,9 @@ dependencies = [
115115

116116
[[package]]
117117
name = "gimli"
118-
version = "0.32.3"
118+
version = "0.34.0"
119119
source = "registry+https://github.com/rust-lang/crates.io-index"
120-
checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7"
120+
checksum = "1033caf0b349c518623b5396bfb2cf0bddf44f0306d543a250e5743297aafd10"
121121
dependencies = [
122122
"rustc-std-workspace-alloc",
123123
"rustc-std-workspace-core",
@@ -164,9 +164,9 @@ dependencies = [
164164

165165
[[package]]
166166
name = "miniz_oxide"
167-
version = "0.8.9"
167+
version = "0.9.1"
168168
source = "registry+https://github.com/rust-lang/crates.io-index"
169-
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
169+
checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c"
170170
dependencies = [
171171
"adler2",
172172
"rustc-std-workspace-alloc",
@@ -185,9 +185,9 @@ dependencies = [
185185

186186
[[package]]
187187
name = "object"
188-
version = "0.37.3"
188+
version = "0.39.1"
189189
source = "registry+https://github.com/rust-lang/crates.io-index"
190-
checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe"
190+
checksum = "2e5a6c098c7a3b6547378093f5cc30bc54fd361ce711e05293a5cc589562739b"
191191
dependencies = [
192192
"memchr",
193193
"rustc-std-workspace-alloc",
@@ -390,9 +390,9 @@ dependencies = [
390390

391391
[[package]]
392392
name = "unwinding"
393-
version = "0.2.8"
393+
version = "0.2.10"
394394
source = "registry+https://github.com/rust-lang/crates.io-index"
395-
checksum = "60612c845ef41699f39dc8c5391f252942c0a88b7d15da672eff0d14101bbd6d"
395+
checksum = "4b134ada16dda9e435abe2a6d76a01d497bc60707357845a15f9b0ed42dc88ce"
396396
dependencies = [
397397
"gimli",
398398
"rustc-std-workspace-core",

library/std/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ std_detect = { path = "../std_detect", public = true }
2929
rustc-demangle = { version = "0.1.28", features = ['rustc-dep-of-std'] }
3030

3131
[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
32-
miniz_oxide = { version = "0.8.0", optional = true, default-features = false }
33-
addr2line = { version = "0.25.0", optional = true, default-features = false }
32+
miniz_oxide = { version = "0.9.0", optional = true, default-features = false }
33+
addr2line = { version = "0.27.0", optional = true, default-features = false }
3434

3535
[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
3636
libc = { version = "0.2.185", default-features = false, features = [
3737
'rustc-dep-of-std',
3838
], public = true }
3939

4040
[target.'cfg(all(not(target_os = "aix"), not(all(windows, target_env = "msvc", not(target_vendor = "uwp")))))'.dependencies]
41-
object = { version = "0.37.1", default-features = false, optional = true, features = [
41+
object = { version = "0.39", default-features = false, optional = true, features = [
4242
'read_core',
4343
'elf',
4444
'macho',
@@ -48,7 +48,7 @@ object = { version = "0.37.1", default-features = false, optional = true, featur
4848
] }
4949

5050
[target.'cfg(target_os = "aix")'.dependencies]
51-
object = { version = "0.37.1", default-features = false, optional = true, features = [
51+
object = { version = "0.39", default-features = false, optional = true, features = [
5252
'read_core',
5353
'xcoff',
5454
'unaligned',

tests/ui/associated-types/issue-38821.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ LL | pub enum ColumnInsertValue<Col, Expr> where
108108
...
109109
LL | Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>,
110110
| ------------------------------------------------ unsatisfied trait bound
111-
= help: consider manually implementing `Debug` to avoid undesired bounds
111+
= help: consider manually implementing `Debug` to avoid undesired bounds caused by "imperfect derives"
112+
= note: to learn more, visit <https://github.com/rust-lang/rust/issues/26925>
112113
help: consider further restricting the associated type
113114
|
114115
LL | Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>, <Col as Expression>::SqlType: NotNull,
@@ -238,7 +239,8 @@ LL | pub enum ColumnInsertValue<Col, Expr> where
238239
...
239240
LL | Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>,
240241
| ------------------------------------------------ unsatisfied trait bound
241-
= help: consider manually implementing `Clone` to avoid undesired bounds
242+
= help: consider manually implementing `Clone` to avoid undesired bounds caused by "imperfect derives"
243+
= note: to learn more, visit <https://github.com/rust-lang/rust/issues/26925>
242244
help: consider further restricting the associated type
243245
|
244246
LL | Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>, <Col as Expression>::SqlType: NotNull,

tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
6767
| ----- in this derive macro expansion
6868
LL | struct Bar<T>(T);
6969
| ^^^ - unsatisfied trait bound
70-
= help: consider manually implementing `Debug` to avoid undesired bounds
70+
= help: consider manually implementing `Debug` to avoid undesired bounds caused by "imperfect derives"
71+
= note: to learn more, visit <https://github.com/rust-lang/rust/issues/26925>
7172
= note: 2 redundant requirements hidden
7273
= note: required for `&&'static Bar<(dyn Debug + 'static)>` to implement `Debug`
7374
= note: required for the cast from `&&&'static Bar<(dyn Debug + 'static)>` to `&dyn Debug`
@@ -102,7 +103,8 @@ LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
102103
| -- in this derive macro expansion
103104
LL | struct Bar<T>(T);
104105
| ^^^ - type parameter would need to implement `Eq`
105-
= help: consider manually implementing `Eq` to avoid undesired bounds
106+
= help: consider manually implementing `Eq` to avoid undesired bounds caused by "imperfect derives"
107+
= note: to learn more, visit <https://github.com/rust-lang/rust/issues/26925>
106108
= note: 1 redundant requirement hidden
107109
= note: required for `&'static Bar<dyn Debug>` to implement `Eq`
108110
note: required by a bound in `std::cmp::AssertParamIsEq`

tests/ui/derives/clone-copy/deriving-copyclone.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ LL | #[derive(Copy, Clone)]
3838
| ----- in this derive macro expansion
3939
LL | struct B<T> {
4040
| ^ - type parameter would need to implement `Clone`
41-
= help: consider manually implementing `Clone` to avoid undesired bounds
41+
= help: consider manually implementing `Clone` to avoid undesired bounds caused by "imperfect derives"
42+
= note: to learn more, visit <https://github.com/rust-lang/rust/issues/26925>
4243
note: required by a bound in `is_clone`
4344
--> $DIR/deriving-copyclone.rs:19:16
4445
|

tests/ui/derives/redundant-derive-note-on-unimplemented.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ LL | #[derive(Debug)]
2121
| ----- in this derive macro expansion
2222
LL | struct S<T>(T);
2323
| ^ - type parameter would need to implement `Debug`
24-
= help: consider manually implementing `Debug` to avoid undesired bounds
24+
= help: consider manually implementing `Debug` to avoid undesired bounds caused by "imperfect derives"
25+
= note: to learn more, visit <https://github.com/rust-lang/rust/issues/26925>
2526
help: consider annotating `X` with `#[derive(Debug)]`
2627
|
2728
LL + #[derive(Debug)]

tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ LL | #[derive(PartialOrd, AddImpl)]
4444
...
4545
LL | struct PriorityQueue<T>(BinaryHeap<PriorityQueueEntry<T>>);
4646
| ^^^^^^^^^^^^^ - type parameter would need to implement `PartialOrd`
47-
= help: consider manually implementing `PartialOrd` to avoid undesired bounds
47+
= help: consider manually implementing `PartialOrd` to avoid undesired bounds caused by "imperfect derives"
48+
= note: to learn more, visit <https://github.com/rust-lang/rust/issues/26925>
4849
note: required by a bound in `Ord`
4950
--> $SRC_DIR/core/src/cmp.rs:LL:COL
5051

tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ LL | #[derive(Debug, Copy, Clone)]
3030
| ----- in this derive macro expansion
3131
LL | pub struct Vector2<T: Debug + Copy + Clone> {
3232
| ^^^^^^^ ---- unsatisfied trait bound
33-
= help: consider manually implementing `Debug` to avoid undesired bounds
33+
= help: consider manually implementing `Debug` to avoid undesired bounds caused by "imperfect derives"
34+
= note: to learn more, visit <https://github.com/rust-lang/rust/issues/26925>
3435
= note: required for the cast from `&Vector2<K>` to `&dyn Debug`
3536
help: consider further restricting type parameter `K` with trait `Copy`
3637
|
@@ -72,7 +73,8 @@ LL | #[derive(Debug, Copy, Clone)]
7273
| ----- in this derive macro expansion
7374
LL | pub struct Vector2<T: Debug + Copy + Clone> {
7475
| ^^^^^^^ ---- unsatisfied trait bound
75-
= help: consider manually implementing `Clone` to avoid undesired bounds
76+
= help: consider manually implementing `Clone` to avoid undesired bounds caused by "imperfect derives"
77+
= note: to learn more, visit <https://github.com/rust-lang/rust/issues/26925>
7678
help: consider further restricting type parameter `K` with trait `Copy`
7779
|
7880
LL | pub struct AABB<K: Debug + std::marker::Copy> {

tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ LL | #[derive(Debug, Copy, Clone)]
6666
| ----- in this derive macro expansion
6767
LL | pub struct Vector2<T: Debug + Copy + Clone> {
6868
| ^^^^^^^ ---- unsatisfied trait bound
69-
= help: consider manually implementing `Debug` to avoid undesired bounds
69+
= help: consider manually implementing `Debug` to avoid undesired bounds caused by "imperfect derives"
70+
= note: to learn more, visit <https://github.com/rust-lang/rust/issues/26925>
7071
= note: required for the cast from `&Vector2<K>` to `&dyn Debug`
7172
help: consider restricting type parameter `K` with trait `Copy`
7273
|
@@ -136,7 +137,8 @@ LL | #[derive(Debug, Copy, Clone)]
136137
| ----- in this derive macro expansion
137138
LL | pub struct Vector2<T: Debug + Copy + Clone> {
138139
| ^^^^^^^ ---- unsatisfied trait bound
139-
= help: consider manually implementing `Clone` to avoid undesired bounds
140+
= help: consider manually implementing `Clone` to avoid undesired bounds caused by "imperfect derives"
141+
= note: to learn more, visit <https://github.com/rust-lang/rust/issues/26925>
140142
help: consider restricting type parameter `K` with trait `Copy`
141143
|
142144
LL | pub struct AABB<K: std::marker::Copy> {

0 commit comments

Comments
 (0)