@@ -13,7 +13,7 @@ LL | trait Foo<const N: dyn Bar<2>> {
1313 | +++
1414
1515warning: trait objects without an explicit `dyn` are deprecated
16- --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:11 :20
16+ --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:9 :20
1717 |
1818LL | trait Bar<const M: Foo<2>> {}
1919 | ^^^^^^
@@ -32,7 +32,7 @@ LL | trait Foo<const N: Bar<2>> {
3232 | ^^^^^^^^^^^^^^^
3333 |
3434note: ...which requires computing type of `Bar::M`...
35- --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:11 :11
35+ --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:9 :11
3636 |
3737LL | trait Bar<const M: Foo<2>> {}
3838 | ^^^^^^^^^^^^^^^
@@ -44,69 +44,6 @@ LL | trait Foo<const N: Bar<2>> {
4444 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
4545 = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
4646
47- error[E0038]: the trait `Foo` cannot be made into an object
48- --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:2:24
49- |
50- LL | trait Foo<const N: Bar<2>> {
51- | ^ `Foo` cannot be made into an object
52- |
53- note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
54- --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:8:8
55- |
56- LL | trait Foo<const N: Bar<2>> {
57- | --- this trait cannot be made into an object...
58- ...
59- LL | fn func() {}
60- | ^^^^ ...because associated function `func` has no `self` parameter
61- help: consider turning `func` into a method by giving it a `&self` argument
62- |
63- LL | fn func(&self) {}
64- | +++++
65- help: alternatively, consider constraining `func` so it does not apply to trait objects
66- |
67- LL | fn func() where Self: Sized {}
68- | +++++++++++++++++
69-
70- error: `(dyn Bar<2> + 'static)` is forbidden as the type of a const generic parameter
71- --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:2:20
72- |
73- LL | trait Foo<const N: Bar<2>> {
74- | ^^^^^^
75- |
76- = note: the only supported types are integers, `bool`, and `char`
77-
78- error[E0038]: the trait `Foo` cannot be made into an object
79- --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:11:11
80- |
81- LL | trait Bar<const M: Foo<2>> {}
82- | ^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
83- |
84- note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
85- --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:8:8
86- |
87- LL | trait Foo<const N: Bar<2>> {
88- | --- this trait cannot be made into an object...
89- ...
90- LL | fn func() {}
91- | ^^^^ ...because associated function `func` has no `self` parameter
92- help: consider turning `func` into a method by giving it a `&self` argument
93- |
94- LL | fn func(&self) {}
95- | +++++
96- help: alternatively, consider constraining `func` so it does not apply to trait objects
97- |
98- LL | fn func() where Self: Sized {}
99- | +++++++++++++++++
100-
101- error: `(dyn Foo<2> + 'static)` is forbidden as the type of a const generic parameter
102- --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:11:20
103- |
104- LL | trait Bar<const M: Foo<2>> {}
105- | ^^^^^^
106- |
107- = note: the only supported types are integers, `bool`, and `char`
108-
109- error: aborting due to 5 previous errors; 2 warnings emitted
47+ error: aborting due to 1 previous error; 2 warnings emitted
11048
111- Some errors have detailed explanations: E0038, E0391.
112- For more information about an error, try `rustc --explain E0038`.
49+ For more information about this error, try `rustc --explain E0391`.
0 commit comments