Skip to content
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

Rollup of 9 pull requests #65804

Merged
merged 26 commits into from
Oct 25, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ff1860a
Fix the start/end byte positions in the compiler JSON output
Rantanen Oct 3, 2019
0b5ee56
PlaceElem<'tcx> should be Copy
spastorino Oct 11, 2019
2705412
Move as_local impl to from Place to PlaceRef
spastorino Oct 21, 2019
c787fe3
Fix check of `statx`
oxalica Oct 22, 2019
190802c
Pattern match over PlaceRef rather than Place
spastorino Oct 20, 2019
a19aed2
Add intern table for `List<PlaceElem<'tcx>>`
spastorino Oct 11, 2019
d32c286
Intern place projection
spastorino Oct 20, 2019
180fc41
Move Place::elem methods and friends to TyCtxt
spastorino Oct 21, 2019
5f5903d
Add ignore-tidy-filelength on ty/context
spastorino Oct 22, 2019
10f1bc7
Some tweaks
oxalica Oct 22, 2019
18ae175
Prevent unnecessary allocation in PathBuf::set_extension.
m-ou-se Oct 23, 2019
01a1bcb
Fix default "disable-shortcuts" feature value
GuillaumeGomez Oct 23, 2019
d7f6ba8
move panictry! to where it is used.
Centril Oct 11, 2019
0a5b38f
move Attribute::with_desugared_doc to librustdoc
Centril Oct 11, 2019
5ff7349
move report_invalid_macro_expansion_item to item.rs
Centril Oct 25, 2019
e0590ea
RFC 2008: Stabilization
davidtwco Sep 20, 2019
9e3e3a4
with_desugared_doc: correctly refer to `attr` instead of `self`
Centril Oct 25, 2019
959b6e3
Rollup merge of #64639 - davidtwco:rfc-2008-stabilization, r=Centril
Centril Oct 25, 2019
1f93be1
Rollup merge of #65074 - Rantanen:json-byte-pos, r=matklad
Centril Oct 25, 2019
8bb039f
Rollup merge of #65315 - spastorino:intern-place-projection, r=oli-obk
Centril Oct 25, 2019
f1d747a
Rollup merge of #65685 - oxalica:statx-eperm, r=alexcrichton
Centril Oct 25, 2019
3e3f21c
Rollup merge of #65731 - fusion-engineering-forks:set-extension, r=dt…
Centril Oct 25, 2019
07b5c2a
Rollup merge of #65740 - GuillaumeGomez:fix-disable-shortcut-feature,…
Centril Oct 25, 2019
0bfe483
Rollup merge of #65787 - Centril:panictry, r=davidtwco
Centril Oct 25, 2019
cbcbba2
Rollup merge of #65789 - Centril:with-desugared-doc, r=davidtwco
Centril Oct 25, 2019
c0bbb4b
Rollup merge of #65790 - Centril:move-report-invalid, r=davidtwco
Centril Oct 25, 2019
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
19 changes: 0 additions & 19 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1368,25 +1368,6 @@ impl<'a> Parser<'a> {
}
}
}

fn report_invalid_macro_expansion_item(&self) {
self.struct_span_err(
self.prev_span,
"macros that expand to items must be delimited with braces or followed by a semicolon",
).multipart_suggestion(
"change the delimiters to curly braces",
vec![
(self.prev_span.with_hi(self.prev_span.lo() + BytePos(1)), String::from(" {")),
(self.prev_span.with_lo(self.prev_span.hi() - BytePos(1)), '}'.to_string()),
],
Applicability::MaybeIncorrect,
).span_suggestion(
self.sess.source_map().next_point(self.prev_span),
"add a semicolon",
';'.to_string(),
Applicability::MaybeIncorrect,
).emit();
}
}

pub fn emit_unclosed_delims(unclosed_delims: &mut Vec<UnmatchedBrace>, handler: &errors::Handler) {
Expand Down
20 changes: 20 additions & 0 deletions src/libsyntax/parse/parser/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use log::debug;
use std::mem;
use rustc_target::spec::abi::Abi;
use errors::{Applicability, DiagnosticBuilder, DiagnosticId, StashKey};
use syntax_pos::BytePos;

/// Whether the type alias or associated type is a concrete type or an opaque type.
#[derive(Debug)]
Expand Down Expand Up @@ -1739,6 +1740,25 @@ impl<'a> Parser<'a> {
}
}

fn report_invalid_macro_expansion_item(&self) {
self.struct_span_err(
self.prev_span,
"macros that expand to items must be delimited with braces or followed by a semicolon",
).multipart_suggestion(
"change the delimiters to curly braces",
vec![
(self.prev_span.with_hi(self.prev_span.lo() + BytePos(1)), String::from(" {")),
(self.prev_span.with_lo(self.prev_span.hi() - BytePos(1)), '}'.to_string()),
],
Applicability::MaybeIncorrect,
).span_suggestion(
self.sess.source_map().next_point(self.prev_span),
"add a semicolon",
';'.to_string(),
Applicability::MaybeIncorrect,
).emit();
}

fn mk_item(&self, span: Span, ident: Ident, kind: ItemKind, vis: Visibility,
attrs: Vec<Attribute>) -> P<Item> {
P(Item {
Expand Down