8000 Rollup of 7 pull requests by Centril · Pull Request #69761 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 7 pull requests #69761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7859f0e
Make PlaceRef lifetimes of Place::as_ref be both 'tcx
spastorino Mar 3, 2020
812e62f
Make PlaceRef lifetimes of LocalAnalyzer::process_place be both 'tcx
spastorino Mar 3, 2020
d3e5177
Use .next() instead of .nth(0) on iterators.
matthiaskrgr Mar 3, 2020
98c7ed6
DefKind::Method -> DefKind::AssocFn
mark-i-m Mar 3, 2020
3aeb9f0
rename TraitItemKind::Method -> Fn
mark-i-m Mar 3, 2020
1a1dcfa
Make PlaceRef lifetimes of codegen_place be both 'tcx
spastorino Mar 3, 2020
2af5e87
Make PlaceRef lifetimes of monomorphized_place_ty be both 'tcx
spastorino Mar 3, 2020
a20d54f
Make PlaceRef lifetimes of RootPlace be both 'tcx
spastorino Mar 3, 2020
842af36
Make PlaceRef lifetimes of borrow_conflict_place be both 'tcx
spastorino Mar 4, 2020
f54e863
Make PlaceRef lifetimes of move_error_reported be both 'tcx
spastorino Mar 4, 2020
6200f5c
Make PlaceRef lifetimes of uninitialized_error_reported be both 'tcx
spastorino Mar 4, 2020
e32ee55
Make PlaceRef lifetimes of move_path_closest_to be both 'tcx
spastorino Mar 4, 2020
634a167
Make PlaceRef lifetimes of move_path_for_place be both 'tcx
spastorino Mar 4, 2020
53be0cc
Use subslice patterns in slice methods
cuviper Mar 4, 2020
8000
81f435d
On mismatched delimiters, only point at empty blocks that are in the …
estebank Mar 3, 2020
c6f1244
Make PlaceRef lifetimes of is_upvar_field_projection be both 'tcx
spastorino Mar 4, 2020
6f23650
Make PlaceRef lifetimes of add_moved_or_invoked_closure_note be both …
spastorino Mar 4, 2020
eb67eca
Make PlaceRef lifetimes of describe_field be both 'tcx
spastorino Mar 4, 2020
a30f55f
Make PlaceRef lifetimes of borrowed_content_source be both 'tcx
spastorino Mar 4, 2020
bd4dad4
Make PlaceRef lifetimes of move_spans be both 'tcx
spastorino Mar 4, 2020
46d85e5
Make PlaceRef lifetimes of closure_span be both 'tcx
spastorino Mar 4, 2020
a32afa3
Make PlaceRef lifetimes of classify_drop_access_kind be both 'tcx
spastorino Mar 4, 2020
a5d1e18
Make PlaceRef lifetimes of is_prefix_of be both 'tcx
spastorino Mar 4, 2020
2cb2559
Make PlaceRef lifetimes of in_projection be both 'tcx
spastorino Mar 4, 2020
b11cd0b
PlaceRef<'a, 'tcx> -> PlaceRef<'tcx>
spastorino Mar 4, 2020
8efb9eb
Avoid using `unwrap()` in suggestions
JohnTitor Mar 5, 2020
9712fa4
Fix #69191
pnkfelix Mar 6, 2020
40809b0
Add FIXME
oli-obk Mar 6, 2020
4c46d7c
Rollup merge of #69656 - matthiaskrgr:iter_nth_zero, r=oli-obk
Centril Mar 6, 2020
ed6ecf6
Rollup merge of #69674 - mark-i-m:assoc-fn, r=Centril
Centril Mar 6, 2020
d97d99f
Rollup merge of #69706 - cuviper:subslice-methods, r=Centril
Centril Mar 6, 2020
639e449
Rollup merge of #69708 - estebank:tiny, r=petrochenkov
Centril Mar 6, 2020
f8ef050
Rollup merge of #69714 - spastorino:place-ref-lifetime, r=oli-obk
Centril Mar 6, 2020
1ca96e2
Rollup merge of #69727 - JohnTitor:sugg-unwrap, r=estebank
Centril Mar 6, 2020
469ab17
Rollup merge of #69753 - pnkfelix:issue-69191-ice-on-uninhabited-enum…
Centril Mar 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
On mismatched delimiters, only point at empty blocks that are in the …
…same line
  • Loading branch information
estebank committed Mar 4, 2020
commit 81f435dd37c5ec828b621d37ec15bf41a33ff89a
7 changes: 6 additions & 1 deletion src/librustc_parse/lexer/tokentrees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ struct TokenTreesReader<'a> {
/// Used only for error recovery when arriving to EOF with mismatched braces.
matching_delim_spans: Vec<(token::DelimToken, Span, Span)>,
last_unclosed_found_span: Option<Span>,
/// Collect empty block spans that might have been auto-inserted by editors.
last_delim_empty_block_spans: FxHashMap<token::DelimToken, Span>,
}

Expand Down Expand Up @@ -138,7 +139,11 @@ impl<'a> TokenTreesReader<'a> {

if tts.is_empty() {
let empty_block_span = open_brace_span.to(close_brace_span);
self.last_delim_empty_block_spans.insert(delim, empty_block_span);
if !sm.is_multiline(empty_block_span) {
// Only track if the block is in the form of `{}`, otherwise it is
// likely that it was written on purpose.
self.last_delim_empty_block_spans.insert(delim, empty_block_span);
}
}

if self.open_braces.is_empty() {
Expand Down
10 changes: 2 additions & 8 deletions src/test/ui/parser/mismatched-delim-brace-empty-block.stderr
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
error: unexpected closing delimiter: `}`
--> $DIR/mismatched-delim-brace-empty-block.rs:5:1
|
LL | fn main() {
| ___________-
LL | |
LL | | }
| |_- this block is empty, you might have not meant to close it
LL | let _ = ();
LL | }
| ^ unexpected closing delimiter
LL | }
| ^ unexpected closing delimiter

error: aborting due to previous error

0