about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2017-11-01Rollup merge of #45644 - zackmdavis:edit_disallowed_inner_attr_note, r=estebankkennytm-5/+4
edit and fix bad spacing of inner-attribute-not-allowed note This multiline string literal was missing a backslash, leaving an awkward newline and 35 spaces in the middle of the message. But while we're here, the existing message seems kind of long in comparison to similar notes: to cut it down, we excise the mentions of doc comments, which seems sensible because we know that this erroneous attribute is not a doc comment (notice the `is_sugared_doc: false` at the end of the function; if it had been a doc comment, that error would get set in the `token::DocComment` match branch of `parse_outer_attributes`).
2017-11-01Rollup merge of #45579 - ↵kennytm-1/+3
leodasvacas:document-that-call-can-be-adt-constructor, r=estebank Document that call expressions also represent ADT constructors. This is a rather obscure part of the language.
2017-10-31Formatting tweak.laurent-2/+1
2017-10-31Add some missing spaces.laurent-1/+1
2017-10-31Fix spans and error messages.laurent-13/+6
2017-10-30edit and fix bad spacing of inner-attribute-not-allowed noteZack M. Davis-5/+4
This multiline string literal was missing a backslash, leaving an awkward newline and 35 spaces in the middle of the message. But while we're here, the existing message seems kind of long in comparison to similar notes: to cut it down, we excise the mentions of doc comments, which seems sensible because we know that this erroneous attribute is not a doc comment (notice the `is_sugared_doc: false` at the end of the function; if it had been a doc comment, that error would get set in the `token::DocComment` match branch of `parse_outer_attributes`).
2017-10-30Add a nicer error message for missing in for loop, fixes #40782.laurent-6/+48
2017-10-28Auto merge of #45489 - oli-obk:json_diagnostics, r=petrochenkovbors-17/+9
Fix a quadradic duplication in json for multi-suggestions r? @petrochenkov
2017-10-28Auto merge of #44295 - plietar:extern-types, r=arielb1bors-8/+55
Implement RFC 1861: Extern types A few notes : - Type parameters are not supported. This was an unresolved question from the RFC. It is not clear how useful this feature is, and how variance should be treated. This can be added in a future PR. - `size_of_val` / `align_of_val` can be called with extern types, and respectively return 0 and 1. This differs from the RFC, which specified that they should panic, but after discussion with @eddyb on IRC this seems like a better solution. If/when a `DynSized` trait is added, this will be disallowed statically. - Auto traits are not implemented by default, since the contents of extern types is unknown. This means extern types are `!Sync`, `!Send` and `!Freeze`. This seems like the correct behaviour to me. Manual `unsafe impl Sync for Foo` is still possible. - This PR allows extern type to be used as the tail of a struct, as described by the RFC : ```rust extern { type OpaqueTail; } #[repr(C)] struct FfiStruct { data: u8, more_data: u32, tail: OpaqueTail, } ``` However this is undesirable, as the alignment of `tail` is unknown (the current PR assumes an alignment of 1). Unfortunately we can't prevent it in the general case as the tail could be a type parameter : ```rust #[repr(C)] struct FfiStruct<T: ?Sized> { data: u8, more_data: u32, tail: T, } ``` Adding a `DynSized` trait would solve this as well, by requiring tail fields to be bound by it. - Despite being unsized, pointers to extern types are thin and can be casted from/to integers. However it is not possible to write a `null<T>() -> *const T` function which works with extern types, as I've explained here : https://github.com/rust-lang/rust/issues/43467#issuecomment-321678621 - Trait objects cannot be built from extern types. I intend to support it eventually, although how this interacts with `DynSized`/`size_of_val` is still unclear. - The definition of `c_void` is unmodified
2017-10-28Auto merge of #45503 - thombles:tk/i44339-v5, r=petrochenkovbors-1/+27
Improve diagnostics when list of tokens has incorrect separators Make `parse_seq_to_before_tokens` more resilient to error conditions. Where possible it is better if it can consume up to the final bracket before returning. This change improves the diagnostics in a couple of situations: ``` struct S(pub () ()); // omitted separator use std::{foo. bar}; // used a similar but wrong separator ``` Fixes #44339 r? @petrochenkov
2017-10-27Implement RFC 1861: Extern typesPaul Lietar-8/+55
2017-10-27Document that call expressions also represent ADT constructors.leonardo.yvens-1/+3
This is a rather obscure part of the language.
2017-10-26Auto merge of #45464 - sinkuu:ice_44851, r=jseyfriedbors-1/+30
Visit attribute tokens in `DefCollector` and `BuildReducedGraphVisitor` Fixes #44851.
2017-10-26Add FIXMEsinkuu-0/+1
2017-10-25Auto merge of #44636 - GuillaumeGomez:little-error-msg, r=michaelwoeristerbors-2/+5
Add short error message-format Fixes #42653.
2017-10-25incr.comp.: Implement query diagnostic persistence.Michael Woerister-0/+37
2017-10-24Reduce the repetition in json error outputOliver Schneider-17/+9
2017-10-25Improve recovery after unexpected tokens parsing sequenceThomas Karpiniec-1/+27
2017-10-24Auto merge of #45401 - zackmdavis:crate_shorthand_visibility_modifier, ↵bors-4/+31
r=nikomatsakis `crate` shorthand visibility modifier cc #45388. r? @nikomatsakis
2017-10-24Auto merge of #44766 - sunjay:lift_generics, r=nikomatsakisbors-32/+38
Move Generics from MethodSig to TraitItem and ImplItem As part of `rust-impl-period/WG-compiler-traits`, we want to "lift" `Generics` from `MethodSig` into `TraitItem` and `ImplItem`. This is in preparation for adding associated type generics. (https://github.com/rust-lang/rust/issues/44265#issuecomment-331172238) Currently this change is only made in the AST. In the future, it may also impact the HIR. (Still discussing) To understand this PR, it's probably best to start from the changes to `ast.rs` and then work your way to the other files to understand the far reaching effects of this change. r? @nikomatsakis
2017-10-23Fix #44851 by visiting tokens in `DefCollector` and `BuildReducedGraphVisitor`sinkuu-1/+29
2017-10-22`crate` shorthand visibility modifierZack M. Davis-4/+31
With regrets, this breaks rustfmt and rls. This is in the matter of #45388.
2017-10-20Add short message-formatGuillaume Gomez-2/+5
2017-10-19Auto merge of #45232 - zackmdavis:moar_lint_suggestions, r=estebankbors-0/+11
code suggestions for non-shorthand field pattern, no-mangle lints continuing in the spirit of #44942 ![moar_lint_suggestions](https://user-images.githubusercontent.com/1076988/31485011-3b20cc80-aee7-11e7-993d-81267ab77732.png) r? @estebank
2017-10-17Removed Generics from FnKind::ItemFn in libsyntaxSunjay Varma-6/+6
2017-10-17Fixed tidy errorsSunjay Varma-2/+4
2017-10-17Lifting Generics from MethodSig to TraitItem and ImplItem since we want to ↵Sunjay Varma-26/+30
support generics in each variant of TraitItem and ImplItem
2017-10-16code suggestion for non-shorthand field patterns lintZack M. Davis-0/+11
We also edit the lint description to clarify that this is different from the struct field init shorthand.
2017-10-15don't issue "expected statement after outer attr." after inner attr.Zack M. Davis-2/+2
While an inner attribute here is in fact erroneous, that error ("inner attribute is not permitted in this context") successfully gets set earlier; this further admonition is nonsensical. Resolves #45296.
2017-10-14Implement `dyn Trait` syntaxVadim Petrochenkov-32/+67
2017-10-13Rollup merge of #45178 - Badel2:comma-after-struct, r=petrochenkovkennytm-0/+11
Better error message for comma after base struct #41834 This adds a better error for commas after the base struct: ``` let foo = Foo { one: 111, ..Foo::default(), // This comma is a syntax error }; ``` The current error is a generic `expected one of ...` which isn't beginner-friendly. My error looks like this: ``` error: cannot use a comma after the base struct --> tmp/example.rs:26:9 | 26 | ..Foo::default(), | ^^^^^^^^^^^^^^^^- help: remove this comma | = note: the base struct expansion must always be the last field ``` I even added a note for people who don't know why this isn't allowed.
2017-10-13Rollup merge of #45122 - jean-lourenco:master, r=nikomatsakiskennytm-0/+1
Better compile error output when using arguments instead of types Following @estebank sugestion on issue https://github.com/rust-lang/rust/issues/18945#issuecomment-331251436
2017-10-13Fix typo in libsyntax/parse/lexer/unicode_chars.rskennytm-1/+1
` (U+0060) should be the "grave" accent, not "Greek" accent.
2017-10-10output compiler message updatedJean Lourenço-0/+1
output message is shown in another 'help:' block line with +100 columns formatted test adjusted
2017-10-11Add error for comma after base struct fieldBadel2-0/+11
`let x = { ..default(), } // This comma is an error`
2017-10-09Fix a bug in diagnostics for `x as usize < y`Vadim Petrochenkov-3/+16
Improve diagnostics for `x as usize << y`
2017-10-08Rollup merge of #45060 - topecongiro:semi-in-local-span, r=petrochenkovkennytm-1/+6
Add a semicolon to span for ast::Local
2017-10-06implement pattern-binding-modes RFCTobias Schottdorf-0/+3
See the [RFC] and [tracking issue]. [tracking issue]: https://github.com/rust-lang/rust/issues/42640 [RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
2017-10-06Add a semicolon to span for ast::LocalSeiichi Uchida-1/+6
2017-10-05Auto merge of #44943 - nivkner:fixme_fixup, r=dtolnaybors-2/+0
address some FIXME whose associated issues were marked as closed part of #44366
2017-10-05Rollup merge of #45024 - QuietMisdreavus:doc-masked-issue-num, r=pnkfelixkennytm-1/+1
add the issue number to doc_masked's feature gate Whoops, missed this in the original `#[doc(masked)]` PR.
2017-10-05Rollup merge of #44972 - durka:patch-44, r=arielb1kennytm-1/+1
fix ItemKind::DefaultImpl doc comment Upgrade comment to doc comment. ...Is this actually used? If so, why does the `Impl` variant right below have a `Defaultness`?
2017-10-05Auto merge of #44940 - philipc:remap-path, r=michaelwoeristerbors-9/+25
Don't use remapped path when loading modules and include files Fixes bug reported in https://github.com/rust-lang/rust/issues/41555#issuecomment-327866056. cc @michaelwoerister
2017-10-04add the issue number to doc_masked's feature gateQuietMisdreavus-1/+1
2017-10-03Rename FileMap::path and change to an OptionPhilip Craig-10/+16
2017-10-02fix comment on DefaultImplAlex Burka-2/+2
2017-10-02fix ItemKind::DefaultImpl doc commentAlex Burka-2/+2
Upgrade comment to doc comment.
2017-09-30code suggestion for deprecated-attribute lintZack M. Davis-1/+2
Also, fix the deprecation message for the late no-debug feature.
2017-09-30remove "refinement on pat" FIXMENiv Kaminer-1/+0
2017-09-30address some `FIXME`s whose associated issues were marked as closedNiv Kaminer-2/+1
remove FIXME(#13101) since `assert_receiver_is_total_eq` stays. remove FIXME(#19649) now that stability markers render. remove FIXME(#13642) now the benchmarks were moved. remove FIXME(#6220) now that floating points can be formatted. remove FIXME(#18248) and write tests for `Rc<str>` and `Rc<[u8]>` remove reference to irelevent issues in FIXME(#1697, #2178...) update FIXME(#5516) to point to getopts issue 7 update FIXME(#7771) to point to RFC 628 update FIXME(#19839) to point to issue 26925