Skip to content

Commit ec004b3

Browse files
committed
---
yaml --- r: 216252 b: refs/heads/stable c: 6f7b5b1 h: refs/heads/master v: v3
1 parent 04910a8 commit ec004b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+889
-975
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/heads/tmp: 378a370ff2057afeb1eae86eb6e78c476866a4a6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: b29c2efd423a7687237e0878c71ceced87131530
32+
refs/heads/stable: 6f7b5b1910e8211a8895ec3cfd3c421a5812b7d7
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375

branches/stable/configure

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,9 @@ if [ -n "$CFG_ENABLE_DEBUG" ]; then
659659
CFG_DISABLE_OPTIMIZE=1
660660
CFG_DISABLE_OPTIMIZE_CXX=1
661661
fi
662+
CFG_ENABLE_LLVM_ASSERTIONS=1
662663
CFG_ENABLE_DEBUG_ASSERTIONS=1
663664
CFG_ENABLE_DEBUG_JEMALLOC=1
664-
CFG_ENABLE_DEBUGINFO=1
665-
CFG_ENABLE_LLVM_ASSERTIONS=1
666665
fi
667666

668667
# OK, now write the debugging options

branches/stable/src/doc/grammar.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,12 @@ explicit codepoint lists. [^inputformat]
9696
## Special Unicode Productions
9797

9898
The following productions in the Rust grammar are defined in terms of Unicode
99-
properties: `ident`, `non_null`, `non_eol`, `non_single_quote` and
100-
`non_double_quote`.
99+
properties: `ident`, `non_null`, `non_star`, `non_eol`, `non_slash_or_star`,
100+
`non_single_quote` and `non_double_quote`.
101101

102102
### Identifiers
103103

104-
The `ident` production is any nonempty Unicode[^non_ascii_idents] string of
105-
the following form:
106-
107-
[^non_ascii_idents]: Non-ASCII characters in identifiers are currently feature
108-
gated. This is expected to improve soon.
104+
The `ident` production is any nonempty Unicode string of the following form:
109105

110106
- The first character has property `XID_start`
111107
- The remaining characters have property `XID_continue`
@@ -122,6 +118,8 @@ Some productions are defined by exclusion of particular Unicode characters:
122118

123119
- `non_null` is any single Unicode character aside from `U+0000` (null)
124120
- `non_eol` is `non_null` restricted to exclude `U+000A` (`'\n'`)
121+
- `non_star` is `non_null` restricted to exclude `U+002A` (`*`)
122+
- `non_slash_or_star` is `non_null` restricted to exclude `U+002F` (`/`) and `U+002A` (`*`)
125123
- `non_single_quote` is `non_null` restricted to exclude `U+0027` (`'`)
126124
- `non_double_quote` is `non_null` restricted to exclude `U+0022` (`"`)
127125

branches/stable/src/doc/reference.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,14 @@ explicit code point lists. [^inputformat]
6565
provided to the grammar verifier, restricted to ASCII range, when verifying the
6666
grammar in this document.
6767

68-
## Identifiers
68+
## Special Unicode Productions
6969

70-
An identifier is any nonempty Unicode[^non_ascii_idents] string of the following form:
70+
The following productions in the Rust grammar are defined in terms of Unicode
71+
properties: `ident`, `non_null`, `non_eol`, `non_single_quote` and `non_double_quote`.
72+
73+
### Identifiers
74+
75+
The `ident` production is any nonempty Unicode[^non_ascii_idents] string of the following form:
7176

