rustdoc: Replace no-pretty-expanded with pretty-expanded

Now that features must be declared expanded source often does not compile.
This adds 'pretty-expanded' to a bunch of test cases that still work.
This commit is contained in:
Brian Anderson 2015-03-22 13:13:15 -07:00
parent e9019101a8
commit 8c93a79e38
1544 changed files with 3093 additions and 12 deletions

View File

@ -40,8 +40,8 @@ pub struct TestProps {
pub check_stdout: bool,
// Don't force a --crate-type=dylib flag on the command line
pub no_prefer_dynamic: bool,
// Don't run --pretty expanded when running pretty printing tests
pub no_pretty_expanded: bool,
// Run --pretty expanded when running pretty printing tests
pub pretty_expanded: bool,
// Which pretty mode are we testing with, default to 'normal'
pub pretty_mode: String,
// Only compare pretty output and don't try compiling
@ -62,7 +62,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
let mut force_host = false;
let mut check_stdout = false;
let mut no_prefer_dynamic = false;
let mut no_pretty_expanded = false;
let mut pretty_expanded = false;
let mut pretty_mode = None;
let mut pretty_compare_only = false;
let mut forbid_output = Vec::new();
@ -96,8 +96,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
no_prefer_dynamic = parse_no_prefer_dynamic(ln);
}
if !no_pretty_expanded {
no_pretty_expanded = parse_no_pretty_expanded(ln);
if !pretty_expanded {
pretty_expanded = parse_pretty_expanded(ln);
}
if pretty_mode.is_none() {
@ -152,7 +152,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
force_host: force_host,
check_stdout: check_stdout,
no_prefer_dynamic: no_prefer_dynamic,
no_pretty_expanded: no_pretty_expanded,
pretty_expanded: pretty_expanded,
pretty_mode: pretty_mode.unwrap_or("normal".to_string()),
pretty_compare_only: pretty_compare_only,
forbid_output: forbid_output,
@ -295,8 +295,8 @@ fn parse_no_prefer_dynamic(line: &str) -> bool {
parse_name_directive(line, "no-prefer-dynamic")
}
fn parse_no_pretty_expanded(line: &str) -> bool {
parse_name_directive(line, "no-pretty-expanded")
fn parse_pretty_expanded(line: &str) -> bool {
parse_name_directive(line, "pretty-expanded")
}
fn parse_pretty_mode(line: &str) -> Option<String> {
@ -340,7 +340,8 @@ fn parse_pp_exact(line: &str, testfile: &Path) -> Option<PathBuf> {
}
fn parse_name_directive(line: &str, directive: &str) -> bool {
line.contains(directive)
// This 'no-' rule is a quick hack to allow pretty-expanded and no-pretty-expanded to coexist
line.contains(directive) && !line.contains(&("no-".to_string() + directive))
}
pub fn parse_name_value_directive(line: &str, directive: &str)

View File

@ -245,7 +245,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
if !proc_res.status.success() {
fatal_proc_rec("pretty-printed source does not typecheck", &proc_res);
}
if props.no_pretty_expanded { return }
if !props.pretty_expanded { return }
// additionally, run `--pretty expanded` and try to build it.
let proc_res = print_source(config, props, testfile, srcs[round].clone(), "expanded");

View File

@ -12,6 +12,8 @@
// Regression test for issue #374
// pretty-expanded FIXME #23616
enum sty { ty_nil, }
struct RawT {struct_: sty, cname: Option<String>, hash: uint}

View File

@ -9,6 +9,8 @@
// except according to those terms.
// pretty-expanded FIXME #23616
enum option<T> { some(T), none, }
struct R<T> {v: Vec<option<T>> }

View File

@ -9,6 +9,8 @@
// except according to those terms.
// aux-build:anon-extern-mod-cross-crate-1.rs
// pretty-expanded FIXME #23616
extern crate anonexternmod;
use anonexternmod::rust_get_test_int;

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(libc)]
extern crate libc;

View File

@ -9,6 +9,8 @@
// except according to those terms.
// pretty-expanded FIXME #23616
struct X {
x: int
}

View File

@ -10,6 +10,8 @@
// pretty-expanded FIXME #23616
pub fn main() {
let i32_c: int = 0x10101010;
assert!(i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3) ==

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(type_limits)]
// Unsigned integer operations

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
fn f() -> int { { return 3; } }
pub fn main() { assert!((f() == 3)); }

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
fn main() {
assert_eq!(3 as uint * 3, 9);
assert_eq!(3 as (uint) * 3, 9);

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(asm)]
pub fn main() {

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(asm)]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(asm)]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]

View File

@ -9,6 +9,8 @@
// except according to those terms.
// Issue 483 - Assignment expressions result in nil
// pretty-expanded FIXME #23616
fn test_assign() {
let mut x: int;
let y: () = x = 10;

View File

@ -12,6 +12,8 @@
// making method calls, but only if there aren't any matches without
// it.
// pretty-expanded FIXME #23616
#![feature(unboxed_closures)]
trait iterable<A> {

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(core)]
use std::marker::MarkerTrait;

View File

@ -11,6 +11,8 @@
// Test a case where the associated type binding (to `bool`, in this
// case) is derived from the trait definition. Issue #21636.
// pretty-expanded FIXME #23616
use std::vec;
pub trait BitIter {

View File

@ -10,6 +10,8 @@
// Test equality constraints on associated types in a where clause.
// pretty-expanded FIXME #23616
pub trait Foo {
type A;
fn boo(&self) -> <Self as Foo>::A;

View File

@ -10,6 +10,8 @@
// Test equality constrai32s on associated types in a where clause.
// pretty-expanded FIXME #23616
pub trait ToI32 {
fn to_i32(&self) -> i32;
}

View File

@ -14,6 +14,8 @@
// `Target=[A]`, then the impl marked with `(*)` is seen to conflict
// with all the others.
// pretty-expanded FIXME #23616
use std::marker::PhantomData;
use std::ops::Deref;

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
trait SignedUnsigned {
type Opposite;
fn convert(self) -> Self::Opposite;

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax)]

View File

@ -12,6 +12,8 @@
// (modulo bound lifetime names) appears in the environment
// twice. Issue #21965.
// pretty-expanded FIXME #23616
fn foo<T>(t: T) -> i32
where T : for<'a> Fn(&'a u8) -> i32,
T : for<'b> Fn(&'b u8) -> i32,

View File

@ -11,6 +11,8 @@
// Check that we do not report ambiguities when the same predicate
// appears in the environment twice. Issue #21965.
// pretty-expanded FIXME #23616
trait Foo {
type B;

View File

@ -10,6 +10,8 @@
// Test associated types appearing in struct-like enum variants.
// pretty-expanded FIXME #23616
use self::VarValue::*;
pub trait UnifyKey {

View File

@ -10,6 +10,8 @@
// Test associated types appearing in tuple-like enum variants.
// pretty-expanded FIXME #23616
use self::VarValue::*;
pub trait UnifyKey {

View File

@ -10,6 +10,8 @@
// Test equality constraints on associated types inside of an object type
// pretty-expanded FIXME #23616
pub trait Foo {
type A;
fn boo(&self) -> <Self as Foo>::A;

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
trait Get {
type Value;
fn get(&self) -> &<Self as Get>::Value;

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
trait Get {
type Value;
fn get(&self) -> &<Self as Get>::Value;

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
trait Get {
type Value;
fn get(&self) -> &<Self as Get>::Value;

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
trait Get {
type Value;
fn get(&self) -> &<Self as Get>::Value;

View File

@ -10,6 +10,8 @@
// Test references to `Self::Item` in the trait. Issue #20220.
// pretty-expanded FIXME #23616
use std::vec;
trait IntoIteratorX {

View File

@ -11,6 +11,8 @@
// Test that we are able to have an impl that defines an associated type
// before the actual trait.
// pretty-expanded FIXME #23616
#![feature(core)]
use std::marker::MarkerTrait;

View File

@ -13,6 +13,8 @@
// where clauses in the environment which in turn required normalizing
// `Self::Input`.
// pretty-expanded FIXME #23616
pub trait Parser {
type Input;

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
fn pairwise_sub<T:DoubleEndedIterator<Item=int>>(mut t: T) -> int {
let mut result = 0;
loop {

View File

@ -10,6 +10,8 @@
// Test that we can resolve nested projection types. Issue #20666.
// pretty-expanded FIXME #23616
#![feature(core)]
use std::marker::MarkerTrait;

View File

@ -11,6 +11,8 @@
// Test that we normalize associated types that appear in a bound that
// contains a binding. Issue #21664.
// pretty-expanded FIXME #23616
#![feature(core)]
#![allow(dead_code)]

View File

@ -11,6 +11,8 @@
// Test that we normalize associated types that appear in bounds; if
// we didn't, the call to `self.split2()` fails to type check.
// pretty-expanded FIXME #23616
use std::marker::PhantomData;
struct Splits<'a, T:'a, P>(PhantomData<(&'a T, P)>);

View File

@ -11,6 +11,8 @@
// Test that we normalize associated types that appear in bounds; if
// we didn't, the call to `self.split2()` fails to type check.
// pretty-expanded FIXME #23616
use std::marker::PhantomData;
struct Splits<'a, T, P>(PhantomData<(&'a(),T,P)>);

View File

@ -12,6 +12,8 @@
// various special paths in the `type_is_immediate` function.
// pretty-expanded FIXME #23616
pub trait OffsetState: Sized {}
pub trait Offset {
type State: OffsetState;

View File

@ -12,6 +12,8 @@
// `Item` originates in a where-clause, not the declaration of
// `T`. Issue #20300.
// pretty-expanded FIXME #23616
#![feature(core)]
use std::marker::{MarkerTrait, PhantomData};

View File

@ -10,6 +10,8 @@
// Test where the impl self type uses a projection from a constant type.
// pretty-expanded FIXME #23616
trait Int
{
type T;

View File

@ -13,6 +13,8 @@
// appear in associated type bindings in object types, which were not
// being properly flagged.
// pretty-expanded FIXME #23616
use std::ops::{Shl, Shr};
use std::cell::RefCell;

View File

@ -11,6 +11,8 @@
// Test that we are handle to correctly handle a projection type
// that appears in a supertrait bound. Issue #20559.
// pretty-expanded FIXME #23616
trait A
{
type TA;

View File

@ -10,6 +10,8 @@
// Test a where clause that uses a non-normalized projection type.
// pretty-expanded FIXME #23616
trait Int
{
type T;

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
trait Foo<T> {
type Bar;
fn get_bar() -> <Self as Foo<T>>::Bar;

View File

@ -10,6 +10,8 @@
// Test associated type references in structure fields.
// pretty-expanded FIXME #23616
trait Test {
type V;

View File

@ -10,6 +10,8 @@
// Test associated type references in a struct literal. Issue #20535.
// pretty-expanded FIXME #23616
pub trait Foo {
type Bar;

View File

@ -11,6 +11,8 @@
// Regression test for #20582. This test caused an ICE related to
// inconsistent region erasure in trans.
// pretty-expanded FIXME #23616
struct Foo<'a> {
buf: &'a[u8]
}

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
trait Get<T> {
fn get(&self) -> T;
}

View File

@ -10,6 +10,8 @@
// Test equality constraints on associated types in a where clause.
// pretty-expanded FIXME #23616
pub trait Foo {
type A;
fn boo(&self) -> <Self as Foo>::A;

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
trait Get {
type Value;
fn get(&self) -> &<Self as Get>::Value;

View File

@ -11,6 +11,8 @@
// Test references to the trait `Stream` in the bounds for associated
// types defined on `Stream`. Issue #20551.
// pretty-expanded FIXME #23616
trait Stream {
type Car;
type Cdr: Stream;

View File

@ -11,6 +11,8 @@
// Test that we correctly normalize the type of a struct field
// which has an associated type.
// pretty-expanded FIXME #23616
pub trait UnifyKey {
type Value;

View File

@ -11,6 +11,8 @@
// Test that we correctly normalize the type of a struct field
// which has an associated type.
// pretty-expanded FIXME #23616
pub trait UnifyKey {
type Value;

View File

@ -10,6 +10,8 @@
// Test paths to associated types using the type-parameter-only sugar.
// pretty-expanded FIXME #23616
pub trait Foo {
type A;
fn boo(&self) -> Self::A;

View File

@ -13,6 +13,8 @@
// carries a predicate that references the trait (`u32 : Trait1`,
// substituted).
// pretty-expanded FIXME #23616
#![allow(dead_code)]
trait Trait1 : Trait2<SomeType<u32>> {

View File

@ -10,6 +10,8 @@
// error-pattern:expected item
// pretty-expanded FIXME #23616
#![feature(custom_attribute, test)]
#[foo = "bar"]

View File

@ -10,6 +10,8 @@
// error-pattern:expected item
// pretty-expanded FIXME #23616
#![feature(custom_attribute, test)]
mod m {

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(main)]
pub fn main() {

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(main)]
#[main]

View File

@ -7,6 +7,8 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(unused_attribute)]
#![feature(custom_attribute)]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(unsafe_destructor)]
#![feature(unsafe_no_drop_flag)]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(start)]
#[start]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(main)]
#[main]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
pub fn main() {
let mut sum = 0;
let xs = vec!(1, 2, 3, 4, 5);

View File

@ -9,6 +9,8 @@
// except according to those terms.
// pretty-expanded FIXME #23616
trait Pushable<T> {
fn push_val(&mut self, t: T);
}

View File

@ -9,6 +9,8 @@
// except according to those terms.
// pretty-expanded FIXME #23616
fn f<T>(x: Vec<T>) -> T { return x.into_iter().next().unwrap(); }
fn g<F>(act: F) -> int where F: FnOnce(Vec<int>) -> int { return act(vec!(1, 2, 3)); }

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
struct Foo {
x: int,
}

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax)]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax)]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax)]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax)]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax)]

View File

@ -9,6 +9,8 @@
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax)]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
pub fn main() {
assert_eq!(0xffffffff, (-1 as u32));
assert_eq!(4294967295, (-1 as u32));

View File

@ -10,6 +10,8 @@
// Check that issue #954 stays fixed
// pretty-expanded FIXME #23616
pub fn main() {
match -1 { -1 => {}, _ => panic!("wat") }
assert_eq!(1-1, 0);

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
use std::sync::Arc;
fn dispose(_x: Arc<bool>) { }

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
pub fn main() {
struct Foo { x: int, y: int }
let mut f = Foo { x: 10, y: 0 };

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax, collections)]

View File

@ -11,6 +11,8 @@
// aux-build:blind-item-mixed-crate-use-item-foo.rs
// aux-build:blind-item-mixed-crate-use-item-foo2.rs
// pretty-expanded FIXME #23616
mod m {
pub fn f<T>(_: T, _: (), _: ()) { }
pub fn g<T>(_: T, _: (), _: ()) { }

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
mod m {
pub fn f<T>(_: T, _: ()) { }
pub fn g<T>(_: T, _: ()) { }

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
fn asBlock<F>(f: F) -> uint where F: FnOnce() -> uint {
return f();
}

View File

@ -13,6 +13,8 @@
// no-reformat
// pretty-expanded FIXME #23616
/*
*
* When you write a block-expression thing followed by

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
fn force<F>(f: F) -> int where F: FnOnce() -> int { return f(); }
pub fn main() {

View File

@ -11,6 +11,8 @@
// pretty-expanded FIXME #23616
pub fn main() {
if !false { assert!((true)); } else { assert!((false)); }
if !true { assert!((false)); } else { assert!((true)); }

View File

@ -10,6 +10,8 @@
// Basic boolean tests
// pretty-expanded FIXME #23616
use std::cmp::Ordering::{Equal, Greater, Less};
use std::ops::{BitAnd, BitOr, BitXor};

View File

@ -9,6 +9,8 @@
// except according to those terms.
// pretty-expanded FIXME #23616
trait Foo {
fn foo(self);
}

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
struct Foo(int, int);
fn main() {

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
pub fn main() {
struct A {
a: int,

View File

@ -9,6 +9,8 @@
// except according to those terms.
// pretty-expanded FIXME #23616
struct F { f: Vec<int> }
fn impure(_v: &[int]) {

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax)]

View File

@ -13,6 +13,8 @@
//
// Example from src/librustc_borrowck/borrowck/README.md
// pretty-expanded FIXME #23616
fn foo<'a>(mut t0: &'a mut int,
mut t1: &'a mut int) {
let p: &int = &*t0; // Freezes `*t0`

View File

@ -14,6 +14,8 @@
// that the main function can read the variable too while
// the closures are in scope. Issue #6801.
// pretty-expanded FIXME #23616
fn a() -> i32 {
let mut x = 3;
x += 1;

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax)]

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
pub fn main() {
let x = [22];
let y = &x[0];

View File

@ -10,6 +10,8 @@
// Test that a `&mut` inside of an `&` is freezable.
// pretty-expanded FIXME #23616
struct MutSlice<'a, T:'a> {
data: &'a mut [T]
}

View File

@ -9,6 +9,8 @@
// except according to those terms.
// pretty-expanded FIXME #23616
fn borrow(_v: &int) {}
fn borrow_from_arg_imm_ref(v: Box<int>) {

View File

@ -11,6 +11,8 @@
// Check that we do not ICE when compiling this
// macro, which reuses the expression `$id`
// pretty-expanded FIXME #23616
#![feature(box_patterns)]
#![feature(box_syntax)]

Some files were not shown because too many files have changed in this diff Show More