From d0e594862c5e1044f3e38fa46c23038e95bcfbf3 Mon Sep 17 00:00:00 2001 From: Johannes Oertel Date: Sat, 2 May 2015 11:54:19 +0200 Subject: [PATCH 1/9] Add regression test for #14565 Closes #14565. --- src/test/run-pass/issue-14564.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/test/run-pass/issue-14564.rs diff --git a/src/test/run-pass/issue-14564.rs b/src/test/run-pass/issue-14564.rs new file mode 100644 index 000000000000..a661437a44cc --- /dev/null +++ b/src/test/run-pass/issue-14564.rs @@ -0,0 +1,15 @@ +// 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +mod Foo { } +struct Foo; +impl Foo { } + +fn main() { } From 846b36833eaf8bf6f8412e2b6b2bdc49d4359803 Mon Sep 17 00:00:00 2001 From: Johannes Oertel Date: Sat, 2 May 2015 11:54:51 +0200 Subject: [PATCH 2/9] Add regression test for #12511 Closes #12511. --- src/test/compile-fail/issue-12511.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/compile-fail/issue-12511.rs diff --git a/src/test/compile-fail/issue-12511.rs b/src/test/compile-fail/issue-12511.rs new file mode 100644 index 000000000000..35697e687341 --- /dev/null +++ b/src/test/compile-fail/issue-12511.rs @@ -0,0 +1,19 @@ +// 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait t1 : t2 { +//~^ ERROR: unsupported cyclic reference between types/traits detected +} + +trait t2 : t1 { +//~^ ERROR: unsupported cyclic reference between types/traits detected +} + +fn main() { } From 3878f4d519c632c353024e98dc3fef1f156009a6 Mon Sep 17 00:00:00 2001 From: Johannes Oertel Date: Sat, 2 May 2015 12:20:51 +0200 Subject: [PATCH 3/9] Add regression test for #17170 Closes #17170. --- src/test/run-pass/issue-17170.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/run-pass/issue-17170.rs diff --git a/src/test/run-pass/issue-17170.rs b/src/test/run-pass/issue-17170.rs new file mode 100644 index 000000000000..ef1345259278 --- /dev/null +++ b/src/test/run-pass/issue-17170.rs @@ -0,0 +1,20 @@ +// 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(simd)] + +#[simd] +struct T(f64, f64, f64); + +static X: T = T(0.0, 0.0, 0.0); + +fn main() { + let _ = X; +} From 2595b1e282e5b2ac3985b40bc2485daf5bd165d3 Mon Sep 17 00:00:00 2001 From: Johannes Oertel Date: Sat, 2 May 2015 12:34:19 +0200 Subject: [PATCH 4/9] Add regression test for #17959 Closes #17959. --- src/test/compile-fail/issue-17959.rs | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/test/compile-fail/issue-17959.rs diff --git a/src/test/compile-fail/issue-17959.rs b/src/test/compile-fail/issue-17959.rs new file mode 100644 index 000000000000..56a66ecc8aa4 --- /dev/null +++ b/src/test/compile-fail/issue-17959.rs @@ -0,0 +1,31 @@ +// 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern crate core; + +use core::ops::Drop; + +trait Bar {} + +struct G { + _ptr: *const T +} + +impl Drop for G { +//~^ ERROR: The requirement `T : core::marker::Sized` is added only by the Drop impl. [E0367] + fn drop(&mut self) { + if !self._ptr.is_null() { + } + } +} + +fn main() { + let x:G; +} From 2cf47917ab05ce544fe626a213a999519a29b372 Mon Sep 17 00:00:00 2001 From: Johannes Oertel Date: Sat, 2 May 2015 13:26:06 +0200 Subject: [PATCH 5/9] Add regression test for #18943 Closes #18943. --- src/test/run-make/issue-18943/Makefile | 7 +++++++ src/test/run-make/issue-18943/foo.rs | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/test/run-make/issue-18943/Makefile create mode 100644 src/test/run-make/issue-18943/foo.rs diff --git a/src/test/run-make/issue-18943/Makefile b/src/test/run-make/issue-18943/Makefile new file mode 100644 index 000000000000..bef70a0edaab --- /dev/null +++ b/src/test/run-make/issue-18943/Makefile @@ -0,0 +1,7 @@ +-include ../tools.mk + +# Regression test for ICE #18943 when compiling as lib + +all: + $(RUSTC) foo.rs --crate-type lib + $(call REMOVE_RLIBS,foo) && exit 0 || exit 1 diff --git a/src/test/run-make/issue-18943/foo.rs b/src/test/run-make/issue-18943/foo.rs new file mode 100644 index 000000000000..aadf0f593e74 --- /dev/null +++ b/src/test/run-make/issue-18943/foo.rs @@ -0,0 +1,16 @@ +// 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo { } + +trait Bar { } + +impl<'a> Foo for Bar + 'a { } + From c81d8f940abfe9c53a00b854a705de4b548dc530 Mon Sep 17 00:00:00 2001 From: Johannes Oertel Date: Sat, 2 May 2015 13:27:48 +0200 Subject: [PATCH 6/9] Add regression test for #19109 Closes #19109. --- src/test/compile-fail/issue-19109.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/compile-fail/issue-19109.rs diff --git a/src/test/compile-fail/issue-19109.rs b/src/test/compile-fail/issue-19109.rs new file mode 100644 index 000000000000..1ffffa9fc748 --- /dev/null +++ b/src/test/compile-fail/issue-19109.rs @@ -0,0 +1,22 @@ +// 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Trait { } + +fn function(t: &mut Trait) { + t as *mut Trait + //~^ ERROR: mismatched types: + //~| expected `()`, + //~| found `*mut Trait` + //~| (expected (), + //~| found *-ptr) [E0308] +} + +fn main() { } From 219385725185a6d7ece59ce881d0fcac4aedc4a3 Mon Sep 17 00:00:00 2001 From: Johannes Oertel Date: Sat, 2 May 2015 14:02:47 +0200 Subject: [PATCH 7/9] Add regression test for #19163 Closes #19163. --- src/test/auxiliary/issue-19163.rs | 16 ++++++++++++++++ src/test/compile-fail/issue-19163.rs | 21 +++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/test/auxiliary/issue-19163.rs create mode 100644 src/test/compile-fail/issue-19163.rs diff --git a/src/test/auxiliary/issue-19163.rs b/src/test/auxiliary/issue-19163.rs new file mode 100644 index 000000000000..76c5cdafd7cf --- /dev/null +++ b/src/test/auxiliary/issue-19163.rs @@ -0,0 +1,16 @@ +// 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_type = "lib"] + +#[macro_export] +macro_rules! mywrite { + ($dst:expr, $($arg:tt)*) => ($dst.write_fmt(format_args!($($arg)*))) +} diff --git a/src/test/compile-fail/issue-19163.rs b/src/test/compile-fail/issue-19163.rs new file mode 100644 index 000000000000..cd6f7c4fd8fc --- /dev/null +++ b/src/test/compile-fail/issue-19163.rs @@ -0,0 +1,21 @@ +// 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:issue-19163.rs + +#[macro_use] extern crate issue_19163; + +use std::io::Write; + +fn main() { + let mut v = vec![]; + mywrite!(&v, "Hello world"); + //~^ error: cannot borrow immutable borrowed content as mutable +} From 42123b75f97312dbc4227390c38bc448ae5b9054 Mon Sep 17 00:00:00 2001 From: Johannes Oertel Date: Sat, 2 May 2015 14:09:53 +0200 Subject: [PATCH 8/9] Add regression test for #19380 Closes #19380. --- src/test/compile-fail/issue-19380.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test/compile-fail/issue-19380.rs diff --git a/src/test/compile-fail/issue-19380.rs b/src/test/compile-fail/issue-19380.rs new file mode 100644 index 000000000000..dbc0e410cf95 --- /dev/null +++ b/src/test/compile-fail/issue-19380.rs @@ -0,0 +1,28 @@ +// 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Qiz { + fn qiz(); +} + +struct Foo; +impl Qiz for Foo { + fn qiz() {} +} + +struct Bar { + foos: &'static [&'static (Qiz + 'static)] +} + +const FOO : Foo = Foo; +const BAR : Bar = Bar { foos: &[&FOO]}; +//~^ ERROR: cannot convert to a trait object because trait `Qiz` is not object-safe [E0038] + +fn main() { } From e7d052ebd943762c4dbfd9a7a0525f3288a26ffa Mon Sep 17 00:00:00 2001 From: Johannes Oertel Date: Sat, 2 May 2015 15:06:00 +0200 Subject: [PATCH 9/9] Remove several FIXMEs --- .../run-pass/associated-types-impl-redirect.rs | 2 -- ...ciated-types-where-clause-impl-ambiguity.rs | 2 -- .../deriving-cmp-generic-struct-enum.rs | 3 --- .../run-pass/deriving-cmp-generic-struct.rs | 3 --- .../deriving-cmp-generic-tuple-struct.rs | 3 --- .../deriving-self-lifetime-totalord-totaleq.rs | 4 +--- src/test/run-pass/generic-recursive-tag.rs | 2 -- src/test/run-pass/issue-19081.rs | 2 -- src/test/run-pass/last-use-in-cap-clause.rs | 1 - src/test/run-pass/ufcs-polymorphic-paths.rs | 12 ++++-------- src/test/run-pass/unfold-cross-crate.rs | 3 --- src/test/run-pass/utf8.rs | 2 -- src/test/run-pass/vec-fixed-length.rs | 18 +++++++++++------- 13 files changed, 16 insertions(+), 41 deletions(-) diff --git a/src/test/run-pass/associated-types-impl-redirect.rs b/src/test/run-pass/associated-types-impl-redirect.rs index d9d11c95adbd..4082580a123f 100644 --- a/src/test/run-pass/associated-types-impl-redirect.rs +++ b/src/test/run-pass/associated-types-impl-redirect.rs @@ -14,8 +14,6 @@ // for `ByRef`. The right answer was to consider the result ambiguous // until more type information was available. -// ignore-pretty -- FIXME(#17362) - #![feature(lang_items, unboxed_closures)] #![no_implicit_prelude] diff --git a/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs b/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs index 4152321cab81..082ad53d5593 100644 --- a/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs +++ b/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs @@ -14,8 +14,6 @@ // for `ByRef`. The right answer was to consider the result ambiguous // until more type information was available. -// ignore-pretty -- FIXME(#17362) pretty prints with `<<` which lexes wrong - #![feature(lang_items, unboxed_closures)] #![no_implicit_prelude] diff --git a/src/test/run-pass/deriving-cmp-generic-struct-enum.rs b/src/test/run-pass/deriving-cmp-generic-struct-enum.rs index 14f7862ef21f..f061b6cf4c1b 100644 --- a/src/test/run-pass/deriving-cmp-generic-struct-enum.rs +++ b/src/test/run-pass/deriving-cmp-generic-struct-enum.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// no-pretty-expanded FIXME #15189 - - #[derive(PartialEq, Eq, PartialOrd, Ord)] enum ES { ES1 { x: T }, diff --git a/src/test/run-pass/deriving-cmp-generic-struct.rs b/src/test/run-pass/deriving-cmp-generic-struct.rs index 5c7d806f519d..d6c73f394aca 100644 --- a/src/test/run-pass/deriving-cmp-generic-struct.rs +++ b/src/test/run-pass/deriving-cmp-generic-struct.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// no-pretty-expanded FIXME #15189 - - #[derive(PartialEq, Eq, PartialOrd, Ord)] struct S { x: T, diff --git a/src/test/run-pass/deriving-cmp-generic-tuple-struct.rs b/src/test/run-pass/deriving-cmp-generic-tuple-struct.rs index b7bfb91b278a..fc256228507f 100644 --- a/src/test/run-pass/deriving-cmp-generic-tuple-struct.rs +++ b/src/test/run-pass/deriving-cmp-generic-tuple-struct.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// no-pretty-expanded FIXME #15189 - - #[derive(PartialEq, Eq, PartialOrd, Ord)] struct TS(T,T); diff --git a/src/test/run-pass/deriving-self-lifetime-totalord-totaleq.rs b/src/test/run-pass/deriving-self-lifetime-totalord-totaleq.rs index 7a0d35f6f499..3fdf840d5963 100644 --- a/src/test/run-pass/deriving-self-lifetime-totalord-totaleq.rs +++ b/src/test/run-pass/deriving-self-lifetime-totalord-totaleq.rs @@ -8,11 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-test FIXME #11820: & is unreliable in deriving - use std::cmp::Ordering::{Less,Equal,Greater}; -#[derive(Eq,Ord)] +#[derive(PartialEq, Eq, PartialOrd, Ord)] struct A<'a> { x: &'a isize } diff --git a/src/test/run-pass/generic-recursive-tag.rs b/src/test/run-pass/generic-recursive-tag.rs index 863e0d7e3333..433bd7cd906e 100644 --- a/src/test/run-pass/generic-recursive-tag.rs +++ b/src/test/run-pass/generic-recursive-tag.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-pretty FIXME(#14193) - #![allow(unknown_features)] #![feature(box_syntax)] diff --git a/src/test/run-pass/issue-19081.rs b/src/test/run-pass/issue-19081.rs index 83ba322ba301..8e2fa2b61971 100644 --- a/src/test/run-pass/issue-19081.rs +++ b/src/test/run-pass/issue-19081.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-pretty -- FIXME(#17362) pretty prints as `Hash< } fn foo() -> Box isize + 'static> { let k: Box<_> = box 22; let _u = A {a: k.clone()}; - // FIXME(#16640) suffix in `22` suffix shouldn't be necessary let result = || 22; // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. Box::new(result) diff --git a/src/test/run-pass/ufcs-polymorphic-paths.rs b/src/test/run-pass/ufcs-polymorphic-paths.rs index eec852ae181c..a8240dfbd1f8 100644 --- a/src/test/run-pass/ufcs-polymorphic-paths.rs +++ b/src/test/run-pass/ufcs-polymorphic-paths.rs @@ -17,9 +17,6 @@ use std::default::Default; use std::iter::FromIterator; use std::ops::Add; use std::option::IntoIter as OptionIter; -// FIXME the glob std::prelude::*; import of Vec is missing non-static inherent -// methods. -use std::vec::Vec; pub struct XorShiftRng; use XorShiftRng as DummyRng; @@ -81,11 +78,10 @@ tests! { Vec::map_in_place, fn(Vec, fn(u8) -> i8) -> Vec, (vec![b'f', b'o', b'o'], u8_as_i8); Vec::map_in_place:: i8>, fn(Vec, fn(u8) -> i8) -> Vec, (vec![b'f', b'o', b'o'], u8_as_i8); - // FIXME these break with "type parameter might not appear here pointing at ``. - // Vec::::map_in_place: fn(Vec, fn(u8) -> i8) -> Vec - // , (vec![b'f', b'o', b'o'], u8_as_i8); - // Vec::::map_in_place:: i8>: fn(Vec, fn(u8) -> i8) -> Vec - // , (vec![b'f', b'o', b'o'], u8_as_i8); + Vec::::map_in_place, fn(Vec, fn(u8) -> i8) -> Vec + , (vec![b'f', b'o', b'o'], u8_as_i8); + Vec::::map_in_place:: i8>, fn(Vec, fn(u8) -> i8) -> Vec + , (vec![b'f', b'o', b'o'], u8_as_i8); // Trait static methods. bool::size, fn() -> usize, (); diff --git a/src/test/run-pass/unfold-cross-crate.rs b/src/test/run-pass/unfold-cross-crate.rs index 5c699bf3044e..938b5dc61672 100644 --- a/src/test/run-pass/unfold-cross-crate.rs +++ b/src/test/run-pass/unfold-cross-crate.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// no-pretty-expanded FIXME #15189 - - #![feature(core)] use std::iter::Unfold; diff --git a/src/test/run-pass/utf8.rs b/src/test/run-pass/utf8.rs index 4782edf4e129..ec1c6970ea0c 100644 --- a/src/test/run-pass/utf8.rs +++ b/src/test/run-pass/utf8.rs @@ -7,8 +7,6 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -// -// no-pretty-expanded FIXME #15189 pub fn main() { let yen: char = '¥'; // 0xa5 diff --git a/src/test/run-pass/vec-fixed-length.rs b/src/test/run-pass/vec-fixed-length.rs index fbaba9b8a619..befb27e6ccb0 100644 --- a/src/test/run-pass/vec-fixed-length.rs +++ b/src/test/run-pass/vec-fixed-length.rs @@ -11,7 +11,16 @@ use std::mem::size_of; -pub fn main() { +#[cfg(not(target_pointer_width = "64"))] +fn test_big_vec() {} + +#[cfg(target_pointer_width = "64")] +fn test_big_vec() +{ + assert_eq!(size_of::<[u8; (1 << 32)]>(), (1 << 32)); +} + +fn main() { let x: [isize; 4] = [1, 2, 3, 4]; assert_eq!(x[0], 1); assert_eq!(x[1], 2); @@ -19,10 +28,5 @@ pub fn main() { assert_eq!(x[3], 4); assert_eq!(size_of::<[u8; 4]>(), 4); - - // FIXME #10183 - // FIXME #18069 - //if cfg!(target_pointer_width = "64") { - // assert_eq!(size_of::<[u8; (1 << 32)]>(), (1 << 32)); - //} + test_big_vec(); }