+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#[derive(Debug)]
-enum Foo<'s> {
- V(&'s str)
-}
-
-fn f(arr: &[&Foo]) {
- for &f in arr {
- println!("{:?}", f);
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-pub struct Foo;
-
-pub trait Bar {
- fn bar(&self);
-}
-
-pub trait Baz {
- fn baz(&self) { }
-}
-
-impl<T: Baz> Bar for T {
- fn bar(&self) {}
-}
-
-impl Baz for Foo {}
-
-pub fn foo(t: Box<Foo>) {
- t.bar(); // ~Foo doesn't implement Baz
- (*t).bar(); // ok b/c Foo implements Baz
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-extern "Rust" fn foo() {}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-#![deny(missing_docs)]
-#![doc="module"]
-
-#[doc="struct"]
-pub struct Foo;
-
-pub fn foo() {
- #![doc="fn"]
-}
-
-#[doc="main"]
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-pub mod two_tuple {
- pub trait T { fn dummy(&self) { } }
- pub struct P<'a>(&'a (T + 'a), &'a (T + 'a));
- pub fn f<'a>(car: &'a T, cdr: &'a T) -> P<'a> {
- P(car, cdr)
- }
-}
-
-pub mod two_fields {
- pub trait T { fn dummy(&self) { } }
- pub struct P<'a> { car: &'a (T + 'a), cdr: &'a (T + 'a) }
- pub fn f<'a>(car: &'a T, cdr: &'a T) -> P<'a> {
- P{ car: car, cdr: cdr }
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-trait Common { fn dummy(&self) { } }
-
-impl<'t, T> Common for (T, &'t T) {}
-
-impl<'t, T> Common for (&'t T, T) {}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-//! Ensure the private trait Bar isn't complained about.
-
-#![deny(missing_docs)]
-
-mod foo {
- trait Bar { fn bar(&self) { } }
- impl Bar for i8 { fn bar(&self) { } }
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// #11612
-// We weren't updating the auto adjustments with all the resolved
-// type information after type check.
-
-// pretty-expanded FIXME #23616
-
-trait A { fn dummy(&self) { } }
-
-struct B<'a, T:'a> {
- f: &'a T
-}
-
-impl<'a, T> A for B<'a, T> {}
-
-fn foo(_: &A) {}
-
-fn bar<G>(b: &B<G>) {
- foo(b); // Coercion should work
- foo(b as &A); // Explicit cast should work as well
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-struct A {
- a: String
-}
-
-fn borrow<'a>(binding: &'a A) -> &'a str {
- match &*binding.a {
- "in" => "in_",
- "ref" => "ref_",
- ident => ident
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(unused_attributes)]
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-// ignore-wasm32-bare no libc to test ffi with
-
-#![feature(libc)]
-
-#![crate_id="rust_get_test_int"]
-
-mod rustrt {
- extern crate libc;
-
- extern {
- pub fn rust_get_test_int() -> libc::intptr_t;
- }
-}
-
-pub fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-pub struct Foo;
-
-mod bar {
- use Foo;
-
- impl Foo {
- fn baz(&self) {}
- }
-}
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-trait Foo {
- #[allow(anonymous_parameters)]
- fn quux(u8) {}
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-use std::slice;
-
-pub struct PhfMapEntries<'a, T: 'a> {
- iter: slice::Iter<'a, (&'static str, T)>,
-}
-
-impl<'a, T> Iterator for PhfMapEntries<'a, T> {
- type Item = (&'static str, &'a T);
-
- fn next(&mut self) -> Option<(&'static str, &'a T)> {
- self.iter.by_ref().map(|&(key, ref value)| (key, value)).next()
- }
-
- fn size_hint(&self) -> (usize, Option<usize>) {
- self.iter.size_hint()
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// defining static with struct that contains enum
-// with &'static str variant used to cause ICE
-
-// pretty-expanded FIXME #23616
-
-pub enum Foo {
- Bar,
- Baz(&'static str),
-}
-
-pub static TEST: Test = Test {
- foo: Foo::Bar,
- c: 'a'
-};
-
-pub struct Test {
- foo: Foo,
- c: char,
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_variables)]
-// pretty-expanded FIXME #23616
-
-struct Foo<'a> {
- i: &'a bool,
- j: Option<&'a isize>,
-}
-
-impl<'a> Foo<'a> {
- fn bar(&mut self, j: &isize) {
- let child = Foo {
- i: self.i,
- j: Some(j)
- };
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-pub struct Foo<'a, 'b: 'a> { foo: &'a &'b isize }
-pub fn foo<'a, 'b>(x: Foo<'a, 'b>, _o: Option<& & ()>) { let _y = x.foo; }
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-trait Foo {
- #[allow(anonymous_parameters)]
- fn bar(&self, isize) {}
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-struct TestStruct {
- x: *const [isize; 2]
-}
-
-unsafe impl Sync for TestStruct {}
-
-static TEST_VALUE : TestStruct = TestStruct{x: 0x1234 as *const [isize; 2]};
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-#![allow(unused_imports, dead_code)]
-
-use foo::Foo;
-
-mod foo {
- pub use m::Foo; // this should shadow d::Foo
-}
-
-mod m {
- pub struct Foo;
-}
-
-mod d {
- pub struct Foo;
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-trait Foo: Sized {
- fn bar(&self);
- fn baz(&self) { }
- fn bah(_: Option<Self>) { }
-}
-
-struct BarTy {
- x : isize,
- y : f64,
-}
-
-impl BarTy {
- fn a() {}
- fn b(&self) {}
-}
-
-// If these fail, it's necessary to update rustc_resolve and the cfail tests.
-impl Foo for *const BarTy {
- fn bar(&self) {
- self.baz();
- BarTy::a();
- Foo::bah(None::<*const BarTy>);
- }
-}
-
-// If these fail, it's necessary to update rustc_resolve and the cfail tests.
-impl<'a> Foo for &'a BarTy {
- fn bar(&self) {
- self.baz();
- self.x;
- self.y;
- BarTy::a();
- Foo::bah(None::<&BarTy>);
- self.b();
- }
-}
-
-// If these fail, it's necessary to update rustc_resolve and the cfail tests.
-impl<'a> Foo for &'a mut BarTy {
- fn bar(&self) {
- self.baz();
- self.x;
- self.y;
- BarTy::a();
- Foo::bah(None::<&mut BarTy>);
- self.b();
- }
-}
-
-// If these fail, it's necessary to update rustc_resolve and the cfail tests.
-impl Foo for Box<BarTy> {
- fn bar(&self) {
- self.baz();
- Foo::bah(None::<Box<BarTy>>);
- }
-}
-
-// If these fail, it's necessary to update rustc_resolve and the cfail tests.
-impl Foo for *const isize {
- fn bar(&self) {
- self.baz();
- Foo::bah(None::<*const isize>);
- }
-}
-
-// If these fail, it's necessary to update rustc_resolve and the cfail tests.
-impl<'a> Foo for &'a isize {
- fn bar(&self) {
- self.baz();
- Foo::bah(None::<&isize>);
- }
-}
-
-// If these fail, it's necessary to update rustc_resolve and the cfail tests.
-impl<'a> Foo for &'a mut isize {
- fn bar(&self) {
- self.baz();
- Foo::bah(None::<&mut isize>);
- }
-}
-
-// If these fail, it's necessary to update rustc_resolve and the cfail tests.
-impl Foo for Box<isize> {
- fn bar(&self) {
- self.baz();
- Foo::bah(None::<Box<isize>>);
- }
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2012-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.
-
-// run-pass
-#![allow(unused_imports)]
-// pretty-expanded FIXME #23616
-
-#[macro_use] extern crate std as std2;
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-#[deny(dead_code)]
-pub enum Foo {
- Bar {
- baz: isize
- }
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-pub trait Reader {}
-
-enum Wrapper<'a> {
- WrapReader(&'a (Reader + 'a))
-}
-
-trait Wrap<'a> {
- fn wrap(self) -> Wrapper<'a>;
-}
-
-impl<'a, R: Reader> Wrap<'a> for &'a mut R {
- fn wrap(self) -> Wrapper<'a> {
- Wrapper::WrapReader(self as &'a mut Reader)
- }
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-pub type BigRat<T = isize> = T;
-
-fn main() {}
+++ /dev/null
-// Copyright 2012-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.
-
-// run-pass
-#![allow(unused_macros)]
-#![allow(dead_code)]
-#![feature(asm)]
-
-type History = Vec<&'static str>;
-
-fn wrap<A>(x:A, which: &'static str, history: &mut History) -> A {
- history.push(which);
- x
-}
-
-macro_rules! demo {
- ( $output_constraint:tt ) => {
- {
- let mut x: isize = 0;
- let y: isize = 1;
-
- let mut history: History = vec![];
- unsafe {
- asm!("mov ($1), $0"
- : $output_constraint (*wrap(&mut x, "out", &mut history))
- : "r"(&wrap(y, "in", &mut history))
- :: "volatile");
- }
- assert_eq!((x,y), (1,1));
- let b: &[_] = &["out", "in"];
- assert_eq!(history, b);
- }
- }
-}
-
-#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-fn main() {
- fn out_write_only_expr_then_in_expr() {
- demo!("=r")
- }
-
- fn out_read_write_expr_then_in_expr() {
- demo!("+r")
- }
-
- out_write_only_expr_then_in_expr();
- out_read_write_expr_then_in_expr();
-}
-
-#[cfg(all(not(target_arch = "x86"), not(target_arch = "x86_64")))]
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-#![feature(fn_traits, unboxed_closures)]
-
-use std::ops::Fn;
-
-trait Response { fn dummy(&self) { } }
-trait Request { fn dummy(&self) { } }
-trait Ingot<R, S> {
- fn enter(&mut self, _: &mut R, _: &mut S, a: &mut Alloy) -> Status;
-}
-
-#[allow(dead_code)]
-struct HelloWorld;
-
-struct SendFile;
-struct Alloy;
-enum Status {
- Continue
-}
-
-impl Alloy {
- fn find<T>(&self) -> Option<T> {
- None
- }
-}
-
-impl<'b> Fn<(&'b mut (Response+'b),)> for SendFile {
- extern "rust-call" fn call(&self, (_res,): (&'b mut (Response+'b),)) {}
-}
-
-impl<'b> FnMut<(&'b mut (Response+'b),)> for SendFile {
- extern "rust-call" fn call_mut(&mut self, (_res,): (&'b mut (Response+'b),)) {
- self.call((_res,))
- }
-}
-
-impl<'b> FnOnce<(&'b mut (Response+'b),)> for SendFile {
- type Output = ();
-
- extern "rust-call" fn call_once(self, (_res,): (&'b mut (Response+'b),)) {
- self.call((_res,))
- }
-}
-
-impl<Rq: Request, Rs: Response> Ingot<Rq, Rs> for HelloWorld {
- fn enter(&mut self, _req: &mut Rq, res: &mut Rs, alloy: &mut Alloy) -> Status {
- let send_file = alloy.find::<SendFile>().unwrap();
- send_file(res);
- Status::Continue
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_upper_case_globals)]
-
-// pretty-expanded FIXME #23616
-
-static mut n_mut: usize = 0;
-
-static n: &'static usize = unsafe{ &n_mut };
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-#[derive(Clone)]
-enum Test<'a> {
- Slice(&'a isize)
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-struct A<'a> {
- a: &'a i32,
- b: &'a i32,
-}
-
-impl <'a> A<'a> {
- fn foo<'b>(&'b self) {
- A {
- a: self.a,
- b: self.b,
- };
- }
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-
-trait MatrixRow { fn dummy(&self) { }}
-
-struct Mat;
-
-impl<'a> MatrixRow for &'a Mat {}
-
-struct Rows<M: MatrixRow> {
- mat: M,
-}
-
-impl<'a> Iterator for Rows<&'a Mat> {
- type Item = ();
-
- fn next(&mut self) -> Option<()> {
- unimplemented!()
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-struct Parser<'a, I, O> {
- parse: Box<FnMut(I) -> Result<O, String> + 'a>
-}
-
-impl<'a, I: 'a, O: 'a> Parser<'a, I, O> {
- fn compose<K: 'a>(mut self, mut rhs: Parser<'a, O, K>) -> Parser<'a, I, K> {
- Parser {
- parse: Box::new(move |x: I| {
- match (self.parse)(x) {
- Ok(r) => (rhs.parse)(r),
- Err(e) => Err(e)
- }
- })
- }
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-// ignore-cloudabi no std::fs
-
-use std::fs::File;
-use std::io::{self, BufReader, Read};
-
-struct Lexer<R: Read>
-{
- reader: BufReader<R>,
-}
-
-impl<R: Read> Lexer<R>
-{
- pub fn new_from_reader(r: R) -> Lexer<R>
- {
- Lexer{reader: BufReader::new(r)}
- }
-
- pub fn new_from_file(p: &str) -> io::Result<Lexer<File>>
- {
- Ok(Lexer::new_from_reader(File::open(p)?))
- }
-
- pub fn new_from_str<'a>(s: &'a str) -> Lexer<&'a [u8]>
- {
- Lexer::new_from_reader(s.as_bytes())
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(unused_must_use)]
-#[allow(dead_code)]
-fn check(a: &str) {
- let x = a as *const str;
- x == x;
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code, warnings)]
-
-static mut x: isize = 3;
-static mut y: isize = unsafe { x };
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-struct A;
-impl Drop for A {
- fn drop(&mut self) {}
-}
-
-const FOO: A = A;
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-trait Person {
- type string;
- fn dummy(&self) { }
-}
-
-struct Someone<P: Person>(std::marker::PhantomData<P>);
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Regression test for #17746
-
-fn main() {}
-
-struct A;
-
-impl A {
- fn b(&mut self) {
- self.a()
- }
-}
-
-trait Foo {
- fn dummy(&self) {}
-}
-trait Bar {
- fn a(&self);
-}
-
-impl Foo for A {}
-impl<T> Bar for T where T: Foo {
- fn a(&self) {}
-}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Test that we can parse where clauses on various forms of tuple
-// structs.
-
-// pretty-expanded FIXME #23616
-
-struct Bar<T>(T) where T: Copy;
-struct Bleh<T, U>(T, U) where T: Copy, U: Sized;
-struct Baz<T> where T: Copy {
- field: T
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_imports)]
-// These crossed imports should resolve fine, and not block on
-// each other and be reported as unresolved.
-
-mod a {
- use b::{B};
- pub use self::inner::A;
-
- mod inner {
- pub struct A;
- }
-}
-
-mod b {
- use a::{A};
- pub use self::inner::B;
-
- mod inner {
- pub struct B;
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-
-pub trait Indexable<T>: std::ops::Index<usize, Output = T> {
- fn index2(&self, i: usize) -> &T {
- &self[i]
- }
-}
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-pub trait Promisable: Send + Sync {}
-impl<T: Send + Sync> Promisable for T {}
-
-pub fn propagate<'a, T, E, F, G>(mut action: F)
- -> Box<FnMut(Result<T, E>) -> Result<T, E> + 'a>
- where
- T: Promisable + Clone + 'a,
- E: Promisable + Clone + 'a,
- F: FnMut(&T) -> Result<T, E> + Send + 'a,
- G: FnMut(Result<T, E>) -> Result<T, E> + 'a {
- Box::new(move |result: Result<T, E>| {
- match result {
- Ok(ref t) => action(t),
- Err(ref e) => Err(e.clone()),
- }
- })
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_camel_case_types)]
-
-// Issue #1821 - Don't recurse trying to typecheck this
-
-
-// pretty-expanded FIXME #23616
-
-enum t {
- foo(Vec<t>)
-}
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Test that methods in trait impls should override default methods.
-
-trait T {
- fn foo(&self) -> i32 { 0 }
-}
-
-impl<'a> T + 'a {
- fn foo(&self) -> i32 { 1 }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_camel_case_types)]
-
-// pretty-expanded FIXME #23616
-
-mod a {
- pub type rust_task = usize;
- pub mod rustrt {
- use super::rust_task;
- extern {
- pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool;
- }
- }
-}
-
-mod b {
- pub type rust_task = bool;
- pub mod rustrt {
- use super::rust_task;
- extern {
- pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool;
- }
- }
-}
-
-pub fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#[derive(Eq, PartialEq, PartialOrd, Ord)]
-enum Test<'a> {
- Int(&'a isize),
- Slice(&'a [u8]),
-}
-
-#[derive(Eq, PartialEq, PartialOrd, Ord)]
-struct Version {
- vendor_info: &'static str
-}
-
-#[derive(Eq, PartialEq, PartialOrd, Ord)]
-struct Foo(&'static str);
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-trait Tup {
- type T0;
- type T1;
-}
-
-impl Tup for isize {
- type T0 = f32;
- type T1 = ();
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-pub trait Borrow<Borrowed: ?Sized> {
- fn borrow(&self) -> &Borrowed;
-}
-
-impl<T: Sized> Borrow<T> for T {
- fn borrow(&self) -> &T { self }
-}
-
-trait Foo {
- fn foo(&self, other: &Self);
-}
-
-fn bar<K, Q>(k: &K, q: &Q) where K: Borrow<Q>, Q: Foo {
- q.foo(k.borrow())
-}
-
-struct MyTree<K>(K);
-
-impl<K> MyTree<K> {
- // This caused a failure in #18906
- fn bar<Q>(k: &K, q: &Q) where K: Borrow<Q>, Q: Foo {
- q.foo(k.borrow())
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-pub trait Foo : Send { }
-
-pub struct MyFoo {
- children: Vec<Box<Foo>>,
-}
-
-impl Foo for MyFoo { }
-
-pub fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-struct Str([u8]);
-
-#[derive(Clone)]
-struct CharSplits<'a, Sep> {
- string: &'a Str,
- sep: Sep,
- allow_trailing_empty: bool,
- only_ascii: bool,
- finished: bool,
-}
-
-fn clone(s: &Str) -> &Str {
- Clone::clone(&s)
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-pub trait Hasher {
- type State;
-
- fn hash<T: Hash<
- <Self as Hasher>::State
- >>(&self, value: &T) -> u64;
-}
-
-pub trait Hash<S> {
- fn hash(&self, state: &mut S);
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// regression test for #19097
-
-struct Foo<T>(T);
-
-impl<'a, T> Foo<&'a T> {
- fn foo(&self) {}
-}
-impl<'a, T> Foo<&'a mut T> {
- fn foo(&self) {}
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-pub trait Handler {
- fn handle(&self, _: &mut String);
-}
-
-impl<F> Handler for F where F: for<'a, 'b> Fn(&'a mut String) {
- fn handle(&self, st: &mut String) {
- self(st)
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(unused_imports)]
-#![deny(unused_qualifications)]
-
-use self::A::B;
-
-#[derive(PartialEq)]
-pub enum A {
- B,
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-trait Trait<Input> {
- type Output;
-
- fn method() -> <Self as Trait<Input>>::Output;
-}
-
-impl<T> Trait<T> for () {
- type Output = ();
-
- fn method() {}
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(unused_variables)]
-// pretty-expanded FIXME #23616
-
-trait Trait<Input> {
- type Output;
-
- fn method(&self, i: Input) -> bool { false }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-trait T {
- unsafe extern "Rust" fn foo(&self);
-}
-
-impl T for () {
- unsafe extern "Rust" fn foo(&self) {}
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_variables)]
-use std::any::TypeId;
-use std::rc::Rc;
-
-type Fp<T> = Rc<T>;
-
-struct Engine;
-
-trait Component: 'static {}
-impl Component for Engine {}
-
-trait Env {
- fn get_component_type_id(&self, type_id: TypeId) -> Option<Fp<Component>>;
-}
-
-impl<'a> Env+'a {
- fn get_component<T: Component>(&self) -> Option<Fp<T>> {
- let x = self.get_component_type_id(TypeId::of::<T>());
- None
- }
-}
-
-trait Figment {
- fn init(&mut self, env: &Env);
-}
-
-struct MyFigment;
-
-impl Figment for MyFigment {
- fn init(&mut self, env: &Env) {
- let engine = env.get_component::<Engine>();
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-trait Base {
- fn dummy(&self) { }
-}
-trait AssocA {
- type X: Base;
- fn dummy(&self) { }
-}
-trait AssocB {
- type Y: Base;
- fn dummy(&self) { }
-}
-impl<T: AssocA> AssocB for T {
- type Y = <T as AssocA>::X;
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-trait PoolManager {
- type C;
- fn dummy(&self) { }
-}
-
-struct InnerPool<M> {
- manager: M,
-}
-
-impl<M> InnerPool<M> where M: PoolManager {}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-trait PoolManager {
- type C;
- fn dummy(&self) { }
-}
-
-struct InnerPool<M: PoolManager> {
- manager: M,
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(unused_variables)]
-// Test that `<Type as Trait>::Output` and `Self::Output` are accepted as type annotations in let
-// bindings
-
-// pretty-expanded FIXME #23616
-
-trait Int {
- fn one() -> Self;
- fn leading_zeros(self) -> usize;
-}
-
-trait Foo {
- type T : Int;
-
- fn test(&self) {
- let r: <Self as Foo>::T = Int::one();
- let r: Self::T = Int::one();
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-#![feature(fn_traits, unboxed_closures)]
-
-#[allow(dead_code)]
-struct Foo;
-
-impl<'a> Fn<(&'a (),)> for Foo {
- extern "rust-call" fn call(&self, (_,): (&(),)) {}
-}
-
-impl<'a> FnMut<(&'a (),)> for Foo {
- extern "rust-call" fn call_mut(&mut self, (_,): (&(),)) {}
-}
-
-impl<'a> FnOnce<(&'a (),)> for Foo {
- type Output = ();
-
- extern "rust-call" fn call_once(self, (_,): (&(),)) {}
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// Check that associated types are `Sized`
-
-// pretty-expanded FIXME #23616
-
-trait Trait {
- type Output;
-
- fn is_sized(&self) -> Self::Output;
- fn wasnt_sized(&self) -> Self::Output { loop {} }
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2012-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.
-
-// run-pass
-#![allow(stable_features)]
-
-// ignore-cloudabi no processes
-// ignore-emscripten no processes
-
-#![feature(os)]
-
-#[cfg(unix)]
-fn main() {
- use std::process::Command;
- use std::env;
- use std::os::unix::prelude::*;
- use std::ffi::OsStr;
-
- if env::args().len() == 1 {
- assert!(Command::new(&env::current_exe().unwrap())
- .arg(<OsStr as OsStrExt>::from_bytes(b"\xff"))
- .status().unwrap().success())
- }
-}
-
-#[cfg(windows)]
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_variables)]
-struct Foo;
-
-impl Foo {
- fn putc(&self, b: u8) { }
-
- fn puts(&self, s: &str) {
- for byte in s.bytes() {
- self.putc(byte)
- }
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-#![allow(dead_code)]
-
-trait Foo<T> {
- fn noop(&self, _: T);
-}
-
-enum Bar<T> { Bla(T) }
-
-struct Baz<'a> {
- inner: for<'b> Foo<Bar<&'b ()>> + 'a,
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-trait Trait {
- fn method(self) -> isize;
-}
-
-struct Wrapper<T> {
- field: T
-}
-
-impl<'a, T> Trait for &'a Wrapper<T> where &'a T: Trait {
- fn method(self) -> isize {
- let r: &'a T = &self.field;
- Trait::method(r); // these should both work
- r.method()
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(unused_must_use)]
-use std::thread;
-
-fn _foo() {
- thread::spawn(move || { // no need for -> ()
- loop {
- println!("hello");
- }
- }).join();
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// test that autoderef of a type like this does not
-// cause compiler to loop. Note that no instances
-// of such a type could ever be constructed.
-
-struct S {
- x: X,
- to_str: (),
-}
-
-struct X(Box<S>);
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_imports)]
-#![allow(stable_features)]
-
-// A reduced version of the rustbook ice. The problem this encountered
-// had to do with codegen ignoring binders.
-
-// pretty-expanded FIXME #23616
-// ignore-cloudabi no std::fs
-
-#![feature(os)]
-
-use std::iter;
-use std::os;
-use std::fs::File;
-use std::io::prelude::*;
-use std::env;
-use std::path::Path;
-
-pub fn parse_summary<R: Read>(_: R, _: &Path) {
- let path_from_root = Path::new("");
- Path::new(&iter::repeat("../")
- .take(path_from_root.components().count() - 1)
- .collect::<String>());
- }
-
-fn foo() {
- let cwd = env::current_dir().unwrap();
- let src = cwd.clone();
- let summary = File::open(&src.join("SUMMARY.md")).unwrap();
- let _ = parse_summary(summary, &src);
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-trait T0 {
- type O;
- fn dummy(&self) { }
-}
-
-struct S<A>(A);
-impl<A> T0 for S<A> { type O = A; }
-
-trait T1: T0 {
- // this looks okay but as we see below, `f` is unusable
- fn m0<F: Fn(<Self as T0>::O) -> bool>(self, f: F) -> bool;
-}
-
-// complains about the bounds on F here not being required by the trait
-impl<A> T1 for S<A> {
- fn m0<F: Fn(A) -> bool>(self, f: F) -> bool { f(self.0) }
-}
-
-// // complains about mismatched types: <S<A> as T0>::O vs. A
-// impl<A> T1 for S<A>
-// {
-// fn m0<F: Fn(<Self as T0>::O) -> bool>(self, f: F) -> bool { f(self.0) }
-// }
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-trait T0 {
- type O;
- fn dummy(&self) { }
-}
-
-struct S<A>(A);
-impl<A> T0 for S<A> { type O = A; }
-
-trait T1: T0 {
- // this looks okay but as we see below, `f` is unusable
- fn m0<F: Fn(<Self as T0>::O) -> bool>(self, f: F) -> bool;
-}
-
-// complains about mismatched types: <S<A> as T0>::O vs. A
-impl<A> T1 for S<A>
-{
- fn m0<F: Fn(<Self as T0>::O) -> bool>(self, f: F) -> bool { f(self.0) }
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-// ignore-cloudabi no std::fs
-
-// Regression test for #20797.
-
-use std::default::Default;
-use std::io;
-use std::fs;
-use std::path::PathBuf;
-
-pub trait PathExtensions {
- fn is_dir(&self) -> bool { false }
-}
-
-impl PathExtensions for PathBuf {}
-
-/// A strategy for acquiring more subpaths to walk.
-pub trait Strategy {
- type P: PathExtensions;
- /// Get additional subpaths from a given path.
- fn get_more(&self, item: &Self::P) -> io::Result<Vec<Self::P>>;
- /// Determine whether a path should be walked further.
- /// This is run against each item from `get_more()`.
- fn prune(&self, p: &Self::P) -> bool;
-}
-
-/// The basic fully-recursive strategy. Nothing is pruned.
-#[derive(Copy, Clone, Default)]
-pub struct Recursive;
-
-impl Strategy for Recursive {
- type P = PathBuf;
- fn get_more(&self, p: &PathBuf) -> io::Result<Vec<PathBuf>> {
- Ok(fs::read_dir(p).unwrap().map(|s| s.unwrap().path()).collect())
- }
-
- fn prune(&self, _: &PathBuf) -> bool { false }
-}
-
-/// A directory walker of `P` using strategy `S`.
-pub struct Subpaths<S: Strategy> {
- stack: Vec<S::P>,
- strategy: S,
-}
-
-impl<S: Strategy> Subpaths<S> {
- /// Create a directory walker with a root path and strategy.
- pub fn new(p: &S::P, strategy: S) -> io::Result<Subpaths<S>> {
- let stack = strategy.get_more(p)?;
- Ok(Subpaths { stack: stack, strategy: strategy })
- }
-}
-
-impl<S: Default + Strategy> Subpaths<S> {
- /// Create a directory walker with a root path and a default strategy.
- pub fn walk(p: &S::P) -> io::Result<Subpaths<S>> {
- Subpaths::new(p, Default::default())
- }
-}
-
-impl<S: Default + Strategy> Default for Subpaths<S> {
- fn default() -> Subpaths<S> {
- Subpaths { stack: Vec::new(), strategy: Default::default() }
- }
-}
-
-impl<S: Strategy> Iterator for Subpaths<S> {
- type Item = S::P;
- fn next (&mut self) -> Option<S::P> {
- let mut opt_path = self.stack.pop();
- while opt_path.is_some() && self.strategy.prune(opt_path.as_ref().unwrap()) {
- opt_path = self.stack.pop();
- }
- match opt_path {
- Some(path) => {
- if path.is_dir() {
- let result = self.strategy.get_more(&path);
- match result {
- Ok(dirs) => { self.stack.extend(dirs); },
- Err(..) => { }
- }
- }
- Some(path)
- }
- None => None,
- }
- }
-}
-
-fn _foo() {
- let _walker: Subpaths<Recursive> = Subpaths::walk(&PathBuf::from("/home")).unwrap();
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-pub trait Subscriber {
- type Input;
-}
-
-pub trait Processor: Subscriber<Input = <Self as Processor>::Input> {
- type Input;
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-pub trait Trait where Self::Out: std::fmt::Display {
- type Out;
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_variables)]
-trait Trait<'a> {
- type A;
- type B;
-}
-
-fn foo<'a, T: Trait<'a>>(value: T::A) {
- let new: T::B = unsafe { std::mem::transmute_copy(&value) };
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Regression test for issue #21245. Check that we are able to infer
-// the types in these examples correctly. It used to be that
-// insufficient type propagation caused the type of the iterator to be
-// incorrectly unified with the `*const` type to which it is coerced.
-
-// pretty-expanded FIXME #23616
-
-use std::ptr;
-
-trait IntoIterator {
- type Iter: Iterator;
-
- fn into_iter2(self) -> Self::Iter;
-}
-
-impl<I> IntoIterator for I where I: Iterator {
- type Iter = I;
-
- fn into_iter2(self) -> I {
- self
- }
-}
-
-fn desugared_for_loop_bad<T>(v: Vec<T>) {
- match IntoIterator::into_iter2(v.iter()) {
- mut iter => {
- loop {
- match ::std::iter::Iterator::next(&mut iter) {
- ::std::option::Option::Some(x) => {
- unsafe { ptr::read(x); }
- },
- ::std::option::Option::None => break
- }
- }
- }
- }
-}
-
-fn desugared_for_loop_good<T>(v: Vec<T>) {
- match v.iter().into_iter() {
- mut iter => {
- loop {
- match ::std::iter::Iterator::next(&mut iter) {
- ::std::option::Option::Some(x) => {
- unsafe { ptr::read(x); }
- },
- ::std::option::Option::None => break
- }
- }
- }
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-#![no_implicit_prelude]
-
-trait Iterator {
- type Item;
- fn dummy(&self) { }
-}
-
-impl<'a, T> Iterator for &'a mut (Iterator<Item=T> + 'a) {
- type Item = T;
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-#[derive(Hash)]
-struct Foo {
- a: Vec<bool>,
- b: (bool, bool),
- c: [bool; 2],
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Test that the requirement (in `Bar`) that `T::Bar : 'static` does
-// not wind up propagating to `T`.
-
-// pretty-expanded FIXME #23616
-
-pub trait Foo {
- type Bar;
-
- fn foo(&self) -> Self;
-}
-
-pub struct Static<T:'static>(T);
-
-struct Bar<T:Foo>
- where T::Bar : 'static
-{
- x: Static<Option<T::Bar>>
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_upper_case_globals)]
-
-extern crate core;
-use core::marker::Sync;
-
-static SARRAY: [i32; 1] = [11];
-
-struct MyStruct {
- pub arr: *const [i32],
-}
-unsafe impl Sync for MyStruct {}
-
-static mystruct: MyStruct = MyStruct {
- arr: &SARRAY
-};
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_variables)]
-
-struct Index;
-
-impl Index {
- fn new() -> Self { Index }
-}
-
-fn user() {
- let new = Index::new;
-
- fn inner() {
- let index = Index::new();
- }
-
- let index2 = new();
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(stable_features)]
-
-#![feature(cfg_target_feature)]
-
-#[cfg(any(not(target_arch = "x86"), target_feature = "sse2"))]
-fn main() {
- if let Ok(x) = "3.1415".parse::<f64>() {
- assert_eq!(false, x <= 0.0);
- }
- if let Ok(x) = "3.1415".parse::<f64>() {
- assert_eq!(3.1415, x + 0.0);
- }
- if let Ok(mut x) = "3.1415".parse::<f64>() {
- assert_eq!(8.1415, { x += 5.0; x });
- }
-}
-
-#[cfg(all(target_arch = "x86", not(target_feature = "sse2")))]
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Regression test for #21726: an issue arose around the rules for
-// subtyping of projection types that resulted in an unconstrained
-// region, yielding region inference failures.
-
-// pretty-expanded FIXME #23616
-
-fn main() { }
-
-fn foo<'a>(s: &'a str) {
- let b: B<()> = B::new(s, ());
- b.get_short();
-}
-
-trait IntoRef<'a> {
- type T: Clone;
- fn into_ref(self, _: &'a str) -> Self::T;
-}
-
-impl<'a> IntoRef<'a> for () {
- type T = &'a str;
- fn into_ref(self, s: &'a str) -> &'a str {
- s
- }
-}
-
-struct B<'a, P: IntoRef<'a>>(P::T);
-
-impl<'a, P: IntoRef<'a>> B<'a, P> {
- fn new(s: &'a str, i: P) -> B<'a, P> {
- B(i.into_ref(s))
- }
-
- fn get_short(&self) -> P::T {
- self.0.clone()
- }
-}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_upper_case_globals)]
-
-// pretty-expanded FIXME #23616
-
-static foo: [usize; 3] = [1, 2, 3];
-
-static slice_1: &'static [usize] = &foo;
-static slice_2: &'static [usize] = &foo;
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-pub trait LineFormatter<'a> {
- type Iter: Iterator<Item=&'a str> + 'a;
- fn iter(&'a self, line: &'a str) -> Self::Iter;
-
- fn dimensions(&'a self, line: &'a str) {
- let iter: Self::Iter = self.iter(line);
- <_ as IntoIterator>::into_iter(iter);
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(type_alias_bounds)]
-
-// pretty-expanded FIXME #23616
-
-use std::marker::PhantomData;
-
-pub struct Handle<T, I>(T, I);
-
-impl<T, I> Handle<T, I> {
- pub fn get_info(&self) -> &I {
- let Handle(_, ref info) = *self;
- info
- }
-}
-
-pub struct BufferHandle<D: Device, T> {
- raw: RawBufferHandle<D>,
- _marker: PhantomData<T>,
-}
-
-impl<D: Device, T> BufferHandle<D, T> {
- pub fn get_info(&self) -> &String {
- self.raw.get_info()
- }
-}
-
-pub type RawBufferHandle<D: Device> = Handle<<D as Device>::Buffer, String>;
-
-pub trait Device {
- type Buffer;
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-trait A<T: A<T>> {}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(type_alias_bounds)]
-
-type Foo<T> where T: Copy = Box<T>;
-
-fn main(){}
+++ /dev/null
-// 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.
-
-// run-pass
-// This test is reduced from libsyntax. It is just checking that we
-// can successfully deal with a "deep" structure, which the drop-check
-// was hitting a recursion limit on at one point.
-
-// pretty-expanded FIXME #23616
-
-#![allow(non_camel_case_types)]
-
-pub fn noop_fold_impl_item() -> SmallVector<ImplItem> {
- loop { }
-}
-
-pub struct SmallVector<T>(P<T>);
-pub struct ImplItem(P<S01_Method>);
-
-struct P<T>(Box<T>);
-
-struct S01_Method(P<S02_Generics>);
-struct S02_Generics(P<S03_TyParam>);
-struct S03_TyParam(P<S04_TyParamBound>);
-struct S04_TyParamBound(S05_PolyTraitRef);
-struct S05_PolyTraitRef(S06_TraitRef);
-struct S06_TraitRef(S07_Path);
-struct S07_Path(Vec<S08_PathSegment>);
-struct S08_PathSegment(S09_GenericArgs);
-struct S09_GenericArgs(P<S10_ParenthesizedParameterData>);
-struct S10_ParenthesizedParameterData(Option<P<S11_Ty>>);
-struct S11_Ty(P<S12_Expr>);
-struct S12_Expr(P<S13_Block>);
-struct S13_Block(Vec<P<S14_Stmt>>);
-struct S14_Stmt(P<S15_Decl>);
-struct S15_Decl(P<S16_Local>);
-struct S16_Local(P<S17_Pat>);
-struct S17_Pat(P<S18_Mac>);
-struct S18_Mac(Vec<P<S19_TokenTree>>);
-struct S19_TokenTree(P<S20_Token>);
-struct S20_Token(P<S21_Nonterminal>);
-struct S21_Nonterminal(P<S22_Item>);
-struct S22_Item(P<S23_EnumDef>);
-struct S23_EnumDef(Vec<P<S24_Variant>>);
-struct S24_Variant(P<S25_VariantKind>);
-struct S25_VariantKind(P<S26_StructDef>);
-struct S26_StructDef(Vec<P<S27_StructField>>);
-struct S27_StructField(P<S28_StructFieldKind>);
-struct S28_StructFieldKind;
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(unused_variables)]
-use std::collections::HashMap;
-use std::collections::hash_map::Entry::Vacant;
-
-pub fn foo() {
- type F = Box<Fn(&()) + 'static>;
- let mut map: HashMap<(), F> = HashMap::new();
- let x: &mut F = match map.entry(()) {
- Vacant(_) => unimplemented!(),
- _ => unimplemented!()
- };
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-trait Test {}
-
-macro_rules! test {
-( $($name:ident)+) => (
- impl<$($name: Test),*> Test for ($($name,)*) {
- }
-)
-}
-
-test!(A B C);
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#[allow(dead_code)]
-static X: &'static str = &*"";
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_camel_case_types)]
-
-
-trait clam<A> {
- fn get(self) -> A;
-}
-
-struct foo<A> {
- x: A,
-}
-
-impl<A> foo<A> {
- pub fn bar<B,C:clam<A>>(&self, _c: C) -> B {
- panic!();
- }
-}
-
-fn foo<A>(b: A) -> foo<A> {
- foo {
- x: b
- }
-}
-
-pub fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(non_camel_case_types)]
-
-// pretty-expanded FIXME #23616
-
-trait clam<A> { fn get(self) -> A; }
-trait foo<A> {
- fn bar<B,C:clam<A>>(&self, c: C) -> B;
-}
-
-pub fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_camel_case_types)]
-
-// Testing that the B's are resolved
-
-
-trait clam<A> { fn get(self) -> A; }
-
-struct foo(isize);
-
-impl foo {
- pub fn bar<B,C:clam<B>>(&self, _c: C) -> B { panic!(); }
-}
-
-pub fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-trait Inner {
- type T;
-}
-
-impl<'a> Inner for &'a i32 {
- type T = i32;
-}
-
-fn f<'a>(x: &'a i32) -> <&'a i32 as Inner>::T {
- *x
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-use std::marker::PhantomData;
-
-pub struct UnionedKeys<'a,K>
- where K: UnifyKey + 'a
-{
- table: &'a mut UnificationTable<K>,
- root_key: K,
- stack: Vec<K>,
-}
-
-pub trait UnifyKey {
- type Value;
-}
-
-pub struct UnificationTable<K:UnifyKey> {
- values: Delegate<K>,
-}
-
-pub struct Delegate<K>(PhantomData<K>);
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// compiler-flags: -g
-
-pub struct Dst {
- pub a: (),
- pub b: (),
- pub data: [u8],
-}
-
-pub unsafe fn borrow(bytes: &[u8]) -> &Dst {
- let dst: &Dst = std::mem::transmute((bytes.as_ptr(), bytes.len()));
- dst
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![feature(core_intrinsics)]
-#![allow(warnings)]
-
-use std::intrinsics;
-
-#[derive(Copy, Clone)]
-struct Wrap(i64);
-
-// These volatile intrinsics used to cause an ICE
-
-unsafe fn test_bool(p: &mut bool, v: bool) {
- intrinsics::volatile_load(p);
- intrinsics::volatile_store(p, v);
-}
-
-unsafe fn test_immediate_fca(p: &mut Wrap, v: Wrap) {
- intrinsics::volatile_load(p);
- intrinsics::volatile_store(p, v);
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#[derive(PartialEq)]
-struct Slice { slice: [u8] }
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Regression test for #24085. Errors were occurring in region
-// inference due to the requirement that `'a:b'`, which was getting
-// incorrectly codegened in connection with the closure below.
-
-#[derive(Copy,Clone)]
-struct Path<'a:'b, 'b> {
- x: &'a i32,
- tail: Option<&'b Path<'a, 'b>>
-}
-
-#[allow(dead_code, unconditional_recursion)]
-fn foo<'a,'b,F>(p: Path<'a, 'b>, mut f: F)
- where F: for<'c> FnMut(Path<'a, 'c>) {
- foo(p, |x| f(x))
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#[derive(Copy,Clone)]
-struct Functions {
- a: fn(u32) -> u32,
- b: extern "C" fn(u32) -> u32,
- c: unsafe fn(u32) -> u32,
- d: unsafe extern "C" fn(u32) -> u32
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// This resulted in an ICE. Test for future-proofing
-// Issue #24227
-
-#![allow(unused)]
-
-struct Foo<'a> {
- x: &'a u8
-}
-
-impl<'a> Foo<'a> {
- fn foo() {
- let mut tmp: Self;
- }
-
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-
-struct Foo;
-
-impl Foo {
- fn new() -> Self { Foo }
- fn bar() { Self::new(); }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(unused_attributes)]
-// compile-flags:--cfg set1
-
-#![cfg_attr(set1, feature(custom_attribute))]
-
-#![foobar]
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_camel_case_types)]
-
-// pretty-expanded FIXME #23616
-
-struct socket {
- sock: isize,
-
-}
-
-impl Drop for socket {
- fn drop(&mut self) {}
-}
-
-impl socket {
- pub fn set_identity(&self) {
- closure(|| setsockopt_bytes(self.sock.clone()))
- }
-}
-
-fn socket() -> socket {
- socket {
- sock: 1
- }
-}
-
-fn closure<F>(f: F) where F: FnOnce() { f() }
-
-fn setsockopt_bytes(_sock: isize) { }
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_camel_case_types)]
-
-
-// pretty-expanded FIXME #23616
-
-struct font<'a> {
- fontbuf: &'a Vec<u8> ,
-}
-
-impl<'a> font<'a> {
- pub fn buf(&self) -> &'a Vec<u8> {
- self.fontbuf
- }
-}
-
-fn font(fontbuf: &Vec<u8> ) -> font {
- font {
- fontbuf: fontbuf
- }
-}
-
-pub fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_upper_case_globals)]
-
-const x: &'static Fn() = &|| println!("ICE here");
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#[derive(Debug)]
-struct Row<T>([T]);
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_upper_case_globals)]
-
-
-trait HasNumber<T> {
- const Number: usize;
-}
-
-enum One {}
-enum Two {}
-
-enum Foo {}
-
-impl<T> HasNumber<T> for One {
- const Number: usize = 1;
-}
-
-impl<T> HasNumber<T> for Two {
- const Number: usize = 2;
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Tests that impls are allowed to have looser, more permissive bounds
-// than the traits require.
-
-
-trait A {
- fn b<C:Sync,D>(&self, x: C) -> C;
-}
-
-struct E {
- f: isize
-}
-
-impl A for E {
- fn b<F,G>(&self, _x: F) -> F { panic!() }
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-use std::ops::{Deref, DerefMut};
-
-struct Foo;
-
-impl Foo {
- fn foo_mut(&mut self) {}
-}
-
-struct Bar(Foo);
-
-impl Deref for Bar {
- type Target = Foo;
-
- fn deref(&self) -> &Foo {
- &self.0
- }
-}
-
-impl DerefMut for Bar {
- fn deref_mut(&mut self) -> &mut Foo {
- &mut self.0
- }
-}
-
-fn test(mut bar: Box<Bar>) {
- bar.foo_mut();
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![deny(unused_attributes)]
-
-#[repr(C)]
-#[repr(packed)]
-pub struct Foo;
-
-#[repr(packed)]
-#[repr(C)]
-pub struct Bar;
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-pub struct Foo {
- x: isize,
- y: isize
-}
-
-impl Foo {
- pub extern fn foo_new() -> Foo {
- Foo { x: 21, y: 33 }
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-use std::cell::RefCell;
-use std::rc::Rc;
-
-pub struct Callbacks {
- callbacks: Vec<Rc<RefCell<FnMut(i32)>>>,
-}
-
-impl Callbacks {
- pub fn register<F: FnMut(i32)+'static>(&mut self, callback: F) {
- self.callbacks.push(Rc::new(RefCell::new(callback)));
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-pub trait Trait<'a> {
- type T;
- type U;
- fn foo(&self, s: &'a ()) -> &'a ();
-}
-
-impl<'a> Trait<'a> for () {
- type T = &'a ();
- type U = Self::T;
-
- fn foo(&self, s: &'a ()) -> &'a () {
- let t: Self::T = s; t
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_snake_case)]
-
-// pretty-expanded FIXME #23616
-
-struct CMap<'a> {
- buf: &'a [u8],
-}
-
-fn CMap(buf: &[u8]) -> CMap {
- CMap {
- buf: buf
- }
-}
-
-pub fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-// Regression test for issue #27583. Unclear how useful this will be
-// going forward, since the issue in question was EXTREMELY sensitive
-// to compiler internals (like the precise numbering of nodes), but
-// what the hey.
-
-#![allow(warnings)]
-
-use std::cell::Cell;
-use std::marker::PhantomData;
-
-pub trait Delegate<'tcx> { }
-
-pub struct InferCtxt<'a, 'tcx: 'a> {
- x: PhantomData<&'a Cell<&'tcx ()>>
-}
-
-pub struct MemCategorizationContext<'t, 'a: 't, 'tcx : 'a> {
- x: &'t InferCtxt<'a, 'tcx>,
-}
-
-pub struct ExprUseVisitor<'d, 't, 'a: 't, 'tcx:'a+'d> {
- typer: &'t InferCtxt<'a, 'tcx>,
- mc: MemCategorizationContext<'t, 'a, 'tcx>,
- delegate: &'d mut (Delegate<'tcx>+'d),
-}
-
-impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
- pub fn new(delegate: &'d mut Delegate<'tcx>,
- typer: &'t InferCtxt<'a, 'tcx>)
- -> ExprUseVisitor<'d,'t,'a,'tcx>
- {
- ExprUseVisitor {
- typer: typer,
- mc: MemCategorizationContext::new(typer),
- delegate: delegate,
- }
- }
-}
-
-impl<'t, 'a,'tcx> MemCategorizationContext<'t, 'a, 'tcx> {
- pub fn new(typer: &'t InferCtxt<'a, 'tcx>) -> MemCategorizationContext<'t, 'a, 'tcx> {
- MemCategorizationContext { x: typer }
- }
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(unused_assignments)]
-#![allow(unused_variables)]
-// Test that a field can have the same name in different variants
-// of an enum
-
-pub enum Foo {
- X { foo: u32 },
- Y { foo: u32 }
-}
-
-pub fn foo(mut x: Foo) {
- let mut y = None;
- let mut z = None;
- if let Foo::X { ref foo } = x {
- z = Some(foo);
- }
- if let Foo::Y { ref mut foo } = x {
- y = Some(foo);
- }
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2012-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.
-
-// run-pass
-#![allow(dead_code)]
-// Minimized version of issue-2804.rs. Both check that callee IDs don't
-// clobber the previous node ID in a macro expr
-
-use std::collections::HashMap;
-
-fn add_interfaces(managed_ip: String, device: HashMap<String, isize>) {
- println!("{}, {}", managed_ip, device["interfaces"]);
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-use std::rc::Rc;
-
-fn test1() -> Rc<for<'a> Fn(&'a usize) + 'static> {
- if let Some(_) = Some(1) {
- loop{}
- } else {
- loop{}
- }
-}
-
-fn test2() -> *mut (for<'a> Fn(&'a usize) + 'static) {
- if let Some(_) = Some(1) {
- loop{}
- } else {
- loop{}
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
-struct Array<T> {
- f00: [T; 00],
- f01: [T; 01],
- f02: [T; 02],
- f03: [T; 03],
- f04: [T; 04],
- f05: [T; 05],
- f06: [T; 06],
- f07: [T; 07],
- f08: [T; 08],
- f09: [T; 09],
- f10: [T; 10],
- f11: [T; 11],
- f12: [T; 12],
- f13: [T; 13],
- f14: [T; 14],
- f15: [T; 15],
- f16: [T; 16],
- f17: [T; 17],
- f18: [T; 18],
- f19: [T; 19],
- f20: [T; 20],
- f21: [T; 21],
- f22: [T; 22],
- f23: [T; 23],
- f24: [T; 24],
- f25: [T; 25],
- f26: [T; 26],
- f27: [T; 27],
- f28: [T; 28],
- f29: [T; 29],
- f30: [T; 30],
- f31: [T; 31],
- f32: [T; 32],
-}
-
-// FIXME(#44580): merge with `Array` once `[T; N]: Clone` where `T: Clone`
-#[derive(Clone, Copy)]
-struct CopyArray<T: Copy> {
- f00: [T; 00],
- f01: [T; 01],
- f02: [T; 02],
- f03: [T; 03],
- f04: [T; 04],
- f05: [T; 05],
- f06: [T; 06],
- f07: [T; 07],
- f08: [T; 08],
- f09: [T; 09],
- f10: [T; 10],
- f11: [T; 11],
- f12: [T; 12],
- f13: [T; 13],
- f14: [T; 14],
- f15: [T; 15],
- f16: [T; 16],
- f17: [T; 17],
- f18: [T; 18],
- f19: [T; 19],
- f20: [T; 20],
- f21: [T; 21],
- f22: [T; 22],
- f23: [T; 23],
- f24: [T; 24],
- f25: [T; 25],
- f26: [T; 26],
- f27: [T; 27],
- f28: [T; 28],
- f29: [T; 29],
- f30: [T; 30],
- f31: [T; 31],
- f32: [T; 32],
-}
-
-#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
-struct Fn<A, B, C, D, E, F, G, H, I, J, K, L> {
- f00: fn(),
- f01: fn(A),
- f02: fn(A, B),
- f03: fn(A, B, C),
- f04: fn(A, B, C, D),
- f05: fn(A, B, C, D, E),
- f06: fn(A, B, C, D, E, F),
- f07: fn(A, B, C, D, E, F, G),
- f08: fn(A, B, C, D, E, F, G, H),
- f09: fn(A, B, C, D, E, F, G, H, I),
- f10: fn(A, B, C, D, E, F, G, H, I, J),
- f11: fn(A, B, C, D, E, F, G, H, I, J, K),
- f12: fn(A, B, C, D, E, F, G, H, I, J, K, L),
-}
-
-#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
-struct Tuple<A, B, C, D, E, F, G, H, I, J, K, L> {
- f00: (),
- f01: (A),
- f02: (A, B),
- f03: (A, B, C),
- f04: (A, B, C, D),
- f05: (A, B, C, D, E),
- f06: (A, B, C, D, E, F),
- f07: (A, B, C, D, E, F, G),
- f08: (A, B, C, D, E, F, G, H),
- f09: (A, B, C, D, E, F, G, H, I),
- f10: (A, B, C, D, E, F, G, H, I, J),
- f11: (A, B, C, D, E, F, G, H, I, J, K),
- f12: (A, B, C, D, E, F, G, H, I, J, K, L),
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// #28600 ICE: pub extern fn with parameter type &str inside struct impl
-
-struct Test;
-
-impl Test {
- #[allow(dead_code)]
- #[allow(unused_variables)]
- pub extern fn test(val: &str) {
-
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![feature(min_const_fn)]
-
-fn main() {}
-
-const fn size_ofs(_: usize) {}
-const fn size_ofs2(_foo: usize) {}
+++ /dev/null
-// 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.
-
-// run-pass
-// Regression test for #28871. The problem is that rustc encountered
-// two ways to project, one from a where clause and one from the where
-// clauses on the trait definition. (In fact, in this case, the where
-// clauses originated from the trait definition as well.) The true
-// cause of the error is that the trait definition where clauses are
-// not being normalized, and hence the two sources are considered in
-// conflict, and not a duplicate. Hacky solution is to prefer where
-// clauses over the data found in the trait definition.
-
-trait T {
- type T;
-}
-
-struct S;
-impl T for S {
- type T = S;
-}
-
-trait T2 {
- type T: Iterator<Item=<S as T>::T>;
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-pub type Session = i32;
-pub struct StreamParser<'a, T> {
- _tokens: T,
- _session: &'a mut Session,
-}
-
-impl<'a, T> StreamParser<'a, T> {
- pub fn thing(&mut self) -> bool { true }
-}
-
-pub fn parse_stream<T: Iterator<Item=i32>, U, F>(
- _session: &mut Session, _tokens: T, _f: F) -> U
- where F: Fn(&mut StreamParser<T>) -> U { panic!(); }
-
-pub fn thing(session: &mut Session) {
- let mut stream = vec![1, 2, 3].into_iter();
-
- let _b = parse_stream(session,
- stream.by_ref(),
- // replacing the above with the following fixes it
- //&mut stream,
- |p| p.thing());
-
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-pub struct Xyz<'a, V> {
- pub v: (V, &'a u32),
-}
-
-pub fn eq<'a, 's, 't, V>(this: &'s Xyz<'a, V>, other: &'t Xyz<'a, V>) -> bool
- where V: PartialEq {
- this.v == other.v
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#[derive(Debug)]
-struct Message<'a, P: 'a = &'a [u8]> {
- header: &'a [u8],
- payload: P,
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// This test ensures that each pointer type `P<X>` is covariant in `X`.
-
-use std::rc::Rc;
-use std::sync::Arc;
-
-fn a<'r>(x: Box<&'static str>) -> Box<&'r str> {
- x
-}
-
-fn b<'r, 'w>(x: &'w &'static str) -> &'w &'r str {
- x
-}
-
-fn c<'r>(x: Arc<&'static str>) -> Arc<&'r str> {
- x
-}
-
-fn d<'r>(x: Rc<&'static str>) -> Rc<&'r str> {
- x
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2012-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.
-
-// run-pass
-#![allow(unused_must_use)]
-#![allow(dead_code)]
-#![allow(unused_mut)]
-#![allow(non_camel_case_types)]
-
-// Map representation
-
-use std::fmt;
-use std::io::prelude::*;
-use square::{bot, wall, rock, lambda, closed_lift, open_lift, earth, empty};
-
-enum square {
- bot,
- wall,
- rock,
- lambda,
- closed_lift,
- open_lift,
- earth,
- empty
-}
-
-impl fmt::Debug for square {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "{}", match *self {
- bot => { "R".to_string() }
- wall => { "#".to_string() }
- rock => { "*".to_string() }
- lambda => { "\\".to_string() }
- closed_lift => { "L".to_string() }
- open_lift => { "O".to_string() }
- earth => { ".".to_string() }
- empty => { " ".to_string() }
- })
- }
-}
-
-fn square_from_char(c: char) -> square {
- match c {
- 'R' => { bot }
- '#' => { wall }
- '*' => { rock }
- '\\' => { lambda }
- 'L' => { closed_lift }
- 'O' => { open_lift }
- '.' => { earth }
- ' ' => { empty }
- _ => {
- println!("invalid square: {}", c);
- panic!()
- }
- }
-}
-
-fn read_board_grid<rdr:'static + Read>(mut input: rdr)
- -> Vec<Vec<square>> {
- let mut input: &mut Read = &mut input;
- let mut grid = Vec::new();
- let mut line = [0; 10];
- input.read(&mut line);
- let mut row = Vec::new();
- for c in &line {
- row.push(square_from_char(*c as char))
- }
- grid.push(row);
- let width = grid[0].len();
- for row in &grid { assert_eq!(row.len(), width) }
- grid
-}
-
-mod test {
- #[test]
- pub fn trivial_to_string() {
- assert_eq!(lambda.to_string(), "\\")
- }
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-pub struct Chan;
-pub struct ChanSelect<'c, T> {
- chans: Vec<(&'c Chan, T)>,
-}
-impl<'c, T> ChanSelect<'c, T> {
- pub fn add_recv_ret(&mut self, chan: &'c Chan, ret: T)
- {
- self.chans.push((chan, ret));
- }
-}
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_upper_case_globals)]
-
-fn ret() -> u32 {
- static x: u32 = 10;
- x & if true { 10u32 } else { 20u32 } & x
-}
-
-fn ret2() -> &'static u32 {
- static x: u32 = 10;
- if true { 10u32; } else { 20u32; }
- &x
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-struct S([u8; { struct Z; 0 }]);
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![feature(optin_builtin_traits)]
-
-auto trait NotSame {}
-
-impl<A> !NotSame for (A, A) {}
-
-trait OneOfEach {}
-
-impl<A> OneOfEach for (A,) {}
-
-impl<A, B> OneOfEach for (A, B)
-where
- (B,): OneOfEach,
- (A, B): NotSame,
-{
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#[derive(Debug)]
-pub struct Config {
- pub name: String,
- pub cluster: String,
- pub debug_none: String,
- pub debug_lockdep: String,
- pub debug_context: String,
- pub debug_crush: String,
- pub debug_mds: String,
- pub debug_mds_balancer: String,
- pub debug_mds_locker: String,
- pub debug_mds_log: String,
- pub debug_mds_log_expire: String,
- pub debug_mds_migrator: String,
- pub debug_buffer: String,
- pub debug_timer: String,
- pub debug_filer: String,
- pub debug_striper: String,
- pub debug_objecter: String,
- pub debug_rados: String,
- pub debug_rbd: String,
- pub debug_journaler: String,
- pub debug_objectcacher: String,
- pub debug_client: String,
- pub debug_osd: String,
- pub debug_optracker: String,
- pub debug_objclass: String,
- pub debug_filestore: String,
- pub debug_keyvaluestore: String,
- pub debug_journal: String,
- pub debug_ms: String,
- pub debug_mon: String,
- pub debug_monc: String,
- pub debug_paxos: String,
- pub debug_tp: String,
- pub debug_auth: String,
- pub debug_crypto: String,
- pub debug_finisher: String,
- pub debug_heartbeatmap: String,
- pub debug_perfcounter: String,
- pub debug_rgw: String,
- pub debug_civetweb: String,
- pub debug_javaclient: String,
- pub debug_asok: String,
- pub debug_throttle: String,
- pub host: String,
- pub fsid: String,
- pub public_addr: String,
- pub cluster_addr: String,
- pub public_network: String,
- pub cluster_network: String,
- pub num_client: String,
- pub monmap: String,
- pub mon_host: String,
- pub lockdep: String,
- pub run_dir: String,
- pub admin_socket: String,
- pub daemonize: String,
- pub pid_file: String,
- pub chdir: String,
- pub max_open_files: String,
- pub restapi_log_level: String,
- pub restapi_base_url: String,
- pub fatal_signal_handlers: String,
- pub log_file: String,
- pub log_max_new: String,
- pub log_max_recent: String,
- pub log_to_stderr: String,
- pub err_to_stderr: String,
- pub log_to_syslog: String,
- pub err_to_syslog: String,
- pub log_flush_on_exit: String,
- pub log_stop_at_utilization: String,
- pub clog_to_monitors: String,
- pub clog_to_syslog: String,
- pub clog_to_syslog_level: String,
- pub clog_to_syslog_facility: String,
- pub mon_cluster_log_to_syslog: String,
- pub mon_cluster_log_to_syslog_level: String,
- pub mon_cluster_log_to_syslog_facility: String,
- pub mon_cluster_log_file: String,
- pub mon_cluster_log_file_level: String,
- pub key: String,
- pub keyfile: String,
- pub keyring: String,
- pub heartbeat_interval: String,
- pub heartbeat_file: String,
- pub heartbeat_inject_failure: String,
- pub perf: String,
- pub ms_tcp_nodelay: String,
- pub ms_tcp_rcvbuf: String,
- pub ms_initial_backoff: String,
- pub ms_max_backoff: String,
- pub ms_nocrc: String,
- pub ms_die_on_bad_msg: String,
- pub ms_die_on_unhandled_msg: String,
- pub ms_die_on_old_message: String,
- pub ms_dispatch_throttle_bytes: String,
- pub ms_bind_ipv6: String,
- pub ms_bind_port_min: String,
- pub ms_bind_port_max: String,
- pub ms_rwthread_stack_bytes: String,
- pub ms_tcp_read_timeout: String,
- pub ms_pq_max_tokens_per_priority: String,
- pub ms_pq_min_cost: String,
- pub ms_inject_socket_failures: String,
- pub ms_inject_delay_type: String,
- pub ms_inject_delay_msg_type: String,
- pub ms_inject_delay_max: String,
- pub ms_inject_delay_probability: String,
- pub ms_inject_internal_delays: String,
- pub ms_dump_on_send: String,
- pub inject_early_sigterm: String,
- pub mon_data: String,
- pub mon_initial_members: String,
- pub mon_sync_fs_threshold: String,
- pub mon_compact_on_start: String,
- pub mon_compact_on_bootstrap: String,
- pub mon_compact_on_trim: String,
- pub mon_tick_interval: String,
- pub mon_subscribe_interval: String,
- pub mon_delta_reset_interval: String,
- pub mon_osd_laggy_halflife: String,
- pub mon_osd_laggy_weight: String,
- pub mon_osd_adjust_heartbeat_grace: String,
- pub mon_osd_adjust_down_out_interval: String,
- pub mon_osd_auto_mark_in: String,
- pub mon_osd_auto_mark_auto_out_in: String,
- pub mon_osd_auto_mark_new_in: String,
- pub mon_osd_down_out_interval: String,
- pub mon_osd_down_out_subtree_limit: String,
- pub mon_osd_min_up_ratio: String,
- pub mon_osd_min_in_ratio: String,
- pub mon_osd_max_op_age: String,
- pub mon_osd_max_split_count: String,
- pub mon_osd_allow_primary_temp: String,
- pub mon_osd_allow_primary_affinity: String,
- pub mon_stat_smooth_intervals: String,
- pub mon_lease: String,
- pub mon_lease_renew_interval: String,
- pub mon_lease_ack_timeout: String,
- pub mon_clock_drift_allowed: String,
- pub mon_clock_drift_warn_backoff: String,
- pub mon_timecheck_interval: String,
- pub mon_accept_timeout: String,
- pub mon_pg_create_interval: String,
- pub mon_pg_stuck_threshold: String,
- pub mon_pg_warn_min_per_osd: String,
- pub mon_pg_warn_max_object_skew: String,
- pub mon_pg_warn_min_objects: String,
- pub mon_pg_warn_min_pool_objects: String,
- pub mon_cache_target_full_warn_ratio: String,
- pub mon_osd_full_ratio: String,
- pub mon_osd_nearfull_ratio: String,
- pub mon_globalid_prealloc: String,
- pub mon_osd_report_timeout: String,
- pub mon_force_standby_active: String,
- pub mon_warn_on_old_mons: String,
- pub mon_warn_on_legacy_crush_tunables: String,
- pub mon_warn_on_osd_down_out_interval_zero: String,
- pub mon_warn_on_cache_pools_without_hit_sets: String,
- pub mon_min_osdmap_epochs: String,
- pub mon_max_pgmap_epochs: String,
- pub mon_max_log_epochs: String,
- pub mon_max_mdsmap_epochs: String,
- pub mon_max_osd: String,
- pub mon_probe_timeout: String,
- pub mon_slurp_timeout: String,
- pub mon_slurp_bytes: String,
- pub mon_client_bytes: String,
- pub mon_daemon_bytes: String,
- pub mon_max_log_entries_per_event: String,
- pub mon_health_data_update_interval: String,
- pub mon_data_avail_crit: String,
- pub mon_data_avail_warn: String,
- pub mon_config_key_max_entry_size: String,
- pub mon_sync_timeout: String,
- pub mon_sync_max_payload_size: String,
- pub mon_sync_debug: String,
- pub mon_sync_debug_leader: String,
- pub mon_sync_debug_provider: String,
- pub mon_sync_debug_provider_fallback: String,
- pub mon_inject_sync_get_chunk_delay: String,
- pub mon_osd_min_down_reporters: String,
- pub mon_osd_min_down_reports: String,
- pub mon_osd_force_trim_to: String,
- pub mon_mds_force_trim_to: String,
- pub mon_advanced_debug_mode: String,
- pub mon_debug_dump_transactions: String,
- pub mon_debug_dump_location: String,
- pub mon_sync_provider_kill_at: String,
- pub mon_sync_requester_kill_at: String,
- pub mon_leveldb_write_buffer_size: String,
- pub mon_leveldb_cache_size: String,
- pub mon_leveldb_block_size: String,
- pub mon_leveldb_bloom_size: String,
- pub mon_leveldb_max_open_files: String,
- pub mon_leveldb_compression: String,
- pub mon_leveldb_paranoid: String,
- pub mon_leveldb_log: String,
- pub mon_leveldb_size_warn: String,
- pub mon_force_quorum_join: String,
- pub paxos_stash_full_interval: String,
- pub paxos_max_join_drift: String,
- pub paxos_propose_interval: String,
- pub paxos_min_wait: String,
- pub paxos_min: String,
- pub paxos_trim_min: String,
- pub paxos_trim_max: String,
- pub paxos_service_trim_min: String,
- pub paxos_service_trim_max: String,
- pub paxos_kill_at: String,
- pub clock_offset: String,
- pub auth_cluster_required: String,
- pub auth_service_required: String,
- pub auth_client_required: String,
- pub auth_supported: String,
- pub cephx_require_signatures: String,
- pub cephx_cluster_require_signatures: String,
- pub cephx_service_require_signatures: String,
- pub cephx_sign_messages: String,
- pub auth_mon_ticket_ttl: String,
- pub auth_service_ticket_ttl: String,
- pub auth_debug: String,
- pub mon_client_hunt_interval: String,
- pub mon_client_ping_interval: String,
- pub mon_client_ping_timeout: String,
- pub mon_client_hunt_interval_backoff: String,
- pub mon_client_hunt_interval_max_multiple: String,
- pub mon_client_max_log_entries_per_message: String,
- pub mon_max_pool_pg_num: String,
- pub mon_pool_quota_warn_threshold: String,
- pub mon_pool_quota_crit_threshold: String,
- pub client_cache_size: String,
- pub client_cache_mid: String,
- pub client_use_random_mds: String,
- pub client_mount_timeout: String,
- pub client_tick_interval: String,
- pub client_trace: String,
- pub client_readahead_min: String,
- pub client_readahead_max_bytes: String,
- pub client_readahead_max_periods: String,
- pub client_snapdir: String,
- pub client_mountpoint: String,
- pub client_notify_timeout: String,
- pub osd_client_watch_timeout: String,
- pub client_caps_release_delay: String,
- pub client_oc: String,
- pub client_oc_size: String,
- pub client_oc_max_dirty: String,
- pub client_oc_target_dirty: String,
- pub client_oc_max_dirty_age: String,
- pub client_oc_max_objects: String,
- pub client_debug_force_sync_read: String,
- pub client_debug_inject_tick_delay: String,
- pub client_max_inline_size: String,
- pub fuse_use_invalidate_cb: String,
- pub fuse_allow_other: String,
- pub fuse_default_permissions: String,
- pub fuse_big_writes: String,
- pub fuse_atomic_o_trunc: String,
- pub fuse_debug: String,
- pub fuse_multithreaded: String,
- pub crush_location: String,
- pub objecter_tick_interval: String,
- pub objecter_timeout: String,
- pub objecter_inflight_op_bytes: String,
- pub objecter_inflight_ops: String,
- pub journaler_allow_split_entries: String,
- pub journaler_write_head_interval: String,
- pub journaler_prefetch_periods: String,
- pub journaler_prezero_periods: String,
- pub journaler_batch_interval: String,
- pub journaler_batch_max: String,
- pub mds_data: String,
- pub mds_max_file_size: String,
- pub mds_cache_size: String,
- pub mds_cache_mid: String,
- pub mds_mem_max: String,
- pub mds_dir_max_commit_size: String,
- pub mds_decay_halflife: String,
- pub mds_beacon_interval: String,
- pub mds_beacon_grace: String,
- pub mds_enforce_unique_name: String,
- pub mds_blacklist_interval: String,
- pub mds_session_timeout: String,
- pub mds_freeze_tree_timeout: String,
- pub mds_session_autoclose: String,
- pub mds_reconnect_timeout: String,
- pub mds_tick_interval: String,
- pub mds_dirstat_min_interval: String,
- pub mds_scatter_nudge_interval: String,
- pub mds_client_prealloc_inos: String,
- pub mds_early_reply: String,
- pub mds_default_dir_hash: String,
- pub mds_log: String,
- pub mds_log_skip_corrupt_events: String,
- pub mds_log_max_events: String,
- pub mds_log_segment_size: String,
- pub mds_log_max_segments: String,
- pub mds_log_max_expiring: String,
- pub mds_bal_sample_interval: String,
- pub mds_bal_replicate_threshold: String,
- pub mds_bal_unreplicate_threshold: String,
- pub mds_bal_frag: String,
- pub mds_bal_split_size: String,
- pub mds_bal_split_rd: String,
- pub mds_bal_split_wr: String,
- pub mds_bal_split_bits: String,
- pub mds_bal_merge_size: String,
- pub mds_bal_merge_rd: String,
- pub mds_bal_merge_wr: String,
- pub mds_bal_interval: String,
- pub mds_bal_fragment_interval: String,
- pub mds_bal_idle_threshold: String,
- pub mds_bal_max: String,
- pub mds_bal_max_until: String,
- pub mds_bal_mode: String,
- pub mds_bal_min_rebalance: String,
- pub mds_bal_min_start: String,
- pub mds_bal_need_min: String,
- pub mds_bal_need_max: String,
- pub mds_bal_midchunk: String,
- pub mds_bal_minchunk: String,
- pub mds_bal_target_removal_min: String,
- pub mds_bal_target_removal_max: String,
- pub mds_replay_interval: String,
- pub mds_shutdown_check: String,
- pub mds_thrash_exports: String,
- pub mds_thrash_fragments: String,
- pub mds_dump_cache_on_map: String,
- pub mds_dump_cache_after_rejoin: String,
- pub mds_verify_scatter: String,
- pub mds_debug_scatterstat: String,
- pub mds_debug_frag: String,
- pub mds_debug_auth_pins: String,
- pub mds_debug_subtrees: String,
- pub mds_kill_mdstable_at: String,
- pub mds_kill_export_at: String,
- pub mds_kill_import_at: String,
- pub mds_kill_link_at: String,
- pub mds_kill_rename_at: String,
- pub mds_kill_openc_at: String,
- pub mds_kill_journal_at: String,
- pub mds_kill_journal_expire_at: String,
- pub mds_kill_journal_replay_at: String,
- pub mds_kill_create_at: String,
- pub mds_open_remote_link_mode: String,
- pub mds_inject_traceless_reply_probability: String,
- pub mds_wipe_sessions: String,
- pub mds_wipe_ino_prealloc: String,
- pub mds_skip_ino: String,
- pub max_mds: String,
- pub mds_standby_for_name: String,
- pub mds_standby_for_rank: String,
- pub mds_standby_replay: String,
- pub osd_compact_leveldb_on_mount: String,
- pub osd_max_backfills: String,
- pub osd_backfill_full_ratio: String,
- pub osd_backfill_retry_interval: String,
- pub osd_agent_max_ops: String,
- pub osd_agent_min_evict_effort: String,
- pub osd_agent_quantize_effort: String,
- pub osd_agent_delay_time: String,
- pub osd_agent_hist_halflife: String,
- pub osd_agent_slop: String,
- pub osd_uuid: String,
- pub osd_data: String,
- pub osd_journal: String,
- pub osd_journal_size: String,
- pub osd_max_write_size: String,
- pub osd_max_pgls: String,
- pub osd_client_message_size_cap: String,
- pub osd_client_message_cap: String,
- pub osd_pg_bits: String,
- pub osd_pgp_bits: String,
- pub osd_crush_chooseleaf_type: String,
- pub osd_pool_default_crush_rule: String,
- pub osd_pool_default_crush_replicated_ruleset: String,
- pub osd_pool_erasure_code_stripe_width: String,
- pub osd_pool_default_size: String,
- pub osd_pool_default_min_size: String,
- pub osd_pool_default_pg_num: String,
- pub osd_pool_default_pgp_num: String,
- pub osd_pool_default_erasure_code_directory: String,
- pub osd_pool_default_erasure_code_profile: String,
- pub osd_erasure_code_plugins: String,
- pub osd_pool_default_flags: String,
- pub osd_pool_default_flag_hashpspool: String,
- pub osd_pool_default_hit_set_bloom_fpp: String,
- pub osd_pool_default_cache_target_dirty_ratio: String,
- pub osd_pool_default_cache_target_full_ratio: String,
- pub osd_pool_default_cache_min_flush_age: String,
- pub osd_pool_default_cache_min_evict_age: String,
- pub osd_hit_set_min_size: String,
- pub osd_hit_set_max_size: String,
- pub osd_hit_set_namespace: String,
- pub osd_tier_default_cache_mode: String,
- pub osd_tier_default_cache_hit_set_count: String,
- pub osd_tier_default_cache_hit_set_period: String,
- pub osd_tier_default_cache_hit_set_type: String,
- pub osd_map_dedup: String,
- pub osd_map_max_advance: String,
- pub osd_map_cache_size: String,
- pub osd_map_message_max: String,
- pub osd_map_share_max_epochs: String,
- pub osd_op_threads: String,
- pub osd_peering_wq_batch_size: String,
- pub osd_op_pq_max_tokens_per_priority: String,
- pub osd_op_pq_min_cost: String,
- pub osd_disk_threads: String,
- pub osd_disk_thread_ioprio_class: String,
- pub osd_disk_thread_ioprio_priority: String,
- pub osd_recovery_threads: String,
- pub osd_recover_clone_overlap: String,
- pub osd_recover_clone_overlap_limit: String,
- pub osd_backfill_scan_min: String,
- pub osd_backfill_scan_max: String,
- pub osd_op_thread_timeout: String,
- pub osd_recovery_thread_timeout: String,
- pub osd_snap_trim_thread_timeout: String,
- pub osd_snap_trim_sleep: String,
- pub osd_scrub_thread_timeout: String,
- pub osd_scrub_finalize_thread_timeout: String,
- pub osd_scrub_invalid_stats: String,
- pub osd_remove_thread_timeout: String,
- pub osd_command_thread_timeout: String,
- pub osd_age: String,
- pub osd_age_time: String,
- pub osd_heartbeat_addr: String,
- pub osd_heartbeat_interval: String,
- pub osd_heartbeat_grace: String,
- pub osd_heartbeat_min_peers: String,
- pub osd_pg_max_concurrent_snap_trims: String,
- pub osd_heartbeat_min_healthy_ratio: String,
- pub osd_mon_heartbeat_interval: String,
- pub osd_mon_report_interval_max: String,
- pub osd_mon_report_interval_min: String,
- pub osd_pg_stat_report_interval_max: String,
- pub osd_mon_ack_timeout: String,
- pub osd_default_data_pool_replay_window: String,
- pub osd_preserve_trimmed_log: String,
- pub osd_auto_mark_unfound_lost: String,
- pub osd_recovery_delay_start: String,
- pub osd_recovery_max_active: String,
- pub osd_recovery_max_single_start: String,
- pub osd_recovery_max_chunk: String,
- pub osd_copyfrom_max_chunk: String,
- pub osd_push_per_object_cost: String,
- pub osd_max_push_cost: String,
- pub osd_max_push_objects: String,
- pub osd_recovery_forget_lost_objects: String,
- pub osd_max_scrubs: String,
- pub osd_scrub_load_threshold: String,
- pub osd_scrub_min_interval: String,
- pub osd_scrub_max_interval: String,
- pub osd_scrub_chunk_min: String,
- pub osd_scrub_chunk_max: String,
- pub osd_scrub_sleep: String,
- pub osd_deep_scrub_interval: String,
- pub osd_deep_scrub_stride: String,
- pub osd_scan_list_ping_tp_interval: String,
- pub osd_auto_weight: String,
- pub osd_class_dir: String,
- pub osd_open_classes_on_start: String,
- pub osd_check_for_log_corruption: String,
- pub osd_use_stale_snap: String,
- pub osd_rollback_to_cluster_snap: String,
- pub osd_default_notify_timeout: String,
- pub osd_kill_backfill_at: String,
- pub osd_pg_epoch_persisted_max_stale: String,
- pub osd_min_pg_log_entries: String,
- pub osd_max_pg_log_entries: String,
- pub osd_op_complaint_time: String,
- pub osd_command_max_records: String,
- pub osd_op_log_threshold: String,
- pub osd_verify_sparse_read_holes: String,
- pub osd_debug_drop_ping_probability: String,
- pub osd_debug_drop_ping_duration: String,
- pub osd_debug_drop_pg_create_probability: String,
- pub osd_debug_drop_pg_create_duration: String,
- pub osd_debug_drop_op_probability: String,
- pub osd_debug_op_order: String,
- pub osd_debug_verify_snaps_on_info: String,
- pub osd_debug_verify_stray_on_activate: String,
- pub osd_debug_skip_full_check_in_backfill_reservation: String,
- pub osd_debug_reject_backfill_probability: String,
- pub osd_enable_op_tracker: String,
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![deny(unused_results)]
-#![allow(dead_code)]
-
-#[derive(Debug)]
-struct A(usize);
-
-#[derive(Debug)]
-struct B { a: usize }
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Regression test for #29740. Inefficient MIR matching algorithms
-// generated way too much code for this sort of case, leading to OOM.
-#![allow(non_snake_case)]
-
-pub mod KeyboardEventConstants {
- pub const DOM_KEY_LOCATION_STANDARD: u32 = 0;
- pub const DOM_KEY_LOCATION_LEFT: u32 = 1;
- pub const DOM_KEY_LOCATION_RIGHT: u32 = 2;
- pub const DOM_KEY_LOCATION_NUMPAD: u32 = 3;
-} // mod KeyboardEventConstants
-
-pub enum Key {
- Space,
- Apostrophe,
- Comma,
- Minus,
- Period,
- Slash,
- Num0,
- Num1,
- Num2,
- Num3,
- Num4,
- Num5,
- Num6,
- Num7,
- Num8,
- Num9,
- Semicolon,
- Equal,
- A,
- B,
- C,
- D,
- E,
- F,
- G,
- H,
- I,
- J,
- K,
- L,
- M,
- N,
- O,
- P,
- Q,
- R,
- S,
- T,
- U,
- V,
- W,
- X,
- Y,
- Z,
- LeftBracket,
- Backslash,
- RightBracket,
- GraveAccent,
- World1,
- World2,
-
- Escape,
- Enter,
- Tab,
- Backspace,
- Insert,
- Delete,
- Right,
- Left,
- Down,
- Up,
- PageUp,
- PageDown,
- Home,
- End,
- CapsLock,
- ScrollLock,
- NumLock,
- PrintScreen,
- Pause,
- F1,
- F2,
- F3,
- F4,
- F5,
- F6,
- F7,
- F8,
- F9,
- F10,
- F11,
- F12,
- F13,
- F14,
- F15,
- F16,
- F17,
- F18,
- F19,
- F20,
- F21,
- F22,
- F23,
- F24,
- F25,
- Kp0,
- Kp1,
- Kp2,
- Kp3,
- Kp4,
- Kp5,
- Kp6,
- Kp7,
- Kp8,
- Kp9,
- KpDecimal,
- KpDivide,
- KpMultiply,
- KpSubtract,
- KpAdd,
- KpEnter,
- KpEqual,
- LeftShift,
- LeftControl,
- LeftAlt,
- LeftSuper,
- RightShift,
- RightControl,
- RightAlt,
- RightSuper,
- Menu,
-}
-
-fn key_from_string(key_string: &str, location: u32) -> Option<Key> {
- match key_string {
- " " => Some(Key::Space),
- "\"" => Some(Key::Apostrophe),
- "'" => Some(Key::Apostrophe),
- "<" => Some(Key::Comma),
- "," => Some(Key::Comma),
- "_" => Some(Key::Minus),
- "-" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Minus),
- ">" => Some(Key::Period),
- "." if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Period),
- "?" => Some(Key::Slash),
- "/" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Slash),
- "~" => Some(Key::GraveAccent),
- "`" => Some(Key::GraveAccent),
- ")" => Some(Key::Num0),
- "0" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num0),
- "!" => Some(Key::Num1),
- "1" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num1),
- "@" => Some(Key::Num2),
- "2" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num2),
- "#" => Some(Key::Num3),
- "3" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num3),
- "$" => Some(Key::Num4),
- "4" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num4),
- "%" => Some(Key::Num5),
- "5" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num5),
- "^" => Some(Key::Num6),
- "6" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num6),
- "&" => Some(Key::Num7),
- "7" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num7),
- "*" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num8),
- "8" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num8),
- "(" => Some(Key::Num9),
- "9" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num9),
- ":" => Some(Key::Semicolon),
- ";" => Some(Key::Semicolon),
- "+" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Equal),
- "=" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Equal),
- "A" => Some(Key::A),
- "a" => Some(Key::A),
- "B" => Some(Key::B),
- "b" => Some(Key::B),
- "C" => Some(Key::C),
- "c" => Some(Key::C),
- "D" => Some(Key::D),
- "d" => Some(Key::D),
- "E" => Some(Key::E),
- "e" => Some(Key::E),
- "F" => Some(Key::F),
- "f" => Some(Key::F),
- "G" => Some(Key::G),
- "g" => Some(Key::G),
- "H" => Some(Key::H),
- "h" => Some(Key::H),
- "I" => Some(Key::I),
- "i" => Some(Key::I),
- "J" => Some(Key::J),
- "j" => Some(Key::J),
- "K" => Some(Key::K),
- "k" => Some(Key::K),
- "L" => Some(Key::L),
- "l" => Some(Key::L),
- "M" => Some(Key::M),
- "m" => Some(Key::M),
- "N" => Some(Key::N),
- "n" => Some(Key::N),
- "O" => Some(Key::O),
- "o" => Some(Key::O),
- "P" => Some(Key::P),
- "p" => Some(Key::P),
- "Q" => Some(Key::Q),
- "q" => Some(Key::Q),
- "R" => Some(Key::R),
- "r" => Some(Key::R),
- "S" => Some(Key::S),
- "s" => Some(Key::S),
- "T" => Some(Key::T),
- "t" => Some(Key::T),
- "U" => Some(Key::U),
- "u" => Some(Key::U),
- "V" => Some(Key::V),
- "v" => Some(Key::V),
- "W" => Some(Key::W),
- "w" => Some(Key::W),
- "X" => Some(Key::X),
- "x" => Some(Key::X),
- "Y" => Some(Key::Y),
- "y" => Some(Key::Y),
- "Z" => Some(Key::Z),
- "z" => Some(Key::Z),
- "{" => Some(Key::LeftBracket),
- "[" => Some(Key::LeftBracket),
- "|" => Some(Key::Backslash),
- "\\" => Some(Key::Backslash),
- "}" => Some(Key::RightBracket),
- "]" => Some(Key::RightBracket),
- "Escape" => Some(Key::Escape),
- "Enter" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD
- => Some(Key::Enter),
- "Tab" => Some(Key::Tab),
- "Backspace" => Some(Key::Backspace),
- "Insert" => Some(Key::Insert),
- "Delete" => Some(Key::Delete),
- "ArrowRight" => Some(Key::Right),
- "ArrowLeft" => Some(Key::Left),
- "ArrowDown" => Some(Key::Down),
- "ArrowUp" => Some(Key::Up),
- "PageUp" => Some(Key::PageUp),
- "PageDown" => Some(Key::PageDown),
- "Home" => Some(Key::Home),
- "End" => Some(Key::End),
- "CapsLock" => Some(Key::CapsLock),
- "ScrollLock" => Some(Key::ScrollLock),
- "NumLock" => Some(Key::NumLock),
- "PrintScreen" => Some(Key::PrintScreen),
- "Pause" => Some(Key::Pause),
- "F1" => Some(Key::F1),
- "F2" => Some(Key::F2),
- "F3" => Some(Key::F3),
- "F4" => Some(Key::F4),
- "F5" => Some(Key::F5),
- "F6" => Some(Key::F6),
- "F7" => Some(Key::F7),
- "F8" => Some(Key::F8),
- "F9" => Some(Key::F9),
- "F10" => Some(Key::F10),
- "F11" => Some(Key::F11),
- "F12" => Some(Key::F12),
- "F13" => Some(Key::F13),
- "F14" => Some(Key::F14),
- "F15" => Some(Key::F15),
- "F16" => Some(Key::F16),
- "F17" => Some(Key::F17),
- "F18" => Some(Key::F18),
- "F19" => Some(Key::F19),
- "F20" => Some(Key::F20),
- "F21" => Some(Key::F21),
- "F22" => Some(Key::F22),
- "F23" => Some(Key::F23),
- "F24" => Some(Key::F24),
- "F25" => Some(Key::F25),
- "0" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp0),
- "1" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp1),
- "2" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp2),
- "3" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp3),
- "4" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp4),
- "5" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp5),
- "6" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp6),
- "7" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp7),
- "8" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp8),
- "9" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp9),
- "." if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpDecimal),
- "/" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpDivide),
- "*" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpMultiply),
- "-" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpSubtract),
- "+" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpAdd),
- "Enter" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD
- => Some(Key::KpEnter),
- "=" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpEqual),
- "Shift" if location == KeyboardEventConstants::DOM_KEY_LOCATION_LEFT
- => Some(Key::LeftShift),
- "Control" if location == KeyboardEventConstants::DOM_KEY_LOCATION_LEFT
- => Some(Key::LeftControl),
- "Alt" if location == KeyboardEventConstants::DOM_KEY_LOCATION_LEFT => Some(Key::LeftAlt),
- "Super" if location == KeyboardEventConstants::DOM_KEY_LOCATION_LEFT
- => Some(Key::LeftSuper),
- "Shift" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT
- => Some(Key::RightShift),
- "Control" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT
- => Some(Key::RightControl),
- "Alt" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT => Some(Key::RightAlt),
- "Super" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT
- => Some(Key::RightSuper),
- "ContextMenu" => Some(Key::Menu),
- _ => None
- }
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-pub struct Struct<K: 'static> {
- pub field: K,
-}
-
-static STRUCT: Struct<&'static [u8]> = Struct {
- field: {&[1]}
-};
-
-static STRUCT2: Struct<&'static [u8]> = Struct {
- field: &[1]
-};
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_snake_case)]
-// pretty-expanded FIXME #23616
-
-fn Matrix4<T>(m11: T, m12: T, m13: T, m14: T,
- m21: T, m22: T, m23: T, m24: T,
- m31: T, m32: T, m33: T, m34: T,
- m41: T, m42: T, m43: T, m44: T)
- -> Matrix4<T> {
- Matrix4 {
- m11: m11, m12: m12, m13: m13, m14: m14,
- m21: m21, m22: m22, m23: m23, m24: m24,
- m31: m31, m32: m32, m33: m33, m34: m34,
- m41: m41, m42: m42, m43: m43, m44: m44
- }
-}
-
-struct Matrix4<T> {
- m11: T, m12: T, m13: T, m14: T,
- m21: T, m22: T, m23: T, m24: T,
- m31: T, m32: T, m33: T, m34: T,
- m41: T, m42: T, m43: T, m44: T,
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-trait Make {
- type Out;
-
- fn make() -> Self::Out;
-}
-
-impl Make for () {
- type Out = ();
-
- fn make() -> Self::Out {}
-}
-
-// Also make sure we don't hit an ICE when the projection can't be known
-fn f<T: Make>() -> <T as Make>::Out { loop {} }
-
-// ...and that it works with a blanket impl
-trait Tr {
- type Assoc;
-}
-
-impl<T: Make> Tr for T {
- type Assoc = ();
-}
-
-fn g<T: Make>() -> <T as Tr>::Assoc { }
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-
-trait Resources {
- type Buffer: Copy;
-}
-
-#[derive(Copy, Clone)]
-struct ConstantBufferSet<R: Resources>(
- pub R::Buffer
-);
-
-#[derive(Copy, Clone)]
-enum It {}
-impl Resources for It {
- type Buffer = u8;
-}
-
-#[derive(Copy, Clone)]
-enum Command {
- BindConstantBuffers(ConstantBufferSet<It>)
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2018 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.
-
-// run-pass
-// only-x86_64
-
-#![allow(dead_code, non_upper_case_globals)]
-#![feature(asm)]
-
-#[repr(C)]
-pub struct D32x4(f32,f32,f32,f32);
-
-impl D32x4 {
- fn add(&self, vec: Self) -> Self {
- unsafe {
- let ret: Self;
- asm!("
- movaps $1, %xmm1
- movaps $2, %xmm2
- addps %xmm1, %xmm2
- movaps $xmm1, $0
- "
- : "=r"(ret)
- : "1"(self), "2"(vec)
- : "xmm1", "xmm2"
- );
- ret
- }
- }
-}
-
-fn main() { }
-
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_variables)]
-const A: [u32; 1] = [0];
-
-fn test() {
- let range = A[1]..;
-}
-
-fn main() { }
-
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Issue 33903:
-// Built-in indexing should be used even when the index is not
-// trivially an integer
-// Only built-in indexing can be used in constant expressions
-
-const FOO: i32 = [12, 34][0 + 1];
-
-fn main() {}
-
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-
-struct A {
- a: &'static (),
-}
-
-static B: &'static A = &A { a: &() };
-static C: &'static A = &B;
-
-fn main() {}
+++ /dev/null
-// Copyright 2012-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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_camel_case_types)]
-// rustc --test ignores2.rs && ./ignores2
-
-pub struct Path;
-
-type rsrc_loader = Box<FnMut(&Path) -> Result<String, String>>;
-
-fn tester()
-{
- let mut loader: rsrc_loader = Box::new(move |_path| {
- Ok("more blah".to_string())
- });
-
- let path = Path;
- assert!(loader(&path).is_ok());
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// #34751 ICE: 'rustc' panicked at 'assertion failed: !substs.has_regions_escaping_depth(0)'
-
-#[allow(dead_code)]
-
-use std::marker::PhantomData;
-
-fn f<'a>(PhantomData::<&'a u8>: PhantomData<&'a u8>) {}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(stable_features)]
-#![feature(associated_consts)]
-
-use std::marker::PhantomData;
-
-trait Tr<'a> {
- const C: PhantomData<&'a u8> = PhantomData::<&'a u8>;
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![feature(specialization)]
-
-fn main() {}
-
-pub trait Alpha<T> { }
-
-pub trait Beta {
- type Event;
-}
-
-pub trait Delta {
- type Handle;
- fn process(&self);
-}
-
-pub struct Parent<A, T>(A, T);
-
-impl<A, T> Delta for Parent<A, T>
-where A: Alpha<T::Handle>,
- T: Delta,
- T::Handle: Beta<Event = <Handle as Beta>::Event> {
- type Handle = Handle;
- default fn process(&self) {
- unimplemented!()
- }
-}
-
-impl<A, T> Delta for Parent<A, T>
-where A: Alpha<T::Handle> + Alpha<Handle>,
- T: Delta,
- T::Handle: Beta<Event = <Handle as Beta>::Event> {
- fn process(&self) {
- unimplemented!()
- }
-}
-
-pub struct Handle;
-
-impl Beta for Handle {
- type Event = ();
-}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Regression test for #35546. Check that we are able to codegen
-// this. Before we had problems because of the drop glue signature
-// around dropping a trait object (specifically, when dropping the
-// `value` field of `Node<Send>`).
-
-struct Node<T: ?Sized + Send> {
- next: Option<Box<Node<Send>>>,
- value: T,
-}
-
-fn clear(head: &mut Option<Box<Node<Send>>>) {
- match head.take() {
- Some(node) => *head = node.next,
- None => (),
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-trait Canvas {
- fn add_point(&self, point: &isize);
- fn add_points(&self, shapes: &[isize]) {
- for pt in shapes {
- self.add_point(pt)
- }
- }
-
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-trait DeclarationParser {
- type Declaration;
-}
-
-struct DeclarationListParser<'i, I, P>
- where P: DeclarationParser<Declaration = I>
-{
- input: &'i (),
- parser: P
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(unused_must_use)]
-#![allow(dead_code)]
-#![allow(unused_mut)]
-use std::thread;
-use std::sync::mpsc::Sender;
-
-type RingBuffer = Vec<f64> ;
-type SamplesFn = Box<FnMut(&RingBuffer) + Send>;
-
-enum Msg
-{
- GetSamples(String, SamplesFn), // sample set name, callback which receives samples
-}
-
-fn foo(name: String, samples_chan: Sender<Msg>) {
- thread::spawn(move|| {
- let mut samples_chan = samples_chan;
-
- let callback: SamplesFn = Box::new(move |buffer| {
- for i in 0..buffer.len() {
- println!("{}: {}", i, buffer[i])
- }
- });
-
- samples_chan.send(Msg::GetSamples(name.clone(), callback));
- }).join();
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// Tests for an LLVM abort when storing a lifetime-parametric fn into
-// context that is expecting one that is not lifetime-parametric
-// (i.e. has no `for <'_>`).
-
-pub struct A<'a>(&'a ());
-pub struct S<T>(T);
-
-pub fn bad<'s>(v: &mut S<fn(A<'s>)>, y: S<for<'b> fn(A<'b>)>) {
- *v = y;
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![feature(slice_patterns)]
-
-fn check(list: &[u8]) {
- match list {
- &[] => {},
- &[_u1, _u2, ref _next..] => {},
- &[_u1] => {},
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// Regression test for #37655. The problem was a false edge created by
-// coercion that wound up requiring that `'a` (in `split()`) outlive
-// `'b`, which shouldn't be necessary.
-
-#![allow(warnings)]
-
-trait SliceExt<T> {
- type Item;
-
- fn get_me<I>(&self, index: I) -> &I::Output
- where I: SliceIndex<Self::Item>;
-}
-
-impl<T> SliceExt<T> for [T] {
- type Item = T;
-
- fn get_me<I>(&self, index: I) -> &I::Output
- where I: SliceIndex<T>
- {
- panic!()
- }
-}
-
-pub trait SliceIndex<T> {
- type Output: ?Sized;
-}
-
-impl<T> SliceIndex<T> for usize {
- type Output = T;
-}
-
-fn foo<'a, 'b>(split: &'b [&'a [u8]]) -> &'a [u8] {
- split.get_me(0)
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-trait Foo {
- fn foo(&self);
-}
-
-fn foo<'a>(s: &'a mut ()) where &'a mut (): Foo {
- s.foo();
-}
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-type A = for<> fn();
-
-type B = for<'a,> fn();
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#[repr(u64)]
-enum A {
- A = 0u64,
- B = !0u64,
-}
-
-fn cmp() -> A {
- A::B
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-enum PureCounter { PureCounterVariant(usize) }
-
-fn each<F>(thing: PureCounter, blk: F) where F: FnOnce(&usize) {
- let PureCounter::PureCounterVariant(ref x) = thing;
- blk(x);
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-fn vec_peek<'r, T>(v: &'r [T]) -> &'r [T] {
- &v[1..5]
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-fn f<T: ?for<'a> Sized>() {}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-macro_rules! expr { () => { () } }
-
-enum A {}
-
-impl A {
- const A: () = expr!();
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-trait A {
- fn a_method(&self);
-}
-
-trait B: A {
- fn b_method(&self);
-}
-
-trait C: B {
- fn c_method(&self) {
- self.a_method();
- }
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-
-// pretty-expanded FIXME #23616
-
-struct HasNested {
- nest: Vec<Vec<isize> > ,
-}
-
-impl HasNested {
- fn method_push_local(&mut self) {
- self.nest[0].push(0);
- }
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(unreachable_code)]
-// Regression test for issue #39984.
-//
-// The key here is that the error type of the `Ok` call ought to be
-// constrained to `String`, even though it is dead-code.
-
-fn main() {}
-
-fn t() -> Result<(), String> {
- return Err("".into());
- Ok(())
-}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-
-macro_rules! m { () => { 0 } }
-
-trait T {
- const C: i32 = m!();
-}
-
-struct S;
-impl S {
- const C: i32 = m!();
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_mut)]
-/*
-# if b { x } else { y } requires identical types for x and y
-*/
-
-fn print1(b: bool, s1: &str, s2: &str) {
- println!("{}", if b { s1 } else { s2 });
-}
-fn print2<'a, 'b>(b: bool, s1: &'a str, s2: &'b str) {
- println!("{}", if b { s1 } else { s2 });
-}
-fn print3(b: bool, s1: &str, s2: &str) {
- let mut s: &str;
- if b { s = s1; } else { s = s2; }
- println!("{}", s);
-}
-fn print4<'a, 'b>(b: bool, s1: &'a str, s2: &'b str) {
- let mut s: &str;
- if b { s = s1; } else { s = s2; }
- println!("{}", s);
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-macro_rules! m {
- ($i:meta) => {
- #[derive($i)]
- struct S;
- }
-}
-
-m!(Clone);
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-struct Foo;
-
-impl Foo {
- fn bar(&mut self) -> bool { true }
-}
-
-fn error(foo: &mut Foo) {
- if let Some(_) = Some(true) {
- } else if foo.bar() {}
-}
-
-fn ok(foo: &mut Foo) {
- if let Some(_) = Some(true) {
- } else {
- if foo.bar() {}
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-struct Function<T, F> { t: T, f: F }
-
-impl<T, R> Function<T, fn() -> R> { fn foo() { } }
-impl<T, R> Function<T, fn() -> R> { fn bar() { } }
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![deny(dead_code)]
-
-#[used]
-static FOO: u32 = 0;
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Regression test for #41936. The coerce-unsized trait check in
-// coherence was using subtyping, which triggered variance
-// computation, which failed because it required type info for fields
-// that had not (yet) been computed.
-
-#![feature(unsize)]
-#![feature(coerce_unsized)]
-
-use std::{marker,ops};
-
-// Change the array to a non-array, and error disappears
-// Adding a new field to the end keeps the error
-struct LogDataBuf([u8;8]);
-
-struct Aref<T: ?Sized>
-{
- // Inner structure triggers the error, removing the inner removes the message.
- ptr: Box<ArefInner<T>>,
-}
-impl<T: ?Sized + marker::Unsize<U>, U: ?Sized> ops::CoerceUnsized<Aref<U>> for Aref<T> {}
-
-struct ArefInner<T: ?Sized>
-{
- // Even with this field commented out, the error is raised.
- data: T,
-}
-
-fn main(){}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-struct Foo<T>(T);
-
-struct IntoIter<T>(T);
-
-impl<'a, T: 'a> Iterator for IntoIter<T> {
- type Item = ();
-
- fn next(&mut self) -> Option<()> {
- None
- }
-}
-
-impl<T> IntoIterator for Foo<T> {
- type Item = ();
- type IntoIter = IntoIter<T>;
-
- fn into_iter(self) -> IntoIter<T> {
- IntoIter(self.0)
- }
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2018 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(stable_features)]
-#![feature(associated_consts)]
-
-impl A for i32 {
- type Foo = u32;
-}
-impl B for u32 {
- const BAR: i32 = 0;
-}
-
-trait A {
- type Foo: B;
-}
-
-trait B {
- const BAR: i32;
-}
-
-fn generic<T: A>() {
- // This panics if the universal function call syntax is used as well
- println!("{}", T::Foo::BAR);
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(unused)]
-
-macro_rules! column {
- ($i:ident) => {
- $i
- };
-}
-
-fn foo() -> ! {
- panic!();
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-trait Trait {
- type Output;
-}
-
-fn f<T: Trait>() {
- std::mem::size_of::<T::Output>();
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_variables)]
-trait VecN {
- const DIM: usize;
-}
-
-trait Mat {
- type Row: VecN;
-}
-
-fn m<M: Mat>() {
- let x = M::Row::DIM;
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2018 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.
-
-// run-pass
-pub trait Foo<'a> {
- type Bar;
- fn foo(&'a self) -> Self::Bar;
-}
-
-impl<'a, 'b, T: 'a> Foo<'a> for &'b T {
- type Bar = &'a T;
- fn foo(&'a self) -> &'a T {
- self
- }
-}
-
-pub fn uncallable<T, F>(x: T, f: F)
- where T: for<'a> Foo<'a>,
- F: for<'a> Fn(<T as Foo<'a>>::Bar)
-{
- f(x.foo());
-}
-
-pub fn catalyst(x: &i32) {
- broken(x, |_| {})
-}
-
-pub fn broken<F: Fn(&i32)>(x: &i32, f: F) {
- uncallable(x, |y| f(y));
-}
-
-fn main() { }
-
+++ /dev/null
-// Copyright 2018 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.
-
-// run-pass
-// only-x86_64
-// no-prefer-dynamic
-// compile-flags: -Ctarget-feature=+avx -Clto
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-trait T {
- type X;
- const X: Self::X;
-}
-fn foo<X: T>() {
- let _: X::X = X::X;
-}
-
-trait S {
- const X: Self::X;
- type X;
-}
-fn bar<X: S>() {
- let _: X::X = X::X;
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// compile-flags: -Z borrowck=compare
-
-struct Foo(bool);
-
-struct Container(&'static [&'static Foo]);
-
-static FOO: Foo = Foo(true);
-static CONTAINER: Container = Container(&[&FOO]);
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![feature(never_type)]
-#![feature(exhaustive_patterns)]
-
-// Regression test for inhabitedness check. The old
-// cache used to cause us to incorrectly decide
-// that `test_b` was invalid.
-
-struct Foo {
- field1: !,
- field2: Option<&'static Bar>,
-}
-
-struct Bar {
- field1: &'static Foo
-}
-
-fn test_a() {
- let x: Option<Foo> = None;
- match x { None => () }
-}
-
-fn test_b() {
- let x: Option<Bar> = None;
- match x { None => () }
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-fn broken(v: &[u8], i: usize, j: usize) -> &[u8] { &v[i..j] }
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-//! dox
-
-#![deny(missing_docs)]
-
-macro_rules! doc {
- ($e:expr) => (
- #[doc = $e]
- pub struct Foo;
- )
-}
-
-doc!("a");
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-macro_rules! a {
- () => { "a" }
-}
-
-macro_rules! b {
- ($doc:expr) => {
- #[doc = $doc]
- pub struct B;
- }
-}
-
-b!(a!());
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-use std::ops::Add;
-
-fn ref_add<T>(a: &T, b: &T) -> T
-where
- for<'x> &'x T: Add<&'x T, Output = T>,
-{
- a + b
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2018 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.
-
-// run-pass
-#![deny(non_camel_case_types)]
-
-#[allow(dead_code)]
-fn qqq(lol: impl Iterator<Item=u32>) -> impl Iterator<Item=u64> {
- lol.map(|x|x as u64)
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-mod my_mod {
- #[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash)]
- pub struct Name<'a> {
- source: &'a str,
- }
-
- pub const JSON: Name = Name { source: "JSON" };
-}
-
-pub fn crash() -> bool {
- match (my_mod::JSON, None) {
- (_, Some(my_mod::JSON)) => true,
- (my_mod::JSON, None) => true,
- _ => false,
- }
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2018 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.
-
-// run-pass
-#![allow(unused_imports)]
-
-use {{}, {}};
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![feature(nll)]
-
-struct AtomicRefMut<'a> {
- value: &'a mut i32,
- borrow: AtomicBorrowRefMut,
-}
-
-struct AtomicBorrowRefMut {
-}
-
-impl Drop for AtomicBorrowRefMut {
- fn drop(&mut self) {
- }
-}
-
-fn map(orig: AtomicRefMut) -> AtomicRefMut {
- AtomicRefMut {
- value: orig.value,
- borrow: orig.borrow,
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![feature(nll)]
-
-struct WithDrop;
-
-impl Drop for WithDrop {
- fn drop(&mut self) {}
-}
-
-fn consume(x: (&mut (), WithDrop)) -> &mut () { x.0 }
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![feature(nll)]
-
-struct MyStruct<'a> {
- field: &'a mut (),
- field2: WithDrop
-}
-
-struct WithDrop;
-
-impl Drop for WithDrop {
- fn drop(&mut self) {}
-}
-
-impl<'a> MyStruct<'a> {
- fn consume(self) -> &'a mut () { self.field }
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2018 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.
-
-// run-pass
-#![allow(dead_code)]
-
-// Tests that automatic coercions from &mut T to *mut T
-// allow borrows of T to expire immediately - essentially, that
-// they work identically to 'foo as *mut T'
-#![feature(nll)]
-
-struct SelfReference {
- self_reference: *mut SelfReference,
-}
-
-impl SelfReference {
- fn set_self_ref(&mut self) {
- self.self_reference = self;
- }
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2018 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_upper_case_globals)]
-
-#![feature(nll)]
-
-static mut x: &'static u32 = &0;
-
-fn foo() {
- unsafe { x = &1; }
-}
-
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-
-// pretty-expanded FIXME #23616
-
-pub struct Scheduler {
- /// The event loop used to drive the scheduler and perform I/O
- event_loop: Box<isize>
-}
-
-pub fn main() { }
+++ /dev/null
-// Copyright 2018 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.
-
-// run-pass
-// Regression test for #48551. Covers a case where duplicate candidates
-// arose during associated type projection.
-
-use std::ops::{Mul, MulAssign};
-
-pub trait ClosedMul<Right>: Sized + Mul<Right, Output = Self> + MulAssign<Right> {}
-impl<T, Right> ClosedMul<Right> for T
-where
- T: Mul<Right, Output = T> + MulAssign<Right>,
-{
-}
-
-pub trait InnerSpace: ClosedMul<<Self as InnerSpace>::Real> {
- type Real;
-}
-
-pub trait FiniteDimVectorSpace: ClosedMul<<Self as FiniteDimVectorSpace>::Field> {
- type Field;
-}
-
-pub trait FiniteDimInnerSpace
- : InnerSpace + FiniteDimVectorSpace<Field = <Self as InnerSpace>::Real> {
-}
-
-pub trait EuclideanSpace: ClosedMul<<Self as EuclideanSpace>::Real> {
- type Coordinates: FiniteDimInnerSpace<Real = Self::Real>
- + Mul<Self::Real, Output = Self::Coordinates>
- + MulAssign<Self::Real>;
-
- type Real;
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2018 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.
-
-// run-pass
-#![allow(dead_code)]
-
-const PATH_DOT: &[u8] = &[b'.'];
-
-fn match_slice(element: &[u8]) {
- match element {
- &[] => {}
- PATH_DOT => {}
- _ => {}
- }
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-const INVALID_ENUM : u32 = 0;
-const INVALID_VALUE : u32 = 1;
-
-fn gl_err_str(err: u32) -> String
-{
- match err
- {
- INVALID_ENUM => { "Invalid enum".to_string() },
- INVALID_VALUE => { "Invalid value".to_string() },
- _ => { "Unknown error".to_string() }
- }
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-fn foo<T: ::std::cmp::PartialEq>(_t: T) { }
-
-pub fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(improper_ctypes)]
-
-// pretty-expanded FIXME #23616
-
-struct TwoDoubles {
- r: f64,
- i: f64
-}
-
-extern "C" {
- fn rust_dbg_extern_identity_TwoDoubles(arg1: TwoDoubles) -> TwoDoubles;
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-#![feature(box_syntax)]
-
-pub struct Foo {
- a: isize,
-}
-
-struct Bar<'a> {
- a: Box<Option<isize>>,
- b: &'a Foo,
-}
-
-fn check(a: Box<Foo>) {
- let _ic = Bar{ b: &*a, a: box None };
-}
-
-pub fn main(){}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-pub mod foo {
- use super::Bar;
-
- pub struct FooStruct { bar : Bar }
-}
-
-pub enum Bar {
- Bar0 = 0 as isize
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-
-// pretty-expanded FIXME #23616
-
-pub use local as local_alias;
-
-pub mod local { }
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-#[derive(PartialEq)]
-struct A { x: usize }
-
-impl Drop for A {
- fn drop(&mut self) {}
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(improper_ctypes)]
-
-// pretty-expanded FIXME #23616
-#![allow(non_snake_case)]
-
-pub mod Bar {
- pub struct Foo {
- v: isize,
- }
-
- extern {
- pub fn foo(v: *const Foo) -> Foo;
- }
-}
-
-pub fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-#![feature(box_patterns)]
-#![feature(box_syntax)]
-
-fn foo(box (_x, _y): Box<(isize, isize)>) {}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-// pretty-expanded FIXME #23616
-
-use std::mem;
-
-/// Returns the size of a type
-pub fn size_of<T>() -> usize {
- TypeInfo::size_of(None::<T>)
-}
-
-/// Returns the size of the type that `val` points to
-pub fn size_of_val<T>(val: &T) -> usize {
- val.size_of_val()
-}
-
-pub trait TypeInfo: Sized {
- fn size_of(_lame_type_hint: Option<Self>) -> usize;
- fn size_of_val(&self) -> usize;
-}
-
-impl<T> TypeInfo for T {
- /// The size of the type in bytes.
- fn size_of(_lame_type_hint: Option<T>) -> usize {
- mem::size_of::<T>()
- }
-
- /// Returns the size of the type of `self` in bytes.
- fn size_of_val(&self) -> usize {
- TypeInfo::size_of(None::<T>)
- }
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_upper_case_globals)]
-
-static x: &'static usize = &1;
-static y: usize = *x;
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-fn foo<T: 'static>(_: T) {}
-
-fn bar<T>(x: &'static T) {
- foo(x);
-}
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-pub mod a {
- pub struct Foo { a: usize }
-}
-
-pub mod b {
- use a::Foo;
- impl Foo {
- fn bar(&self) { }
- }
-}
-
-pub fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-/*
-
-#7673 Polymorphically creating traits barely works
-
-*/
-
-#![feature(box_syntax)]
-
-pub fn main() {}
-
-trait A {
- fn dummy(&self) { }
-}
-
-impl<T: 'static> A for T {}
-
-fn owned2<T: 'static>(a: Box<T>) { a as Box<A>; }
-fn owned3<T: 'static>(a: Box<T>) { box a as Box<A>; }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-/*
-
-#8171 Self is not recognised as implementing kinds in default method implementations
-
-*/
-
-fn require_send<T: Send>(_: T){}
-
-trait TragicallySelfIsNotSend: Send + Sized {
- fn x(self) {
- require_send(self);
- }
-}
-
-pub fn main(){}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-pub trait Writer {
- fn write(&mut self, b: &[u8]) -> Result<(), ()>;
-}
-
-fn foo(a: &mut Writer) {
- a.write(&[]).unwrap();
-}
-
-pub fn main(){}
+++ /dev/null
-// 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.
-
-// run-pass
-trait Foo1 {}
-
-trait A {}
-
-macro_rules! foo1(($t:path) => {
- impl<T: $t> Foo1 for T {}
-});
-
-foo1!(A);
-
-trait Foo2 {}
-
-trait B<T> {}
-
-#[allow(unused)]
-struct C {}
-
-macro_rules! foo2(($t:path) => {
- impl<T: $t> Foo2 for T {}
-});
-
-foo2!(B<C>);
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-#![allow(non_camel_case_types)]
-#![allow(non_upper_case_globals)]
-// pretty-expanded FIXME #23616
-
-pub struct UninterpretedOption_NamePart {
- name_part: Option<String>,
-}
-
-impl<'a> UninterpretedOption_NamePart {
- pub fn default_instance() -> &'static UninterpretedOption_NamePart {
- static instance: UninterpretedOption_NamePart = UninterpretedOption_NamePart {
- name_part: None,
- };
- &instance
- }
-}
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-#![allow(non_snake_case)]
-
-macro_rules! silly_macro {
- () => (
- pub mod Qux {
- pub struct Foo { x : u8 }
- pub fn bar(_foo : Foo) {}
- }
- );
-}
-
-silly_macro!();
-
-pub fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// Regression test for issue 9243
-#![allow(non_upper_case_globals)]
-
-pub struct Test {
- mem: isize,
-}
-
-pub static g_test: Test = Test {mem: 0};
-
-impl Drop for Test {
- fn drop(&mut self) {}
-}
-
-fn main() {}
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-static DATA:&'static [&'static str] = &["my string"];
-fn main() { }
+++ /dev/null
-// 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.
-
-// run-pass
-#![allow(dead_code)]
-// pretty-expanded FIXME #23616
-
-mod a {
- pub enum Enum<T> {
- A(T),
- }
-
- pub trait X {
- fn dummy(&self) { }
- }
- impl X for isize {}
-
- pub struct Z<'a>(Enum<&'a (X+'a)>);
- fn foo() { let x: isize = 42; let z = Z(Enum::A(&x as &X)); let _ = z; }
-}
-
-mod b {
- trait X {
- fn dummy(&self) { }
- }
- impl X for isize {}
- struct Y<'a>{
- x:Option<&'a (X+'a)>,
- }
-
- fn bar() {
- let x: isize = 42;
- let _y = Y { x: Some(&x as &X) };
- }
-}
-
-mod c {
- pub trait X { fn f(&self); }
- impl X for isize { fn f(&self) {} }
- pub struct Z<'a>(Option<&'a (X+'a)>);
- fn main() { let x: isize = 42; let z = Z(Some(&x as &X)); let _ = z; }
-}
-
-pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#[derive(Debug)]
+enum Foo<'s> {
+ V(&'s str)
+}
+
+fn f(arr: &[&Foo]) {
+ for &f in arr {
+ println!("{:?}", f);
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+pub struct Foo;
+
+pub trait Bar {
+ fn bar(&self);
+}
+
+pub trait Baz {
+ fn baz(&self) { }
+}
+
+impl<T: Baz> Bar for T {
+ fn bar(&self) {}
+}
+
+impl Baz for Foo {}
+
+pub fn foo(t: Box<Foo>) {
+ t.bar(); // ~Foo doesn't implement Baz
+ (*t).bar(); // ok b/c Foo implements Baz
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+extern "Rust" fn foo() {}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+#![deny(missing_docs)]
+#![doc="module"]
+
+#[doc="struct"]
+pub struct Foo;
+
+pub fn foo() {
+ #![doc="fn"]
+}
+
+#[doc="main"]
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+pub mod two_tuple {
+ pub trait T { fn dummy(&self) { } }
+ pub struct P<'a>(&'a (T + 'a), &'a (T + 'a));
+ pub fn f<'a>(car: &'a T, cdr: &'a T) -> P<'a> {
+ P(car, cdr)
+ }
+}
+
+pub mod two_fields {
+ pub trait T { fn dummy(&self) { } }
+ pub struct P<'a> { car: &'a (T + 'a), cdr: &'a (T + 'a) }
+ pub fn f<'a>(car: &'a T, cdr: &'a T) -> P<'a> {
+ P{ car: car, cdr: cdr }
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+trait Common { fn dummy(&self) { } }
+
+impl<'t, T> Common for (T, &'t T) {}
+
+impl<'t, T> Common for (&'t T, T) {}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+//! Ensure the private trait Bar isn't complained about.
+
+#![deny(missing_docs)]
+
+mod foo {
+ trait Bar { fn bar(&self) { } }
+ impl Bar for i8 { fn bar(&self) { } }
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// #11612
+// We weren't updating the auto adjustments with all the resolved
+// type information after type check.
+
+// pretty-expanded FIXME #23616
+
+trait A { fn dummy(&self) { } }
+
+struct B<'a, T:'a> {
+ f: &'a T
+}
+
+impl<'a, T> A for B<'a, T> {}
+
+fn foo(_: &A) {}
+
+fn bar<G>(b: &B<G>) {
+ foo(b); // Coercion should work
+ foo(b as &A); // Explicit cast should work as well
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+struct A {
+ a: String
+}
+
+fn borrow<'a>(binding: &'a A) -> &'a str {
+ match &*binding.a {
+ "in" => "in_",
+ "ref" => "ref_",
+ ident => ident
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(unused_attributes)]
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+// ignore-wasm32-bare no libc to test ffi with
+
+#![feature(libc)]
+
+#![crate_id="rust_get_test_int"]
+
+mod rustrt {
+ extern crate libc;
+
+ extern {
+ pub fn rust_get_test_int() -> libc::intptr_t;
+ }
+}
+
+pub fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+pub struct Foo;
+
+mod bar {
+ use Foo;
+
+ impl Foo {
+ fn baz(&self) {}
+ }
+}
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+trait Foo {
+ #[allow(anonymous_parameters)]
+ fn quux(u8) {}
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+use std::slice;
+
+pub struct PhfMapEntries<'a, T: 'a> {
+ iter: slice::Iter<'a, (&'static str, T)>,
+}
+
+impl<'a, T> Iterator for PhfMapEntries<'a, T> {
+ type Item = (&'static str, &'a T);
+
+ fn next(&mut self) -> Option<(&'static str, &'a T)> {
+ self.iter.by_ref().map(|&(key, ref value)| (key, value)).next()
+ }
+
+ fn size_hint(&self) -> (usize, Option<usize>) {
+ self.iter.size_hint()
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// defining static with struct that contains enum
+// with &'static str variant used to cause ICE
+
+// pretty-expanded FIXME #23616
+
+pub enum Foo {
+ Bar,
+ Baz(&'static str),
+}
+
+pub static TEST: Test = Test {
+ foo: Foo::Bar,
+ c: 'a'
+};
+
+pub struct Test {
+ foo: Foo,
+ c: char,
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(unused_variables)]
+// pretty-expanded FIXME #23616
+
+struct Foo<'a> {
+ i: &'a bool,
+ j: Option<&'a isize>,
+}
+
+impl<'a> Foo<'a> {
+ fn bar(&mut self, j: &isize) {
+ let child = Foo {
+ i: self.i,
+ j: Some(j)
+ };
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+pub struct Foo<'a, 'b: 'a> { foo: &'a &'b isize }
+pub fn foo<'a, 'b>(x: Foo<'a, 'b>, _o: Option<& & ()>) { let _y = x.foo; }
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+trait Foo {
+ #[allow(anonymous_parameters)]
+ fn bar(&self, isize) {}
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+struct TestStruct {
+ x: *const [isize; 2]
+}
+
+unsafe impl Sync for TestStruct {}
+
+static TEST_VALUE : TestStruct = TestStruct{x: 0x1234 as *const [isize; 2]};
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+#![allow(unused_imports, dead_code)]
+
+use foo::Foo;
+
+mod foo {
+ pub use m::Foo; // this should shadow d::Foo
+}
+
+mod m {
+ pub struct Foo;
+}
+
+mod d {
+ pub struct Foo;
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+trait Foo: Sized {
+ fn bar(&self);
+ fn baz(&self) { }
+ fn bah(_: Option<Self>) { }
+}
+
+struct BarTy {
+ x : isize,
+ y : f64,
+}
+
+impl BarTy {
+ fn a() {}
+ fn b(&self) {}
+}
+
+// If these fail, it's necessary to update rustc_resolve and the cfail tests.
+impl Foo for *const BarTy {
+ fn bar(&self) {
+ self.baz();
+ BarTy::a();
+ Foo::bah(None::<*const BarTy>);
+ }
+}
+
+// If these fail, it's necessary to update rustc_resolve and the cfail tests.
+impl<'a> Foo for &'a BarTy {
+ fn bar(&self) {
+ self.baz();
+ self.x;
+ self.y;
+ BarTy::a();
+ Foo::bah(None::<&BarTy>);
+ self.b();
+ }
+}
+
+// If these fail, it's necessary to update rustc_resolve and the cfail tests.
+impl<'a> Foo for &'a mut BarTy {
+ fn bar(&self) {
+ self.baz();
+ self.x;
+ self.y;
+ BarTy::a();
+ Foo::bah(None::<&mut BarTy>);
+ self.b();
+ }
+}
+
+// If these fail, it's necessary to update rustc_resolve and the cfail tests.
+impl Foo for Box<BarTy> {
+ fn bar(&self) {
+ self.baz();
+ Foo::bah(None::<Box<BarTy>>);
+ }
+}
+
+// If these fail, it's necessary to update rustc_resolve and the cfail tests.
+impl Foo for *const isize {
+ fn bar(&self) {
+ self.baz();
+ Foo::bah(None::<*const isize>);
+ }
+}
+
+// If these fail, it's necessary to update rustc_resolve and the cfail tests.
+impl<'a> Foo for &'a isize {
+ fn bar(&self) {
+ self.baz();
+ Foo::bah(None::<&isize>);
+ }
+}
+
+// If these fail, it's necessary to update rustc_resolve and the cfail tests.
+impl<'a> Foo for &'a mut isize {
+ fn bar(&self) {
+ self.baz();
+ Foo::bah(None::<&mut isize>);
+ }
+}
+
+// If these fail, it's necessary to update rustc_resolve and the cfail tests.
+impl Foo for Box<isize> {
+ fn bar(&self) {
+ self.baz();
+ Foo::bah(None::<Box<isize>>);
+ }
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2012-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.
+
+// compile-pass
+#![allow(unused_imports)]
+// pretty-expanded FIXME #23616
+
+#[macro_use] extern crate std as std2;
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+#[deny(dead_code)]
+pub enum Foo {
+ Bar {
+ baz: isize
+ }
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+pub trait Reader {}
+
+enum Wrapper<'a> {
+ WrapReader(&'a (Reader + 'a))
+}
+
+trait Wrap<'a> {
+ fn wrap(self) -> Wrapper<'a>;
+}
+
+impl<'a, R: Reader> Wrap<'a> for &'a mut R {
+ fn wrap(self) -> Wrapper<'a> {
+ Wrapper::WrapReader(self as &'a mut Reader)
+ }
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+pub type BigRat<T = isize> = T;
+
+fn main() {}
--- /dev/null
+// Copyright 2012-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.
+
+// compile-pass
+#![allow(unused_macros)]
+#![allow(dead_code)]
+#![feature(asm)]
+
+type History = Vec<&'static str>;
+
+fn wrap<A>(x:A, which: &'static str, history: &mut History) -> A {
+ history.push(which);
+ x
+}
+
+macro_rules! demo {
+ ( $output_constraint:tt ) => {
+ {
+ let mut x: isize = 0;
+ let y: isize = 1;
+
+ let mut history: History = vec![];
+ unsafe {
+ asm!("mov ($1), $0"
+ : $output_constraint (*wrap(&mut x, "out", &mut history))
+ : "r"(&wrap(y, "in", &mut history))
+ :: "volatile");
+ }
+ assert_eq!((x,y), (1,1));
+ let b: &[_] = &["out", "in"];
+ assert_eq!(history, b);
+ }
+ }
+}
+
+#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+fn main() {
+ fn out_write_only_expr_then_in_expr() {
+ demo!("=r")
+ }
+
+ fn out_read_write_expr_then_in_expr() {
+ demo!("+r")
+ }
+
+ out_write_only_expr_then_in_expr();
+ out_read_write_expr_then_in_expr();
+}
+
+#[cfg(all(not(target_arch = "x86"), not(target_arch = "x86_64")))]
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+#![feature(fn_traits, unboxed_closures)]
+
+use std::ops::Fn;
+
+trait Response { fn dummy(&self) { } }
+trait Request { fn dummy(&self) { } }
+trait Ingot<R, S> {
+ fn enter(&mut self, _: &mut R, _: &mut S, a: &mut Alloy) -> Status;
+}
+
+#[allow(dead_code)]
+struct HelloWorld;
+
+struct SendFile;
+struct Alloy;
+enum Status {
+ Continue
+}
+
+impl Alloy {
+ fn find<T>(&self) -> Option<T> {
+ None
+ }
+}
+
+impl<'b> Fn<(&'b mut (Response+'b),)> for SendFile {
+ extern "rust-call" fn call(&self, (_res,): (&'b mut (Response+'b),)) {}
+}
+
+impl<'b> FnMut<(&'b mut (Response+'b),)> for SendFile {
+ extern "rust-call" fn call_mut(&mut self, (_res,): (&'b mut (Response+'b),)) {
+ self.call((_res,))
+ }
+}
+
+impl<'b> FnOnce<(&'b mut (Response+'b),)> for SendFile {
+ type Output = ();
+
+ extern "rust-call" fn call_once(self, (_res,): (&'b mut (Response+'b),)) {
+ self.call((_res,))
+ }
+}
+
+impl<Rq: Request, Rs: Response> Ingot<Rq, Rs> for HelloWorld {
+ fn enter(&mut self, _req: &mut Rq, res: &mut Rs, alloy: &mut Alloy) -> Status {
+ let send_file = alloy.find::<SendFile>().unwrap();
+ send_file(res);
+ Status::Continue
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_upper_case_globals)]
+
+// pretty-expanded FIXME #23616
+
+static mut n_mut: usize = 0;
+
+static n: &'static usize = unsafe{ &n_mut };
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+#[derive(Clone)]
+enum Test<'a> {
+ Slice(&'a isize)
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+struct A<'a> {
+ a: &'a i32,
+ b: &'a i32,
+}
+
+impl <'a> A<'a> {
+ fn foo<'b>(&'b self) {
+ A {
+ a: self.a,
+ b: self.b,
+ };
+ }
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+
+trait MatrixRow { fn dummy(&self) { }}
+
+struct Mat;
+
+impl<'a> MatrixRow for &'a Mat {}
+
+struct Rows<M: MatrixRow> {
+ mat: M,
+}
+
+impl<'a> Iterator for Rows<&'a Mat> {
+ type Item = ();
+
+ fn next(&mut self) -> Option<()> {
+ unimplemented!()
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+struct Parser<'a, I, O> {
+ parse: Box<FnMut(I) -> Result<O, String> + 'a>
+}
+
+impl<'a, I: 'a, O: 'a> Parser<'a, I, O> {
+ fn compose<K: 'a>(mut self, mut rhs: Parser<'a, O, K>) -> Parser<'a, I, K> {
+ Parser {
+ parse: Box::new(move |x: I| {
+ match (self.parse)(x) {
+ Ok(r) => (rhs.parse)(r),
+ Err(e) => Err(e)
+ }
+ })
+ }
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+// ignore-cloudabi no std::fs
+
+use std::fs::File;
+use std::io::{self, BufReader, Read};
+
+struct Lexer<R: Read>
+{
+ reader: BufReader<R>,
+}
+
+impl<R: Read> Lexer<R>
+{
+ pub fn new_from_reader(r: R) -> Lexer<R>
+ {
+ Lexer{reader: BufReader::new(r)}
+ }
+
+ pub fn new_from_file(p: &str) -> io::Result<Lexer<File>>
+ {
+ Ok(Lexer::new_from_reader(File::open(p)?))
+ }
+
+ pub fn new_from_str<'a>(s: &'a str) -> Lexer<&'a [u8]>
+ {
+ Lexer::new_from_reader(s.as_bytes())
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(unused_must_use)]
+#[allow(dead_code)]
+fn check(a: &str) {
+ let x = a as *const str;
+ x == x;
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code, warnings)]
+
+static mut x: isize = 3;
+static mut y: isize = unsafe { x };
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+struct A;
+impl Drop for A {
+ fn drop(&mut self) {}
+}
+
+const FOO: A = A;
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+trait Person {
+ type string;
+ fn dummy(&self) { }
+}
+
+struct Someone<P: Person>(std::marker::PhantomData<P>);
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Regression test for #17746
+
+fn main() {}
+
+struct A;
+
+impl A {
+ fn b(&mut self) {
+ self.a()
+ }
+}
+
+trait Foo {
+ fn dummy(&self) {}
+}
+trait Bar {
+ fn a(&self);
+}
+
+impl Foo for A {}
+impl<T> Bar for T where T: Foo {
+ fn a(&self) {}
+}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Test that we can parse where clauses on various forms of tuple
+// structs.
+
+// pretty-expanded FIXME #23616
+
+struct Bar<T>(T) where T: Copy;
+struct Bleh<T, U>(T, U) where T: Copy, U: Sized;
+struct Baz<T> where T: Copy {
+ field: T
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(unused_imports)]
+// These crossed imports should resolve fine, and not block on
+// each other and be reported as unresolved.
+
+mod a {
+ use b::{B};
+ pub use self::inner::A;
+
+ mod inner {
+ pub struct A;
+ }
+}
+
+mod b {
+ use a::{A};
+ pub use self::inner::B;
+
+ mod inner {
+ pub struct B;
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+
+pub trait Indexable<T>: std::ops::Index<usize, Output = T> {
+ fn index2(&self, i: usize) -> &T {
+ &self[i]
+ }
+}
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+pub trait Promisable: Send + Sync {}
+impl<T: Send + Sync> Promisable for T {}
+
+pub fn propagate<'a, T, E, F, G>(mut action: F)
+ -> Box<FnMut(Result<T, E>) -> Result<T, E> + 'a>
+ where
+ T: Promisable + Clone + 'a,
+ E: Promisable + Clone + 'a,
+ F: FnMut(&T) -> Result<T, E> + Send + 'a,
+ G: FnMut(Result<T, E>) -> Result<T, E> + 'a {
+ Box::new(move |result: Result<T, E>| {
+ match result {
+ Ok(ref t) => action(t),
+ Err(ref e) => Err(e.clone()),
+ }
+ })
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+
+// Issue #1821 - Don't recurse trying to typecheck this
+
+
+// pretty-expanded FIXME #23616
+
+enum t {
+ foo(Vec<t>)
+}
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Test that methods in trait impls should override default methods.
+
+trait T {
+ fn foo(&self) -> i32 { 0 }
+}
+
+impl<'a> T + 'a {
+ fn foo(&self) -> i32 { 1 }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+
+// pretty-expanded FIXME #23616
+
+mod a {
+ pub type rust_task = usize;
+ pub mod rustrt {
+ use super::rust_task;
+ extern {
+ pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool;
+ }
+ }
+}
+
+mod b {
+ pub type rust_task = bool;
+ pub mod rustrt {
+ use super::rust_task;
+ extern {
+ pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool;
+ }
+ }
+}
+
+pub fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#[derive(Eq, PartialEq, PartialOrd, Ord)]
+enum Test<'a> {
+ Int(&'a isize),
+ Slice(&'a [u8]),
+}
+
+#[derive(Eq, PartialEq, PartialOrd, Ord)]
+struct Version {
+ vendor_info: &'static str
+}
+
+#[derive(Eq, PartialEq, PartialOrd, Ord)]
+struct Foo(&'static str);
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+trait Tup {
+ type T0;
+ type T1;
+}
+
+impl Tup for isize {
+ type T0 = f32;
+ type T1 = ();
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+pub trait Borrow<Borrowed: ?Sized> {
+ fn borrow(&self) -> &Borrowed;
+}
+
+impl<T: Sized> Borrow<T> for T {
+ fn borrow(&self) -> &T { self }
+}
+
+trait Foo {
+ fn foo(&self, other: &Self);
+}
+
+fn bar<K, Q>(k: &K, q: &Q) where K: Borrow<Q>, Q: Foo {
+ q.foo(k.borrow())
+}
+
+struct MyTree<K>(K);
+
+impl<K> MyTree<K> {
+ // This caused a failure in #18906
+ fn bar<Q>(k: &K, q: &Q) where K: Borrow<Q>, Q: Foo {
+ q.foo(k.borrow())
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+pub trait Foo : Send { }
+
+pub struct MyFoo {
+ children: Vec<Box<Foo>>,
+}
+
+impl Foo for MyFoo { }
+
+pub fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+struct Str([u8]);
+
+#[derive(Clone)]
+struct CharSplits<'a, Sep> {
+ string: &'a Str,
+ sep: Sep,
+ allow_trailing_empty: bool,
+ only_ascii: bool,
+ finished: bool,
+}
+
+fn clone(s: &Str) -> &Str {
+ Clone::clone(&s)
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+pub trait Hasher {
+ type State;
+
+ fn hash<T: Hash<
+ <Self as Hasher>::State
+ >>(&self, value: &T) -> u64;
+}
+
+pub trait Hash<S> {
+ fn hash(&self, state: &mut S);
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// regression test for #19097
+
+struct Foo<T>(T);
+
+impl<'a, T> Foo<&'a T> {
+ fn foo(&self) {}
+}
+impl<'a, T> Foo<&'a mut T> {
+ fn foo(&self) {}
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+pub trait Handler {
+ fn handle(&self, _: &mut String);
+}
+
+impl<F> Handler for F where F: for<'a, 'b> Fn(&'a mut String) {
+ fn handle(&self, st: &mut String) {
+ self(st)
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(unused_imports)]
+#![deny(unused_qualifications)]
+
+use self::A::B;
+
+#[derive(PartialEq)]
+pub enum A {
+ B,
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+trait Trait<Input> {
+ type Output;
+
+ fn method() -> <Self as Trait<Input>>::Output;
+}
+
+impl<T> Trait<T> for () {
+ type Output = ();
+
+ fn method() {}
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(unused_variables)]
+// pretty-expanded FIXME #23616
+
+trait Trait<Input> {
+ type Output;
+
+ fn method(&self, i: Input) -> bool { false }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+trait T {
+ unsafe extern "Rust" fn foo(&self);
+}
+
+impl T for () {
+ unsafe extern "Rust" fn foo(&self) {}
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(unused_variables)]
+use std::any::TypeId;
+use std::rc::Rc;
+
+type Fp<T> = Rc<T>;
+
+struct Engine;
+
+trait Component: 'static {}
+impl Component for Engine {}
+
+trait Env {
+ fn get_component_type_id(&self, type_id: TypeId) -> Option<Fp<Component>>;
+}
+
+impl<'a> Env+'a {
+ fn get_component<T: Component>(&self) -> Option<Fp<T>> {
+ let x = self.get_component_type_id(TypeId::of::<T>());
+ None
+ }
+}
+
+trait Figment {
+ fn init(&mut self, env: &Env);
+}
+
+struct MyFigment;
+
+impl Figment for MyFigment {
+ fn init(&mut self, env: &Env) {
+ let engine = env.get_component::<Engine>();
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+trait Base {
+ fn dummy(&self) { }
+}
+trait AssocA {
+ type X: Base;
+ fn dummy(&self) { }
+}
+trait AssocB {
+ type Y: Base;
+ fn dummy(&self) { }
+}
+impl<T: AssocA> AssocB for T {
+ type Y = <T as AssocA>::X;
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+trait PoolManager {
+ type C;
+ fn dummy(&self) { }
+}
+
+struct InnerPool<M> {
+ manager: M,
+}
+
+impl<M> InnerPool<M> where M: PoolManager {}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+trait PoolManager {
+ type C;
+ fn dummy(&self) { }
+}
+
+struct InnerPool<M: PoolManager> {
+ manager: M,
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(unused_variables)]
+// Test that `<Type as Trait>::Output` and `Self::Output` are accepted as type annotations in let
+// bindings
+
+// pretty-expanded FIXME #23616
+
+trait Int {
+ fn one() -> Self;
+ fn leading_zeros(self) -> usize;
+}
+
+trait Foo {
+ type T : Int;
+
+ fn test(&self) {
+ let r: <Self as Foo>::T = Int::one();
+ let r: Self::T = Int::one();
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+#![feature(fn_traits, unboxed_closures)]
+
+#[allow(dead_code)]
+struct Foo;
+
+impl<'a> Fn<(&'a (),)> for Foo {
+ extern "rust-call" fn call(&self, (_,): (&(),)) {}
+}
+
+impl<'a> FnMut<(&'a (),)> for Foo {
+ extern "rust-call" fn call_mut(&mut self, (_,): (&(),)) {}
+}
+
+impl<'a> FnOnce<(&'a (),)> for Foo {
+ type Output = ();
+
+ extern "rust-call" fn call_once(self, (_,): (&(),)) {}
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// Check that associated types are `Sized`
+
+// pretty-expanded FIXME #23616
+
+trait Trait {
+ type Output;
+
+ fn is_sized(&self) -> Self::Output;
+ fn wasnt_sized(&self) -> Self::Output { loop {} }
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2012-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.
+
+// compile-pass
+#![allow(stable_features)]
+
+// ignore-cloudabi no processes
+// ignore-emscripten no processes
+
+#![feature(os)]
+
+#[cfg(unix)]
+fn main() {
+ use std::process::Command;
+ use std::env;
+ use std::os::unix::prelude::*;
+ use std::ffi::OsStr;
+
+ if env::args().len() == 1 {
+ assert!(Command::new(&env::current_exe().unwrap())
+ .arg(<OsStr as OsStrExt>::from_bytes(b"\xff"))
+ .status().unwrap().success())
+ }
+}
+
+#[cfg(windows)]
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(unused_variables)]
+struct Foo;
+
+impl Foo {
+ fn putc(&self, b: u8) { }
+
+ fn puts(&self, s: &str) {
+ for byte in s.bytes() {
+ self.putc(byte)
+ }
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+#![allow(dead_code)]
+
+trait Foo<T> {
+ fn noop(&self, _: T);
+}
+
+enum Bar<T> { Bla(T) }
+
+struct Baz<'a> {
+ inner: for<'b> Foo<Bar<&'b ()>> + 'a,
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+trait Trait {
+ fn method(self) -> isize;
+}
+
+struct Wrapper<T> {
+ field: T
+}
+
+impl<'a, T> Trait for &'a Wrapper<T> where &'a T: Trait {
+ fn method(self) -> isize {
+ let r: &'a T = &self.field;
+ Trait::method(r); // these should both work
+ r.method()
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(unused_must_use)]
+use std::thread;
+
+fn _foo() {
+ thread::spawn(move || { // no need for -> ()
+ loop {
+ println!("hello");
+ }
+ }).join();
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// test that autoderef of a type like this does not
+// cause compiler to loop. Note that no instances
+// of such a type could ever be constructed.
+
+struct S {
+ x: X,
+ to_str: (),
+}
+
+struct X(Box<S>);
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(unused_imports)]
+#![allow(stable_features)]
+
+// A reduced version of the rustbook ice. The problem this encountered
+// had to do with codegen ignoring binders.
+
+// pretty-expanded FIXME #23616
+// ignore-cloudabi no std::fs
+
+#![feature(os)]
+
+use std::iter;
+use std::os;
+use std::fs::File;
+use std::io::prelude::*;
+use std::env;
+use std::path::Path;
+
+pub fn parse_summary<R: Read>(_: R, _: &Path) {
+ let path_from_root = Path::new("");
+ Path::new(&iter::repeat("../")
+ .take(path_from_root.components().count() - 1)
+ .collect::<String>());
+ }
+
+fn foo() {
+ let cwd = env::current_dir().unwrap();
+ let src = cwd.clone();
+ let summary = File::open(&src.join("SUMMARY.md")).unwrap();
+ let _ = parse_summary(summary, &src);
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+trait T0 {
+ type O;
+ fn dummy(&self) { }
+}
+
+struct S<A>(A);
+impl<A> T0 for S<A> { type O = A; }
+
+trait T1: T0 {
+ // this looks okay but as we see below, `f` is unusable
+ fn m0<F: Fn(<Self as T0>::O) -> bool>(self, f: F) -> bool;
+}
+
+// complains about the bounds on F here not being required by the trait
+impl<A> T1 for S<A> {
+ fn m0<F: Fn(A) -> bool>(self, f: F) -> bool { f(self.0) }
+}
+
+// // complains about mismatched types: <S<A> as T0>::O vs. A
+// impl<A> T1 for S<A>
+// {
+// fn m0<F: Fn(<Self as T0>::O) -> bool>(self, f: F) -> bool { f(self.0) }
+// }
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+trait T0 {
+ type O;
+ fn dummy(&self) { }
+}
+
+struct S<A>(A);
+impl<A> T0 for S<A> { type O = A; }
+
+trait T1: T0 {
+ // this looks okay but as we see below, `f` is unusable
+ fn m0<F: Fn(<Self as T0>::O) -> bool>(self, f: F) -> bool;
+}
+
+// complains about mismatched types: <S<A> as T0>::O vs. A
+impl<A> T1 for S<A>
+{
+ fn m0<F: Fn(<Self as T0>::O) -> bool>(self, f: F) -> bool { f(self.0) }
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+// ignore-cloudabi no std::fs
+
+// Regression test for #20797.
+
+use std::default::Default;
+use std::io;
+use std::fs;
+use std::path::PathBuf;
+
+pub trait PathExtensions {
+ fn is_dir(&self) -> bool { false }
+}
+
+impl PathExtensions for PathBuf {}
+
+/// A strategy for acquiring more subpaths to walk.
+pub trait Strategy {
+ type P: PathExtensions;
+ /// Get additional subpaths from a given path.
+ fn get_more(&self, item: &Self::P) -> io::Result<Vec<Self::P>>;
+ /// Determine whether a path should be walked further.
+ /// This is run against each item from `get_more()`.
+ fn prune(&self, p: &Self::P) -> bool;
+}
+
+/// The basic fully-recursive strategy. Nothing is pruned.
+#[derive(Copy, Clone, Default)]
+pub struct Recursive;
+
+impl Strategy for Recursive {
+ type P = PathBuf;
+ fn get_more(&self, p: &PathBuf) -> io::Result<Vec<PathBuf>> {
+ Ok(fs::read_dir(p).unwrap().map(|s| s.unwrap().path()).collect())
+ }
+
+ fn prune(&self, _: &PathBuf) -> bool { false }
+}
+
+/// A directory walker of `P` using strategy `S`.
+pub struct Subpaths<S: Strategy> {
+ stack: Vec<S::P>,
+ strategy: S,
+}
+
+impl<S: Strategy> Subpaths<S> {
+ /// Create a directory walker with a root path and strategy.
+ pub fn new(p: &S::P, strategy: S) -> io::Result<Subpaths<S>> {
+ let stack = strategy.get_more(p)?;
+ Ok(Subpaths { stack: stack, strategy: strategy })
+ }
+}
+
+impl<S: Default + Strategy> Subpaths<S> {
+ /// Create a directory walker with a root path and a default strategy.
+ pub fn walk(p: &S::P) -> io::Result<Subpaths<S>> {
+ Subpaths::new(p, Default::default())
+ }
+}
+
+impl<S: Default + Strategy> Default for Subpaths<S> {
+ fn default() -> Subpaths<S> {
+ Subpaths { stack: Vec::new(), strategy: Default::default() }
+ }
+}
+
+impl<S: Strategy> Iterator for Subpaths<S> {
+ type Item = S::P;
+ fn next (&mut self) -> Option<S::P> {
+ let mut opt_path = self.stack.pop();
+ while opt_path.is_some() && self.strategy.prune(opt_path.as_ref().unwrap()) {
+ opt_path = self.stack.pop();
+ }
+ match opt_path {
+ Some(path) => {
+ if path.is_dir() {
+ let result = self.strategy.get_more(&path);
+ match result {
+ Ok(dirs) => { self.stack.extend(dirs); },
+ Err(..) => { }
+ }
+ }
+ Some(path)
+ }
+ None => None,
+ }
+ }
+}
+
+fn _foo() {
+ let _walker: Subpaths<Recursive> = Subpaths::walk(&PathBuf::from("/home")).unwrap();
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+pub trait Subscriber {
+ type Input;
+}
+
+pub trait Processor: Subscriber<Input = <Self as Processor>::Input> {
+ type Input;
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+pub trait Trait where Self::Out: std::fmt::Display {
+ type Out;
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(unused_variables)]
+trait Trait<'a> {
+ type A;
+ type B;
+}
+
+fn foo<'a, T: Trait<'a>>(value: T::A) {
+ let new: T::B = unsafe { std::mem::transmute_copy(&value) };
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Regression test for issue #21245. Check that we are able to infer
+// the types in these examples correctly. It used to be that
+// insufficient type propagation caused the type of the iterator to be
+// incorrectly unified with the `*const` type to which it is coerced.
+
+// pretty-expanded FIXME #23616
+
+use std::ptr;
+
+trait IntoIterator {
+ type Iter: Iterator;
+
+ fn into_iter2(self) -> Self::Iter;
+}
+
+impl<I> IntoIterator for I where I: Iterator {
+ type Iter = I;
+
+ fn into_iter2(self) -> I {
+ self
+ }
+}
+
+fn desugared_for_loop_bad<T>(v: Vec<T>) {
+ match IntoIterator::into_iter2(v.iter()) {
+ mut iter => {
+ loop {
+ match ::std::iter::Iterator::next(&mut iter) {
+ ::std::option::Option::Some(x) => {
+ unsafe { ptr::read(x); }
+ },
+ ::std::option::Option::None => break
+ }
+ }
+ }
+ }
+}
+
+fn desugared_for_loop_good<T>(v: Vec<T>) {
+ match v.iter().into_iter() {
+ mut iter => {
+ loop {
+ match ::std::iter::Iterator::next(&mut iter) {
+ ::std::option::Option::Some(x) => {
+ unsafe { ptr::read(x); }
+ },
+ ::std::option::Option::None => break
+ }
+ }
+ }
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+#![no_implicit_prelude]
+
+trait Iterator {
+ type Item;
+ fn dummy(&self) { }
+}
+
+impl<'a, T> Iterator for &'a mut (Iterator<Item=T> + 'a) {
+ type Item = T;
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+#[derive(Hash)]
+struct Foo {
+ a: Vec<bool>,
+ b: (bool, bool),
+ c: [bool; 2],
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Test that the requirement (in `Bar`) that `T::Bar : 'static` does
+// not wind up propagating to `T`.
+
+// pretty-expanded FIXME #23616
+
+pub trait Foo {
+ type Bar;
+
+ fn foo(&self) -> Self;
+}
+
+pub struct Static<T:'static>(T);
+
+struct Bar<T:Foo>
+ where T::Bar : 'static
+{
+ x: Static<Option<T::Bar>>
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_upper_case_globals)]
+
+extern crate core;
+use core::marker::Sync;
+
+static SARRAY: [i32; 1] = [11];
+
+struct MyStruct {
+ pub arr: *const [i32],
+}
+unsafe impl Sync for MyStruct {}
+
+static mystruct: MyStruct = MyStruct {
+ arr: &SARRAY
+};
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(unused_variables)]
+
+struct Index;
+
+impl Index {
+ fn new() -> Self { Index }
+}
+
+fn user() {
+ let new = Index::new;
+
+ fn inner() {
+ let index = Index::new();
+ }
+
+ let index2 = new();
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(stable_features)]
+
+#![feature(cfg_target_feature)]
+
+#[cfg(any(not(target_arch = "x86"), target_feature = "sse2"))]
+fn main() {
+ if let Ok(x) = "3.1415".parse::<f64>() {
+ assert_eq!(false, x <= 0.0);
+ }
+ if let Ok(x) = "3.1415".parse::<f64>() {
+ assert_eq!(3.1415, x + 0.0);
+ }
+ if let Ok(mut x) = "3.1415".parse::<f64>() {
+ assert_eq!(8.1415, { x += 5.0; x });
+ }
+}
+
+#[cfg(all(target_arch = "x86", not(target_feature = "sse2")))]
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Regression test for #21726: an issue arose around the rules for
+// subtyping of projection types that resulted in an unconstrained
+// region, yielding region inference failures.
+
+// pretty-expanded FIXME #23616
+
+fn main() { }
+
+fn foo<'a>(s: &'a str) {
+ let b: B<()> = B::new(s, ());
+ b.get_short();
+}
+
+trait IntoRef<'a> {
+ type T: Clone;
+ fn into_ref(self, _: &'a str) -> Self::T;
+}
+
+impl<'a> IntoRef<'a> for () {
+ type T = &'a str;
+ fn into_ref(self, s: &'a str) -> &'a str {
+ s
+ }
+}
+
+struct B<'a, P: IntoRef<'a>>(P::T);
+
+impl<'a, P: IntoRef<'a>> B<'a, P> {
+ fn new(s: &'a str, i: P) -> B<'a, P> {
+ B(i.into_ref(s))
+ }
+
+ fn get_short(&self) -> P::T {
+ self.0.clone()
+ }
+}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_upper_case_globals)]
+
+// pretty-expanded FIXME #23616
+
+static foo: [usize; 3] = [1, 2, 3];
+
+static slice_1: &'static [usize] = &foo;
+static slice_2: &'static [usize] = &foo;
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+pub trait LineFormatter<'a> {
+ type Iter: Iterator<Item=&'a str> + 'a;
+ fn iter(&'a self, line: &'a str) -> Self::Iter;
+
+ fn dimensions(&'a self, line: &'a str) {
+ let iter: Self::Iter = self.iter(line);
+ <_ as IntoIterator>::into_iter(iter);
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(type_alias_bounds)]
+
+// pretty-expanded FIXME #23616
+
+use std::marker::PhantomData;
+
+pub struct Handle<T, I>(T, I);
+
+impl<T, I> Handle<T, I> {
+ pub fn get_info(&self) -> &I {
+ let Handle(_, ref info) = *self;
+ info
+ }
+}
+
+pub struct BufferHandle<D: Device, T> {
+ raw: RawBufferHandle<D>,
+ _marker: PhantomData<T>,
+}
+
+impl<D: Device, T> BufferHandle<D, T> {
+ pub fn get_info(&self) -> &String {
+ self.raw.get_info()
+ }
+}
+
+pub type RawBufferHandle<D: Device> = Handle<<D as Device>::Buffer, String>;
+
+pub trait Device {
+ type Buffer;
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+trait A<T: A<T>> {}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(type_alias_bounds)]
+
+type Foo<T> where T: Copy = Box<T>;
+
+fn main(){}
--- /dev/null
+// 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.
+
+// compile-pass
+// This test is reduced from libsyntax. It is just checking that we
+// can successfully deal with a "deep" structure, which the drop-check
+// was hitting a recursion limit on at one point.
+
+// pretty-expanded FIXME #23616
+
+#![allow(non_camel_case_types)]
+
+pub fn noop_fold_impl_item() -> SmallVector<ImplItem> {
+ loop { }
+}
+
+pub struct SmallVector<T>(P<T>);
+pub struct ImplItem(P<S01_Method>);
+
+struct P<T>(Box<T>);
+
+struct S01_Method(P<S02_Generics>);
+struct S02_Generics(P<S03_TyParam>);
+struct S03_TyParam(P<S04_TyParamBound>);
+struct S04_TyParamBound(S05_PolyTraitRef);
+struct S05_PolyTraitRef(S06_TraitRef);
+struct S06_TraitRef(S07_Path);
+struct S07_Path(Vec<S08_PathSegment>);
+struct S08_PathSegment(S09_GenericArgs);
+struct S09_GenericArgs(P<S10_ParenthesizedParameterData>);
+struct S10_ParenthesizedParameterData(Option<P<S11_Ty>>);
+struct S11_Ty(P<S12_Expr>);
+struct S12_Expr(P<S13_Block>);
+struct S13_Block(Vec<P<S14_Stmt>>);
+struct S14_Stmt(P<S15_Decl>);
+struct S15_Decl(P<S16_Local>);
+struct S16_Local(P<S17_Pat>);
+struct S17_Pat(P<S18_Mac>);
+struct S18_Mac(Vec<P<S19_TokenTree>>);
+struct S19_TokenTree(P<S20_Token>);
+struct S20_Token(P<S21_Nonterminal>);
+struct S21_Nonterminal(P<S22_Item>);
+struct S22_Item(P<S23_EnumDef>);
+struct S23_EnumDef(Vec<P<S24_Variant>>);
+struct S24_Variant(P<S25_VariantKind>);
+struct S25_VariantKind(P<S26_StructDef>);
+struct S26_StructDef(Vec<P<S27_StructField>>);
+struct S27_StructField(P<S28_StructFieldKind>);
+struct S28_StructFieldKind;
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(unused_variables)]
+use std::collections::HashMap;
+use std::collections::hash_map::Entry::Vacant;
+
+pub fn foo() {
+ type F = Box<Fn(&()) + 'static>;
+ let mut map: HashMap<(), F> = HashMap::new();
+ let x: &mut F = match map.entry(()) {
+ Vacant(_) => unimplemented!(),
+ _ => unimplemented!()
+ };
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+trait Test {}
+
+macro_rules! test {
+( $($name:ident)+) => (
+ impl<$($name: Test),*> Test for ($($name,)*) {
+ }
+)
+}
+
+test!(A B C);
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#[allow(dead_code)]
+static X: &'static str = &*"";
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+
+
+trait clam<A> {
+ fn get(self) -> A;
+}
+
+struct foo<A> {
+ x: A,
+}
+
+impl<A> foo<A> {
+ pub fn bar<B,C:clam<A>>(&self, _c: C) -> B {
+ panic!();
+ }
+}
+
+fn foo<A>(b: A) -> foo<A> {
+ foo {
+ x: b
+ }
+}
+
+pub fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(non_camel_case_types)]
+
+// pretty-expanded FIXME #23616
+
+trait clam<A> { fn get(self) -> A; }
+trait foo<A> {
+ fn bar<B,C:clam<A>>(&self, c: C) -> B;
+}
+
+pub fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+
+// Testing that the B's are resolved
+
+
+trait clam<A> { fn get(self) -> A; }
+
+struct foo(isize);
+
+impl foo {
+ pub fn bar<B,C:clam<B>>(&self, _c: C) -> B { panic!(); }
+}
+
+pub fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+trait Inner {
+ type T;
+}
+
+impl<'a> Inner for &'a i32 {
+ type T = i32;
+}
+
+fn f<'a>(x: &'a i32) -> <&'a i32 as Inner>::T {
+ *x
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+use std::marker::PhantomData;
+
+pub struct UnionedKeys<'a,K>
+ where K: UnifyKey + 'a
+{
+ table: &'a mut UnificationTable<K>,
+ root_key: K,
+ stack: Vec<K>,
+}
+
+pub trait UnifyKey {
+ type Value;
+}
+
+pub struct UnificationTable<K:UnifyKey> {
+ values: Delegate<K>,
+}
+
+pub struct Delegate<K>(PhantomData<K>);
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// compiler-flags: -g
+
+pub struct Dst {
+ pub a: (),
+ pub b: (),
+ pub data: [u8],
+}
+
+pub unsafe fn borrow(bytes: &[u8]) -> &Dst {
+ let dst: &Dst = std::mem::transmute((bytes.as_ptr(), bytes.len()));
+ dst
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![feature(core_intrinsics)]
+#![allow(warnings)]
+
+use std::intrinsics;
+
+#[derive(Copy, Clone)]
+struct Wrap(i64);
+
+// These volatile intrinsics used to cause an ICE
+
+unsafe fn test_bool(p: &mut bool, v: bool) {
+ intrinsics::volatile_load(p);
+ intrinsics::volatile_store(p, v);
+}
+
+unsafe fn test_immediate_fca(p: &mut Wrap, v: Wrap) {
+ intrinsics::volatile_load(p);
+ intrinsics::volatile_store(p, v);
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#[derive(PartialEq)]
+struct Slice { slice: [u8] }
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Regression test for #24085. Errors were occurring in region
+// inference due to the requirement that `'a:b'`, which was getting
+// incorrectly codegened in connection with the closure below.
+
+#[derive(Copy,Clone)]
+struct Path<'a:'b, 'b> {
+ x: &'a i32,
+ tail: Option<&'b Path<'a, 'b>>
+}
+
+#[allow(dead_code, unconditional_recursion)]
+fn foo<'a,'b,F>(p: Path<'a, 'b>, mut f: F)
+ where F: for<'c> FnMut(Path<'a, 'c>) {
+ foo(p, |x| f(x))
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#[derive(Copy,Clone)]
+struct Functions {
+ a: fn(u32) -> u32,
+ b: extern "C" fn(u32) -> u32,
+ c: unsafe fn(u32) -> u32,
+ d: unsafe extern "C" fn(u32) -> u32
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// This resulted in an ICE. Test for future-proofing
+// Issue #24227
+
+#![allow(unused)]
+
+struct Foo<'a> {
+ x: &'a u8
+}
+
+impl<'a> Foo<'a> {
+ fn foo() {
+ let mut tmp: Self;
+ }
+
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+
+struct Foo;
+
+impl Foo {
+ fn new() -> Self { Foo }
+ fn bar() { Self::new(); }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(unused_attributes)]
+// compile-flags:--cfg set1
+
+#![cfg_attr(set1, feature(custom_attribute))]
+
+#![foobar]
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+
+// pretty-expanded FIXME #23616
+
+struct socket {
+ sock: isize,
+
+}
+
+impl Drop for socket {
+ fn drop(&mut self) {}
+}
+
+impl socket {
+ pub fn set_identity(&self) {
+ closure(|| setsockopt_bytes(self.sock.clone()))
+ }
+}
+
+fn socket() -> socket {
+ socket {
+ sock: 1
+ }
+}
+
+fn closure<F>(f: F) where F: FnOnce() { f() }
+
+fn setsockopt_bytes(_sock: isize) { }
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+
+
+// pretty-expanded FIXME #23616
+
+struct font<'a> {
+ fontbuf: &'a Vec<u8> ,
+}
+
+impl<'a> font<'a> {
+ pub fn buf(&self) -> &'a Vec<u8> {
+ self.fontbuf
+ }
+}
+
+fn font(fontbuf: &Vec<u8> ) -> font {
+ font {
+ fontbuf: fontbuf
+ }
+}
+
+pub fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_upper_case_globals)]
+
+const x: &'static Fn() = &|| println!("ICE here");
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#[derive(Debug)]
+struct Row<T>([T]);
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_upper_case_globals)]
+
+
+trait HasNumber<T> {
+ const Number: usize;
+}
+
+enum One {}
+enum Two {}
+
+enum Foo {}
+
+impl<T> HasNumber<T> for One {
+ const Number: usize = 1;
+}
+
+impl<T> HasNumber<T> for Two {
+ const Number: usize = 2;
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Tests that impls are allowed to have looser, more permissive bounds
+// than the traits require.
+
+
+trait A {
+ fn b<C:Sync,D>(&self, x: C) -> C;
+}
+
+struct E {
+ f: isize
+}
+
+impl A for E {
+ fn b<F,G>(&self, _x: F) -> F { panic!() }
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+use std::ops::{Deref, DerefMut};
+
+struct Foo;
+
+impl Foo {
+ fn foo_mut(&mut self) {}
+}
+
+struct Bar(Foo);
+
+impl Deref for Bar {
+ type Target = Foo;
+
+ fn deref(&self) -> &Foo {
+ &self.0
+ }
+}
+
+impl DerefMut for Bar {
+ fn deref_mut(&mut self) -> &mut Foo {
+ &mut self.0
+ }
+}
+
+fn test(mut bar: Box<Bar>) {
+ bar.foo_mut();
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![deny(unused_attributes)]
+
+#[repr(C)]
+#[repr(packed)]
+pub struct Foo;
+
+#[repr(packed)]
+#[repr(C)]
+pub struct Bar;
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+pub struct Foo {
+ x: isize,
+ y: isize
+}
+
+impl Foo {
+ pub extern fn foo_new() -> Foo {
+ Foo { x: 21, y: 33 }
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+use std::cell::RefCell;
+use std::rc::Rc;
+
+pub struct Callbacks {
+ callbacks: Vec<Rc<RefCell<FnMut(i32)>>>,
+}
+
+impl Callbacks {
+ pub fn register<F: FnMut(i32)+'static>(&mut self, callback: F) {
+ self.callbacks.push(Rc::new(RefCell::new(callback)));
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+pub trait Trait<'a> {
+ type T;
+ type U;
+ fn foo(&self, s: &'a ()) -> &'a ();
+}
+
+impl<'a> Trait<'a> for () {
+ type T = &'a ();
+ type U = Self::T;
+
+ fn foo(&self, s: &'a ()) -> &'a () {
+ let t: Self::T = s; t
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_snake_case)]
+
+// pretty-expanded FIXME #23616
+
+struct CMap<'a> {
+ buf: &'a [u8],
+}
+
+fn CMap(buf: &[u8]) -> CMap {
+ CMap {
+ buf: buf
+ }
+}
+
+pub fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+// Regression test for issue #27583. Unclear how useful this will be
+// going forward, since the issue in question was EXTREMELY sensitive
+// to compiler internals (like the precise numbering of nodes), but
+// what the hey.
+
+#![allow(warnings)]
+
+use std::cell::Cell;
+use std::marker::PhantomData;
+
+pub trait Delegate<'tcx> { }
+
+pub struct InferCtxt<'a, 'tcx: 'a> {
+ x: PhantomData<&'a Cell<&'tcx ()>>
+}
+
+pub struct MemCategorizationContext<'t, 'a: 't, 'tcx : 'a> {
+ x: &'t InferCtxt<'a, 'tcx>,
+}
+
+pub struct ExprUseVisitor<'d, 't, 'a: 't, 'tcx:'a+'d> {
+ typer: &'t InferCtxt<'a, 'tcx>,
+ mc: MemCategorizationContext<'t, 'a, 'tcx>,
+ delegate: &'d mut (Delegate<'tcx>+'d),
+}
+
+impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
+ pub fn new(delegate: &'d mut Delegate<'tcx>,
+ typer: &'t InferCtxt<'a, 'tcx>)
+ -> ExprUseVisitor<'d,'t,'a,'tcx>
+ {
+ ExprUseVisitor {
+ typer: typer,
+ mc: MemCategorizationContext::new(typer),
+ delegate: delegate,
+ }
+ }
+}
+
+impl<'t, 'a,'tcx> MemCategorizationContext<'t, 'a, 'tcx> {
+ pub fn new(typer: &'t InferCtxt<'a, 'tcx>) -> MemCategorizationContext<'t, 'a, 'tcx> {
+ MemCategorizationContext { x: typer }
+ }
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(unused_assignments)]
+#![allow(unused_variables)]
+// Test that a field can have the same name in different variants
+// of an enum
+
+pub enum Foo {
+ X { foo: u32 },
+ Y { foo: u32 }
+}
+
+pub fn foo(mut x: Foo) {
+ let mut y = None;
+ let mut z = None;
+ if let Foo::X { ref foo } = x {
+ z = Some(foo);
+ }
+ if let Foo::Y { ref mut foo } = x {
+ y = Some(foo);
+ }
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2012-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.
+
+// compile-pass
+#![allow(dead_code)]
+// Minimized version of issue-2804.rs. Both check that callee IDs don't
+// clobber the previous node ID in a macro expr
+
+use std::collections::HashMap;
+
+fn add_interfaces(managed_ip: String, device: HashMap<String, isize>) {
+ println!("{}, {}", managed_ip, device["interfaces"]);
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+use std::rc::Rc;
+
+fn test1() -> Rc<for<'a> Fn(&'a usize) + 'static> {
+ if let Some(_) = Some(1) {
+ loop{}
+ } else {
+ loop{}
+ }
+}
+
+fn test2() -> *mut (for<'a> Fn(&'a usize) + 'static) {
+ if let Some(_) = Some(1) {
+ loop{}
+ } else {
+ loop{}
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
+struct Array<T> {
+ f00: [T; 00],
+ f01: [T; 01],
+ f02: [T; 02],
+ f03: [T; 03],
+ f04: [T; 04],
+ f05: [T; 05],
+ f06: [T; 06],
+ f07: [T; 07],
+ f08: [T; 08],
+ f09: [T; 09],
+ f10: [T; 10],
+ f11: [T; 11],
+ f12: [T; 12],
+ f13: [T; 13],
+ f14: [T; 14],
+ f15: [T; 15],
+ f16: [T; 16],
+ f17: [T; 17],
+ f18: [T; 18],
+ f19: [T; 19],
+ f20: [T; 20],
+ f21: [T; 21],
+ f22: [T; 22],
+ f23: [T; 23],
+ f24: [T; 24],
+ f25: [T; 25],
+ f26: [T; 26],
+ f27: [T; 27],
+ f28: [T; 28],
+ f29: [T; 29],
+ f30: [T; 30],
+ f31: [T; 31],
+ f32: [T; 32],
+}
+
+// FIXME(#44580): merge with `Array` once `[T; N]: Clone` where `T: Clone`
+#[derive(Clone, Copy)]
+struct CopyArray<T: Copy> {
+ f00: [T; 00],
+ f01: [T; 01],
+ f02: [T; 02],
+ f03: [T; 03],
+ f04: [T; 04],
+ f05: [T; 05],
+ f06: [T; 06],
+ f07: [T; 07],
+ f08: [T; 08],
+ f09: [T; 09],
+ f10: [T; 10],
+ f11: [T; 11],
+ f12: [T; 12],
+ f13: [T; 13],
+ f14: [T; 14],
+ f15: [T; 15],
+ f16: [T; 16],
+ f17: [T; 17],
+ f18: [T; 18],
+ f19: [T; 19],
+ f20: [T; 20],
+ f21: [T; 21],
+ f22: [T; 22],
+ f23: [T; 23],
+ f24: [T; 24],
+ f25: [T; 25],
+ f26: [T; 26],
+ f27: [T; 27],
+ f28: [T; 28],
+ f29: [T; 29],
+ f30: [T; 30],
+ f31: [T; 31],
+ f32: [T; 32],
+}
+
+#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+struct Fn<A, B, C, D, E, F, G, H, I, J, K, L> {
+ f00: fn(),
+ f01: fn(A),
+ f02: fn(A, B),
+ f03: fn(A, B, C),
+ f04: fn(A, B, C, D),
+ f05: fn(A, B, C, D, E),
+ f06: fn(A, B, C, D, E, F),
+ f07: fn(A, B, C, D, E, F, G),
+ f08: fn(A, B, C, D, E, F, G, H),
+ f09: fn(A, B, C, D, E, F, G, H, I),
+ f10: fn(A, B, C, D, E, F, G, H, I, J),
+ f11: fn(A, B, C, D, E, F, G, H, I, J, K),
+ f12: fn(A, B, C, D, E, F, G, H, I, J, K, L),
+}
+
+#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
+struct Tuple<A, B, C, D, E, F, G, H, I, J, K, L> {
+ f00: (),
+ f01: (A),
+ f02: (A, B),
+ f03: (A, B, C),
+ f04: (A, B, C, D),
+ f05: (A, B, C, D, E),
+ f06: (A, B, C, D, E, F),
+ f07: (A, B, C, D, E, F, G),
+ f08: (A, B, C, D, E, F, G, H),
+ f09: (A, B, C, D, E, F, G, H, I),
+ f10: (A, B, C, D, E, F, G, H, I, J),
+ f11: (A, B, C, D, E, F, G, H, I, J, K),
+ f12: (A, B, C, D, E, F, G, H, I, J, K, L),
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// #28600 ICE: pub extern fn with parameter type &str inside struct impl
+
+struct Test;
+
+impl Test {
+ #[allow(dead_code)]
+ #[allow(unused_variables)]
+ pub extern fn test(val: &str) {
+
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![feature(min_const_fn)]
+
+fn main() {}
+
+const fn size_ofs(_: usize) {}
+const fn size_ofs2(_foo: usize) {}
--- /dev/null
+// 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.
+
+// compile-pass
+// Regression test for #28871. The problem is that rustc encountered
+// two ways to project, one from a where clause and one from the where
+// clauses on the trait definition. (In fact, in this case, the where
+// clauses originated from the trait definition as well.) The true
+// cause of the error is that the trait definition where clauses are
+// not being normalized, and hence the two sources are considered in
+// conflict, and not a duplicate. Hacky solution is to prefer where
+// clauses over the data found in the trait definition.
+
+trait T {
+ type T;
+}
+
+struct S;
+impl T for S {
+ type T = S;
+}
+
+trait T2 {
+ type T: Iterator<Item=<S as T>::T>;
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+pub type Session = i32;
+pub struct StreamParser<'a, T> {
+ _tokens: T,
+ _session: &'a mut Session,
+}
+
+impl<'a, T> StreamParser<'a, T> {
+ pub fn thing(&mut self) -> bool { true }
+}
+
+pub fn parse_stream<T: Iterator<Item=i32>, U, F>(
+ _session: &mut Session, _tokens: T, _f: F) -> U
+ where F: Fn(&mut StreamParser<T>) -> U { panic!(); }
+
+pub fn thing(session: &mut Session) {
+ let mut stream = vec![1, 2, 3].into_iter();
+
+ let _b = parse_stream(session,
+ stream.by_ref(),
+ // replacing the above with the following fixes it
+ //&mut stream,
+ |p| p.thing());
+
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+pub struct Xyz<'a, V> {
+ pub v: (V, &'a u32),
+}
+
+pub fn eq<'a, 's, 't, V>(this: &'s Xyz<'a, V>, other: &'t Xyz<'a, V>) -> bool
+ where V: PartialEq {
+ this.v == other.v
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#[derive(Debug)]
+struct Message<'a, P: 'a = &'a [u8]> {
+ header: &'a [u8],
+ payload: P,
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// This test ensures that each pointer type `P<X>` is covariant in `X`.
+
+use std::rc::Rc;
+use std::sync::Arc;
+
+fn a<'r>(x: Box<&'static str>) -> Box<&'r str> {
+ x
+}
+
+fn b<'r, 'w>(x: &'w &'static str) -> &'w &'r str {
+ x
+}
+
+fn c<'r>(x: Arc<&'static str>) -> Arc<&'r str> {
+ x
+}
+
+fn d<'r>(x: Rc<&'static str>) -> Rc<&'r str> {
+ x
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2012-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.
+
+// compile-pass
+#![allow(unused_must_use)]
+#![allow(dead_code)]
+#![allow(unused_mut)]
+#![allow(non_camel_case_types)]
+
+// Map representation
+
+use std::fmt;
+use std::io::prelude::*;
+use square::{bot, wall, rock, lambda, closed_lift, open_lift, earth, empty};
+
+enum square {
+ bot,
+ wall,
+ rock,
+ lambda,
+ closed_lift,
+ open_lift,
+ earth,
+ empty
+}
+
+impl fmt::Debug for square {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "{}", match *self {
+ bot => { "R".to_string() }
+ wall => { "#".to_string() }
+ rock => { "*".to_string() }
+ lambda => { "\\".to_string() }
+ closed_lift => { "L".to_string() }
+ open_lift => { "O".to_string() }
+ earth => { ".".to_string() }
+ empty => { " ".to_string() }
+ })
+ }
+}
+
+fn square_from_char(c: char) -> square {
+ match c {
+ 'R' => { bot }
+ '#' => { wall }
+ '*' => { rock }
+ '\\' => { lambda }
+ 'L' => { closed_lift }
+ 'O' => { open_lift }
+ '.' => { earth }
+ ' ' => { empty }
+ _ => {
+ println!("invalid square: {}", c);
+ panic!()
+ }
+ }
+}
+
+fn read_board_grid<rdr:'static + Read>(mut input: rdr)
+ -> Vec<Vec<square>> {
+ let mut input: &mut Read = &mut input;
+ let mut grid = Vec::new();
+ let mut line = [0; 10];
+ input.read(&mut line);
+ let mut row = Vec::new();
+ for c in &line {
+ row.push(square_from_char(*c as char))
+ }
+ grid.push(row);
+ let width = grid[0].len();
+ for row in &grid { assert_eq!(row.len(), width) }
+ grid
+}
+
+mod test {
+ #[test]
+ pub fn trivial_to_string() {
+ assert_eq!(lambda.to_string(), "\\")
+ }
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+pub struct Chan;
+pub struct ChanSelect<'c, T> {
+ chans: Vec<(&'c Chan, T)>,
+}
+impl<'c, T> ChanSelect<'c, T> {
+ pub fn add_recv_ret(&mut self, chan: &'c Chan, ret: T)
+ {
+ self.chans.push((chan, ret));
+ }
+}
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_upper_case_globals)]
+
+fn ret() -> u32 {
+ static x: u32 = 10;
+ x & if true { 10u32 } else { 20u32 } & x
+}
+
+fn ret2() -> &'static u32 {
+ static x: u32 = 10;
+ if true { 10u32; } else { 20u32; }
+ &x
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+struct S([u8; { struct Z; 0 }]);
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![feature(optin_builtin_traits)]
+
+auto trait NotSame {}
+
+impl<A> !NotSame for (A, A) {}
+
+trait OneOfEach {}
+
+impl<A> OneOfEach for (A,) {}
+
+impl<A, B> OneOfEach for (A, B)
+where
+ (B,): OneOfEach,
+ (A, B): NotSame,
+{
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#[derive(Debug)]
+pub struct Config {
+ pub name: String,
+ pub cluster: String,
+ pub debug_none: String,
+ pub debug_lockdep: String,
+ pub debug_context: String,
+ pub debug_crush: String,
+ pub debug_mds: String,
+ pub debug_mds_balancer: String,
+ pub debug_mds_locker: String,
+ pub debug_mds_log: String,
+ pub debug_mds_log_expire: String,
+ pub debug_mds_migrator: String,
+ pub debug_buffer: String,
+ pub debug_timer: String,
+ pub debug_filer: String,
+ pub debug_striper: String,
+ pub debug_objecter: String,
+ pub debug_rados: String,
+ pub debug_rbd: String,
+ pub debug_journaler: String,
+ pub debug_objectcacher: String,
+ pub debug_client: String,
+ pub debug_osd: String,
+ pub debug_optracker: String,
+ pub debug_objclass: String,
+ pub debug_filestore: String,
+ pub debug_keyvaluestore: String,
+ pub debug_journal: String,
+ pub debug_ms: String,
+ pub debug_mon: String,
+ pub debug_monc: String,
+ pub debug_paxos: String,
+ pub debug_tp: String,
+ pub debug_auth: String,
+ pub debug_crypto: String,
+ pub debug_finisher: String,
+ pub debug_heartbeatmap: String,
+ pub debug_perfcounter: String,
+ pub debug_rgw: String,
+ pub debug_civetweb: String,
+ pub debug_javaclient: String,
+ pub debug_asok: String,
+ pub debug_throttle: String,
+ pub host: String,
+ pub fsid: String,
+ pub public_addr: String,
+ pub cluster_addr: String,
+ pub public_network: String,
+ pub cluster_network: String,
+ pub num_client: String,
+ pub monmap: String,
+ pub mon_host: String,
+ pub lockdep: String,
+ pub run_dir: String,
+ pub admin_socket: String,
+ pub daemonize: String,
+ pub pid_file: String,
+ pub chdir: String,
+ pub max_open_files: String,
+ pub restapi_log_level: String,
+ pub restapi_base_url: String,
+ pub fatal_signal_handlers: String,
+ pub log_file: String,
+ pub log_max_new: String,
+ pub log_max_recent: String,
+ pub log_to_stderr: String,
+ pub err_to_stderr: String,
+ pub log_to_syslog: String,
+ pub err_to_syslog: String,
+ pub log_flush_on_exit: String,
+ pub log_stop_at_utilization: String,
+ pub clog_to_monitors: String,
+ pub clog_to_syslog: String,
+ pub clog_to_syslog_level: String,
+ pub clog_to_syslog_facility: String,
+ pub mon_cluster_log_to_syslog: String,
+ pub mon_cluster_log_to_syslog_level: String,
+ pub mon_cluster_log_to_syslog_facility: String,
+ pub mon_cluster_log_file: String,
+ pub mon_cluster_log_file_level: String,
+ pub key: String,
+ pub keyfile: String,
+ pub keyring: String,
+ pub heartbeat_interval: String,
+ pub heartbeat_file: String,
+ pub heartbeat_inject_failure: String,
+ pub perf: String,
+ pub ms_tcp_nodelay: String,
+ pub ms_tcp_rcvbuf: String,
+ pub ms_initial_backoff: String,
+ pub ms_max_backoff: String,
+ pub ms_nocrc: String,
+ pub ms_die_on_bad_msg: String,
+ pub ms_die_on_unhandled_msg: String,
+ pub ms_die_on_old_message: String,
+ pub ms_dispatch_throttle_bytes: String,
+ pub ms_bind_ipv6: String,
+ pub ms_bind_port_min: String,
+ pub ms_bind_port_max: String,
+ pub ms_rwthread_stack_bytes: String,
+ pub ms_tcp_read_timeout: String,
+ pub ms_pq_max_tokens_per_priority: String,
+ pub ms_pq_min_cost: String,
+ pub ms_inject_socket_failures: String,
+ pub ms_inject_delay_type: String,
+ pub ms_inject_delay_msg_type: String,
+ pub ms_inject_delay_max: String,
+ pub ms_inject_delay_probability: String,
+ pub ms_inject_internal_delays: String,
+ pub ms_dump_on_send: String,
+ pub inject_early_sigterm: String,
+ pub mon_data: String,
+ pub mon_initial_members: String,
+ pub mon_sync_fs_threshold: String,
+ pub mon_compact_on_start: String,
+ pub mon_compact_on_bootstrap: String,
+ pub mon_compact_on_trim: String,
+ pub mon_tick_interval: String,
+ pub mon_subscribe_interval: String,
+ pub mon_delta_reset_interval: String,
+ pub mon_osd_laggy_halflife: String,
+ pub mon_osd_laggy_weight: String,
+ pub mon_osd_adjust_heartbeat_grace: String,
+ pub mon_osd_adjust_down_out_interval: String,
+ pub mon_osd_auto_mark_in: String,
+ pub mon_osd_auto_mark_auto_out_in: String,
+ pub mon_osd_auto_mark_new_in: String,
+ pub mon_osd_down_out_interval: String,
+ pub mon_osd_down_out_subtree_limit: String,
+ pub mon_osd_min_up_ratio: String,
+ pub mon_osd_min_in_ratio: String,
+ pub mon_osd_max_op_age: String,
+ pub mon_osd_max_split_count: String,
+ pub mon_osd_allow_primary_temp: String,
+ pub mon_osd_allow_primary_affinity: String,
+ pub mon_stat_smooth_intervals: String,
+ pub mon_lease: String,
+ pub mon_lease_renew_interval: String,
+ pub mon_lease_ack_timeout: String,
+ pub mon_clock_drift_allowed: String,
+ pub mon_clock_drift_warn_backoff: String,
+ pub mon_timecheck_interval: String,
+ pub mon_accept_timeout: String,
+ pub mon_pg_create_interval: String,
+ pub mon_pg_stuck_threshold: String,
+ pub mon_pg_warn_min_per_osd: String,
+ pub mon_pg_warn_max_object_skew: String,
+ pub mon_pg_warn_min_objects: String,
+ pub mon_pg_warn_min_pool_objects: String,
+ pub mon_cache_target_full_warn_ratio: String,
+ pub mon_osd_full_ratio: String,
+ pub mon_osd_nearfull_ratio: String,
+ pub mon_globalid_prealloc: String,
+ pub mon_osd_report_timeout: String,
+ pub mon_force_standby_active: String,
+ pub mon_warn_on_old_mons: String,
+ pub mon_warn_on_legacy_crush_tunables: String,
+ pub mon_warn_on_osd_down_out_interval_zero: String,
+ pub mon_warn_on_cache_pools_without_hit_sets: String,
+ pub mon_min_osdmap_epochs: String,
+ pub mon_max_pgmap_epochs: String,
+ pub mon_max_log_epochs: String,
+ pub mon_max_mdsmap_epochs: String,
+ pub mon_max_osd: String,
+ pub mon_probe_timeout: String,
+ pub mon_slurp_timeout: String,
+ pub mon_slurp_bytes: String,
+ pub mon_client_bytes: String,
+ pub mon_daemon_bytes: String,
+ pub mon_max_log_entries_per_event: String,
+ pub mon_health_data_update_interval: String,
+ pub mon_data_avail_crit: String,
+ pub mon_data_avail_warn: String,
+ pub mon_config_key_max_entry_size: String,
+ pub mon_sync_timeout: String,
+ pub mon_sync_max_payload_size: String,
+ pub mon_sync_debug: String,
+ pub mon_sync_debug_leader: String,
+ pub mon_sync_debug_provider: String,
+ pub mon_sync_debug_provider_fallback: String,
+ pub mon_inject_sync_get_chunk_delay: String,
+ pub mon_osd_min_down_reporters: String,
+ pub mon_osd_min_down_reports: String,
+ pub mon_osd_force_trim_to: String,
+ pub mon_mds_force_trim_to: String,
+ pub mon_advanced_debug_mode: String,
+ pub mon_debug_dump_transactions: String,
+ pub mon_debug_dump_location: String,
+ pub mon_sync_provider_kill_at: String,
+ pub mon_sync_requester_kill_at: String,
+ pub mon_leveldb_write_buffer_size: String,
+ pub mon_leveldb_cache_size: String,
+ pub mon_leveldb_block_size: String,
+ pub mon_leveldb_bloom_size: String,
+ pub mon_leveldb_max_open_files: String,
+ pub mon_leveldb_compression: String,
+ pub mon_leveldb_paranoid: String,
+ pub mon_leveldb_log: String,
+ pub mon_leveldb_size_warn: String,
+ pub mon_force_quorum_join: String,
+ pub paxos_stash_full_interval: String,
+ pub paxos_max_join_drift: String,
+ pub paxos_propose_interval: String,
+ pub paxos_min_wait: String,
+ pub paxos_min: String,
+ pub paxos_trim_min: String,
+ pub paxos_trim_max: String,
+ pub paxos_service_trim_min: String,
+ pub paxos_service_trim_max: String,
+ pub paxos_kill_at: String,
+ pub clock_offset: String,
+ pub auth_cluster_required: String,
+ pub auth_service_required: String,
+ pub auth_client_required: String,
+ pub auth_supported: String,
+ pub cephx_require_signatures: String,
+ pub cephx_cluster_require_signatures: String,
+ pub cephx_service_require_signatures: String,
+ pub cephx_sign_messages: String,
+ pub auth_mon_ticket_ttl: String,
+ pub auth_service_ticket_ttl: String,
+ pub auth_debug: String,
+ pub mon_client_hunt_interval: String,
+ pub mon_client_ping_interval: String,
+ pub mon_client_ping_timeout: String,
+ pub mon_client_hunt_interval_backoff: String,
+ pub mon_client_hunt_interval_max_multiple: String,
+ pub mon_client_max_log_entries_per_message: String,
+ pub mon_max_pool_pg_num: String,
+ pub mon_pool_quota_warn_threshold: String,
+ pub mon_pool_quota_crit_threshold: String,
+ pub client_cache_size: String,
+ pub client_cache_mid: String,
+ pub client_use_random_mds: String,
+ pub client_mount_timeout: String,
+ pub client_tick_interval: String,
+ pub client_trace: String,
+ pub client_readahead_min: String,
+ pub client_readahead_max_bytes: String,
+ pub client_readahead_max_periods: String,
+ pub client_snapdir: String,
+ pub client_mountpoint: String,
+ pub client_notify_timeout: String,
+ pub osd_client_watch_timeout: String,
+ pub client_caps_release_delay: String,
+ pub client_oc: String,
+ pub client_oc_size: String,
+ pub client_oc_max_dirty: String,
+ pub client_oc_target_dirty: String,
+ pub client_oc_max_dirty_age: String,
+ pub client_oc_max_objects: String,
+ pub client_debug_force_sync_read: String,
+ pub client_debug_inject_tick_delay: String,
+ pub client_max_inline_size: String,
+ pub fuse_use_invalidate_cb: String,
+ pub fuse_allow_other: String,
+ pub fuse_default_permissions: String,
+ pub fuse_big_writes: String,
+ pub fuse_atomic_o_trunc: String,
+ pub fuse_debug: String,
+ pub fuse_multithreaded: String,
+ pub crush_location: String,
+ pub objecter_tick_interval: String,
+ pub objecter_timeout: String,
+ pub objecter_inflight_op_bytes: String,
+ pub objecter_inflight_ops: String,
+ pub journaler_allow_split_entries: String,
+ pub journaler_write_head_interval: String,
+ pub journaler_prefetch_periods: String,
+ pub journaler_prezero_periods: String,
+ pub journaler_batch_interval: String,
+ pub journaler_batch_max: String,
+ pub mds_data: String,
+ pub mds_max_file_size: String,
+ pub mds_cache_size: String,
+ pub mds_cache_mid: String,
+ pub mds_mem_max: String,
+ pub mds_dir_max_commit_size: String,
+ pub mds_decay_halflife: String,
+ pub mds_beacon_interval: String,
+ pub mds_beacon_grace: String,
+ pub mds_enforce_unique_name: String,
+ pub mds_blacklist_interval: String,
+ pub mds_session_timeout: String,
+ pub mds_freeze_tree_timeout: String,
+ pub mds_session_autoclose: String,
+ pub mds_reconnect_timeout: String,
+ pub mds_tick_interval: String,
+ pub mds_dirstat_min_interval: String,
+ pub mds_scatter_nudge_interval: String,
+ pub mds_client_prealloc_inos: String,
+ pub mds_early_reply: String,
+ pub mds_default_dir_hash: String,
+ pub mds_log: String,
+ pub mds_log_skip_corrupt_events: String,
+ pub mds_log_max_events: String,
+ pub mds_log_segment_size: String,
+ pub mds_log_max_segments: String,
+ pub mds_log_max_expiring: String,
+ pub mds_bal_sample_interval: String,
+ pub mds_bal_replicate_threshold: String,
+ pub mds_bal_unreplicate_threshold: String,
+ pub mds_bal_frag: String,
+ pub mds_bal_split_size: String,
+ pub mds_bal_split_rd: String,
+ pub mds_bal_split_wr: String,
+ pub mds_bal_split_bits: String,
+ pub mds_bal_merge_size: String,
+ pub mds_bal_merge_rd: String,
+ pub mds_bal_merge_wr: String,
+ pub mds_bal_interval: String,
+ pub mds_bal_fragment_interval: String,
+ pub mds_bal_idle_threshold: String,
+ pub mds_bal_max: String,
+ pub mds_bal_max_until: String,
+ pub mds_bal_mode: String,
+ pub mds_bal_min_rebalance: String,
+ pub mds_bal_min_start: String,
+ pub mds_bal_need_min: String,
+ pub mds_bal_need_max: String,
+ pub mds_bal_midchunk: String,
+ pub mds_bal_minchunk: String,
+ pub mds_bal_target_removal_min: String,
+ pub mds_bal_target_removal_max: String,
+ pub mds_replay_interval: String,
+ pub mds_shutdown_check: String,
+ pub mds_thrash_exports: String,
+ pub mds_thrash_fragments: String,
+ pub mds_dump_cache_on_map: String,
+ pub mds_dump_cache_after_rejoin: String,
+ pub mds_verify_scatter: String,
+ pub mds_debug_scatterstat: String,
+ pub mds_debug_frag: String,
+ pub mds_debug_auth_pins: String,
+ pub mds_debug_subtrees: String,
+ pub mds_kill_mdstable_at: String,
+ pub mds_kill_export_at: String,
+ pub mds_kill_import_at: String,
+ pub mds_kill_link_at: String,
+ pub mds_kill_rename_at: String,
+ pub mds_kill_openc_at: String,
+ pub mds_kill_journal_at: String,
+ pub mds_kill_journal_expire_at: String,
+ pub mds_kill_journal_replay_at: String,
+ pub mds_kill_create_at: String,
+ pub mds_open_remote_link_mode: String,
+ pub mds_inject_traceless_reply_probability: String,
+ pub mds_wipe_sessions: String,
+ pub mds_wipe_ino_prealloc: String,
+ pub mds_skip_ino: String,
+ pub max_mds: String,
+ pub mds_standby_for_name: String,
+ pub mds_standby_for_rank: String,
+ pub mds_standby_replay: String,
+ pub osd_compact_leveldb_on_mount: String,
+ pub osd_max_backfills: String,
+ pub osd_backfill_full_ratio: String,
+ pub osd_backfill_retry_interval: String,
+ pub osd_agent_max_ops: String,
+ pub osd_agent_min_evict_effort: String,
+ pub osd_agent_quantize_effort: String,
+ pub osd_agent_delay_time: String,
+ pub osd_agent_hist_halflife: String,
+ pub osd_agent_slop: String,
+ pub osd_uuid: String,
+ pub osd_data: String,
+ pub osd_journal: String,
+ pub osd_journal_size: String,
+ pub osd_max_write_size: String,
+ pub osd_max_pgls: String,
+ pub osd_client_message_size_cap: String,
+ pub osd_client_message_cap: String,
+ pub osd_pg_bits: String,
+ pub osd_pgp_bits: String,
+ pub osd_crush_chooseleaf_type: String,
+ pub osd_pool_default_crush_rule: String,
+ pub osd_pool_default_crush_replicated_ruleset: String,
+ pub osd_pool_erasure_code_stripe_width: String,
+ pub osd_pool_default_size: String,
+ pub osd_pool_default_min_size: String,
+ pub osd_pool_default_pg_num: String,
+ pub osd_pool_default_pgp_num: String,
+ pub osd_pool_default_erasure_code_directory: String,
+ pub osd_pool_default_erasure_code_profile: String,
+ pub osd_erasure_code_plugins: String,
+ pub osd_pool_default_flags: String,
+ pub osd_pool_default_flag_hashpspool: String,
+ pub osd_pool_default_hit_set_bloom_fpp: String,
+ pub osd_pool_default_cache_target_dirty_ratio: String,
+ pub osd_pool_default_cache_target_full_ratio: String,
+ pub osd_pool_default_cache_min_flush_age: String,
+ pub osd_pool_default_cache_min_evict_age: String,
+ pub osd_hit_set_min_size: String,
+ pub osd_hit_set_max_size: String,
+ pub osd_hit_set_namespace: String,
+ pub osd_tier_default_cache_mode: String,
+ pub osd_tier_default_cache_hit_set_count: String,
+ pub osd_tier_default_cache_hit_set_period: String,
+ pub osd_tier_default_cache_hit_set_type: String,
+ pub osd_map_dedup: String,
+ pub osd_map_max_advance: String,
+ pub osd_map_cache_size: String,
+ pub osd_map_message_max: String,
+ pub osd_map_share_max_epochs: String,
+ pub osd_op_threads: String,
+ pub osd_peering_wq_batch_size: String,
+ pub osd_op_pq_max_tokens_per_priority: String,
+ pub osd_op_pq_min_cost: String,
+ pub osd_disk_threads: String,
+ pub osd_disk_thread_ioprio_class: String,
+ pub osd_disk_thread_ioprio_priority: String,
+ pub osd_recovery_threads: String,
+ pub osd_recover_clone_overlap: String,
+ pub osd_recover_clone_overlap_limit: String,
+ pub osd_backfill_scan_min: String,
+ pub osd_backfill_scan_max: String,
+ pub osd_op_thread_timeout: String,
+ pub osd_recovery_thread_timeout: String,
+ pub osd_snap_trim_thread_timeout: String,
+ pub osd_snap_trim_sleep: String,
+ pub osd_scrub_thread_timeout: String,
+ pub osd_scrub_finalize_thread_timeout: String,
+ pub osd_scrub_invalid_stats: String,
+ pub osd_remove_thread_timeout: String,
+ pub osd_command_thread_timeout: String,
+ pub osd_age: String,
+ pub osd_age_time: String,
+ pub osd_heartbeat_addr: String,
+ pub osd_heartbeat_interval: String,
+ pub osd_heartbeat_grace: String,
+ pub osd_heartbeat_min_peers: String,
+ pub osd_pg_max_concurrent_snap_trims: String,
+ pub osd_heartbeat_min_healthy_ratio: String,
+ pub osd_mon_heartbeat_interval: String,
+ pub osd_mon_report_interval_max: String,
+ pub osd_mon_report_interval_min: String,
+ pub osd_pg_stat_report_interval_max: String,
+ pub osd_mon_ack_timeout: String,
+ pub osd_default_data_pool_replay_window: String,
+ pub osd_preserve_trimmed_log: String,
+ pub osd_auto_mark_unfound_lost: String,
+ pub osd_recovery_delay_start: String,
+ pub osd_recovery_max_active: String,
+ pub osd_recovery_max_single_start: String,
+ pub osd_recovery_max_chunk: String,
+ pub osd_copyfrom_max_chunk: String,
+ pub osd_push_per_object_cost: String,
+ pub osd_max_push_cost: String,
+ pub osd_max_push_objects: String,
+ pub osd_recovery_forget_lost_objects: String,
+ pub osd_max_scrubs: String,
+ pub osd_scrub_load_threshold: String,
+ pub osd_scrub_min_interval: String,
+ pub osd_scrub_max_interval: String,
+ pub osd_scrub_chunk_min: String,
+ pub osd_scrub_chunk_max: String,
+ pub osd_scrub_sleep: String,
+ pub osd_deep_scrub_interval: String,
+ pub osd_deep_scrub_stride: String,
+ pub osd_scan_list_ping_tp_interval: String,
+ pub osd_auto_weight: String,
+ pub osd_class_dir: String,
+ pub osd_open_classes_on_start: String,
+ pub osd_check_for_log_corruption: String,
+ pub osd_use_stale_snap: String,
+ pub osd_rollback_to_cluster_snap: String,
+ pub osd_default_notify_timeout: String,
+ pub osd_kill_backfill_at: String,
+ pub osd_pg_epoch_persisted_max_stale: String,
+ pub osd_min_pg_log_entries: String,
+ pub osd_max_pg_log_entries: String,
+ pub osd_op_complaint_time: String,
+ pub osd_command_max_records: String,
+ pub osd_op_log_threshold: String,
+ pub osd_verify_sparse_read_holes: String,
+ pub osd_debug_drop_ping_probability: String,
+ pub osd_debug_drop_ping_duration: String,
+ pub osd_debug_drop_pg_create_probability: String,
+ pub osd_debug_drop_pg_create_duration: String,
+ pub osd_debug_drop_op_probability: String,
+ pub osd_debug_op_order: String,
+ pub osd_debug_verify_snaps_on_info: String,
+ pub osd_debug_verify_stray_on_activate: String,
+ pub osd_debug_skip_full_check_in_backfill_reservation: String,
+ pub osd_debug_reject_backfill_probability: String,
+ pub osd_enable_op_tracker: String,
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![deny(unused_results)]
+#![allow(dead_code)]
+
+#[derive(Debug)]
+struct A(usize);
+
+#[derive(Debug)]
+struct B { a: usize }
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Regression test for #29740. Inefficient MIR matching algorithms
+// generated way too much code for this sort of case, leading to OOM.
+#![allow(non_snake_case)]
+
+pub mod KeyboardEventConstants {
+ pub const DOM_KEY_LOCATION_STANDARD: u32 = 0;
+ pub const DOM_KEY_LOCATION_LEFT: u32 = 1;
+ pub const DOM_KEY_LOCATION_RIGHT: u32 = 2;
+ pub const DOM_KEY_LOCATION_NUMPAD: u32 = 3;
+} // mod KeyboardEventConstants
+
+pub enum Key {
+ Space,
+ Apostrophe,
+ Comma,
+ Minus,
+ Period,
+ Slash,
+ Num0,
+ Num1,
+ Num2,
+ Num3,
+ Num4,
+ Num5,
+ Num6,
+ Num7,
+ Num8,
+ Num9,
+ Semicolon,
+ Equal,
+ A,
+ B,
+ C,
+ D,
+ E,
+ F,
+ G,
+ H,
+ I,
+ J,
+ K,
+ L,
+ M,
+ N,
+ O,
+ P,
+ Q,
+ R,
+ S,
+ T,
+ U,
+ V,
+ W,
+ X,
+ Y,
+ Z,
+ LeftBracket,
+ Backslash,
+ RightBracket,
+ GraveAccent,
+ World1,
+ World2,
+
+ Escape,
+ Enter,
+ Tab,
+ Backspace,
+ Insert,
+ Delete,
+ Right,
+ Left,
+ Down,
+ Up,
+ PageUp,
+ PageDown,
+ Home,
+ End,
+ CapsLock,
+ ScrollLock,
+ NumLock,
+ PrintScreen,
+ Pause,
+ F1,
+ F2,
+ F3,
+ F4,
+ F5,
+ F6,
+ F7,
+ F8,
+ F9,
+ F10,
+ F11,
+ F12,
+ F13,
+ F14,
+ F15,
+ F16,
+ F17,
+ F18,
+ F19,
+ F20,
+ F21,
+ F22,
+ F23,
+ F24,
+ F25,
+ Kp0,
+ Kp1,
+ Kp2,
+ Kp3,
+ Kp4,
+ Kp5,
+ Kp6,
+ Kp7,
+ Kp8,
+ Kp9,
+ KpDecimal,
+ KpDivide,
+ KpMultiply,
+ KpSubtract,
+ KpAdd,
+ KpEnter,
+ KpEqual,
+ LeftShift,
+ LeftControl,
+ LeftAlt,
+ LeftSuper,
+ RightShift,
+ RightControl,
+ RightAlt,
+ RightSuper,
+ Menu,
+}
+
+fn key_from_string(key_string: &str, location: u32) -> Option<Key> {
+ match key_string {
+ " " => Some(Key::Space),
+ "\"" => Some(Key::Apostrophe),
+ "'" => Some(Key::Apostrophe),
+ "<" => Some(Key::Comma),
+ "," => Some(Key::Comma),
+ "_" => Some(Key::Minus),
+ "-" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Minus),
+ ">" => Some(Key::Period),
+ "." if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Period),
+ "?" => Some(Key::Slash),
+ "/" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Slash),
+ "~" => Some(Key::GraveAccent),
+ "`" => Some(Key::GraveAccent),
+ ")" => Some(Key::Num0),
+ "0" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num0),
+ "!" => Some(Key::Num1),
+ "1" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num1),
+ "@" => Some(Key::Num2),
+ "2" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num2),
+ "#" => Some(Key::Num3),
+ "3" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num3),
+ "$" => Some(Key::Num4),
+ "4" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num4),
+ "%" => Some(Key::Num5),
+ "5" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num5),
+ "^" => Some(Key::Num6),
+ "6" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num6),
+ "&" => Some(Key::Num7),
+ "7" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num7),
+ "*" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num8),
+ "8" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num8),
+ "(" => Some(Key::Num9),
+ "9" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Num9),
+ ":" => Some(Key::Semicolon),
+ ";" => Some(Key::Semicolon),
+ "+" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Equal),
+ "=" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD => Some(Key::Equal),
+ "A" => Some(Key::A),
+ "a" => Some(Key::A),
+ "B" => Some(Key::B),
+ "b" => Some(Key::B),
+ "C" => Some(Key::C),
+ "c" => Some(Key::C),
+ "D" => Some(Key::D),
+ "d" => Some(Key::D),
+ "E" => Some(Key::E),
+ "e" => Some(Key::E),
+ "F" => Some(Key::F),
+ "f" => Some(Key::F),
+ "G" => Some(Key::G),
+ "g" => Some(Key::G),
+ "H" => Some(Key::H),
+ "h" => Some(Key::H),
+ "I" => Some(Key::I),
+ "i" => Some(Key::I),
+ "J" => Some(Key::J),
+ "j" => Some(Key::J),
+ "K" => Some(Key::K),
+ "k" => Some(Key::K),
+ "L" => Some(Key::L),
+ "l" => Some(Key::L),
+ "M" => Some(Key::M),
+ "m" => Some(Key::M),
+ "N" => Some(Key::N),
+ "n" => Some(Key::N),
+ "O" => Some(Key::O),
+ "o" => Some(Key::O),
+ "P" => Some(Key::P),
+ "p" => Some(Key::P),
+ "Q" => Some(Key::Q),
+ "q" => Some(Key::Q),
+ "R" => Some(Key::R),
+ "r" => Some(Key::R),
+ "S" => Some(Key::S),
+ "s" => Some(Key::S),
+ "T" => Some(Key::T),
+ "t" => Some(Key::T),
+ "U" => Some(Key::U),
+ "u" => Some(Key::U),
+ "V" => Some(Key::V),
+ "v" => Some(Key::V),
+ "W" => Some(Key::W),
+ "w" => Some(Key::W),
+ "X" => Some(Key::X),
+ "x" => Some(Key::X),
+ "Y" => Some(Key::Y),
+ "y" => Some(Key::Y),
+ "Z" => Some(Key::Z),
+ "z" => Some(Key::Z),
+ "{" => Some(Key::LeftBracket),
+ "[" => Some(Key::LeftBracket),
+ "|" => Some(Key::Backslash),
+ "\\" => Some(Key::Backslash),
+ "}" => Some(Key::RightBracket),
+ "]" => Some(Key::RightBracket),
+ "Escape" => Some(Key::Escape),
+ "Enter" if location == KeyboardEventConstants::DOM_KEY_LOCATION_STANDARD
+ => Some(Key::Enter),
+ "Tab" => Some(Key::Tab),
+ "Backspace" => Some(Key::Backspace),
+ "Insert" => Some(Key::Insert),
+ "Delete" => Some(Key::Delete),
+ "ArrowRight" => Some(Key::Right),
+ "ArrowLeft" => Some(Key::Left),
+ "ArrowDown" => Some(Key::Down),
+ "ArrowUp" => Some(Key::Up),
+ "PageUp" => Some(Key::PageUp),
+ "PageDown" => Some(Key::PageDown),
+ "Home" => Some(Key::Home),
+ "End" => Some(Key::End),
+ "CapsLock" => Some(Key::CapsLock),
+ "ScrollLock" => Some(Key::ScrollLock),
+ "NumLock" => Some(Key::NumLock),
+ "PrintScreen" => Some(Key::PrintScreen),
+ "Pause" => Some(Key::Pause),
+ "F1" => Some(Key::F1),
+ "F2" => Some(Key::F2),
+ "F3" => Some(Key::F3),
+ "F4" => Some(Key::F4),
+ "F5" => Some(Key::F5),
+ "F6" => Some(Key::F6),
+ "F7" => Some(Key::F7),
+ "F8" => Some(Key::F8),
+ "F9" => Some(Key::F9),
+ "F10" => Some(Key::F10),
+ "F11" => Some(Key::F11),
+ "F12" => Some(Key::F12),
+ "F13" => Some(Key::F13),
+ "F14" => Some(Key::F14),
+ "F15" => Some(Key::F15),
+ "F16" => Some(Key::F16),
+ "F17" => Some(Key::F17),
+ "F18" => Some(Key::F18),
+ "F19" => Some(Key::F19),
+ "F20" => Some(Key::F20),
+ "F21" => Some(Key::F21),
+ "F22" => Some(Key::F22),
+ "F23" => Some(Key::F23),
+ "F24" => Some(Key::F24),
+ "F25" => Some(Key::F25),
+ "0" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp0),
+ "1" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp1),
+ "2" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp2),
+ "3" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp3),
+ "4" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp4),
+ "5" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp5),
+ "6" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp6),
+ "7" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp7),
+ "8" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp8),
+ "9" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::Kp9),
+ "." if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpDecimal),
+ "/" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpDivide),
+ "*" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpMultiply),
+ "-" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpSubtract),
+ "+" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpAdd),
+ "Enter" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD
+ => Some(Key::KpEnter),
+ "=" if location == KeyboardEventConstants::DOM_KEY_LOCATION_NUMPAD => Some(Key::KpEqual),
+ "Shift" if location == KeyboardEventConstants::DOM_KEY_LOCATION_LEFT
+ => Some(Key::LeftShift),
+ "Control" if location == KeyboardEventConstants::DOM_KEY_LOCATION_LEFT
+ => Some(Key::LeftControl),
+ "Alt" if location == KeyboardEventConstants::DOM_KEY_LOCATION_LEFT => Some(Key::LeftAlt),
+ "Super" if location == KeyboardEventConstants::DOM_KEY_LOCATION_LEFT
+ => Some(Key::LeftSuper),
+ "Shift" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT
+ => Some(Key::RightShift),
+ "Control" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT
+ => Some(Key::RightControl),
+ "Alt" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT => Some(Key::RightAlt),
+ "Super" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT
+ => Some(Key::RightSuper),
+ "ContextMenu" => Some(Key::Menu),
+ _ => None
+ }
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+pub struct Struct<K: 'static> {
+ pub field: K,
+}
+
+static STRUCT: Struct<&'static [u8]> = Struct {
+ field: {&[1]}
+};
+
+static STRUCT2: Struct<&'static [u8]> = Struct {
+ field: &[1]
+};
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_snake_case)]
+// pretty-expanded FIXME #23616
+
+fn Matrix4<T>(m11: T, m12: T, m13: T, m14: T,
+ m21: T, m22: T, m23: T, m24: T,
+ m31: T, m32: T, m33: T, m34: T,
+ m41: T, m42: T, m43: T, m44: T)
+ -> Matrix4<T> {
+ Matrix4 {
+ m11: m11, m12: m12, m13: m13, m14: m14,
+ m21: m21, m22: m22, m23: m23, m24: m24,
+ m31: m31, m32: m32, m33: m33, m34: m34,
+ m41: m41, m42: m42, m43: m43, m44: m44
+ }
+}
+
+struct Matrix4<T> {
+ m11: T, m12: T, m13: T, m14: T,
+ m21: T, m22: T, m23: T, m24: T,
+ m31: T, m32: T, m33: T, m34: T,
+ m41: T, m42: T, m43: T, m44: T,
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+trait Make {
+ type Out;
+
+ fn make() -> Self::Out;
+}
+
+impl Make for () {
+ type Out = ();
+
+ fn make() -> Self::Out {}
+}
+
+// Also make sure we don't hit an ICE when the projection can't be known
+fn f<T: Make>() -> <T as Make>::Out { loop {} }
+
+// ...and that it works with a blanket impl
+trait Tr {
+ type Assoc;
+}
+
+impl<T: Make> Tr for T {
+ type Assoc = ();
+}
+
+fn g<T: Make>() -> <T as Tr>::Assoc { }
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+
+trait Resources {
+ type Buffer: Copy;
+}
+
+#[derive(Copy, Clone)]
+struct ConstantBufferSet<R: Resources>(
+ pub R::Buffer
+);
+
+#[derive(Copy, Clone)]
+enum It {}
+impl Resources for It {
+ type Buffer = u8;
+}
+
+#[derive(Copy, Clone)]
+enum Command {
+ BindConstantBuffers(ConstantBufferSet<It>)
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2018 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.
+
+// compile-pass
+// only-x86_64
+
+#![allow(dead_code, non_upper_case_globals)]
+#![feature(asm)]
+
+#[repr(C)]
+pub struct D32x4(f32,f32,f32,f32);
+
+impl D32x4 {
+ fn add(&self, vec: Self) -> Self {
+ unsafe {
+ let ret: Self;
+ asm!("
+ movaps $1, %xmm1
+ movaps $2, %xmm2
+ addps %xmm1, %xmm2
+ movaps $xmm1, $0
+ "
+ : "=r"(ret)
+ : "1"(self), "2"(vec)
+ : "xmm1", "xmm2"
+ );
+ ret
+ }
+ }
+}
+
+fn main() { }
+
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(unused_variables)]
+const A: [u32; 1] = [0];
+
+fn test() {
+ let range = A[1]..;
+}
+
+fn main() { }
+
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Issue 33903:
+// Built-in indexing should be used even when the index is not
+// trivially an integer
+// Only built-in indexing can be used in constant expressions
+
+const FOO: i32 = [12, 34][0 + 1];
+
+fn main() {}
+
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+
+struct A {
+ a: &'static (),
+}
+
+static B: &'static A = &A { a: &() };
+static C: &'static A = &B;
+
+fn main() {}
--- /dev/null
+// Copyright 2012-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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+// rustc --test ignores2.rs && ./ignores2
+
+pub struct Path;
+
+type rsrc_loader = Box<FnMut(&Path) -> Result<String, String>>;
+
+fn tester()
+{
+ let mut loader: rsrc_loader = Box::new(move |_path| {
+ Ok("more blah".to_string())
+ });
+
+ let path = Path;
+ assert!(loader(&path).is_ok());
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// #34751 ICE: 'rustc' panicked at 'assertion failed: !substs.has_regions_escaping_depth(0)'
+
+#[allow(dead_code)]
+
+use std::marker::PhantomData;
+
+fn f<'a>(PhantomData::<&'a u8>: PhantomData<&'a u8>) {}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(stable_features)]
+#![feature(associated_consts)]
+
+use std::marker::PhantomData;
+
+trait Tr<'a> {
+ const C: PhantomData<&'a u8> = PhantomData::<&'a u8>;
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![feature(specialization)]
+
+fn main() {}
+
+pub trait Alpha<T> { }
+
+pub trait Beta {
+ type Event;
+}
+
+pub trait Delta {
+ type Handle;
+ fn process(&self);
+}
+
+pub struct Parent<A, T>(A, T);
+
+impl<A, T> Delta for Parent<A, T>
+where A: Alpha<T::Handle>,
+ T: Delta,
+ T::Handle: Beta<Event = <Handle as Beta>::Event> {
+ type Handle = Handle;
+ default fn process(&self) {
+ unimplemented!()
+ }
+}
+
+impl<A, T> Delta for Parent<A, T>
+where A: Alpha<T::Handle> + Alpha<Handle>,
+ T: Delta,
+ T::Handle: Beta<Event = <Handle as Beta>::Event> {
+ fn process(&self) {
+ unimplemented!()
+ }
+}
+
+pub struct Handle;
+
+impl Beta for Handle {
+ type Event = ();
+}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Regression test for #35546. Check that we are able to codegen
+// this. Before we had problems because of the drop glue signature
+// around dropping a trait object (specifically, when dropping the
+// `value` field of `Node<Send>`).
+
+struct Node<T: ?Sized + Send> {
+ next: Option<Box<Node<Send>>>,
+ value: T,
+}
+
+fn clear(head: &mut Option<Box<Node<Send>>>) {
+ match head.take() {
+ Some(node) => *head = node.next,
+ None => (),
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+trait Canvas {
+ fn add_point(&self, point: &isize);
+ fn add_points(&self, shapes: &[isize]) {
+ for pt in shapes {
+ self.add_point(pt)
+ }
+ }
+
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+trait DeclarationParser {
+ type Declaration;
+}
+
+struct DeclarationListParser<'i, I, P>
+ where P: DeclarationParser<Declaration = I>
+{
+ input: &'i (),
+ parser: P
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(unused_must_use)]
+#![allow(dead_code)]
+#![allow(unused_mut)]
+use std::thread;
+use std::sync::mpsc::Sender;
+
+type RingBuffer = Vec<f64> ;
+type SamplesFn = Box<FnMut(&RingBuffer) + Send>;
+
+enum Msg
+{
+ GetSamples(String, SamplesFn), // sample set name, callback which receives samples
+}
+
+fn foo(name: String, samples_chan: Sender<Msg>) {
+ thread::spawn(move|| {
+ let mut samples_chan = samples_chan;
+
+ let callback: SamplesFn = Box::new(move |buffer| {
+ for i in 0..buffer.len() {
+ println!("{}: {}", i, buffer[i])
+ }
+ });
+
+ samples_chan.send(Msg::GetSamples(name.clone(), callback));
+ }).join();
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// Tests for an LLVM abort when storing a lifetime-parametric fn into
+// context that is expecting one that is not lifetime-parametric
+// (i.e. has no `for <'_>`).
+
+pub struct A<'a>(&'a ());
+pub struct S<T>(T);
+
+pub fn bad<'s>(v: &mut S<fn(A<'s>)>, y: S<for<'b> fn(A<'b>)>) {
+ *v = y;
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![feature(slice_patterns)]
+
+fn check(list: &[u8]) {
+ match list {
+ &[] => {},
+ &[_u1, _u2, ref _next..] => {},
+ &[_u1] => {},
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// Regression test for #37655. The problem was a false edge created by
+// coercion that wound up requiring that `'a` (in `split()`) outlive
+// `'b`, which shouldn't be necessary.
+
+#![allow(warnings)]
+
+trait SliceExt<T> {
+ type Item;
+
+ fn get_me<I>(&self, index: I) -> &I::Output
+ where I: SliceIndex<Self::Item>;
+}
+
+impl<T> SliceExt<T> for [T] {
+ type Item = T;
+
+ fn get_me<I>(&self, index: I) -> &I::Output
+ where I: SliceIndex<T>
+ {
+ panic!()
+ }
+}
+
+pub trait SliceIndex<T> {
+ type Output: ?Sized;
+}
+
+impl<T> SliceIndex<T> for usize {
+ type Output = T;
+}
+
+fn foo<'a, 'b>(split: &'b [&'a [u8]]) -> &'a [u8] {
+ split.get_me(0)
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+trait Foo {
+ fn foo(&self);
+}
+
+fn foo<'a>(s: &'a mut ()) where &'a mut (): Foo {
+ s.foo();
+}
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+type A = for<> fn();
+
+type B = for<'a,> fn();
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#[repr(u64)]
+enum A {
+ A = 0u64,
+ B = !0u64,
+}
+
+fn cmp() -> A {
+ A::B
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+enum PureCounter { PureCounterVariant(usize) }
+
+fn each<F>(thing: PureCounter, blk: F) where F: FnOnce(&usize) {
+ let PureCounter::PureCounterVariant(ref x) = thing;
+ blk(x);
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+fn vec_peek<'r, T>(v: &'r [T]) -> &'r [T] {
+ &v[1..5]
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+fn f<T: ?for<'a> Sized>() {}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+macro_rules! expr { () => { () } }
+
+enum A {}
+
+impl A {
+ const A: () = expr!();
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+trait A {
+ fn a_method(&self);
+}
+
+trait B: A {
+ fn b_method(&self);
+}
+
+trait C: B {
+ fn c_method(&self) {
+ self.a_method();
+ }
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+
+// pretty-expanded FIXME #23616
+
+struct HasNested {
+ nest: Vec<Vec<isize> > ,
+}
+
+impl HasNested {
+ fn method_push_local(&mut self) {
+ self.nest[0].push(0);
+ }
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(unreachable_code)]
+// Regression test for issue #39984.
+//
+// The key here is that the error type of the `Ok` call ought to be
+// constrained to `String`, even though it is dead-code.
+
+fn main() {}
+
+fn t() -> Result<(), String> {
+ return Err("".into());
+ Ok(())
+}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+
+macro_rules! m { () => { 0 } }
+
+trait T {
+ const C: i32 = m!();
+}
+
+struct S;
+impl S {
+ const C: i32 = m!();
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(unused_mut)]
+/*
+# if b { x } else { y } requires identical types for x and y
+*/
+
+fn print1(b: bool, s1: &str, s2: &str) {
+ println!("{}", if b { s1 } else { s2 });
+}
+fn print2<'a, 'b>(b: bool, s1: &'a str, s2: &'b str) {
+ println!("{}", if b { s1 } else { s2 });
+}
+fn print3(b: bool, s1: &str, s2: &str) {
+ let mut s: &str;
+ if b { s = s1; } else { s = s2; }
+ println!("{}", s);
+}
+fn print4<'a, 'b>(b: bool, s1: &'a str, s2: &'b str) {
+ let mut s: &str;
+ if b { s = s1; } else { s = s2; }
+ println!("{}", s);
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+macro_rules! m {
+ ($i:meta) => {
+ #[derive($i)]
+ struct S;
+ }
+}
+
+m!(Clone);
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+struct Foo;
+
+impl Foo {
+ fn bar(&mut self) -> bool { true }
+}
+
+fn error(foo: &mut Foo) {
+ if let Some(_) = Some(true) {
+ } else if foo.bar() {}
+}
+
+fn ok(foo: &mut Foo) {
+ if let Some(_) = Some(true) {
+ } else {
+ if foo.bar() {}
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+struct Function<T, F> { t: T, f: F }
+
+impl<T, R> Function<T, fn() -> R> { fn foo() { } }
+impl<T, R> Function<T, fn() -> R> { fn bar() { } }
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![deny(dead_code)]
+
+#[used]
+static FOO: u32 = 0;
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Regression test for #41936. The coerce-unsized trait check in
+// coherence was using subtyping, which triggered variance
+// computation, which failed because it required type info for fields
+// that had not (yet) been computed.
+
+#![feature(unsize)]
+#![feature(coerce_unsized)]
+
+use std::{marker,ops};
+
+// Change the array to a non-array, and error disappears
+// Adding a new field to the end keeps the error
+struct LogDataBuf([u8;8]);
+
+struct Aref<T: ?Sized>
+{
+ // Inner structure triggers the error, removing the inner removes the message.
+ ptr: Box<ArefInner<T>>,
+}
+impl<T: ?Sized + marker::Unsize<U>, U: ?Sized> ops::CoerceUnsized<Aref<U>> for Aref<T> {}
+
+struct ArefInner<T: ?Sized>
+{
+ // Even with this field commented out, the error is raised.
+ data: T,
+}
+
+fn main(){}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+struct Foo<T>(T);
+
+struct IntoIter<T>(T);
+
+impl<'a, T: 'a> Iterator for IntoIter<T> {
+ type Item = ();
+
+ fn next(&mut self) -> Option<()> {
+ None
+ }
+}
+
+impl<T> IntoIterator for Foo<T> {
+ type Item = ();
+ type IntoIter = IntoIter<T>;
+
+ fn into_iter(self) -> IntoIter<T> {
+ IntoIter(self.0)
+ }
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2018 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(stable_features)]
+#![feature(associated_consts)]
+
+impl A for i32 {
+ type Foo = u32;
+}
+impl B for u32 {
+ const BAR: i32 = 0;
+}
+
+trait A {
+ type Foo: B;
+}
+
+trait B {
+ const BAR: i32;
+}
+
+fn generic<T: A>() {
+ // This panics if the universal function call syntax is used as well
+ println!("{}", T::Foo::BAR);
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(unused)]
+
+macro_rules! column {
+ ($i:ident) => {
+ $i
+ };
+}
+
+fn foo() -> ! {
+ panic!();
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+trait Trait {
+ type Output;
+}
+
+fn f<T: Trait>() {
+ std::mem::size_of::<T::Output>();
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(unused_variables)]
+trait VecN {
+ const DIM: usize;
+}
+
+trait Mat {
+ type Row: VecN;
+}
+
+fn m<M: Mat>() {
+ let x = M::Row::DIM;
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2018 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.
+
+// compile-pass
+pub trait Foo<'a> {
+ type Bar;
+ fn foo(&'a self) -> Self::Bar;
+}
+
+impl<'a, 'b, T: 'a> Foo<'a> for &'b T {
+ type Bar = &'a T;
+ fn foo(&'a self) -> &'a T {
+ self
+ }
+}
+
+pub fn uncallable<T, F>(x: T, f: F)
+ where T: for<'a> Foo<'a>,
+ F: for<'a> Fn(<T as Foo<'a>>::Bar)
+{
+ f(x.foo());
+}
+
+pub fn catalyst(x: &i32) {
+ broken(x, |_| {})
+}
+
+pub fn broken<F: Fn(&i32)>(x: &i32, f: F) {
+ uncallable(x, |y| f(y));
+}
+
+fn main() { }
+
--- /dev/null
+// Copyright 2018 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.
+
+// compile-pass
+// only-x86_64
+// no-prefer-dynamic
+// compile-flags: -Ctarget-feature=+avx -Clto
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+trait T {
+ type X;
+ const X: Self::X;
+}
+fn foo<X: T>() {
+ let _: X::X = X::X;
+}
+
+trait S {
+ const X: Self::X;
+ type X;
+}
+fn bar<X: S>() {
+ let _: X::X = X::X;
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// compile-flags: -Z borrowck=compare
+
+struct Foo(bool);
+
+struct Container(&'static [&'static Foo]);
+
+static FOO: Foo = Foo(true);
+static CONTAINER: Container = Container(&[&FOO]);
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![feature(never_type)]
+#![feature(exhaustive_patterns)]
+
+// Regression test for inhabitedness check. The old
+// cache used to cause us to incorrectly decide
+// that `test_b` was invalid.
+
+struct Foo {
+ field1: !,
+ field2: Option<&'static Bar>,
+}
+
+struct Bar {
+ field1: &'static Foo
+}
+
+fn test_a() {
+ let x: Option<Foo> = None;
+ match x { None => () }
+}
+
+fn test_b() {
+ let x: Option<Bar> = None;
+ match x { None => () }
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+fn broken(v: &[u8], i: usize, j: usize) -> &[u8] { &v[i..j] }
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+//! dox
+
+#![deny(missing_docs)]
+
+macro_rules! doc {
+ ($e:expr) => (
+ #[doc = $e]
+ pub struct Foo;
+ )
+}
+
+doc!("a");
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+macro_rules! a {
+ () => { "a" }
+}
+
+macro_rules! b {
+ ($doc:expr) => {
+ #[doc = $doc]
+ pub struct B;
+ }
+}
+
+b!(a!());
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+use std::ops::Add;
+
+fn ref_add<T>(a: &T, b: &T) -> T
+where
+ for<'x> &'x T: Add<&'x T, Output = T>,
+{
+ a + b
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2018 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.
+
+// compile-pass
+#![deny(non_camel_case_types)]
+
+#[allow(dead_code)]
+fn qqq(lol: impl Iterator<Item=u32>) -> impl Iterator<Item=u64> {
+ lol.map(|x|x as u64)
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+mod my_mod {
+ #[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash)]
+ pub struct Name<'a> {
+ source: &'a str,
+ }
+
+ pub const JSON: Name = Name { source: "JSON" };
+}
+
+pub fn crash() -> bool {
+ match (my_mod::JSON, None) {
+ (_, Some(my_mod::JSON)) => true,
+ (my_mod::JSON, None) => true,
+ _ => false,
+ }
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2018 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.
+
+// compile-pass
+#![allow(unused_imports)]
+
+use {{}, {}};
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![feature(nll)]
+
+struct AtomicRefMut<'a> {
+ value: &'a mut i32,
+ borrow: AtomicBorrowRefMut,
+}
+
+struct AtomicBorrowRefMut {
+}
+
+impl Drop for AtomicBorrowRefMut {
+ fn drop(&mut self) {
+ }
+}
+
+fn map(orig: AtomicRefMut) -> AtomicRefMut {
+ AtomicRefMut {
+ value: orig.value,
+ borrow: orig.borrow,
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![feature(nll)]
+
+struct WithDrop;
+
+impl Drop for WithDrop {
+ fn drop(&mut self) {}
+}
+
+fn consume(x: (&mut (), WithDrop)) -> &mut () { x.0 }
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![feature(nll)]
+
+struct MyStruct<'a> {
+ field: &'a mut (),
+ field2: WithDrop
+}
+
+struct WithDrop;
+
+impl Drop for WithDrop {
+ fn drop(&mut self) {}
+}
+
+impl<'a> MyStruct<'a> {
+ fn consume(self) -> &'a mut () { self.field }
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2018 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.
+
+// compile-pass
+#![allow(dead_code)]
+
+// Tests that automatic coercions from &mut T to *mut T
+// allow borrows of T to expire immediately - essentially, that
+// they work identically to 'foo as *mut T'
+#![feature(nll)]
+
+struct SelfReference {
+ self_reference: *mut SelfReference,
+}
+
+impl SelfReference {
+ fn set_self_ref(&mut self) {
+ self.self_reference = self;
+ }
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2018 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_upper_case_globals)]
+
+#![feature(nll)]
+
+static mut x: &'static u32 = &0;
+
+fn foo() {
+ unsafe { x = &1; }
+}
+
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+
+// pretty-expanded FIXME #23616
+
+pub struct Scheduler {
+ /// The event loop used to drive the scheduler and perform I/O
+ event_loop: Box<isize>
+}
+
+pub fn main() { }
--- /dev/null
+// Copyright 2018 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.
+
+// compile-pass
+// Regression test for #48551. Covers a case where duplicate candidates
+// arose during associated type projection.
+
+use std::ops::{Mul, MulAssign};
+
+pub trait ClosedMul<Right>: Sized + Mul<Right, Output = Self> + MulAssign<Right> {}
+impl<T, Right> ClosedMul<Right> for T
+where
+ T: Mul<Right, Output = T> + MulAssign<Right>,
+{
+}
+
+pub trait InnerSpace: ClosedMul<<Self as InnerSpace>::Real> {
+ type Real;
+}
+
+pub trait FiniteDimVectorSpace: ClosedMul<<Self as FiniteDimVectorSpace>::Field> {
+ type Field;
+}
+
+pub trait FiniteDimInnerSpace
+ : InnerSpace + FiniteDimVectorSpace<Field = <Self as InnerSpace>::Real> {
+}
+
+pub trait EuclideanSpace: ClosedMul<<Self as EuclideanSpace>::Real> {
+ type Coordinates: FiniteDimInnerSpace<Real = Self::Real>
+ + Mul<Self::Real, Output = Self::Coordinates>
+ + MulAssign<Self::Real>;
+
+ type Real;
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2018 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.
+
+// compile-pass
+#![allow(dead_code)]
+
+const PATH_DOT: &[u8] = &[b'.'];
+
+fn match_slice(element: &[u8]) {
+ match element {
+ &[] => {}
+ PATH_DOT => {}
+ _ => {}
+ }
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+const INVALID_ENUM : u32 = 0;
+const INVALID_VALUE : u32 = 1;
+
+fn gl_err_str(err: u32) -> String
+{
+ match err
+ {
+ INVALID_ENUM => { "Invalid enum".to_string() },
+ INVALID_VALUE => { "Invalid value".to_string() },
+ _ => { "Unknown error".to_string() }
+ }
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+fn foo<T: ::std::cmp::PartialEq>(_t: T) { }
+
+pub fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(improper_ctypes)]
+
+// pretty-expanded FIXME #23616
+
+struct TwoDoubles {
+ r: f64,
+ i: f64
+}
+
+extern "C" {
+ fn rust_dbg_extern_identity_TwoDoubles(arg1: TwoDoubles) -> TwoDoubles;
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+#![feature(box_syntax)]
+
+pub struct Foo {
+ a: isize,
+}
+
+struct Bar<'a> {
+ a: Box<Option<isize>>,
+ b: &'a Foo,
+}
+
+fn check(a: Box<Foo>) {
+ let _ic = Bar{ b: &*a, a: box None };
+}
+
+pub fn main(){}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+pub mod foo {
+ use super::Bar;
+
+ pub struct FooStruct { bar : Bar }
+}
+
+pub enum Bar {
+ Bar0 = 0 as isize
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+
+// pretty-expanded FIXME #23616
+
+pub use local as local_alias;
+
+pub mod local { }
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+#[derive(PartialEq)]
+struct A { x: usize }
+
+impl Drop for A {
+ fn drop(&mut self) {}
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(improper_ctypes)]
+
+// pretty-expanded FIXME #23616
+#![allow(non_snake_case)]
+
+pub mod Bar {
+ pub struct Foo {
+ v: isize,
+ }
+
+ extern {
+ pub fn foo(v: *const Foo) -> Foo;
+ }
+}
+
+pub fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+#![feature(box_patterns)]
+#![feature(box_syntax)]
+
+fn foo(box (_x, _y): Box<(isize, isize)>) {}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+// pretty-expanded FIXME #23616
+
+use std::mem;
+
+/// Returns the size of a type
+pub fn size_of<T>() -> usize {
+ TypeInfo::size_of(None::<T>)
+}
+
+/// Returns the size of the type that `val` points to
+pub fn size_of_val<T>(val: &T) -> usize {
+ val.size_of_val()
+}
+
+pub trait TypeInfo: Sized {
+ fn size_of(_lame_type_hint: Option<Self>) -> usize;
+ fn size_of_val(&self) -> usize;
+}
+
+impl<T> TypeInfo for T {
+ /// The size of the type in bytes.
+ fn size_of(_lame_type_hint: Option<T>) -> usize {
+ mem::size_of::<T>()
+ }
+
+ /// Returns the size of the type of `self` in bytes.
+ fn size_of_val(&self) -> usize {
+ TypeInfo::size_of(None::<T>)
+ }
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_upper_case_globals)]
+
+static x: &'static usize = &1;
+static y: usize = *x;
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+fn foo<T: 'static>(_: T) {}
+
+fn bar<T>(x: &'static T) {
+ foo(x);
+}
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+pub mod a {
+ pub struct Foo { a: usize }
+}
+
+pub mod b {
+ use a::Foo;
+ impl Foo {
+ fn bar(&self) { }
+ }
+}
+
+pub fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+/*
+
+#7673 Polymorphically creating traits barely works
+
+*/
+
+#![feature(box_syntax)]
+
+pub fn main() {}
+
+trait A {
+ fn dummy(&self) { }
+}
+
+impl<T: 'static> A for T {}
+
+fn owned2<T: 'static>(a: Box<T>) { a as Box<A>; }
+fn owned3<T: 'static>(a: Box<T>) { box a as Box<A>; }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+/*
+
+#8171 Self is not recognised as implementing kinds in default method implementations
+
+*/
+
+fn require_send<T: Send>(_: T){}
+
+trait TragicallySelfIsNotSend: Send + Sized {
+ fn x(self) {
+ require_send(self);
+ }
+}
+
+pub fn main(){}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+pub trait Writer {
+ fn write(&mut self, b: &[u8]) -> Result<(), ()>;
+}
+
+fn foo(a: &mut Writer) {
+ a.write(&[]).unwrap();
+}
+
+pub fn main(){}
--- /dev/null
+// 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.
+
+// compile-pass
+trait Foo1 {}
+
+trait A {}
+
+macro_rules! foo1(($t:path) => {
+ impl<T: $t> Foo1 for T {}
+});
+
+foo1!(A);
+
+trait Foo2 {}
+
+trait B<T> {}
+
+#[allow(unused)]
+struct C {}
+
+macro_rules! foo2(($t:path) => {
+ impl<T: $t> Foo2 for T {}
+});
+
+foo2!(B<C>);
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+#![allow(non_upper_case_globals)]
+// pretty-expanded FIXME #23616
+
+pub struct UninterpretedOption_NamePart {
+ name_part: Option<String>,
+}
+
+impl<'a> UninterpretedOption_NamePart {
+ pub fn default_instance() -> &'static UninterpretedOption_NamePart {
+ static instance: UninterpretedOption_NamePart = UninterpretedOption_NamePart {
+ name_part: None,
+ };
+ &instance
+ }
+}
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+#![allow(non_snake_case)]
+
+macro_rules! silly_macro {
+ () => (
+ pub mod Qux {
+ pub struct Foo { x : u8 }
+ pub fn bar(_foo : Foo) {}
+ }
+ );
+}
+
+silly_macro!();
+
+pub fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// Regression test for issue 9243
+#![allow(non_upper_case_globals)]
+
+pub struct Test {
+ mem: isize,
+}
+
+pub static g_test: Test = Test {mem: 0};
+
+impl Drop for Test {
+ fn drop(&mut self) {}
+}
+
+fn main() {}
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+static DATA:&'static [&'static str] = &["my string"];
+fn main() { }
--- /dev/null
+// 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.
+
+// compile-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+
+mod a {
+ pub enum Enum<T> {
+ A(T),
+ }
+
+ pub trait X {
+ fn dummy(&self) { }
+ }
+ impl X for isize {}
+
+ pub struct Z<'a>(Enum<&'a (X+'a)>);
+ fn foo() { let x: isize = 42; let z = Z(Enum::A(&x as &X)); let _ = z; }
+}
+
+mod b {
+ trait X {
+ fn dummy(&self) { }
+ }
+ impl X for isize {}
+ struct Y<'a>{
+ x:Option<&'a (X+'a)>,
+ }
+
+ fn bar() {
+ let x: isize = 42;
+ let _y = Y { x: Some(&x as &X) };
+ }
+}
+
+mod c {
+ pub trait X { fn f(&self); }
+ impl X for isize { fn f(&self) {} }
+ pub struct Z<'a>(Option<&'a (X+'a)>);
+ fn main() { let x: isize = 42; let z = Z(Some(&x as &X)); let _ = z; }
+}
+
+pub fn main() {}