use std::io::Read;
use std::usize;
-#[derive(Clone, Copy, PartialEq)]
+#[derive(Clone, Copy, PartialEq, Debug)]
pub enum CommentStyle {
/// No code on either side of each line of the comment
Isolated,
fn consume_whitespace_counting_blank_lines(rdr: &mut StringReader, comments: &mut Vec<Comment>) {
while is_pattern_whitespace(rdr.ch) && !rdr.is_eof() {
- if rdr.col == CharPos(0) && rdr.ch_is('\n') {
+ if rdr.ch_is('\n') {
push_blank_line_comment(rdr, &mut *comments);
}
rdr.bump();
}
}
-
fn read_shebang_comment(rdr: &mut StringReader,
code_to_the_left: bool,
comments: &mut Vec<Comment>) {
}
-fn consume_comment(rdr: &mut StringReader, code_to_the_left: bool, comments: &mut Vec<Comment>) {
+fn consume_comment(rdr: &mut StringReader,
+ comments: &mut Vec<Comment>,
+ code_to_the_left: &mut bool,
+ anything_to_the_left: &mut bool) {
debug!(">>> consume comment");
if rdr.ch_is('/') && rdr.nextch_is('/') {
- read_line_comments(rdr, code_to_the_left, comments);
+ read_line_comments(rdr, *code_to_the_left, comments);
+ *code_to_the_left = false;
+ *anything_to_the_left = false;
} else if rdr.ch_is('/') && rdr.nextch_is('*') {
- read_block_comment(rdr, code_to_the_left, comments);
+ read_block_comment(rdr, *code_to_the_left, comments);
+ *anything_to_the_left = true;
} else if rdr.ch_is('#') && rdr.nextch_is('!') {
- read_shebang_comment(rdr, code_to_the_left, comments);
+ read_shebang_comment(rdr, *code_to_the_left, comments);
+ *code_to_the_left = false;
+ *anything_to_the_left = false;
} else {
panic!();
}
let mut comments: Vec<Comment> = Vec::new();
let mut literals: Vec<Literal> = Vec::new();
- let mut first_read: bool = true;
+ let mut code_to_the_left = false; // Only code
+ let mut anything_to_the_left = false; // Code or comments
while !rdr.is_eof() {
loop {
- let mut code_to_the_left = !first_read;
+ // Eat all the whitespace and count blank lines.
rdr.consume_non_eol_whitespace();
if rdr.ch_is('\n') {
- code_to_the_left = false;
+ if anything_to_the_left {
+ rdr.bump(); // The line is not blank, do not count.
+ }
consume_whitespace_counting_blank_lines(&mut rdr, &mut comments);
+ code_to_the_left = false;
+ anything_to_the_left = false;
}
- while rdr.peeking_at_comment() {
- consume_comment(&mut rdr, code_to_the_left, &mut comments);
- consume_whitespace_counting_blank_lines(&mut rdr, &mut comments);
+ // Eat one comment group
+ if rdr.peeking_at_comment() {
+ consume_comment(&mut rdr, &mut comments,
+ &mut code_to_the_left, &mut anything_to_the_left);
+ } else {
+ break
}
- break;
}
-
let bstart = rdr.pos;
rdr.next_token();
// discard, and look ahead; we're working with internal state
} else {
debug!("tok: {}", pprust::token_to_string(&tok));
}
- first_read = false;
+ code_to_the_left = true;
+ anything_to_the_left = true;
}
(comments, literals)
}
fn maybe_print_comment(&mut self, pos: BytePos) -> io::Result<()> {
- loop {
- match self.next_comment() {
- Some(ref cmnt) => {
- if (*cmnt).pos < pos {
- try!(self.print_comment(cmnt));
- self.cur_cmnt_and_lit().cur_cmnt += 1;
- } else { break; }
- }
- _ => break
+ while let Some(ref cmnt) = self.next_comment() {
+ if cmnt.pos < pos {
+ try!(self.print_comment(cmnt));
+ self.cur_cmnt_and_lit().cur_cmnt += 1;
+ } else {
+ break
}
}
Ok(())
Ok(())
}
comments::Trailing => {
- try!(word(self.writer(), " "));
+ if !self.is_bol() {
+ try!(word(self.writer(), " "));
+ }
if cmnt.lines.len() == 1 {
try!(word(self.writer(), &cmnt.lines[0]));
hardbreak(self.writer())
for (i, st) in blk.stmts.iter().enumerate() {
match st.node {
ast::StmtKind::Expr(ref expr) if i == blk.stmts.len() - 1 => {
+ try!(self.maybe_print_comment(st.span.lo));
try!(self.space_if_not_bol());
try!(self.print_expr_outer_attr_style(&expr, false));
try!(self.maybe_print_trailing_comment(expr.span, Some(blk.span.hi)));
}
try!(self.cbox(INDENT_UNIT));
try!(self.ibox(0));
+ try!(self.maybe_print_comment(arm.pats[0].span.lo));
try!(self.print_outer_attributes(&arm.attrs));
let mut first = true;
for p in &arm.pats {
_ => return Ok(())
};
if let Some(ref cmnt) = self.next_comment() {
- if (*cmnt).style != comments::Trailing { return Ok(()) }
+ if cmnt.style != comments::Trailing { return Ok(()) }
let span_line = cm.lookup_char_pos(span.hi);
- let comment_line = cm.lookup_char_pos((*cmnt).pos);
- let mut next = (*cmnt).pos + BytePos(1);
- if let Some(p) = next_pos {
- next = p;
- }
- if span.hi < (*cmnt).pos && (*cmnt).pos < next &&
- span_line.line == comment_line.line {
+ let comment_line = cm.lookup_char_pos(cmnt.pos);
+ let next = next_pos.unwrap_or(cmnt.pos + BytePos(1));
+ if span.hi < cmnt.pos && cmnt.pos < next && span_line.line == comment_line.line {
self.print_comment(cmnt)?;
self.cur_cmnt_and_lit.cur_cmnt += 1;
}
// The problem was specified to casting to `*`, as creating unsafe
// pointers was not being fully checked. Issue #20791.
-// pretty-expanded FIXME #23616
-
fn main() {
let x: &i32;
let y = x as *const i32; //~ ERROR use of possibly uninitialized variable: `*x`
// aux-build:coherence_lib.rs
-// pretty-expanded FIXME #23616
-
// Test that the `Pair` type reports an error if it contains type
// parameters, even when they are covered by local types. This test
// was originally intended to test the opposite, but the rules changed
// aux-build:coherence_lib.rs
-// pretty-expanded FIXME #23616
-
extern crate coherence_lib as lib;
use lib::Remote;
// aux-build:coherence_lib.rs
-// pretty-expanded FIXME #23616
-
extern crate coherence_lib as lib;
use lib::Remote;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// pretty-expanded FIXME #23616
-
fn foo(_: Box<FnMut()>) {}
fn main() {
// Test that a partially specified trait object with unspecified associated
// type does not type-check.
-// pretty-expanded FIXME #23616
-
trait Foo {
type A;
// except according to those terms.
// revisions: a
-// pretty-expanded FIXME #23616
// Counterpart to `meta-expected-error-wrong-rev.rs`
// revisions: a
// should-fail
-// pretty-expanded FIXME #23616
// This is a "meta-test" of the compilertest framework itself. In
// particular, it includes the right error message, but the message
// Test that the lifetime from the enclosing `&` is "inherited"
// through the `Box` struct.
-// pretty-expanded FIXME #23616
-
#![allow(dead_code)]
trait Test {
// Test that the lifetime from the enclosing `&` is "inherited"
// through the `MyBox` struct.
-// pretty-expanded FIXME #23616
-
#![allow(dead_code)]
#![feature(rustc_error)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// pretty-expanded FIXME #23616
-
#![allow(dead_code)]
// Get<T> is covariant in T
for e in v {
n = *e; // This comment once triggered pretty printer bug
}
-
n
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:attempt to divide by zero
fn main() {
// Issue #7580
-// ignore-pretty
-//
-// Expanded pretty printing causes resolve conflicts.
-
// error-pattern:panic works
use std::*;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:attempt to calculate the remainder with a divisor of zero
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to add with overflow'
// compile-flags: -C debug-assertions
-
fn main() {
let _x = 200u8 + 200u8 + 200u8;
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to shift left with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to negate with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to shift right with overflow'
// compile-flags: -C debug-assertions
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// error-pattern:thread 'main' panicked at 'attempt to subtract with overflow'
// compile-flags: -C debug-assertions
// error-pattern:runned an unexported test
// compile-flags:--test
// check-stdout
-// ignore-pretty: does not work well with `--test`
mod m {
pub fn exported() {}
// check-stdout
// error-pattern:thread 'test_foo' panicked at
// compile-flags: --test
-// ignore-pretty: does not work well with `--test`
// ignore-emscripten
#[test]
// check-stdout
// error-pattern:thread 'test_foo' panicked at
// compile-flags: --test
-// ignore-pretty: does not work well with `--test`
// ignore-emscripten
#[test]
// error-pattern:should be a positive integer
// compile-flags: --test
// exec-env:RUST_TEST_THREADS=foo
-// ignore-pretty: does not work well with `--test`
// ignore-emscripten
#[test]
// aux-build:custom_derive_partial_eq.rs
// ignore-stage1
-// ignore-pretty : (#23623) problems when ending with // comments
-
#![feature(plugin, custom_derive)]
#![plugin(custom_derive_partial_eq)]
#![allow(unused)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
// ignore-cross-compile
#![feature(quote, rustc_private)]
// except according to those terms.
// ignore-cross-compile
-// ignore-pretty: does not work well with `--test`
-
#![feature(quote, rustc_private)]
extern crate syntax;
// aux-build:lint_group_plugin_test.rs
// ignore-stage1
-// ignore-pretty
-
#![feature(plugin)]
#![plugin(lint_group_plugin_test)]
#![allow(dead_code)]
// aux-build:lint_plugin_test.rs
// ignore-stage1
-// ignore-pretty: Random space appears with the pretty test
// compile-flags: -Z extra-plugins=lint_plugin_test
#![allow(dead_code)]
// aux-build:lint_plugin_test.rs
// ignore-stage1
-// ignore-pretty
-
#![feature(plugin)]
#![plugin(lint_plugin_test)]
#![allow(dead_code)]
// except according to those terms.
// ignore-cross-compile
-// ignore-pretty: does not work well with `--test`
-
#![feature(quote, rustc_private)]
extern crate syntax;
// except according to those terms.
// ignore-cross-compile
-// ignore-pretty: does not work well with `--test`
-
#![feature(quote, rustc_private)]
#![deny(unused_variables)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// no-prefer-dynamic
#![allow(dead_code)]
// "enable" to 0 instead.
// compile-flags:-g -Cllvm-args=-enable-tail-merge=0
-// ignore-pretty as this critically relies on line numbers
+// ignore-pretty issue #37195
// ignore-emscripten spawning processes is not supported
use std::io;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// no-pretty-expanded FIXME #15189
// ignore-android FIXME #17520
// ignore-emscripten spawning processes is not supported
// compile-flags:-g
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37199
fn match_ref(v: Option<isize>) -> isize {
match v {
// except according to those terms.
// compile-flags: --cfg bar -D warnings
-// ignore-pretty
-
#![cfg(bar)]
fn main() {}
// except according to those terms.
// ignore-windows - this is a unix-specific test
+// ignore-pretty issue #37199
// ignore-emscripten
-// ignore-pretty
-
#![feature(process_exec)]
use std::env;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
// compile-flags:--test
// ignore-emscripten
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-
mod foo {
#![macro_escape] //~ WARNING macro_escape is a deprecated synonym for macro_use
//~^ HELP consider an outer attribute
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-
#[macro_escape] //~ WARNING macro_escape is a deprecated synonym for macro_use
mod foo {
}
// 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 E<T> {
E0,
-// ignore-pretty
-
// 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.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//
-// ignore-pretty
-
#![warn(variant_size_differences)]
#![allow(dead_code)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty: pprust doesn't print hygiene output
-
// Test that labels injected by macros do not break hygiene. This
// checks cases where the macros invocations are under the rhs of a
// let statement.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// no-pretty-expanded unnecessary unsafe block generated
-
#![deny(warnings)]
#![allow(unused_must_use)]
#![allow(unused_features)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
#![feature(item_like_imports)]
#![allow(unused)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37199
// Don't panic on blocks without results
// There are several tests in this run-pass that raised
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-
macro_rules! third {
($e:expr) => ({let x = 2; $e[x]})
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-
use std::rc::Rc;
use std::cell::Cell;
// except according to those terms.
// compile-flags:--test
-// no-pretty-expanded
// This verifies that the test generation doesn't crash when we have
// no tests - for more information, see PR #16892.
// except according to those terms.
// compile-flags:--test
-// ignore-pretty turns out the pretty-printer doesn't handle gensym'd things...
mod tests {
use super::*;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-
#![allow(unknown_features)]
struct Parser<'a, I, O> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-
#![deny(dead_code)]
const LOW_RANGE: char = '0';
// except according to those terms.
// aux-build:i8.rs
-// ignore-pretty (#23623)
+// ignore-pretty issue #37201
extern crate i8;
use std::string as i16;
// except according to those terms.
// compile-flags: --test
-// no-pretty-expanded
#![deny(unstable)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37201
struct X { val: i32 }
impl std::ops::Deref for X {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
+// ignore-pretty issue #37201
// This test is ensuring that parameters are indeed dropped after
// temporaries in a fn body.
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-//
-// ignore-pretty
+
+// ignore-pretty issue #37195
mod issue_26873_multifile;
fn main() {}
-
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty #27582
+// ignore-pretty issue #37201
// Check that when a `let`-binding occurs in a loop, its associated
// drop-flag is reinitialized (to indicate "needs-drop" at the end of
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-
fn main() {
const iter: i32 = 0;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems with newlines before // comments
+// ignore-pretty issue #37199
pub struct Foo;
// Regression test for #29740. Inefficient MIR matching algorithms
// generated way too much code for this sort of case, leading to OOM.
-// ignore-pretty
-
pub mod KeyboardEventConstants {
pub const DOM_KEY_LOCATION_STANDARD: u32 = 0;
pub const DOM_KEY_LOCATION_LEFT: u32 = 1;
// compile-flags:--test
// rustc-env:RUSTC_BOOTSTRAP_KEY=
-// ignore-pretty : (#23623) problems when ending with // comments
-
#![cfg(any())] // This test should be configured away
#![feature(rustc_attrs)] // Test that this is allowed on stable/beta
#![feature(iter_arith_traits)] // Test that this is not unused
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-
// (Closes #7911) Test that we can use the same self expression
// with different mutability in macro in two methods
// except according to those terms.
// ignore-emscripten no threads support
-// ignore-pretty : (#23623) problems when ending with // comments
-
#![feature(rustc_attrs, zero_one)]
use std::num::Zero;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty unreported
#![allow(unknown_features)]
#![feature(box_syntax)]
// NB: this file needs CRLF line endings. The .gitattributes file in\r
// this directory should enforce it.\r
\r
-// ignore-pretty\r
+// ignore-pretty issue #37195\r
\r
/// Doc comment that ends in CRLF\r
pub fn foo() {}\r
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// no-pretty-expanded FIXME #15189
-
pub fn main() {
let x = vec!(1, 2, 3);
let mut y = 0;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty - token trees can't pretty print
-
pub fn main() {
macro_rules! mylambda_tt {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty - token trees can't pretty print
-
macro_rules! descriptions {
($name:ident is $desc:expr) => {
// Check that we will correctly expand attributes
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty - token trees can't pretty print
-
#![feature(custom_attribute)]
macro_rules! compiles_fine {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37195
fn bar() {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty - token trees can't pretty print
// compile-flags: --cfg foo
macro_rules! compiles_fine {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty - token trees can't pretty print
-
macro_rules! make_foo {
() => (
struct Foo;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty - token trees can't pretty print
-
macro_rules! myfn {
( $f:ident, ( $( $x:ident ),* ), $body:block ) => (
fn $f( $( $x : isize),* ) -> isize $body
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty : (#23623) problems when ending with // comments
-
// check raw fat pointer ops in mir
// FIXME: please improve this when we get monomorphization support
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37195
mod mod_dir_implicit_aux;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37195
mod mod_dir_simple {
#[path = "test.rs"]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37195
#[path = "mod_dir_simple"]
mod pancakes {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37195
#[path = "mod_dir_simple"]
mod pancakes {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37195
#[path = "mod_dir_simple"]
mod biscuits {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37195
// Testing that the parser for each file tracks its modules
// and paths independently. The load_another_mod module should
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37195
mod mod_dir_simple {
pub mod test;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37195
// Testing that a plain .rs file can load modules from other source files
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
+// ignore-pretty issue #37195
// Testing that a plain .rs file can load modules from other source files
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// no-pretty-expanded
-
// This file is intended to test only that methods are automatically
// reachable for each numeric type, for each exported impl, with no imports
// necessary. Testing the methods of the impls is done within the source
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
// compile-flags:--test
#![reexport_test_harness_main = "test_main"]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-
#![feature(issue_5723_bootstrap)]
trait Foo {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-
#![feature(issue_5723_bootstrap)]
trait Foo {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty: `expand` adds some preludes before shebang
-//
-
pub fn main() { println!("Hello World"); }
#![feature(repr_simd, platform_intrinsics)]
-// ignore-pretty : (#23623) problems when ending with // comments
-
#[repr(simd)]
#[derive(Copy, Clone, Debug, PartialEq)]
#[allow(non_camel_case_types)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-//
// exec-env:RUST_MIN_STACK=16000000
// rustc-env:RUST_MIN_STACK=16000000
//
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(core)]
-
-// This test is brittle!
-// ignore-pretty - the pretty tests lose path information, breaking include!
+// ignore-pretty issue #37195
pub mod m1 {
pub mod m2 {
macro_rules! indirect_line { () => ( line!() ) }
pub fn main() {
- assert_eq!(line!(), 27);
+ assert_eq!(line!(), 24);
assert_eq!(column!(), 4);
- assert_eq!(indirect_line!(), 29);
+ assert_eq!(indirect_line!(), 26);
assert!((file!().ends_with("syntax-extension-source-utils.rs")));
assert_eq!(stringify!((2*3) + 5).to_string(), "( 2 * 3 ) + 5".to_string());
assert!(include!("syntax-extension-source-utils-files/includeme.\
// The Windows tests are wrapped in an extra module for some reason
assert!((m1::m2::where_am_i().ends_with("m1::m2")));
- assert_eq!((46, "( 2 * 3 ) + 5"), (line!(), stringify!((2*3) + 5)));
+ assert_eq!((43, "( 2 * 3 ) + 5"), (line!(), stringify!((2*3) + 5)));
}
#![feature(std_misc)]
// ignore-emscripten no threads support
-// no-pretty-expanded FIXME #15189
use std::thread;
use std::sync::mpsc::{channel, Sender};
#![feature(test)]
// compile-flags: --test
-// no-pretty-expanded
extern crate test;
#[bench]
// except according to those terms.
// compile-flags:--test
-// ignore-pretty: does not work well with `--test`
-
// Building as a test runner means that a synthetic main will be run,
// not ours
pub fn main() { panic!(); }
// except according to those terms.
// compile-flags: --test
-// ignore-pretty: does not work well with `--test`
-
#[test]
#[should_panic(expected = "foo")]
pub fn test_foo() {
// and shared between threads as long as all types fulfill Send.
// ignore-emscripten no threads support
-// ignore-pretty
-
#![allow(unknown_features)]
#![feature(box_syntax, std_misc)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-pretty
-
#![feature(untagged_unions)]
#![allow(dead_code)]
#![allow(unions_with_drop_fields)]