Merge branch 'master' into issue-32540
This commit is contained in:
commit
dedb7bbbbf
664 changed files with 11577 additions and 8696 deletions
41
src/test/codegen/panic-abort-windows.rs
Normal file
41
src/test/codegen/panic-abort-windows.rs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-tidy-linelength
|
||||
|
||||
// This test is for *-windows-msvc only.
|
||||
// ignore-android
|
||||
// ignore-bitrig
|
||||
// ignore-macos
|
||||
// ignore-dragonfly
|
||||
// ignore-freebsd
|
||||
// ignore-haiku
|
||||
// ignore-ios
|
||||
// ignore-linux
|
||||
// ignore-netbsd
|
||||
// ignore-openbsd
|
||||
// ignore-solaris
|
||||
// ignore-emscripten
|
||||
|
||||
// compile-flags: -C no-prepopulate-passes -C panic=abort -O
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// CHECK: Function Attrs: uwtable
|
||||
// CHECK-NEXT: define void @normal_uwtable()
|
||||
#[no_mangle]
|
||||
pub fn normal_uwtable() {
|
||||
}
|
||||
|
||||
// CHECK: Function Attrs: nounwind uwtable
|
||||
// CHECK-NEXT: define void @extern_uwtable()
|
||||
#[no_mangle]
|
||||
pub extern fn extern_uwtable() {
|
||||
}
|
||||
|
|
@ -27,14 +27,6 @@ fn main() {
|
|||
&ps,
|
||||
syntax::ext::expand::ExpansionConfig::default("qquote".to_string()),
|
||||
&mut resolver);
|
||||
cx.bt_push(syntax::codemap::ExpnInfo {
|
||||
call_site: DUMMY_SP,
|
||||
callee: syntax::codemap::NameAndSpan {
|
||||
format: syntax::codemap::MacroBang(Symbol::intern("")),
|
||||
allow_internal_unstable: false,
|
||||
span: None,
|
||||
}
|
||||
});
|
||||
let cx = &mut cx;
|
||||
|
||||
assert_eq!(pprust::expr_to_string(&*quote_expr!(&cx, 23)), "23");
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ fn main() {
|
|||
x; //~ value moved here
|
||||
|
||||
let y = Int(2);
|
||||
//~^use `mut y` here to make mutable
|
||||
//~^ consider changing this to `mut y`
|
||||
y //~ error: cannot borrow immutable local variable `y` as mutable
|
||||
//~| cannot borrow
|
||||
+=
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ fn indirect_write_to_imm_box() {
|
|||
let mut x: isize = 1;
|
||||
let y: Box<_> = box &mut x;
|
||||
let p = &y;
|
||||
***p = 2; //~ ERROR cannot assign to data in an immutable container
|
||||
***p = 2; //~ ERROR cannot assign to data in a `&` reference
|
||||
drop(p);
|
||||
}
|
||||
|
||||
|
|
@ -43,7 +43,6 @@ fn borrow_in_var_from_var_via_imm_box() {
|
|||
let p = &y;
|
||||
let q = &***p;
|
||||
**y = 2; //~ ERROR cannot assign to `**y` because it is borrowed
|
||||
//~^ ERROR cannot assign to data in an immutable container
|
||||
drop(p);
|
||||
drop(q);
|
||||
}
|
||||
|
|
@ -64,7 +63,6 @@ fn borrow_in_var_from_field_via_imm_box() {
|
|||
let p = &y;
|
||||
let q = &***p;
|
||||
**y = 2; //~ ERROR cannot assign to `**y` because it is borrowed
|
||||
//~^ ERROR cannot assign to data in an immutable container
|
||||
drop(p);
|
||||
drop(q);
|
||||
}
|
||||
|
|
@ -85,7 +83,6 @@ fn borrow_in_field_from_var_via_imm_box() {
|
|||
let p = &y.a;
|
||||
let q = &***p;
|
||||
**y.a = 2; //~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
//~^ ERROR cannot assign to data in an immutable container
|
||||
drop(p);
|
||||
drop(q);
|
||||
}
|
||||
|
|
@ -106,7 +103,6 @@ fn borrow_in_field_from_field_via_imm_box() {
|
|||
let p = &y.a;
|
||||
let q = &***p;
|
||||
**y.a = 2; //~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
//~^ ERROR cannot assign to data in an immutable container
|
||||
drop(p);
|
||||
drop(q);
|
||||
}
|
||||
|
|
|
|||
23
src/test/compile-fail/coerce-to-bang-cast.rs
Normal file
23
src/test/compile-fail/coerce-to-bang-cast.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(never_type)]
|
||||
|
||||
fn foo(x: usize, y: !, z: usize) { }
|
||||
|
||||
fn cast_a() {
|
||||
let y = {return; 22} as !;
|
||||
}
|
||||
|
||||
fn cast_b() {
|
||||
let y = 22 as !; //~ ERROR non-scalar cast
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
90
src/test/compile-fail/coerce-to-bang.rs
Normal file
90
src/test/compile-fail/coerce-to-bang.rs
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(never_type)]
|
||||
|
||||
fn foo(x: usize, y: !, z: usize) { }
|
||||
|
||||
fn call_foo_a() {
|
||||
// FIXME(#40800) -- accepted beacuse divergence happens **before**
|
||||
// the coercion to `!`, but within same expression. Not clear that
|
||||
// these are the rules we want.
|
||||
foo(return, 22, 44);
|
||||
}
|
||||
|
||||
fn call_foo_b() {
|
||||
// Divergence happens in the argument itself, definitely ok.
|
||||
foo(22, return, 44);
|
||||
}
|
||||
|
||||
fn call_foo_c() {
|
||||
// This test fails because the divergence happens **after** the
|
||||
// coercion to `!`:
|
||||
foo(22, 44, return); //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn call_foo_d() {
|
||||
// This test passes because `a` has type `!`:
|
||||
let a: ! = return;
|
||||
let b = 22;
|
||||
let c = 44;
|
||||
foo(a, b, c); // ... and hence a reference to `a` is expected to diverge.
|
||||
}
|
||||
|
||||
fn call_foo_e() {
|
||||
// This test probably could pass but we don't *know* that `a`
|
||||
// has type `!` so we don't let it work.
|
||||
let a = return;
|
||||
let b = 22;
|
||||
let c = 44;
|
||||
foo(a, b, c); //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn call_foo_f() {
|
||||
// This fn fails because `a` has type `usize`, and hence a
|
||||
// reference to is it **not** considered to diverge.
|
||||
let a: usize = return;
|
||||
let b = 22;
|
||||
let c = 44;
|
||||
foo(a, b, c); //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn array_a() {
|
||||
// Accepted: return is coerced to `!` just fine, and then `22` can be
|
||||
// because we already diverged.
|
||||
let x: [!; 2] = [return, 22];
|
||||
}
|
||||
|
||||
fn array_b() {
|
||||
// Error: divergence has not yet occurred.
|
||||
let x: [!; 2] = [22, return]; //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn tuple_a() {
|
||||
// No divergence at all.
|
||||
let x: (usize, !, usize) = (22, 44, 66); //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn tuple_b() {
|
||||
// Divergence happens before coercion: OK
|
||||
let x: (usize, !, usize) = (return, 44, 66);
|
||||
}
|
||||
|
||||
fn tuple_c() {
|
||||
// Divergence happens before coercion: OK
|
||||
let x: (usize, !, usize) = (22, return, 66);
|
||||
}
|
||||
|
||||
fn tuple_d() {
|
||||
// Error: divergence happens too late
|
||||
let x: (usize, !, usize) = (22, 44, return); //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
|
|
@ -9,10 +9,8 @@
|
|||
// except according to those terms.
|
||||
|
||||
#![allow(dead_code)]
|
||||
#![deny(overlapping_inherent_impls)]
|
||||
|
||||
trait C {}
|
||||
impl C { fn f() {} } //~ ERROR duplicate definitions with name `f`
|
||||
//~^ WARN: this was previously accepted
|
||||
impl C { fn f() {} }
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -22,16 +22,6 @@ impl Deserialize for () {
|
|||
}
|
||||
}
|
||||
|
||||
fn doit() -> Result<(), String> {
|
||||
let _ = match Deserialize::deserialize() {
|
||||
//~^ ERROR code relies on type
|
||||
//~| WARNING previously accepted
|
||||
Ok(x) => x,
|
||||
Err(e) => return Err(e),
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
|
||||
trait ImplementedForUnitButNotNever {}
|
||||
|
||||
impl ImplementedForUnitButNotNever for () {}
|
||||
|
|
@ -46,6 +36,6 @@ fn smeg() {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let _ = doit();
|
||||
smeg();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,24 +8,18 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
pub fn expr_while_23() {
|
||||
let mut x = 23;
|
||||
let mut y = 23;
|
||||
let mut z = 23;
|
||||
// After #39485, this test used to pass, but that change was reverted
|
||||
// due to numerous inference failures like #39808, so it now fails
|
||||
// again. #39485 made it so that diverging types never propagate
|
||||
// upward; but we now do propagate such types upward in many more
|
||||
// cases.
|
||||
|
||||
while x > 0 {
|
||||
x -= 1;
|
||||
|
||||
while y > 0 {
|
||||
y -= 1;
|
||||
|
||||
while z > 0 { z -= 1; }
|
||||
|
||||
if x > 10 {
|
||||
return;
|
||||
"unreachable";
|
||||
}
|
||||
}
|
||||
}
|
||||
fn g() {
|
||||
&panic!() //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn f() -> isize {
|
||||
(return 1, return 2) //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -25,7 +25,6 @@ fn f() {
|
|||
bar::m! { //~ ERROR ambiguous
|
||||
//~| NOTE macro-expanded items do not shadow when used in a macro invocation path
|
||||
mod bar { pub use two_macros::m; } //~ NOTE could refer to the name defined here
|
||||
//~^^^ NOTE in this expansion
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -37,6 +36,5 @@ fn g() {
|
|||
baz::m! { //~ ERROR ambiguous
|
||||
//~| NOTE macro-expanded items do not shadow when used in a macro invocation path
|
||||
mod baz { pub use two_macros::m; } //~ NOTE could refer to the name defined here
|
||||
//~^^^ NOTE in this expansion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ mod m2 {
|
|||
m! { //~ ERROR ambiguous
|
||||
//~| NOTE macro-expanded macro imports do not shadow
|
||||
use foo::m; //~ NOTE could refer to the name imported here
|
||||
//~^^^ NOTE in this expansion
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -43,7 +42,6 @@ mod m3 {
|
|||
m! { //~ ERROR ambiguous
|
||||
//~| NOTE macro-expanded macro imports do not shadow
|
||||
use two_macros::n as m; //~ NOTE could refer to the name imported here
|
||||
//~^^^ NOTE in this expansion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
71
src/test/compile-fail/imports/shadow_builtin_macros.rs
Normal file
71
src/test/compile-fail/imports/shadow_builtin_macros.rs
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// aux-build:two_macros.rs
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
mod foo {
|
||||
extern crate two_macros;
|
||||
pub use self::two_macros::m as panic;
|
||||
}
|
||||
|
||||
mod m1 {
|
||||
use foo::panic; // ok
|
||||
fn f() { panic!(); }
|
||||
}
|
||||
|
||||
mod m2 {
|
||||
use foo::*; //~ NOTE `panic` could refer to the name imported here
|
||||
fn f() { panic!(); } //~ ERROR ambiguous
|
||||
//~| NOTE `panic` is also a builtin macro
|
||||
//~| NOTE consider adding an explicit import of `panic` to disambiguate
|
||||
}
|
||||
|
||||
mod m3 {
|
||||
::two_macros::m!(use foo::panic;); //~ NOTE `panic` could refer to the name imported here
|
||||
fn f() { panic!(); } //~ ERROR ambiguous
|
||||
//~| NOTE `panic` is also a builtin macro
|
||||
//~| NOTE macro-expanded macro imports do not shadow
|
||||
}
|
||||
|
||||
mod m4 {
|
||||
macro_rules! panic { () => {} } // ok
|
||||
panic!();
|
||||
}
|
||||
|
||||
mod m5 {
|
||||
macro_rules! m { () => {
|
||||
macro_rules! panic { () => {} } //~ ERROR `panic` is already in scope
|
||||
//~| NOTE macro-expanded `macro_rules!`s may not shadow existing macros
|
||||
} }
|
||||
m!(); //~ NOTE in this expansion
|
||||
//~| NOTE in this expansion
|
||||
panic!();
|
||||
}
|
||||
|
||||
#[macro_use(n)] //~ NOTE `n` could also refer to the name imported here
|
||||
extern crate two_macros;
|
||||
mod bar {
|
||||
pub use two_macros::m as n;
|
||||
}
|
||||
|
||||
mod m6 {
|
||||
use bar::n; // ok
|
||||
n!();
|
||||
}
|
||||
|
||||
mod m7 {
|
||||
use bar::*; //~ NOTE `n` could refer to the name imported here
|
||||
n!(); //~ ERROR ambiguous
|
||||
//~| NOTE consider adding an explicit import of `n` to disambiguate
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
(return)[0]; //~ ERROR the type of this value must be known in this context
|
||||
(return)[0]; //~ ERROR cannot index a value of type `!`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
fn main() {
|
||||
fn bar<T>(_: T) {}
|
||||
[0][0u8]; //~ ERROR: the trait bound `u8: std::slice::SliceIndex<{integer}>` is not satisfied
|
||||
[0][0u8]; //~ ERROR: the trait bound `u8: std::slice::SliceIndex<[{integer}]>` is not satisfied
|
||||
|
||||
[0][0]; // should infer to be a usize
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ struct Foo;
|
|||
|
||||
impl Foo {
|
||||
fn id() {} //~ ERROR duplicate definitions
|
||||
//~^ WARN previously accepted
|
||||
}
|
||||
|
||||
impl Foo {
|
||||
|
|
@ -28,7 +27,6 @@ struct Bar<T>(T);
|
|||
|
||||
impl<T> Bar<T> {
|
||||
fn bar(&self) {} //~ ERROR duplicate definitions
|
||||
//~^ WARN previously accepted
|
||||
}
|
||||
|
||||
impl Bar<u32> {
|
||||
|
|
@ -39,7 +37,6 @@ struct Baz<T>(T);
|
|||
|
||||
impl<T: Copy> Baz<T> {
|
||||
fn baz(&self) {} //~ ERROR duplicate definitions
|
||||
//~^ WARN previously accepted
|
||||
}
|
||||
|
||||
impl<T> Baz<Vec<T>> {
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ pub fn main() {
|
|||
v[3i32]; //~ERROR : std::ops::Index<i32>` is not satisfied
|
||||
s.as_bytes()[3_usize];
|
||||
s.as_bytes()[3];
|
||||
s.as_bytes()[3u8]; //~ERROR : std::slice::SliceIndex<u8>` is not satisfied
|
||||
s.as_bytes()[3i8]; //~ERROR : std::slice::SliceIndex<u8>` is not satisfied
|
||||
s.as_bytes()[3u32]; //~ERROR : std::slice::SliceIndex<u8>` is not satisfied
|
||||
s.as_bytes()[3i32]; //~ERROR : std::slice::SliceIndex<u8>` is not satisfied
|
||||
s.as_bytes()[3u8]; //~ERROR : std::slice::SliceIndex<[u8]>` is not satisfied
|
||||
s.as_bytes()[3i8]; //~ERROR : std::slice::SliceIndex<[u8]>` is not satisfied
|
||||
s.as_bytes()[3u32]; //~ERROR : std::slice::SliceIndex<[u8]>` is not satisfied
|
||||
s.as_bytes()[3i32]; //~ERROR : std::slice::SliceIndex<[u8]>` is not satisfied
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn g() {
|
||||
&panic!()
|
||||
}
|
||||
|
||||
fn f() -> isize {
|
||||
(return 1, return 2)
|
||||
//~^ ERROR mismatched types
|
||||
//~| expected type `isize`
|
||||
//~| found type `(!, !)`
|
||||
//~| expected isize, found tuple
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
return.is_failure //~ ERROR the type of this value must be known in this context
|
||||
return.is_failure //~ ERROR no field `is_failure` on type `!`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
fn main() {
|
||||
loop {
|
||||
break.push(1) //~ ERROR the type of this value must be known in this context
|
||||
break.push(1) //~ ERROR no method named `push` found for type `!`
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
*return //~ ERROR the type of this value must be known in this context
|
||||
*return //~ ERROR type `!` cannot be dereferenced
|
||||
;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,5 @@
|
|||
// into it.
|
||||
|
||||
fn main() {
|
||||
(return)((),());
|
||||
//~^ ERROR the type of this value must be known
|
||||
(return)((),()); //~ ERROR expected function, found `!`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@ impl<A> vec_monad<A> for Vec<A> {
|
|||
}
|
||||
fn main() {
|
||||
["hi"].bind(|x| [x] );
|
||||
//~^ ERROR no method named `bind` found for type `[&'static str; 1]` in the current scope
|
||||
//~^ ERROR no method named `bind` found for type `[&str; 1]` in the current scope
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,5 +21,4 @@ fn main() {
|
|||
|
||||
foo!(1i32.foo());
|
||||
//~^ ERROR no method named `foo` found for type `i32` in the current scope
|
||||
//~^^ NOTE in this expansion of foo!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@
|
|||
|
||||
fn main() {
|
||||
let _: i32 =
|
||||
'a: //~ ERROR mismatched types
|
||||
loop { break };
|
||||
'a: // in this case, the citation is just the `break`:
|
||||
loop { break }; //~ ERROR mismatched types
|
||||
let _: i32 =
|
||||
'b: //~ ERROR mismatched types
|
||||
while true { break };
|
||||
while true { break }; // but here we cite the whole loop
|
||||
let _: i32 =
|
||||
'c: //~ ERROR mismatched types
|
||||
for _ in None { break };
|
||||
for _ in None { break }; // but here we cite the whole loop
|
||||
let _: i32 =
|
||||
'd: //~ ERROR mismatched types
|
||||
while let Some(_) = None { break };
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ fn main() {
|
|||
match op {
|
||||
Some(ref v) => { let a = &mut v; },
|
||||
//~^ ERROR:cannot borrow immutable
|
||||
//~| use `ref mut v` here to make mutable
|
||||
//~| cannot borrow mutably
|
||||
None => {},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
|
@ -8,6 +8,14 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn pat_tup_5() {
|
||||
let (_x, _y) = (5, 55);
|
||||
#![feature(closure_to_fn_coercion)]
|
||||
|
||||
fn main() {
|
||||
let bar: fn(&mut u32) = |_| {}; //~ ERROR mismatched types
|
||||
//~| expected concrete lifetime, found bound lifetime parameter
|
||||
|
||||
fn foo(x: Box<Fn(&i32)>) {}
|
||||
let bar = Box::new(|x: &i32| {}) as Box<Fn(_)>;
|
||||
foo(bar); //~ ERROR mismatched types
|
||||
//~| expected concrete lifetime, found bound lifetime parameter
|
||||
}
|
||||
16
src/test/compile-fail/issue-40749.rs
Normal file
16
src/test/compile-fail/issue-40749.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
[0; ..10];
|
||||
//~^ ERROR mismatched types
|
||||
//~| expected type `usize`
|
||||
//~| found type `std::ops::RangeTo<{integer}>`
|
||||
}
|
||||
16
src/test/compile-fail/issue-40845.rs
Normal file
16
src/test/compile-fail/issue-40845.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
trait T { m!(); } //~ ERROR cannot find macro `m!` in this scope
|
||||
|
||||
struct S;
|
||||
impl S { m!(); } //~ ERROR cannot find macro `m!` in this scope
|
||||
|
||||
fn main() {}
|
||||
17
src/test/compile-fail/issue-5500.rs
Normal file
17
src/test/compile-fail/issue-5500.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
&panic!()
|
||||
//~^ ERROR mismatched types
|
||||
//~| expected type `()`
|
||||
//~| found type `&_`
|
||||
//~| expected (), found reference
|
||||
}
|
||||
|
|
@ -40,37 +40,40 @@ fn main() {
|
|||
loop {
|
||||
break 'while_loop 123;
|
||||
//~^ ERROR `break` with value from a `while` loop
|
||||
//~| ERROR mismatched types
|
||||
break 456;
|
||||
break 789;
|
||||
};
|
||||
}
|
||||
|
||||
'while_let_loop: while let Some(_) = Some(()) {
|
||||
while let Some(_) = Some(()) {
|
||||
if break () { //~ ERROR `break` with value from a `while let` loop
|
||||
break;
|
||||
break None;
|
||||
//~^ ERROR `break` with value from a `while let` loop
|
||||
//~| ERROR mismatched types
|
||||
}
|
||||
}
|
||||
|
||||
while let Some(_) = Some(()) {
|
||||
break None;
|
||||
//~^ ERROR `break` with value from a `while let` loop
|
||||
}
|
||||
|
||||
'while_let_loop: while let Some(_) = Some(()) {
|
||||
loop {
|
||||
break 'while_let_loop "nope";
|
||||
//~^ ERROR `break` with value from a `while let` loop
|
||||
//~| ERROR mismatched types
|
||||
break 33;
|
||||
};
|
||||
}
|
||||
|
||||
'for_loop: for _ in &[1,2,3] {
|
||||
for _ in &[1,2,3] {
|
||||
break (); //~ ERROR `break` with value from a `for` loop
|
||||
break [()];
|
||||
//~^ ERROR `break` with value from a `for` loop
|
||||
//~| ERROR mismatched types
|
||||
}
|
||||
|
||||
'for_loop: for _ in &[1,2,3] {
|
||||
loop {
|
||||
break Some(3);
|
||||
break 'for_loop Some(17);
|
||||
//~^ ERROR `break` with value from a `for` loop
|
||||
//~| ERROR mismatched types
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
22
src/test/compile-fail/match-no-arms-unreachable-after.rs
Normal file
22
src/test/compile-fail/match-no-arms-unreachable-after.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![allow(warnings)]
|
||||
#![deny(unreachable_code)]
|
||||
|
||||
enum Void { }
|
||||
|
||||
fn foo(v: Void) {
|
||||
match v { }
|
||||
let x = 2; //~ ERROR unreachable
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
|
@ -8,10 +8,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(slice_patterns)]
|
||||
#![allow(unused_parens)]
|
||||
#![deny(unreachable_code)]
|
||||
|
||||
pub fn pat_vec_7() {
|
||||
match [7, 77, 777, 7777] {
|
||||
[x, y, ..] => x + y
|
||||
};
|
||||
fn main() {
|
||||
match (return) { } //~ ERROR unreachable expression
|
||||
}
|
||||
17
src/test/compile-fail/match-unresolved-one-arm.rs
Normal file
17
src/test/compile-fail/match-unresolved-one-arm.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn foo<T>() -> T { panic!("Rocks for my pillow") }
|
||||
|
||||
fn main() {
|
||||
let x = match () { //~ ERROR type annotations needed
|
||||
() => foo() // T here should be unresolved
|
||||
};
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ impl S {
|
|||
}
|
||||
|
||||
fn func(arg: S) {
|
||||
//~^ here to make mutable
|
||||
//~^ consider changing this to `mut arg`
|
||||
arg.mutate();
|
||||
//~^ ERROR cannot borrow immutable argument
|
||||
//~| cannot borrow mutably
|
||||
|
|
@ -25,7 +25,7 @@ fn func(arg: S) {
|
|||
|
||||
fn main() {
|
||||
let local = S;
|
||||
//~^ here to make mutable
|
||||
//~^ consider changing this to `mut local`
|
||||
local.mutate();
|
||||
//~^ ERROR cannot borrow immutable local variable
|
||||
//~| cannot borrow mutably
|
||||
|
|
|
|||
|
|
@ -16,5 +16,6 @@
|
|||
fn main() {
|
||||
let x: ! = panic!("aah"); //~ ERROR unused
|
||||
drop(x); //~ ERROR unreachable
|
||||
//~^ ERROR unreachable
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
// Test that we can't use another type in place of !
|
||||
|
||||
#![feature(never_type)]
|
||||
#![deny(warnings)]
|
||||
|
||||
fn main() {
|
||||
let x: ! = "hello"; //~ ERROR mismatched types
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Test that diverging types default to ! when feature(never_type) is enabled. This test is the
|
||||
// same as run-pass/unit-fallback.rs except that ! is enabled.
|
||||
|
||||
#![feature(never_type)]
|
||||
|
||||
trait Balls: Sized {
|
||||
fn smeg() -> Result<Self, ()>;
|
||||
}
|
||||
|
||||
impl Balls for () {
|
||||
fn smeg() -> Result<(), ()> { Ok(()) }
|
||||
}
|
||||
|
||||
struct Flah;
|
||||
|
||||
impl Flah {
|
||||
fn flah<T: Balls>(&self) -> Result<T, ()> {
|
||||
T::smeg()
|
||||
}
|
||||
}
|
||||
|
||||
fn doit() -> Result<(), ()> {
|
||||
// The type of _ is unconstrained here and should default to !
|
||||
let _ = try!(Flah.flah()); //~ ERROR the trait bound
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _ = doit();
|
||||
}
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ fn make_bar<T:Bar<u32>>(t: &T) -> &Bar<u32> {
|
|||
|
||||
fn make_baz<T:Baz>(t: &T) -> &Baz {
|
||||
//~^ ERROR E0038
|
||||
//~| NOTE the trait cannot use `Self` as a type parameter in the supertrait listing
|
||||
//~| NOTE the trait cannot use `Self` as a type parameter in the supertraits or where-clauses
|
||||
//~| NOTE the trait `Baz` cannot be made into an object
|
||||
t
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ fn main() {
|
|||
let x = &[1, 2, 3] as &[i32];
|
||||
x[1i32]; //~ ERROR E0277
|
||||
//~| NOTE slice indices are of type `usize` or ranges of `usize`
|
||||
//~| NOTE trait `std::slice::SliceIndex<i32>` is not implemented for `i32`
|
||||
//~| NOTE trait `std::slice::SliceIndex<[i32]>` is not implemented for `i32`
|
||||
//~| NOTE required because of the requirements on the impl of `std::ops::Index<i32>`
|
||||
x[..1i32]; //~ ERROR E0277
|
||||
//~| NOTE slice indices are of type `usize` or ranges of `usize`
|
||||
//~| NOTE trait `std::slice::SliceIndex<i32>` is not implemented for `std::ops::RangeTo<i32>`
|
||||
//~| NOTE trait `std::slice::SliceIndex<[i32]>` is not implemented for `std::ops::RangeTo<i32>`
|
||||
//~| NOTE requirements on the impl of `std::ops::Index<std::ops::RangeTo<i32>>`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@
|
|||
|
||||
mod foo {
|
||||
type T = ();
|
||||
struct S1(pub(foo) (), pub(T), pub(crate) (), pub(((), T)));
|
||||
struct S2(pub((foo)) ()); //~ ERROR expected `,`, found `(`
|
||||
//~| ERROR expected one of `;` or `where`, found `(`
|
||||
struct S1(pub(in foo) (), pub(T), pub(crate) (), pub(((), T)));
|
||||
struct S2(pub((foo)) ());
|
||||
//~^ ERROR expected `,`, found `(`
|
||||
//~| ERROR expected one of `;` or `where`, found `(`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,10 @@
|
|||
macro_rules! define_struct {
|
||||
($t:ty) => {
|
||||
struct S1(pub $t);
|
||||
struct S2(pub (foo) ());
|
||||
struct S3(pub $t ()); //~ ERROR expected `,`, found `(`
|
||||
//~| ERROR expected one of `;` or `where`, found `(`
|
||||
struct S2(pub (in foo) ());
|
||||
struct S3(pub $t ());
|
||||
//~^ ERROR expected `,`, found `(`
|
||||
//~| ERROR expected one of `;` or `where`, found `(`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,10 @@
|
|||
macro_rules! define_struct {
|
||||
($t:ty) => {
|
||||
struct S1(pub($t));
|
||||
struct S2(pub (foo) ());
|
||||
struct S3(pub($t) ()); //~ ERROR expected `,`, found `(`
|
||||
//~| ERROR expected one of `;` or `where`, found `(`
|
||||
struct S2(pub (in foo) ());
|
||||
struct S3(pub($t) ());
|
||||
//~^ ERROR expected `,`, found `(`
|
||||
//~| ERROR expected one of `;` or `where`, found `(`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ trait SomeTrait { }
|
|||
|
||||
// Bounds on object types:
|
||||
|
||||
struct Foo<'a,'b,'c> { //~ ERROR parameter `'b` is never used
|
||||
struct Foo<'a,'b,'c> { //~ ERROR parameter `'c` is never used
|
||||
// All of these are ok, because we can derive exactly one bound:
|
||||
a: Box<IsStatic>,
|
||||
b: Box<Is<'static>>,
|
||||
|
|
|
|||
|
|
@ -13,9 +13,6 @@
|
|||
// over time, but this test used to exhibit some pretty bogus messages
|
||||
// that were not remotely helpful.
|
||||
|
||||
// error-pattern:cannot infer
|
||||
// error-pattern:cannot outlive the lifetime 'a
|
||||
// error-pattern:must be valid for the static lifetime
|
||||
// error-pattern:cannot infer
|
||||
// error-pattern:cannot outlive the lifetime 'a
|
||||
// error-pattern:must be valid for the static lifetime
|
||||
|
|
|
|||
|
|
@ -16,17 +16,11 @@ struct an_enum<'a>(&'a isize);
|
|||
struct a_class<'a> { x:&'a isize }
|
||||
|
||||
fn a_fn1<'a,'b>(e: an_enum<'a>) -> an_enum<'b> {
|
||||
return e; //~ ERROR mismatched types
|
||||
//~| expected type `an_enum<'b>`
|
||||
//~| found type `an_enum<'a>`
|
||||
//~| lifetime mismatch
|
||||
return e; //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn a_fn3<'a,'b>(e: a_class<'a>) -> a_class<'b> {
|
||||
return e; //~ ERROR mismatched types
|
||||
//~| expected type `a_class<'b>`
|
||||
//~| found type `a_class<'a>`
|
||||
//~| lifetime mismatch
|
||||
return e; //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
|
|
|
|||
16
src/test/compile-fail/static-lifetime-bound.rs
Normal file
16
src/test/compile-fail/static-lifetime-bound.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn f<'a: 'static>(_: &'a i32) {} //~WARN unnecessary lifetime parameter `'a`
|
||||
|
||||
fn main() {
|
||||
let x = 0;
|
||||
f(&x); //~ERROR does not live long enough
|
||||
}
|
||||
|
|
@ -8,6 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-windows
|
||||
|
||||
// compile-flags: -Z parse-only
|
||||
|
||||
mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
|
||||
|
|
|
|||
32
src/test/parse-fail/mod_file_not_exist_windows.rs
Normal file
32
src/test/parse-fail/mod_file_not_exist_windows.rs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-gnu
|
||||
// ignore-android
|
||||
// ignore-bitrig
|
||||
// ignore-macos
|
||||
// ignore-dragonfly
|
||||
// ignore-freebsd
|
||||
// ignore-haiku
|
||||
// ignore-ios
|
||||
// ignore-linux
|
||||
// ignore-netbsd
|
||||
// ignore-openbsd
|
||||
// ignore-solaris
|
||||
// ignore-emscripten
|
||||
|
||||
// compile-flags: -Z parse-only
|
||||
|
||||
mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
|
||||
//~^ HELP name the file either not_a_real_file.rs or not_a_real_file\mod.rs inside the directory
|
||||
|
||||
fn main() {
|
||||
assert_eq!(mod_file_aux::bar(), 10);
|
||||
}
|
||||
|
|
@ -30,14 +30,6 @@ fn main() {
|
|||
&ps,
|
||||
syntax::ext::expand::ExpansionConfig::default("qquote".to_string()),
|
||||
&mut resolver);
|
||||
cx.bt_push(syntax::codemap::ExpnInfo {
|
||||
call_site: DUMMY_SP,
|
||||
callee: syntax::codemap::NameAndSpan {
|
||||
format: syntax::codemap::MacroBang(Symbol::intern("")),
|
||||
allow_internal_unstable: false,
|
||||
span: None,
|
||||
}
|
||||
});
|
||||
let cx = &mut cx;
|
||||
|
||||
println!("{}", pprust::expr_to_string(&*quote_expr!(&cx, 23)));
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
-include ../tools.mk
|
||||
|
||||
FILES=f00.rs f01.rs f02.rs f03.rs f04.rs f05.rs f06.rs f07.rs \
|
||||
f08.rs f09.rs f10.rs f11.rs f12.rs f13.rs f14.rs f15.rs \
|
||||
f16.rs f17.rs f18.rs f19.rs f20.rs f21.rs f22.rs f23.rs \
|
||||
f24.rs f25.rs
|
||||
|
||||
|
||||
# all: $(patsubst %.rs,$(TMPDIR)/%.dot,$(FILES)) $(patsubst %.rs,$(TMPDIR)/%.pp,$(FILES))
|
||||
all: $(patsubst %.rs,$(TMPDIR)/%.check,$(FILES))
|
||||
|
||||
|
||||
RUSTC_LIB=$(RUSTC) --crate-type=lib
|
||||
|
||||
define FIND_LAST_BLOCK
|
||||
LASTBLOCKNUM_$(1) := $(shell $(RUSTC_LIB) -Z unstable-options --pretty=expanded,identified $(1) \
|
||||
| grep block
|
||||
| tail -1
|
||||
| sed -e 's@.*/\* block \([0-9]*\) \*/.*@\1@')
|
||||
endef
|
||||
|
||||
ifeq ($(findstring rustc,$(RUSTC)),)
|
||||
$(error Must set RUSTC)
|
||||
endif
|
||||
|
||||
$(TMPDIR)/%.pp: %.rs
|
||||
$(RUSTC_LIB) --pretty=expanded,identified $< -o $@
|
||||
|
||||
$(TMPDIR)/%.dot: %.rs
|
||||
$(eval $(call FIND_LAST_BLOCK,$<))
|
||||
$(RUSTC_LIB) -Z unstable-options --unpretty flowgraph,unlabelled=$(LASTBLOCKNUM_$<) $< -o $@.tmp
|
||||
cat $@.tmp | sed -e 's@ (id=[0-9]*)@@g' \
|
||||
-e 's@\[label=""\]@@' \
|
||||
-e 's@digraph [a-zA-Z0-9_]* @digraph block @' \
|
||||
> $@
|
||||
|
||||
$(TMPDIR)/%.check: %.rs $(TMPDIR)/%.dot
|
||||
diff -u $(patsubst %.rs,$(TMPDIR)/%.dot,$<) $(patsubst %.rs,%.dot-expected.dot,$<)
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="block { }"];
|
||||
N3[label="expr { }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N1;
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 1"];
|
||||
N3[label="stmt 1;"];
|
||||
N4[label="block { 1; }"];
|
||||
N5[label="expr { 1; }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N1;
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="local _x"];
|
||||
N3[label="stmt let _x: isize;"];
|
||||
N4[label="block { let _x: isize; }"];
|
||||
N5[label="expr { let _x: isize; }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N1;
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 3"];
|
||||
N3[label="expr 4"];
|
||||
N4[label="expr 3 + 4"];
|
||||
N5[label="stmt 3 + 4;"];
|
||||
N6[label="block { 3 + 4; }"];
|
||||
N7[label="expr { 3 + 4; }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N1;
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 4"];
|
||||
N3[label="local _x"];
|
||||
N4[label="stmt let _x = 4;"];
|
||||
N5[label="block { let _x = 4; }"];
|
||||
N6[label="expr { let _x = 4; }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N1;
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn pat_id_4() {
|
||||
let _x = 4;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 5"];
|
||||
N3[label="expr 55"];
|
||||
N4[label="expr (5, 55)"];
|
||||
N5[label="local _x"];
|
||||
N6[label="local _y"];
|
||||
N7[label="pat (_x, _y)"];
|
||||
N8[label="stmt let (_x, _y) = (5, 55);"];
|
||||
N9[label="block { let (_x, _y) = (5, 55); }"];
|
||||
N10[label="expr { let (_x, _y) = (5, 55); }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N1;
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 6"];
|
||||
N3[label="expr S6{val: 6,}"];
|
||||
N4[label="local _x"];
|
||||
N5[label="pat S6 { val: _x }"];
|
||||
N6[label="stmt let S6 { val: _x } = S6{val: 6,};"];
|
||||
N7[label="block { let S6 { val: _x } = S6{val: 6,}; }"];
|
||||
N8[label="expr { let S6 { val: _x } = S6{val: 6,}; }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N1;
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
struct S6 { val: isize }
|
||||
pub fn pat_struct_6() {
|
||||
let S6 { val: _x } = S6{ val: 6 };
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 7"];
|
||||
N3[label="expr 77"];
|
||||
N4[label="expr 777"];
|
||||
N5[label="expr 7777"];
|
||||
N6[label="expr [7, 77, 777, 7777]"];
|
||||
N7[label="expr match [7, 77, 777, 7777] { [x, y, ..] => x + y, }"];
|
||||
N8[label="(dummy_node)"];
|
||||
N9[label="local x"];
|
||||
N10[label="local y"];
|
||||
N11[label="pat _"];
|
||||
N12[label="pat [x, y, ..]"];
|
||||
N13[label="expr x"];
|
||||
N14[label="expr y"];
|
||||
N15[label="expr x + y"];
|
||||
N16[label="stmt match [7, 77, 777, 7777] { [x, y, ..] => x + y, };"];
|
||||
N17[label="block { match [7, 77, 777, 7777] { [x, y, ..] => x + y, }; }"];
|
||||
N18[label="expr { match [7, 77, 777, 7777] { [x, y, ..] => x + y, }; }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N12;
|
||||
N12 -> N8;
|
||||
N8 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N15;
|
||||
N15 -> N7;
|
||||
N7 -> N16;
|
||||
N16 -> N17;
|
||||
N17 -> N18;
|
||||
N18 -> N1;
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 8"];
|
||||
N3[label="local x"];
|
||||
N4[label="stmt let x = 8;"];
|
||||
N5[label="local _y"];
|
||||
N6[label="stmt let _y;"];
|
||||
N7[label="expr x"];
|
||||
N8[label="expr 88"];
|
||||
N9[label="expr x > 88"];
|
||||
N10[label="expr 888"];
|
||||
N11[label="expr _y"];
|
||||
N12[label="expr _y = 888"];
|
||||
N13[label="stmt _y = 888;"];
|
||||
N14[label="block { _y = 888; }"];
|
||||
N15[label="expr if x > 88 { _y = 888; }"];
|
||||
N16[label="block { let x = 8; let _y; if x > 88 { _y = 888; } }"];
|
||||
N17[label="expr { let x = 8; let _y; if x > 88 { _y = 888; } }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N12;
|
||||
N12 -> N13;
|
||||
N13 -> N14;
|
||||
N9 -> N15;
|
||||
N14 -> N15;
|
||||
N15 -> N16;
|
||||
N16 -> N17;
|
||||
N17 -> N1;
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 91"];
|
||||
N3[label="local x"];
|
||||
N4[label="stmt let x = 91;"];
|
||||
N5[label="local _y"];
|
||||
N6[label="stmt let _y;"];
|
||||
N7[label="expr x"];
|
||||
N8[label="expr 92"];
|
||||
N9[label="expr x > 92"];
|
||||
N10[label="expr 93"];
|
||||
N11[label="expr _y"];
|
||||
N12[label="expr _y = 93"];
|
||||
N13[label="stmt _y = 93;"];
|
||||
N14[label="block { _y = 93; }"];
|
||||
N15[label="expr 94"];
|
||||
N16[label="expr 95"];
|
||||
N17[label="expr 94 + 95"];
|
||||
N18[label="expr _y"];
|
||||
N19[label="expr _y = 94 + 95"];
|
||||
N20[label="stmt _y = 94 + 95;"];
|
||||
N21[label="block { _y = 94 + 95; }"];
|
||||
N22[label="expr { _y = 94 + 95; }"];
|
||||
N23[label="expr if x > 92 { _y = 93; } else { _y = 94 + 95; }"];
|
||||
N24[label="block { let x = 91; let _y; if x > 92 { _y = 93; } else { _y = 94 + 95; } }"];
|
||||
N25[label="expr { let x = 91; let _y; if x > 92 { _y = 93; } else { _y = 94 + 95; } }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N12;
|
||||
N12 -> N13;
|
||||
N13 -> N14;
|
||||
N9 -> N15;
|
||||
N15 -> N16;
|
||||
N16 -> N17;
|
||||
N17 -> N18;
|
||||
N18 -> N19;
|
||||
N19 -> N20;
|
||||
N20 -> N21;
|
||||
N21 -> N22;
|
||||
N14 -> N23;
|
||||
N22 -> N23;
|
||||
N23 -> N24;
|
||||
N24 -> N25;
|
||||
N25 -> N1;
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 10"];
|
||||
N3[label="local mut x"];
|
||||
N4[label="stmt let mut x = 10;"];
|
||||
N5[label="(dummy_node)"];
|
||||
N6[label="expr while x > 0 { x -= 1; }"];
|
||||
N7[label="expr x"];
|
||||
N8[label="expr 0"];
|
||||
N9[label="expr x > 0"];
|
||||
N10[label="expr 1"];
|
||||
N11[label="expr x"];
|
||||
N12[label="expr x -= 1"];
|
||||
N13[label="stmt x -= 1;"];
|
||||
N14[label="block { x -= 1; }"];
|
||||
N15[label="block { let mut x = 10; while x > 0 { x -= 1; } }"];
|
||||
N16[label="expr { let mut x = 10; while x > 0 { x -= 1; } }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N6;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N12;
|
||||
N12 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N5;
|
||||
N6 -> N15;
|
||||
N15 -> N16;
|
||||
N16 -> N1;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn expr_while_10() {
|
||||
let mut x = 10;
|
||||
while x > 0 {
|
||||
x -= 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 11"];
|
||||
N3[label="local mut _x"];
|
||||
N4[label="stmt let mut _x = 11;"];
|
||||
N5[label="(dummy_node)"];
|
||||
N6[label="expr loop { _x -= 1; }"];
|
||||
N7[label="expr 1"];
|
||||
N8[label="expr _x"];
|
||||
N9[label="expr _x -= 1"];
|
||||
N10[label="stmt _x -= 1;"];
|
||||
N11[label="block { _x -= 1; }"];
|
||||
N12[label="stmt loop { _x -= 1; }"];
|
||||
N13[label="expr \"unreachable\""];
|
||||
N14[label="stmt \"unreachable\";"];
|
||||
N15[label="block { let mut _x = 11; loop { _x -= 1; } \"unreachable\"; }"];
|
||||
N16[label="expr { let mut _x = 11; loop { _x -= 1; } \"unreachable\"; }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N5;
|
||||
N6 -> N12;
|
||||
N12 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N15;
|
||||
N15 -> N16;
|
||||
N16 -> N1;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
pub fn expr_loop_11() {
|
||||
let mut _x = 11;
|
||||
loop {
|
||||
_x -= 1;
|
||||
}
|
||||
"unreachable";
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 12"];
|
||||
N3[label="local mut x"];
|
||||
N4[label="stmt let mut x = 12;"];
|
||||
N5[label="(dummy_node)"];
|
||||
N6[label="expr loop { x -= 1; if x == 2 { break ; \"unreachable\"; } }"];
|
||||
N7[label="expr 1"];
|
||||
N8[label="expr x"];
|
||||
N9[label="expr x -= 1"];
|
||||
N10[label="stmt x -= 1;"];
|
||||
N11[label="expr x"];
|
||||
N12[label="expr 2"];
|
||||
N13[label="expr x == 2"];
|
||||
N14[label="expr break"];
|
||||
N15[label="(dummy_node)"];
|
||||
N16[label="stmt break ;"];
|
||||
N17[label="expr \"unreachable\""];
|
||||
N18[label="stmt \"unreachable\";"];
|
||||
N19[label="block { break ; \"unreachable\"; }"];
|
||||
N20[label="expr if x == 2 { break ; \"unreachable\"; }"];
|
||||
N21[label="block { x -= 1; if x == 2 { break ; \"unreachable\"; } }"];
|
||||
N22[label="block { let mut x = 12; loop { x -= 1; if x == 2 { break ; \"unreachable\"; } } }"];
|
||||
N23[label="expr { let mut x = 12; loop { x -= 1; if x == 2 { break ; \"unreachable\"; } } }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N12;
|
||||
N12 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N6;
|
||||
N15 -> N16;
|
||||
N16 -> N17;
|
||||
N17 -> N18;
|
||||
N18 -> N19;
|
||||
N13 -> N20;
|
||||
N19 -> N20;
|
||||
N20 -> N21;
|
||||
N21 -> N5;
|
||||
N6 -> N22;
|
||||
N22 -> N23;
|
||||
N23 -> N1;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
pub fn expr_loop_12() {
|
||||
let mut x = 12;
|
||||
loop {
|
||||
x -= 1;
|
||||
if x == 2 { break; "unreachable"; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr E13::E13b"];
|
||||
N3[label="expr 13"];
|
||||
N4[label="expr E13::E13b(13)"];
|
||||
N5[label="local x"];
|
||||
N6[label="stmt let x = E13::E13b(13);"];
|
||||
N7[label="local _y"];
|
||||
N8[label="stmt let _y;"];
|
||||
N9[label="expr x"];
|
||||
N10[label="expr match x { E13::E13a => _y = 1, E13::E13b(v) => _y = v + 1, }"];
|
||||
N11[label="(dummy_node)"];
|
||||
N12[label="pat E13::E13a"];
|
||||
N13[label="expr 1"];
|
||||
N14[label="expr _y"];
|
||||
N15[label="expr _y = 1"];
|
||||
N16[label="(dummy_node)"];
|
||||
N17[label="local v"];
|
||||
N18[label="pat E13::E13b(v)"];
|
||||
N19[label="expr v"];
|
||||
N20[label="expr 1"];
|
||||
N21[label="expr v + 1"];
|
||||
N22[label="expr _y"];
|
||||
N23[label="expr _y = v + 1"];
|
||||
N24[label="block {\l let x = E13::E13b(13);\l let _y;\l match x { E13::E13a => _y = 1, E13::E13b(v) => _y = v + 1, }\l}\l"];
|
||||
N25[label="expr {\l let x = E13::E13b(13);\l let _y;\l match x { E13::E13a => _y = 1, E13::E13b(v) => _y = v + 1, }\l}\l"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N12;
|
||||
N12 -> N11;
|
||||
N11 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N15;
|
||||
N15 -> N10;
|
||||
N9 -> N17;
|
||||
N17 -> N18;
|
||||
N18 -> N16;
|
||||
N16 -> N19;
|
||||
N19 -> N20;
|
||||
N20 -> N21;
|
||||
N21 -> N22;
|
||||
N22 -> N23;
|
||||
N23 -> N10;
|
||||
N10 -> N24;
|
||||
N24 -> N25;
|
||||
N25 -> N1;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
enum E13 { E13a, E13b(isize) }
|
||||
pub fn expr_match_13() {
|
||||
let x = E13::E13b(13); let _y;
|
||||
match x {
|
||||
E13::E13a => _y = 1,
|
||||
E13::E13b(v) => _y = v + 1,
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 14"];
|
||||
N3[label="local x"];
|
||||
N4[label="stmt let x = 14;"];
|
||||
N5[label="expr x"];
|
||||
N6[label="expr 1"];
|
||||
N7[label="expr x > 1"];
|
||||
N8[label="expr return"];
|
||||
N9[label="(dummy_node)"];
|
||||
N10[label="stmt return;"];
|
||||
N11[label="expr \"unreachable\""];
|
||||
N12[label="stmt \"unreachable\";"];
|
||||
N13[label="block { return; \"unreachable\"; }"];
|
||||
N14[label="expr if x > 1 { return; \"unreachable\"; }"];
|
||||
N15[label="block { let x = 14; if x > 1 { return; \"unreachable\"; } }"];
|
||||
N16[label="expr { let x = 14; if x > 1 { return; \"unreachable\"; } }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N1;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N12;
|
||||
N12 -> N13;
|
||||
N7 -> N14;
|
||||
N13 -> N14;
|
||||
N14 -> N15;
|
||||
N15 -> N16;
|
||||
N16 -> N1;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
pub fn expr_ret_14() {
|
||||
let x = 14;
|
||||
if x > 1 {
|
||||
return;
|
||||
"unreachable";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 15"];
|
||||
N3[label="local mut x"];
|
||||
N4[label="stmt let mut x = 15;"];
|
||||
N5[label="expr 151"];
|
||||
N6[label="local mut y"];
|
||||
N7[label="stmt let mut y = 151;"];
|
||||
N8[label="(dummy_node)"];
|
||||
N9[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { break ; \"unreachable\"; }\l y -= 3;\l }\l y -= 4;\l x -= 5;\l }\l"];
|
||||
N10[label="(dummy_node)"];
|
||||
N11[label="expr \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { break ; \"unreachable\"; }\l y -= 3;\l }\l"];
|
||||
N12[label="expr x"];
|
||||
N13[label="expr 1"];
|
||||
N14[label="expr x == 1"];
|
||||
N15[label="expr break \'outer"];
|
||||
N16[label="(dummy_node)"];
|
||||
N17[label="stmt break \'outer ;"];
|
||||
N18[label="expr \"unreachable\""];
|
||||
N19[label="stmt \"unreachable\";"];
|
||||
N20[label="block { break \'outer ; \"unreachable\"; }"];
|
||||
N21[label="expr if x == 1 { break \'outer ; \"unreachable\"; }"];
|
||||
N22[label="stmt if x == 1 { break \'outer ; \"unreachable\"; }"];
|
||||
N23[label="expr y"];
|
||||
N24[label="expr 2"];
|
||||
N25[label="expr y >= 2"];
|
||||
N26[label="expr break"];
|
||||
N27[label="(dummy_node)"];
|
||||
N28[label="stmt break ;"];
|
||||
N29[label="expr \"unreachable\""];
|
||||
N30[label="stmt \"unreachable\";"];
|
||||
N31[label="block { break ; \"unreachable\"; }"];
|
||||
N32[label="expr if y >= 2 { break ; \"unreachable\"; }"];
|
||||
N33[label="stmt if y >= 2 { break ; \"unreachable\"; }"];
|
||||
N34[label="expr 3"];
|
||||
N35[label="expr y"];
|
||||
N36[label="expr y -= 3"];
|
||||
N37[label="stmt y -= 3;"];
|
||||
N38[label="block {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { break ; \"unreachable\"; }\l y -= 3;\l}\l"];
|
||||
N39[label="stmt \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { break ; \"unreachable\"; }\l y -= 3;\l }\l"];
|
||||
N40[label="expr 4"];
|
||||
N41[label="expr y"];
|
||||
N42[label="expr y -= 4"];
|
||||
N43[label="stmt y -= 4;"];
|
||||
N44[label="expr 5"];
|
||||
N45[label="expr x"];
|
||||
N46[label="expr x -= 5"];
|
||||
N47[label="stmt x -= 5;"];
|
||||
N48[label="block {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { break ; \"unreachable\"; }\l y -= 3;\l }\l y -= 4;\l x -= 5;\l}\l"];
|
||||
N49[label="block {\l let mut x = 15;\l let mut y = 151;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { break ; \"unreachable\"; }\l y -= 3;\l }\l y -= 4;\l x -= 5;\l }\l}\l"];
|
||||
N50[label="expr {\l let mut x = 15;\l let mut y = 151;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { break ; \"unreachable\"; }\l y -= 3;\l }\l y -= 4;\l x -= 5;\l }\l}\l"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N10;
|
||||
N10 -> N12;
|
||||
N12 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N15;
|
||||
N15 -> N9;
|
||||
N16 -> N17;
|
||||
N17 -> N18;
|
||||
N18 -> N19;
|
||||
N19 -> N20;
|
||||
N14 -> N21;
|
||||
N20 -> N21;
|
||||
N21 -> N22;
|
||||
N22 -> N23;
|
||||
N23 -> N24;
|
||||
N24 -> N25;
|
||||
N25 -> N26;
|
||||
N26 -> N11;
|
||||
N27 -> N28;
|
||||
N28 -> N29;
|
||||
N29 -> N30;
|
||||
N30 -> N31;
|
||||
N25 -> N32;
|
||||
N31 -> N32;
|
||||
N32 -> N33;
|
||||
N33 -> N34;
|
||||
N34 -> N35;
|
||||
N35 -> N36;
|
||||
N36 -> N37;
|
||||
N37 -> N38;
|
||||
N38 -> N10;
|
||||
N11 -> N39;
|
||||
N39 -> N40;
|
||||
N40 -> N41;
|
||||
N41 -> N42;
|
||||
N42 -> N43;
|
||||
N43 -> N44;
|
||||
N44 -> N45;
|
||||
N45 -> N46;
|
||||
N46 -> N47;
|
||||
N47 -> N48;
|
||||
N48 -> N8;
|
||||
N9 -> N49;
|
||||
N49 -> N50;
|
||||
N50 -> N1;
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
pub fn expr_break_label_15() {
|
||||
let mut x = 15;
|
||||
let mut y = 151;
|
||||
'outer: loop {
|
||||
'inner: loop {
|
||||
if x == 1 {
|
||||
break 'outer;
|
||||
"unreachable";
|
||||
}
|
||||
if y >= 2 {
|
||||
break;
|
||||
"unreachable";
|
||||
}
|
||||
y -= 3;
|
||||
}
|
||||
y -= 4;
|
||||
x -= 5;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 16"];
|
||||
N3[label="local mut x"];
|
||||
N4[label="stmt let mut x = 16;"];
|
||||
N5[label="expr 16"];
|
||||
N6[label="local mut y"];
|
||||
N7[label="stmt let mut y = 16;"];
|
||||
N8[label="(dummy_node)"];
|
||||
N9[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 1 { break ; \"unreachable\"; }\l y -= 1;\l }\l y -= 1;\l x -= 1;\l }\l"];
|
||||
N10[label="(dummy_node)"];
|
||||
N11[label="expr \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 1 { break ; \"unreachable\"; }\l y -= 1;\l }\l"];
|
||||
N12[label="expr x"];
|
||||
N13[label="expr 1"];
|
||||
N14[label="expr x == 1"];
|
||||
N15[label="expr continue \'outer"];
|
||||
N16[label="(dummy_node)"];
|
||||
N17[label="stmt continue \'outer ;"];
|
||||
N18[label="expr \"unreachable\""];
|
||||
N19[label="stmt \"unreachable\";"];
|
||||
N20[label="block { continue \'outer ; \"unreachable\"; }"];
|
||||
N21[label="expr if x == 1 { continue \'outer ; \"unreachable\"; }"];
|
||||
N22[label="stmt if x == 1 { continue \'outer ; \"unreachable\"; }"];
|
||||
N23[label="expr y"];
|
||||
N24[label="expr 1"];
|
||||
N25[label="expr y >= 1"];
|
||||
N26[label="expr break"];
|
||||
N27[label="(dummy_node)"];
|
||||
N28[label="stmt break ;"];
|
||||
N29[label="expr \"unreachable\""];
|
||||
N30[label="stmt \"unreachable\";"];
|
||||
N31[label="block { break ; \"unreachable\"; }"];
|
||||
N32[label="expr if y >= 1 { break ; \"unreachable\"; }"];
|
||||
N33[label="stmt if y >= 1 { break ; \"unreachable\"; }"];
|
||||
N34[label="expr 1"];
|
||||
N35[label="expr y"];
|
||||
N36[label="expr y -= 1"];
|
||||
N37[label="stmt y -= 1;"];
|
||||
N38[label="block {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 1 { break ; \"unreachable\"; }\l y -= 1;\l}\l"];
|
||||
N39[label="stmt \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 1 { break ; \"unreachable\"; }\l y -= 1;\l }\l"];
|
||||
N40[label="expr 1"];
|
||||
N41[label="expr y"];
|
||||
N42[label="expr y -= 1"];
|
||||
N43[label="stmt y -= 1;"];
|
||||
N44[label="expr 1"];
|
||||
N45[label="expr x"];
|
||||
N46[label="expr x -= 1"];
|
||||
N47[label="stmt x -= 1;"];
|
||||
N48[label="block {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 1 { break ; \"unreachable\"; }\l y -= 1;\l }\l y -= 1;\l x -= 1;\l}\l"];
|
||||
N49[label="stmt \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 1 { break ; \"unreachable\"; }\l y -= 1;\l }\l y -= 1;\l x -= 1;\l }\l"];
|
||||
N50[label="expr \"unreachable\""];
|
||||
N51[label="stmt \"unreachable\";"];
|
||||
N52[label="block {\l let mut x = 16;\l let mut y = 16;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 1 { break ; \"unreachable\"; }\l y -= 1;\l }\l y -= 1;\l x -= 1;\l }\l \"unreachable\";\l}\l"];
|
||||
N53[label="expr {\l let mut x = 16;\l let mut y = 16;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 1 { break ; \"unreachable\"; }\l y -= 1;\l }\l y -= 1;\l x -= 1;\l }\l \"unreachable\";\l}\l"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N10;
|
||||
N10 -> N12;
|
||||
N12 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N15;
|
||||
N15 -> N8;
|
||||
N16 -> N17;
|
||||
N17 -> N18;
|
||||
N18 -> N19;
|
||||
N19 -> N20;
|
||||
N14 -> N21;
|
||||
N20 -> N21;
|
||||
N21 -> N22;
|
||||
N22 -> N23;
|
||||
N23 -> N24;
|
||||
N24 -> N25;
|
||||
N25 -> N26;
|
||||
N26 -> N11;
|
||||
N27 -> N28;
|
||||
N28 -> N29;
|
||||
N29 -> N30;
|
||||
N30 -> N31;
|
||||
N25 -> N32;
|
||||
N31 -> N32;
|
||||
N32 -> N33;
|
||||
N33 -> N34;
|
||||
N34 -> N35;
|
||||
N35 -> N36;
|
||||
N36 -> N37;
|
||||
N37 -> N38;
|
||||
N38 -> N10;
|
||||
N11 -> N39;
|
||||
N39 -> N40;
|
||||
N40 -> N41;
|
||||
N41 -> N42;
|
||||
N42 -> N43;
|
||||
N43 -> N44;
|
||||
N44 -> N45;
|
||||
N45 -> N46;
|
||||
N46 -> N47;
|
||||
N47 -> N48;
|
||||
N48 -> N8;
|
||||
N9 -> N49;
|
||||
N49 -> N50;
|
||||
N50 -> N51;
|
||||
N51 -> N52;
|
||||
N52 -> N53;
|
||||
N53 -> N1;
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
pub fn expr_continue_label_16() {
|
||||
let mut x = 16;
|
||||
let mut y = 16;
|
||||
'outer: loop {
|
||||
'inner: loop {
|
||||
if x == 1 {
|
||||
continue 'outer;
|
||||
"unreachable";
|
||||
}
|
||||
if y >= 1 {
|
||||
break;
|
||||
"unreachable";
|
||||
}
|
||||
y -= 1;
|
||||
}
|
||||
y -= 1;
|
||||
x -= 1;
|
||||
}
|
||||
"unreachable";
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 1"];
|
||||
N3[label="expr 7"];
|
||||
N4[label="expr 17"];
|
||||
N5[label="expr [1, 7, 17]"];
|
||||
N6[label="local _v"];
|
||||
N7[label="stmt let _v = [1, 7, 17];"];
|
||||
N8[label="block { let _v = [1, 7, 17]; }"];
|
||||
N9[label="expr { let _v = [1, 7, 17]; }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N1;
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn expr_vec_17() {
|
||||
let _v = [1, 7, 17];
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="stmt fn inner(x: isize) -> isize { x + x }"];
|
||||
N3[label="expr inner"];
|
||||
N4[label="expr inner"];
|
||||
N5[label="expr 18"];
|
||||
N6[label="expr inner(18)"];
|
||||
N7[label="expr inner(inner(18))"];
|
||||
N8[label="stmt inner(inner(18));"];
|
||||
N9[label="block {\l fn inner(x: isize) -> isize { x + x }\l inner(inner(18));\l}\l"];
|
||||
N10[label="expr {\l fn inner(x: isize) -> isize { x + x }\l inner(inner(18));\l}\l"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N1;
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn expr_call_18() {
|
||||
fn inner(x:isize) -> isize { x + x }
|
||||
inner(inner(18));
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="stmt struct S19 {\l x: isize,\l}\l"];
|
||||
N3[label="stmt impl S19 {\l fn inner(self: Self) -> S19 { S19{x: self.x + self.x,} }\l}\l"];
|
||||
N4[label="expr 19"];
|
||||
N5[label="expr S19{x: 19,}"];
|
||||
N6[label="local s"];
|
||||
N7[label="stmt let s = S19{x: 19,};"];
|
||||
N8[label="expr s"];
|
||||
N9[label="expr s.inner()"];
|
||||
N10[label="expr s.inner().inner()"];
|
||||
N11[label="stmt s.inner().inner();"];
|
||||
N12[label="block {\l struct S19 {\l x: isize,\l }\l impl S19 {\l fn inner(self: Self) -> S19 { S19{x: self.x + self.x,} }\l }\l let s = S19{x: 19,};\l s.inner().inner();\l}\l"];
|
||||
N13[label="expr {\l struct S19 {\l x: isize,\l }\l impl S19 {\l fn inner(self: Self) -> S19 { S19{x: self.x + self.x,} }\l }\l let s = S19{x: 19,};\l s.inner().inner();\l}\l"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N12;
|
||||
N12 -> N13;
|
||||
N13 -> N1;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn expr_method_call_19() {
|
||||
struct S19 { x: isize }
|
||||
impl S19 { fn inner(self) -> S19 { S19 { x: self.x + self.x } } }
|
||||
let s = S19 { x: 19 };
|
||||
s.inner().inner();
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 2"];
|
||||
N3[label="expr 0"];
|
||||
N4[label="expr 20"];
|
||||
N5[label="expr [2, 0, 20]"];
|
||||
N6[label="local v"];
|
||||
N7[label="stmt let v = [2, 0, 20];"];
|
||||
N8[label="expr v"];
|
||||
N9[label="expr 20"];
|
||||
N10[label="expr v[20]"];
|
||||
N11[label="stmt v[20];"];
|
||||
N12[label="block { let v = [2, 0, 20]; v[20]; }"];
|
||||
N13[label="expr { let v = [2, 0, 20]; v[20]; }"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N12;
|
||||
N12 -> N13;
|
||||
N13 -> N1;
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn expr_index_20() {
|
||||
let v = [2, 0, 20];
|
||||
v[20];
|
||||
}
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 15"];
|
||||
N3[label="local mut x"];
|
||||
N4[label="stmt let mut x = 15;"];
|
||||
N5[label="expr 151"];
|
||||
N6[label="local mut y"];
|
||||
N7[label="stmt let mut y = 151;"];
|
||||
N8[label="(dummy_node)"];
|
||||
N9[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l \"unreachable\";\l }\l"];
|
||||
N10[label="(dummy_node)"];
|
||||
N11[label="expr \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l"];
|
||||
N12[label="expr x"];
|
||||
N13[label="expr 1"];
|
||||
N14[label="expr x == 1"];
|
||||
N15[label="expr break \'outer"];
|
||||
N16[label="(dummy_node)"];
|
||||
N17[label="stmt break \'outer ;"];
|
||||
N18[label="expr \"unreachable\""];
|
||||
N19[label="stmt \"unreachable\";"];
|
||||
N20[label="block { break \'outer ; \"unreachable\"; }"];
|
||||
N21[label="expr if x == 1 { break \'outer ; \"unreachable\"; }"];
|
||||
N22[label="stmt if x == 1 { break \'outer ; \"unreachable\"; }"];
|
||||
N23[label="expr y"];
|
||||
N24[label="expr 2"];
|
||||
N25[label="expr y >= 2"];
|
||||
N26[label="expr return"];
|
||||
N27[label="(dummy_node)"];
|
||||
N28[label="stmt return;"];
|
||||
N29[label="expr \"unreachable\""];
|
||||
N30[label="stmt \"unreachable\";"];
|
||||
N31[label="block { return; \"unreachable\"; }"];
|
||||
N32[label="expr if y >= 2 { return; \"unreachable\"; }"];
|
||||
N33[label="stmt if y >= 2 { return; \"unreachable\"; }"];
|
||||
N34[label="expr 3"];
|
||||
N35[label="expr y"];
|
||||
N36[label="expr y -= 3"];
|
||||
N37[label="stmt y -= 3;"];
|
||||
N38[label="expr 5"];
|
||||
N39[label="expr x"];
|
||||
N40[label="expr x -= 5"];
|
||||
N41[label="stmt x -= 5;"];
|
||||
N42[label="block {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l}\l"];
|
||||
N43[label="stmt \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l"];
|
||||
N44[label="expr \"unreachable\""];
|
||||
N45[label="stmt \"unreachable\";"];
|
||||
N46[label="block {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l \"unreachable\";\l}\l"];
|
||||
N47[label="block {\l let mut x = 15;\l let mut y = 151;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l \"unreachable\";\l }\l}\l"];
|
||||
N48[label="expr {\l let mut x = 15;\l let mut y = 151;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l \"unreachable\";\l }\l}\l"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N10;
|
||||
N10 -> N12;
|
||||
N12 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N15;
|
||||
N15 -> N9;
|
||||
N16 -> N17;
|
||||
N17 -> N18;
|
||||
N18 -> N19;
|
||||
N19 -> N20;
|
||||
N14 -> N21;
|
||||
N20 -> N21;
|
||||
N21 -> N22;
|
||||
N22 -> N23;
|
||||
N23 -> N24;
|
||||
N24 -> N25;
|
||||
N25 -> N26;
|
||||
N26 -> N1;
|
||||
N27 -> N28;
|
||||
N28 -> N29;
|
||||
N29 -> N30;
|
||||
N30 -> N31;
|
||||
N25 -> N32;
|
||||
N31 -> N32;
|
||||
N32 -> N33;
|
||||
N33 -> N34;
|
||||
N34 -> N35;
|
||||
N35 -> N36;
|
||||
N36 -> N37;
|
||||
N37 -> N38;
|
||||
N38 -> N39;
|
||||
N39 -> N40;
|
||||
N40 -> N41;
|
||||
N41 -> N42;
|
||||
N42 -> N10;
|
||||
N11 -> N43;
|
||||
N43 -> N44;
|
||||
N44 -> N45;
|
||||
N45 -> N46;
|
||||
N46 -> N8;
|
||||
N9 -> N47;
|
||||
N47 -> N48;
|
||||
N48 -> N1;
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
pub fn expr_break_label_21() {
|
||||
let mut x = 15;
|
||||
let mut y = 151;
|
||||
'outer: loop {
|
||||
'inner: loop {
|
||||
if x == 1 {
|
||||
break 'outer;
|
||||
"unreachable";
|
||||
}
|
||||
if y >= 2 {
|
||||
return;
|
||||
"unreachable";
|
||||
}
|
||||
y -= 3;
|
||||
x -= 5;
|
||||
}
|
||||
"unreachable";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 15"];
|
||||
N3[label="local mut x"];
|
||||
N4[label="stmt let mut x = 15;"];
|
||||
N5[label="expr 151"];
|
||||
N6[label="local mut y"];
|
||||
N7[label="stmt let mut y = 151;"];
|
||||
N8[label="(dummy_node)"];
|
||||
N9[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l \"unreachable\";\l }\l"];
|
||||
N10[label="(dummy_node)"];
|
||||
N11[label="expr \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l"];
|
||||
N12[label="expr x"];
|
||||
N13[label="expr 1"];
|
||||
N14[label="expr x == 1"];
|
||||
N15[label="expr continue \'outer"];
|
||||
N16[label="(dummy_node)"];
|
||||
N17[label="stmt continue \'outer ;"];
|
||||
N18[label="expr \"unreachable\""];
|
||||
N19[label="stmt \"unreachable\";"];
|
||||
N20[label="block { continue \'outer ; \"unreachable\"; }"];
|
||||
N21[label="expr if x == 1 { continue \'outer ; \"unreachable\"; }"];
|
||||
N22[label="stmt if x == 1 { continue \'outer ; \"unreachable\"; }"];
|
||||
N23[label="expr y"];
|
||||
N24[label="expr 2"];
|
||||
N25[label="expr y >= 2"];
|
||||
N26[label="expr return"];
|
||||
N27[label="(dummy_node)"];
|
||||
N28[label="stmt return;"];
|
||||
N29[label="expr \"unreachable\""];
|
||||
N30[label="stmt \"unreachable\";"];
|
||||
N31[label="block { return; \"unreachable\"; }"];
|
||||
N32[label="expr if y >= 2 { return; \"unreachable\"; }"];
|
||||
N33[label="stmt if y >= 2 { return; \"unreachable\"; }"];
|
||||
N34[label="expr 1"];
|
||||
N35[label="expr x"];
|
||||
N36[label="expr x -= 1"];
|
||||
N37[label="stmt x -= 1;"];
|
||||
N38[label="expr 3"];
|
||||
N39[label="expr y"];
|
||||
N40[label="expr y -= 3"];
|
||||
N41[label="stmt y -= 3;"];
|
||||
N42[label="block {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l}\l"];
|
||||
N43[label="stmt \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l"];
|
||||
N44[label="expr \"unreachable\""];
|
||||
N45[label="stmt \"unreachable\";"];
|
||||
N46[label="block {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l \"unreachable\";\l}\l"];
|
||||
N47[label="stmt \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l \"unreachable\";\l }\l"];
|
||||
N48[label="expr \"unreachable\""];
|
||||
N49[label="stmt \"unreachable\";"];
|
||||
N50[label="block {\l let mut x = 15;\l let mut y = 151;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l \"unreachable\";\l }\l \"unreachable\";\l}\l"];
|
||||
N51[label="expr {\l let mut x = 15;\l let mut y = 151;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l \"unreachable\";\l }\l \"unreachable\";\l}\l"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N10;
|
||||
N10 -> N12;
|
||||
N12 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N15;
|
||||
N15 -> N8;
|
||||
N16 -> N17;
|
||||
N17 -> N18;
|
||||
N18 -> N19;
|
||||
N19 -> N20;
|
||||
N14 -> N21;
|
||||
N20 -> N21;
|
||||
N21 -> N22;
|
||||
N22 -> N23;
|
||||
N23 -> N24;
|
||||
N24 -> N25;
|
||||
N25 -> N26;
|
||||
N26 -> N1;
|
||||
N27 -> N28;
|
||||
N28 -> N29;
|
||||
N29 -> N30;
|
||||
N30 -> N31;
|
||||
N25 -> N32;
|
||||
N31 -> N32;
|
||||
N32 -> N33;
|
||||
N33 -> N34;
|
||||
N34 -> N35;
|
||||
N35 -> N36;
|
||||
N36 -> N37;
|
||||
N37 -> N38;
|
||||
N38 -> N39;
|
||||
N39 -> N40;
|
||||
N40 -> N41;
|
||||
N41 -> N42;
|
||||
N42 -> N10;
|
||||
N11 -> N43;
|
||||
N43 -> N44;
|
||||
N44 -> N45;
|
||||
N45 -> N46;
|
||||
N46 -> N8;
|
||||
N9 -> N47;
|
||||
N47 -> N48;
|
||||
N48 -> N49;
|
||||
N49 -> N50;
|
||||
N50 -> N51;
|
||||
N51 -> N1;
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
pub fn expr_break_label_21() {
|
||||
let mut x = 15;
|
||||
let mut y = 151;
|
||||
'outer: loop {
|
||||
'inner: loop {
|
||||
if x == 1 {
|
||||
continue 'outer;
|
||||
"unreachable";
|
||||
}
|
||||
if y >= 2 {
|
||||
return;
|
||||
"unreachable";
|
||||
}
|
||||
x -= 1;
|
||||
y -= 3;
|
||||
}
|
||||
"unreachable";
|
||||
}
|
||||
"unreachable";
|
||||
}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 23"];
|
||||
N3[label="local mut x"];
|
||||
N4[label="stmt let mut x = 23;"];
|
||||
N5[label="expr 23"];
|
||||
N6[label="local mut y"];
|
||||
N7[label="stmt let mut y = 23;"];
|
||||
N8[label="expr 23"];
|
||||
N9[label="local mut z"];
|
||||
N10[label="stmt let mut z = 23;"];
|
||||
N11[label="(dummy_node)"];
|
||||
N12[label="expr while x > 0 {\l x -= 1;\l while y > 0 {\l y -= 1;\l while z > 0 { z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l}\l"];
|
||||
N13[label="expr x"];
|
||||
N14[label="expr 0"];
|
||||
N15[label="expr x > 0"];
|
||||
N16[label="expr 1"];
|
||||
N17[label="expr x"];
|
||||
N18[label="expr x -= 1"];
|
||||
N19[label="stmt x -= 1;"];
|
||||
N20[label="(dummy_node)"];
|
||||
N21[label="expr while y > 0 {\l y -= 1;\l while z > 0 { z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l}\l"];
|
||||
N22[label="expr y"];
|
||||
N23[label="expr 0"];
|
||||
N24[label="expr y > 0"];
|
||||
N25[label="expr 1"];
|
||||
N26[label="expr y"];
|
||||
N27[label="expr y -= 1"];
|
||||
N28[label="stmt y -= 1;"];
|
||||
N29[label="(dummy_node)"];
|
||||
N30[label="expr while z > 0 { z -= 1; }"];
|
||||
N31[label="expr z"];
|
||||
N32[label="expr 0"];
|
||||
N33[label="expr z > 0"];
|
||||
N34[label="expr 1"];
|
||||
N35[label="expr z"];
|
||||
N36[label="expr z -= 1"];
|
||||
N37[label="stmt z -= 1;"];
|
||||
N38[label="block { z -= 1; }"];
|
||||
N39[label="stmt while z > 0 { z -= 1; }"];
|
||||
N40[label="expr x"];
|
||||
N41[label="expr 10"];
|
||||
N42[label="expr x > 10"];
|
||||
N43[label="expr return"];
|
||||
N44[label="(dummy_node)"];
|
||||
N45[label="stmt return;"];
|
||||
N46[label="expr \"unreachable\""];
|
||||
N47[label="stmt \"unreachable\";"];
|
||||
N48[label="block { return; \"unreachable\"; }"];
|
||||
N49[label="expr if x > 10 { return; \"unreachable\"; }"];
|
||||
N50[label="block { y -= 1; while z > 0 { z -= 1; } if x > 10 { return; \"unreachable\"; } }"];
|
||||
N51[label="block {\l x -= 1;\l while y > 0 {\l y -= 1;\l while z > 0 { z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l}\l"];
|
||||
N52[label="block {\l let mut x = 23;\l let mut y = 23;\l let mut z = 23;\l while x > 0 {\l x -= 1;\l while y > 0 {\l y -= 1;\l while z > 0 { z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l }\l}\l"];
|
||||
N53[label="expr {\l let mut x = 23;\l let mut y = 23;\l let mut z = 23;\l while x > 0 {\l x -= 1;\l while y > 0 {\l y -= 1;\l while z > 0 { z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l }\l}\l"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N15;
|
||||
N15 -> N12;
|
||||
N15 -> N16;
|
||||
N16 -> N17;
|
||||
N17 -> N18;
|
||||
N18 -> N19;
|
||||
N19 -> N20;
|
||||
N20 -> N22;
|
||||
N22 -> N23;
|
||||
N23 -> N24;
|
||||
N24 -> N21;
|
||||
N24 -> N25;
|
||||
N25 -> N26;
|
||||
N26 -> N27;
|
||||
N27 -> N28;
|
||||
N28 -> N29;
|
||||
N29 -> N31;
|
||||
N31 -> N32;
|
||||
N32 -> N33;
|
||||
N33 -> N30;
|
||||
N33 -> N34;
|
||||
N34 -> N35;
|
||||
N35 -> N36;
|
||||
N36 -> N37;
|
||||
N37 -> N38;
|
||||
N38 -> N29;
|
||||
N30 -> N39;
|
||||
N39 -> N40;
|
||||
N40 -> N41;
|
||||
N41 -> N42;
|
||||
N42 -> N43;
|
||||
N43 -> N1;
|
||||
N44 -> N45;
|
||||
N45 -> N46;
|
||||
N46 -> N47;
|
||||
N47 -> N48;
|
||||
N42 -> N49;
|
||||
N48 -> N49;
|
||||
N49 -> N50;
|
||||
N50 -> N20;
|
||||
N21 -> N51;
|
||||
N51 -> N11;
|
||||
N12 -> N52;
|
||||
N52 -> N53;
|
||||
N53 -> N1;
|
||||
}
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 24"];
|
||||
N3[label="local mut x"];
|
||||
N4[label="stmt let mut x = 24;"];
|
||||
N5[label="expr 24"];
|
||||
N6[label="local mut y"];
|
||||
N7[label="stmt let mut y = 24;"];
|
||||
N8[label="expr 24"];
|
||||
N9[label="local mut z"];
|
||||
N10[label="stmt let mut z = 24;"];
|
||||
N11[label="(dummy_node)"];
|
||||
N12[label="expr loop {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l}\l"];
|
||||
N13[label="expr x"];
|
||||
N14[label="expr 0"];
|
||||
N15[label="expr x == 0"];
|
||||
N16[label="expr break"];
|
||||
N17[label="(dummy_node)"];
|
||||
N18[label="stmt break ;"];
|
||||
N19[label="expr \"unreachable\""];
|
||||
N20[label="stmt \"unreachable\";"];
|
||||
N21[label="block { break ; \"unreachable\"; }"];
|
||||
N22[label="expr if x == 0 { break ; \"unreachable\"; }"];
|
||||
N23[label="stmt if x == 0 { break ; \"unreachable\"; }"];
|
||||
N24[label="expr 1"];
|
||||
N25[label="expr x"];
|
||||
N26[label="expr x -= 1"];
|
||||
N27[label="stmt x -= 1;"];
|
||||
N28[label="(dummy_node)"];
|
||||
N29[label="expr loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l}\l"];
|
||||
N30[label="expr y"];
|
||||
N31[label="expr 0"];
|
||||
N32[label="expr y == 0"];
|
||||
N33[label="expr break"];
|
||||
N34[label="(dummy_node)"];
|
||||
N35[label="stmt break ;"];
|
||||
N36[label="expr \"unreachable\""];
|
||||
N37[label="stmt \"unreachable\";"];
|
||||
N38[label="block { break ; \"unreachable\"; }"];
|
||||
N39[label="expr if y == 0 { break ; \"unreachable\"; }"];
|
||||
N40[label="stmt if y == 0 { break ; \"unreachable\"; }"];
|
||||
N41[label="expr 1"];
|
||||
N42[label="expr y"];
|
||||
N43[label="expr y -= 1"];
|
||||
N44[label="stmt y -= 1;"];
|
||||
N45[label="(dummy_node)"];
|
||||
N46[label="expr loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }"];
|
||||
N47[label="expr z"];
|
||||
N48[label="expr 0"];
|
||||
N49[label="expr z == 0"];
|
||||
N50[label="expr break"];
|
||||
N51[label="(dummy_node)"];
|
||||
N52[label="stmt break ;"];
|
||||
N53[label="expr \"unreachable\""];
|
||||
N54[label="stmt \"unreachable\";"];
|
||||
N55[label="block { break ; \"unreachable\"; }"];
|
||||
N56[label="expr if z == 0 { break ; \"unreachable\"; }"];
|
||||
N57[label="stmt if z == 0 { break ; \"unreachable\"; }"];
|
||||
N58[label="expr 1"];
|
||||
N59[label="expr z"];
|
||||
N60[label="expr z -= 1"];
|
||||
N61[label="stmt z -= 1;"];
|
||||
N62[label="block { if z == 0 { break ; \"unreachable\"; } z -= 1; }"];
|
||||
N63[label="stmt loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }"];
|
||||
N64[label="expr x"];
|
||||
N65[label="expr 10"];
|
||||
N66[label="expr x > 10"];
|
||||
N67[label="expr return"];
|
||||
N68[label="(dummy_node)"];
|
||||
N69[label="stmt return;"];
|
||||
N70[label="expr \"unreachable\""];
|
||||
N71[label="stmt \"unreachable\";"];
|
||||
N72[label="block { return; \"unreachable\"; }"];
|
||||
N73[label="expr if x > 10 { return; \"unreachable\"; }"];
|
||||
N74[label="block {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l}\l"];
|
||||
N75[label="block {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l}\l"];
|
||||
N76[label="block {\l let mut x = 24;\l let mut y = 24;\l let mut z = 24;\l loop {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l }\l}\l"];
|
||||
N77[label="expr {\l let mut x = 24;\l let mut y = 24;\l let mut z = 24;\l loop {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l }\l}\l"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N15;
|
||||
N15 -> N16;
|
||||
N16 -> N12;
|
||||
N17 -> N18;
|
||||
N18 -> N19;
|
||||
N19 -> N20;
|
||||
N20 -> N21;
|
||||
N15 -> N22;
|
||||
N21 -> N22;
|
||||
N22 -> N23;
|
||||
N23 -> N24;
|
||||
N24 -> N25;
|
||||
N25 -> N26;
|
||||
N26 -> N27;
|
||||
N27 -> N28;
|
||||
N28 -> N30;
|
||||
N30 -> N31;
|
||||
N31 -> N32;
|
||||
N32 -> N33;
|
||||
N33 -> N29;
|
||||
N34 -> N35;
|
||||
N35 -> N36;
|
||||
N36 -> N37;
|
||||
N37 -> N38;
|
||||
N32 -> N39;
|
||||
N38 -> N39;
|
||||
N39 -> N40;
|
||||
N40 -> N41;
|
||||
N41 -> N42;
|
||||
N42 -> N43;
|
||||
N43 -> N44;
|
||||
N44 -> N45;
|
||||
N45 -> N47;
|
||||
N47 -> N48;
|
||||
N48 -> N49;
|
||||
N49 -> N50;
|
||||
N50 -> N46;
|
||||
N51 -> N52;
|
||||
N52 -> N53;
|
||||
N53 -> N54;
|
||||
N54 -> N55;
|
||||
N49 -> N56;
|
||||
N55 -> N56;
|
||||
N56 -> N57;
|
||||
N57 -> N58;
|
||||
N58 -> N59;
|
||||
N59 -> N60;
|
||||
N60 -> N61;
|
||||
N61 -> N62;
|
||||
N62 -> N45;
|
||||
N46 -> N63;
|
||||
N63 -> N64;
|
||||
N64 -> N65;
|
||||
N65 -> N66;
|
||||
N66 -> N67;
|
||||
N67 -> N1;
|
||||
N68 -> N69;
|
||||
N69 -> N70;
|
||||
N70 -> N71;
|
||||
N71 -> N72;
|
||||
N66 -> N73;
|
||||
N72 -> N73;
|
||||
N73 -> N74;
|
||||
N74 -> N28;
|
||||
N29 -> N75;
|
||||
N75 -> N11;
|
||||
N12 -> N76;
|
||||
N76 -> N77;
|
||||
N77 -> N1;
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
pub fn expr_while_24() {
|
||||
let mut x = 24;
|
||||
let mut y = 24;
|
||||
let mut z = 24;
|
||||
|
||||
loop {
|
||||
if x == 0 { break; "unreachable"; }
|
||||
x -= 1;
|
||||
|
||||
loop {
|
||||
if y == 0 { break; "unreachable"; }
|
||||
y -= 1;
|
||||
|
||||
loop {
|
||||
if z == 0 { break; "unreachable"; }
|
||||
z -= 1;
|
||||
}
|
||||
|
||||
if x > 10 {
|
||||
return;
|
||||
"unreachable";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
digraph block {
|
||||
N0[label="entry"];
|
||||
N1[label="exit"];
|
||||
N2[label="expr 25"];
|
||||
N3[label="local mut x"];
|
||||
N4[label="stmt let mut x = 25;"];
|
||||
N5[label="expr 25"];
|
||||
N6[label="local mut y"];
|
||||
N7[label="stmt let mut y = 25;"];
|
||||
N8[label="expr 25"];
|
||||
N9[label="local mut z"];
|
||||
N10[label="stmt let mut z = 25;"];
|
||||
N11[label="(dummy_node)"];
|
||||
N12[label="expr \'a:\l loop {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l \'a:\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l }\l }\l"];
|
||||
N13[label="expr x"];
|
||||
N14[label="expr 0"];
|
||||
N15[label="expr x == 0"];
|
||||
N16[label="expr break"];
|
||||
N17[label="(dummy_node)"];
|
||||
N18[label="stmt break ;"];
|
||||
N19[label="expr \"unreachable\""];
|
||||
N20[label="stmt \"unreachable\";"];
|
||||
N21[label="block { break ; \"unreachable\"; }"];
|
||||
N22[label="expr if x == 0 { break ; \"unreachable\"; }"];
|
||||
N23[label="stmt if x == 0 { break ; \"unreachable\"; }"];
|
||||
N24[label="expr 1"];
|
||||
N25[label="expr x"];
|
||||
N26[label="expr x -= 1"];
|
||||
N27[label="stmt x -= 1;"];
|
||||
N28[label="(dummy_node)"];
|
||||
N29[label="expr \'a:\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l }\l"];
|
||||
N30[label="expr y"];
|
||||
N31[label="expr 0"];
|
||||
N32[label="expr y == 0"];
|
||||
N33[label="expr break"];
|
||||
N34[label="(dummy_node)"];
|
||||
N35[label="stmt break ;"];
|
||||
N36[label="expr \"unreachable\""];
|
||||
N37[label="stmt \"unreachable\";"];
|
||||
N38[label="block { break ; \"unreachable\"; }"];
|
||||
N39[label="expr if y == 0 { break ; \"unreachable\"; }"];
|
||||
N40[label="stmt if y == 0 { break ; \"unreachable\"; }"];
|
||||
N41[label="expr 1"];
|
||||
N42[label="expr y"];
|
||||
N43[label="expr y -= 1"];
|
||||
N44[label="stmt y -= 1;"];
|
||||
N45[label="(dummy_node)"];
|
||||
N46[label="expr \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }"];
|
||||
N47[label="expr z"];
|
||||
N48[label="expr 0"];
|
||||
N49[label="expr z == 0"];
|
||||
N50[label="expr break"];
|
||||
N51[label="(dummy_node)"];
|
||||
N52[label="stmt break ;"];
|
||||
N53[label="expr \"unreachable\""];
|
||||
N54[label="stmt \"unreachable\";"];
|
||||
N55[label="block { break ; \"unreachable\"; }"];
|
||||
N56[label="expr if z == 0 { break ; \"unreachable\"; }"];
|
||||
N57[label="stmt if z == 0 { break ; \"unreachable\"; }"];
|
||||
N58[label="expr 1"];
|
||||
N59[label="expr z"];
|
||||
N60[label="expr z -= 1"];
|
||||
N61[label="stmt z -= 1;"];
|
||||
N62[label="block { if z == 0 { break ; \"unreachable\"; } z -= 1; }"];
|
||||
N63[label="stmt \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }"];
|
||||
N64[label="expr x"];
|
||||
N65[label="expr 10"];
|
||||
N66[label="expr x > 10"];
|
||||
N67[label="expr continue \'a"];
|
||||
N68[label="(dummy_node)"];
|
||||
N69[label="stmt continue \'a ;"];
|
||||
N70[label="expr \"unreachable\""];
|
||||
N71[label="stmt \"unreachable\";"];
|
||||
N72[label="block { continue \'a ; \"unreachable\"; }"];
|
||||
N73[label="expr if x > 10 { continue \'a ; \"unreachable\"; }"];
|
||||
N74[label="block {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l}\l"];
|
||||
N75[label="block {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l \'a:\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l }\l}\l"];
|
||||
N76[label="block {\l let mut x = 25;\l let mut y = 25;\l let mut z = 25;\l \'a:\l loop {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l \'a:\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l }\l }\l}\l"];
|
||||
N77[label="expr {\l let mut x = 25;\l let mut y = 25;\l let mut z = 25;\l \'a:\l loop {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l \'a:\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l }\l }\l}\l"];
|
||||
N0 -> N2;
|
||||
N2 -> N3;
|
||||
N3 -> N4;
|
||||
N4 -> N5;
|
||||
N5 -> N6;
|
||||
N6 -> N7;
|
||||
N7 -> N8;
|
||||
N8 -> N9;
|
||||
N9 -> N10;
|
||||
N10 -> N11;
|
||||
N11 -> N13;
|
||||
N13 -> N14;
|
||||
N14 -> N15;
|
||||
N15 -> N16;
|
||||
N16 -> N12;
|
||||
N17 -> N18;
|
||||
N18 -> N19;
|
||||
N19 -> N20;
|
||||
N20 -> N21;
|
||||
N15 -> N22;
|
||||
N21 -> N22;
|
||||
N22 -> N23;
|
||||
N23 -> N24;
|
||||
N24 -> N25;
|
||||
N25 -> N26;
|
||||
N26 -> N27;
|
||||
N27 -> N28;
|
||||
N28 -> N30;
|
||||
N30 -> N31;
|
||||
N31 -> N32;
|
||||
N32 -> N33;
|
||||
N33 -> N29;
|
||||
N34 -> N35;
|
||||
N35 -> N36;
|
||||
N36 -> N37;
|
||||
N37 -> N38;
|
||||
N32 -> N39;
|
||||
N38 -> N39;
|
||||
N39 -> N40;
|
||||
N40 -> N41;
|
||||
N41 -> N42;
|
||||
N42 -> N43;
|
||||
N43 -> N44;
|
||||
N44 -> N45;
|
||||
N45 -> N47;
|
||||
N47 -> N48;
|
||||
N48 -> N49;
|
||||
N49 -> N50;
|
||||
N50 -> N46;
|
||||
N51 -> N52;
|
||||
N52 -> N53;
|
||||
N53 -> N54;
|
||||
N54 -> N55;
|
||||
N49 -> N56;
|
||||
N55 -> N56;
|
||||
N56 -> N57;
|
||||
N57 -> N58;
|
||||
N58 -> N59;
|
||||
N59 -> N60;
|
||||
N60 -> N61;
|
||||
N61 -> N62;
|
||||
N62 -> N45;
|
||||
N46 -> N63;
|
||||
N63 -> N64;
|
||||
N64 -> N65;
|
||||
N65 -> N66;
|
||||
N66 -> N67;
|
||||
N67 -> N28;
|
||||
N68 -> N69;
|
||||
N69 -> N70;
|
||||
N70 -> N71;
|
||||
N71 -> N72;
|
||||
N66 -> N73;
|
||||
N72 -> N73;
|
||||
N73 -> N74;
|
||||
N74 -> N28;
|
||||
N29 -> N75;
|
||||
N75 -> N11;
|
||||
N12 -> N76;
|
||||
N76 -> N77;
|
||||
N77 -> N1;
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
pub fn expr_while_25() {
|
||||
let mut x = 25;
|
||||
let mut y = 25;
|
||||
let mut z = 25;
|
||||
|
||||
'a: loop {
|
||||
if x == 0 { break; "unreachable"; }
|
||||
x -= 1;
|
||||
|
||||
'a: loop {
|
||||
if y == 0 { break; "unreachable"; }
|
||||
y -= 1;
|
||||
|
||||
'a: loop {
|
||||
if z == 0 { break; "unreachable"; }
|
||||
z -= 1;
|
||||
}
|
||||
|
||||
if x > 10 {
|
||||
continue 'a;
|
||||
"unreachable";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
src/test/run-make/issue-40535/Makefile
Normal file
11
src/test/run-make/issue-40535/Makefile
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# The ICE occurred in the following situation:
|
||||
# * `foo` declares `extern crate bar, baz`, depends only on `bar` (forgetting `baz` in `Cargo.toml`)
|
||||
# * `bar` declares and depends on `extern crate baz`
|
||||
# * All crates built in metadata-only mode (`cargo check`)
|
||||
all:
|
||||
# cc https://github.com/rust-lang/rust/issues/40623
|
||||
$(RUSTC) baz.rs --emit=metadata --out-dir=$(TMPDIR)
|
||||
$(RUSTC) bar.rs --emit=metadata --extern baz=$(TMPDIR)/libbaz.rmeta --out-dir=$(TMPDIR)
|
||||
$(RUSTC) foo.rs --emit=metadata --extern bar=$(TMPDIR)/libbar.rmeta --out-dir=$(TMPDIR) 2>&1 | \
|
||||
grep -vq "unexpectedly panicked"
|
||||
# ^ Succeeds if it doesn't find the ICE message
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
|
@ -8,6 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn lit_1() {
|
||||
1;
|
||||
}
|
||||
#![crate_type = "lib"]
|
||||
|
||||
extern crate baz;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
|
@ -8,6 +8,4 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn empty_0() {
|
||||
|
||||
}
|
||||
#![crate_type = "lib"]
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn expr_add_3() {
|
||||
3 + 4;
|
||||
}
|
||||
#![crate_type = "lib"]
|
||||
|
||||
extern crate bar;
|
||||
extern crate baz;
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
#![ crate_name = "test" ]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(associated_type_defaults)]
|
||||
|
||||
extern crate graphviz;
|
||||
// A simple rust project
|
||||
|
|
@ -441,3 +442,19 @@ fn test_format_args() {
|
|||
print!("{0} + {} = {}", x, y);
|
||||
print!("x is {}, y is {1}, name is {n}", x, y, n = name);
|
||||
}
|
||||
|
||||
struct FrameBuffer;
|
||||
|
||||
struct SilenceGenerator;
|
||||
|
||||
impl Iterator for SilenceGenerator {
|
||||
type Item = FrameBuffer;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
panic!();
|
||||
}
|
||||
}
|
||||
|
||||
trait Foo {
|
||||
type Bar = FrameBuffer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// aux-build:logging_right_crate.rs
|
||||
// exec-env:RUST_LOG=logging-right-crate=debug
|
||||
|
||||
// This is a test for issue #3046 to make sure that when we monomorphize a
|
||||
// function from one crate to another the right top-level logging name is
|
||||
// preserved.
|
||||
//
|
||||
// It used to be the case that if logging were turned on for this crate, all
|
||||
// monomorphized functions from other crates had logging turned on (their
|
||||
// logging module names were all incorrect). This test ensures that this no
|
||||
// longer happens by enabling logging for *this* crate and then invoking a
|
||||
// function in an external crate which will panic when logging is enabled.
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
extern crate logging_right_crate;
|
||||
|
||||
pub fn main() {
|
||||
// this function panicks if logging is turned on
|
||||
logging_right_crate::foo::<isize>();
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-windows
|
||||
// exec-env:RUST_LOG=debug
|
||||
// compile-flags:-C debug-assertions=y
|
||||
// ignore-emscripten: FIXME(#31622)
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
use std::process::Command;
|
||||
use std::env;
|
||||
use std::str;
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
if args.len() > 1 && args[1] == "child" {
|
||||
debug!("foo");
|
||||
debug!("bar");
|
||||
return
|
||||
}
|
||||
|
||||
let p = Command::new(&args[0])
|
||||
.arg("child")
|
||||
.output().unwrap();
|
||||
assert!(p.status.success());
|
||||
let mut lines = str::from_utf8(&p.stderr).unwrap().lines();
|
||||
assert!(lines.next().unwrap().contains("foo"));
|
||||
assert!(lines.next().unwrap().contains("bar"));
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue