about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2018-05-16Auto merge of #50473 - petrochenkov:pmapi, r=alexcrichtonbors-210/+595
Review proc macro API 1.2 cc https://github.com/rust-lang/rust/issues/38356 Summary of applied changes: - Documentation for proc macro API 1.2 is expanded. - Renamed APIs: `Term` -> `Ident`, `TokenTree::Term` -> `TokenTree::Ident`, `Op` -> `Punct`, `TokenTree::Op` -> `TokenTree::Punct`, `Op::op` -> `Punct::as_char`. - Removed APIs: `Ident::as_str`, use `Display` impl for `Ident` instead. - New APIs (not stabilized in 1.2): `Ident::new_raw` for creating a raw identifier (I'm not sure `new_x` it's a very idiomatic name though). - Runtime changes: - `Punct::new` now ensures that the input `char` is a valid punctuation character in Rust. - `Ident::new` ensures that the input `str` is a valid identifier in Rust. - Lifetimes in proc macros are now represented as two joint tokens - `Punct('\'', Spacing::Joint)` and `Ident("lifetime_name_without_quote")` similarly to multi-character operators. - Stabilized APIs: None yet. A bit of motivation for renaming (although it was already stated in the review comments): - With my compiler frontend glasses on `Ident` is the single most appropriate name for this thing, *especially* if we are doing input validation on construction. `TokenTree::Ident` effectively wraps `token::Ident` or `ast::Ident + is_raw`, its meaning is "identifier" and it's already named `ident` in declarative macros. - Regarding `Punct`, the motivation is that `Op` is actively misleading. The thing doesn't mean an operator, it's neither a subset of operators (there is non-operator punctuation in the language), nor superset (operators can be multicharacter while this thing is always a single character). So I named it `Punct` (first proposed in [the original RFC](https://github.com/rust-lang/rfcs/pull/1566), then [by @SimonSapin](https://github.com/rust-lang/rust/issues/38356#issuecomment-276676526)) , together with input validation it's now a subset of ASCII punctuation character category (`u8::is_ascii_punctuation`).
2018-05-16Auto merge of #48557 - matthewjasper:allow-trvial-bounds, r=nikomatsakisbors-65/+1084
Implement RFC 2056 trivial constraints in where clauses This is an implementation of the new behaviour for #48214. Tests are mostly updated to show the effects of this. Feature gate hasn't been added yet. Some things that are worth noting and are maybe not want we want * `&mut T: Copy` doesn't allow as much as someone might expect because there is often an implicit reborrow. * ~There isn't a check that a where clause is well-formed any more, so `where Vec<str>: Debug` is now allowed (without a `str: Sized` bound).~ r? @nikomatsakis
2018-05-16Auto merge of #50795 - nrc:update, r=oli-obkbors-121/+69
Update RLS and Rustfmt Fixes RLS tests r? @alexcrichton
2018-05-16Auto merge of #50750 - est31:master, r=eddybbors-127/+48
Remove ScopeTarget and LoopIdResult * Remove ScopeTarget in preparation of label-break-value (PR #50045) * Replace LoopIdResult by Result which is possible now thanks to commit 8ac65af81f5f9cf6c5e2c2306705b50eed77cfb5 " Implement Encodable and Decodable for Result." r? @eddyb
2018-05-16Update RLS and RustfmtNick Cameron-121/+69
2018-05-16Auto merge of #50541 - QuietMisdreavus:rustdoc-errors, r=GuillaumeGomezbors-122/+144
rustdoc: replace most (e)println! statements with structured warnings/errors Turns out, the rustc diagnostic handler doesn't need a whole lot of setup that we weren't already doing. For errors that occur outside a "dealing with source code" context, we can just use the format/color config we were already parsing and make up a `Handler` that we can emit structured warnings/errors from. So i did that. This will make it way easier to test things with `rustdoc-ui` tests, since those require the JSON error output. (In fact, this PR is a yak shave for a different one where i was trying to do just that. `>_>`)
2018-05-15Auto merge of #48523 - varkor:generics-ty-generalisations, r=nikomatsakisbors-806/+966
The Great Generics Generalisation: Ty Edition Part of the generic parameter refactoring effort, split off from https://github.com/rust-lang/rust/pull/48149. Contains the `ty`-relative refactoring. r? @eddyb
2018-05-16Fix stability annotations for already stable bits of proc macro API 1.1Vadim Petrochenkov-48/+41
Remove unnecessary proc-macro-related `feature`s
2018-05-15Represent lifetimes as two joint tokens in proc macrosVadim Petrochenkov-21/+158
2018-05-15Make is_global true for latebound regionsMatthew Jasper-17/+28
2018-05-15Address feedback, remove remaining review comments, add some more docsVadim Petrochenkov-53/+30
2018-05-15proc_macro: Validate inputs to `Punct::new` and `Ident::new`Vadim Petrochenkov-22/+203
2018-05-15proc_macro: Properly support raw identifiersVadim Petrochenkov-14/+13
2018-05-15TokenTree: Op -> Punct, Term -> IdentVadim Petrochenkov-131/+115
2018-05-15Extend documentation and add review commentsVadim Petrochenkov-38/+152
2018-05-15Auto merge of #50767 - oli-obk:rls_clippy, r=kennytmbors-9/+0
Don't inject clippy into the rls anymore r? @kennytm sorry about breaking nightlies. The issue is that the `[patch.crates-io]` doesn't work if the versions differ. So every time we update clippy, we can only update it to the verison that rls is depending on. I'm disabling the injection of clippy into rls for now. I'm not sure how to do this properly. We could * add a version check, so rls only builds clippy if its dependency clippy is the same as the submodule clippy * do something crazy like auto-patching the Cargo.toml of the rls tool repo to just use a path dependency on clippy * build crates-io clippy instead of submodule clippy and gate clippy injection on that * that's somewhat automatic, and is essentially what is necessary right now, but done manually * make clippy 0.1.* instead of 0.0.* and update patch versions for nightly updates and minor version updates for `clippy_lints` api changes. * not sure how semver-great this is
2018-05-15One must always remember to clean up after themselvesvarkor-5/+6
2018-05-15Pattern match on Ok instead of Some of .ok() retvalest31-1/+1
2018-05-15Remove LoopIdResultest31-64/+19
It's redundant as Result already implements Encodable as well as Decodable.
2018-05-15Remove hir::ScopeTargetest31-85/+51
When we want to implement label-break-value, we can't really decide whether to emit ScopeTarget::Loop or ScopeTarget::Block in the code that is supposed to create it. So we get rid of it and reconstruct the information when needed.
2018-05-15Collapse Substs::identity_for_item in collectvarkor-3/+1
2018-05-15Clean up dropck_outlives PhantomData handlingvarkor-7/+4
2018-05-15Add mk_param_from_defvarkor-37/+24
2018-05-15Use Kind instead of UnpackedKind in Substs methodsvarkor-94/+75
2018-05-15Clean up shared subst codevarkor-144/+101
2018-05-15Refactor Substs methods on generic parametersvarkor-306/+393
2018-05-15Clean up generic param handlingvarkor-22/+35
2018-05-15Update bad-annotation error messagevarkor-2/+2
2018-05-15Refactoring generic counting loopsvarkor-67/+71
2018-05-15Review refactoringvarkor-52/+48
2018-05-15Rename param_counts to own_countsvarkor-35/+35
2018-05-15Remove GenericParamDef::to_typevarkor-23/+34
2018-05-15Lift pure_wrt_drop to GenericParamDefvarkor-60/+40
2018-05-15Refactor generic params loopsvarkor-165/+95
2018-05-15Fix rebase falloutvarkor-4/+10
2018-05-15Rename RegionParamDef to LifetimeParamDefvarkor-5/+5
2018-05-15Pull common parameters into GenericParamDefvarkor-266/+263
This leads to a lot of simplifications, as most code doesn't actually need to know about the specific lifetime/type data; rather, it's concerned with properties like name, index and def_id.
2018-05-15Inline get_typevarkor-40/+63
2018-05-15Fix typo in late-bound region testing messagevarkor-1/+1
2018-05-15Refactor to address commentsvarkor-75/+60
2018-05-15Replace type_param_to_index with param_def_id_to_indexvarkor-14/+19
2018-05-15Use GenericParamCount instead of FxHashMapvarkor-89/+81
2018-05-15Place Self at the start of ty::Generics' param listsvarkor-17/+16
2018-05-15Correct variable renaming falloutvarkor-6/+6
2018-05-15Eliminate ty::Generics::types()varkor-36/+52
And with one final incanation, the specific kind iterators were banished from ty::Generics, never to be seen again!
2018-05-15Eliminate ty::Generics::lifetimes()varkor-30/+37
Begone lazy lifetime code!
2018-05-15Generalise more cases of explicit iteration of specific kindsvarkor-71/+110
2018-05-15Generalise cases of explicit iteration of specific kindsvarkor-119/+210
2018-05-15Fix tidy errors caused by renamingvarkor-10/+26
2018-05-15Rename TypeParameterDef -> TypeParamDef and RegionParameterDef -> RegionParamDefvarkor-49/+49