about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-05-25Reword malformed attribute input diagnosticsEsteban Küber-12/+74
- Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error - Use consistend error message: "malformed `attrname` attribute input" - Provide suggestions when possible - Move note/help to label/suggestion - Use consistent wording "ill-formed" -> "malformed" - Move diagnostic logic out of parser
2019-05-24Revert changes that belong to separate PREsteban Küber-18/+4
2019-05-24Move diagnostic logic out of parserEsteban Küber-19/+20
2019-05-24Fix rebaseEsteban Küber-4/+6
2019-05-24review commentsEsteban Küber-63/+70
2019-05-24Tweak macro parse errors when reaching EOF during macro call parseEsteban Küber-44/+105
- Add detail on origin of current parser when reaching EOF and stop saying "found <eof>" and point at the end of macro calls - Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error
2019-05-24Auto merge of #60803 - varkor:remove-in-place-syntax, r=petrochenkovbors-47/+4
Remove `ObsoleteInPlace` The in place syntax has been deprecated for over a year. As it is, this is accumulated cruft: the error messages are unlikely to be helpful any more and it conflicts with some useful syntax (e.g. const generics in some instances). It may be that removing `Token::LArrow` is backwards-incompatible. We should do a crater run to check. cc @eddyb
2019-05-24Auto merge of #60984 - matthewjasper:borrowck-error-reporting-cleanup, ↵bors-4/+5
r=pnkfelix Borrowck error reporting cleanup * Don't show variables created by desugarings in borrowck errors * Move "conflict error" reporting to it's own module, so that `error_reporting` contains only common error reporting methods. * Remove unused `ScopeTree` parameter. r? @pnkfelix
2019-05-24Remove `ObsoleteInPlace`varkor-47/+4
2019-05-24Rollup merge of #61056 - euclio:custom-discriminant-error, r=estebankMazdak Farrokhzad-16/+45
tweak discriminant on non-nullary enum diagnostic Adds notes pointing at the non-nullary variants, and uses "custom discriminant" language to be consistent with the Reference. Fixes #61039. r? @estebank
2019-05-23tweak discriminant on non-nullary enum diagnosticAndy Russell-16/+45
Adds notes pointing at the non-nullary variants, and uses "custom discriminant" language to be consistent with the Reference.
2019-05-23Auto merge of #60965 - petrochenkov:lit3, r=matkladbors-441/+435
syntax: Continue refactoring literals A follow up to https://github.com/rust-lang/rust/pull/60679. https://github.com/rust-lang/rust/commit/a2fd002bd5a91ba7997057724b72b9dac8fae550: Similarly to `EscapeError`, literal parsing now produces a `LitError`. This way we can get rid of `diag: Option<(Span, &Handler)>` in interfaces while leaving attr/mod alone. https://github.com/rust-lang/rust/commit/d9516d11208456d4a17fe68a34c1d0a00334e62c: Gathers all components of a literal token in a single struct.
2019-05-23syntax: Some code cleanupVadim Petrochenkov-212/+157
2019-05-23syntax: Turn `token::Lit` into a structVadim Petrochenkov-197/+216
2019-05-23syntax: Remove an obsolete hack from literal comparisonsVadim Petrochenkov-9/+1
2019-05-23syntax: Fix spans for boolean literals passed to proc macrosVadim Petrochenkov-5/+5
2019-05-23syntax: More consistent wording for some literal parsing errorsVadim Petrochenkov-2/+2
2019-05-23syntax: Return named errors from literal parsing functionsVadim Petrochenkov-128/+166
2019-05-23Auto merge of #61075 - Centril:rollup-1ugmcqu, r=Centrilbors-10/+14
Rollup of 7 pull requests Successful merges: - #60981 (Bump compiler-builtins to 0.1.15) - #61014 (Make -Zemit-artifact-notifications also emit the artifact type) - #61043 (Disable LLVM/debug assertions in gnu-full-bootstrap) - #61046 (Fix ICE with inconsistent macro matchers) - #61055 (Solaris CI: Build with dilos2 stable) - #61057 (Revert "Add implementations of last in terms of next_back on a bunch of DoubleEndedIterators.") - #61073 (librustc_errors: Remove unused annotation style `OldSchoolNoteText`) Failed merges: r? @ghost
2019-05-23Rollup merge of #61046 - mark-i-m:transcribe-fix, r=petrochenkovMazdak Farrokhzad-8/+10
Fix ICE with inconsistent macro matchers Fixes #61033 r? @petrochenkov
2019-05-23Rollup merge of #61014 - jsgf:emit-artifact-type, r=alexcrichtonMazdak Farrokhzad-2/+4
Make -Zemit-artifact-notifications also emit the artifact type This is easier for tooling to handle than trying to reverse-engineer the type from the filename extension. The field name and value is intended to reflect the `--emit` command-line option. Related issues https://github.com/rust-lang/rust/issues/60988 https://github.com/rust-lang/rust/issues/58465 cc @alexcrichton
2019-05-23Auto merge of #60174 - matthewjasper:add-match-arm-scopes, r=pnkfelixbors-2/+12
Add match arm scopes and other scope fixes * Add drop and lint scopes for match arms. * Lint attributes are now respected on match arms. * Make sure we emit a StorageDead if we diverge when initializing a temporary. * Adjust MIR pretty printing of scopes for locals. * Don't generate duplicate lint scopes for `let statements`. * Add some previously missing fake borrows for matches. closes #46525 cc @rust-lang/compiler
2019-05-23Auto merge of #60740 - petrochenkov:kw, r=nnethercotebors-316/+314
Simplify use of keyword symbols They mirror non-keyword symbols now (see https://github.com/rust-lang/rust/pull/60630). `keywords::MyKeyword.name()` -> `kw::MyKeyword` `keywords::MyKeyword.ident()` -> `Ident::with_empty_ctxt(kw::MyKeyword)` (not common) `keywords::Invalid.ident()` -> `Ident::invalid()` (more common) Keywords are simply `Symbol` constants now, the `Keyword` struct is eliminated. This means `kw::MyKeyword` can now be used in `match` in particular.
2019-05-22Restore the old behavior of the rustdoc keyword check + Fix rebaseVadim Petrochenkov-19/+18
2019-05-22Eliminate unnecessary `Ident::with_empty_ctxt`sVadim Petrochenkov-22/+18
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-299/+302
2019-05-22these errors can happen after allMark Mansi-8/+10
2019-05-22Allow null-pointer-optimized enums in FFI if their underlying representation ↵Michael Bradshaw-0/+7
is FFI safe This allows types like Option<NonZeroU8> to be used in FFI without triggering the improper_ctypes lint. This works by changing the is_repr_nullable_ptr function to consider an enum E to be FFI-safe if: - E has no explicit #[repr(...)]. - It only has two variants. - One of those variants is empty (meaning it has no fields). - The other variant has only one field. - That field is one of the following: - &T - &mut T - extern "C" fn - core::num::NonZero* - core::ptr::NonNull<T> - #[repr(transparent)] struct wrapper around one of the types in this list. - The size of E and its field are both known and are both the same size (implying E is participating in the nonnull optimization).
2019-05-22Auto merge of #59445 - alexreg:ban-multi-trait-objects-via-aliases, r=oli-obkbors-2/+2
Ban multi-trait objects via trait aliases Obviously, multi-trait objects are not normally supported, so they should not be supported via trait aliases. This has been factored out from the previous PR https://github.com/rust-lang/rust/pull/55994 (see point 1). r? @Centril CC @nikomatsakis ------------------ ### RELNOTES: We now allow `dyn Send + fmt::Debug` with equivalent semantics to `dyn fmt::Debug + Send`. That is, the order of the mentioned traits does not matter wrt. principal/not-principal traits. This is a small change that might deserve a mention in the blog post because it is a language change but most likely not. See https://github.com/rust-lang/rust/blob/ce2ee305f9165c037ecddddb5792588a15ff6c37/src/test/ui/traits/wf-trait-object-reverse-order.rs. // @Centril
2019-05-22Rollup merge of #60995 - topecongiro:parser-from-stream-and-base-dir, ↵Mazdak Farrokhzad-0/+17
r=michaelwoerister Add stream_to_parser_with_base_dir This PR adds `stream_to_parser_with_base_dir`, which creates a parser from a token stream and a base directory. Context: I would like to parse `cfg_if!` macro and get a list of modules defined inside it from rustfmt so that rustfmt can format those modules (cc https://github.com/rust-lang/rustfmt/issues/3253). To do so, I need to create a parser from `TokenStream` and set the directory of `Parser` to the same directory as the parent directory of a file which contains `cfg_if!` invocation. AFAIK there is no way to achieve this, and hence this PR. Alternatively, I could change the visibility of `Parser.directory` from `crate` to `pub` so that the value can be modified after initializing a parser. I don't have a preference over either approach (or others, as long as it works).
2019-05-21Make -Zemit-artifact-notifications also emit the artifact typeJeremy Fitzhardinge-2/+4
This is easier for tooling to handle than trying to reverse-engineer it from the filename extension.
2019-05-21Dont show variables from desugarings in borrowck errorsMatthew Jasper-4/+5
2019-05-21Give match arms an HirId and a SpanMatthew Jasper-2/+12
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-72/+87
2019-05-21Fix tidy: remove a trailing whitespacetopecongiro-1/+1
2019-05-21Add doc commenttopecongiro-0/+10
2019-05-21Auto merge of #60903 - nnethercote:mv-gensyms-from-Symbol-to-Ident, ↵bors-27/+21
r=petrochenkov Move gensym operations from `Symbol` to `Ident` Gensyms are always at the `Ident` level, and long-term we probably want to record gensym-ness in hygiene data. r? @petrochenkov
2019-05-21Add stream_to_parser_with_base_dirtopecongiro-0/+7
2019-05-20Rollup merge of #60959 - petrochenkov:sassert, r=estebankMazdak Farrokhzad-7/+7
rustc: Improve type size assertions Now they - Tell what the new size is, when it changes - Do not require passing an identifier ``` ::: src\libsyntax\parse\token.rs:223:1 | 223 | static_assert_size!(Token, 123); | -------------------------------- in this macro invocation | = note: expected type `[(); 123]` found type `[(); 16]` ```
2019-05-20Rollup merge of #60823 - oli-obk:used_unused_no_mangle, r=michaelwoeristerMazdak Farrokhzad-1/+1
Fix incremental compilation of cdylib emitting spurious unused_attributes lint fixes #60050
2019-05-20Ban multi-trait objects via trait aliases.Alexander Regueiro-2/+2
2019-05-20Remove `Symbol::gensym()`.Nicholas Nethercote-15/+18
2019-05-20Eliminate `Symbol::gensymed`.Nicholas Nethercote-9/+4
2019-05-20Move `is_gensymed` from `Symbol` to `Ident`.Nicholas Nethercote-5/+1
Note that the `is_gensymed` call on `primitive_types` is unnecessary because that table only contains the name of primitive types (e.g. `i32`) and never contains gensyms.
2019-05-19Improve type size assertionsVadim Petrochenkov-7/+7
Now they - Tell what the new size is, when it changes - Do not require passing an identifier
2019-05-18Auto merge of #60910 - nnethercote:avoid-some-unnecessary-interning, ↵bors-18/+22
r=petrochenkov Avoid some unnecessary interning r? @petrochenkov
2019-05-17Rollup merge of #60901 - estebank:str-str-str, r=CentrilManish Goregaokar-2/+1
Handle more string addition cases with appropriate suggestions
2019-05-17Avoid unnecessary interning in `Ident::from_str()` calls.Nicholas Nethercote-18/+22
A lot of these static symbols are pre-interned.
2019-05-16Fix binop spanEsteban Küber-2/+1
2019-05-16review commentsEsteban Küber-26/+22