7277
[^non_ascii_idents]: Non-ASCII characters in identifiers are currently feature
7378
gated. This is expected to improve soon.
@@ -81,34 +86,40 @@ that does _not_ occur in the set of [keywords](#keywords).
8186
> character ranges used to form the more familiar C and Java language-family
8287
> identifiers.
8388
89+
### Delimiter-restricted productions
90+
91+
Some productions are defined by exclusion of particular Unicode characters:
92+
93+
- `non_null` is any single Unicode character aside from `U+0000` (null)
94+
- `non_eol` is `non_null` restricted to exclude `U+000A` (`'\n'`)
95+
- `non_single_quote` is `non_null` restricted to exclude `U+0027` (`'`)
96+
- `non_double_quote` is `non_null` restricted to exclude `U+0022` (`"`)
97+
8498
## Comments
8599

86-
Comments in Rust code follow the general C++ style of line (`//`) and
87-
block-comment (`/* ... */`) forms. Nested block comments are supported.
100+
Comments in Rust code follow the general C++ style of line and block-comment
101+
forms. Nested block comments are supported.
88102

89103
Line comments beginning with exactly _three_ slashes (`///`), and block
90104
comments beginning with exactly one repeated asterisk in the block-open
91105
sequence (`/**`), are interpreted as a special syntax for `doc`
92106
[attributes](#attributes). That is, they are equivalent to writing
93-
`#[doc="..."]` around the body of the comment, i.e., `/// Foo` turns into
94-
`#[doc="Foo"]`.
107+
`#[doc="..."]` around the body of the comment (this includes the comment
108+
characters themselves, i.e. `/// Foo` turns into `#[doc="/// Foo"]`).
95109

96110
Line comments beginning with `//!` and block comments beginning with `/*!` are
97111
doc comments that apply to the parent of the comment, rather than the item
98112
that follows. That is, they are equivalent to writing `#![doc="..."]` around
99-
the body of the comment. `//!` comments are usually used to document
100-
modules that occupy a source file.
113+
the body of the comment. `//!` comments are usually used to display
114+
information on the crate index page.
101115

102116
Non-doc comments are interpreted as a form of whitespace.
103117

104118
## Whitespace
105119

106-
Whitespace is any non-empty string containing any the following characters:
107-
108-
- `U+0020` (space, `' '`)
109-
- `U+0009` (tab, `'\t'`)
110-
- `U+000A` (LF, `'\n'`)
111-
- `U+000D` (CR, `'\r'`)
120+
The `whitespace_char` production is any nonempty Unicode string consisting of
121+
any of the following Unicode characters: `U+0020` (space, `' '`), `U+0009`
122+
(tab, `'\t'`), `U+000A` (LF, `'\n'`), `U+000D` (CR, `'\r'`).
112123

113124
Rust is a "free-form" language, meaning that all forms of whitespace serve only
114125
to separate _tokens_ in the grammar, and have no semantic significance.

branches/stable/src/doc/trpl/vectors.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,3 @@ Vectors have many more useful methods, which you can read about in [their
5656
API documentation][vec].
5757

5858
[vec]: ../std/vec/index.html
59-
[generic]: generics.html

branches/stable/src/librustc/middle/astencode.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,31 +1835,29 @@ fn decode_item_ast(par_doc: rbml::Doc) -> ast::Item {
18351835
}
18361836

18371837
#[cfg(test)]
1838-
trait FakeExtCtxt {
1839-
fn call_site(&self) -> codemap::Span;
1838+
trait fake_ext_ctxt {
18401839
fn cfg(&self) -> ast::CrateConfig;
1840+
fn parse_sess<'a>(&'a self) -> &'a parse::ParseSess;
1841+
fn call_site(&self) -> Span;
18411842
fn ident_of(&self, st: &str) -> ast::Ident;
1842-
fn name_of(&self, st: &str) -> ast::Name;
1843-
fn parse_sess(&self) -> &parse::ParseSess;
18441843
}
18451844

18461845
#[cfg(test)]
1847-
impl FakeExtCtxt for parse::ParseSess {
1848-
fn call_site(&self) -> codemap::Span {
1846+
impl fake_ext_ctxt for parse::ParseSess {
1847+
fn cfg(&self) -> ast::CrateConfig {
1848+
Vec::new()
1849+
}
1850+
fn parse_sess<'a>(&'a self) -> &'a parse::ParseSess { self }
1851+
fn call_site(&self) -> Span {
18491852
codemap::Span {
18501853
lo: codemap::BytePos(0),
18511854
hi: codemap::BytePos(0),
1852-
expn_id: codemap::NO_EXPANSION,
1855+
expn_id: codemap::NO_EXPANSION
18531856
}
18541857
}
1855-
fn cfg(&self) -> ast::CrateConfig { Vec::new() }
18561858
fn ident_of(&self, st: &str) -> ast::Ident {
1857-
parse::token::str_to_ident(st)
1858-
}
1859-
fn name_of(&self, st: &str) -> ast::Name {
1860-
parse::token::intern(st)
1859+
token::str_to_ident(st)
18611860
}
1862-
fn parse_sess(&self) -> &parse::ParseSess { self }
18631861
}
18641862

18651863
#[cfg(test)]
@@ -1885,14 +1883,15 @@ fn test_basic() {
18851883
fn foo() {}
18861884
));
18871885
}
1888-
1886+
/* NOTE: When there's a snapshot, update this (yay quasiquoter!)
18891887
#[test]
18901888
fn test_smalltalk() {
18911889
let cx = mk_ctxt();
18921890
roundtrip(quote_item!(&cx,
18931891
fn foo() -> isize { 3 + 4 } // first smalltalk program ever executed.
18941892
));
18951893
}
1894+
*/
18961895

18971896
#[test]
18981897
fn test_more() {

branches/stable/src/librustc/session/mod.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ pub struct Session {
5757
pub crate_metadata: RefCell<Vec<String>>,
5858
pub features: RefCell<feature_gate::Features>,
5959

60-
pub delayed_span_bug: RefCell<Option<(codemap::Span, String)>>,
61-
6260
/// The maximum recursion limit for potentially infinitely recursive
6361
/// operations such as auto-dereference and monomorphization.
6462
pub recursion_limit: Cell<usize>,
@@ -116,15 +114,7 @@ impl Session {
116114
self.diagnostic().handler().has_errors()
117115
}
118116
pub fn abort_if_errors(&self) {
119-
self.diagnostic().handler().abort_if_errors();
120-
121-
let delayed_bug = self.delayed_span_bug.borrow();
122-
match *delayed_bug {
123-
Some((span, ref errmsg)) => {
124-
self.diagnostic().span_bug(span, errmsg);
125-
},
126-
_ => {}
127-
}
117+
self.diagnostic().handler().abort_if_errors()
128118
}
129119
pub fn span_warn(&self, sp: Span, msg: &str) {
130120
if self.can_print_warnings {
@@ -181,11 +171,6 @@ impl Session {
181171
None => self.bug(msg),
182172
}
183173
}
184-
/// Delay a span_bug() call until abort_if_errors()
185-
pub fn delay_span_bug(&self, sp: Span, msg: &str) {
186-
let mut delayed = self.delayed_span_bug.borrow_mut();
187-
*delayed = Some((sp, msg.to_string()));
188-
}
189174
pub fn span_bug(&self, sp: Span, msg: &str) -> ! {
190175
self.diagnostic().span_bug(sp, msg)
191176
}
@@ -417,7 +402,6 @@ pub fn build_session_(sopts: config::Options,
417402
plugin_llvm_passes: RefCell::new(Vec::new()),
418403
crate_types: RefCell::new(Vec::new()),
419404
crate_metadata: RefCell::new(Vec::new()),
420-
delayed_span_bug: RefCell::new(None),
421405
features: RefCell::new(feature_gate::Features::new()),
422406
recursion_limit: Cell::new(64),
423407
can_print_warnings: can_print_warnings

branches/stable/src/librustc_trans/trans/adt.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,6 @@ fn find_discr_field_candidate<'tcx>(tcx: &ty::ctxt<'tcx>,
414414
assert_eq!(nonzero_fields.len(), 1);
415415
let nonzero_field = ty::lookup_field_type(tcx, did, nonzero_fields[0].id, substs);
416416
match nonzero_field.sty {
417-
ty::ty_ptr(ty::mt { ty, .. }) if !type_is_sized(tcx, ty) => {
418-
path.push_all(&[0, FAT_PTR_ADDR]);
419-
Some(path)
420-
},
421417
ty::ty_ptr(..) | ty::ty_int(..) | ty::ty_uint(..) => {
422418
path.push(0);
423419
Some(path)

branches/stable/src/librustc_typeck/check/method/suggest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ pub fn all_traits<'a>(ccx: &'a CrateCtxt) -> AllTraits<'a> {
364364
}
365365

366366
pub struct AllTraits<'a> {
367-
borrow: cell::Ref<'a, Option<AllTraitsVec>>,
367+
borrow: cell::Ref<'a Option<AllTraitsVec>>,
368368
idx: usize
369369
}
370370

branches/stable/src/librustc_typeck/check/regionck.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,11 @@ fn visit_expr(rcx: &mut Rcx, expr: &ast::Expr) {
562562
}
563563
Err(..) => {
564564
let tcx = rcx.fcx.tcx();
565-
tcx.sess.delay_span_bug(expr.span, "cat_expr_unadjusted Errd");
565+
if tcx.sess.has_errors() {
566+
// cannot run dropck; okay b/c in error state anyway.
567+
} else {
568+
tcx.sess.span_bug(expr.span, "cat_expr_unadjusted Errd");
569+
}
566570
}
567571
}
568572
}
@@ -579,7 +583,11 @@ fn visit_expr(rcx: &mut Rcx, expr: &ast::Expr) {
579583
}
580584
Err(..) => {
581585
let tcx = rcx.fcx.tcx();
582-
tcx.sess.delay_span_bug(expr.span, "cat_expr Errd");
586+
if tcx.sess.has_errors() {
587+
// cannot run dropck; okay b/c in error state anyway.
588+
} else {
589+
tcx.sess.span_bug(expr.span, "cat_expr Errd");
590+
}
583591
}
584592
}
585593

branches/stable/src/libsyntax/ast.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ impl Ident {
8989
pub fn as_str<'a>(&'a self) -> &'a str {
9090
self.name.as_str()
9191
}
92+
93+
pub fn encode_with_hygiene(&self) -> String {
94+
format!("\x00name_{},ctxt_{}\x00",
95+
self.name.usize(),
96+
self.ctxt)
97+
}
9298
}
9399

94100
impl fmt::Debug for Ident {

0 commit comments

Comments
 (0)