diff options
| author | bors <bors@rust-lang.org> | 2019-07-12 23:37:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-07-12 23:37:39 +0000 |
| commit | e13fe7ff5e482b626714ac6ec41b8d44e7c22ed1 (patch) | |
| tree | a060f5b049425798bdf7dc8470ae34c4e7e5b22b /src/libsyntax | |
| parent | 71f9384e3bec467158a628e2d11e77ffada16a90 (diff) | |
| parent | fe4e32a4e655846976475ef0a7dc5837eab796fe (diff) | |
| download | rust-e13fe7ff5e482b626714ac6ec41b8d44e7c22ed1.tar.gz rust-e13fe7ff5e482b626714ac6ec41b8d44e7c22ed1.zip | |
Auto merge of #62635 - Centril:rollup-potvfnk, r=Centril
Rollup of 12 pull requests Successful merges: - #61535 (Coherence test when a generic type param has a default value from an associated type) - #62274 (rustc_mir: follow FalseUnwind's real_target edge in qualify_consts.) - #62431 (Add messages to `Option`'s and `Result`'s `must_use` annotation for `is_*`) - #62453 (in which we suggest anonymizing single-use lifetimes in paths ) - #62568 (Replace unsafe_destructor_blind_to_params with may_dangle) - #62578 (Add test for #49919) - #62595 (Document that the crate keyword refers to the project root) - #62599 (move mem::uninitialized deprecation back by 1 release, to 1.39) - #62605 (Emit dropped unemitted errors to aid in ICE debugging) - #62607 (Correctly break out of recovery loop) - #62608 (`async unsafe fn` tests) - #62623 (downgrade indirect_structural_match lint to allow) Failed merges: r? @ghost
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 14 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 18 | ||||
| -rw-r--r-- | src/libsyntax/util/parser_testing.rs | 6 |
3 files changed, 15 insertions, 23 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 84a012f03c9..e3628d908fb 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -199,9 +199,6 @@ declare_features! ( // no-tracking-issue-end - // Allows using `#[unsafe_destructor_blind_to_params]` (RFC 1238). - (active, dropck_parametricity, "1.3.0", Some(28498), None), - // no-tracking-issue-start // Allows using `#[omit_gdb_pretty_printer_section]`. @@ -641,6 +638,8 @@ declare_features! ( (removed, extern_in_paths, "1.33.0", Some(55600), None, Some("subsumed by `::foo::bar` paths")), (removed, quote, "1.33.0", Some(29601), None, None), + // Allows using `#[unsafe_destructor_blind_to_params]` (RFC 1238). + (removed, dropck_parametricity, "1.38.0", Some(28498), None, None), // ------------------------------------------------------------------------- // feature-group-end: removed features @@ -1447,15 +1446,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ cfg_fn!(omit_gdb_pretty_printer_section) ) ), - (sym::unsafe_destructor_blind_to_params, - Normal, - template!(Word), - Gated(Stability::Deprecated("https://github.com/rust-lang/rust/issues/34761", - Some("replace this attribute with `#[may_dangle]`")), - sym::dropck_parametricity, - "unsafe_destructor_blind_to_params has been replaced by \ - may_dangle and will be removed in the future", - cfg_fn!(dropck_parametricity))), (sym::may_dangle, Normal, template!(Word), diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 83dbff6b2d5..e0633f73ac4 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4629,6 +4629,9 @@ impl<'a> Parser<'a> { fn parse_block_tail(&mut self, lo: Span, s: BlockCheckMode) -> PResult<'a, P<Block>> { let mut stmts = vec![]; while !self.eat(&token::CloseDelim(token::Brace)) { + if self.token == token::Eof { + break; + } let stmt = match self.parse_full_stmt(false) { Err(mut err) => { err.emit(); @@ -4643,8 +4646,6 @@ impl<'a> Parser<'a> { }; if let Some(stmt) = stmt { stmts.push(stmt); - } else if self.token == token::Eof { - break; } else { // Found only `;` or `}`. continue; @@ -6666,12 +6667,13 @@ impl<'a> Parser<'a> { } /// Reads a module from a source file. - fn eval_src_mod(&mut self, - path: PathBuf, - directory_ownership: DirectoryOwnership, - name: String, - id_sp: Span) - -> PResult<'a, (ast::Mod, Vec<Attribute> )> { + fn eval_src_mod( + &mut self, + path: PathBuf, + directory_ownership: DirectoryOwnership, + name: String, + id_sp: Span, + ) -> PResult<'a, (ast::Mod, Vec<Attribute>)> { let mut included_mod_stack = self.sess.included_mod_stack.borrow_mut(); if let Some(i) = included_mod_stack.iter().position(|p| *p == path) { let mut err = String::from("circular modules: "); diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs index f850960624c..2ef32d37d44 100644 --- a/src/libsyntax/util/parser_testing.rs +++ b/src/libsyntax/util/parser_testing.rs @@ -34,7 +34,7 @@ fn with_error_checking_parse<'a, T, F>(s: String, ps: &'a ParseSess, f: F) -> T } /// Parse a string, return a crate. -pub fn string_to_crate (source_str : String) -> ast::Crate { +pub fn string_to_crate(source_str : String) -> ast::Crate { let ps = ParseSess::new(FilePathMapping::empty()); with_error_checking_parse(source_str, &ps, |p| { p.parse_crate_mod() @@ -42,7 +42,7 @@ pub fn string_to_crate (source_str : String) -> ast::Crate { } /// Parse a string, return an expr -pub fn string_to_expr (source_str : String) -> P<ast::Expr> { +pub fn string_to_expr(source_str : String) -> P<ast::Expr> { let ps = ParseSess::new(FilePathMapping::empty()); with_error_checking_parse(source_str, &ps, |p| { p.parse_expr() @@ -50,7 +50,7 @@ pub fn string_to_expr (source_str : String) -> P<ast::Expr> { } /// Parse a string, return an item -pub fn string_to_item (source_str : String) -> Option<P<ast::Item>> { +pub fn string_to_item(source_str : String) -> Option<P<ast::Item>> { let ps = ParseSess::new(FilePathMapping::empty()); with_error_checking_parse(source_str, &ps, |p| { p.parse_item() |
