File tree 4 files changed +15
-8
lines changed
rustc_const_eval/src/interpret
src/test/ui/const-generics/issues
4 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 13
13
T : TypeVisitable < ' tcx > ,
14
14
{
15
15
debug ! ( "ensure_monomorphic_enough: ty={:?}" , ty) ;
16
- if !( ty. needs_subst ( ) || ty. has_opaque_types ( ) ) {
16
+ if !( ty. needs_subst ( ) || ty. has_opaque_types ( ) ) {
17
17
return Ok ( ( ) ) ;
18
18
}
19
19
Original file line number Diff line number Diff line change @@ -279,7 +279,11 @@ fn resolve_associated_item<'tcx>(
279
279
280
280
// If the item does not have a value, then we cannot return an instance.
281
281
if !leaf_def. item . defaultness ( tcx) . has_value ( ) {
282
- return Ok ( None ) ;
282
+ let guard = tcx. sess . delay_span_bug (
283
+ tcx. def_span ( leaf_def. item . def_id ) ,
284
+ "missing value for assoc item in impl" ,
285
+ ) ;
286
+ return Err ( guard) ;
283
287
}
284
288
285
289
let substs = tcx. erase_regions ( substs) ;
Original file line number Diff line number Diff line change @@ -4,13 +4,12 @@ trait Trait {
4
4
const N : usize ;
5
5
}
6
6
7
- // FIXME: We should mention that `N` is missing
8
7
impl const Trait for i32 { }
8
+ //~^ ERROR not all trait items implemented, missing: `N`
9
9
10
10
fn f ( )
11
11
where
12
12
[ ( ) ; <i32 as Trait >:: N ] : ,
13
- //~^ ERROR unable to use constant with a hidden value in the type system
14
13
{ }
15
14
16
15
fn main ( ) { }
Original file line number Diff line number Diff line change 1
- error: unable to use constant with a hidden value in the type system
2
- --> $DIR/issue-98629.rs:11:5
1
+ error[E0046]: not all trait items implemented, missing: `N`
2
+ --> $DIR/issue-98629.rs:7:1
3
3
|
4
- LL | [(); <i32 as Trait>::N]:,
5
- | ^^^^^^^^^^^^^^^^^^^^^^^
4
+ LL | const N: usize;
5
+ | -------------- `N` from trait
6
+ ...
7
+ LL | impl const Trait for i32 {}
8
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ missing `N` in implementation
6
9
7
10
error: aborting due to previous error
8
11
12
+ For more information about this error, try `rustc --explain E0046`.
You can’t perform that action at this time.
0 commit comments