From 0b653ab9539140bb04941de9a36c03cf10bfc28b Mon Sep 17 00:00:00 2001 From: Gareth Daniel Smith Date: Sat, 30 Jun 2012 11:54:54 +0100 Subject: [PATCH 1/3] initial draft of fix for issue #2498: 1. make /// ... and //! ... and /** ... */ and /*! ... */ into sugar for #[doc = ...] attributes. 2. add a script in etc/ to help converting doc-attributes to doc-comments 3. add some functions to core::str to help with (1) --- src/etc/sugarise-doc-comments.py | 82 ++++++++++++++++++++ src/libcore/str.rs | 54 +++++++++++-- src/libsyntax/ast.rs | 3 +- src/libsyntax/attr.rs | 27 ++++++- src/libsyntax/fold.rs | 3 +- src/libsyntax/parse/attr.rs | 86 ++++++++++++++++----- src/libsyntax/parse/comments.rs | 128 +++++++++++++++++++++++++++---- src/libsyntax/parse/lexer.rs | 66 +++++++++++++--- src/libsyntax/parse/token.rs | 5 ++ src/libsyntax/print/pprust.rs | 16 +++- src/rustc/driver/session.rs | 3 +- src/rustc/metadata/decoder.rs | 3 +- src/rustdoc/attr_parser.rs | 5 +- src/test/pretty/doc-comments.rs | 32 ++++++++ 14 files changed, 454 insertions(+), 59 deletions(-) create mode 100644 src/etc/sugarise-doc-comments.py create mode 100644 src/test/pretty/doc-comments.rs diff --git a/src/etc/sugarise-doc-comments.py b/src/etc/sugarise-doc-comments.py new file mode 100644 index 0000000000000..04c8a4ebff25e --- /dev/null +++ b/src/etc/sugarise-doc-comments.py @@ -0,0 +1,82 @@ +#!/usr/bin/python + +# +# this script attempts to turn doc comment attributes (#[doc = "..."]) +# into sugared-doc-comments (/** ... */ and /// ...) +# +# it sugarises all .rs/.rc files underneath the working directory +# + +import sys, os, fnmatch, re + + +DOC_PATTERN = '^(?P[\\t ]*)#\\[(\\s*)doc(\\s*)=' + \ + '(\\s*)"(?P(\\"|[^"])*?)"(\\s*)\\]' + \ + '(?P;)?' + +ESCAPES = [("\\'", "'"), + ('\\"', '"'), + ("\\n", "\n"), + ("\\r", "\r"), + ("\\t", "\t")] + + +def unescape(s): + for (find, repl) in ESCAPES: + s = s.replace(find, repl) + return s + + +def block_trim(s): + lns = s.splitlines() + + # remove leading/trailing whitespace-lines + while lns and not lns[0].strip(): + lns = lns[1:] + while lns and not lns[-1].strip(): + lns = lns[:-1] + + # remove leading horizontal whitespace + n = sys.maxint + for ln in lns: + if ln.strip(): + n = min(n, len(re.search('^\s*', ln).group())) + if n != sys.maxint: + lns = [ln[n:] for ln in lns] + + # strip trailing whitespace + lns = [ln.rstrip() for ln in lns] + + return lns + + +def replace_doc(m): + indent = m.group('indent') + text = block_trim(unescape(m.group('text'))) + + if len(text) > 1: + inner = '!' if m.group('semi') else '*' + starify = lambda s: indent + ' *' + (' ' + s if s else '') + text = '\n'.join(map(starify, text)) + repl = indent + '/*' + inner + '\n' + text + '\n' + indent + ' */' + else: + inner = '!' if m.group('semi') else '/' + repl = indent + '//' + inner + ' ' + text[0] + + return repl + + +def sugarise_file(path): + s = open(path).read() + + r = re.compile(DOC_PATTERN, re.MULTILINE | re.DOTALL) + ns = re.sub(r, replace_doc, s) + + if s != ns: + open(path, 'w').write(ns) + + +for (dirpath, dirnames, filenames) in os.walk('.'): + for name in fnmatch.filter(filenames, '*.r[sc]'): + sugarise_file(os.path.join(dirpath, name)) + diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 35d2edd608ae5..8d98e39791c62 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -58,8 +58,8 @@ export all, any, all_between, any_between, map, - each, - each_char, + each, eachi, + each_char, each_chari, bytes_iter, chars_iter, split_char_iter, @@ -73,7 +73,7 @@ export find_char, find_char_from, find_char_between, rfind_char, rfind_char_from, rfind_char_between, find_str, find_str_from, find_str_between, - contains, + contains, contains_char, starts_with, ends_with, @@ -672,9 +672,15 @@ pure fn bytes_iter(ss: str/&, it: fn(u8)) { #[doc = "Iterate over the bytes in a string"] #[inline(always)] pure fn each(s: str/&, it: fn(u8) -> bool) { + eachi(s, {|_i, b| it(b)}) +} + +#[doc = "Iterate over the bytes in a string, with indices"] +#[inline(always)] +pure fn eachi(s: str/&, it: fn(uint, u8) -> bool) { let mut i = 0u, l = len(s); while (i < l) { - if !it(s[i]) { break; } + if !it(i, s[i]) { break; } i += 1u; } } @@ -682,12 +688,19 @@ pure fn each(s: str/&, it: fn(u8) -> bool) { #[doc = "Iterates over the chars in a string"] #[inline(always)] pure fn each_char(s: str/&, it: fn(char) -> bool) { - let mut pos = 0u; + each_chari(s, {|_i, c| it(c)}) +} + +#[doc = "Iterates over the chars in a string, with indices"] +#[inline(always)] +pure fn each_chari(s: str/&, it: fn(uint, char) -> bool) { + let mut pos = 0u, ch_pos = 0u; let len = len(s); while pos < len { let {ch, next} = char_range_at(s, pos); pos = next; - if !it(ch) { break; } + if !it(ch_pos, ch) { break; } + ch_pos += 1u; } } @@ -1146,6 +1159,18 @@ pure fn contains(haystack: str/&a, needle: str/&b) -> bool { option::is_some(find_str(haystack, needle)) } +#[doc = " +Returns true if a string contains a char. + +# Arguments + +* haystack - The string to look in +* needle - The char to look for +"] +pure fn contains_char(haystack: str/&, needle: char) -> bool { + option::is_some(find_char(haystack, needle)) +} + #[doc = " Returns true if one string starts with another @@ -1879,12 +1904,21 @@ impl extensions/& for str/& { #[doc = "Returns true if one string contains another"] #[inline] fn contains(needle: str/&a) -> bool { contains(self, needle) } + #[doc = "Returns true if a string contains a char"] + #[inline] + fn contains_char(needle: char) -> bool { contains_char(self, needle) } #[doc = "Iterate over the bytes in a string"] #[inline] fn each(it: fn(u8) -> bool) { each(self, it) } + #[doc = "Iterate over the bytes in a string, with indices"] + #[inline] + fn eachi(it: fn(uint, u8) -> bool) { eachi(self, it) } #[doc = "Iterate over the chars in a string"] #[inline] fn each_char(it: fn(char) -> bool) { each_char(self, it) } + #[doc = "Iterate over the chars in a string, with indices"] + #[inline] + fn each_chari(it: fn(uint, char) -> bool) { each_chari(self, it) } #[doc = "Returns true if one string ends with another"] #[inline] fn ends_with(needle: str/&) -> bool { ends_with(self, needle) } @@ -2644,6 +2678,14 @@ mod tests { assert !contains(data, "ไท华"); } + #[test] + fn test_contains_char() { + assert contains_char("abc", 'b'); + assert contains_char("a", 'a'); + assert !contains_char("abc", 'd'); + assert !contains_char("", 'a'); + } + #[test] fn test_chars_iter() { let mut i = 0; diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 3d2d28a9b1d58..d0876dd1062d1 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -652,8 +652,9 @@ type attribute = spanned; #[auto_serialize] enum attr_style { attr_outer, attr_inner, } +// doc-comments are promoted to attributes that have is_sugared_doc = true #[auto_serialize] -type attribute_ = {style: attr_style, value: meta_item}; +type attribute_ = {style: attr_style, value: meta_item, is_sugared_doc: bool}; /* iface_refs appear in both impls and in classes that implement ifaces. diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index c01c03bcd460a..64aacf8f0427b 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -4,7 +4,8 @@ import std::map; import std::map::hashmap; import either::either; import diagnostic::span_handler; -import ast_util::dummy_spanned; +import ast_util::{spanned, dummy_spanned}; +import parse::comments::{doc_comment_style, strip_doc_comment_decoration}; // Constructors export mk_name_value_item_str; @@ -12,10 +13,12 @@ export mk_name_value_item; export mk_list_item; export mk_word_item; export mk_attr; +export mk_sugared_doc_attr; // Conversion export attr_meta; export attr_metas; +export desugar_doc_attr; // Accessors export get_attr_name; @@ -66,9 +69,19 @@ fn mk_word_item(+name: ast::ident) -> @ast::meta_item { } fn mk_attr(item: @ast::meta_item) -> ast::attribute { - ret dummy_spanned({style: ast::attr_inner, value: *item}); + ret dummy_spanned({style: ast::attr_inner, value: *item, + is_sugared_doc: false}); } +fn mk_sugared_doc_attr(text: str, lo: uint, hi: uint) -> ast::attribute { + let lit = spanned(lo, hi, ast::lit_str(@text)); + let attr = { + style: doc_comment_style(text), + value: spanned(lo, hi, ast::meta_name_value(@"doc", lit)), + is_sugared_doc: true + }; + ret spanned(lo, hi, attr); +} /* Conversion */ @@ -81,6 +94,16 @@ fn attr_metas(attrs: [ast::attribute]/~) -> [@ast::meta_item]/~ { ret mitems; } +fn desugar_doc_attr(attr: ast::attribute) -> ast::attribute { + if attr.node.is_sugared_doc { + let comment = get_meta_item_value_str(@attr.node.value).get(); + let meta = mk_name_value_item_str(@"doc", + strip_doc_comment_decoration(*comment)); + ret mk_attr(meta); + } else { + attr + } +} /* Accessors */ diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 0f9397f5c2b04..1a2b19509b75d 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -102,7 +102,8 @@ fn fold_meta_item_(&&mi: @meta_item, fld: ast_fold) -> @meta_item { fn fold_attribute_(at: attribute, fld: ast_fold) -> attribute { ret {node: {style: at.node.style, - value: *fold_meta_item_(@at.node.value, fld)}, + value: *fold_meta_item_(@at.node.value, fld), + is_sugared_doc: at.node.is_sugared_doc }, span: fld.new_span(at.span)}; } //used in noop_fold_foreign_item and noop_fold_fn_decl diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index a349621091bab..3b7f31fb79fb2 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -15,7 +15,8 @@ impl parser_attr for parser { -> attr_or_ext { let expect_item_next = vec::is_not_empty(first_item_attrs); - if self.token == token::POUND { + alt self.token { + token::POUND { let lo = self.span.lo; if self.look_ahead(1u) == token::LBRACKET { self.bump(); @@ -30,15 +31,40 @@ impl parser_attr for parser { self.bump(); ret some(right(self.parse_syntax_ext_naked(lo))); } else { ret none; } - } else { ret none; } + } + token::DOC_COMMENT(_) { + ret some(left(self.parse_outer_attributes())); + } + _ { + ret none; + } + } } // Parse attributes that appear before an item fn parse_outer_attributes() -> [ast::attribute]/~ { let mut attrs: [ast::attribute]/~ = []/~; - while self.token == token::POUND - && self.look_ahead(1u) == token::LBRACKET { - vec::push(attrs, self.parse_attribute(ast::attr_outer)); + loop { + alt copy self.token { + token::POUND { + if self.look_ahead(1u) != token::LBRACKET { + break; + } + attrs += [self.parse_attribute(ast::attr_outer)]/~; + } + token::DOC_COMMENT(s) { + let attr = ::attr::mk_sugared_doc_attr( + *self.get_str(s), self.span.lo, self.span.hi); + if attr.node.style != ast::attr_outer { + self.fatal("expected outer comment"); + } + attrs += [attr]/~; + self.bump(); + } + _ { + break; + } + } } ret attrs; } @@ -55,7 +81,8 @@ impl parser_attr for parser { let meta_item = self.parse_meta_item(); self.expect(token::RBRACKET); let mut hi = self.span.hi; - ret spanned(lo, hi, {style: style, value: *meta_item}); + ret spanned(lo, hi, {style: style, value: *meta_item, + is_sugared_doc: false}); } // Parse attributes that appear after the opening of an item, each @@ -68,22 +95,41 @@ impl parser_attr for parser { {inner: [ast::attribute]/~, next: [ast::attribute]/~} { let mut inner_attrs: [ast::attribute]/~ = []/~; let mut next_outer_attrs: [ast::attribute]/~ = []/~; - while self.token == token::POUND { - if self.look_ahead(1u) != token::LBRACKET { - // This is an extension - break; - } - let attr = self.parse_attribute(ast::attr_inner); - if self.token == token::SEMI { + loop { + alt copy self.token { + token::POUND { + if self.look_ahead(1u) != token::LBRACKET { + // This is an extension + break; + } + let attr = self.parse_attribute(ast::attr_inner); + if self.token == token::SEMI { + self.bump(); + inner_attrs += [attr]/~; + } else { + // It's not really an inner attribute + let outer_attr = + spanned(attr.span.lo, attr.span.hi, + {style: ast::attr_outer, value: attr.node.value, + is_sugared_doc: false}); + next_outer_attrs += [outer_attr]/~; + break; + } + } + token::DOC_COMMENT(s) { + let attr = ::attr::mk_sugared_doc_attr( + *self.get_str(s), self.span.lo, self.span.hi); self.bump(); - vec::push(inner_attrs, attr); - } else { - // It's not really an inner attribute - let outer_attr = - spanned(attr.span.lo, attr.span.hi, - {style: ast::attr_outer, value: attr.node.value}); - vec::push(next_outer_attrs, outer_attr); + if attr.node.style == ast::attr_inner { + inner_attrs += [attr]/~; + } else { + next_outer_attrs += [attr]/~; + break; + } + } + _ { break; + } } } ret {inner: inner_attrs, next: next_outer_attrs}; diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index b6ab87ad1bcf1..7a6a9f0f3d767 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -8,6 +8,7 @@ export cmnt; export lit; export cmnt_style; export gather_comments_and_literals; +export is_doc_comment, doc_comment_style, strip_doc_comment_decoration; enum cmnt_style { isolated, // No code on either side of each line of the comment @@ -18,6 +19,81 @@ enum cmnt_style { type cmnt = {style: cmnt_style, lines: [str]/~, pos: uint}; +fn is_doc_comment(s: str) -> bool { + s.starts_with("///") || + s.starts_with("//!") || + s.starts_with("/**") || + s.starts_with("/*!") +} + +fn doc_comment_style(comment: str) -> ast::attr_style { + assert is_doc_comment(comment); + if comment.starts_with("//!") || comment.starts_with("/*!") { + ast::attr_inner + } else { + ast::attr_outer + } +} + +fn strip_doc_comment_decoration(comment: str) -> str { + + /// remove whitespace-only lines from the start/end of lines + fn vertical_trim(lines: [str]/~) -> [str]/~ { + let mut i = 0u, j = lines.len(); + while i < j && lines[i].trim().is_empty() { + i += 1u; + } + while j > i && lines[j - 1u].trim().is_empty() { + j -= 1u; + } + ret lines.slice(i, j); + } + + // drop leftmost columns that contain only values in chars + fn block_trim(lines: [str]/~, chars: str, max: option) -> [str]/~ { + + let mut i = max.get_default(uint::max_value); + for lines.each {|line| + if line.trim().is_empty() { + cont; + } + for line.each_chari {|j, c| + if j >= i { + break; + } + if !chars.contains_char(c) { + i = j; + break; + } + } + } + + ret lines.map {|line| + let chars = str::chars(line); + if i > chars.len() { + "" + } else { + str::from_chars(chars.slice(i, chars.len())) + } + }; + } + + if comment.starts_with("//") { + ret comment.slice(3u, comment.len()).trim(); + } + + if comment.starts_with("/*") { + let lines = str::lines_any(comment.slice(3u, comment.len() - 2u)); + let lines = vertical_trim(lines); + let lines = block_trim(lines, "\t ", none); + let lines = block_trim(lines, "*", some(1u)); + let lines = block_trim(lines, "\t ", none); + ret str::connect(lines, "\n"); + } + + fail "not a doc-comment: " + comment; +} + fn read_to_eol(rdr: string_reader) -> str { let mut val = ""; while rdr.curr != '\n' && !is_eof(rdr) { @@ -57,29 +133,41 @@ fn consume_whitespace_counting_blank_lines(rdr: string_reader, } } -fn read_shebang_comment(rdr: string_reader, code_to_the_left: bool) -> cmnt { + +fn read_shebang_comment(rdr: string_reader, code_to_the_left: bool, + &comments: [cmnt]/~) { #debug(">>> shebang comment"); let p = rdr.chpos; #debug("<<< shebang comment"); - ret {style: if code_to_the_left { trailing } else { isolated }, - lines: [read_one_line_comment(rdr)]/~, - pos: p}; + vec::push(comments, { + style: if code_to_the_left { trailing } else { isolated }, + lines: [read_one_line_comment(rdr)]/~, + pos: p + }); } -fn read_line_comments(rdr: string_reader, code_to_the_left: bool) -> cmnt { +fn read_line_comments(rdr: string_reader, code_to_the_left: bool, + &comments: [cmnt]/~) { #debug(">>> line comments"); let p = rdr.chpos; let mut lines: [str]/~ = []/~; while rdr.curr == '/' && nextch(rdr) == '/' { let line = read_one_line_comment(rdr); log(debug, line); + if is_doc_comment(line) { // doc-comments are not put in comments + break; + } vec::push(lines, line); consume_non_eol_whitespace(rdr); } #debug("<<< line comments"); - ret {style: if code_to_the_left { trailing } else { isolated }, - lines: lines, - pos: p}; + if !lines.is_empty() { + vec::push(comments, { + style: if code_to_the_left { trailing } else { isolated }, + lines: lines, + pos: p + }); + } } fn all_whitespace(s: str, begin: uint, end: uint) -> bool { @@ -101,13 +189,27 @@ fn trim_whitespace_prefix_and_push_line(&lines: [str]/~, vec::push(lines, s1); } -fn read_block_comment(rdr: string_reader, code_to_the_left: bool) -> cmnt { +fn read_block_comment(rdr: string_reader, code_to_the_left: bool, + &comments: [cmnt]/~) { #debug(">>> block comment"); let p = rdr.chpos; let mut lines: [str]/~ = []/~; let mut col: uint = rdr.col; bump(rdr); bump(rdr); + + // doc-comments are not really comments, they are attributes + if rdr.curr == '*' || rdr.curr == '!' { + while !(rdr.curr == '*' && nextch(rdr) == '/') && !is_eof(rdr) { + bump(rdr); + } + if !is_eof(rdr) { + bump(rdr); + bump(rdr); + } + ret; + } + let mut curr_line = "/*"; let mut level: int = 1; while level > 0 { @@ -143,7 +245,7 @@ fn read_block_comment(rdr: string_reader, code_to_the_left: bool) -> cmnt { style = mixed; } #debug("<<< block comment"); - ret {style: style, lines: lines, pos: p}; + vec::push(comments, {style: style, lines: lines, pos: p}); } fn peeking_at_comment(rdr: string_reader) -> bool { @@ -156,11 +258,11 @@ fn consume_comment(rdr: string_reader, code_to_the_left: bool, &comments: [cmnt]/~) { #debug(">>> consume comment"); if rdr.curr == '/' && nextch(rdr) == '/' { - vec::push(comments, read_line_comments(rdr, code_to_the_left)); + read_line_comments(rdr, code_to_the_left, comments); } else if rdr.curr == '/' && nextch(rdr) == '*' { - vec::push(comments, read_block_comment(rdr, code_to_the_left)); + read_block_comment(rdr, code_to_the_left, comments); } else if rdr.curr == '#' && nextch(rdr) == '!' { - vec::push(comments, read_shebang_comment(rdr, code_to_the_left)); + read_shebang_comment(rdr, code_to_the_left, comments); } else { fail; } #debug("<<< consume comment"); } diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 8687e011635a8..fec6d23a03b15 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -161,7 +161,11 @@ impl tt_reader_as_reader of reader for tt_reader { } fn string_advance_token(&&r: string_reader) { - consume_whitespace_and_comments(r); + for consume_whitespace_and_comments(r).each {|comment| + r.peek_tok = comment.tok; + r.peek_span = comment.sp; + ret; + } if is_eof(r) { r.peek_tok = token::EOF; @@ -277,22 +281,41 @@ fn is_hex_digit(c: char) -> bool { fn is_bin_digit(c: char) -> bool { ret c == '0' || c == '1'; } -fn consume_whitespace_and_comments(rdr: string_reader) { +// might return a sugared-doc-attr +fn consume_whitespace_and_comments(rdr: string_reader) + -> option<{tok: token::token, sp: span}> { while is_whitespace(rdr.curr) { bump(rdr); } ret consume_any_line_comment(rdr); } -fn consume_any_line_comment(rdr: string_reader) { +// might return a sugared-doc-attr +fn consume_any_line_comment(rdr: string_reader) + -> option<{tok: token::token, sp: span}> { if rdr.curr == '/' { alt nextch(rdr) { '/' { - while rdr.curr != '\n' && !is_eof(rdr) { bump(rdr); } - // Restart whitespace munch. - - ret consume_whitespace_and_comments(rdr); + bump(rdr); + bump(rdr); + // line comments starting with "///" or "//!" are doc-comments + if rdr.curr == '/' || rdr.curr == '!' { + let start_chpos = rdr.chpos - 2u; + let mut acc = "//"; + while rdr.curr != '\n' && !is_eof(rdr) { + str::push_char(acc, rdr.curr); + bump(rdr); + } + ret some({ + tok: token::DOC_COMMENT(intern(*rdr.interner, @acc)), + sp: ast_util::mk_sp(start_chpos, rdr.chpos) + }); + } else { + while rdr.curr != '\n' && !is_eof(rdr) { bump(rdr); } + // Restart whitespace munch. + ret consume_whitespace_and_comments(rdr); + } } '*' { bump(rdr); bump(rdr); ret consume_block_comment(rdr); } - _ { ret; } + _ {} } } else if rdr.curr == '#' { if nextch(rdr) == '!' { @@ -305,9 +328,34 @@ fn consume_any_line_comment(rdr: string_reader) { } } } + ret none; } -fn consume_block_comment(rdr: string_reader) { +// might return a sugared-doc-attr +fn consume_block_comment(rdr: string_reader) + -> option<{tok: token::token, sp: span}> { + + // block comments starting with "/**" or "/*!" are doc-comments + if rdr.curr == '*' || rdr.curr == '!' { + let start_chpos = rdr.chpos - 2u; + let mut acc = "/*"; + while !(rdr.curr == '*' && nextch(rdr) == '/') && !is_eof(rdr) { + str::push_char(acc, rdr.curr); + bump(rdr); + } + if is_eof(rdr) { + rdr.fatal("unterminated block doc-comment"); + } else { + acc += "*/"; + bump(rdr); + bump(rdr); + ret some({ + tok: token::DOC_COMMENT(intern(*rdr.interner, @acc)), + sp: ast_util::mk_sp(start_chpos, rdr.chpos) + }); + } + } + let mut level: int = 1; while level > 0 { if is_eof(rdr) { rdr.fatal("unterminated block comment"); } diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 8ab37e95d21d0..b3db69b5be65e 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -80,6 +80,7 @@ enum token { //ACTUALLY(whole_nonterminal), + DOC_COMMENT(str_num), EOF, } @@ -170,11 +171,15 @@ fn to_str(in: interner<@str>, t: token) -> str { + str::escape_default(*interner::get(in, s)) + "\"" } + /* Name components */ IDENT(s, _) { *interner::get(in, s) } UNDERSCORE { "_" } + + /* Other */ + DOC_COMMENT(s) { *interner::get(in, s) } EOF { "" } } } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 833da64af799b..02e9b8931f283 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -647,7 +647,9 @@ fn print_inner_attributes(s: ps, attrs: [ast::attribute]/~) { alt attr.node.style { ast::attr_inner { print_attribute(s, attr); - word(s.s, ";"); + if !attr.node.is_sugared_doc { + word(s.s, ";"); + } count += 1; } _ {/* fallthrough */ } @@ -659,9 +661,15 @@ fn print_inner_attributes(s: ps, attrs: [ast::attribute]/~) { fn print_attribute(s: ps, attr: ast::attribute) { hardbreak_if_not_bol(s); maybe_print_comment(s, attr.span.lo); - word(s.s, "#["); - print_meta_item(s, @attr.node.value); - word(s.s, "]"); + if attr.node.is_sugared_doc { + let meta = attr::attr_meta(attr); + let comment = attr::get_meta_item_value_str(meta).get(); + word(s.s, *comment); + } else { + word(s.s, "#["); + print_meta_item(s, @attr.node.value); + word(s.s, "]"); + } } diff --git a/src/rustc/driver/session.rs b/src/rustc/driver/session.rs index 263343d63d71f..4308a986efd9d 100644 --- a/src/rustc/driver/session.rs +++ b/src/rustc/driver/session.rs @@ -233,7 +233,8 @@ mod test { ast::meta_name_value( @"crate_type", ast_util::respan(ast_util::dummy_sp(), - ast::lit_str(@t)))) + ast::lit_str(@t)))), + is_sugared_doc: false }) } diff --git a/src/rustc/metadata/decoder.rs b/src/rustc/metadata/decoder.rs index b738f1988c23d..300b8be8e28d0 100644 --- a/src/rustc/metadata/decoder.rs +++ b/src/rustc/metadata/decoder.rs @@ -612,7 +612,8 @@ fn get_attributes(md: ebml::doc) -> [ast::attribute]/~ { assert (vec::len(meta_items) == 1u); let meta_item = meta_items[0]; vec::push(attrs, - {node: {style: ast::attr_outer, value: *meta_item}, + {node: {style: ast::attr_outer, value: *meta_item, + is_sugared_doc: false}, span: ast_util::dummy_sp()}); }; } diff --git a/src/rustdoc/attr_parser.rs b/src/rustdoc/attr_parser.rs index 44c2b8da3e662..e0a3b12c07cbe 100644 --- a/src/rustdoc/attr_parser.rs +++ b/src/rustdoc/attr_parser.rs @@ -44,7 +44,10 @@ fn doc_meta( doc attribute"]; let doc_attrs = attr::find_attrs_by_name(attrs, "doc"); - let doc_metas = attr::attr_metas(doc_attrs); + let doc_metas = doc_attrs.map {|attr| + attr::attr_meta(attr::desugar_doc_attr(attr)) + }; + if vec::is_not_empty(doc_metas) { if vec::len(doc_metas) != 1u { #warn("ignoring %u doc attributes", vec::len(doc_metas) - 1u); diff --git a/src/test/pretty/doc-comments.rs b/src/test/pretty/doc-comments.rs new file mode 100644 index 0000000000000..835c1d9640a0f --- /dev/null +++ b/src/test/pretty/doc-comments.rs @@ -0,0 +1,32 @@ +// pp-exact + +// some single-line non-doc comment + +/// some single line outer-docs +fn a() { } + +fn b() { + //! some single line inner-docs +} + +/* + * some multi-line non-doc comment + */ + +/** + * some multi-line outer-docs + */ +fn c() { } + +fn d() { + /*! + * some multi-line inner-docs + */ +} + +#[doc = "unsugared outer doc-comments work also"] +fn e() { } + +fn f() { + #[doc = "as do inner ones"]; +} From 6d86969260b73432c96b9a63a5a68559e56aabcd Mon Sep 17 00:00:00 2001 From: Gareth Daniel Smith Date: Sat, 30 Jun 2012 12:23:59 +0100 Subject: [PATCH 2/3] change the test suite `//! kind` syntax to `//~ kind` in order to avoid a conflict with the new single-line-sugared-inner-doc-comment (`//! ...`). --- src/compiletest/errors.rs | 4 +- src/test/compile-fail/alt-join.rs | 2 +- .../alt-pattern-field-mismatch-2.rs | 2 +- .../alt-pattern-field-mismatch.rs | 2 +- src/test/compile-fail/ambig_impl_1.rs | 6 +- src/test/compile-fail/ambig_impl_2_exe.rs | 6 +- src/test/compile-fail/ambig_impl_bounds.rs | 6 +- src/test/compile-fail/ambig_impl_unify.rs | 6 +- .../compile-fail/assign-imm-local-twice.rs | 4 +- src/test/compile-fail/assign-super.rs | 2 +- src/test/compile-fail/assign-to-method.rs | 2 +- .../attempted-access-non-fatal.rs | 4 +- src/test/compile-fail/attr-before-ext.rs | 2 +- src/test/compile-fail/attr-before-let.rs | 2 +- src/test/compile-fail/bad-bang-ann-3.rs | 2 +- src/test/compile-fail/bad-bang-ann.rs | 2 +- src/test/compile-fail/bad-for-loop.rs | 2 +- .../compile-fail/bad-method-typaram-kind.rs | 2 +- .../compile-fail/bad-value-ident-false.rs | 2 +- src/test/compile-fail/bad-value-ident-true.rs | 2 +- .../bad-var-env-capture-in-block-arg.rs | 2 +- src/test/compile-fail/bang-tailexpr.rs | 2 +- src/test/compile-fail/binop-typeck.rs | 2 +- .../block-arg-as-stmt-with-value.rs | 2 +- src/test/compile-fail/block-coerce-no-2.rs | 2 +- src/test/compile-fail/block-coerce-no.rs | 2 +- .../compile-fail/borrowck-assign-comp-idx.rs | 8 +-- src/test/compile-fail/borrowck-assign-comp.rs | 12 ++-- .../borrowck-assign-to-constants.rs | 4 +- .../compile-fail/borrowck-assign-to-enum.rs | 2 +- .../borrowck-assign-to-subfield.rs | 4 +- .../compile-fail/borrowck-binding-mutbl.rs | 4 +- .../compile-fail/borrowck-issue-2657-1.rs | 4 +- .../compile-fail/borrowck-issue-2657-2.rs | 2 +- src/test/compile-fail/borrowck-lend-args.rs | 4 +- src/test/compile-fail/borrowck-lend-flow.rs | 28 ++++---- .../borrowck-loan-blocks-move-cc.rs | 8 +-- .../compile-fail/borrowck-loan-blocks-move.rs | 4 +- .../borrowck-loan-blocks-mut-uniq.rs | 4 +- .../borrowck-loan-rcvr-overloaded-op.rs | 12 ++-- src/test/compile-fail/borrowck-loan-rcvr.rs | 16 ++--- .../compile-fail/borrowck-loan-vec-content.rs | 4 +- .../borrowck-move-from-unsafe-ptr.rs | 2 +- .../borrowck-mut-addr-of-imm-var.rs | 2 +- .../borrowck-mut-vec-as-imm-slice-bad.rs | 4 +- .../borrowck-no-cycle-in-exchange-heap.rs | 4 +- .../compile-fail/borrowck-pat-enum-in-box.rs | 4 +- src/test/compile-fail/borrowck-pat-enum.rs | 4 +- .../borrowck-pat-reassign-binding.rs | 4 +- ...borrowck-pat-reassign-sometimes-binding.rs | 4 +- .../borrowck-pure-scope-in-call.rs | 8 +-- .../borrowck-unchecked-with-borrow.rs | 4 +- .../compile-fail/borrowck-uniq-via-box.rs | 36 +++++----- .../compile-fail/borrowck-uniq-via-lend.rs | 8 +-- .../compile-fail/borrowck-uniq-via-ref.rs | 36 +++++----- .../compile-fail/cap-clause-move-upvar.rs | 2 +- .../cap-clause-with-stack-closure.rs | 4 +- src/test/compile-fail/class-implements-int.rs | 2 +- src/test/compile-fail/class-missing-self.rs | 4 +- src/test/compile-fail/do1.rs | 2 +- src/test/compile-fail/do2.rs | 2 +- .../compile-fail/empty-vec-trailing-comma.rs | 2 +- src/test/compile-fail/enum-in-scope.rs | 2 +- src/test/compile-fail/estr-subtyping.rs | 18 ++--- src/test/compile-fail/evec-subtyping.rs | 18 ++--- src/test/compile-fail/fn-compare-mismatch.rs | 2 +- src/test/compile-fail/fn-variance-1.rs | 4 +- src/test/compile-fail/fn-variance-2.rs | 2 +- src/test/compile-fail/fn-variance-3.rs | 2 +- .../fully-qualified-type-name1.rs | 2 +- .../fully-qualified-type-name2.rs | 2 +- .../fully-qualified-type-name3.rs | 2 +- .../fully-qualified-type-name4.rs | 2 +- src/test/compile-fail/iface-cast.rs | 2 +- .../iface-impl-different-num-params.rs | 2 +- src/test/compile-fail/iface-test-2.rs | 8 +-- src/test/compile-fail/iface-test.rs | 6 +- src/test/compile-fail/impure-pred.rs | 2 +- src/test/compile-fail/index_message.rs | 2 +- .../integer-literal-suffix-inference.rs | 72 +++++++++---------- src/test/compile-fail/issue-1362.rs | 2 +- src/test/compile-fail/issue-1448-1.rs | 2 +- src/test/compile-fail/issue-1448-2.rs | 2 +- src/test/compile-fail/issue-1697.rs | 4 +- src/test/compile-fail/issue-1763.rs | 2 +- src/test/compile-fail/issue-1896.rs | 2 +- src/test/compile-fail/issue-1962.rs | 2 +- src/test/compile-fail/issue-2063-resource.rs | 4 +- src/test/compile-fail/issue-2063.rs | 2 +- src/test/compile-fail/issue-2111.rs | 2 +- src/test/compile-fail/issue-2149.rs | 4 +- src/test/compile-fail/issue-2150.rs | 4 +- src/test/compile-fail/issue-2151.rs | 2 +- src/test/compile-fail/issue-2330.rs | 2 +- src/test/compile-fail/issue-2354.rs | 2 +- src/test/compile-fail/issue-2467.rs | 4 +- src/test/compile-fail/issue-2487-b.rs | 2 +- src/test/compile-fail/issue-2509-a.rs | 2 +- src/test/compile-fail/issue-2590.rs | 2 +- src/test/compile-fail/issue-2718-a.rs | 2 +- src/test/compile-fail/issue-511.rs | 6 +- src/test/compile-fail/issue-897-2.rs | 4 +- src/test/compile-fail/issue-897.rs | 4 +- .../kindck-implicit-close-over-mut-var.rs | 4 +- src/test/compile-fail/kindck-nonsendable-1.rs | 6 +- src/test/compile-fail/liveness-and-init.rs | 2 +- .../liveness-assign-imm-local-in-loop.rs | 4 +- .../liveness-assign-imm-local-in-op-eq.rs | 4 +- .../liveness-assign-imm-local-in-swap.rs | 8 +-- .../liveness-assign-imm-local-with-init.rs | 4 +- src/test/compile-fail/liveness-block-unint.rs | 2 +- .../compile-fail/liveness-break-uninit-2.rs | 4 +- .../compile-fail/liveness-break-uninit.rs | 4 +- ...ess-ctor-access-self-with-uninit-fields.rs | 2 +- .../liveness-ctor-field-never-init.rs | 2 +- .../liveness-ctor-uninit-field.rs | 2 +- .../compile-fail/liveness-ctor-uninit-var.rs | 2 +- src/test/compile-fail/liveness-dead.rs | 6 +- src/test/compile-fail/liveness-if-no-else.rs | 2 +- .../compile-fail/liveness-if-with-else.rs | 2 +- .../liveness-init-in-called-fn-expr.rs | 2 +- .../compile-fail/liveness-init-in-fn-expr.rs | 2 +- src/test/compile-fail/liveness-init-in-fru.rs | 2 +- .../compile-fail/liveness-init-op-equal.rs | 2 +- .../compile-fail/liveness-init-plus-equal.rs | 2 +- src/test/compile-fail/liveness-issue-2163.rs | 2 +- .../compile-fail/liveness-move-from-args.rs | 6 +- .../compile-fail/liveness-move-from-mode.rs | 4 +- .../compile-fail/liveness-move-in-loop.rs | 4 +- .../compile-fail/liveness-move-in-while.rs | 4 +- src/test/compile-fail/liveness-or-init.rs | 2 +- src/test/compile-fail/liveness-return.rs | 2 +- src/test/compile-fail/liveness-swap-uninit.rs | 2 +- .../liveness-uninit-after-item.rs | 2 +- src/test/compile-fail/liveness-uninit.rs | 2 +- src/test/compile-fail/liveness-unused.rs | 14 ++-- .../compile-fail/liveness-use-after-move.rs | 4 +- .../compile-fail/liveness-use-after-send.rs | 4 +- .../liveness-use-in-index-lvalue.rs | 2 +- src/test/compile-fail/liveness-while-break.rs | 2 +- src/test/compile-fail/liveness-while-cond.rs | 2 +- src/test/compile-fail/liveness-while.rs | 2 +- .../compile-fail/loop-does-not-diverge.rs | 2 +- src/test/compile-fail/lub-in-args.rs | 4 +- src/test/compile-fail/main-wrong-type-2.rs | 2 +- src/test/compile-fail/main-wrong-type.rs | 2 +- src/test/compile-fail/map-types.rs | 2 +- src/test/compile-fail/mode-inference-fail.rs | 2 +- src/test/compile-fail/mutable-arguments.rs | 20 +++--- .../compile-fail/mutable-huh-box-assign.rs | 2 +- .../compile-fail/mutable-huh-field-assign.rs | 2 +- .../compile-fail/mutable-huh-ptr-assign.rs | 2 +- .../compile-fail/mutable-huh-unique-assign.rs | 2 +- .../compile-fail/mutable-huh-variance-vec1.rs | 2 +- .../compile-fail/mutable-huh-variance-vec2.rs | 2 +- .../compile-fail/mutable-huh-variance-vec3.rs | 2 +- .../compile-fail/mutable-huh-variance-vec4.rs | 14 ++-- .../compile-fail/mutable-huh-vec-assign.rs | 2 +- .../compile-fail/native-unsafe-fn-called.rs | 2 +- src/test/compile-fail/native-unsafe-fn.rs | 2 +- src/test/compile-fail/no-reuse-move-arc.rs | 4 +- src/test/compile-fail/no-send-res-ports.rs | 2 +- src/test/compile-fail/noexporttypeexe.rs | 2 +- src/test/compile-fail/non-const.rs | 12 ++-- src/test/compile-fail/non-copyable-void.rs | 2 +- src/test/compile-fail/non-exhaustive-match.rs | 12 ++-- src/test/compile-fail/not-enough-arguments.rs | 2 +- src/test/compile-fail/occurs-check.rs | 2 +- .../compile-fail/omitted-arg-in-item-fn.rs | 2 +- .../compile-fail/omitted-arg-wrong-types.rs | 4 +- .../pat-shadow-in-nested-binding.rs | 2 +- .../placement-new-bad-method-type.rs | 2 +- src/test/compile-fail/pptypedef.rs | 2 +- src/test/compile-fail/prim-with-args.rs | 48 ++++++------- src/test/compile-fail/pure-higher-order.rs | 8 +-- src/test/compile-fail/pure-loop-body.rs | 2 +- .../compile-fail/pure-modifies-aliased.rs | 6 +- src/test/compile-fail/pure-overloaded-op.rs | 6 +- src/test/compile-fail/pure-subtyping.rs | 22 +++--- src/test/compile-fail/qquote-1.rs | 2 +- src/test/compile-fail/qquote-2.rs | 2 +- src/test/compile-fail/rec-expected.rs | 2 +- src/test/compile-fail/region-unused.rs | 2 +- src/test/compile-fail/regions-addr-of-arg.rs | 2 +- src/test/compile-fail/regions-addr-of-self.rs | 2 +- .../regions-addr-of-upvar-self.rs | 2 +- .../regions-appearance-constraint.rs | 2 +- src/test/compile-fail/regions-blk.rs | 2 +- src/test/compile-fail/regions-borrow.rs | 2 +- src/test/compile-fail/regions-bounds.rs | 10 +-- .../compile-fail/regions-creating-enums.rs | 4 +- .../compile-fail/regions-creating-enums3.rs | 2 +- .../compile-fail/regions-creating-enums4.rs | 2 +- .../regions-escape-into-other-fn.rs | 2 +- .../regions-escape-loop-via-variable.rs | 2 +- .../regions-escape-loop-via-vec.rs | 8 +-- src/test/compile-fail/regions-fn-subtyping.rs | 2 +- src/test/compile-fail/regions-fns.rs | 4 +- src/test/compile-fail/regions-iface-1.rs | 2 +- src/test/compile-fail/regions-iface-2.rs | 2 +- src/test/compile-fail/regions-iface-3.rs | 4 +- src/test/compile-fail/regions-in-consts.rs | 4 +- src/test/compile-fail/regions-in-enums.rs | 8 +-- src/test/compile-fail/regions-in-rsrcs.rs | 16 ++--- .../compile-fail/regions-in-type-items.rs | 10 +-- src/test/compile-fail/regions-nested-fns.rs | 8 +-- .../regions-out-of-scope-slice.rs | 2 +- src/test/compile-fail/regions-scoping.rs | 30 ++++---- .../regions-var-type-out-of-scope.rs | 2 +- src/test/compile-fail/selftype-astparam.rs | 2 +- src/test/compile-fail/selftype-ifacetype.rs | 2 +- .../compile-fail/sendfn-is-not-a-lambda.rs | 2 +- src/test/compile-fail/seq-args.rs | 2 +- src/test/compile-fail/swap-no-lval.rs | 4 +- src/test/compile-fail/terr-in-field.rs | 2 +- src/test/compile-fail/terr-sorts.rs | 2 +- src/test/compile-fail/tps-invariant-class.rs | 2 +- src/test/compile-fail/tps-invariant-enum.rs | 2 +- src/test/compile-fail/tps-invariant-iface.rs | 4 +- src/test/compile-fail/tstate-and-init.rs | 2 +- src/test/compile-fail/tstate-block-uninit.rs | 2 +- .../compile-fail/tstate-break-uninit-2.rs | 4 +- src/test/compile-fail/tstate-break-uninit.rs | 4 +- src/test/compile-fail/tstate-ctor-unsat.rs | 2 +- src/test/compile-fail/tstate-fru.rs | 2 +- src/test/compile-fail/tstate-if-no-else.rs | 2 +- src/test/compile-fail/tstate-if-with-else.rs | 2 +- .../compile-fail/tstate-loop-constraints.rs | 2 +- src/test/compile-fail/tstate-or-init.rs | 2 +- src/test/compile-fail/tstate-return.rs | 2 +- .../compile-fail/tstate-unsat-after-item.rs | 2 +- .../tstate-unsat-in-called-fn-expr.rs | 2 +- .../compile-fail/tstate-unsat-in-fn-expr.rs | 2 +- src/test/compile-fail/tstate-unsat.rs | 2 +- src/test/compile-fail/tstate-while-break.rs | 2 +- src/test/compile-fail/tstate-while-cond.rs | 2 +- src/test/compile-fail/tstate-while.rs | 2 +- .../tutorial-suffix-inference-test.rs | 6 +- src/test/compile-fail/type-mismatch.rs | 2 +- src/test/compile-fail/unique-unique-kind.rs | 2 +- .../unsafe-fn-assign-deref-ptr.rs | 2 +- src/test/compile-fail/unsafe-fn-autoderef.rs | 2 +- .../unsafe-fn-called-from-safe.rs | 2 +- src/test/compile-fail/unsafe-fn-deref-ptr.rs | 2 +- .../compile-fail/unsafe-fn-used-as-value.rs | 2 +- src/test/compile-fail/unsendable-class.rs | 6 +- src/test/compile-fail/vec-add.rs | 60 ++++++++-------- src/test/compile-fail/vec-concat-bug.rs | 2 +- src/test/compile-fail/vector-no-ann.rs | 2 +- src/test/compile-fail/warn-path-statement.rs | 2 +- .../liveness-assign-imm-local-after-ret.rs | 2 +- src/test/run-pass/pred-not-bool.rs | 2 +- src/test/run-pass/unreachable-code-1.rs | 2 +- 253 files changed, 596 insertions(+), 596 deletions(-) diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 5d1bba368d435..83ce87b61e71c 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -21,14 +21,14 @@ fn load_errors(testfile: str) -> [expected_error]/~ { } fn parse_expected(line_num: uint, line: str) -> [expected_error]/~ unsafe { - let error_tag = "//!"; + let error_tag = "//~"; let mut idx; alt str::find_str(line, error_tag) { option::none { ret []/~; } option::some(nn) { idx = (nn as uint) + str::len(error_tag); } } - // "//!^^^ kind msg" denotes a message expected + // "//~^^^ kind msg" denotes a message expected // three lines above current line: let mut adjust_line = 0u; let len = str::len(line); diff --git a/src/test/compile-fail/alt-join.rs b/src/test/compile-fail/alt-join.rs index bc1357372b025..cd39d90b9bd61 100644 --- a/src/test/compile-fail/alt-join.rs +++ b/src/test/compile-fail/alt-join.rs @@ -6,6 +6,6 @@ fn my_fail() -> ! { fail; } fn main() { alt true { false { my_fail(); } true { } } - log(debug, x); //! ERROR unresolved name: x + log(debug, x); //~ ERROR unresolved name: x let x: int; } diff --git a/src/test/compile-fail/alt-pattern-field-mismatch-2.rs b/src/test/compile-fail/alt-pattern-field-mismatch-2.rs index 75e0763e4a60d..b8d4dab9539f7 100644 --- a/src/test/compile-fail/alt-pattern-field-mismatch-2.rs +++ b/src/test/compile-fail/alt-pattern-field-mismatch-2.rs @@ -10,7 +10,7 @@ fn main() { rgb(_, _, _) { } cmyk(_, _, _, _) { } no_color(_) { } - //!^ ERROR this pattern has 1 field, but the corresponding variant has no fields + //~^ ERROR this pattern has 1 field, but the corresponding variant has no fields } } } diff --git a/src/test/compile-fail/alt-pattern-field-mismatch.rs b/src/test/compile-fail/alt-pattern-field-mismatch.rs index 086267a85b3be..2e24f6a5c899c 100644 --- a/src/test/compile-fail/alt-pattern-field-mismatch.rs +++ b/src/test/compile-fail/alt-pattern-field-mismatch.rs @@ -8,7 +8,7 @@ fn main() { fn foo(c: color) { alt c { rgb(_, _) { } - //!^ ERROR this pattern has 2 fields, but the corresponding variant has 3 fields + //~^ ERROR this pattern has 2 fields, but the corresponding variant has 3 fields cmyk(_, _, _, _) { } no_color { } } diff --git a/src/test/compile-fail/ambig_impl_1.rs b/src/test/compile-fail/ambig_impl_1.rs index 0eed1c8f89fb7..51247c7e8e9ea 100644 --- a/src/test/compile-fail/ambig_impl_1.rs +++ b/src/test/compile-fail/ambig_impl_1.rs @@ -1,3 +1,3 @@ -impl methods1 for uint { fn me() -> uint { self } } //! NOTE candidate #1 is `methods1::me` -impl methods2 for uint { fn me() -> uint { self } } //! NOTE candidate #2 is `methods2::me` -fn main() { 1u.me(); } //! ERROR multiple applicable methods in scope +impl methods1 for uint { fn me() -> uint { self } } //~ NOTE candidate #1 is `methods1::me` +impl methods2 for uint { fn me() -> uint { self } } //~ NOTE candidate #2 is `methods2::me` +fn main() { 1u.me(); } //~ ERROR multiple applicable methods in scope diff --git a/src/test/compile-fail/ambig_impl_2_exe.rs b/src/test/compile-fail/ambig_impl_2_exe.rs index 5bd20db144f5e..7cb79ff789e12 100644 --- a/src/test/compile-fail/ambig_impl_2_exe.rs +++ b/src/test/compile-fail/ambig_impl_2_exe.rs @@ -2,6 +2,6 @@ // aux-build:ambig_impl_2_lib.rs use ambig_impl_2_lib; import ambig_impl_2_lib::methods1; -impl methods2 for uint { fn me() -> uint { self } } //! NOTE candidate #2 is `methods2::me` -fn main() { 1u.me(); } //! ERROR multiple applicable methods in scope -//!^ NOTE candidate #1 is `ambig_impl_2_lib::methods1::me` +impl methods2 for uint { fn me() -> uint { self } } //~ NOTE candidate #2 is `methods2::me` +fn main() { 1u.me(); } //~ ERROR multiple applicable methods in scope +//~^ NOTE candidate #1 is `ambig_impl_2_lib::methods1::me` diff --git a/src/test/compile-fail/ambig_impl_bounds.rs b/src/test/compile-fail/ambig_impl_bounds.rs index d14e57a21f410..9d7a9634a074e 100644 --- a/src/test/compile-fail/ambig_impl_bounds.rs +++ b/src/test/compile-fail/ambig_impl_bounds.rs @@ -2,9 +2,9 @@ iface A { fn foo(); } iface B { fn foo(); } fn foo(t: T) { - t.foo(); //! ERROR multiple applicable methods in scope - //!^ NOTE candidate #1 derives from the bound `A` - //!^^ NOTE candidate #2 derives from the bound `B` + t.foo(); //~ ERROR multiple applicable methods in scope + //~^ NOTE candidate #1 derives from the bound `A` + //~^^ NOTE candidate #2 derives from the bound `B` } fn main() {} \ No newline at end of file diff --git a/src/test/compile-fail/ambig_impl_unify.rs b/src/test/compile-fail/ambig_impl_unify.rs index 038ade94bd4e1..4a0d4f259dd1f 100644 --- a/src/test/compile-fail/ambig_impl_unify.rs +++ b/src/test/compile-fail/ambig_impl_unify.rs @@ -1,12 +1,12 @@ impl methods for [uint]/~ { - fn foo() -> int {1} //! NOTE candidate #1 is `methods::foo` + fn foo() -> int {1} //~ NOTE candidate #1 is `methods::foo` } impl methods for [int]/~ { - fn foo() -> int {2} //! NOTE candidate #2 is `methods::foo` + fn foo() -> int {2} //~ NOTE candidate #2 is `methods::foo` } fn main() { let x = []/~; - x.foo(); //! ERROR multiple applicable methods in scope + x.foo(); //~ ERROR multiple applicable methods in scope } \ No newline at end of file diff --git a/src/test/compile-fail/assign-imm-local-twice.rs b/src/test/compile-fail/assign-imm-local-twice.rs index 7472ebe7effd9..54b130ae26fe8 100644 --- a/src/test/compile-fail/assign-imm-local-twice.rs +++ b/src/test/compile-fail/assign-imm-local-twice.rs @@ -1,8 +1,8 @@ fn test() { let v: int; - v = 1; //! NOTE prior assignment occurs here + v = 1; //~ NOTE prior assignment occurs here #debug["v=%d", v]; - v = 2; //! ERROR re-assignment of immutable variable + v = 2; //~ ERROR re-assignment of immutable variable #debug["v=%d", v]; } diff --git a/src/test/compile-fail/assign-super.rs b/src/test/compile-fail/assign-super.rs index 70532cef3ae3c..a7cb5b389704a 100644 --- a/src/test/compile-fail/assign-super.rs +++ b/src/test/compile-fail/assign-super.rs @@ -1,5 +1,5 @@ fn main() { let mut x: [mut int]/~ = [mut 3]/~; let y: [int]/~ = [3]/~; - x = y; //! ERROR values differ in mutability + x = y; //~ ERROR values differ in mutability } \ No newline at end of file diff --git a/src/test/compile-fail/assign-to-method.rs b/src/test/compile-fail/assign-to-method.rs index f7577d21c7e37..772a3a945fdc0 100644 --- a/src/test/compile-fail/assign-to-method.rs +++ b/src/test/compile-fail/assign-to-method.rs @@ -11,5 +11,5 @@ class cat { fn main() { let nyan : cat = cat(52u, 99); - nyan.speak = fn@() { #debug["meow"]; }; //! ERROR assigning to method + nyan.speak = fn@() { #debug["meow"]; }; //~ ERROR assigning to method } diff --git a/src/test/compile-fail/attempted-access-non-fatal.rs b/src/test/compile-fail/attempted-access-non-fatal.rs index 7ead10b3f6337..a4183ec310f3a 100644 --- a/src/test/compile-fail/attempted-access-non-fatal.rs +++ b/src/test/compile-fail/attempted-access-non-fatal.rs @@ -1,6 +1,6 @@ // Check that bogus field access is non-fatal fn main() { let x = 0; - log(debug, x.foo); //! ERROR attempted access of field - log(debug, x.bar); //! ERROR attempted access of field + log(debug, x.foo); //~ ERROR attempted access of field + log(debug, x.bar); //~ ERROR attempted access of field } \ No newline at end of file diff --git a/src/test/compile-fail/attr-before-ext.rs b/src/test/compile-fail/attr-before-ext.rs index 8409ab8ef528d..2f4b8111bc94d 100644 --- a/src/test/compile-fail/attr-before-ext.rs +++ b/src/test/compile-fail/attr-before-ext.rs @@ -1,4 +1,4 @@ fn main() { #[attr] - #debug("hi"); //! ERROR expected item + #debug("hi"); //~ ERROR expected item } \ No newline at end of file diff --git a/src/test/compile-fail/attr-before-let.rs b/src/test/compile-fail/attr-before-let.rs index 814ad400d6baa..f99170e654d0a 100644 --- a/src/test/compile-fail/attr-before-let.rs +++ b/src/test/compile-fail/attr-before-let.rs @@ -1,4 +1,4 @@ fn main() { #[attr] - let _i = 0; //! ERROR expected item + let _i = 0; //~ ERROR expected item } \ No newline at end of file diff --git a/src/test/compile-fail/bad-bang-ann-3.rs b/src/test/compile-fail/bad-bang-ann-3.rs index bab121bd6d348..3a88afd534646 100644 --- a/src/test/compile-fail/bad-bang-ann-3.rs +++ b/src/test/compile-fail/bad-bang-ann-3.rs @@ -3,7 +3,7 @@ fn bad_bang(i: uint) -> ! { ret 7u; - //!^ ERROR expected `_|_` but found `uint` + //~^ ERROR expected `_|_` but found `uint` } fn main() { bad_bang(5u); } diff --git a/src/test/compile-fail/bad-bang-ann.rs b/src/test/compile-fail/bad-bang-ann.rs index b6e2dea4e5ae7..a2ad98df9595c 100644 --- a/src/test/compile-fail/bad-bang-ann.rs +++ b/src/test/compile-fail/bad-bang-ann.rs @@ -3,7 +3,7 @@ fn bad_bang(i: uint) -> ! { if i < 0u { } else { fail; } - //!^ ERROR expected `_|_` but found `()` + //~^ ERROR expected `_|_` but found `()` } fn main() { bad_bang(5u); } diff --git a/src/test/compile-fail/bad-for-loop.rs b/src/test/compile-fail/bad-for-loop.rs index a28d893b97e6f..5808fcbb16164 100644 --- a/src/test/compile-fail/bad-for-loop.rs +++ b/src/test/compile-fail/bad-for-loop.rs @@ -1,4 +1,4 @@ fn main() { fn baz(_x: fn() -> int) {} - for baz {|_e| } //! ERROR should return `bool` + for baz {|_e| } //~ ERROR should return `bool` } diff --git a/src/test/compile-fail/bad-method-typaram-kind.rs b/src/test/compile-fail/bad-method-typaram-kind.rs index 55b259daf1e81..9934702fdeaaf 100644 --- a/src/test/compile-fail/bad-method-typaram-kind.rs +++ b/src/test/compile-fail/bad-method-typaram-kind.rs @@ -1,5 +1,5 @@ fn foo() { - 1u.bar::(); //! ERROR: missing `copy` + 1u.bar::(); //~ ERROR: missing `copy` } impl methods for uint { diff --git a/src/test/compile-fail/bad-value-ident-false.rs b/src/test/compile-fail/bad-value-ident-false.rs index fa744c6823d2f..9498f1c341fdc 100644 --- a/src/test/compile-fail/bad-value-ident-false.rs +++ b/src/test/compile-fail/bad-value-ident-false.rs @@ -1,2 +1,2 @@ -fn false() { } //! ERROR found `false` in restricted position +fn false() { } //~ ERROR found `false` in restricted position fn main() { } \ No newline at end of file diff --git a/src/test/compile-fail/bad-value-ident-true.rs b/src/test/compile-fail/bad-value-ident-true.rs index 9a4a155c97d49..96f172b3285a3 100644 --- a/src/test/compile-fail/bad-value-ident-true.rs +++ b/src/test/compile-fail/bad-value-ident-true.rs @@ -1,2 +1,2 @@ -fn true() { } //! ERROR found `true` in restricted position +fn true() { } //~ ERROR found `true` in restricted position fn main() { } \ No newline at end of file diff --git a/src/test/compile-fail/bad-var-env-capture-in-block-arg.rs b/src/test/compile-fail/bad-var-env-capture-in-block-arg.rs index 7cd084c2d7fa8..21c9d7203edc2 100644 --- a/src/test/compile-fail/bad-var-env-capture-in-block-arg.rs +++ b/src/test/compile-fail/bad-var-env-capture-in-block-arg.rs @@ -2,6 +2,6 @@ fn main() { let x = 3; fn blah(_a: native fn()) {} blah({|| - log(debug, x); //! ERROR attempted dynamic environment capture + log(debug, x); //~ ERROR attempted dynamic environment capture }); } \ No newline at end of file diff --git a/src/test/compile-fail/bang-tailexpr.rs b/src/test/compile-fail/bang-tailexpr.rs index 83909b6753f8c..f3d78f2f6c21b 100644 --- a/src/test/compile-fail/bang-tailexpr.rs +++ b/src/test/compile-fail/bang-tailexpr.rs @@ -1,4 +1,4 @@ fn f() -> ! { - 3i //! ERROR expected `_|_` but found `int` + 3i //~ ERROR expected `_|_` but found `int` } fn main() { } diff --git a/src/test/compile-fail/binop-typeck.rs b/src/test/compile-fail/binop-typeck.rs index e2669be751b21..f48734a48f972 100644 --- a/src/test/compile-fail/binop-typeck.rs +++ b/src/test/compile-fail/binop-typeck.rs @@ -4,5 +4,5 @@ fn main() { let x = true; let y = 1; let z = x + y; - //!^ ERROR binary operation + cannot be applied to type `bool` + //~^ ERROR binary operation + cannot be applied to type `bool` } diff --git a/src/test/compile-fail/block-arg-as-stmt-with-value.rs b/src/test/compile-fail/block-arg-as-stmt-with-value.rs index 76519ff6dad80..e89a10a12468a 100644 --- a/src/test/compile-fail/block-arg-as-stmt-with-value.rs +++ b/src/test/compile-fail/block-arg-as-stmt-with-value.rs @@ -3,7 +3,7 @@ fn compute1() -> float { let v = [0f, 1f, 2f, 3f]/~; vec::foldl(0f, v) { |x, y| x + y } - 10f - //!^ ERROR mismatched types: expected `()` + //~^ ERROR mismatched types: expected `()` } fn main() { diff --git a/src/test/compile-fail/block-coerce-no-2.rs b/src/test/compile-fail/block-coerce-no-2.rs index 613d1c0028ce6..780a91b664cea 100644 --- a/src/test/compile-fail/block-coerce-no-2.rs +++ b/src/test/compile-fail/block-coerce-no-2.rs @@ -9,5 +9,5 @@ fn main() { } f(g); - //!^ ERROR mismatched types: expected `extern fn(extern fn(extern fn()))` + //~^ ERROR mismatched types: expected `extern fn(extern fn(extern fn()))` } diff --git a/src/test/compile-fail/block-coerce-no.rs b/src/test/compile-fail/block-coerce-no.rs index b544c58e6705e..45298ccaf8e52 100644 --- a/src/test/compile-fail/block-coerce-no.rs +++ b/src/test/compile-fail/block-coerce-no.rs @@ -6,7 +6,7 @@ fn coerce(b: fn()) -> native fn() { g: fn()) -> native fn() { ret f(g); } fn fn_id(f: native fn()) -> native fn() { ret f } ret lol(fn_id, b); - //!^ ERROR mismatched types: expected `extern fn(fn()) -> extern fn()` + //~^ ERROR mismatched types: expected `extern fn(fn()) -> extern fn()` } fn main() { diff --git a/src/test/compile-fail/borrowck-assign-comp-idx.rs b/src/test/compile-fail/borrowck-assign-comp-idx.rs index e2a7610ddc63a..accd228dc0342 100644 --- a/src/test/compile-fail/borrowck-assign-comp-idx.rs +++ b/src/test/compile-fail/borrowck-assign-comp-idx.rs @@ -4,9 +4,9 @@ fn a() { let mut p = [mut 1]/~; // Create an immutable pointer into p's contents: - let _q: &int = &p[0]; //! NOTE loan of mutable vec content granted here + let _q: &int = &p[0]; //~ NOTE loan of mutable vec content granted here - p[0] = 5; //! ERROR assigning to mutable vec content prohibited due to outstanding loan + p[0] = 5; //~ ERROR assigning to mutable vec content prohibited due to outstanding loan } fn borrow(_x: [int]/&, _f: fn()) {} @@ -17,8 +17,8 @@ fn b() { let mut p = [mut 1]/~; - borrow(p) {|| //! NOTE loan of mutable vec content granted here - p[0] = 5; //! ERROR assigning to mutable vec content prohibited due to outstanding loan + borrow(p) {|| //~ NOTE loan of mutable vec content granted here + p[0] = 5; //~ ERROR assigning to mutable vec content prohibited due to outstanding loan } } diff --git a/src/test/compile-fail/borrowck-assign-comp.rs b/src/test/compile-fail/borrowck-assign-comp.rs index 2e045b84c603a..55a29393caea1 100644 --- a/src/test/compile-fail/borrowck-assign-comp.rs +++ b/src/test/compile-fail/borrowck-assign-comp.rs @@ -2,12 +2,12 @@ type point = { x: int, y: int }; fn a() { let mut p = {x: 3, y: 4}; - let _q = &p; //! NOTE loan of mutable local variable granted here + let _q = &p; //~ NOTE loan of mutable local variable granted here // This assignment is illegal because the field x is not // inherently mutable; since `p` was made immutable, `p.x` is now // immutable. Otherwise the type of &_q.x (&int) would be wrong. - p.x = 5; //! ERROR assigning to mutable field prohibited due to outstanding loan + p.x = 5; //~ ERROR assigning to mutable field prohibited due to outstanding loan } fn b() { @@ -24,8 +24,8 @@ fn c() { // and then try to overwrite `p` as a whole. let mut p = {x: 3, mut y: 4}; - let _q = &p.y; //! NOTE loan of mutable local variable granted here - p = {x: 5, mut y: 7};//! ERROR assigning to mutable local variable prohibited due to outstanding loan + let _q = &p.y; //~ NOTE loan of mutable local variable granted here + p = {x: 5, mut y: 7};//~ ERROR assigning to mutable local variable prohibited due to outstanding loan copy p; } @@ -34,8 +34,8 @@ fn d() { // address of a subcomponent and then modify that subcomponent: let mut p = {x: 3, mut y: 4}; - let _q = &p.y; //! NOTE loan of mutable field granted here - p.y = 5; //! ERROR assigning to mutable field prohibited due to outstanding loan + let _q = &p.y; //~ NOTE loan of mutable field granted here + p.y = 5; //~ ERROR assigning to mutable field prohibited due to outstanding loan copy p; } diff --git a/src/test/compile-fail/borrowck-assign-to-constants.rs b/src/test/compile-fail/borrowck-assign-to-constants.rs index 59ced0275c028..44ca3b043db71 100644 --- a/src/test/compile-fail/borrowck-assign-to-constants.rs +++ b/src/test/compile-fail/borrowck-assign-to-constants.rs @@ -2,6 +2,6 @@ const foo: int = 5; fn main() { // assigning to various global constants - none = some(3); //! ERROR assigning to static item - foo = 6; //! ERROR assigning to static item + none = some(3); //~ ERROR assigning to static item + foo = 6; //~ ERROR assigning to static item } \ No newline at end of file diff --git a/src/test/compile-fail/borrowck-assign-to-enum.rs b/src/test/compile-fail/borrowck-assign-to-enum.rs index 927bcfdc85e7a..d7770a30d7565 100644 --- a/src/test/compile-fail/borrowck-assign-to-enum.rs +++ b/src/test/compile-fail/borrowck-assign-to-enum.rs @@ -2,5 +2,5 @@ enum foo = int; fn main() { let x = foo(3); - *x = 4; //! ERROR assigning to enum content + *x = 4; //~ ERROR assigning to enum content } \ No newline at end of file diff --git a/src/test/compile-fail/borrowck-assign-to-subfield.rs b/src/test/compile-fail/borrowck-assign-to-subfield.rs index 275d8ed7e703c..8a14efc09a6e7 100644 --- a/src/test/compile-fail/borrowck-assign-to-subfield.rs +++ b/src/test/compile-fail/borrowck-assign-to-subfield.rs @@ -14,7 +14,7 @@ fn main() { // in these cases we pass through a box, so the mut // of the box is dominant - p.x.a = 2; //! ERROR assigning to immutable field - p.y.a = 2; //! ERROR assigning to const field + p.x.a = 2; //~ ERROR assigning to immutable field + p.y.a = 2; //~ ERROR assigning to const field p.z.a = 2; } \ No newline at end of file diff --git a/src/test/compile-fail/borrowck-binding-mutbl.rs b/src/test/compile-fail/borrowck-binding-mutbl.rs index 0da9a8a860fcc..d3de94942edd3 100644 --- a/src/test/compile-fail/borrowck-binding-mutbl.rs +++ b/src/test/compile-fail/borrowck-binding-mutbl.rs @@ -6,8 +6,8 @@ fn main() { alt x { {f: v} => { - impure(v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + impure(v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } } } \ No newline at end of file diff --git a/src/test/compile-fail/borrowck-issue-2657-1.rs b/src/test/compile-fail/borrowck-issue-2657-1.rs index 00c579dc45ee0..520ae1bf6462f 100644 --- a/src/test/compile-fail/borrowck-issue-2657-1.rs +++ b/src/test/compile-fail/borrowck-issue-2657-1.rs @@ -1,8 +1,8 @@ fn main() { let x = some(~1); -alt x { //! NOTE loan of immutable local variable granted here +alt x { //~ NOTE loan of immutable local variable granted here some(y) { - let _a <- x; //! ERROR moving out of immutable local variable prohibited due to outstanding loan + let _a <- x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan } _ {} } diff --git a/src/test/compile-fail/borrowck-issue-2657-2.rs b/src/test/compile-fail/borrowck-issue-2657-2.rs index d8d068ee8fd74..07e4ca8229b79 100644 --- a/src/test/compile-fail/borrowck-issue-2657-2.rs +++ b/src/test/compile-fail/borrowck-issue-2657-2.rs @@ -2,7 +2,7 @@ fn main() { let x = some(~1); alt x { some(y) { - let _b <- y; //! ERROR moving out of pattern binding + let _b <- y; //~ ERROR moving out of pattern binding } _ {} } diff --git a/src/test/compile-fail/borrowck-lend-args.rs b/src/test/compile-fail/borrowck-lend-args.rs index ef8914b134fea..4fbc51183ce5a 100644 --- a/src/test/compile-fail/borrowck-lend-args.rs +++ b/src/test/compile-fail/borrowck-lend-args.rs @@ -5,8 +5,8 @@ fn borrow_from_arg_imm_ref(&&v: ~int) { } fn borrow_from_arg_mut_ref(&v: ~int) { - borrow(v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn borrow_from_arg_move(-v: ~int) { diff --git a/src/test/compile-fail/borrowck-lend-flow.rs b/src/test/compile-fail/borrowck-lend-flow.rs index b4d81aa09ae56..26618d3436e07 100644 --- a/src/test/compile-fail/borrowck-lend-flow.rs +++ b/src/test/compile-fail/borrowck-lend-flow.rs @@ -19,23 +19,23 @@ fn post_aliased_const() { fn post_aliased_mut() { // SPURIOUS--flow let mut v = ~3; - borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan - let _w = &mut v; //! NOTE prior loan as mutable granted here + borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan + let _w = &mut v; //~ NOTE prior loan as mutable granted here } fn post_aliased_scope(cond: bool) { // NDM--scope of & let mut v = ~3; - borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan - if cond { inc(&mut v); } //! NOTE prior loan as mutable granted here + borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan + if cond { inc(&mut v); } //~ NOTE prior loan as mutable granted here } fn loop_aliased_mut() { let mut v = ~3, w = ~4; let mut _x = &mut w; loop { - borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan - _x = &mut v; //! NOTE prior loan as mutable granted here + borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan + _x = &mut v; //~ NOTE prior loan as mutable granted here } } @@ -43,8 +43,8 @@ fn while_aliased_mut(cond: bool) { let mut v = ~3, w = ~4; let mut _x = &mut w; while cond { - borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan - _x = &mut v; //! NOTE prior loan as mutable granted here + borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan + _x = &mut v; //~ NOTE prior loan as mutable granted here } } @@ -52,9 +52,9 @@ fn while_aliased_mut_cond(cond: bool, cond2: bool) { let mut v = ~3, w = ~4; let mut _x = &mut w; while cond { - borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan + borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan if cond2 { - _x = &mut v; //! NOTE prior loan as mutable granted here + _x = &mut v; //~ NOTE prior loan as mutable granted here } } } @@ -63,8 +63,8 @@ fn loop_in_block() { let mut v = ~3, w = ~4; let mut _x = &mut w; for uint::range(0u, 10u) {|_i| - borrow(v); //! ERROR loan of mutable variable declared in an outer block as immutable conflicts with prior loan - _x = &mut v; //! NOTE prior loan as mutable granted here + borrow(v); //~ ERROR loan of mutable variable declared in an outer block as immutable conflicts with prior loan + _x = &mut v; //~ NOTE prior loan as mutable granted here } } @@ -77,8 +77,8 @@ fn at_most_once_block() { let mut v = ~3, w = ~4; let mut _x = &mut w; at_most_once {|| - borrow(v); //! ERROR loan of mutable variable declared in an outer block as immutable conflicts with prior loan - _x = &mut v; //! NOTE prior loan as mutable granted here + borrow(v); //~ ERROR loan of mutable variable declared in an outer block as immutable conflicts with prior loan + _x = &mut v; //~ NOTE prior loan as mutable granted here } } diff --git a/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs b/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs index 0862af2e6fab7..78a4de4fc1924 100644 --- a/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs +++ b/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs @@ -4,16 +4,16 @@ fn borrow(v: &int, f: fn(x: &int)) { fn box_imm() { let mut v = ~3; - let _w = &mut v; //! NOTE loan of mutable local variable granted here + let _w = &mut v; //~ NOTE loan of mutable local variable granted here task::spawn { |move v| - //!^ ERROR moving out of mutable local variable prohibited due to outstanding loan + //~^ ERROR moving out of mutable local variable prohibited due to outstanding loan #debug["v=%d", *v]; } let mut v = ~3; - let _w = &mut v; //! NOTE loan of mutable local variable granted here + let _w = &mut v; //~ NOTE loan of mutable local variable granted here task::spawn(fn~(move v) { - //!^ ERROR moving out of mutable local variable prohibited due to outstanding loan + //~^ ERROR moving out of mutable local variable prohibited due to outstanding loan #debug["v=%d", *v]; }); } diff --git a/src/test/compile-fail/borrowck-loan-blocks-move.rs b/src/test/compile-fail/borrowck-loan-blocks-move.rs index b5044754ac0b2..5cecbf9284fc3 100644 --- a/src/test/compile-fail/borrowck-loan-blocks-move.rs +++ b/src/test/compile-fail/borrowck-loan-blocks-move.rs @@ -3,8 +3,8 @@ fn take(-_v: ~int) { fn box_imm() { let v = ~3; - let _w = &v; //! NOTE loan of immutable local variable granted here - take(v); //! ERROR moving out of immutable local variable prohibited due to outstanding loan + let _w = &v; //~ NOTE loan of immutable local variable granted here + take(v); //~ ERROR moving out of immutable local variable prohibited due to outstanding loan } fn main() { diff --git a/src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs b/src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs index a09d2e7a71bab..ffed2371334e5 100644 --- a/src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs +++ b/src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs @@ -4,8 +4,8 @@ fn borrow(v: &int, f: fn(x: &int)) { fn box_imm() { let mut v = ~3; - borrow(v) { |w| //! NOTE loan of mutable local variable granted here - v = ~4; //! ERROR assigning to mutable variable declared in an outer block prohibited due to outstanding loan + borrow(v) { |w| //~ NOTE loan of mutable local variable granted here + v = ~4; //~ ERROR assigning to mutable variable declared in an outer block prohibited due to outstanding loan assert *v == 3; assert *w == 4; } diff --git a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs index a268b37ca72eb..f75b256079e70 100644 --- a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs +++ b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs @@ -18,11 +18,11 @@ fn b() { // Here I create an outstanding loan and check that we get conflicts: - &mut p; //! NOTE prior loan as mutable granted here - //!^ NOTE prior loan as mutable granted here + &mut p; //~ NOTE prior loan as mutable granted here + //~^ NOTE prior loan as mutable granted here - p + 3; //! ERROR loan of mutable local variable as immutable conflicts with prior loan - p * 3; //! ERROR loan of mutable local variable as immutable conflicts with prior loan + p + 3; //~ ERROR loan of mutable local variable as immutable conflicts with prior loan + p * 3; //~ ERROR loan of mutable local variable as immutable conflicts with prior loan } fn c() { @@ -35,8 +35,8 @@ fn c() { // ...but not impure fns - *q * 3; //! ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory - //!^ NOTE impure due to access to impure function + *q * 3; //~ ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory + //~^ NOTE impure due to access to impure function } fn main() { diff --git a/src/test/compile-fail/borrowck-loan-rcvr.rs b/src/test/compile-fail/borrowck-loan-rcvr.rs index ec543bfc4f97e..b749996585b33 100644 --- a/src/test/compile-fail/borrowck-loan-rcvr.rs +++ b/src/test/compile-fail/borrowck-loan-rcvr.rs @@ -19,8 +19,8 @@ fn a() { p.impurem(); // But in this case we do not honor the loan: - p.blockm {|| //! NOTE loan of mutable local variable granted here - p.x = 10; //! ERROR assigning to mutable field prohibited due to outstanding loan + p.blockm {|| //~ NOTE loan of mutable local variable granted here + p.x = 10; //~ ERROR assigning to mutable field prohibited due to outstanding loan } } @@ -29,11 +29,11 @@ fn b() { // Here I create an outstanding loan and check that we get conflicts: - &mut p; //! NOTE prior loan as mutable granted here - //!^ NOTE prior loan as mutable granted here + &mut p; //~ NOTE prior loan as mutable granted here + //~^ NOTE prior loan as mutable granted here - p.purem(); //! ERROR loan of mutable local variable as immutable conflicts with prior loan - p.impurem(); //! ERROR loan of mutable local variable as immutable conflicts with prior loan + p.purem(); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan + p.impurem(); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan } fn c() { @@ -45,8 +45,8 @@ fn c() { (*q).purem(); // ...but not impure fns - (*q).impurem(); //! ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory - //!^ NOTE impure due to access to impure function + (*q).impurem(); //~ ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory + //~^ NOTE impure due to access to impure function } fn main() { diff --git a/src/test/compile-fail/borrowck-loan-vec-content.rs b/src/test/compile-fail/borrowck-loan-vec-content.rs index 2e54f948de2db..5542f0f4268d1 100644 --- a/src/test/compile-fail/borrowck-loan-vec-content.rs +++ b/src/test/compile-fail/borrowck-loan-vec-content.rs @@ -14,8 +14,8 @@ fn has_mut_vec_and_does_not_try_to_change_it() { fn has_mut_vec_but_tries_to_change_it() { let v = [mut 1, 2, 3]/~; - takes_imm_elt(&v[0]) {|| //! NOTE loan of mutable vec content granted here - v[1] = 4; //! ERROR assigning to mutable vec content prohibited due to outstanding loan + takes_imm_elt(&v[0]) {|| //~ NOTE loan of mutable vec content granted here + v[1] = 4; //~ ERROR assigning to mutable vec content prohibited due to outstanding loan } } diff --git a/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs b/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs index 03fbb6b975ce8..fc8ff1ffe07bc 100644 --- a/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs +++ b/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs @@ -1,5 +1,5 @@ fn foo(x: *~int) -> ~int { - let y <- *x; //! ERROR dereference of unsafe pointer requires unsafe function or block + let y <- *x; //~ ERROR dereference of unsafe pointer requires unsafe function or block ret y; } diff --git a/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs b/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs index d9436d90f9c6d..d3e6bb68a48bc 100644 --- a/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs +++ b/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs @@ -1,6 +1,6 @@ fn main() { let x: int = 3; - let y: &mut int = &mut x; //! ERROR taking mut reference to immutable local variable + let y: &mut int = &mut x; //~ ERROR taking mut reference to immutable local variable *y = 5; log (debug, *y); } diff --git a/src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs b/src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs index 8735e8e48bacf..4df662e90c52f 100644 --- a/src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs +++ b/src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs @@ -5,8 +5,8 @@ fn want_slice(v: [int]/&) -> int { } fn has_mut_vec(+v: @[mut int]/~) -> int { - want_slice(*v) //! ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory - //!^ NOTE impure due to access to impure function + want_slice(*v) //~ ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory + //~^ NOTE impure due to access to impure function } fn main() { diff --git a/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs b/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs index a546ef867e187..a4aeb976e95f0 100644 --- a/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs +++ b/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs @@ -5,9 +5,9 @@ enum cycle { fn main() { let x = ~node({mut a: ~empty}); // Create a cycle! - alt check *x { //! NOTE loan of immutable local variable granted here + alt check *x { //~ NOTE loan of immutable local variable granted here node(y) { - y.a <- x; //! ERROR moving out of immutable local variable prohibited due to outstanding loan + y.a <- x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan } }; } \ No newline at end of file diff --git a/src/test/compile-fail/borrowck-pat-enum-in-box.rs b/src/test/compile-fail/borrowck-pat-enum-in-box.rs index 29de06a11041b..86ff452c35690 100644 --- a/src/test/compile-fail/borrowck-pat-enum-in-box.rs +++ b/src/test/compile-fail/borrowck-pat-enum-in-box.rs @@ -27,8 +27,8 @@ fn process(_i: int) {} fn match_const_box_and_do_bad_things(v: &const @const option) { alt *v { - @some(i) { //! ERROR illegal borrow unless pure: enum variant in aliasable, mutable location - process(i) //! NOTE impure due to access to impure function + @some(i) { //~ ERROR illegal borrow unless pure: enum variant in aliasable, mutable location + process(i) //~ NOTE impure due to access to impure function } @none {} } diff --git a/src/test/compile-fail/borrowck-pat-enum.rs b/src/test/compile-fail/borrowck-pat-enum.rs index 8e87e5d7420eb..091467283c50a 100644 --- a/src/test/compile-fail/borrowck-pat-enum.rs +++ b/src/test/compile-fail/borrowck-pat-enum.rs @@ -33,8 +33,8 @@ fn match_const_reg_unused(v: &const option) { fn match_const_reg_impure(v: &const option) { alt *v { - some(i) {impure(i)} //! ERROR illegal borrow unless pure: enum variant in aliasable, mutable location - //!^ NOTE impure due to access to impure function + some(i) {impure(i)} //~ ERROR illegal borrow unless pure: enum variant in aliasable, mutable location + //~^ NOTE impure due to access to impure function none {} } } diff --git a/src/test/compile-fail/borrowck-pat-reassign-binding.rs b/src/test/compile-fail/borrowck-pat-reassign-binding.rs index cf1199557bda8..7ce3ff8f02889 100644 --- a/src/test/compile-fail/borrowck-pat-reassign-binding.rs +++ b/src/test/compile-fail/borrowck-pat-reassign-binding.rs @@ -2,11 +2,11 @@ fn main() { let mut x: option = none; - alt x { //! NOTE loan of mutable local variable granted here + alt x { //~ NOTE loan of mutable local variable granted here none {} some(i) { // Not ok: i is an outstanding ptr into x. - x = some(i+1); //! ERROR assigning to mutable local variable prohibited due to outstanding loan + x = some(i+1); //~ ERROR assigning to mutable local variable prohibited due to outstanding loan } } copy x; // just to prevent liveness warnings diff --git a/src/test/compile-fail/borrowck-pat-reassign-sometimes-binding.rs b/src/test/compile-fail/borrowck-pat-reassign-sometimes-binding.rs index db8129d005ace..1e1de3e39cfdd 100644 --- a/src/test/compile-fail/borrowck-pat-reassign-sometimes-binding.rs +++ b/src/test/compile-fail/borrowck-pat-reassign-sometimes-binding.rs @@ -2,14 +2,14 @@ fn main() { let mut x = none; - alt x { //! NOTE loan of mutable local variable granted here + alt x { //~ NOTE loan of mutable local variable granted here none { // It is ok to reassign x here, because there is in // fact no outstanding loan of x! x = some(0); } some(i) { - x = some(1); //! ERROR assigning to mutable local variable prohibited due to outstanding loan + x = some(1); //~ ERROR assigning to mutable local variable prohibited due to outstanding loan } } copy x; // just to prevent liveness warnings diff --git a/src/test/compile-fail/borrowck-pure-scope-in-call.rs b/src/test/compile-fail/borrowck-pure-scope-in-call.rs index 4469dca362065..71a3988b2eee3 100644 --- a/src/test/compile-fail/borrowck-pure-scope-in-call.rs +++ b/src/test/compile-fail/borrowck-pure-scope-in-call.rs @@ -4,8 +4,8 @@ fn test1(x: @mut ~int) { // Here, evaluating the second argument actually invalidates the // first borrow, even though it occurs outside of the scope of the // borrow! - pure_borrow(*x, *x = ~5); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to assigning to dereference of mutable @ pointer + pure_borrow(*x, *x = ~5); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to assigning to dereference of mutable @ pointer } fn test2() { @@ -13,8 +13,8 @@ fn test2() { // Same, but for loanable data: - pure_borrow(x, x = ~5); //! ERROR assigning to mutable local variable prohibited due to outstanding loan - //!^ NOTE loan of mutable local variable granted here + pure_borrow(x, x = ~5); //~ ERROR assigning to mutable local variable prohibited due to outstanding loan + //~^ NOTE loan of mutable local variable granted here copy x; } diff --git a/src/test/compile-fail/borrowck-unchecked-with-borrow.rs b/src/test/compile-fail/borrowck-unchecked-with-borrow.rs index a5f8b947bf2e5..c0a2466199f08 100644 --- a/src/test/compile-fail/borrowck-unchecked-with-borrow.rs +++ b/src/test/compile-fail/borrowck-unchecked-with-borrow.rs @@ -4,9 +4,9 @@ fn impure(_i: int) {} fn foo(v: &const option) { alt *v { some(i) { - //!^ ERROR illegal borrow unless pure: enum variant in aliasable, mutable location + //~^ ERROR illegal borrow unless pure: enum variant in aliasable, mutable location unchecked { - impure(i); //! NOTE impure due to access to impure function + impure(i); //~ NOTE impure due to access to impure function } } none { diff --git a/src/test/compile-fail/borrowck-uniq-via-box.rs b/src/test/compile-fail/borrowck-uniq-via-box.rs index cf0f5439afc9b..6fcdf369aba3a 100644 --- a/src/test/compile-fail/borrowck-uniq-via-box.rs +++ b/src/test/compile-fail/borrowck-uniq-via-box.rs @@ -1,23 +1,23 @@ fn borrow(_v: &int) {} fn box_mut(v: @mut ~int) { - borrow(*v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(*v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_rec_mut(v: @{mut f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_mut_rec(v: @mut {f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_mut_recs(v: @mut {f: {g: {h: ~int}}}) { - borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_imm(v: @~int) { @@ -33,28 +33,28 @@ fn box_imm_recs(v: @{f: {g: {h: ~int}}}) { } fn box_const(v: @const ~int) { - borrow(*v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(*v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_rec_const(v: @{const f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_recs_const(v: @{f: {g: {const h: ~int}}}) { - borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_const_rec(v: @const {f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_const_recs(v: @const {f: {g: {h: ~int}}}) { - borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn main() { diff --git a/src/test/compile-fail/borrowck-uniq-via-lend.rs b/src/test/compile-fail/borrowck-uniq-via-lend.rs index 78bba1576e8d1..fcc8d2c877588 100644 --- a/src/test/compile-fail/borrowck-uniq-via-lend.rs +++ b/src/test/compile-fail/borrowck-uniq-via-lend.rs @@ -29,8 +29,8 @@ fn aliased_const() { fn aliased_mut() { let mut v = ~3; - let _w = &mut v; //! NOTE prior loan as mutable granted here - borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan + let _w = &mut v; //~ NOTE prior loan as mutable granted here + borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan } fn aliased_other() { @@ -42,8 +42,8 @@ fn aliased_other() { fn aliased_other_reassign() { let mut v = ~3, w = ~4; let mut _x = &mut w; - _x = &mut v; //! NOTE prior loan as mutable granted here - borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan + _x = &mut v; //~ NOTE prior loan as mutable granted here + borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan } fn main() { diff --git a/src/test/compile-fail/borrowck-uniq-via-ref.rs b/src/test/compile-fail/borrowck-uniq-via-ref.rs index 156106b880c4f..fe825165183a8 100644 --- a/src/test/compile-fail/borrowck-uniq-via-ref.rs +++ b/src/test/compile-fail/borrowck-uniq-via-ref.rs @@ -1,23 +1,23 @@ fn borrow(_v: &int) {} fn box_mut(v: &mut ~int) { - borrow(*v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(*v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_rec_mut(v: &{mut f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_mut_rec(v: &mut {f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_mut_recs(v: &mut {f: {g: {h: ~int}}}) { - borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_imm(v: &~int) { @@ -33,28 +33,28 @@ fn box_imm_recs(v: &{f: {g: {h: ~int}}}) { } fn box_const(v: &const ~int) { - borrow(*v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(*v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_rec_const(v: &{const f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_recs_const(v: &{f: {g: {const h: ~int}}}) { - borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_const_rec(v: &const {f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_const_recs(v: &const {f: {g: {h: ~int}}}) { - borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn main() { diff --git a/src/test/compile-fail/cap-clause-move-upvar.rs b/src/test/compile-fail/cap-clause-move-upvar.rs index 3920298c35515..c070c80edf9e3 100644 --- a/src/test/compile-fail/cap-clause-move-upvar.rs +++ b/src/test/compile-fail/cap-clause-move-upvar.rs @@ -1,7 +1,7 @@ fn main() { let x = 5; let _y = fn~(move x) -> int { - let _z = fn~(move x) -> int { x }; //! ERROR moving out of variable declared in an outer block + let _z = fn~(move x) -> int { x }; //~ ERROR moving out of variable declared in an outer block 22 }; } diff --git a/src/test/compile-fail/cap-clause-with-stack-closure.rs b/src/test/compile-fail/cap-clause-with-stack-closure.rs index 4d9a77fb3d63f..c7192852c378f 100644 --- a/src/test/compile-fail/cap-clause-with-stack-closure.rs +++ b/src/test/compile-fail/cap-clause-with-stack-closure.rs @@ -6,9 +6,9 @@ fn main() { foo {|| bar(x); } let x = @3; - foo {|copy x| bar(x); } //! ERROR cannot capture values explicitly with a block closure + foo {|copy x| bar(x); } //~ ERROR cannot capture values explicitly with a block closure let x = @3; - foo {|move x| bar(x); } //! ERROR cannot capture values explicitly with a block closure + foo {|move x| bar(x); } //~ ERROR cannot capture values explicitly with a block closure } diff --git a/src/test/compile-fail/class-implements-int.rs b/src/test/compile-fail/class-implements-int.rs index 1768b8c4bf047..469fee7863b97 100644 --- a/src/test/compile-fail/class-implements-int.rs +++ b/src/test/compile-fail/class-implements-int.rs @@ -1,4 +1,4 @@ -class cat : int { //! ERROR can only implement interface types +class cat : int { //~ ERROR can only implement interface types let meows: uint; new(in_x : uint) { self.meows = in_x; } } diff --git a/src/test/compile-fail/class-missing-self.rs b/src/test/compile-fail/class-missing-self.rs index 280ba47031eab..5e27afaf16416 100644 --- a/src/test/compile-fail/class-missing-self.rs +++ b/src/test/compile-fail/class-missing-self.rs @@ -4,8 +4,8 @@ class cat { fn sleep() { loop{} } fn meow() { #error("Meow"); - meows += 1u; //! ERROR unresolved name - sleep(); //! ERROR unresolved name + meows += 1u; //~ ERROR unresolved name + sleep(); //~ ERROR unresolved name } } diff --git a/src/test/compile-fail/do1.rs b/src/test/compile-fail/do1.rs index 76a10c6d2f161..2034bfcbc58dc 100644 --- a/src/test/compile-fail/do1.rs +++ b/src/test/compile-fail/do1.rs @@ -1,3 +1,3 @@ fn main() { - let x = do y; //! ERROR: `do` must be followed by a block call + let x = do y; //~ ERROR: `do` must be followed by a block call } diff --git a/src/test/compile-fail/do2.rs b/src/test/compile-fail/do2.rs index 598bb298794ad..9108c03747ff8 100644 --- a/src/test/compile-fail/do2.rs +++ b/src/test/compile-fail/do2.rs @@ -1,5 +1,5 @@ fn f(f: fn@(int) -> bool) -> bool { f(10i) } fn main() { - assert do f() { |i| i == 10i } == 10i; //! ERROR: expected `bool` but found `int` + assert do f() { |i| i == 10i } == 10i; //~ ERROR: expected `bool` but found `int` } diff --git a/src/test/compile-fail/empty-vec-trailing-comma.rs b/src/test/compile-fail/empty-vec-trailing-comma.rs index 2d01da0f485bd..5cc08681e9921 100644 --- a/src/test/compile-fail/empty-vec-trailing-comma.rs +++ b/src/test/compile-fail/empty-vec-trailing-comma.rs @@ -1,3 +1,3 @@ fn main() { - let v = [,]/~; //! ERROR unexpected token: ',' + let v = [,]/~; //~ ERROR unexpected token: ',' } diff --git a/src/test/compile-fail/enum-in-scope.rs b/src/test/compile-fail/enum-in-scope.rs index 38e95c21e8f4f..e1d86936d0294 100644 --- a/src/test/compile-fail/enum-in-scope.rs +++ b/src/test/compile-fail/enum-in-scope.rs @@ -1,5 +1,5 @@ enum hello = int; fn main() { - let hello = 0; //!ERROR declaration of `hello` shadows an enum that's in + let hello = 0; //~ERROR declaration of `hello` shadows an enum that's in } \ No newline at end of file diff --git a/src/test/compile-fail/estr-subtyping.rs b/src/test/compile-fail/estr-subtyping.rs index 69b6d45baf73c..e5f963733dccb 100644 --- a/src/test/compile-fail/estr-subtyping.rs +++ b/src/test/compile-fail/estr-subtyping.rs @@ -4,26 +4,26 @@ fn wants_three(x: str/3) { } fn has_box(x: str/@) { wants_box(x); - wants_uniq(x); //! ERROR str storage differs: expected ~ but found @ - wants_three(x); //! ERROR str storage differs: expected 3 but found @ + wants_uniq(x); //~ ERROR str storage differs: expected ~ but found @ + wants_three(x); //~ ERROR str storage differs: expected 3 but found @ } fn has_uniq(x: str/~) { - wants_box(x); //! ERROR str storage differs: expected @ but found ~ + wants_box(x); //~ ERROR str storage differs: expected @ but found ~ wants_uniq(x); - wants_three(x); //! ERROR str storage differs: expected 3 but found ~ + wants_three(x); //~ ERROR str storage differs: expected 3 but found ~ } fn has_three(x: str/3) { - wants_box(x); //! ERROR str storage differs: expected @ but found 3 - wants_uniq(x); //! ERROR str storage differs: expected ~ but found 3 + wants_box(x); //~ ERROR str storage differs: expected @ but found 3 + wants_uniq(x); //~ ERROR str storage differs: expected ~ but found 3 wants_three(x); } fn has_four(x: str/4) { - wants_box(x); //! ERROR str storage differs: expected @ but found 4 - wants_uniq(x); //! ERROR str storage differs: expected ~ but found 4 - wants_three(x); //! ERROR str storage differs: expected 3 but found 4 + wants_box(x); //~ ERROR str storage differs: expected @ but found 4 + wants_uniq(x); //~ ERROR str storage differs: expected ~ but found 4 + wants_three(x); //~ ERROR str storage differs: expected 3 but found 4 } fn main() { diff --git a/src/test/compile-fail/evec-subtyping.rs b/src/test/compile-fail/evec-subtyping.rs index 843bd77625ebd..2688213740e4e 100644 --- a/src/test/compile-fail/evec-subtyping.rs +++ b/src/test/compile-fail/evec-subtyping.rs @@ -4,26 +4,26 @@ fn wants_three(x: [uint]/3) { } fn has_box(x: [uint]/@) { wants_box(x); - wants_uniq(x); //! ERROR [] storage differs: expected ~ but found @ - wants_three(x); //! ERROR [] storage differs: expected 3 but found @ + wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found @ + wants_three(x); //~ ERROR [] storage differs: expected 3 but found @ } fn has_uniq(x: [uint]/~) { - wants_box(x); //! ERROR [] storage differs: expected @ but found ~ + wants_box(x); //~ ERROR [] storage differs: expected @ but found ~ wants_uniq(x); - wants_three(x); //! ERROR [] storage differs: expected 3 but found ~ + wants_three(x); //~ ERROR [] storage differs: expected 3 but found ~ } fn has_three(x: [uint]/3) { - wants_box(x); //! ERROR [] storage differs: expected @ but found 3 - wants_uniq(x); //! ERROR [] storage differs: expected ~ but found 3 + wants_box(x); //~ ERROR [] storage differs: expected @ but found 3 + wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 3 wants_three(x); } fn has_four(x: [uint]/4) { - wants_box(x); //! ERROR [] storage differs: expected @ but found 4 - wants_uniq(x); //! ERROR [] storage differs: expected ~ but found 4 - wants_three(x); //! ERROR [] storage differs: expected 3 but found 4 + wants_box(x); //~ ERROR [] storage differs: expected @ but found 4 + wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 4 + wants_three(x); //~ ERROR [] storage differs: expected 3 but found 4 } fn main() { diff --git a/src/test/compile-fail/fn-compare-mismatch.rs b/src/test/compile-fail/fn-compare-mismatch.rs index 3dd0654f2fbf9..bc78b475843ef 100644 --- a/src/test/compile-fail/fn-compare-mismatch.rs +++ b/src/test/compile-fail/fn-compare-mismatch.rs @@ -2,5 +2,5 @@ fn main() { fn f() { } fn g(i: int) { } let x = f == g; - //!^ ERROR expected `extern fn()` but found `extern fn(int)` + //~^ ERROR expected `extern fn()` but found `extern fn(int)` } diff --git a/src/test/compile-fail/fn-variance-1.rs b/src/test/compile-fail/fn-variance-1.rs index cb2dbde3d48f8..01abd73bb479e 100644 --- a/src/test/compile-fail/fn-variance-1.rs +++ b/src/test/compile-fail/fn-variance-1.rs @@ -7,11 +7,11 @@ fn apply(t: T, f: fn(T)) { } fn main() { - apply(@3, takes_mut); //! ERROR (values differ in mutability) + apply(@3, takes_mut); //~ ERROR (values differ in mutability) apply(@3, takes_const); apply(@3, takes_imm); apply(@mut 3, takes_mut); apply(@mut 3, takes_const); - apply(@mut 3, takes_imm); //! ERROR (values differ in mutability) + apply(@mut 3, takes_imm); //~ ERROR (values differ in mutability) } diff --git a/src/test/compile-fail/fn-variance-2.rs b/src/test/compile-fail/fn-variance-2.rs index 9d4254a708e2b..6d9bdabae86c9 100644 --- a/src/test/compile-fail/fn-variance-2.rs +++ b/src/test/compile-fail/fn-variance-2.rs @@ -18,5 +18,5 @@ fn main() { let g: @const int = r(); // Bad. - let h: @int = r(); //! ERROR (values differ in mutability) + let h: @int = r(); //~ ERROR (values differ in mutability) } diff --git a/src/test/compile-fail/fn-variance-3.rs b/src/test/compile-fail/fn-variance-3.rs index d5989822f94b8..f9fe3d31fccb5 100644 --- a/src/test/compile-fail/fn-variance-3.rs +++ b/src/test/compile-fail/fn-variance-3.rs @@ -20,5 +20,5 @@ fn main() { // mutability check will fail, because the // type of r has been inferred to be // fn(@const int) -> @const int - *r(@mut 3) = 4; //! ERROR assigning to dereference of const @ pointer + *r(@mut 3) = 4; //~ ERROR assigning to dereference of const @ pointer } diff --git a/src/test/compile-fail/fully-qualified-type-name1.rs b/src/test/compile-fail/fully-qualified-type-name1.rs index db574f6f2bc16..cb56cbacb48be 100644 --- a/src/test/compile-fail/fully-qualified-type-name1.rs +++ b/src/test/compile-fail/fully-qualified-type-name1.rs @@ -3,5 +3,5 @@ fn main() { let x: option; x = 5; - //!^ ERROR mismatched types: expected `core::option::option` + //~^ ERROR mismatched types: expected `core::option::option` } diff --git a/src/test/compile-fail/fully-qualified-type-name2.rs b/src/test/compile-fail/fully-qualified-type-name2.rs index a9293da2eff0b..db6521cbd7891 100644 --- a/src/test/compile-fail/fully-qualified-type-name2.rs +++ b/src/test/compile-fail/fully-qualified-type-name2.rs @@ -10,7 +10,7 @@ mod y { fn bar(x: x::foo) -> y::foo { ret x; - //!^ ERROR mismatched types: expected `y::foo` but found `x::foo` + //~^ ERROR mismatched types: expected `y::foo` but found `x::foo` } fn main() { diff --git a/src/test/compile-fail/fully-qualified-type-name3.rs b/src/test/compile-fail/fully-qualified-type-name3.rs index 411dc2e9e766c..6bd764af17943 100644 --- a/src/test/compile-fail/fully-qualified-type-name3.rs +++ b/src/test/compile-fail/fully-qualified-type-name3.rs @@ -5,7 +5,7 @@ type T2 = int; fn bar(x: T1) -> T2 { ret x; - //!^ ERROR mismatched types: expected `T2` but found `T1` + //~^ ERROR mismatched types: expected `T2` but found `T1` } fn main() { diff --git a/src/test/compile-fail/fully-qualified-type-name4.rs b/src/test/compile-fail/fully-qualified-type-name4.rs index 73941c45498d1..7356043203292 100644 --- a/src/test/compile-fail/fully-qualified-type-name4.rs +++ b/src/test/compile-fail/fully-qualified-type-name4.rs @@ -4,7 +4,7 @@ import core::task::task; fn bar(x: uint) -> task { ret x; - //!^ ERROR mismatched types: expected `core::task::task` + //~^ ERROR mismatched types: expected `core::task::task` } fn main() { diff --git a/src/test/compile-fail/iface-cast.rs b/src/test/compile-fail/iface-cast.rs index 5c859f2122923..a82bb0b80d226 100644 --- a/src/test/compile-fail/iface-cast.rs +++ b/src/test/compile-fail/iface-cast.rs @@ -2,7 +2,7 @@ iface foo { } fn bar(x: foo) -> foo { ret (x as foo::); - //!^ ERROR mismatched types: expected `foo` but found `foo` + //~^ ERROR mismatched types: expected `foo` but found `foo` } fn main() {} diff --git a/src/test/compile-fail/iface-impl-different-num-params.rs b/src/test/compile-fail/iface-impl-different-num-params.rs index 7eadb1fe98e2c..094dc7ac0621c 100644 --- a/src/test/compile-fail/iface-impl-different-num-params.rs +++ b/src/test/compile-fail/iface-impl-different-num-params.rs @@ -3,7 +3,7 @@ iface foo { } impl of foo for int { fn bar() -> int { - //!^ ERROR method `bar` has 0 parameters but the iface has 1 + //~^ ERROR method `bar` has 0 parameters but the iface has 1 self } } diff --git a/src/test/compile-fail/iface-test-2.rs b/src/test/compile-fail/iface-test-2.rs index 96e5979084e7a..b2ee357ffc589 100644 --- a/src/test/compile-fail/iface-test-2.rs +++ b/src/test/compile-fail/iface-test-2.rs @@ -4,8 +4,8 @@ impl of bar for uint { fn dup() -> uint { self } fn blah() {} } impl of bar for uint { fn dup() -> uint { self } fn blah() {} } fn main() { - 10.dup::(); //! ERROR does not take type parameters - 10.blah::(); //! ERROR incorrect number of type parameters - 10u.dup(); //! ERROR multiple applicable methods - (10 as bar).dup(); //! ERROR contains a self type + 10.dup::(); //~ ERROR does not take type parameters + 10.blah::(); //~ ERROR incorrect number of type parameters + 10u.dup(); //~ ERROR multiple applicable methods + (10 as bar).dup(); //~ ERROR contains a self type } diff --git a/src/test/compile-fail/iface-test.rs b/src/test/compile-fail/iface-test.rs index 86c5a478d81e5..1d45832d6df1c 100644 --- a/src/test/compile-fail/iface-test.rs +++ b/src/test/compile-fail/iface-test.rs @@ -1,9 +1,9 @@ iface foo { fn foo(); } -impl of foo for uint {} //! ERROR missing method `foo` +impl of foo for uint {} //~ ERROR missing method `foo` -impl of foo for uint { fn foo() -> int {} } //! ERROR incompatible type +impl of foo for uint { fn foo() -> int {} } //~ ERROR incompatible type -impl of int for uint { fn foo() {} } //! ERROR can only implement interface +impl of int for uint { fn foo() {} } //~ ERROR can only implement interface fn main() {} diff --git a/src/test/compile-fail/impure-pred.rs b/src/test/compile-fail/impure-pred.rs index 41990fe167c15..aef5080e3ae19 100644 --- a/src/test/compile-fail/impure-pred.rs +++ b/src/test/compile-fail/impure-pred.rs @@ -3,7 +3,7 @@ fn g() { } pure fn f(_q: int) -> bool { - g(); //! ERROR access to impure function prohibited in pure context + g(); //~ ERROR access to impure function prohibited in pure context ret true; } diff --git a/src/test/compile-fail/index_message.rs b/src/test/compile-fail/index_message.rs index 4c8a9f10e665a..d138efbe5e268 100644 --- a/src/test/compile-fail/index_message.rs +++ b/src/test/compile-fail/index_message.rs @@ -1,4 +1,4 @@ fn main() { let z = (); - log(debug, z[0]); //! ERROR cannot index a value of type `()` + log(debug, z[0]); //~ ERROR cannot index a value of type `()` } diff --git a/src/test/compile-fail/integer-literal-suffix-inference.rs b/src/test/compile-fail/integer-literal-suffix-inference.rs index 96c7983c2baf2..8efc2650fa756 100644 --- a/src/test/compile-fail/integer-literal-suffix-inference.rs +++ b/src/test/compile-fail/integer-literal-suffix-inference.rs @@ -29,62 +29,62 @@ fn main() { fn id_u64(n: u64) -> u64 { n } id_i8(a8); // ok - id_i8(a16); //! ERROR mismatched types: expected `i8` but found `i16` - id_i8(a32); //! ERROR mismatched types: expected `i8` but found `i32` - id_i8(a64); //! ERROR mismatched types: expected `i8` but found `i64` + id_i8(a16); //~ ERROR mismatched types: expected `i8` but found `i16` + id_i8(a32); //~ ERROR mismatched types: expected `i8` but found `i32` + id_i8(a64); //~ ERROR mismatched types: expected `i8` but found `i64` - id_i16(a8); //! ERROR mismatched types: expected `i16` but found `i8` + id_i16(a8); //~ ERROR mismatched types: expected `i16` but found `i8` id_i16(a16); // ok - id_i16(a32); //! ERROR mismatched types: expected `i16` but found `i32` - id_i16(a64); //! ERROR mismatched types: expected `i16` but found `i64` + id_i16(a32); //~ ERROR mismatched types: expected `i16` but found `i32` + id_i16(a64); //~ ERROR mismatched types: expected `i16` but found `i64` - id_i32(a8); //! ERROR mismatched types: expected `i32` but found `i8` - id_i32(a16); //! ERROR mismatched types: expected `i32` but found `i16` + id_i32(a8); //~ ERROR mismatched types: expected `i32` but found `i8` + id_i32(a16); //~ ERROR mismatched types: expected `i32` but found `i16` id_i32(a32); // ok - id_i32(a64); //! ERROR mismatched types: expected `i32` but found `i64` + id_i32(a64); //~ ERROR mismatched types: expected `i32` but found `i64` - id_i64(a8); //! ERROR mismatched types: expected `i64` but found `i8` - id_i64(a16); //! ERROR mismatched types: expected `i64` but found `i16` - id_i64(a32); //! ERROR mismatched types: expected `i64` but found `i32` + id_i64(a8); //~ ERROR mismatched types: expected `i64` but found `i8` + id_i64(a16); //~ ERROR mismatched types: expected `i64` but found `i16` + id_i64(a32); //~ ERROR mismatched types: expected `i64` but found `i32` id_i64(a64); // ok id_i8(c8); // ok - id_i8(c16); //! ERROR mismatched types: expected `i8` but found `i16` - id_i8(c32); //! ERROR mismatched types: expected `i8` but found `i32` - id_i8(c64); //! ERROR mismatched types: expected `i8` but found `i64` + id_i8(c16); //~ ERROR mismatched types: expected `i8` but found `i16` + id_i8(c32); //~ ERROR mismatched types: expected `i8` but found `i32` + id_i8(c64); //~ ERROR mismatched types: expected `i8` but found `i64` - id_i16(c8); //! ERROR mismatched types: expected `i16` but found `i8` + id_i16(c8); //~ ERROR mismatched types: expected `i16` but found `i8` id_i16(c16); // ok - id_i16(c32); //! ERROR mismatched types: expected `i16` but found `i32` - id_i16(c64); //! ERROR mismatched types: expected `i16` but found `i64` + id_i16(c32); //~ ERROR mismatched types: expected `i16` but found `i32` + id_i16(c64); //~ ERROR mismatched types: expected `i16` but found `i64` - id_i32(c8); //! ERROR mismatched types: expected `i32` but found `i8` - id_i32(c16); //! ERROR mismatched types: expected `i32` but found `i16` + id_i32(c8); //~ ERROR mismatched types: expected `i32` but found `i8` + id_i32(c16); //~ ERROR mismatched types: expected `i32` but found `i16` id_i32(c32); // ok - id_i32(c64); //! ERROR mismatched types: expected `i32` but found `i64` + id_i32(c64); //~ ERROR mismatched types: expected `i32` but found `i64` - id_i64(a8); //! ERROR mismatched types: expected `i64` but found `i8` - id_i64(a16); //! ERROR mismatched types: expected `i64` but found `i16` - id_i64(a32); //! ERROR mismatched types: expected `i64` but found `i32` + id_i64(a8); //~ ERROR mismatched types: expected `i64` but found `i8` + id_i64(a16); //~ ERROR mismatched types: expected `i64` but found `i16` + id_i64(a32); //~ ERROR mismatched types: expected `i64` but found `i32` id_i64(a64); // ok id_u8(b8); // ok - id_u8(b16); //! ERROR mismatched types: expected `u8` but found `u16` - id_u8(b32); //! ERROR mismatched types: expected `u8` but found `u32` - id_u8(b64); //! ERROR mismatched types: expected `u8` but found `u64` + id_u8(b16); //~ ERROR mismatched types: expected `u8` but found `u16` + id_u8(b32); //~ ERROR mismatched types: expected `u8` but found `u32` + id_u8(b64); //~ ERROR mismatched types: expected `u8` but found `u64` - id_u16(b8); //! ERROR mismatched types: expected `u16` but found `u8` + id_u16(b8); //~ ERROR mismatched types: expected `u16` but found `u8` id_u16(b16); // ok - id_u16(b32); //! ERROR mismatched types: expected `u16` but found `u32` - id_u16(b64); //! ERROR mismatched types: expected `u16` but found `u64` + id_u16(b32); //~ ERROR mismatched types: expected `u16` but found `u32` + id_u16(b64); //~ ERROR mismatched types: expected `u16` but found `u64` - id_u32(b8); //! ERROR mismatched types: expected `u32` but found `u8` - id_u32(b16); //! ERROR mismatched types: expected `u32` but found `u16` + id_u32(b8); //~ ERROR mismatched types: expected `u32` but found `u8` + id_u32(b16); //~ ERROR mismatched types: expected `u32` but found `u16` id_u32(b32); // ok - id_u32(b64); //! ERROR mismatched types: expected `u32` but found `u64` + id_u32(b64); //~ ERROR mismatched types: expected `u32` but found `u64` - id_u64(b8); //! ERROR mismatched types: expected `u64` but found `u8` - id_u64(b16); //! ERROR mismatched types: expected `u64` but found `u16` - id_u64(b32); //! ERROR mismatched types: expected `u64` but found `u32` + id_u64(b8); //~ ERROR mismatched types: expected `u64` but found `u8` + id_u64(b16); //~ ERROR mismatched types: expected `u64` but found `u16` + id_u64(b32); //~ ERROR mismatched types: expected `u64` but found `u32` id_u64(b64); // ok } diff --git a/src/test/compile-fail/issue-1362.rs b/src/test/compile-fail/issue-1362.rs index 890e230e82986..c11b98cfe5263 100644 --- a/src/test/compile-fail/issue-1362.rs +++ b/src/test/compile-fail/issue-1362.rs @@ -1,7 +1,7 @@ // Regression test for issue #1362 - without that fix the span will be bogus // no-reformat fn main() { - let x: uint = 20i; //! ERROR mismatched types + let x: uint = 20i; //~ ERROR mismatched types } // NOTE: Do not add any extra lines as the line number the error is // on is significant; an error later in the source file might not diff --git a/src/test/compile-fail/issue-1448-1.rs b/src/test/compile-fail/issue-1448-1.rs index 8c3617a99da7c..89189fc1fcad2 100644 --- a/src/test/compile-fail/issue-1448-1.rs +++ b/src/test/compile-fail/issue-1448-1.rs @@ -3,5 +3,5 @@ fn main() { #macro[[#apply[f, [x, ...]], f(x, ...)]]; fn add(a: int, b: int) -> int { ret a + b; } - assert (#apply[add, [y, 15]] == 16); //! ERROR unresolved name: y + assert (#apply[add, [y, 15]] == 16); //~ ERROR unresolved name: y } diff --git a/src/test/compile-fail/issue-1448-2.rs b/src/test/compile-fail/issue-1448-2.rs index 9677a74a1b6c1..d91d48ac17240 100644 --- a/src/test/compile-fail/issue-1448-2.rs +++ b/src/test/compile-fail/issue-1448-2.rs @@ -1,5 +1,5 @@ // Regresion test for issue #1448 and #1386 fn main() { - #debug["%u", 10i]; //! ERROR mismatched types + #debug["%u", 10i]; //~ ERROR mismatched types } diff --git a/src/test/compile-fail/issue-1697.rs b/src/test/compile-fail/issue-1697.rs index 6579cd507dd5c..63b316813ff98 100644 --- a/src/test/compile-fail/issue-1697.rs +++ b/src/test/compile-fail/issue-1697.rs @@ -1,7 +1,7 @@ // Testing that we don't fail abnormally after hitting the errors -import unresolved::*; //! ERROR unresolved modulename -//!^ ERROR unresolved does not name a module +import unresolved::*; //~ ERROR unresolved modulename +//~^ ERROR unresolved does not name a module fn main() { } \ No newline at end of file diff --git a/src/test/compile-fail/issue-1763.rs b/src/test/compile-fail/issue-1763.rs index 17510164a5f9e..ba4828f88bc67 100644 --- a/src/test/compile-fail/issue-1763.rs +++ b/src/test/compile-fail/issue-1763.rs @@ -1,6 +1,6 @@ // Issue #1763 - infer types correctly -type actor = { //! ERROR type parameter `T` is unused +type actor = { //~ ERROR type parameter `T` is unused unused: bool }; diff --git a/src/test/compile-fail/issue-1896.rs b/src/test/compile-fail/issue-1896.rs index eea825060612b..765e014f7d895 100644 --- a/src/test/compile-fail/issue-1896.rs +++ b/src/test/compile-fail/issue-1896.rs @@ -3,6 +3,6 @@ type t = { f: fn() -> T }; fn f(_x: t) {} fn main() { - let x: t<()> = { f: { || () } }; //! ERROR expressions with stack closure + let x: t<()> = { f: { || () } }; //~ ERROR expressions with stack closure f(x); } diff --git a/src/test/compile-fail/issue-1962.rs b/src/test/compile-fail/issue-1962.rs index ff47022ab6532..aaf3c7653fbc9 100644 --- a/src/test/compile-fail/issue-1962.rs +++ b/src/test/compile-fail/issue-1962.rs @@ -1,7 +1,7 @@ // compile-flags: -W err-while-true fn main() { let mut i = 0; - while true { //! ERROR denote infinite loops with loop + while true { //~ ERROR denote infinite loops with loop i += 1; if i == 5 { break; } } diff --git a/src/test/compile-fail/issue-2063-resource.rs b/src/test/compile-fail/issue-2063-resource.rs index 0fb4f2caf6c94..9f489101f1bde 100644 --- a/src/test/compile-fail/issue-2063-resource.rs +++ b/src/test/compile-fail/issue-2063-resource.rs @@ -1,12 +1,12 @@ // 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. -class t { //! ERROR this type cannot be instantiated +class t { //~ ERROR this type cannot be instantiated let x: x; let to_str: (); new(x: x) { self.x = x; self.to_str = (); } } -enum x = @t; //! ERROR this type cannot be instantiated +enum x = @t; //~ ERROR this type cannot be instantiated fn main() { } diff --git a/src/test/compile-fail/issue-2063.rs b/src/test/compile-fail/issue-2063.rs index b061ed9d7338f..07b7d1ad3f4c6 100644 --- a/src/test/compile-fail/issue-2063.rs +++ b/src/test/compile-fail/issue-2063.rs @@ -1,7 +1,7 @@ // 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. -enum t = @t; //! ERROR this type cannot be instantiated +enum t = @t; //~ ERROR this type cannot be instantiated // I use an impl here because it will cause // the compiler to attempt autoderef and then diff --git a/src/test/compile-fail/issue-2111.rs b/src/test/compile-fail/issue-2111.rs index 5e289af9f517f..957d84eaa84fb 100644 --- a/src/test/compile-fail/issue-2111.rs +++ b/src/test/compile-fail/issue-2111.rs @@ -1,5 +1,5 @@ fn foo(a: option, b: option) { - alt (a,b) { //! ERROR: non-exhaustive patterns: none not covered + alt (a,b) { //~ ERROR: non-exhaustive patterns: none not covered (some(a), some(b)) if a == b { } (some(_), none) | (none, some(_)) { } diff --git a/src/test/compile-fail/issue-2149.rs b/src/test/compile-fail/issue-2149.rs index 6363ca5fb6c15..c8b36e0da18e2 100644 --- a/src/test/compile-fail/issue-2149.rs +++ b/src/test/compile-fail/issue-2149.rs @@ -2,8 +2,8 @@ impl monad for [A]/~ { fn bind(f: fn(A) -> [B]/~) { let mut r = fail; for self.each {|elt| r += f(elt); } - //!^ WARNING unreachable expression - //!^^ ERROR the type of this value must be known + //~^ WARNING unreachable expression + //~^^ ERROR the type of this value must be known } } fn main() { diff --git a/src/test/compile-fail/issue-2150.rs b/src/test/compile-fail/issue-2150.rs index a4877dad5b9f4..c523de89e848a 100644 --- a/src/test/compile-fail/issue-2150.rs +++ b/src/test/compile-fail/issue-2150.rs @@ -1,8 +1,8 @@ fn fail_len(v: [const int]/~) -> uint { let mut i = fail; for v.each {|x| i += 1u; } - //!^ WARNING unreachable statement - //!^^ ERROR the type of this value must be known + //~^ WARNING unreachable statement + //~^^ ERROR the type of this value must be known ret i; } fn main() {} \ No newline at end of file diff --git a/src/test/compile-fail/issue-2151.rs b/src/test/compile-fail/issue-2151.rs index a69b6df11069d..06ee782e77922 100644 --- a/src/test/compile-fail/issue-2151.rs +++ b/src/test/compile-fail/issue-2151.rs @@ -1,6 +1,6 @@ fn main() { vec::iter(fail) {|i| log (debug, i * 2); - //!^ ERROR the type of this value must be known + //~^ ERROR the type of this value must be known }; } \ No newline at end of file diff --git a/src/test/compile-fail/issue-2330.rs b/src/test/compile-fail/issue-2330.rs index 355b90bb2aacf..b0b210517147b 100644 --- a/src/test/compile-fail/issue-2330.rs +++ b/src/test/compile-fail/issue-2330.rs @@ -5,7 +5,7 @@ iface channel { } // `chan` is not an iface, it's an enum -impl of chan for int { //! ERROR can only implement interface types +impl of chan for int { //~ ERROR can only implement interface types fn send(v: int) { fail } } diff --git a/src/test/compile-fail/issue-2354.rs b/src/test/compile-fail/issue-2354.rs index 5b557cb1d7582..cf7a36224bb50 100644 --- a/src/test/compile-fail/issue-2354.rs +++ b/src/test/compile-fail/issue-2354.rs @@ -4,7 +4,7 @@ near the corresponding open brace. But currently it's reported at the end. xfailed for now (see Issue #2354) */ -fn foo() { //! ERROR this open brace is not closed +fn foo() { //~ ERROR this open brace is not closed alt some(x) { some(y) { fail; } none { fail; } diff --git a/src/test/compile-fail/issue-2467.rs b/src/test/compile-fail/issue-2467.rs index 2429273e1ecc8..f22fd18d356b7 100644 --- a/src/test/compile-fail/issue-2467.rs +++ b/src/test/compile-fail/issue-2467.rs @@ -1,5 +1,5 @@ -enum test { thing = 3u } //! ERROR mismatched types -//!^ ERROR expected signed integer constant +enum test { thing = 3u } //~ ERROR mismatched types +//~^ ERROR expected signed integer constant fn main() { log(error, thing as int); assert(thing as int == 3); diff --git a/src/test/compile-fail/issue-2487-b.rs b/src/test/compile-fail/issue-2487-b.rs index a1438c5318762..9868bef2ec37c 100644 --- a/src/test/compile-fail/issue-2487-b.rs +++ b/src/test/compile-fail/issue-2487-b.rs @@ -7,7 +7,7 @@ class socket { fn set_identity() { closure { || - setsockopt_bytes(self.sock) //! ERROR copying a noncopyable value + setsockopt_bytes(self.sock) //~ ERROR copying a noncopyable value } } } diff --git a/src/test/compile-fail/issue-2509-a.rs b/src/test/compile-fail/issue-2509-a.rs index 2113a1ec127eb..7039bec64d1dc 100644 --- a/src/test/compile-fail/issue-2509-a.rs +++ b/src/test/compile-fail/issue-2509-a.rs @@ -1,4 +1,4 @@ -class c { //! ERROR a class must have at least one field +class c { //~ ERROR a class must have at least one field new() { } } diff --git a/src/test/compile-fail/issue-2590.rs b/src/test/compile-fail/issue-2590.rs index c27fee9f8a876..d6e3022acc3e2 100644 --- a/src/test/compile-fail/issue-2590.rs +++ b/src/test/compile-fail/issue-2590.rs @@ -6,7 +6,7 @@ type parser = { impl parser for parser { fn parse() -> [mut int] { - dvec::unwrap(self.tokens) //! ERROR illegal move from self + dvec::unwrap(self.tokens) //~ ERROR illegal move from self } } diff --git a/src/test/compile-fail/issue-2718-a.rs b/src/test/compile-fail/issue-2718-a.rs index 1eb8d4a1b695e..b068f9e1dc25a 100644 --- a/src/test/compile-fail/issue-2718-a.rs +++ b/src/test/compile-fail/issue-2718-a.rs @@ -6,7 +6,7 @@ class send_packet { mod pingpong { type ping = send_packet; - enum pong = send_packet; //! ERROR illegal recursive enum type; wrap the inner value in a box to make it representable + enum pong = send_packet; //~ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable } fn main() {} diff --git a/src/test/compile-fail/issue-511.rs b/src/test/compile-fail/issue-511.rs index 793bb48c79a7d..9dea2443187c1 100644 --- a/src/test/compile-fail/issue-511.rs +++ b/src/test/compile-fail/issue-511.rs @@ -7,7 +7,7 @@ fn f(&o: option) { fn main() { f::(option::none); - //!^ ERROR taking mut reference to static item - //!^^ ERROR illegal borrow unless pure: creating mutable alias to aliasable, immutable memory - //!^^^ NOTE impure due to access to impure function + //~^ ERROR taking mut reference to static item + //~^^ ERROR illegal borrow unless pure: creating mutable alias to aliasable, immutable memory + //~^^^ NOTE impure due to access to impure function } \ No newline at end of file diff --git a/src/test/compile-fail/issue-897-2.rs b/src/test/compile-fail/issue-897-2.rs index ee9ff3788043d..ce6737cc96206 100644 --- a/src/test/compile-fail/issue-897-2.rs +++ b/src/test/compile-fail/issue-897-2.rs @@ -1,6 +1,6 @@ fn g() -> ! { fail; } fn f() -> ! { - ret 42i; //! ERROR expected `_|_` but found `int` - g(); //! WARNING unreachable statement + ret 42i; //~ ERROR expected `_|_` but found `int` + g(); //~ WARNING unreachable statement } fn main() { } diff --git a/src/test/compile-fail/issue-897.rs b/src/test/compile-fail/issue-897.rs index 35a56b255afa8..1adf8534cca67 100644 --- a/src/test/compile-fail/issue-897.rs +++ b/src/test/compile-fail/issue-897.rs @@ -1,5 +1,5 @@ fn f() -> ! { - ret 42i; //! ERROR expected `_|_` but found `int` - fail; //! WARNING unreachable statement + ret 42i; //~ ERROR expected `_|_` but found `int` + fail; //~ WARNING unreachable statement } fn main() { } diff --git a/src/test/compile-fail/kindck-implicit-close-over-mut-var.rs b/src/test/compile-fail/kindck-implicit-close-over-mut-var.rs index d646d6db07f82..f1da5ef132859 100644 --- a/src/test/compile-fail/kindck-implicit-close-over-mut-var.rs +++ b/src/test/compile-fail/kindck-implicit-close-over-mut-var.rs @@ -4,7 +4,7 @@ fn foo() { // Here, i is *moved* into the closure: Not actually OK let mut i = 0; task::spawn {|| - use(i); //! ERROR mutable variables cannot be implicitly captured + use(i); //~ ERROR mutable variables cannot be implicitly captured } } @@ -14,7 +14,7 @@ fn bar() { let mut i = 0; while i < 10 { task::spawn {|| - use(i); //! ERROR mutable variables cannot be implicitly captured + use(i); //~ ERROR mutable variables cannot be implicitly captured } i += 1; } diff --git a/src/test/compile-fail/kindck-nonsendable-1.rs b/src/test/compile-fail/kindck-nonsendable-1.rs index 29f34c5a51e52..fce28489cbf22 100644 --- a/src/test/compile-fail/kindck-nonsendable-1.rs +++ b/src/test/compile-fail/kindck-nonsendable-1.rs @@ -2,7 +2,7 @@ fn foo(_x: @uint) {} fn main() { let x = @3u; - let _ = fn~() { foo(x); }; //! ERROR not a sendable value - let _ = fn~(copy x) { foo(x); }; //! ERROR not a sendable value - let _ = fn~(move x) { foo(x); }; //! ERROR not a sendable value + let _ = fn~() { foo(x); }; //~ ERROR not a sendable value + let _ = fn~(copy x) { foo(x); }; //~ ERROR not a sendable value + let _ = fn~(move x) { foo(x); }; //~ ERROR not a sendable value } \ No newline at end of file diff --git a/src/test/compile-fail/liveness-and-init.rs b/src/test/compile-fail/liveness-and-init.rs index aea30e3465c6d..7deafdce36305 100644 --- a/src/test/compile-fail/liveness-and-init.rs +++ b/src/test/compile-fail/liveness-and-init.rs @@ -2,5 +2,5 @@ fn main() { let i: int; log(debug, false && { i = 5; true }); - log(debug, i); //! ERROR use of possibly uninitialized variable: `i` + log(debug, i); //~ ERROR use of possibly uninitialized variable: `i` } diff --git a/src/test/compile-fail/liveness-assign-imm-local-in-loop.rs b/src/test/compile-fail/liveness-assign-imm-local-in-loop.rs index 2fc1bca5a6303..41b9fd4f1d9a0 100644 --- a/src/test/compile-fail/liveness-assign-imm-local-in-loop.rs +++ b/src/test/compile-fail/liveness-assign-imm-local-in-loop.rs @@ -1,8 +1,8 @@ fn test() { let v: int; loop { - v = 1; //! ERROR re-assignment of immutable variable - //!^ NOTE prior assignment occurs here + v = 1; //~ ERROR re-assignment of immutable variable + //~^ NOTE prior assignment occurs here copy v; // just to prevent liveness warnings } } diff --git a/src/test/compile-fail/liveness-assign-imm-local-in-op-eq.rs b/src/test/compile-fail/liveness-assign-imm-local-in-op-eq.rs index adb42333523a4..baf0d55f05749 100644 --- a/src/test/compile-fail/liveness-assign-imm-local-in-op-eq.rs +++ b/src/test/compile-fail/liveness-assign-imm-local-in-op-eq.rs @@ -1,7 +1,7 @@ fn test() { let v: int; - v = 2; //! NOTE prior assignment occurs here - v += 1; //! ERROR re-assignment of immutable variable + v = 2; //~ NOTE prior assignment occurs here + v += 1; //~ ERROR re-assignment of immutable variable copy v; } diff --git a/src/test/compile-fail/liveness-assign-imm-local-in-swap.rs b/src/test/compile-fail/liveness-assign-imm-local-in-swap.rs index c432d03bed36c..d2388f200d613 100644 --- a/src/test/compile-fail/liveness-assign-imm-local-in-swap.rs +++ b/src/test/compile-fail/liveness-assign-imm-local-in-swap.rs @@ -1,17 +1,17 @@ fn test1() { let v: int; let mut w: int; - v = 1; //! NOTE prior assignment occurs here + v = 1; //~ NOTE prior assignment occurs here w = 2; - v <-> w; //! ERROR re-assignment of immutable variable + v <-> w; //~ ERROR re-assignment of immutable variable } fn test2() { let v: int; let mut w: int; - v = 1; //! NOTE prior assignment occurs here + v = 1; //~ NOTE prior assignment occurs here w = 2; - w <-> v; //! ERROR re-assignment of immutable variable + w <-> v; //~ ERROR re-assignment of immutable variable } fn main() { diff --git a/src/test/compile-fail/liveness-assign-imm-local-with-init.rs b/src/test/compile-fail/liveness-assign-imm-local-with-init.rs index 045ce5baa46a1..1b46e97dbd2fb 100644 --- a/src/test/compile-fail/liveness-assign-imm-local-with-init.rs +++ b/src/test/compile-fail/liveness-assign-imm-local-with-init.rs @@ -1,7 +1,7 @@ fn test() { - let v: int = 1; //! NOTE prior assignment occurs here + let v: int = 1; //~ NOTE prior assignment occurs here copy v; - v = 2; //! ERROR re-assignment of immutable variable + v = 2; //~ ERROR re-assignment of immutable variable copy v; } diff --git a/src/test/compile-fail/liveness-block-unint.rs b/src/test/compile-fail/liveness-block-unint.rs index 698f9f7cf7925..e341ed33c2fc0 100644 --- a/src/test/compile-fail/liveness-block-unint.rs +++ b/src/test/compile-fail/liveness-block-unint.rs @@ -2,6 +2,6 @@ fn force(f: fn()) { f(); } fn main() { let x: int; force(fn&() { - log(debug, x); //! ERROR capture of possibly uninitialized variable: `x` + log(debug, x); //~ ERROR capture of possibly uninitialized variable: `x` }); } diff --git a/src/test/compile-fail/liveness-break-uninit-2.rs b/src/test/compile-fail/liveness-break-uninit-2.rs index 4b18845f87821..fc1c941836ead 100644 --- a/src/test/compile-fail/liveness-break-uninit-2.rs +++ b/src/test/compile-fail/liveness-break-uninit-2.rs @@ -3,10 +3,10 @@ fn foo() -> int { while 1 != 2 { break; - x = 0; //! WARNING unreachable statement + x = 0; //~ WARNING unreachable statement } - log(debug, x); //! ERROR use of possibly uninitialized variable: `x` + log(debug, x); //~ ERROR use of possibly uninitialized variable: `x` ret 17; } diff --git a/src/test/compile-fail/liveness-break-uninit.rs b/src/test/compile-fail/liveness-break-uninit.rs index 5bba9535e5314..56753a3a95ca5 100644 --- a/src/test/compile-fail/liveness-break-uninit.rs +++ b/src/test/compile-fail/liveness-break-uninit.rs @@ -3,10 +3,10 @@ fn foo() -> int { loop { break; - x = 0; //! WARNING unreachable statement + x = 0; //~ WARNING unreachable statement } - log(debug, x); //! ERROR use of possibly uninitialized variable: `x` + log(debug, x); //~ ERROR use of possibly uninitialized variable: `x` ret 17; } diff --git a/src/test/compile-fail/liveness-ctor-access-self-with-uninit-fields.rs b/src/test/compile-fail/liveness-ctor-access-self-with-uninit-fields.rs index 9c98229281612..0480bc71798a7 100644 --- a/src/test/compile-fail/liveness-ctor-access-self-with-uninit-fields.rs +++ b/src/test/compile-fail/liveness-ctor-access-self-with-uninit-fields.rs @@ -3,7 +3,7 @@ class cat { fn meow() {} new() { self.meow(); - //!^ ERROR use of possibly uninitialized field: `self.how_hungry` + //~^ ERROR use of possibly uninitialized field: `self.how_hungry` } } diff --git a/src/test/compile-fail/liveness-ctor-field-never-init.rs b/src/test/compile-fail/liveness-ctor-field-never-init.rs index b979bdd9255d8..d71dff9806422 100644 --- a/src/test/compile-fail/liveness-ctor-field-never-init.rs +++ b/src/test/compile-fail/liveness-ctor-field-never-init.rs @@ -1,6 +1,6 @@ class cat { let how_hungry : int; - new() {} //! ERROR field `self.how_hungry` is never initialized + new() {} //~ ERROR field `self.how_hungry` is never initialized } fn main() { diff --git a/src/test/compile-fail/liveness-ctor-uninit-field.rs b/src/test/compile-fail/liveness-ctor-uninit-field.rs index 080d4678a2f1e..3d4a88db26222 100644 --- a/src/test/compile-fail/liveness-ctor-uninit-field.rs +++ b/src/test/compile-fail/liveness-ctor-uninit-field.rs @@ -6,7 +6,7 @@ class cat { new() { self.a = 3; self.b = self.a; - self.a += self.c; //! ERROR use of possibly uninitialized field: `self.c` + self.a += self.c; //~ ERROR use of possibly uninitialized field: `self.c` } } diff --git a/src/test/compile-fail/liveness-ctor-uninit-var.rs b/src/test/compile-fail/liveness-ctor-uninit-var.rs index 3bbccd62ae3e7..d03c7888974e1 100644 --- a/src/test/compile-fail/liveness-ctor-uninit-var.rs +++ b/src/test/compile-fail/liveness-ctor-uninit-var.rs @@ -12,7 +12,7 @@ class cat { new(in_x : uint, in_y : int) { let foo; self.meows = in_x + (in_y as uint); - self.how_hungry = foo; //! ERROR use of possibly uninitialized variable: `foo` + self.how_hungry = foo; //~ ERROR use of possibly uninitialized variable: `foo` } } diff --git a/src/test/compile-fail/liveness-dead.rs b/src/test/compile-fail/liveness-dead.rs index bda153b5ad4dc..a115d7c4e3402 100644 --- a/src/test/compile-fail/liveness-dead.rs +++ b/src/test/compile-fail/liveness-dead.rs @@ -3,7 +3,7 @@ fn f1(&x: int) { } fn f2() { - let mut x = 3; //! WARNING value assigned to `x` is never read + let mut x = 3; //~ WARNING value assigned to `x` is never read x = 4; copy x; } @@ -11,10 +11,10 @@ fn f2() { fn f3() { let mut x = 3; copy x; - x = 4; //! WARNING value assigned to `x` is never read + x = 4; //~ WARNING value assigned to `x` is never read } fn main() { // leave this in here just to trigger compile-fail: let x: int; - copy x; //! ERROR use of possibly uninitialized variable: `x` + copy x; //~ ERROR use of possibly uninitialized variable: `x` } diff --git a/src/test/compile-fail/liveness-if-no-else.rs b/src/test/compile-fail/liveness-if-no-else.rs index 5cbd24a6a5b29..dfdcfa266fc70 100644 --- a/src/test/compile-fail/liveness-if-no-else.rs +++ b/src/test/compile-fail/liveness-if-no-else.rs @@ -2,5 +2,5 @@ fn foo(x: int) { log(debug, x); } fn main() { let x: int; if 1 > 2 { x = 10; } - foo(x); //! ERROR use of possibly uninitialized variable: `x` + foo(x); //~ ERROR use of possibly uninitialized variable: `x` } diff --git a/src/test/compile-fail/liveness-if-with-else.rs b/src/test/compile-fail/liveness-if-with-else.rs index dbb3e6b164546..7f7003dbbe4f0 100644 --- a/src/test/compile-fail/liveness-if-with-else.rs +++ b/src/test/compile-fail/liveness-if-with-else.rs @@ -7,5 +7,5 @@ fn main() { } else { x = 10; } - foo(x); //! ERROR use of possibly uninitialized variable: `x` + foo(x); //~ ERROR use of possibly uninitialized variable: `x` } diff --git a/src/test/compile-fail/liveness-init-in-called-fn-expr.rs b/src/test/compile-fail/liveness-init-in-called-fn-expr.rs index 28351ceeb08cd..5716a380936e1 100644 --- a/src/test/compile-fail/liveness-init-in-called-fn-expr.rs +++ b/src/test/compile-fail/liveness-init-in-called-fn-expr.rs @@ -1,7 +1,7 @@ fn main() { let j = fn@() -> int { let i: int; - ret i; //! ERROR use of possibly uninitialized variable: `i` + ret i; //~ ERROR use of possibly uninitialized variable: `i` }; j(); } diff --git a/src/test/compile-fail/liveness-init-in-fn-expr.rs b/src/test/compile-fail/liveness-init-in-fn-expr.rs index 8c68ba750a8a1..cffba2132c2c1 100644 --- a/src/test/compile-fail/liveness-init-in-fn-expr.rs +++ b/src/test/compile-fail/liveness-init-in-fn-expr.rs @@ -1,7 +1,7 @@ fn main() { let f = fn@() -> int { let i: int; - ret i; //! ERROR use of possibly uninitialized variable: `i` + ret i; //~ ERROR use of possibly uninitialized variable: `i` }; log(error, f()); } diff --git a/src/test/compile-fail/liveness-init-in-fru.rs b/src/test/compile-fail/liveness-init-in-fru.rs index a9a80e9ad6ed7..f6ba7c32792ad 100644 --- a/src/test/compile-fail/liveness-init-in-fru.rs +++ b/src/test/compile-fail/liveness-init-in-fru.rs @@ -4,6 +4,6 @@ type point = {x: int, y: int}; fn main() { let mut origin: point; - origin = {x: 10 with origin}; //! ERROR use of possibly uninitialized variable: `origin` + origin = {x: 10 with origin}; //~ ERROR use of possibly uninitialized variable: `origin` copy origin; } diff --git a/src/test/compile-fail/liveness-init-op-equal.rs b/src/test/compile-fail/liveness-init-op-equal.rs index 8d397e73b1fbd..89b07847e73dd 100644 --- a/src/test/compile-fail/liveness-init-op-equal.rs +++ b/src/test/compile-fail/liveness-init-op-equal.rs @@ -1,6 +1,6 @@ fn test() { let v: int; - v += 1; //! ERROR use of possibly uninitialized variable: `v` + v += 1; //~ ERROR use of possibly uninitialized variable: `v` copy v; } diff --git a/src/test/compile-fail/liveness-init-plus-equal.rs b/src/test/compile-fail/liveness-init-plus-equal.rs index dacc1f4f922ea..afb384b24d599 100644 --- a/src/test/compile-fail/liveness-init-plus-equal.rs +++ b/src/test/compile-fail/liveness-init-plus-equal.rs @@ -1,6 +1,6 @@ fn test() { let mut v: int; - v = v + 1; //! ERROR use of possibly uninitialized variable: `v` + v = v + 1; //~ ERROR use of possibly uninitialized variable: `v` copy v; } diff --git a/src/test/compile-fail/liveness-issue-2163.rs b/src/test/compile-fail/liveness-issue-2163.rs index e5a7cd0365d09..0165cd8e86f17 100644 --- a/src/test/compile-fail/liveness-issue-2163.rs +++ b/src/test/compile-fail/liveness-issue-2163.rs @@ -1,5 +1,5 @@ fn main(_s: [str]/~) { let a: [int]/~ = []/~; - vec::each(a) { |_x| //! ERROR not all control paths return a value + vec::each(a) { |_x| //~ ERROR not all control paths return a value } } diff --git a/src/test/compile-fail/liveness-move-from-args.rs b/src/test/compile-fail/liveness-move-from-args.rs index 0c3e594040bc1..27e7e51b40547 100644 --- a/src/test/compile-fail/liveness-move-from-args.rs +++ b/src/test/compile-fail/liveness-move-from-args.rs @@ -1,15 +1,15 @@ fn take(-_x: int) { } fn from_by_value_arg(++x: int) { - take(x); //! ERROR illegal move from argument `x`, which is not copy or move mode + take(x); //~ ERROR illegal move from argument `x`, which is not copy or move mode } fn from_by_mut_ref_arg(&x: int) { - take(x); //! ERROR illegal move from argument `x`, which is not copy or move mode + take(x); //~ ERROR illegal move from argument `x`, which is not copy or move mode } fn from_by_ref_arg(&&x: int) { - take(x); //! ERROR illegal move from argument `x`, which is not copy or move mode + take(x); //~ ERROR illegal move from argument `x`, which is not copy or move mode } fn from_copy_arg(+x: int) { diff --git a/src/test/compile-fail/liveness-move-from-mode.rs b/src/test/compile-fail/liveness-move-from-mode.rs index f0db4926734c5..a837d337f98dd 100644 --- a/src/test/compile-fail/liveness-move-from-mode.rs +++ b/src/test/compile-fail/liveness-move-from-mode.rs @@ -4,7 +4,7 @@ fn main() { let x: int = 25; loop { - take(x); //! ERROR use of moved variable: `x` - //!^ NOTE move of variable occurred here + take(x); //~ ERROR use of moved variable: `x` + //~^ NOTE move of variable occurred here } } diff --git a/src/test/compile-fail/liveness-move-in-loop.rs b/src/test/compile-fail/liveness-move-in-loop.rs index 1bdfc392bd906..d9233e41e38a9 100644 --- a/src/test/compile-fail/liveness-move-in-loop.rs +++ b/src/test/compile-fail/liveness-move-in-loop.rs @@ -7,8 +7,8 @@ fn main() { loop { loop { loop { - x <- y; //! ERROR use of moved variable - //!^ NOTE move of variable occurred here + x <- y; //~ ERROR use of moved variable + //~^ NOTE move of variable occurred here copy x; } diff --git a/src/test/compile-fail/liveness-move-in-while.rs b/src/test/compile-fail/liveness-move-in-while.rs index d5a95b08bd83e..261eb31089084 100644 --- a/src/test/compile-fail/liveness-move-in-while.rs +++ b/src/test/compile-fail/liveness-move-in-while.rs @@ -5,7 +5,7 @@ fn main() { loop { log(debug, y); while true { while true { while true { x <- y; copy x; } } } - //!^ ERROR use of moved variable: `y` - //!^^ NOTE move of variable occurred here + //~^ ERROR use of moved variable: `y` + //~^^ NOTE move of variable occurred here } } diff --git a/src/test/compile-fail/liveness-or-init.rs b/src/test/compile-fail/liveness-or-init.rs index 5912378cf4251..138dbc0a7a847 100644 --- a/src/test/compile-fail/liveness-or-init.rs +++ b/src/test/compile-fail/liveness-or-init.rs @@ -2,5 +2,5 @@ fn main() { let i: int; log(debug, false || { i = 5; true }); - log(debug, i); //! ERROR use of possibly uninitialized variable: `i` + log(debug, i); //~ ERROR use of possibly uninitialized variable: `i` } diff --git a/src/test/compile-fail/liveness-return.rs b/src/test/compile-fail/liveness-return.rs index cee1444ca630a..830eb9f8e891d 100644 --- a/src/test/compile-fail/liveness-return.rs +++ b/src/test/compile-fail/liveness-return.rs @@ -1,6 +1,6 @@ fn f() -> int { let x: int; - ret x; //! ERROR use of possibly uninitialized variable: `x` + ret x; //~ ERROR use of possibly uninitialized variable: `x` } fn main() { f(); } diff --git a/src/test/compile-fail/liveness-swap-uninit.rs b/src/test/compile-fail/liveness-swap-uninit.rs index d3a5395bfffce..5291c9925b6f8 100644 --- a/src/test/compile-fail/liveness-swap-uninit.rs +++ b/src/test/compile-fail/liveness-swap-uninit.rs @@ -1,6 +1,6 @@ fn main() { let mut x = 3; let y; - x <-> y; //! ERROR use of possibly uninitialized variable: `y` + x <-> y; //~ ERROR use of possibly uninitialized variable: `y` copy x; } diff --git a/src/test/compile-fail/liveness-uninit-after-item.rs b/src/test/compile-fail/liveness-uninit-after-item.rs index 678a063284ef6..af8afda4e62f5 100644 --- a/src/test/compile-fail/liveness-uninit-after-item.rs +++ b/src/test/compile-fail/liveness-uninit-after-item.rs @@ -1,6 +1,6 @@ fn main() { let bar; fn baz(_x: int) { } - baz(bar); //! ERROR use of possibly uninitialized variable: `bar` + baz(bar); //~ ERROR use of possibly uninitialized variable: `bar` } diff --git a/src/test/compile-fail/liveness-uninit.rs b/src/test/compile-fail/liveness-uninit.rs index 1930a2e335267..59bb9e847dcd8 100644 --- a/src/test/compile-fail/liveness-uninit.rs +++ b/src/test/compile-fail/liveness-uninit.rs @@ -2,5 +2,5 @@ fn foo(x: int) { log(debug, x); } fn main() { let x: int; - foo(x); //! ERROR use of possibly uninitialized variable: `x` + foo(x); //~ ERROR use of possibly uninitialized variable: `x` } diff --git a/src/test/compile-fail/liveness-unused.rs b/src/test/compile-fail/liveness-unused.rs index a1ad07f6ecb95..7db0a9fe1711f 100644 --- a/src/test/compile-fail/liveness-unused.rs +++ b/src/test/compile-fail/liveness-unused.rs @@ -1,26 +1,26 @@ fn f1(x: int) { - //!^ WARNING unused variable: `x` + //~^ WARNING unused variable: `x` } fn f1b(&x: int) { - //!^ WARNING unused variable: `x` + //~^ WARNING unused variable: `x` } fn f2() { let x = 3; - //!^ WARNING unused variable: `x` + //~^ WARNING unused variable: `x` } fn f3() { let mut x = 3; - //!^ WARNING variable `x` is assigned to, but never used + //~^ WARNING variable `x` is assigned to, but never used x += 4; - //!^ WARNING value assigned to `x` is never read + //~^ WARNING value assigned to `x` is never read } fn f3b() { let mut z = 3; - //!^ WARNING variable `z` is assigned to, but never used + //~^ WARNING variable `z` is assigned to, but never used loop { z += 4; } @@ -40,5 +40,5 @@ fn even(i: int) : is_even(i) -> int { i } fn main() { let i: int = 4; log(debug, false && { check is_even(i); true }); - even(i); //! ERROR unsatisfied precondition + even(i); //~ ERROR unsatisfied precondition } diff --git a/src/test/compile-fail/liveness-use-after-move.rs b/src/test/compile-fail/liveness-use-after-move.rs index 34a932a5a1689..f060fe8307f0e 100644 --- a/src/test/compile-fail/liveness-use-after-move.rs +++ b/src/test/compile-fail/liveness-use-after-move.rs @@ -1,6 +1,6 @@ fn main() { let x = @5; - let y <- x; //! NOTE move of variable occurred here - log(debug, *x); //! ERROR use of moved variable: `x` + let y <- x; //~ NOTE move of variable occurred here + log(debug, *x); //~ ERROR use of moved variable: `x` copy y; } diff --git a/src/test/compile-fail/liveness-use-after-send.rs b/src/test/compile-fail/liveness-use-after-send.rs index 3827598c0a71d..6dfa9a997ff44 100644 --- a/src/test/compile-fail/liveness-use-after-send.rs +++ b/src/test/compile-fail/liveness-use-after-send.rs @@ -9,8 +9,8 @@ enum _chan = int; // Tests that "log(debug, message);" is flagged as using // message after the send deinitializes it fn test00_start(ch: _chan, message: int, _count: int) { - send(ch, message); //! NOTE move of variable occurred here - log(debug, message); //! ERROR use of moved variable: `message` + send(ch, message); //~ NOTE move of variable occurred here + log(debug, message); //~ ERROR use of moved variable: `message` } fn main() { fail; } diff --git a/src/test/compile-fail/liveness-use-in-index-lvalue.rs b/src/test/compile-fail/liveness-use-in-index-lvalue.rs index fd7ad945a5727..de0706ecb6c00 100644 --- a/src/test/compile-fail/liveness-use-in-index-lvalue.rs +++ b/src/test/compile-fail/liveness-use-in-index-lvalue.rs @@ -1,6 +1,6 @@ fn test() { let w: [int]/~; - w[5] = 0; //! ERROR use of possibly uninitialized variable: `w` + w[5] = 0; //~ ERROR use of possibly uninitialized variable: `w` } fn main() { test(); } diff --git a/src/test/compile-fail/liveness-while-break.rs b/src/test/compile-fail/liveness-while-break.rs index 755deb31fbafc..c963e2dee4e23 100644 --- a/src/test/compile-fail/liveness-while-break.rs +++ b/src/test/compile-fail/liveness-while-break.rs @@ -4,7 +4,7 @@ fn test(cond: bool) { v = 3; break; } - #debug["%d", v]; //! ERROR use of possibly uninitialized variable: `v` + #debug["%d", v]; //~ ERROR use of possibly uninitialized variable: `v` } fn main() { diff --git a/src/test/compile-fail/liveness-while-cond.rs b/src/test/compile-fail/liveness-while-cond.rs index a0a90e9550c39..28a5fb18a7f1d 100644 --- a/src/test/compile-fail/liveness-while-cond.rs +++ b/src/test/compile-fail/liveness-while-cond.rs @@ -1,4 +1,4 @@ fn main() { let x: bool; - while x { } //! ERROR use of possibly uninitialized variable: `x` + while x { } //~ ERROR use of possibly uninitialized variable: `x` } diff --git a/src/test/compile-fail/liveness-while.rs b/src/test/compile-fail/liveness-while.rs index b69012bc3f22a..9cd61330bae4c 100644 --- a/src/test/compile-fail/liveness-while.rs +++ b/src/test/compile-fail/liveness-while.rs @@ -1,7 +1,7 @@ fn f() -> int { let mut x: int; while 1 == 1 { x = 10; } - ret x; //! ERROR use of possibly uninitialized variable: `x` + ret x; //~ ERROR use of possibly uninitialized variable: `x` } fn main() { f(); } diff --git a/src/test/compile-fail/loop-does-not-diverge.rs b/src/test/compile-fail/loop-does-not-diverge.rs index e0cf57c1588b7..06a227cffd2d7 100644 --- a/src/test/compile-fail/loop-does-not-diverge.rs +++ b/src/test/compile-fail/loop-does-not-diverge.rs @@ -4,7 +4,7 @@ fn forever() -> ! { loop { break; } - ret 42i; //! ERROR expected `_|_` but found `int` + ret 42i; //~ ERROR expected `_|_` but found `int` } fn main() { diff --git a/src/test/compile-fail/lub-in-args.rs b/src/test/compile-fail/lub-in-args.rs index 1b10639445afe..dd44a1371614b 100644 --- a/src/test/compile-fail/lub-in-args.rs +++ b/src/test/compile-fail/lub-in-args.rs @@ -12,6 +12,6 @@ fn main() { // shortcoming of the current inference algorithm. These errors // are *not* desirable. - two_args(x, y); //! ERROR (values differ in mutability) - two_args(a, b); //! ERROR (values differ in mutability) + two_args(x, y); //~ ERROR (values differ in mutability) + two_args(a, b); //~ ERROR (values differ in mutability) } \ No newline at end of file diff --git a/src/test/compile-fail/main-wrong-type-2.rs b/src/test/compile-fail/main-wrong-type-2.rs index 338956f7796fc..106b0daf4b31c 100644 --- a/src/test/compile-fail/main-wrong-type-2.rs +++ b/src/test/compile-fail/main-wrong-type-2.rs @@ -1,3 +1,3 @@ fn main() -> char { -//!^ ERROR Wrong type in main function: found `extern fn() -> char` +//~^ ERROR Wrong type in main function: found `extern fn() -> char` } diff --git a/src/test/compile-fail/main-wrong-type.rs b/src/test/compile-fail/main-wrong-type.rs index 859a70e0a510c..b920f02e0694f 100644 --- a/src/test/compile-fail/main-wrong-type.rs +++ b/src/test/compile-fail/main-wrong-type.rs @@ -1,3 +1,3 @@ fn main(foo: {x: int, y: int}) { -//!^ ERROR Wrong type in main function: found `extern fn({x: int,y: int})` +//~^ ERROR Wrong type in main function: found `extern fn({x: int,y: int})` } diff --git a/src/test/compile-fail/map-types.rs b/src/test/compile-fail/map-types.rs index c4005048bf1b6..084cbf9529c05 100644 --- a/src/test/compile-fail/map-types.rs +++ b/src/test/compile-fail/map-types.rs @@ -8,5 +8,5 @@ import std::map::map; fn main() { let x: map = map::str_hash::() as map::; let y: map = x; - //!^ ERROR mismatched types: expected `std::map::map` + //~^ ERROR mismatched types: expected `std::map::map` } diff --git a/src/test/compile-fail/mode-inference-fail.rs b/src/test/compile-fail/mode-inference-fail.rs index 732c9a4311f28..0a42bef596838 100644 --- a/src/test/compile-fail/mode-inference-fail.rs +++ b/src/test/compile-fail/mode-inference-fail.rs @@ -7,5 +7,5 @@ fn apply_int(f: fn(int) -> int, a: int) -> int { f(a) } fn main() { let f = {|i| i}; assert apply_int(f, 2) == 2; - assert apply(f, 2) == 2; //! ERROR expected argument mode ++ + assert apply(f, 2) == 2; //~ ERROR expected argument mode ++ } diff --git a/src/test/compile-fail/mutable-arguments.rs b/src/test/compile-fail/mutable-arguments.rs index 79e7f412163e6..4fcb73e8516c4 100644 --- a/src/test/compile-fail/mutable-arguments.rs +++ b/src/test/compile-fail/mutable-arguments.rs @@ -5,25 +5,25 @@ fn mutate_by_mut_ref(&x: uint) { } fn mutate_by_ref(&&x: uint) { - //!^ WARNING unused variable: `x` - x = 0u; //! ERROR assigning to argument + //~^ WARNING unused variable: `x` + x = 0u; //~ ERROR assigning to argument } fn mutate_by_val(++x: uint) { - //!^ WARNING unused variable: `x` - x = 0u; //! ERROR assigning to argument + //~^ WARNING unused variable: `x` + x = 0u; //~ ERROR assigning to argument } fn mutate_by_copy(+x: uint) { - //!^ WARNING unused variable: `x` - x = 0u; //! ERROR assigning to argument - //!^ WARNING value assigned to `x` is never read + //~^ WARNING unused variable: `x` + x = 0u; //~ ERROR assigning to argument + //~^ WARNING value assigned to `x` is never read } fn mutate_by_move(-x: uint) { - //!^ WARNING unused variable: `x` - x = 0u; //! ERROR assigning to argument - //!^ WARNING value assigned to `x` is never read + //~^ WARNING unused variable: `x` + x = 0u; //~ ERROR assigning to argument + //~^ WARNING value assigned to `x` is never read } fn main() { diff --git a/src/test/compile-fail/mutable-huh-box-assign.rs b/src/test/compile-fail/mutable-huh-box-assign.rs index 5b5150b985c3c..c9484e62c1eb0 100644 --- a/src/test/compile-fail/mutable-huh-box-assign.rs +++ b/src/test/compile-fail/mutable-huh-box-assign.rs @@ -1,6 +1,6 @@ fn main() { fn f(&&v: @const int) { - *v = 1 //! ERROR assigning to dereference of const @ pointer + *v = 1 //~ ERROR assigning to dereference of const @ pointer } let v = @0; diff --git a/src/test/compile-fail/mutable-huh-field-assign.rs b/src/test/compile-fail/mutable-huh-field-assign.rs index e1bf6fe665bb4..44da70f463c34 100644 --- a/src/test/compile-fail/mutable-huh-field-assign.rs +++ b/src/test/compile-fail/mutable-huh-field-assign.rs @@ -1,7 +1,7 @@ fn main() { fn f(&&v: {const field: int}) { // This shouldn't be possible - v.field = 1 //! ERROR assigning to const field + v.field = 1 //~ ERROR assigning to const field } let v = {field: 0}; diff --git a/src/test/compile-fail/mutable-huh-ptr-assign.rs b/src/test/compile-fail/mutable-huh-ptr-assign.rs index 77ba86d6d6f5f..1aa965869be56 100644 --- a/src/test/compile-fail/mutable-huh-ptr-assign.rs +++ b/src/test/compile-fail/mutable-huh-ptr-assign.rs @@ -2,7 +2,7 @@ use std; fn main() { unsafe fn f(&&v: *const int) { - *v = 1 //! ERROR assigning to dereference of const * pointer + *v = 1 //~ ERROR assigning to dereference of const * pointer } unsafe { diff --git a/src/test/compile-fail/mutable-huh-unique-assign.rs b/src/test/compile-fail/mutable-huh-unique-assign.rs index 591ea069b0709..1b9b7a22191cb 100644 --- a/src/test/compile-fail/mutable-huh-unique-assign.rs +++ b/src/test/compile-fail/mutable-huh-unique-assign.rs @@ -1,6 +1,6 @@ fn main() { fn f(&&v: ~const int) { - *v = 1 //! ERROR assigning to dereference of const ~ pointer + *v = 1 //~ ERROR assigning to dereference of const ~ pointer } let v = ~0; diff --git a/src/test/compile-fail/mutable-huh-variance-vec1.rs b/src/test/compile-fail/mutable-huh-variance-vec1.rs index ba25fbbb9d7b6..3a3575e001f98 100644 --- a/src/test/compile-fail/mutable-huh-variance-vec1.rs +++ b/src/test/compile-fail/mutable-huh-variance-vec1.rs @@ -8,5 +8,5 @@ fn main() { v[0] = [mut 3] } - f(v); //! ERROR (values differ in mutability) + f(v); //~ ERROR (values differ in mutability) } diff --git a/src/test/compile-fail/mutable-huh-variance-vec2.rs b/src/test/compile-fail/mutable-huh-variance-vec2.rs index cab07b804e6bf..69a69b447be71 100644 --- a/src/test/compile-fail/mutable-huh-variance-vec2.rs +++ b/src/test/compile-fail/mutable-huh-variance-vec2.rs @@ -8,5 +8,5 @@ fn main() { v[0] = [3] } - f(v); //! ERROR (values differ in mutability) + f(v); //~ ERROR (values differ in mutability) } diff --git a/src/test/compile-fail/mutable-huh-variance-vec3.rs b/src/test/compile-fail/mutable-huh-variance-vec3.rs index afba07126cf13..81844c6934177 100644 --- a/src/test/compile-fail/mutable-huh-variance-vec3.rs +++ b/src/test/compile-fail/mutable-huh-variance-vec3.rs @@ -8,5 +8,5 @@ fn main() { v[0][1] = [mut 3] } - f(v); //! ERROR (values differ in mutability) + f(v); //~ ERROR (values differ in mutability) } diff --git a/src/test/compile-fail/mutable-huh-variance-vec4.rs b/src/test/compile-fail/mutable-huh-variance-vec4.rs index a7394928076be..ebb535bcdd019 100644 --- a/src/test/compile-fail/mutable-huh-variance-vec4.rs +++ b/src/test/compile-fail/mutable-huh-variance-vec4.rs @@ -27,20 +27,20 @@ fn main() { f(v); g(v); - h(v); //! ERROR (values differ in mutability) - i(v); //! ERROR (values differ in mutability) - j(v); //! ERROR (values differ in mutability) + h(v); //~ ERROR (values differ in mutability) + i(v); //~ ERROR (values differ in mutability) + j(v); //~ ERROR (values differ in mutability) - f(w); //! ERROR (values differ in mutability) + f(w); //~ ERROR (values differ in mutability) g(w); h(w); - i(w); //! ERROR (values differ in mutability) - j(w); //! ERROR (values differ in mutability) + i(w); //~ ERROR (values differ in mutability) + j(w); //~ ERROR (values differ in mutability) // Note that without adding f() or h() to the mix, it is valid for // x to have the type [mut [const int]/~]/~, and thus we can safely // call g() and i() but not j(): g(x); i(x); - j(x); //! ERROR (values differ in mutability) + j(x); //~ ERROR (values differ in mutability) } diff --git a/src/test/compile-fail/mutable-huh-vec-assign.rs b/src/test/compile-fail/mutable-huh-vec-assign.rs index 3a94c6d9b17d9..9bf6b45751320 100644 --- a/src/test/compile-fail/mutable-huh-vec-assign.rs +++ b/src/test/compile-fail/mutable-huh-vec-assign.rs @@ -1,7 +1,7 @@ fn main() { fn f(&&v: [const int]/~) { // This shouldn't be possible - v[0] = 1 //! ERROR assigning to const vec content + v[0] = 1 //~ ERROR assigning to const vec content } let v = [0]/~; diff --git a/src/test/compile-fail/native-unsafe-fn-called.rs b/src/test/compile-fail/native-unsafe-fn-called.rs index ee44500fee392..b24a4cf69182c 100644 --- a/src/test/compile-fail/native-unsafe-fn-called.rs +++ b/src/test/compile-fail/native-unsafe-fn-called.rs @@ -7,6 +7,6 @@ native mod test { fn main() { test::free(); - //!^ ERROR access to unsafe function requires unsafe function or block + //~^ ERROR access to unsafe function requires unsafe function or block } diff --git a/src/test/compile-fail/native-unsafe-fn.rs b/src/test/compile-fail/native-unsafe-fn.rs index 8615c7795a9e8..fd2ace2345739 100644 --- a/src/test/compile-fail/native-unsafe-fn.rs +++ b/src/test/compile-fail/native-unsafe-fn.rs @@ -7,7 +7,7 @@ native mod test { fn main() { let x = test::free; - //!^ ERROR access to unsafe function requires unsafe function or block + //~^ ERROR access to unsafe function requires unsafe function or block } diff --git a/src/test/compile-fail/no-reuse-move-arc.rs b/src/test/compile-fail/no-reuse-move-arc.rs index 2369edd43dc68..87923c9cbebc0 100644 --- a/src/test/compile-fail/no-reuse-move-arc.rs +++ b/src/test/compile-fail/no-reuse-move-arc.rs @@ -4,12 +4,12 @@ fn main() { let v = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]/~; let arc_v = arc::arc(v); - task::spawn() {|move arc_v| //! NOTE move of variable occurred here + task::spawn() {|move arc_v| //~ NOTE move of variable occurred here let v = *arc::get(&arc_v); assert v[3] == 4; }; - assert (*arc::get(&arc_v))[2] == 3; //! ERROR use of moved variable: `arc_v` + assert (*arc::get(&arc_v))[2] == 3; //~ ERROR use of moved variable: `arc_v` log(info, arc_v); } diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs index 3f8fde8927e3f..b6ff823615a45 100644 --- a/src/test/compile-fail/no-send-res-ports.rs +++ b/src/test/compile-fail/no-send-res-ports.rs @@ -7,7 +7,7 @@ fn main() { let x = ~mut some(foo(comm::port())); - task::spawn {|move x| //! ERROR not a sendable value + task::spawn {|move x| //~ ERROR not a sendable value let mut y = none; *x <-> y; log(error, y); diff --git a/src/test/compile-fail/noexporttypeexe.rs b/src/test/compile-fail/noexporttypeexe.rs index b88f3b34c61df..22de85cdbfb7e 100644 --- a/src/test/compile-fail/noexporttypeexe.rs +++ b/src/test/compile-fail/noexporttypeexe.rs @@ -8,6 +8,6 @@ fn main() { // because the def_id associated with the type was // not convertible to a path. let x: int = noexporttypelib::foo(); - //!^ ERROR expected `int` but found `core::option::option` + //~^ ERROR expected `int` but found `core::option::option` } diff --git a/src/test/compile-fail/non-const.rs b/src/test/compile-fail/non-const.rs index ab542f3bc1ebe..5319b28e9100c 100644 --- a/src/test/compile-fail/non-const.rs +++ b/src/test/compile-fail/non-const.rs @@ -16,15 +16,15 @@ class r2 { fn main() { foo({f: 3}); - foo({mut f: 3}); //! ERROR missing `const` + foo({mut f: 3}); //~ ERROR missing `const` foo([1]/~); - foo([mut 1]/~); //! ERROR missing `const` + foo([mut 1]/~); //~ ERROR missing `const` foo(~1); - foo(~mut 1); //! ERROR missing `const` + foo(~mut 1); //~ ERROR missing `const` foo(@1); - foo(@mut 1); //! ERROR missing `const` + foo(@mut 1); //~ ERROR missing `const` foo(r(1)); // this is okay now. - foo(r2(@mut 1)); //! ERROR missing `const` + foo(r2(@mut 1)); //~ ERROR missing `const` foo("123"); - foo({f: {mut f: 1}}); //! ERROR missing `const` + foo({f: {mut f: 1}}); //~ ERROR missing `const` } diff --git a/src/test/compile-fail/non-copyable-void.rs b/src/test/compile-fail/non-copyable-void.rs index 07b93989ba7db..6a77d0fb6e553 100644 --- a/src/test/compile-fail/non-copyable-void.rs +++ b/src/test/compile-fail/non-copyable-void.rs @@ -3,6 +3,6 @@ fn main() { let y : *libc::c_void = x as *libc::c_void; unsafe { let _z = *y; - //!^ ERROR copying a noncopyable value + //~^ ERROR copying a noncopyable value } } diff --git a/src/test/compile-fail/non-exhaustive-match.rs b/src/test/compile-fail/non-exhaustive-match.rs index 8863be414742b..0d004df5c1a59 100644 --- a/src/test/compile-fail/non-exhaustive-match.rs +++ b/src/test/compile-fail/non-exhaustive-match.rs @@ -2,21 +2,21 @@ enum t { a, b, } fn main() { let x = a; - alt x { b { } } //! ERROR non-exhaustive patterns - alt true { //! ERROR non-exhaustive patterns + alt x { b { } } //~ ERROR non-exhaustive patterns + alt true { //~ ERROR non-exhaustive patterns true {} } - alt @some(10) { //! ERROR non-exhaustive patterns + alt @some(10) { //~ ERROR non-exhaustive patterns @none {} } - alt (2, 3, 4) { //! ERROR non-exhaustive patterns + alt (2, 3, 4) { //~ ERROR non-exhaustive patterns (_, _, 4) {} } - alt (a, a) { //! ERROR non-exhaustive patterns + alt (a, a) { //~ ERROR non-exhaustive patterns (a, b) {} (b, a) {} } - alt a { //! ERROR b not covered + alt a { //~ ERROR b not covered a {} } // This is exhaustive, though the algorithm got it wrong at one point diff --git a/src/test/compile-fail/not-enough-arguments.rs b/src/test/compile-fail/not-enough-arguments.rs index 2aeda5a765234..36480253c97fa 100644 --- a/src/test/compile-fail/not-enough-arguments.rs +++ b/src/test/compile-fail/not-enough-arguments.rs @@ -8,5 +8,5 @@ fn foo(a: int, b: int, c: int, d:int) { fn main() { foo(1, 2, 3); - //!^ ERROR this function takes 4 parameters but 3 + //~^ ERROR this function takes 4 parameters but 3 } diff --git a/src/test/compile-fail/occurs-check.rs b/src/test/compile-fail/occurs-check.rs index a802967bc7a04..49b6d42a1297d 100644 --- a/src/test/compile-fail/occurs-check.rs +++ b/src/test/compile-fail/occurs-check.rs @@ -1,4 +1,4 @@ fn main() { - let f; //! ERROR cyclic type of infinite size + let f; //~ ERROR cyclic type of infinite size f = @f; } diff --git a/src/test/compile-fail/omitted-arg-in-item-fn.rs b/src/test/compile-fail/omitted-arg-in-item-fn.rs index 85674b92a1d81..157718a26a641 100644 --- a/src/test/compile-fail/omitted-arg-in-item-fn.rs +++ b/src/test/compile-fail/omitted-arg-in-item-fn.rs @@ -1,4 +1,4 @@ // xfail-test -fn foo(x) { //! ERROR expecting ':' but found ')' +fn foo(x) { //~ ERROR expecting ':' but found ')' } \ No newline at end of file diff --git a/src/test/compile-fail/omitted-arg-wrong-types.rs b/src/test/compile-fail/omitted-arg-wrong-types.rs index 7f5fb30f63b19..e6ad54f219de7 100644 --- a/src/test/compile-fail/omitted-arg-wrong-types.rs +++ b/src/test/compile-fail/omitted-arg-wrong-types.rs @@ -4,8 +4,8 @@ fn let_in(x: T, f: fn(T)) {} fn main() { let_in(3u, fn&(i) { assert i == 3; }); - //!^ ERROR expected `uint` but found `int` + //~^ ERROR expected `uint` but found `int` let_in(3, fn&(i) { assert i == 3u; }); - //!^ ERROR expected `int` but found `uint` + //~^ ERROR expected `int` but found `uint` } \ No newline at end of file diff --git a/src/test/compile-fail/pat-shadow-in-nested-binding.rs b/src/test/compile-fail/pat-shadow-in-nested-binding.rs index 60fb9b831ab41..c4ba513187911 100644 --- a/src/test/compile-fail/pat-shadow-in-nested-binding.rs +++ b/src/test/compile-fail/pat-shadow-in-nested-binding.rs @@ -1,5 +1,5 @@ enum foo = uint; fn main() { - let (foo, _) = (2, 3); //! ERROR declaration of `foo` shadows an enum that's in scope + let (foo, _) = (2, 3); //~ ERROR declaration of `foo` shadows an enum that's in scope } diff --git a/src/test/compile-fail/placement-new-bad-method-type.rs b/src/test/compile-fail/placement-new-bad-method-type.rs index 562faf84136a1..10db67161d185 100644 --- a/src/test/compile-fail/placement-new-bad-method-type.rs +++ b/src/test/compile-fail/placement-new-bad-method-type.rs @@ -11,5 +11,5 @@ impl methods for malloc_pool { fn main() { let p = &malloc_pool(()); let x = new(*p) 4u; - //!^ ERROR mismatched types: expected `fn(uint, uint) -> *()` + //~^ ERROR mismatched types: expected `fn(uint, uint) -> *()` } diff --git a/src/test/compile-fail/pptypedef.rs b/src/test/compile-fail/pptypedef.rs index 941535ef0f182..90d0df078b8a8 100644 --- a/src/test/compile-fail/pptypedef.rs +++ b/src/test/compile-fail/pptypedef.rs @@ -4,5 +4,5 @@ fn bar(_t: foo) {} fn main() { // we used to print foo: - bar(some(3u)); //! ERROR mismatched types: expected `foo` + bar(some(3u)); //~ ERROR mismatched types: expected `foo` } \ No newline at end of file diff --git a/src/test/compile-fail/prim-with-args.rs b/src/test/compile-fail/prim-with-args.rs index 955d17cb33b7e..6edb9cb59d85f 100644 --- a/src/test/compile-fail/prim-with-args.rs +++ b/src/test/compile-fail/prim-with-args.rs @@ -1,29 +1,29 @@ fn main() { -let x: int; //! ERROR Type parameters are not allowed on this type. -let x: i8; //! ERROR Type parameters are not allowed on this type. -let x: i16; //! ERROR Type parameters are not allowed on this type. -let x: i32; //! ERROR Type parameters are not allowed on this type. -let x: i64; //! ERROR Type parameters are not allowed on this type. -let x: uint; //! ERROR Type parameters are not allowed on this type. -let x: u8; //! ERROR Type parameters are not allowed on this type. -let x: u16; //! ERROR Type parameters are not allowed on this type. -let x: u32; //! ERROR Type parameters are not allowed on this type. -let x: u64; //! ERROR Type parameters are not allowed on this type. -let x: float; //! ERROR Type parameters are not allowed on this type. -let x: char; //! ERROR Type parameters are not allowed on this type. +let x: int; //~ ERROR Type parameters are not allowed on this type. +let x: i8; //~ ERROR Type parameters are not allowed on this type. +let x: i16; //~ ERROR Type parameters are not allowed on this type. +let x: i32; //~ ERROR Type parameters are not allowed on this type. +let x: i64; //~ ERROR Type parameters are not allowed on this type. +let x: uint; //~ ERROR Type parameters are not allowed on this type. +let x: u8; //~ ERROR Type parameters are not allowed on this type. +let x: u16; //~ ERROR Type parameters are not allowed on this type. +let x: u32; //~ ERROR Type parameters are not allowed on this type. +let x: u64; //~ ERROR Type parameters are not allowed on this type. +let x: float; //~ ERROR Type parameters are not allowed on this type. +let x: char; //~ ERROR Type parameters are not allowed on this type. -let x: int/&; //! ERROR Region parameters are not allowed on this type. -let x: i8/&; //! ERROR Region parameters are not allowed on this type. -let x: i16/&; //! ERROR Region parameters are not allowed on this type. -let x: i32/&; //! ERROR Region parameters are not allowed on this type. -let x: i64/&; //! ERROR Region parameters are not allowed on this type. -let x: uint/&; //! ERROR Region parameters are not allowed on this type. -let x: u8/&; //! ERROR Region parameters are not allowed on this type. -let x: u16/&; //! ERROR Region parameters are not allowed on this type. -let x: u32/&; //! ERROR Region parameters are not allowed on this type. -let x: u64/&; //! ERROR Region parameters are not allowed on this type. -let x: float/&; //! ERROR Region parameters are not allowed on this type. -let x: char/&; //! ERROR Region parameters are not allowed on this type. +let x: int/&; //~ ERROR Region parameters are not allowed on this type. +let x: i8/&; //~ ERROR Region parameters are not allowed on this type. +let x: i16/&; //~ ERROR Region parameters are not allowed on this type. +let x: i32/&; //~ ERROR Region parameters are not allowed on this type. +let x: i64/&; //~ ERROR Region parameters are not allowed on this type. +let x: uint/&; //~ ERROR Region parameters are not allowed on this type. +let x: u8/&; //~ ERROR Region parameters are not allowed on this type. +let x: u16/&; //~ ERROR Region parameters are not allowed on this type. +let x: u32/&; //~ ERROR Region parameters are not allowed on this type. +let x: u64/&; //~ ERROR Region parameters are not allowed on this type. +let x: float/&; //~ ERROR Region parameters are not allowed on this type. +let x: char/&; //~ ERROR Region parameters are not allowed on this type. } diff --git a/src/test/compile-fail/pure-higher-order.rs b/src/test/compile-fail/pure-higher-order.rs index 22d43c27e1ab1..830f065b623a3 100644 --- a/src/test/compile-fail/pure-higher-order.rs +++ b/src/test/compile-fail/pure-higher-order.rs @@ -19,20 +19,20 @@ pure fn range3(from: uint, to: uint, f: fn(uint)) { } pure fn range4(from: uint, to: uint) { - range(from, to, print) //! ERROR access to impure function prohibited in pure context + range(from, to, print) //~ ERROR access to impure function prohibited in pure context } pure fn range5(from: uint, to: uint, x: {f: fn(uint)}) { - range(from, to, x.f) //! ERROR access to impure function prohibited in pure context + range(from, to, x.f) //~ ERROR access to impure function prohibited in pure context } pure fn range6(from: uint, to: uint, x: @{f: fn(uint)}) { - range(from, to, x.f) //! ERROR access to impure function prohibited in pure context + range(from, to, x.f) //~ ERROR access to impure function prohibited in pure context } pure fn range7(from: uint, to: uint) { range(from, to) { |i| - print(i); //! ERROR access to impure function prohibited in pure context + print(i); //~ ERROR access to impure function prohibited in pure context } } diff --git a/src/test/compile-fail/pure-loop-body.rs b/src/test/compile-fail/pure-loop-body.rs index 5774cf19bb411..7a7f92e6a51cc 100644 --- a/src/test/compile-fail/pure-loop-body.rs +++ b/src/test/compile-fail/pure-loop-body.rs @@ -14,7 +14,7 @@ pure fn range2(from: uint, to: uint, f: fn(uint)) { pure fn range3(from: uint, to: uint, f: {x: fn(uint)}) { for range(from, to) { |i| - f.x(i*2u); //! ERROR access to impure function prohibited + f.x(i*2u); //~ ERROR access to impure function prohibited } } diff --git a/src/test/compile-fail/pure-modifies-aliased.rs b/src/test/compile-fail/pure-modifies-aliased.rs index e8f469a8c8c8d..d63169d512f82 100644 --- a/src/test/compile-fail/pure-modifies-aliased.rs +++ b/src/test/compile-fail/pure-modifies-aliased.rs @@ -1,16 +1,16 @@ // Check that pure functions cannot modify aliased state. pure fn modify_in_ref(&&sum: {mut f: int}) { - sum.f = 3; //! ERROR assigning to mutable field prohibited in pure context + sum.f = 3; //~ ERROR assigning to mutable field prohibited in pure context } pure fn modify_in_box(sum: @mut {f: int}) { - sum.f = 3; //! ERROR assigning to mutable field prohibited in pure context + sum.f = 3; //~ ERROR assigning to mutable field prohibited in pure context } impl foo for int { pure fn modify_in_box_rec(sum: @{mut f: int}) { - sum.f = self; //! ERROR assigning to mutable field prohibited in pure context + sum.f = self; //~ ERROR assigning to mutable field prohibited in pure context } } diff --git a/src/test/compile-fail/pure-overloaded-op.rs b/src/test/compile-fail/pure-overloaded-op.rs index cb7bdeb6442b0..3f29e385202aa 100644 --- a/src/test/compile-fail/pure-overloaded-op.rs +++ b/src/test/compile-fail/pure-overloaded-op.rs @@ -15,12 +15,12 @@ impl foo for point { pure fn a(p: point) -> int { p + 3 } pure fn b(p: point) -> int { p * 3 } -//!^ ERROR access to impure function prohibited in pure context +//~^ ERROR access to impure function prohibited in pure context pure fn c(p: point) -> int { p[3] } -//!^ ERROR access to impure function prohibited in pure context +//~^ ERROR access to impure function prohibited in pure context pure fn d(p: point) -> int { -p } -//!^ ERROR access to impure function prohibited in pure context +//~^ ERROR access to impure function prohibited in pure context fn main() {} diff --git a/src/test/compile-fail/pure-subtyping.rs b/src/test/compile-fail/pure-subtyping.rs index da0cab02e6b79..6725bd19e440f 100644 --- a/src/test/compile-fail/pure-subtyping.rs +++ b/src/test/compile-fail/pure-subtyping.rs @@ -2,14 +2,14 @@ fn assign_to_pure(x: pure fn(), y: fn(), z: unsafe fn()) { let a: pure fn() = x; - let b: pure fn() = y; //! ERROR expected pure fn but found impure fn - let c: pure fn() = z; //! ERROR expected pure fn but found unsafe fn + let b: pure fn() = y; //~ ERROR expected pure fn but found impure fn + let c: pure fn() = z; //~ ERROR expected pure fn but found unsafe fn } fn assign_to_impure(x: pure fn(), y: fn(), z: unsafe fn()) { let h: fn() = x; let i: fn() = y; - let j: fn() = z; //! ERROR expected impure fn but found unsafe fn + let j: fn() = z; //~ ERROR expected impure fn but found unsafe fn } fn assign_to_unsafe(x: pure fn(), y: fn(), z: unsafe fn()) { @@ -20,16 +20,16 @@ fn assign_to_unsafe(x: pure fn(), y: fn(), z: unsafe fn()) { fn assign_to_pure2(x: pure fn@(), y: fn@(), z: unsafe fn@()) { let a: pure fn() = x; - let b: pure fn() = y; //! ERROR expected pure fn but found impure fn - let c: pure fn() = z; //! ERROR expected pure fn but found unsafe fn + let b: pure fn() = y; //~ ERROR expected pure fn but found impure fn + let c: pure fn() = z; //~ ERROR expected pure fn but found unsafe fn - let a: pure fn~() = x; //! ERROR closure protocol mismatch (fn~ vs fn@) - let b: pure fn~() = y; //! ERROR closure protocol mismatch (fn~ vs fn@) - let c: pure fn~() = z; //! ERROR closure protocol mismatch (fn~ vs fn@) + let a: pure fn~() = x; //~ ERROR closure protocol mismatch (fn~ vs fn@) + let b: pure fn~() = y; //~ ERROR closure protocol mismatch (fn~ vs fn@) + let c: pure fn~() = z; //~ ERROR closure protocol mismatch (fn~ vs fn@) - let a: unsafe fn~() = x; //! ERROR closure protocol mismatch (fn~ vs fn@) - let b: unsafe fn~() = y; //! ERROR closure protocol mismatch (fn~ vs fn@) - let c: unsafe fn~() = z; //! ERROR closure protocol mismatch (fn~ vs fn@) + let a: unsafe fn~() = x; //~ ERROR closure protocol mismatch (fn~ vs fn@) + let b: unsafe fn~() = y; //~ ERROR closure protocol mismatch (fn~ vs fn@) + let c: unsafe fn~() = z; //~ ERROR closure protocol mismatch (fn~ vs fn@) } fn main() { diff --git a/src/test/compile-fail/qquote-1.rs b/src/test/compile-fail/qquote-1.rs index c88bf563e7144..d460864ac83b9 100644 --- a/src/test/compile-fail/qquote-1.rs +++ b/src/test/compile-fail/qquote-1.rs @@ -40,7 +40,7 @@ fn main() { let abc = #ast{23}; check_pp(abc, pprust::print_expr, "23"); - let expr3 = #ast{2 - $(abcd) + 7}; //! ERROR unresolved name: abcd + let expr3 = #ast{2 - $(abcd) + 7}; //~ ERROR unresolved name: abcd check_pp(expr3, pprust::print_expr, "2 - 23 + 7"); } diff --git a/src/test/compile-fail/qquote-2.rs b/src/test/compile-fail/qquote-2.rs index af5cf1c3fab58..4cf49e183ba19 100644 --- a/src/test/compile-fail/qquote-2.rs +++ b/src/test/compile-fail/qquote-2.rs @@ -37,7 +37,7 @@ fn mk_ctxt() -> fake_ext_ctxt { fn main() { let ext_cx = mk_ctxt(); - let stmt = #ast(stmt){let x int = 20;}; //! ERROR expected end-of-string + let stmt = #ast(stmt){let x int = 20;}; //~ ERROR expected end-of-string check_pp(*stmt, pprust::print_stmt, ""); } diff --git a/src/test/compile-fail/rec-expected.rs b/src/test/compile-fail/rec-expected.rs index acbb7f0353117..1f69ffc7a4d2b 100644 --- a/src/test/compile-fail/rec-expected.rs +++ b/src/test/compile-fail/rec-expected.rs @@ -3,7 +3,7 @@ type bar = {b: int}; fn want_foo(f: foo) {} fn have_bar(b: bar) { - want_foo(b); //! ERROR expected a record with field `a` + want_foo(b); //~ ERROR expected a record with field `a` } fn main() {} \ No newline at end of file diff --git a/src/test/compile-fail/region-unused.rs b/src/test/compile-fail/region-unused.rs index 617315853af01..bf48e3f0da2a8 100644 --- a/src/test/compile-fail/region-unused.rs +++ b/src/test/compile-fail/region-unused.rs @@ -1,3 +1,3 @@ -type foo/& = {f: int}; //! ERROR lifetime `self` unused +type foo/& = {f: int}; //~ ERROR lifetime `self` unused fn main() {} \ No newline at end of file diff --git a/src/test/compile-fail/regions-addr-of-arg.rs b/src/test/compile-fail/regions-addr-of-arg.rs index 4c14937de68de..09b5008aa9940 100644 --- a/src/test/compile-fail/regions-addr-of-arg.rs +++ b/src/test/compile-fail/regions-addr-of-arg.rs @@ -1,5 +1,5 @@ fn foo(a: int) { - let _p: &static.int = &a; //! ERROR mismatched types + let _p: &static.int = &a; //~ ERROR mismatched types } fn bar(a: int) { diff --git a/src/test/compile-fail/regions-addr-of-self.rs b/src/test/compile-fail/regions-addr-of-self.rs index b9943bc18e074..39e9f5687582b 100644 --- a/src/test/compile-fail/regions-addr-of-self.rs +++ b/src/test/compile-fail/regions-addr-of-self.rs @@ -6,7 +6,7 @@ class dog { } fn chase_cat() { - let p: &static.mut uint = &mut self.cats_chased; //! ERROR mismatched types + let p: &static.mut uint = &mut self.cats_chased; //~ ERROR mismatched types *p += 1u; } diff --git a/src/test/compile-fail/regions-addr-of-upvar-self.rs b/src/test/compile-fail/regions-addr-of-upvar-self.rs index b0cd97d24d343..f7e39ee524310 100644 --- a/src/test/compile-fail/regions-addr-of-upvar-self.rs +++ b/src/test/compile-fail/regions-addr-of-upvar-self.rs @@ -7,7 +7,7 @@ class dog { fn chase_cat() { uint::range(0u, 10u) { |i| - let p: &static.mut uint = &mut self.food; //! ERROR mismatched types + let p: &static.mut uint = &mut self.food; //~ ERROR mismatched types *p = 3u; } } diff --git a/src/test/compile-fail/regions-appearance-constraint.rs b/src/test/compile-fail/regions-appearance-constraint.rs index c37d3c1d21917..300aece8c3c37 100644 --- a/src/test/compile-fail/regions-appearance-constraint.rs +++ b/src/test/compile-fail/regions-appearance-constraint.rs @@ -17,7 +17,7 @@ fn testfn(cond: bool) { let mut y = @4; let mut a = &*x; - //!^ ERROR reference is not valid outside of its lifetime + //~^ ERROR reference is not valid outside of its lifetime let mut exp = 3; if cond { diff --git a/src/test/compile-fail/regions-blk.rs b/src/test/compile-fail/regions-blk.rs index 0d0cdb6d93f76..9e6b5d0d34271 100644 --- a/src/test/compile-fail/regions-blk.rs +++ b/src/test/compile-fail/regions-blk.rs @@ -7,7 +7,7 @@ fn foo(cond: bool) { z = &x; } else { let w: &blk.int = &x; - z = w; //! ERROR mismatched types + z = w; //~ ERROR mismatched types } } diff --git a/src/test/compile-fail/regions-borrow.rs b/src/test/compile-fail/regions-borrow.rs index 5bcfc9841622f..5e893246cdc80 100644 --- a/src/test/compile-fail/regions-borrow.rs +++ b/src/test/compile-fail/regions-borrow.rs @@ -3,6 +3,6 @@ fn foo(x: &uint) -> &uint { x } fn main() { let p = @3u; let r = foo(p); - //!^ ERROR reference is not valid + //~^ ERROR reference is not valid assert *p == *r; } diff --git a/src/test/compile-fail/regions-bounds.rs b/src/test/compile-fail/regions-bounds.rs index c62db9b8fff2a..9eef8c1a64385 100644 --- a/src/test/compile-fail/regions-bounds.rs +++ b/src/test/compile-fail/regions-bounds.rs @@ -7,20 +7,20 @@ iface an_iface/& { } class a_class/& { let x:int; new(x:int) { self.x = x; } } fn a_fn1(e: an_enum/&a) -> an_enum/&b { - ret e; //! ERROR mismatched types: expected `an_enum/&b` but found `an_enum/&a` + ret e; //~ ERROR mismatched types: expected `an_enum/&b` but found `an_enum/&a` } fn a_fn2(e: an_iface/&a) -> an_iface/&b { - ret e; //! ERROR mismatched types: expected `an_iface/&b` but found `an_iface/&a` + ret e; //~ ERROR mismatched types: expected `an_iface/&b` but found `an_iface/&a` } fn a_fn3(e: a_class/&a) -> a_class/&b { - ret e; //! ERROR mismatched types: expected `a_class/&b` but found `a_class/&a` + ret e; //~ ERROR mismatched types: expected `a_class/&b` but found `a_class/&a` } fn a_fn4(e: int/&a) -> int/&b { - //!^ ERROR Region parameters are not allowed on this type. - //!^^ ERROR Region parameters are not allowed on this type. + //~^ ERROR Region parameters are not allowed on this type. + //~^^ ERROR Region parameters are not allowed on this type. ret e; } diff --git a/src/test/compile-fail/regions-creating-enums.rs b/src/test/compile-fail/regions-creating-enums.rs index 226039f4c2a5a..3873dcb6d0a3c 100644 --- a/src/test/compile-fail/regions-creating-enums.rs +++ b/src/test/compile-fail/regions-creating-enums.rs @@ -20,12 +20,12 @@ fn compute(x: &ast) -> uint { fn map_nums(x: &ast, f: fn(uint) -> uint) -> &ast { alt *x { num(x) { - ret &num(f(x)); //! ERROR mismatched types: expected `&ast/&` but found + ret &num(f(x)); //~ ERROR mismatched types: expected `&ast/&` but found } add(x, y) { let m_x = map_nums(x, f); let m_y = map_nums(y, f); - ret &add(m_x, m_y); //! ERROR mismatched types: expected `&ast/&` but found + ret &add(m_x, m_y); //~ ERROR mismatched types: expected `&ast/&` but found } } } diff --git a/src/test/compile-fail/regions-creating-enums3.rs b/src/test/compile-fail/regions-creating-enums3.rs index d650441aab7a5..7f162b494aa9c 100644 --- a/src/test/compile-fail/regions-creating-enums3.rs +++ b/src/test/compile-fail/regions-creating-enums3.rs @@ -4,7 +4,7 @@ enum ast/& { } fn mk_add_bad1(x: &a.ast, y: &b.ast) -> ast/&a { - add(x, y) //! ERROR mismatched types: expected `&a.ast/&a` but found `&b.ast/&b` + add(x, y) //~ ERROR mismatched types: expected `&a.ast/&a` but found `&b.ast/&b` } fn main() { diff --git a/src/test/compile-fail/regions-creating-enums4.rs b/src/test/compile-fail/regions-creating-enums4.rs index f80334d3fea57..a95b6f9f4bdb7 100644 --- a/src/test/compile-fail/regions-creating-enums4.rs +++ b/src/test/compile-fail/regions-creating-enums4.rs @@ -4,7 +4,7 @@ enum ast/& { } fn mk_add_bad2(x: &a.ast, y: &a.ast, z: &ast) -> ast { - add(x, y) //! ERROR mismatched types: expected `ast/&` but found `ast/&a` + add(x, y) //~ ERROR mismatched types: expected `ast/&` but found `ast/&a` } fn main() { diff --git a/src/test/compile-fail/regions-escape-into-other-fn.rs b/src/test/compile-fail/regions-escape-into-other-fn.rs index fc3247de05554..67c7dd3317a34 100644 --- a/src/test/compile-fail/regions-escape-into-other-fn.rs +++ b/src/test/compile-fail/regions-escape-into-other-fn.rs @@ -3,5 +3,5 @@ fn bar(x: &uint) -> uint { *x } fn main() { let p = @3u; - bar(foo(p)); //! ERROR reference is not valid + bar(foo(p)); //~ ERROR reference is not valid } diff --git a/src/test/compile-fail/regions-escape-loop-via-variable.rs b/src/test/compile-fail/regions-escape-loop-via-variable.rs index bf0c625abab32..04900da8ae5e5 100644 --- a/src/test/compile-fail/regions-escape-loop-via-variable.rs +++ b/src/test/compile-fail/regions-escape-loop-via-variable.rs @@ -4,7 +4,7 @@ fn main() { // Here, the variable `p` gets inferred to a type with a lifetime // of the loop body. The regionck then determines that this type // is invalid. - let mut p = //! ERROR reference is not valid + let mut p = //~ ERROR reference is not valid &x; loop { diff --git a/src/test/compile-fail/regions-escape-loop-via-vec.rs b/src/test/compile-fail/regions-escape-loop-via-vec.rs index 309cb0302330e..c1b096c5f5172 100644 --- a/src/test/compile-fail/regions-escape-loop-via-vec.rs +++ b/src/test/compile-fail/regions-escape-loop-via-vec.rs @@ -2,16 +2,16 @@ // This generates a ton of error msgs at the moment. fn broken() -> int { let mut x = 3; - let mut y = [&mut x]/~; //! ERROR reference is not valid + let mut y = [&mut x]/~; //~ ERROR reference is not valid while x < 10 { let mut z = x; y += [&mut z]/~; x += 1; } vec::foldl(0, y) {|v, p| v + *p } - //!^ ERROR reference is not valid - //!^^ ERROR reference is not valid - //!^^^ ERROR reference is not valid + //~^ ERROR reference is not valid + //~^^ ERROR reference is not valid + //~^^^ ERROR reference is not valid } fn main() { } \ No newline at end of file diff --git a/src/test/compile-fail/regions-fn-subtyping.rs b/src/test/compile-fail/regions-fn-subtyping.rs index 3cbee781bba79..571b5da41fefd 100644 --- a/src/test/compile-fail/regions-fn-subtyping.rs +++ b/src/test/compile-fail/regions-fn-subtyping.rs @@ -7,7 +7,7 @@ fn has_same_region(f: fn(x: &a.int, g: fn(y: &a.int))) { // accept any region. That is, the type that `has_same_region` // expects is *not* a subtype of the type that `wants_two_regions` // expects. - wants_two_regions(f); //! ERROR mismatched types + wants_two_regions(f); //~ ERROR mismatched types } fn wants_two_regions(_f: fn(x: &int, g: fn(y: &int))) { diff --git a/src/test/compile-fail/regions-fns.rs b/src/test/compile-fail/regions-fns.rs index 0f636d27dc4df..fc8a631c6b74f 100644 --- a/src/test/compile-fail/regions-fns.rs +++ b/src/test/compile-fail/regions-fns.rs @@ -2,7 +2,7 @@ // with lifetime r, and a is a pointer with unspecified lifetime. fn not_ok_1(a: &uint) { let mut g: fn@(x: &uint) = fn@(x: &r.uint) {}; - //!^ ERROR mismatched types + //~^ ERROR mismatched types g(a); } @@ -11,7 +11,7 @@ fn not_ok_1(a: &uint) { fn not_ok_2(s: &s.uint) { let mut g: fn@(x: &uint) = fn@(x: &r.uint) {}; - //!^ ERROR mismatched types + //~^ ERROR mismatched types g(s); } diff --git a/src/test/compile-fail/regions-iface-1.rs b/src/test/compile-fail/regions-iface-1.rs index a2a2e39a2f81a..f6d4d5885f99f 100644 --- a/src/test/compile-fail/regions-iface-1.rs +++ b/src/test/compile-fail/regions-iface-1.rs @@ -11,7 +11,7 @@ impl/& of get_ctxt for has_ctxt { // Here an error occurs because we used `&self` but // the definition used `&`: - fn get_ctxt() -> &self.ctxt { //! ERROR method `get_ctxt` has an incompatible type + fn get_ctxt() -> &self.ctxt { //~ ERROR method `get_ctxt` has an incompatible type self.c } diff --git a/src/test/compile-fail/regions-iface-2.rs b/src/test/compile-fail/regions-iface-2.rs index 76f4d24291a60..3ebba4e2d2f43 100644 --- a/src/test/compile-fail/regions-iface-2.rs +++ b/src/test/compile-fail/regions-iface-2.rs @@ -13,7 +13,7 @@ impl/& of get_ctxt for has_ctxt { fn make_gc() -> get_ctxt { let ctxt = { v: 22u }; let hc = { c: &ctxt }; - ret hc as get_ctxt; //! ERROR mismatched types: expected `get_ctxt/&` + ret hc as get_ctxt; //~ ERROR mismatched types: expected `get_ctxt/&` } fn main() { diff --git a/src/test/compile-fail/regions-iface-3.rs b/src/test/compile-fail/regions-iface-3.rs index ae8d0130dffea..efd15583ab6d9 100644 --- a/src/test/compile-fail/regions-iface-3.rs +++ b/src/test/compile-fail/regions-iface-3.rs @@ -3,11 +3,11 @@ iface get_ctxt/& { } fn make_gc1(gc: get_ctxt/&a) -> get_ctxt/&b { - ret gc; //! ERROR mismatched types: expected `get_ctxt/&b` but found `get_ctxt/&a` + ret gc; //~ ERROR mismatched types: expected `get_ctxt/&b` but found `get_ctxt/&a` } fn make_gc2(gc: get_ctxt/&a) -> get_ctxt/&b { - ret gc as get_ctxt; //! ERROR mismatched types: expected `get_ctxt/&b` but found `get_ctxt/&a` + ret gc as get_ctxt; //~ ERROR mismatched types: expected `get_ctxt/&b` but found `get_ctxt/&a` } fn main() { diff --git a/src/test/compile-fail/regions-in-consts.rs b/src/test/compile-fail/regions-in-consts.rs index c48fec0f8acf6..83a117d951a1d 100644 --- a/src/test/compile-fail/regions-in-consts.rs +++ b/src/test/compile-fail/regions-in-consts.rs @@ -1,7 +1,7 @@ // xfail-test -const c_x: &blk.int = 22; //! ERROR only the static region is allowed here -const c_y: &static.int = &22; //! ERROR only the static region is allowed here +const c_x: &blk.int = 22; //~ ERROR only the static region is allowed here +const c_y: &static.int = &22; //~ ERROR only the static region is allowed here fn main() { } \ No newline at end of file diff --git a/src/test/compile-fail/regions-in-enums.rs b/src/test/compile-fail/regions-in-enums.rs index 4126ef7554733..d7b1ddf1e1817 100644 --- a/src/test/compile-fail/regions-in-enums.rs +++ b/src/test/compile-fail/regions-in-enums.rs @@ -1,13 +1,13 @@ enum no0 { - x0(&uint) //! ERROR to use region types here, the containing type must be declared with a region bound + x0(&uint) //~ ERROR to use region types here, the containing type must be declared with a region bound } enum no1 { - x1(&self.uint) //! ERROR to use region types here, the containing type must be declared with a region bound + x1(&self.uint) //~ ERROR to use region types here, the containing type must be declared with a region bound } enum no2 { - x2(&foo.uint) //! ERROR named regions other than `self` are not allowed as part of a type declaration + x2(&foo.uint) //~ ERROR named regions other than `self` are not allowed as part of a type declaration } enum yes0/& { @@ -19,7 +19,7 @@ enum yes1/& { } enum yes2/& { - x5(&foo.uint) //! ERROR named regions other than `self` are not allowed as part of a type declaration + x5(&foo.uint) //~ ERROR named regions other than `self` are not allowed as part of a type declaration } fn main() {} \ No newline at end of file diff --git a/src/test/compile-fail/regions-in-rsrcs.rs b/src/test/compile-fail/regions-in-rsrcs.rs index fe1482f92e819..55990fb0568c2 100644 --- a/src/test/compile-fail/regions-in-rsrcs.rs +++ b/src/test/compile-fail/regions-in-rsrcs.rs @@ -1,18 +1,18 @@ class no0 { - let x: &uint; //! ERROR to use region types here, the containing type must be declared with a region bound - new(x: &uint) { self.x = x; } //! ERROR to use region types here, the containing type must be declared with a region bound + let x: &uint; //~ ERROR to use region types here, the containing type must be declared with a region bound + new(x: &uint) { self.x = x; } //~ ERROR to use region types here, the containing type must be declared with a region bound drop {} } class no1 { - let x: &self.uint; //! ERROR to use region types here, the containing type must be declared with a region bound - new(x: &self.uint) { self.x = x; } //! ERROR to use region types here, the containing type must be declared with a region bound + let x: &self.uint; //~ ERROR to use region types here, the containing type must be declared with a region bound + new(x: &self.uint) { self.x = x; } //~ ERROR to use region types here, the containing type must be declared with a region bound drop {} } class no2 { - let x: &foo.uint; //! ERROR named regions other than `self` are not allowed as part of a type declaration - new(x: &foo.uint) { self.x = x; } //! ERROR named regions other than `self` are not allowed as part of a type declaration + let x: &foo.uint; //~ ERROR named regions other than `self` are not allowed as part of a type declaration + new(x: &foo.uint) { self.x = x; } //~ ERROR named regions other than `self` are not allowed as part of a type declaration drop {} } @@ -29,8 +29,8 @@ class yes1/& { } class yes2/& { - let x: &foo.uint; //! ERROR named regions other than `self` are not allowed as part of a type declaration - new(x: &foo.uint) { self.x = x; } //! ERROR named regions other than `self` are not allowed as part of a type declaration + let x: &foo.uint; //~ ERROR named regions other than `self` are not allowed as part of a type declaration + new(x: &foo.uint) { self.x = x; } //~ ERROR named regions other than `self` are not allowed as part of a type declaration drop {} } diff --git a/src/test/compile-fail/regions-in-type-items.rs b/src/test/compile-fail/regions-in-type-items.rs index c4619001e7cd0..bbc5da2004d47 100644 --- a/src/test/compile-fail/regions-in-type-items.rs +++ b/src/test/compile-fail/regions-in-type-items.rs @@ -1,13 +1,13 @@ type item_ty_no0 = { - x: &uint //! ERROR to use region types here, the containing type must be declared with a region bound + x: &uint //~ ERROR to use region types here, the containing type must be declared with a region bound }; type item_ty_no1 = { - x: &self.uint //! ERROR to use region types here, the containing type must be declared with a region bound + x: &self.uint //~ ERROR to use region types here, the containing type must be declared with a region bound }; type item_ty_no2 = { - x: &foo.uint //! ERROR named regions other than `self` are not allowed as part of a type declaration + x: &foo.uint //~ ERROR named regions other than `self` are not allowed as part of a type declaration }; type item_ty_yes0/& = { @@ -18,8 +18,8 @@ type item_ty_yes1/& = { x: &self.uint }; -type item_ty_yes2/& = { //! ERROR lifetime `self` unused inside reference-parameterized type - x: &foo.uint //! ERROR named regions other than `self` are not allowed as part of a type declaration +type item_ty_yes2/& = { //~ ERROR lifetime `self` unused inside reference-parameterized type + x: &foo.uint //~ ERROR named regions other than `self` are not allowed as part of a type declaration }; fn main() {} \ No newline at end of file diff --git a/src/test/compile-fail/regions-nested-fns.rs b/src/test/compile-fail/regions-nested-fns.rs index 3f0a871a34226..c6393d89d2bbd 100644 --- a/src/test/compile-fail/regions-nested-fns.rs +++ b/src/test/compile-fail/regions-nested-fns.rs @@ -7,13 +7,13 @@ fn nested(x: &x.int) { ignore(fn&(z: &z.int) { ay = x; ay = &y; - ay = z; //! ERROR references with lifetime + ay = z; //~ ERROR references with lifetime }); ignore(fn&(z: &z.int) -> &z.int { - if false { ret x; } //! ERROR references with lifetime - if false { ret &y; } //! ERROR references with lifetime - if false { ret ay; } //! ERROR references with lifetime + if false { ret x; } //~ ERROR references with lifetime + if false { ret &y; } //~ ERROR references with lifetime + if false { ret ay; } //~ ERROR references with lifetime ret z; }); } diff --git a/src/test/compile-fail/regions-out-of-scope-slice.rs b/src/test/compile-fail/regions-out-of-scope-slice.rs index 5f5aadaa10763..02ec5b1b6431d 100644 --- a/src/test/compile-fail/regions-out-of-scope-slice.rs +++ b/src/test/compile-fail/regions-out-of-scope-slice.rs @@ -3,7 +3,7 @@ fn foo(cond: bool) { // Here we will infer a type that uses the // region of the if stmt then block, but in the scope: - let mut x; //! ERROR foo + let mut x; //~ ERROR foo if cond { x = [1,2,3]/&blk; diff --git a/src/test/compile-fail/regions-scoping.rs b/src/test/compile-fail/regions-scoping.rs index aea02babfa0b6..f694f6a10fa46 100644 --- a/src/test/compile-fail/regions-scoping.rs +++ b/src/test/compile-fail/regions-scoping.rs @@ -9,19 +9,19 @@ fn nested(x: &x.int) { // (1) z: &z.int) -> &z.int) // A fresh region `z` (3) -> &x.int { - if false { ret z(x, x, x); } //! ERROR mismatched types: expected `&y.int` but found `&x.int` - if false { ret z(x, x, y); } //! ERROR mismatched types: expected `&y.int` but found `&x.int` - //!^ ERROR mismatched types: expected `&x.int` but found `&y.int` + if false { ret z(x, x, x); } //~ ERROR mismatched types: expected `&y.int` but found `&x.int` + if false { ret z(x, x, y); } //~ ERROR mismatched types: expected `&y.int` but found `&x.int` + //~^ ERROR mismatched types: expected `&x.int` but found `&y.int` if false { ret z(x, y, x); } - if false { ret z(x, y, y); } //! ERROR mismatched types: expected `&x.int` but found `&y.int` - if false { ret z(y, x, x); } //! ERROR mismatched types: expected `&x.int` but found `&y.int` - //!^ ERROR mismatched types: expected `&y.int` but found `&x.int` - if false { ret z(y, x, y); } //! ERROR mismatched types: expected `&x.int` but found `&y.int` - //!^ ERROR mismatched types: expected `&y.int` but found `&x.int` - //!^^ ERROR mismatched types: expected `&x.int` but found `&y.int` - if false { ret z(y, y, x); } //! ERROR mismatched types: expected `&x.int` but found `&y.int` - if false { ret z(y, y, y); } //! ERROR mismatched types: expected `&x.int` but found `&y.int` - //!^ ERROR mismatched types: expected `&x.int` but found `&y.int` + if false { ret z(x, y, y); } //~ ERROR mismatched types: expected `&x.int` but found `&y.int` + if false { ret z(y, x, x); } //~ ERROR mismatched types: expected `&x.int` but found `&y.int` + //~^ ERROR mismatched types: expected `&y.int` but found `&x.int` + if false { ret z(y, x, y); } //~ ERROR mismatched types: expected `&x.int` but found `&y.int` + //~^ ERROR mismatched types: expected `&y.int` but found `&x.int` + //~^^ ERROR mismatched types: expected `&x.int` but found `&y.int` + if false { ret z(y, y, x); } //~ ERROR mismatched types: expected `&x.int` but found `&y.int` + if false { ret z(y, y, y); } //~ ERROR mismatched types: expected `&x.int` but found `&y.int` + //~^ ERROR mismatched types: expected `&x.int` but found `&y.int` fail; } ) {|foo| @@ -33,10 +33,10 @@ fn nested(x: &x.int) { // (1) let z = 3i; let d: &x.int = foo(x, x) { |_x, _y, z| z }; let e: &x.int = foo(x, &z) { |_x, _y, z| z }; - let f: &x.int = foo(&z, &z) { |_x, _y, z| z }; //! ERROR mismatched types: expected `&x.int` but found + let f: &x.int = foo(&z, &z) { |_x, _y, z| z }; //~ ERROR mismatched types: expected `&x.int` but found - foo(x, &z) { |x, _y, _z| x }; //! ERROR mismatched types: expected `&z.int` but found `&x.int` - foo(x, &z) { |_x, y, _z| y }; //! ERROR mismatched types: expected `&z.int` but found `&(x: A, y: A) -> A { x + y } fn main() { let x = 3 as add; let y = 4 as add; - do_add(x, y); //! ERROR a boxed iface with self types may not be passed as a bounded type + do_add(x, y); //~ ERROR a boxed iface with self types may not be passed as a bounded type } diff --git a/src/test/compile-fail/selftype-ifacetype.rs b/src/test/compile-fail/selftype-ifacetype.rs index 2772b35984953..bbaf49e85bf3c 100644 --- a/src/test/compile-fail/selftype-ifacetype.rs +++ b/src/test/compile-fail/selftype-ifacetype.rs @@ -3,7 +3,7 @@ iface add { } fn do_add(x: add, y: add) -> add { - x + y //! ERROR can not call a method that contains a self type through a boxed iface + x + y //~ ERROR can not call a method that contains a self type through a boxed iface } fn main() {} diff --git a/src/test/compile-fail/sendfn-is-not-a-lambda.rs b/src/test/compile-fail/sendfn-is-not-a-lambda.rs index 09d331979090b..5aee9cd6fa712 100644 --- a/src/test/compile-fail/sendfn-is-not-a-lambda.rs +++ b/src/test/compile-fail/sendfn-is-not-a-lambda.rs @@ -4,5 +4,5 @@ fn test(f: fn@(uint) -> uint) -> uint { fn main() { let f = fn~(x: uint) -> uint { ret 4u; }; - log(debug, test(f)); //! ERROR expected `fn@(uint) -> uint` + log(debug, test(f)); //~ ERROR expected `fn@(uint) -> uint` } diff --git a/src/test/compile-fail/seq-args.rs b/src/test/compile-fail/seq-args.rs index 0587e21e5aa12..8edc11e84f62d 100644 --- a/src/test/compile-fail/seq-args.rs +++ b/src/test/compile-fail/seq-args.rs @@ -2,7 +2,7 @@ use std; fn main() { iface seq { } -impl of seq for [T]/~ { //! ERROR wrong number of type arguments +impl of seq for [T]/~ { //~ ERROR wrong number of type arguments /* ... */ } impl of seq for u32 { diff --git a/src/test/compile-fail/swap-no-lval.rs b/src/test/compile-fail/swap-no-lval.rs index 8366aa5421e6a..b7a5fce6b5a35 100644 --- a/src/test/compile-fail/swap-no-lval.rs +++ b/src/test/compile-fail/swap-no-lval.rs @@ -1,5 +1,5 @@ fn main() { 5 <-> 3; - //!^ ERROR swapping to and from non-lvalue - //!^^ ERROR swapping to and from non-lvalue + //~^ ERROR swapping to and from non-lvalue + //~^^ ERROR swapping to and from non-lvalue } diff --git a/src/test/compile-fail/terr-in-field.rs b/src/test/compile-fail/terr-in-field.rs index 0b676e35db7a7..84cb3bc9ac58d 100644 --- a/src/test/compile-fail/terr-in-field.rs +++ b/src/test/compile-fail/terr-in-field.rs @@ -3,7 +3,7 @@ type bar = {a: int, b: uint}; fn want_foo(f: foo) {} fn have_bar(b: bar) { - want_foo(b); //! ERROR (in field `b`, int vs uint) + want_foo(b); //~ ERROR (in field `b`, int vs uint) } fn main() {} diff --git a/src/test/compile-fail/terr-sorts.rs b/src/test/compile-fail/terr-sorts.rs index 6ab384673c1cf..d7d8bd48b3836 100644 --- a/src/test/compile-fail/terr-sorts.rs +++ b/src/test/compile-fail/terr-sorts.rs @@ -3,7 +3,7 @@ type bar = @foo; fn want_foo(f: foo) {} fn have_bar(b: bar) { - want_foo(b); //! ERROR (record vs @-ptr) + want_foo(b); //~ ERROR (record vs @-ptr) } fn main() {} diff --git a/src/test/compile-fail/tps-invariant-class.rs b/src/test/compile-fail/tps-invariant-class.rs index 0c4b3b54b8334..a3ecbec5b1124 100644 --- a/src/test/compile-fail/tps-invariant-class.rs +++ b/src/test/compile-fail/tps-invariant-class.rs @@ -13,7 +13,7 @@ fn set_box_impl(b: box_impl<@const T>, v: @const T) { fn main() { let b = box_impl::<@int>(@3); set_box_impl(b, @mut 5); - //!^ ERROR values differ in mutability + //~^ ERROR values differ in mutability // No error when type of parameter actually IS @const int let b = box_impl::<@const int>(@3); diff --git a/src/test/compile-fail/tps-invariant-enum.rs b/src/test/compile-fail/tps-invariant-enum.rs index 16375bd8b47c9..4c9691a1c5837 100644 --- a/src/test/compile-fail/tps-invariant-enum.rs +++ b/src/test/compile-fail/tps-invariant-enum.rs @@ -9,7 +9,7 @@ fn set_box_impl(b: box_impl<@const T>, v: @const T) { fn main() { let b = box_impl::<@int>({mut f: @3}); set_box_impl(b, @mut 5); - //!^ ERROR values differ in mutability + //~^ ERROR values differ in mutability // No error when type of parameter actually IS @const int let x: @const int = @3; // only way I could find to upcast diff --git a/src/test/compile-fail/tps-invariant-iface.rs b/src/test/compile-fail/tps-invariant-iface.rs index 49ab080998e78..81caef856c2c0 100644 --- a/src/test/compile-fail/tps-invariant-iface.rs +++ b/src/test/compile-fail/tps-invariant-iface.rs @@ -23,7 +23,7 @@ fn set_box_impl(b: box_impl<@const T>, v: @const T) { fn main() { let b = box_impl::<@int>({mut f: @3}); set_box_iface(b as box_iface::<@int>, @mut 5); - //!^ ERROR values differ in mutability + //~^ ERROR values differ in mutability set_box_impl(b, @mut 5); - //!^ ERROR values differ in mutability + //~^ ERROR values differ in mutability } \ No newline at end of file diff --git a/src/test/compile-fail/tstate-and-init.rs b/src/test/compile-fail/tstate-and-init.rs index 7b254fe2e19e1..d6e01f20ff472 100644 --- a/src/test/compile-fail/tstate-and-init.rs +++ b/src/test/compile-fail/tstate-and-init.rs @@ -3,5 +3,5 @@ fn even(i: int) : is_even(i) -> int { i } fn main() { let i: int = 4; log(debug, false && { check is_even(i); true }); - even(i); //! ERROR unsatisfied precondition + even(i); //~ ERROR unsatisfied precondition } diff --git a/src/test/compile-fail/tstate-block-uninit.rs b/src/test/compile-fail/tstate-block-uninit.rs index 3fbf812a9dcbf..91a31fed6cf46 100644 --- a/src/test/compile-fail/tstate-block-uninit.rs +++ b/src/test/compile-fail/tstate-block-uninit.rs @@ -6,6 +6,6 @@ fn force(f: fn()) { f(); } fn main() { let x: int = 4; force(fn&() { - even(x); //! ERROR unsatisfied precondition + even(x); //~ ERROR unsatisfied precondition }); } diff --git a/src/test/compile-fail/tstate-break-uninit-2.rs b/src/test/compile-fail/tstate-break-uninit-2.rs index 8ea5446c8090b..7d75009098fcc 100644 --- a/src/test/compile-fail/tstate-break-uninit-2.rs +++ b/src/test/compile-fail/tstate-break-uninit-2.rs @@ -6,10 +6,10 @@ fn foo() -> int { while 1 != 2 { break; - check is_even(x); //! WARNING unreachable statement + check is_even(x); //~ WARNING unreachable statement } - even(x); //! ERROR unsatisfied precondition + even(x); //~ ERROR unsatisfied precondition ret 17; } diff --git a/src/test/compile-fail/tstate-break-uninit.rs b/src/test/compile-fail/tstate-break-uninit.rs index 55146447b4484..b0d51deb5df07 100644 --- a/src/test/compile-fail/tstate-break-uninit.rs +++ b/src/test/compile-fail/tstate-break-uninit.rs @@ -6,10 +6,10 @@ fn foo() -> int { loop { break; - check is_even(x); //! WARNING unreachable statement + check is_even(x); //~ WARNING unreachable statement } - even(x); //! ERROR unsatisfied precondition + even(x); //~ ERROR unsatisfied precondition ret 17; } diff --git a/src/test/compile-fail/tstate-ctor-unsat.rs b/src/test/compile-fail/tstate-ctor-unsat.rs index d249865cd497d..e72e57f901b52 100644 --- a/src/test/compile-fail/tstate-ctor-unsat.rs +++ b/src/test/compile-fail/tstate-ctor-unsat.rs @@ -15,7 +15,7 @@ class cat { new(in_x : uint, in_y : int) { let foo = 3; self.meows = in_x + (in_y as uint); - self.how_hungry = even(foo); //! ERROR unsatisfied precondition + self.how_hungry = even(foo); //~ ERROR unsatisfied precondition } } diff --git a/src/test/compile-fail/tstate-fru.rs b/src/test/compile-fail/tstate-fru.rs index 70c39d434ff94..c5335ce1f8567 100644 --- a/src/test/compile-fail/tstate-fru.rs +++ b/src/test/compile-fail/tstate-fru.rs @@ -9,6 +9,6 @@ fn main() { let origin: point; origin = {x: 0, y: 0}; let right: point = {x: 10 with tested(origin)}; - //!^ ERROR precondition + //~^ ERROR precondition copy right; } diff --git a/src/test/compile-fail/tstate-if-no-else.rs b/src/test/compile-fail/tstate-if-no-else.rs index fbc02bf591a0e..e9873110a44c6 100644 --- a/src/test/compile-fail/tstate-if-no-else.rs +++ b/src/test/compile-fail/tstate-if-no-else.rs @@ -6,5 +6,5 @@ fn foo(x: int) { log(debug, x); } fn main() { let x: int = 10; if 1 > 2 { check is_even(x); } - even(x); //! ERROR unsatisfied precondition + even(x); //~ ERROR unsatisfied precondition } diff --git a/src/test/compile-fail/tstate-if-with-else.rs b/src/test/compile-fail/tstate-if-with-else.rs index 74edb4b8d8b72..c813d84d4657a 100644 --- a/src/test/compile-fail/tstate-if-with-else.rs +++ b/src/test/compile-fail/tstate-if-with-else.rs @@ -10,5 +10,5 @@ fn main() { } else { check is_even(x); } - even(x); //! ERROR unsatisfied precondition + even(x); //~ ERROR unsatisfied precondition } diff --git a/src/test/compile-fail/tstate-loop-constraints.rs b/src/test/compile-fail/tstate-loop-constraints.rs index 34ff0753d86ad..731a7d0b6d885 100644 --- a/src/test/compile-fail/tstate-loop-constraints.rs +++ b/src/test/compile-fail/tstate-loop-constraints.rs @@ -10,7 +10,7 @@ fn main() { check is_even(x); even(x); // OK loop { - even(x); //! ERROR unsatisfied precondition + even(x); //~ ERROR unsatisfied precondition x = 11; } } diff --git a/src/test/compile-fail/tstate-or-init.rs b/src/test/compile-fail/tstate-or-init.rs index c26925929a6aa..f24dd9d888e73 100644 --- a/src/test/compile-fail/tstate-or-init.rs +++ b/src/test/compile-fail/tstate-or-init.rs @@ -3,5 +3,5 @@ fn even(i: int) : is_even(i) -> int { i } fn main() { let i: int = 4; log(debug, false || { check is_even(i); true }); - even(i); //! ERROR unsatisfied precondition + even(i); //~ ERROR unsatisfied precondition } diff --git a/src/test/compile-fail/tstate-return.rs b/src/test/compile-fail/tstate-return.rs index 6d786bacd7be3..0ac68559f8b86 100644 --- a/src/test/compile-fail/tstate-return.rs +++ b/src/test/compile-fail/tstate-return.rs @@ -3,7 +3,7 @@ fn even(i: int) : is_even(i) -> int { i } fn f() -> int { let x: int = 4; - ret even(x); //! ERROR unsatisfied precondition + ret even(x); //~ ERROR unsatisfied precondition } fn main() { f(); } diff --git a/src/test/compile-fail/tstate-unsat-after-item.rs b/src/test/compile-fail/tstate-unsat-after-item.rs index 03fc1d326f68f..6722736dea0f0 100644 --- a/src/test/compile-fail/tstate-unsat-after-item.rs +++ b/src/test/compile-fail/tstate-unsat-after-item.rs @@ -4,6 +4,6 @@ fn even(i: int) : is_even(i) -> int { i } fn main() { let x = 4; fn baz(_x: int) { } - baz(even(x)); //! ERROR unsatisfied precondition + baz(even(x)); //~ ERROR unsatisfied precondition } diff --git a/src/test/compile-fail/tstate-unsat-in-called-fn-expr.rs b/src/test/compile-fail/tstate-unsat-in-called-fn-expr.rs index 24cfa527e9537..a02598a305a4c 100644 --- a/src/test/compile-fail/tstate-unsat-in-called-fn-expr.rs +++ b/src/test/compile-fail/tstate-unsat-in-called-fn-expr.rs @@ -3,7 +3,7 @@ fn foo(v: [int]) : vec::is_empty(v) { #debug("%d", v[0]); } fn main() { let f = fn@() { let v = [1]/~; - foo(v); //! ERROR unsatisfied precondition constraint + foo(v); //~ ERROR unsatisfied precondition constraint }(); log(error, f); } diff --git a/src/test/compile-fail/tstate-unsat-in-fn-expr.rs b/src/test/compile-fail/tstate-unsat-in-fn-expr.rs index 753655d354c54..18189629d86a5 100644 --- a/src/test/compile-fail/tstate-unsat-in-fn-expr.rs +++ b/src/test/compile-fail/tstate-unsat-in-fn-expr.rs @@ -3,7 +3,7 @@ fn foo(v: [int]) : vec::is_empty(v) { #debug("%d", v[0]); } fn main() { let f = fn@() { let v = [1]/~; - foo(v); //! ERROR unsatisfied precondition constraint + foo(v); //~ ERROR unsatisfied precondition constraint }; log(error, f()); } diff --git a/src/test/compile-fail/tstate-unsat.rs b/src/test/compile-fail/tstate-unsat.rs index 44a3e88fdee76..210feb28b920f 100644 --- a/src/test/compile-fail/tstate-unsat.rs +++ b/src/test/compile-fail/tstate-unsat.rs @@ -3,5 +3,5 @@ fn even(i: int) : is_even(i) -> int { i } fn main() { let x: int = 4; - even(x); //! ERROR unsatisfied precondition + even(x); //~ ERROR unsatisfied precondition } diff --git a/src/test/compile-fail/tstate-while-break.rs b/src/test/compile-fail/tstate-while-break.rs index 6a25929a85b3b..49905d5034854 100644 --- a/src/test/compile-fail/tstate-while-break.rs +++ b/src/test/compile-fail/tstate-while-break.rs @@ -7,7 +7,7 @@ fn test(cond: bool) { check is_even(v); break; } - even(v); //! ERROR unsatisfied precondition + even(v); //~ ERROR unsatisfied precondition } fn main() { diff --git a/src/test/compile-fail/tstate-while-cond.rs b/src/test/compile-fail/tstate-while-cond.rs index ae5436aa4e841..afc77fa42c63d 100644 --- a/src/test/compile-fail/tstate-while-cond.rs +++ b/src/test/compile-fail/tstate-while-cond.rs @@ -3,5 +3,5 @@ fn even(i: int) : is_even(i) -> int { i } fn main() { let x: int = 4; - while even(x) != 0 { } //! ERROR unsatisfied precondition + while even(x) != 0 { } //~ ERROR unsatisfied precondition } diff --git a/src/test/compile-fail/tstate-while.rs b/src/test/compile-fail/tstate-while.rs index 6091a0237a259..f99c966aaf46f 100644 --- a/src/test/compile-fail/tstate-while.rs +++ b/src/test/compile-fail/tstate-while.rs @@ -4,7 +4,7 @@ fn even(i: int) : is_even(i) -> int { i } fn f() { let mut x: int = 10; while 1 == 1 { x = 10; } - even(x); //! ERROR unsatisfied precondition + even(x); //~ ERROR unsatisfied precondition } fn main() { f(); } diff --git a/src/test/compile-fail/tutorial-suffix-inference-test.rs b/src/test/compile-fail/tutorial-suffix-inference-test.rs index fa07be952c119..41fe5864ec3e2 100644 --- a/src/test/compile-fail/tutorial-suffix-inference-test.rs +++ b/src/test/compile-fail/tutorial-suffix-inference-test.rs @@ -7,9 +7,9 @@ fn main() { identity_u8(x); // after this, `x` is assumed to have type `u8` identity_u16(x); - //!^ ERROR mismatched types: expected `u16` but found `u8` + //~^ ERROR mismatched types: expected `u16` but found `u8` identity_u16(y); - //!^ ERROR mismatched types: expected `u16` but found `i32` + //~^ ERROR mismatched types: expected `u16` but found `i32` let a = 3i; @@ -17,6 +17,6 @@ fn main() { identity_i(a); // ok identity_u16(a); - //!^ ERROR mismatched types: expected `u16` but found `int` + //~^ ERROR mismatched types: expected `u16` but found `int` } \ No newline at end of file diff --git a/src/test/compile-fail/type-mismatch.rs b/src/test/compile-fail/type-mismatch.rs index 08deb8a2d7c36..d9c2654ff2b23 100644 --- a/src/test/compile-fail/type-mismatch.rs +++ b/src/test/compile-fail/type-mismatch.rs @@ -4,5 +4,5 @@ fn main() { let x = true; let y = 1; let z = x + y; - //!^ ERROR binary operation + cannot be applied to type `bool` + //~^ ERROR binary operation + cannot be applied to type `bool` } diff --git a/src/test/compile-fail/unique-unique-kind.rs b/src/test/compile-fail/unique-unique-kind.rs index 9373ae70230b8..afa8134e08305 100644 --- a/src/test/compile-fail/unique-unique-kind.rs +++ b/src/test/compile-fail/unique-unique-kind.rs @@ -3,5 +3,5 @@ fn f(_i: T) { fn main() { let i = ~@100; - f(i); //! ERROR missing `send` + f(i); //~ ERROR missing `send` } diff --git a/src/test/compile-fail/unsafe-fn-assign-deref-ptr.rs b/src/test/compile-fail/unsafe-fn-assign-deref-ptr.rs index 089c4a74505af..03af39ab7fcfa 100644 --- a/src/test/compile-fail/unsafe-fn-assign-deref-ptr.rs +++ b/src/test/compile-fail/unsafe-fn-assign-deref-ptr.rs @@ -1,7 +1,7 @@ // -*- rust -*- fn f(p: *u8) { - *p = 0u8; //! ERROR dereference of unsafe pointer requires unsafe function or block + *p = 0u8; //~ ERROR dereference of unsafe pointer requires unsafe function or block ret; } diff --git a/src/test/compile-fail/unsafe-fn-autoderef.rs b/src/test/compile-fail/unsafe-fn-autoderef.rs index cc6faa07557b5..b4ab76dc0c9b4 100644 --- a/src/test/compile-fail/unsafe-fn-autoderef.rs +++ b/src/test/compile-fail/unsafe-fn-autoderef.rs @@ -15,7 +15,7 @@ fn f(p: *rec) -> int { // are prohibited by various checks, such as that the enum is // instantiable and so forth). - ret p.f; //! ERROR attempted access of field `f` on type `*rec` + ret p.f; //~ ERROR attempted access of field `f` on type `*rec` } fn main() { diff --git a/src/test/compile-fail/unsafe-fn-called-from-safe.rs b/src/test/compile-fail/unsafe-fn-called-from-safe.rs index 2353be31c2bf9..d7681a2ec6034 100644 --- a/src/test/compile-fail/unsafe-fn-called-from-safe.rs +++ b/src/test/compile-fail/unsafe-fn-called-from-safe.rs @@ -3,5 +3,5 @@ unsafe fn f() { ret; } fn main() { - f(); //! ERROR access to unsafe function requires unsafe function or block + f(); //~ ERROR access to unsafe function requires unsafe function or block } diff --git a/src/test/compile-fail/unsafe-fn-deref-ptr.rs b/src/test/compile-fail/unsafe-fn-deref-ptr.rs index dd6a9c7a40558..e66bf5eb687dc 100644 --- a/src/test/compile-fail/unsafe-fn-deref-ptr.rs +++ b/src/test/compile-fail/unsafe-fn-deref-ptr.rs @@ -1,7 +1,7 @@ // -*- rust -*- fn f(p: *u8) -> u8 { - ret *p; //! ERROR dereference of unsafe pointer requires unsafe function or block + ret *p; //~ ERROR dereference of unsafe pointer requires unsafe function or block } fn main() { diff --git a/src/test/compile-fail/unsafe-fn-used-as-value.rs b/src/test/compile-fail/unsafe-fn-used-as-value.rs index dfcc2c85fcf24..7dc0ce4a12b4f 100644 --- a/src/test/compile-fail/unsafe-fn-used-as-value.rs +++ b/src/test/compile-fail/unsafe-fn-used-as-value.rs @@ -3,6 +3,6 @@ unsafe fn f() { ret; } fn main() { - let x = f; //! ERROR access to unsafe function requires unsafe function or block + let x = f; //~ ERROR access to unsafe function requires unsafe function or block x(); } diff --git a/src/test/compile-fail/unsendable-class.rs b/src/test/compile-fail/unsendable-class.rs index 689253ddeef24..de5715321e81c 100644 --- a/src/test/compile-fail/unsendable-class.rs +++ b/src/test/compile-fail/unsendable-class.rs @@ -9,7 +9,7 @@ class foo { fn main() { let cat = "kitty"; - let po = comm::port(); //! ERROR missing `send` - let ch = comm::chan(po); //! ERROR missing `send` - comm::send(ch, foo(42, @cat)); //! ERROR missing `send` + let po = comm::port(); //~ ERROR missing `send` + let ch = comm::chan(po); //~ ERROR missing `send` + comm::send(ch, foo(42, @cat)); //~ ERROR missing `send` } \ No newline at end of file diff --git a/src/test/compile-fail/vec-add.rs b/src/test/compile-fail/vec-add.rs index 583ffb9c19734..6224fed743453 100644 --- a/src/test/compile-fail/vec-add.rs +++ b/src/test/compile-fail/vec-add.rs @@ -30,74 +30,74 @@ fn add(i: [int]/~, m: [mut int]/~, c: [const int]/~) { m + c, c); - add(m + [3]/~, //! ERROR mismatched types + add(m + [3]/~, //~ ERROR mismatched types m + [3]/~, m + [3]/~); add(i + [3]/~, - i + [3]/~, //! ERROR mismatched types + i + [3]/~, //~ ERROR mismatched types i + [3]/~); - add(c + [3]/~, //! ERROR mismatched types - //!^ ERROR binary operation + cannot be applied - c + [3]/~, //! ERROR binary operation + cannot be applied - //!^ mismatched types + add(c + [3]/~, //~ ERROR mismatched types + //~^ ERROR binary operation + cannot be applied + c + [3]/~, //~ ERROR binary operation + cannot be applied + //~^ mismatched types [3]/~); - add(m + [mut 3]/~, //! ERROR mismatched types + add(m + [mut 3]/~, //~ ERROR mismatched types m + [mut 3]/~, m + [mut 3]/~); add(i + [mut 3]/~, - i + [mut 3]/~, //! ERROR mismatched types + i + [mut 3]/~, //~ ERROR mismatched types i + [mut 3]/~); - add(c + [mut 3]/~, //! ERROR binary operation + cannot be applied - //!^ mismatched types - c + [mut 3]/~, //! ERROR binary operation + cannot be applied - //!^ mismatched types + add(c + [mut 3]/~, //~ ERROR binary operation + cannot be applied + //~^ mismatched types + c + [mut 3]/~, //~ ERROR binary operation + cannot be applied + //~^ mismatched types [mut 3]/~); - add(m + i, //! ERROR mismatched types + add(m + i, //~ ERROR mismatched types m + i, m + i); add(i + i, - i + i, //! ERROR mismatched types + i + i, //~ ERROR mismatched types i + i); - add(c + i, //! ERROR binary operation + cannot be applied - //!^ ERROR mismatched types - c + i, //! ERROR binary operation + cannot be applied - //!^ ERROR mismatched types + add(c + i, //~ ERROR binary operation + cannot be applied + //~^ ERROR mismatched types + c + i, //~ ERROR binary operation + cannot be applied + //~^ ERROR mismatched types i); - add(m + m, //! ERROR mismatched types + add(m + m, //~ ERROR mismatched types m + m, m + m); add(i + m, - i + m, //! ERROR mismatched types + i + m, //~ ERROR mismatched types i + m); - add(c + m, //! ERROR binary operation + cannot be applied - //!^ ERROR mismatched types - c + m, //! ERROR binary operation + cannot be applied - //!^ ERROR mismatched types + add(c + m, //~ ERROR binary operation + cannot be applied + //~^ ERROR mismatched types + c + m, //~ ERROR binary operation + cannot be applied + //~^ ERROR mismatched types m); - add(m + c, //! ERROR mismatched types + add(m + c, //~ ERROR mismatched types m + c, m + c); add(i + c, - i + c, //! ERROR mismatched types + i + c, //~ ERROR mismatched types i + c); - add(c + c, //! ERROR binary operation + cannot be applied - //!^ ERROR mismatched types - c + c, //! ERROR binary operation + cannot be applied - //!^ ERROR mismatched types + add(c + c, //~ ERROR binary operation + cannot be applied + //~^ ERROR mismatched types + c + c, //~ ERROR binary operation + cannot be applied + //~^ ERROR mismatched types c); } diff --git a/src/test/compile-fail/vec-concat-bug.rs b/src/test/compile-fail/vec-concat-bug.rs index 40e6e2b035813..6545a56806e3c 100644 --- a/src/test/compile-fail/vec-concat-bug.rs +++ b/src/test/compile-fail/vec-concat-bug.rs @@ -3,7 +3,7 @@ fn concat(v: [const [const T]/~]/~) -> [T]/~ { // Earlier versions of our type checker accepted this: vec::iter(v) {|&&inner: [T]/~| - //!^ ERROR values differ in mutability + //~^ ERROR values differ in mutability r += inner; } diff --git a/src/test/compile-fail/vector-no-ann.rs b/src/test/compile-fail/vector-no-ann.rs index c68995a68544a..a8365b6687008 100644 --- a/src/test/compile-fail/vector-no-ann.rs +++ b/src/test/compile-fail/vector-no-ann.rs @@ -1,3 +1,3 @@ fn main() { - let _foo = []/~; //! ERROR unconstrained type + let _foo = []/~; //~ ERROR unconstrained type } diff --git a/src/test/compile-fail/warn-path-statement.rs b/src/test/compile-fail/warn-path-statement.rs index ba8c241689d62..d5645c4358f5e 100644 --- a/src/test/compile-fail/warn-path-statement.rs +++ b/src/test/compile-fail/warn-path-statement.rs @@ -2,5 +2,5 @@ fn main() { let x = 10; - x; //! ERROR path statement with no effect + x; //~ ERROR path statement with no effect } \ No newline at end of file diff --git a/src/test/run-pass/liveness-assign-imm-local-after-ret.rs b/src/test/run-pass/liveness-assign-imm-local-after-ret.rs index 4b1cc59171310..028bf10201be7 100644 --- a/src/test/run-pass/liveness-assign-imm-local-after-ret.rs +++ b/src/test/run-pass/liveness-assign-imm-local-after-ret.rs @@ -2,7 +2,7 @@ fn test() { let _v: int; _v = 1; ret; - _v = 2; //! WARNING: unreachable statement + _v = 2; //~ WARNING: unreachable statement } fn main() { diff --git a/src/test/run-pass/pred-not-bool.rs b/src/test/run-pass/pred-not-bool.rs index 58281b40b5e61..67b5a877c0524 100644 --- a/src/test/run-pass/pred-not-bool.rs +++ b/src/test/run-pass/pred-not-bool.rs @@ -1,6 +1,6 @@ // this checks that a pred with a non-bool return // type is rejected, even if the pred is never used -pure fn bad(a: int) -> int { ret 37; } //! ERROR Non-boolean return type +pure fn bad(a: int) -> int { ret 37; } //~ ERROR Non-boolean return type fn main() { } diff --git a/src/test/run-pass/unreachable-code-1.rs b/src/test/run-pass/unreachable-code-1.rs index 38b97b47e4bd6..fba080ac7f5e1 100644 --- a/src/test/run-pass/unreachable-code-1.rs +++ b/src/test/run-pass/unreachable-code-1.rs @@ -4,7 +4,7 @@ fn id(x: bool) -> bool { x } fn call_id() { let c <- fail; - id(c); //! WARNING unreachable statement + id(c); //~ WARNING unreachable statement } fn call_id_3() { id(ret) && id(ret); } From 29eb788b1f957f84d1b19a6ddcb7d5f4852d4973 Mon Sep 17 00:00:00 2001 From: Gareth Daniel Smith Date: Sat, 30 Jun 2012 12:31:24 +0100 Subject: [PATCH 3/3] make script executable --- src/etc/sugarise-doc-comments.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 src/etc/sugarise-doc-comments.py diff --git a/src/etc/sugarise-doc-comments.py b/src/etc/sugarise-doc-comments.py old mode 100644 new mode 100755