about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-12-20Rollup merge of #67131 - Centril:item-merge, r=petrochenkovMazdak Farrokhzad-99/+127
Merge `TraitItem` & `ImplItem into `AssocItem` In this PR we: - Merge `{Trait,Impl}Item{Kind?}` into `AssocItem{Kind?}` as discussed in https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286. - This is done by using the cover grammar of both forms. - In particular, it requires that we syntactically allow (under `#[cfg(FALSE)]`): - `default`ness on `trait` items, - `impl` items without a body / definition (`const`, `type`, and `fn`), - and associated `type`s in `impl`s with bounds, e.g., `type Foo: Ord;`. - The syntactic restrictions are replaced by semantic ones in `ast_validation`. - Move syntactic restrictions around C-variadic parameters from the parser into `ast_validation`: - `fn`s in all contexts now syntactically allow `...`, - `...` can occur anywhere in the list syntactically (`fn foo(..., x: usize) {}`), - and `...` can be the sole parameter (`fn foo(...) {}`. r? @petrochenkov
2019-12-20Rollup merge of #64588 - matthewjasper:mir-address-of, r=oli-obkMazdak Farrokhzad-3/+41
Add a raw "address of" operator * Parse and feature gate `&raw [const | mut] expr` (feature gate name is `raw_address_of`) * Add `mir::Rvalue::AddressOf` * Use the new `Rvalue` for: * the new syntax * reference to pointer casts * drop shims for slices and arrays * Stop using `mir::Rvalue::Cast` with a reference as the operand * Correctly evaluate `mir::Rvalue::{Ref, AddressOf}` in constant propagation cc @Centril @RalfJung @oli-obk @eddyb cc #64490
2019-12-20Rollup merge of #67285 - ohadravid:indicate-origin-of-where-type-parameter, ↵Mazdak Farrokhzad-17/+73
r=estebank Indicate origin of where type parameter for uninferred types Based on #65951 (which is not merge yet), fixes #67277. This PR improves a little the diagnostic for code like: ``` async fn foo() { bar().await; } async fn bar<T>() -> () {} ``` by showing: ``` error[E0698]: type inside `async fn` body must be known in this context --> unresolved_type_param.rs:9:5 | 9 | bar().await; | ^^^ cannot infer type for type parameter `T` declared on the function `bar` | ... ``` (The ``` declared on the function `bar` ``` part is new) A small side note: `Vec` and `slice` seem to resist this change, because querying `item_name()` panics, and `get_opt_name()` returns `None`. r? @estebank
2019-12-20Rollup merge of #67127 - estebank:disambiguate-suggestion, r=varkorMazdak Farrokhzad-0/+11
Use structured suggestion for disambiguating method calls Fix #65635.
2019-12-19is_binding_pat: treat or-pat like tuple-patMazdak Farrokhzad-1/+2
2019-12-19is_binding_pat: don't use _ armMazdak Farrokhzad-1/+8
2019-12-19Rollup merge of #67382 - nnethercote:rm-unnecessary-ATTR-constants, ↵Mazdak Farrokhzad-15/+7
r=michaelwoerister Remove some unnecessary `ATTR_*` constants. r? @michaelwoerister
2019-12-18Add Rvalue::AddressOf to MIRMatthew Jasper-3/+41
This operator creates a raw pointer to a Place directly, without first creating a reference. See RFC #2582 for motivation. The Rvalue is currently unused.
2019-12-18Propagate cfg bootstrapMark Rousskov-3/+0
2019-12-18record previous unresolve span for generator error reportingcsmoe-9/+3
2019-12-18add debuginfo in generator_interiorcsmoe-0/+16
2019-12-18Remove some unnecessary `ATTR_*` constants.Nicholas Nethercote-15/+7
2019-12-17Revert "Auto merge of #67362 - Mark-Simulacrum:par-4-default, r=alexcrichton"Mark Rousskov-7/+7
This reverts commit 3ed3b8bb7b100afecf7d5f52eafbb70fec27f537, reversing changes made to 99b89533d4cdf7682ea4054ad0ee36c351d05df1. We will reland a similar patch at a future date but for now we should get a nightly released in a few hours with the parallel patch, so this should be reverted to make sure that the next nightly is not parallel-enabled.
2019-12-17Auto merge of #67362 - Mark-Simulacrum:par-4-default, r=alexcrichtonbors-7/+7
4 thread parallelism by default The Session default here is super unusual but seems to both compile and do what we expect as best as I can tell.
2019-12-17Move AtomicU64 usage to AtomicUsizeMark Rousskov-7/+7
2019-12-16improve lower_pat_slice docs + while -> forMazdak Farrokhzad-12/+26
2019-12-15improve hir::PatKind::Slice docsMazdak Farrokhzad-2/+9
2019-12-15Rollup merge of #67289 - estebank:unnamed-closure, r=CentrilMazdak Farrokhzad-4/+11
Do not ICE on unnamed future Fix #67252.
2019-12-14Do not ICE on unnamed futureEsteban Küber-4/+11
2019-12-14Auto merge of #67224 - nikomatsakis:revert-stabilization-of-never-type, ↵bors-1/+1
r=centril Revert stabilization of never type Fixes https://github.com/rust-lang/rust/issues/66757 I decided to keep the separate `never-type-fallback` feature gate, but tried to otherwise revert https://github.com/rust-lang/rust/pull/65355. Seemed pretty clean. ( cc @Centril, author of #65355, you may want to check this over briefly )
2019-12-14add Scalar::try_from_(u)int methodsChristian Poveda-12/+22
2019-12-14Revert "Stabilize the `never_type`, written `!`."Niko Matsakis-1/+1
This reverts commit 15c30ddd69d6cc3fffe6d304c6dc968a5ed046f1.
2019-12-14Auto merge of #67136 - oli-obk:const_stability, r=Centrilbors-19/+78
Require stable/unstable annotations for the constness of all stable fns with a const modifier r? @RalfJung @Centril Every `#[stable]` const fn now needs either a `#[rustc_const_unstable]` attribute or a `#[rustc_const_stable]` attribute. You can't silently stabilize the constness of a function anymore.
2019-12-14Indicate origin of where type parameter for uninferred typesOhad Ravid-17/+73
2019-12-13Auto merge of #65951 - estebank:type-inference-error, r=nikomatsakisbors-59/+238
Point at method call when type annotations are needed - Point at method call instead of whole expression when type annotations are needed. - Suggest use of turbofish on function and methods. Fix #49391, fix #46333, fix #48089. CC #58517, #63502, #63082. Fixes https://github.com/rust-lang/rust/issues/40015 r? @nikomatsakis
2019-12-13Consistently name `min_const_fn`Oliver Scherer-2/+2
2019-12-13Change the const stab default for internal const fnsOliver Scherer-4/+7
2019-12-13Elaborate internal const fn commentOliver Scherer-1/+3
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-18/+67
functions with a `const` modifier
2019-12-13Reuse the `staged_api` feature for `rustc_const_unstable`Oliver Scherer-1/+6
2019-12-12make visitor uses more robustMazdak Farrokhzad-2/+2
2019-12-12`AssocImplKind::{Method -> Fn}`.Mazdak Farrokhzad-6/+6
2019-12-12Remove `ast::{Impl,Trait}{Item,ItemKind}`.Mazdak Farrokhzad-32/+32
2019-12-12More c-variadic errors as semantic restrictions.Mazdak Farrokhzad-1/+7
2019-12-12Unify assoc item visitors more.Mazdak Farrokhzad-5/+5
2019-12-12Unify associated item visitor.Mazdak Farrokhzad-7/+7
2019-12-12parse: refactor fun ret ty & param tyMazdak Farrokhzad-22/+12
2019-12-12Unify `{Trait,Impl}ItemKind::TyAlias` structures.Mazdak Farrokhzad-30/+31
2019-12-12`TraitItemKind::Type` -> `TraitItemKind::TyAlias`.Mazdak Farrokhzad-2/+2
2019-12-12Use `Option` in `ImplItemKind::Method`.Mazdak Farrokhzad-25/+50
2019-12-12Use `Option` in `ImplItemKind::Const`.Mazdak Farrokhzad-1/+7
2019-12-12Auto merge of #67079 - nnethercote:optimize-shallow_resolve_changed, ↵bors-28/+36
r=nikomatsakis Optimize `shallow_resolve_changed` r? @nikomatsakis
2019-12-11Use structured suggestion for disambiguating method callsEsteban Küber-0/+11
Fix #65635.
2019-12-11Add more context for type parametersEsteban Küber-15/+27
2019-12-11Reuse existing HirId → DefId tableEsteban Küber-24/+4
2019-12-11Auto merge of #66650 - matthewjasper:nonuniform-array-move, r=pnkfelixbors-11/+24
Remove uniform array move MIR passes This PR fixes a number of bugs caused by limitations of this pass * Projections from constant indexes weren't being canonicalized * Constant indexes from the start weren't being canonicalized (they could have different min_lengths) * It didn't apply to non-moves This PR makes the following changes to support removing this pass: * ConstantIndex of arrays are now generated in a canonical form (from the start, min_length is the actual length). * Subslices are now split when generating move paths and when checking subslices have been moved. Additionally * The parent move path of a projection from an array element is now calculated correctly closes #66502
2019-12-11Auto merge of #65345 - ↵bors-83/+223
davidtwco:issue-64130-async-send-sync-error-improvements, r=nikomatsakis async/await: improve not-send errors, part 2 Part of #64130. Fixes #65667. This PR improves the errors introduced in #64895 so that they have specialized messages for `Send` and `Sync`. r? @nikomatsakis
2019-12-11erase regions instead of using `builtin_deref`Nicholas Matsakis-7/+18
The reason we were invoking `builtin_deref` was to enable comparisons when the type was `&T`. For the reasons outlined in the comment, those comparisons failed because the regions disagreed.
2019-12-11Auto merge of #66821 - eddyb:global-trait-caching, r=nikomatsakisbors-24/+23
rustc: allow non-empty ParamEnv's in global trait select/eval caches. *Based on #66963* This appears to alleviate the symptoms of #65510 locally (without fixing WF directly), and is potentially easier to validate as sound (since it's a more ad-hoc version of queries we already have). I'm opening this PR primarily to test the effects on perf. r? @nikomatsakis cc @rust-lang/wg-traits
2019-12-11Change `PendingPredicateObligation::stalled_on`'s type.Nicholas Nethercote-20/+26
From a `Vec<Ty>` to a `Vec<InferTy>`, because that's a more restrictive type. This is a perf win because the ultra-hot function `shallow_resolve_changed` has less pattern-matching to do.