Skip to content

Commit a4460aa

Browse files
committed
---
yaml --- r: 216253 b: refs/heads/stable c: bba18fe h: refs/heads/master i: 216251: 04910a8 v: v3
1 parent ec004b3 commit a4460aa

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

+986
-884
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: 6f7b5b1910e8211a8895ec3cfd3c421a5812b7d7
32+
refs/heads/stable: bba18fec45b0764c1c65b8f0d3ea1fb50ad8a57b
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375

branches/stable/configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,10 @@ 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
663662
CFG_ENABLE_DEBUG_ASSERTIONS=1
664663
CFG_ENABLE_DEBUG_JEMALLOC=1
664+
CFG_ENABLE_DEBUGINFO=1
665+
CFG_ENABLE_LLVM_ASSERTIONS=1
665666
fi
666667

667668
# OK, now write the debugging options

branches/stable/src/doc/grammar.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,16 @@ 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_star`, `non_eol`, `non_slash_or_star`,
100-
`non_single_quote` and `non_double_quote`.
99+
properties: `ident`, `non_null`, `non_eol`, `non_single_quote` and
100+
`non_double_quote`.
101101

102102
### Identifiers
103103

104-
The `ident` production is any nonempty Unicode string of the following form:
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.
105109

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

119123
- `non_null` is any single Unicode character aside from `U+0000` (null)
120124
- `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` (`*`)
123125
- `non_single_quote` is `non_null` restricted to exclude `U+0027` (`'`)
124126
- `non_double_quote` is `non_null` restricted to exclude `U+0022` (`"`)
125127

branches/stable/src/doc/reference.md

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,9 @@ 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-
## Special Unicode Productions
68+
## Identifiers
6969

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:
70+
An identifier is any nonempty Unicode[^non_ascii_idents] string of the following form:
7671

7772
[^non_ascii_idents]: Non-ASCII characters in identifiers are currently feature
7873
gated. This is expected to improve soon.
@@ -86,40 +81,34 @@ that does _not_ occur in the set of [keywords](#keywords).
8681
> character ranges used to form the more familiar C and Java language-family
8782
> identifiers.
8883
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-
9884
## Comments
9985

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

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

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

116102
Non-doc comments are interpreted as a form of whitespace.
117103

118104
## Whitespace
119105

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'`).
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'`)
123112

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ 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: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,29 +1835,31 @@ fn decode_item_ast(par_doc: rbml::Doc) -> ast::Item {
18351835
}
18361836

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

18451846
#[cfg(test)]
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 {
1847+
impl FakeExtCtxt for parse::ParseSess {
1848+
fn call_site(&self) -> codemap::Span {
18521849
codemap::Span {
18531850
lo: codemap::BytePos(0),
18541851
hi: codemap::BytePos(0),
1855-
expn_id: codemap::NO_EXPANSION
1852+
expn_id: codemap::NO_EXPANSION,
18561853
}
18571854
}
1855+
fn cfg(&self) -> ast::CrateConfig { Vec::new() }
18581856
fn ident_of(&self, st: &str) -> ast::Ident {
1859-
token::str_to_ident(st)
1857+
parse::token::str_to_ident(st)
1858+
}
1859+
fn name_of(&self, st: &str) -> ast::Name {
1860+
parse::token::intern(st)
18601861
}
1862+
fn parse_sess(&self) -> &parse::ParseSess { self }
18611863
}
18621864

18631865
#[cfg(test)]
@@ -1883,15 +1885,14 @@ fn test_basic() {
18831885
fn foo() {}
18841886
));
18851887
}
1886-
/* NOTE: When there's a snapshot, update this (yay quasiquoter!)
1888+
18871889
#[test]
18881890
fn test_smalltalk() {
18891891
let cx = mk_ctxt();
18901892
roundtrip(quote_item!(&cx,
18911893
fn foo() -> isize { 3 + 4 } // first smalltalk program ever executed.
18921894
));
18931895
}
1894-
*/
18951896

18961897
#[test]
18971898
fn test_more() {

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ 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+
6062
/// The maximum recursion limit for potentially infinitely recursive
6163
/// operations such as auto-dereference and monomorphization.
6264
pub recursion_limit: Cell<usize>,
@@ -114,7 +116,15 @@ impl Session {
114116
self.diagnostic().handler().has_errors()
115117
}
116118
pub fn abort_if_errors(&self) {
117-
self.diagnostic().handler().abort_if_errors()
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+
}
118128
}
119129
pub fn span_warn(&self, sp: Span, msg: &str) {
120130
if self.can_print_warnings {
@@ -171,6 +181,11 @@ impl Session {
171181
None => self.bug(msg),
172182
}
173183
}
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+
}
174189
pub fn span_bug(&self, sp: Span, msg: &str) -> ! {
175190
self.diagnostic().span_bug(sp, msg)
176191
}
@@ -402,6 +417,7 @@ pub fn build_session_(sopts: config::Options,
402417
plugin_llvm_passes: RefCell::new(Vec::new()),
403418
crate_types: RefCell::new(Vec::new()),
404419
crate_metadata: RefCell::new(Vec::new()),
420+
delayed_span_bug: RefCell::new(None),
405421
features: RefCell::new(feature_gate::Features::new()),
406422
recursion_limit: Cell::new(64),
407423
can_print_warnings: can_print_warnings

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ 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+
},
417421
ty::ty_ptr(..) | ty::ty_int(..) | ty::ty_uint(..) => {
418422
path.push(0);
419423
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: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,7 @@ fn visit_expr(rcx: &mut Rcx, expr: &ast::Expr) {
562562
}
563563
Err(..) => {
564564
let tcx = rcx.fcx.tcx();
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-
}
565+
tcx.sess.delay_span_bug(expr.span, "cat_expr_unadjusted Errd");
570566
}
571567
}
572568
}
@@ -583,11 +579,7 @@ fn visit_expr(rcx: &mut Rcx, expr: &ast::Expr) {
583579
}
584580
Err(..) => {
585581
let tcx = rcx.fcx.tcx();
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-
}
582+
tcx.sess.delay_span_bug(expr.span, "cat_expr Errd");
591583
}
592584
}
593585

branches/stable/src/libsyntax/ast.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ 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-
}
9892
}
9993

10094
impl fmt::Debug for Ident {

0 commit comments

Comments
 (0)