Regenerate tests

This commit is contained in:
Oliver Schneider 2018-03-05 10:21:11 +01:00
parent 6cfda078bf
commit aedd4c61ea
No known key found for this signature in database
GPG Key ID: A69F8D225B3AD7D9
34 changed files with 255 additions and 291 deletions

21
src/Cargo.lock generated
View File

@ -1858,20 +1858,6 @@ dependencies = [
"syntax_pos 0.0.0",
]
[[package]]
name = "rustc_const_eval"
version = "0.0.0"
dependencies = [
"arena 0.0.0",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_const_math 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
"syntax 0.0.0",
"syntax_pos 0.0.0",
]
[[package]]
name = "rustc_const_math"
version = "0.0.0"
@ -1914,7 +1900,6 @@ dependencies = [
"rustc_allocator 0.0.0",
"rustc_back 0.0.0",
"rustc_borrowck 0.0.0",
"rustc_const_eval 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
"rustc_incremental 0.0.0",
@ -1964,7 +1949,7 @@ version = "0.0.0"
dependencies = [
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_const_eval 0.0.0",
"rustc_mir 0.0.0",
"syntax 0.0.0",
"syntax_pos 0.0.0",
]
@ -2012,6 +1997,7 @@ dependencies = [
name = "rustc_mir"
version = "0.0.0"
dependencies = [
"arena 0.0.0",
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"graphviz 0.0.0",
@ -2020,7 +2006,6 @@ dependencies = [
"rustc 0.0.0",
"rustc_apfloat 0.0.0",
"rustc_back 0.0.0",
"rustc_const_eval 0.0.0",
"rustc_const_math 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
@ -2046,10 +2031,10 @@ version = "0.0.0"
dependencies = [
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_const_eval 0.0.0",
"rustc_const_math 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
"rustc_mir 0.0.0",
"syntax 0.0.0",
"syntax_pos 0.0.0",
]

View File

@ -61,10 +61,10 @@ for ty::subst::Kind<'gcx> {
}
}
impl<'gcx> HashStable<StableHashingContext<'gcx>>
impl<'a, 'gcx> HashStable<StableHashingContext<'a>>
for ty::subst::UnpackedKind<'gcx> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'gcx>,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
match self {
ty::subst::UnpackedKind::Lifetime(lt) => lt.hash_stable(hcx, hasher),

View File

@ -362,6 +362,7 @@ impl<'sess> OnDiskCache<'sess> {
cnum_map: cnum_map.as_ref().unwrap(),
file_index_to_file: &self.file_index_to_file,
file_index_to_stable_id: &self.file_index_to_stable_id,
synthetic_expansion_infos: &self.synthetic_expansion_infos,
interpret_alloc_cache: FxHashMap::default(),
};

View File

@ -36,7 +36,7 @@ use rustc_typeck as typeck;
use rustc_privacy;
use rustc_plugin::registry::Registry;
use rustc_plugin as plugin;
use rustc_passes::{self, ast_validation, loops, consts, hir_stats};
use rustc_passes::{self, ast_validation, loops, rvalue_promotion, hir_stats};
use super::Compilation;
use serialize::json;

View File

@ -373,13 +373,17 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
PatternKind::Constant { value: hi }) => {
use std::cmp::Ordering;
match (end, compare_const_vals(&lo.val, &hi.val, ty).unwrap()) {
(RangeEnd::Excluded, Ordering::Less) => {},
(RangeEnd::Excluded, _) => span_err!(
self.tcx.sess,
lo_expr.span,
E0579,
"lower range bound must be less than upper",
),
(RangeEnd::Excluded, Ordering::Less) =>
PatternKind::Range { lo, hi, end },
(RangeEnd::Excluded, _) => {
span_err!(
self.tcx.sess,
lo_expr.span,
E0579,
"lower range bound must be less than upper",
);
PatternKind::Wild
},
(RangeEnd::Included, Ordering::Greater) => {
let mut err = struct_span_err!(
self.tcx.sess,
@ -399,10 +403,10 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
to be less than or equal to the end of the range.");
}
err.emit();
PatternKind::Wild
},
(RangeEnd::Included, _) => {}
(RangeEnd::Included, _) => PatternKind::Range { lo, hi, end },
}
PatternKind::Range { lo, hi, end }
}
_ => PatternKind::Wild
}

View File

@ -1090,8 +1090,7 @@ fn collect_miri<'a, 'tcx>(
let instance = Instance::mono(tcx, did);
if should_monomorphize_locally(tcx, &instance) {
trace!("collecting static {:?}", did);
let node_id = tcx.hir.as_local_node_id(did).unwrap();
output.push(MonoItem::Static(node_id));
output.push(MonoItem::Static(did));
}
} else if let Some(alloc) = tcx.interpret_interner.get_alloc(alloc_id) {
trace!("collecting {:?} with {:#?}", alloc_id, alloc);

View File

@ -203,7 +203,7 @@ impl MirPass for RestoreSubsliceArrayMoveOut {
let opt_size = opt_src_place.and_then(|src_place| {
let src_ty = src_place.ty(mir, tcx).to_ty(tcx);
if let ty::TyArray(_, ref size_o) = src_ty.sty {
size_o.val.to_const_int().and_then(|v| v.to_u64())
size_o.val.to_raw_bits().map(|n| n as u64)
} else {
None
}

View File

@ -32,7 +32,7 @@ use rustc::middle::expr_use_visitor as euv;
use rustc::middle::mem_categorization as mc;
use rustc::middle::mem_categorization::Categorization;
use rustc::ty::{self, Ty, TyCtxt};
use rustc::ty::maps::{queries, Providers};
use rustc::ty::maps::Providers;
use rustc::ty::subst::Substs;
use rustc::traits::Reveal;
use rustc::util::nodemap::{ItemLocalSet, NodeSet};
@ -325,16 +325,7 @@ fn check_expr<'a, 'tcx>(v: &mut CheckCrateVisitor<'a, 'tcx>, e: &hir::Expr, node
// Don't peek inside trait associated constants.
false
} else {
queries::const_is_rvalue_promotable_to_static::try_get(v.tcx, e.span, did)
.unwrap_or_else(|mut err| {
// A cycle between constants ought to be reported elsewhere.
err.cancel();
v.tcx.sess.delay_span_bug(
e.span,
&format!("cycle encountered during const qualification: {:?}",
did));
false
})
v.tcx.at(e.span).const_is_rvalue_promotable_to_static(did)
};
// Just in case the type is more specific than the definition,

View File

@ -5,7 +5,7 @@ LL | const NEG_NEG_128: i8 = -NEG_128;
| ^^^^^^^^ attempt to negate with overflow
|
note: for pattern here
--> $DIR/const-eval-overflow-2.rs:27:9
--> $DIR/const-eval-overflow-2.rs:26:9
|
LL | NEG_NEG_128 => println!("A"),
| ^^^^^^^^^^^

View File

@ -1,11 +1,3 @@
warning: constant evaluation error: attempt to add with overflow
--> $DIR/const-eval-overflow-4.rs:23:13
|
LL | : [u32; (i8::MAX as i8 + 1i8) as usize]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(const_err)] on by default
error[E0080]: constant evaluation error
--> $DIR/const-eval-overflow-4.rs:23:13
|

View File

@ -1,26 +1,15 @@
error[E0080]: constant evaluation error
--> $DIR/conditional_array_execution.rs:16:20
|
LL | println!("{}", FOO); //~ E0080
| ^^^ referenced constant has errors
error[E0080]: constant evaluation error
--> $DIR/conditional_array_execution.rs:13:19
|
13 | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; //~ E0080
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; //~ E0080
| ^^^^^ attempt to subtract with overflow
|
note: inside call to FOO
--> $DIR/conditional_array_execution.rs:13:1
|
13 | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; //~ E0080
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0080]: constant evaluation error
--> $DIR/conditional_array_execution.rs:16:20
|
16 | println!("{}", FOO); //~ E0080
| ^^^ attempt to subtract with overflow
|
note: inside call to main
--> $DIR/conditional_array_execution.rs:16:20
|
16 | println!("{}", FOO); //~ E0080
| ^^^
error: aborting due to 2 previous errors
If you want more information on this error, try using "rustc --explain E0080"

View File

@ -0,0 +1,9 @@
error[E0080]: constant evaluation error
--> $DIR/index_out_of_bound.rs:11:19
|
LL | static FOO: i32 = [][0];
| ^^^^^ index out of bounds: the len is 0 but the index is 0 at $DIR/index_out_of_bound.rs:11:19: 11:24
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0080"

View File

@ -1,16 +1,20 @@
warning: constant evaluation error: attempt to subtract with overflow
--> $DIR/issue-43197.rs:18:20
error[E0080]: constant evaluation error
--> $DIR/issue-43197.rs:20:23
|
LL | const X: u32 = 0-1; //~ ERROR constant evaluation error
| ^^^
|
= note: #[warn(const_err)] on by default
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
warning: constant evaluation error: attempt to subtract with overflow
--> $DIR/issue-43197.rs:20:20
error[E0080]: constant evaluation error
--> $DIR/issue-43197.rs:20:26
|
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
error[E0080]: constant evaluation error
--> $DIR/issue-43197.rs:19:24
|
LL | const Y: u32 = foo(0-1); //~ ERROR constant evaluation error
| ^^^^^^^^
| ^^^ attempt to subtract with overflow
error[E0080]: constant evaluation error
--> $DIR/issue-43197.rs:18:20
@ -18,12 +22,6 @@ error[E0080]: constant evaluation error
LL | const X: u32 = 0-1; //~ ERROR constant evaluation error
| ^^^ attempt to subtract with overflow
error[E0080]: constant evaluation error
--> $DIR/issue-43197.rs:20:24
|
LL | const Y: u32 = foo(0-1); //~ ERROR constant evaluation error
| ^^^ attempt to subtract with overflow
error: aborting due to 2 previous errors
error: aborting due to 4 previous errors
If you want more information on this error, try using "rustc --explain E0080"

View File

@ -1,15 +0,0 @@
error[E0080]: constant evaluation error
--> $DIR/const-expr-addr-operator.rs:15:29
|
LL | const X: &'static u32 = &22; //~ ERROR constant evaluation error
| ^^^ unimplemented constant expression: address operator
|
note: for pattern here
--> $DIR/const-expr-addr-operator.rs:17:9
|
LL | X => 0,
| ^
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0080"

View File

@ -1,62 +1,35 @@
<<<<<<< HEAD
warning: constant evaluation error: non-constant path in constant expression
--> $DIR/const-fn-error.rs:27:19
|
LL | let a : [i32; f(X)];
| ^^^^
|
= note: #[warn(const_err)] on by default
error[E0016]: blocks in constant functions are limited to items and tail expressions
--> $DIR/const-fn-error.rs:16:19
|
LL | let mut sum = 0; //~ ERROR blocks in constant functions are limited
=======
error[E0016]: blocks in constant functions are limited to items and tail expressions
--> $DIR/const-fn-error.rs:16:19
|
16 | let mut sum = 0;
>>>>>>> Produce instead of pointers
LL | let mut sum = 0;
| ^
error[E0015]: calls in constant functions are limited to constant functions, struct and enum constructors
--> $DIR/const-fn-error.rs:18:14
|
<<<<<<< HEAD
LL | for i in 0..x { //~ ERROR calls in constant functions
=======
18 | for i in 0..x {
>>>>>>> Report errors in statics during collecting instead of translating
LL | for i in 0..x {
| ^^^^
error[E0019]: constant function contains unimplemented expression type
--> $DIR/const-fn-error.rs:18:14
|
<<<<<<< HEAD
LL | for i in 0..x { //~ ERROR calls in constant functions
=======
18 | for i in 0..x {
>>>>>>> Report errors in statics during collecting instead of translating
LL | for i in 0..x {
| ^^^^
error[E0080]: constant evaluation error
<<<<<<< HEAD
--> $DIR/const-fn-error.rs:21:5
--> $DIR/const-fn-error.rs:18:14
|
LL | sum //~ ERROR E0080
| ^^^ non-constant path in constant expression
LL | for i in 0..x {
| ^^^^ calling non-const fn `<I as std::iter::IntoIterator><std::ops::Range<usize>>::into_iter`
...
LL | let a : [i32; f(X)];
| ---- inside call to `f`
|
note: for constant expression here
--> $DIR/const-fn-error.rs:27:13
--> $DIR/const-fn-error.rs:29:13
|
LL | let a : [i32; f(X)];
| ^^^^^^^^^^^
=======
--> $DIR/const-fn-error.rs:28:19
|
28 | let a : [i32; f(X)];
| ^^^^ miri failed: machine error: Cannot evaluate within constants: "calling non-const fn `<I as std::iter::IntoIterator><std::ops::Range<usize>>::into_iter`"
>>>>>>> Produce instead of pointers
error: aborting due to 4 previous errors

View File

@ -1,23 +1,15 @@
warning: constant evaluation error: attempt to subtract with overflow
--> $DIR/const-len-underflow-separate-spans.rs:17:20
|
LL | const LEN: usize = ONE - TWO;
| ^^^^^^^^^
|
= note: #[warn(const_err)] on by default
error[E0080]: constant evaluation error
--> $DIR/const-len-underflow-separate-spans.rs:17:20
|
LL | const LEN: usize = ONE - TWO;
| ^^^^^^^^^ attempt to subtract with overflow
|
note: for constant expression here
--> $DIR/const-len-underflow-separate-spans.rs:22:12
error[E0080]: constant evaluation error
--> $DIR/const-len-underflow-separate-spans.rs:21:17
|
LL | let a: [i8; LEN] = unimplemented!();
| ^^^^^^^^^
| ^^^ referenced constant has errors
error: aborting due to previous error
error: aborting due to 2 previous errors
If you want more information on this error, try using "rustc --explain E0080"

View File

@ -1,15 +0,0 @@
error[E0080]: constant evaluation error
--> $DIR/const-pattern-not-const-evaluable.rs:22:31
|
LL | const BOO: Pair<Cake, Cake> = Pair(Marmor, BlackForest);
| ^^^^ unimplemented constant expression: tuple struct constructors
|
note: for pattern here
--> $DIR/const-pattern-not-const-evaluable.rs:37:9
|
LL | FOO => println!("hi"),
| ^^^
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0080"

View File

@ -2,65 +2,65 @@ error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:27:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 127i8
| ^^^^ overflowed on value after 127
|
= note: explicitly set `OhNo = -128i8` if that is desired outcome
= note: explicitly set `OhNo = -128` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:36:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 255u8
| ^^^^ overflowed on value after 255
|
= note: explicitly set `OhNo = 0u8` if that is desired outcome
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:45:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 32767i16
| ^^^^ overflowed on value after 32767
|
= note: explicitly set `OhNo = -32768i16` if that is desired outcome
= note: explicitly set `OhNo = -32768` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:54:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 65535u16
| ^^^^ overflowed on value after 65535
|
= note: explicitly set `OhNo = 0u16` if that is desired outcome
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:63:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 2147483647i32
| ^^^^ overflowed on value after 2147483647
|
= note: explicitly set `OhNo = -2147483648i32` if that is desired outcome
= note: explicitly set `OhNo = -2147483648` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:72:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 4294967295u32
| ^^^^ overflowed on value after 4294967295
|
= note: explicitly set `OhNo = 0u32` if that is desired outcome
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:81:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 9223372036854775807i64
| ^^^^ overflowed on value after 9223372036854775807
|
= note: explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
= note: explicitly set `OhNo = -9223372036854775808` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:90:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 18446744073709551615u64
| ^^^^ overflowed on value after 18446744073709551615
|
= note: explicitly set `OhNo = 0u64` if that is desired outcome
= note: explicitly set `OhNo = 0` if that is desired outcome
error: aborting due to 8 previous errors

View File

@ -2,65 +2,65 @@ error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:25:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 127i8
| ^^^^ overflowed on value after 127
|
= note: explicitly set `OhNo = -128i8` if that is desired outcome
= note: explicitly set `OhNo = -128` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:36:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 255u8
| ^^^^ overflowed on value after 255
|
= note: explicitly set `OhNo = 0u8` if that is desired outcome
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:47:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 32767i16
| ^^^^ overflowed on value after 32767
|
= note: explicitly set `OhNo = -32768i16` if that is desired outcome
= note: explicitly set `OhNo = -32768` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:58:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 65535u16
| ^^^^ overflowed on value after 65535
|
= note: explicitly set `OhNo = 0u16` if that is desired outcome
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:70:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 2147483647i32
| ^^^^ overflowed on value after 2147483647
|
= note: explicitly set `OhNo = -2147483648i32` if that is desired outcome
= note: explicitly set `OhNo = -2147483648` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:82:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 4294967295u32
| ^^^^ overflowed on value after 4294967295
|
= note: explicitly set `OhNo = 0u32` if that is desired outcome
= note: explicitly set `OhNo = 0` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:94:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 9223372036854775807i64
| ^^^^ overflowed on value after 9223372036854775807
|
= note: explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
= note: explicitly set `OhNo = -9223372036854775808` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:106:9
|
LL | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 18446744073709551615u64
| ^^^^ overflowed on value after 18446744073709551615
|
= note: explicitly set `OhNo = 0u64` if that is desired outcome
= note: explicitly set `OhNo = 0` if that is desired outcome
error: aborting due to 8 previous errors

View File

@ -11,7 +11,7 @@
// compile-flags: -Z teach
fn main() {
match 5u32 { //~ERROR non-exhaustive patterns: `_` not covered
match 5u32 {
1000 ... 5 => {}
//~^ ERROR lower range bound must be less than or equal to upper
}

View File

@ -10,7 +10,7 @@
fn main() {
match 5u32 { //~ ERROR non-exhaustive patterns
match 5u32 {
1000 ... 5 => {}
//~^ ERROR lower range bound must be less than or equal to upper
}

View File

@ -1,10 +1,10 @@
warning: constant evaluation error: attempt to shift left with overflow
error: bitshift exceeds the type's number of bits
--> $DIR/E0080.rs:12:9
|
LL | X = (1 << 500), //~ ERROR E0080
| ^^^^^^^^^^
|
= note: #[warn(const_err)] on by default
= note: #[deny(exceeding_bitshifts)] on by default
error[E0080]: constant evaluation error
--> $DIR/E0080.rs:12:9
@ -12,18 +12,26 @@ error[E0080]: constant evaluation error
LL | X = (1 << 500), //~ ERROR E0080
| ^^^^^^^^^^ attempt to shift left with overflow
warning: constant evaluation error: attempt to divide by zero
--> $DIR/E0080.rs:14:9
warning: constant evaluation error
--> $DIR/E0080.rs:15:9
|
LL | Y = (1 / 0) //~ ERROR E0080
| ^^^^^^^
| ^^^^^^^ attempt to divide by zero
|
= note: #[warn(const_err)] on by default
warning: constant evaluation error
--> $DIR/E0080.rs:15:9
|
LL | Y = (1 / 0) //~ ERROR E0080
| ^^^^^^^ attempted to do overflowing math
error[E0080]: constant evaluation error
--> $DIR/E0080.rs:14:9
--> $DIR/E0080.rs:15:9
|
LL | Y = (1 / 0) //~ ERROR E0080
| ^^^^^^^ attempt to divide by zero
error: aborting due to 2 previous errors
error: aborting due to 3 previous errors
If you want more information on this error, try using "rustc --explain E0080"

View File

@ -1,10 +1,10 @@
error[E0081]: discriminant value `3isize` already exists
error[E0081]: discriminant value `3` already exists
--> $DIR/E0081.rs:13:9
|
LL | P = 3,
| - first use of `3isize`
| - first use of `3`
LL | X = 3,
| ^ enum already has `3isize`
| ^ enum already has `3`
error: aborting due to previous error

View File

@ -2,9 +2,9 @@ error[E0370]: enum discriminant overflowed
--> $DIR/E0370.rs:17:5
|
LL | Y, //~ ERROR E0370
| ^ overflowed on value after 9223372036854775807i64
| ^ overflowed on value after 9223372036854775807
|
= note: explicitly set `Y = -9223372036854775808i64` if that is desired outcome
= note: explicitly set `Y = -9223372036854775808` if that is desired outcome
error: aborting due to previous error

View File

@ -1,9 +0,0 @@
error[E0080]: constant evaluation error
--> $DIR/feature-gate-const-indexing.rs:16:24
|
LL | const BLUB: [i32; (ARR[0] - 41) as usize] = [5]; //~ ERROR constant evaluation error
| ^^^^^^ the index operation on const values is unstable
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0080"

View File

@ -1,8 +1,72 @@
error[E0080]: constant evaluation error
--> $DIR/infinite-recursion-const-fn.rs:16:18
--> $DIR/infinite-recursion-const-fn.rs:14:25
|
16 | const ARR: [i32; a()] = [5; 6]; //~ ERROR constant evaluation error
| ^^^ miri failed: reached the configured maximum number of stack frames
LL | const fn a() -> usize { b() } //~ ERROR constant evaluation error
| ^^^
| |
| reached the configured maximum number of stack frames
| inside call to `b`
LL | const fn b() -> usize { a() }
| ---
| |
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
| inside call to `a`
LL | const ARR: [i32; a()] = [5; 6];
| --- inside call to `a`
|
note: for constant expression here
--> $DIR/infinite-recursion-const-fn.rs:16:1
|
LL | const ARR: [i32; a()] = [5; 6];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0080"

View File

@ -1,28 +1,28 @@
error[E0081]: discriminant value `1isize` already exists
error[E0081]: discriminant value `1` already exists
--> $DIR/issue-15524.rs:15:9
|
LL | A = 1,
| - first use of `1isize`
| - first use of `1`
LL | B = 1,
| ^ enum already has `1isize`
| ^ enum already has `1`
error[E0081]: discriminant value `1isize` already exists
error[E0081]: discriminant value `1` already exists
--> $DIR/issue-15524.rs:18:5
|
LL | A = 1,
| - first use of `1isize`
| - first use of `1`
...
LL | D,
| ^ enum already has `1isize`
| ^ enum already has `1`
error[E0081]: discriminant value `1isize` already exists
error[E0081]: discriminant value `1` already exists
--> $DIR/issue-15524.rs:21:9
|
LL | A = 1,
| - first use of `1isize`
| - first use of `1`
...
LL | E = N,
| ^ enum already has `1isize`
| ^ enum already has `1`
error: aborting due to 3 previous errors

View File

@ -5,10 +5,15 @@ LL | A = X::A as isize, //~ ERROR E0391
| ^^^^^^^^^^^^^ cyclic reference
|
note: the cycle begins when const-evaluating `X::A::{{initializer}}`...
--> $DIR/issue-23302-1.rs:14:5
--> $DIR/issue-23302-1.rs:14:9
|
LL | A = X::A as isize, //~ ERROR E0391
| ^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^
note: ...which then requires computing layout of `X`...
--> $DIR/issue-23302-1.rs:14:9
|
LL | A = X::A as isize, //~ ERROR E0391
| ^^^^
= note: ...which then again requires const-evaluating `X::A::{{initializer}}`, completing the cycle.
error: aborting due to previous error

View File

@ -5,10 +5,15 @@ LL | A = Y::B as isize, //~ ERROR E0391
| ^^^^^^^^^^^^^ cyclic reference
|
note: the cycle begins when const-evaluating `Y::A::{{initializer}}`...
--> $DIR/issue-23302-2.rs:14:5
--> $DIR/issue-23302-2.rs:14:9
|
LL | A = Y::B as isize, //~ ERROR E0391
| ^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^
note: ...which then requires computing layout of `Y`...
--> $DIR/issue-23302-2.rs:14:9
|
LL | A = Y::B as isize, //~ ERROR E0391
| ^^^^
= note: ...which then again requires const-evaluating `Y::A::{{initializer}}`, completing the cycle.
error: aborting due to previous error

View File

@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
const A: i32 = B; //~ ERROR E0391
const A: i32 = B;
const B: i32 = A;
const B: i32 = A; //~ ERROR cyclic dependency detected
fn main() { }

View File

@ -1,20 +1,30 @@
error[E0391]: cyclic dependency detected
--> $DIR/issue-23302-3.rs:11:16
|
LL | const A: i32 = B; //~ ERROR E0391
| ^ cyclic reference
|
note: the cycle begins when processing `B`...
--> $DIR/issue-23302-3.rs:13:1
|
LL | const B: i32 = A;
| ^^^^^^^^^^^^^^^^^
note: ...which then requires processing `A`...
--> $DIR/issue-23302-3.rs:13:16
|
LL | const B: i32 = A;
LL | const B: i32 = A; //~ ERROR cyclic dependency detected
| ^ cyclic reference
|
note: the cycle begins when const checking if rvalue is promotable to static `A`...
--> $DIR/issue-23302-3.rs:11:1
|
LL | const A: i32 = B;
| ^^^^^^^^^^^^^^^^^
note: ...which then requires checking which parts of `A` are promotable to static...
--> $DIR/issue-23302-3.rs:11:1
|
LL | const A: i32 = B;
| ^^^^^^^^^^^^^^^^^
note: ...which then requires const checking if rvalue is promotable to static `B`...
--> $DIR/issue-23302-3.rs:11:16
|
LL | const A: i32 = B;
| ^
= note: ...which then again requires processing `B`, completing the cycle.
note: ...which then requires checking which parts of `B` are promotable to static...
--> $DIR/issue-23302-3.rs:13:1
|
LL | const B: i32 = A; //~ ERROR cyclic dependency detected
| ^^^^^^^^^^^^^^^^^
= note: ...which then again requires const checking if rvalue is promotable to static `A`, completing the cycle.
error: aborting due to previous error

View File

@ -5,15 +5,25 @@ LL | B = A, //~ ERROR E0391
| ^ cyclic reference
|
note: the cycle begins when const-evaluating `Foo::B::{{initializer}}`...
--> $DIR/issue-36163.rs:14:5
|
LL | B = A, //~ ERROR E0391
| ^^^^^
note: ...which then requires const-evaluating `A`...
--> $DIR/issue-36163.rs:14:9
|
LL | B = A, //~ ERROR E0391
| ^
note: ...which then requires processing `Foo::B::{{initializer}}`...
--> $DIR/issue-36163.rs:14:9
|
LL | B = A, //~ ERROR E0391
| ^
note: ...which then requires const-evaluating `A`...
--> $DIR/issue-36163.rs:11:1
|
LL | const A: isize = Foo::B as isize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which then requires computing layout of `Foo`...
--> $DIR/issue-36163.rs:11:18
|
LL | const A: isize = Foo::B as isize;
| ^^^^^^
= note: ...which then again requires const-evaluating `Foo::B::{{initializer}}`, completing the cycle.
error: aborting due to previous error

View File

@ -1,15 +0,0 @@
error[E0080]: constant evaluation error
--> $DIR/auxiliary/issue_38875_b.rs:11:24
|
LL | pub const FOO: usize = *&0;
| ^^^ unimplemented constant expression: deref operation
|
note: for constant expression here
--> $DIR/issue_38875.rs:16:22
|
LL | let test_x = [0; issue_38875_b::FOO];
| ^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0080"

View File

@ -1,17 +0,0 @@
warning: constant evaluation error: nonexistent struct field
--> $DIR/union-const-eval.rs:21:21
|
LL | let b: [u8; C.b]; //~ ERROR constant evaluation error
| ^^^
|
= note: #[warn(const_err)] on by default
error[E0080]: constant evaluation error
--> $DIR/union-const-eval.rs:21:21
|
LL | let b: [u8; C.b]; //~ ERROR constant evaluation error
| ^^^ nonexistent struct field
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0080"