Skip to content

Commit 698fb3f

Browse files
committed
---
yaml --- r: 93950 b: refs/heads/try c: e9ab9bf h: refs/heads/master v: v3
1 parent da67f63 commit 698fb3f

File tree

10 files changed

+22
-69
lines changed

10 files changed

+22
-69
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: d2c405eeff3930bf0c0777f06108a2eedcd456f6
5+
refs/heads/try: e9ab9bf01a752eb3d97ad61fa254d1af7ea7e0a2
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/doc/rust.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,17 @@ Some productions are defined by exclusion of particular Unicode characters:
153153
~~~~ {.ebnf .gram}
154154
comment : block_comment | line_comment ;
155155
block_comment : "/*" block_comment_body * '*' + '/' ;
156-
block_comment_body : (block_comment | character) * ;
156+
block_comment_body : non_star * | '*' + non_slash_or_star ;
157157
line_comment : "//" non_eol * ;
158158
~~~~
159159

160160
Comments in Rust code follow the general C++ style of line and block-comment forms,
161161
with no nesting of block-comment delimiters.
162162

163-
Line comments beginning with exactly _three_ slashes (`///`), and block
164-
comments beginning with a exactly one repeated asterisk in the block-open
165-
sequence (`/**`), are interpreted as a special syntax for `doc`
166-
[attributes](#attributes). That is, they are equivalent to writing
167-
`#[doc="..."]` around the body of the comment (this includes the comment
168-
characters themselves, ie `/// Foo` turns into `#[doc="/// Foo"]`).
163+
Line comments beginning with _three_ slashes (`///`),
164+
and block comments beginning with a repeated asterisk in the block-open sequence (`/**`),
165+
are interpreted as a special syntax for `doc` [attributes](#attributes).
166+
That is, they are equivalent to writing `#[doc "..."]` around the comment's text.
169167

170168
Non-doc comments are interpreted as a form of whitespace.
171169

branches/try/src/etc/unicode.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# code covering the core properties. Since this is a pretty rare event we
66
# just store this out-of-line and check the unicode.rs file into git.
77
#
8-
# The emitted code is "the minimum we think is necessary for libcore", that
8+
# The emitted code is "the minimum we think is necessary for libstd", that
99
# is, to support basic operations of the compiler and "most nontrivial rust
1010
# programs". It is not meant to be a complete implementation of unicode.
1111
# For that we recommend you use a proper binding to libicu.
@@ -144,7 +144,7 @@ def emit_bsearch_range_table(f):
144144
use cmp::{Equal, Less, Greater};
145145
use vec::ImmutableVector;
146146
use option::None;
147-
(do r.bsearch |&(lo,hi)| {
147+
r.bsearch(|&(lo,hi)| {
148148
if lo <= c && c <= hi { Equal }
149149
else if hi < c { Less }
150150
else { Greater }
@@ -302,14 +302,14 @@ def emit_decomp_module(f, canon, compat, combine):
302302
ix += 1
303303
f.write("\n ];\n")
304304

305-
f.write(" pub fn canonical(c: char, i: &fn(char)) "
305+
f.write(" pub fn canonical(c: char, i: |char|) "
306306
+ "{ d(c, i, false); }\n\n")
307-
f.write(" pub fn compatibility(c: char, i: &fn(char)) "
307+
f.write(" pub fn compatibility(c: char, i: |char|) "
308308
+"{ d(c, i, true); }\n\n")
309309
f.write(" pub fn canonical_combining_class(c: char) -> u8 {\n"
310310
+ " bsearch_range_value_table(c, combining_class_table)\n"
311311
+ " }\n\n")
312-
f.write(" fn d(c: char, i: &fn(char), k: bool) {\n")
312+
f.write(" fn d(c: char, i: |char|, k: bool) {\n")
313313
f.write(" use iter::Iterator;\n");
314314

315315
f.write(" if c <= '\\x7f' { i(c); return; }\n")

branches/try/src/etc/vim/syntax/rust.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ syn match rustCharacter /'\([^'\\]\|\\\([nrt0\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8
187187

188188
syn region rustCommentML start="/\*" end="\*/" contains=rustTodo
189189
syn region rustComment start="//" end="$" contains=rustTodo keepend
190-
syn region rustCommentMLDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo
191-
syn region rustCommentDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo keepend
190+
syn region rustCommentMLDoc start="/\*\%(!\|\*/\@!\)" end="\*/" contains=rustTodo
191+
syn region rustCommentDoc start="//[/!]" end="$" contains=rustTodo keepend
192192

193193
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
194194

branches/try/src/librustc/front/feature_gate.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
//! Features are enabled in programs via the crate-level attributes of
1919
//! #[feature(...)] with a comma-separated list of features.
2020
21-
use middle::lint;
22-
2321
use syntax::ast;
2422
use syntax::attr::AttrMetaMethods;
2523
use syntax::codemap::Span;
@@ -211,10 +209,7 @@ pub fn check_crate(sess: Session, crate: &ast::Crate) {
211209
directive not necessary");
212210
}
213211
None => {
214-
sess.add_lint(lint::unknown_features,
215-
ast::CRATE_NODE_ID,
216-
mi.span,
217-
~"unknown feature");
212+
sess.span_err(mi.span, "unknown feature");
218213
}
219214
}
220215
}

branches/try/src/librustc/middle/lint.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ use syntax::codemap::Span;
5959
use syntax::codemap;
6060
use syntax::parse::token;
6161
use syntax::{ast, ast_util, visit};
62-
use syntax::ast_util::IdVisitingOperation;
6362
use syntax::visit::Visitor;
6463

6564
#[deriving(Clone, Eq)]
@@ -78,7 +77,6 @@ pub enum lint {
7877
unused_unsafe,
7978
unsafe_block,
8079
attribute_usage,
81-
unknown_features,
8280

8381
managed_heap_memory,
8482
owned_heap_memory,
@@ -323,13 +321,6 @@ static lint_table: &'static [(&'static str, LintSpec)] = &[
323321
desc: "mass-change the level for lints which produce warnings",
324322
default: warn
325323
}),
326-
327-
("unknown_features",
328-
LintSpec {
329-
lint: unknown_features,
330-
desc: "unknown features found in create-level #[feature] directives",
331-
default: deny,
332-
}),
333324
];
334325

335326
/*
@@ -1329,7 +1320,7 @@ impl<'self> Visitor<()> for Context<'self> {
13291320
}
13301321
}
13311322

1332-
impl<'self> IdVisitingOperation for Context<'self> {
1323+
impl<'self> ast_util::IdVisitingOperation for Context<'self> {
13331324
fn visit_id(&self, id: ast::NodeId) {
13341325
match self.tcx.sess.lints.pop(&id) {
13351326
None => {}
@@ -1365,7 +1356,6 @@ pub fn check_crate(tcx: ty::ctxt,
13651356
cx.set_level(lint, level, CommandLine);
13661357
}
13671358
cx.with_lint_attrs(crate.attrs, |cx| {
1368-
cx.visit_id(ast::CRATE_NODE_ID);
13691359
cx.visit_ids(|v| {
13701360
v.visited_outermost = true;
13711361
visit::walk_crate(v, crate, ());

branches/try/src/libsyntax/parse/lexer.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ fn consume_whitespace_and_comments(rdr: @mut StringReader)
317317
}
318318

319319
pub fn is_line_non_doc_comment(s: &str) -> bool {
320-
s.starts_with("////")
320+
let s = s.trim_right();
321+
s.len() > 3 && s.chars().all(|ch| ch == '/')
321322
}
322323

323324
// PRECONDITION: rdr.curr is not whitespace
@@ -377,7 +378,8 @@ fn consume_any_line_comment(rdr: @mut StringReader)
377378
}
378379

379380
pub fn is_block_non_doc_comment(s: &str) -> bool {
380-
s.starts_with("/***")
381+
assert!(s.len() >= 1u);
382+
s.slice(1u, s.len() - 1u).chars().all(|ch| ch == '*')
381383
}
382384

383385
// might return a sugared-doc-attr

branches/try/src/test/compile-fail/gated-bad-feature.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
foo(bar),
1414
foo = "baz"
1515
)];
16-
//~^^^ ERROR: malformed feature
17-
//~^^^ ERROR: malformed feature
16+
//~^^^^ ERROR: unknown feature
17+
//~^^^^ ERROR: malformed feature
18+
//~^^^^ ERROR: malformed feature
1819

1920
#[feature]; //~ ERROR: malformed feature
2021
#[feature = "foo"]; //~ ERROR: malformed feature

branches/try/src/test/compile-fail/lint-unknown-feature.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

branches/try/src/test/run-pass/issue-10638.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)