6 files changed +88
-4
lines changed Original file line number Diff line number Diff line change 43
43
#
44
44
# FIXME: need a scheme for changing this `nightly` value to `beta` and `stable`
45
45
# either automatically or manually.
46
- export RUST_RELEASE_CHANNEL=beta
46
+ export RUST_RELEASE_CHANNEL=stable
47
47
if [ " $DEPLOY$DEPLOY_ALT " != " " ]; then
48
48
RUST_CONFIGURE_ARGS=" $RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNEL "
49
49
RUST_CONFIGURE_ARGS=" $RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
Original file line number Diff line number Diff line change @@ -1403,15 +1403,27 @@ pub fn checked_type_of<'a, 'tcx>(
1403
1403
if !fail {
1404
1404
return None ;
1405
1405
}
1406
- bug ! ( "unexpected const parent path def {:?}" , x) ;
1406
+ tcx. sess . delay_span_bug (
1407
+ DUMMY_SP ,
1408
+ & format ! (
1409
+ "unexpected const parent path def {:?}" , x
1410
+ ) ,
1411
+ ) ;
1412
+ tcx. types . err
1407
1413
}
1408
1414
}
1409
1415
}
1410
1416
x => {
1411
1417
if !fail {
1412
1418
return None ;
1413
1419
}
1414
- bug ! ( "unexpected const parent path {:?}" , x) ;
1420
+ tcx. sess . delay_span_bug (
1421
+ DUMMY_SP ,
1422
+ & format ! (
1423
+ "unexpected const parent path {:?}" , x
1424
+ ) ,
1425
+ ) ;
1426
+ tcx. types . err
1415
1427
}
1416
1428
}
1417
1429
}
@@ -1420,7 +1432,13 @@ pub fn checked_type_of<'a, 'tcx>(
1420
1432
if !fail {
1421
1433
return None ;
1422
1434
}
1423
- bug ! ( "unexpected const parent in type_of_def_id(): {:?}" , x) ;
1435
+ tcx. sess . delay_span_bug (
1436
+ DUMMY_SP ,
1437
+ & format ! (
1438
+ "unexpected const parent in type_of_def_id(): {:?}" , x
1439
+ ) ,
1440
+ ) ;
1441
+ tcx. types . err
1424
1442
}
1425
1443
}
1426
1444
}
Original file line number Diff line number Diff line change
1
+ // The test is failing on 1.35.0 stable but that's not important since the ICE happens only with
2
+ // the feature gate enabled, thus it doesn't affect stable.
3
+ // https://github.com/rust-lang/rust/pull/60710#issuecomment-493662676
4
+ //
5
+ // ignore-test
6
+
7
+ #![ feature( const_generics) ]
8
+ //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
9
+
10
+ // We should probably be able to infer the types here. However, this test is checking that we don't
11
+ // get an ICE in this case. It may be modified later to not be an error.
12
+
13
+ struct Foo < const NUM_BYTES : usize > ( pub [ u8 ; NUM_BYTES ] ) ;
14
+
15
+ fn main ( ) {
16
+ let _ = Foo :: < 3 > ( [ 1 , 2 , 3 ] ) ; //~ ERROR type annotations needed
17
+ }
Original file line number Diff line number Diff line change
1
+ warning: the feature `const_generics` is incomplete and may cause the compiler to crash
2
+ --> $DIR/cannot-infer-type-for-const-param.rs:1:12
3
+ |
4
+ LL | #![feature(const_generics)]
5
+ | ^^^^^^^^^^^^^^
6
+
7
+ error[E0282]: type annotations needed
8
+ --> $DIR/cannot-infer-type-for-const-param.rs:10:19
9
+ |
10
+ LL | let _ = Foo::<3>([1, 2, 3]);
11
+ | ^ cannot infer type for `{integer}`
12
+
13
+ error: aborting due to previous error
14
+
15
+ For more information about this error, try `rustc --explain E0282`.
Original file line number Diff line number Diff line change
1
+ use std:: convert:: TryInto ;
2
+
3
+ struct S ;
4
+
5
+ fn main ( ) {
6
+ let _: u32 = 5i32 . try_into :: < 32 > ( ) . unwrap ( ) ; //~ ERROR wrong number of const arguments
7
+ S . f :: < 0 > ( ) ; //~ ERROR no method named `f`
8
+ S :: < 0 > ; //~ ERROR wrong number of const arguments
9
+ }
Original file line number Diff line number Diff line change
1
+ error[E0107]: wrong number of const arguments: expected 0, found 1
2
+ --> $DIR/invalid-const-arg-for-type-param.rs:6:34
3
+ |
4
+ LL | let _: u32 = 5i32.try_into::<32>().unwrap();
5
+ | ^^ unexpected const argument
6
+
7
+ error[E0599]: no method named `f` found for type `S` in the current scope
8
+ --> $DIR/invalid-const-arg-for-type-param.rs:7:7
9
+ |
10
+ LL | struct S;
11
+ | --------- method `f` not found for this
12
+ ...
13
+ LL | S.f::<0>();
14
+ | ^
15
+
16
+ error[E0107]: wrong number of const arguments: expected 0, found 1
17
+ --> $DIR/invalid-const-arg-for-type-param.rs:8:9
18
+ |
19
+ LL | S::<0>;
20
+ | ^ unexpected const argument
21
+
22
+ error: aborting due to 3 previous errors
23
+
24
+ Some errors occurred: E0107, E0599.
25
+ For more information about an error, try `rustc --explain E0107`.
0 commit comments