about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2019-11-27Rollup merge of #66704 - GuillaumeGomez:intra-doc-enum-variant-field, r=kinnisonTyler Mandry-23/+90
Intra doc enum variant field Part of #43466. Add intra-doc link support for this: ```rust enum Foo { X { y: u8, // can be found with Foo::X::y } } ``` r? @kinnison
2019-11-27Rollup merge of #66700 - VirrageS:master, r=matthewjasperTyler Mandry-15/+88
Fix pointing at arg for fulfillment errors in function calls Closes: https://github.com/rust-lang/rust/issues/66258
2019-11-27Rollup merge of #66534 - immunant:multiple_global_decls, r=eddybTyler Mandry-3/+5
Allow global references via ForeignItem and Item for the same symbol name during LLVM codegen Combining CGUs can result in code that references a static variable through both an Item and a ForeignItem with the same name. We don't care that the global was already created by a ForeignItem reference when we see the Item reference, as long as the LLVM types of the ForeignItem and Item match. Fixes #66464
2019-11-27Rollup merge of #66399 - eddyb:rmeta-table-cleanup, r=Mark-SimulacrumTyler Mandry-160/+98
rustc_metadata: simplify the interactions between Lazy and Table. These are small post-#59953 cleanups (including undoing some contrivances from that PR). r? @michaelwoerister
2019-11-27Rollup merge of #66305 - elichai:2019-11-array_ffi, r=eddybTyler Mandry-6/+62
Add by-value arrays to `improper_ctypes` lint Hi, C doesn't have a notion of passing arrays by value, only by reference/pointer. Rust currently will pass it correctly by reference by it looks very misleading, and can confuse the borrow checker to think a move had occurred. Fixes #58905 and fixes #24578. We could also improve the borrow checker here but I think it's kinda a waste of work if we instead just tell the user it's an invalid FFI call. (My first PR to `rustc` so if I missed some test or formatting guideline please tell me :) )
2019-11-27Rollup merge of #66222 - Aaron1011:fix/opaque-closure, r=pnkfelixTyler Mandry-4/+29
Use `eq_opaque_type_and_type` when type-checking closure signatures This handles the case where a user explicitly annotations a closure signature with a opaque return type. Fixes #63263
2019-11-27Rollup merge of #64325 - cramertj:nested-self-types, r=mikeyhewTyler Mandry-319/+214
Stabilize nested self receivers in 1.41.0 Previously, only `Self`, `&Self`, `&mut Self`, `Arc<Self>`, `Rc<Self>`, and `Box<Self>` were available as stable method receivers. This commit stabilizes nested uses of all the above types. However, nested receivers remain non-object-safe.
2019-11-27Auto merge of #56231 - eddyb:mir-debuginfo, r=oli-obkbors-480/+780
rustc: move debug info from LocalDecl and UpvarDecl into a dedicated VarDebugInfo. This PR introduces a MIR "user variable" debuginfo system, which amounts to mapping a variable name, in some `SourceScope`, to a `Place`, so that: * each name can appear multiple times (e.g. due to macro hygiene), even in the same scope * each `Place` can appear multiple times (e.g. in the future from optimizations like NRVO, which collapse multiple MIR locals into one) * the `Place`s aren't limited to just locals, so they can describe the (right now quite ad-hoc) closure upvars and generator saved state fields, and can be properly transformed by optimizations (e.g. inlining - see `src/test/mir-opt/inline-closure-captures.rs`) The main motivation for this was that #48300 and further optimizations were blocked on being able to describe complex debuginfo transformations (see https://github.com/rust-lang/rust/pull/48300#discussion_r170020762). <hr/> In the textual representation, the "user variable" debuginfo can be found in each scope, and consists of `debug NAME => PLACE;` "declarations", e.g. the MIR for `let x = ...; let y = ...; ...` is now: ```rust let _1: T; // in scope 0 at ... scope 1 { debug x => _1; // in scope 1 at ... let _2: T; // in scope 1 at ... scope 2 { debug y => _2; // in scope 2 at ... } } ``` For reference, this is how the information was represented before this PR: (notably, the scopes in which the variables are visible for debuginfo weren't even shown anywhere, making `scope 2` look pointless, and user variable names were part of MIR locals) ```rust let _1: T; // "x" in scope 0 at ... scope 1 { let _2: T; // "y" in scope 1 at ... scope 2 { } } ``` cc @nikomatsakis @michaelwoerister
2019-11-27rustc: move debug info from LocalDecl and UpvarDecl into a dedicated ↵Eduard-Mihai Burtescu-480/+780
VarDebugInfo.
2019-11-27Use new ErrorKind enumGuillaume Gomez-10/+16
2019-11-27rustc_metadata: use a macro to deduplicate LazyPerDefTables and ↵Eduard-Mihai Burtescu-69/+47
PerDefTableBuilders.
2019-11-27rustc_metadata: remove Encodable requirements from LazyMeta impls.Eduard-Mihai Burtescu-12/+11
2019-11-27rustc_metadata: use a separate TableBuilder type to build a Table.Eduard-Mihai Burtescu-33/+39
2019-11-27rustc_metadata: replace PerDefTable<T> with Table<DefIndex, T>.Eduard-Mihai Burtescu-113/+68
2019-11-27Auto merge of #66691 - dtolnay:fmt0, r=sfacklerbors-1296/+1802
Format libcore with rustfmt I am interested in whether we can begin cautious incremental progress on #66688 and assess along the way whether we can keep the disruption sufficiently small. This PR applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API [with this script](https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8). With the list of files from the script in `outstanding_files`, the relevant commands were: ```console $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- ``` Repeating this process several months apart should get us coverage of most of the rest of libcore.
2019-11-27Replace Iterator::find calls with Iterator::any when betterGuillaume Gomez-6/+5
2019-11-27Add support for intra-doc link fields of enum variantGuillaume Gomez-7/+74
2019-11-27little intra-doc code cleanupGuillaume Gomez-16/+11
2019-11-27Auto merge of #66677 - wesleywiser:fix_const_prop_alloc_id_ice, r=oli-obkbors-36/+78
[const prop] Fix "alloc id without corresponding allocation" ICE r? @oli-obk
2019-11-26Bless ui tests for libcore reformatDavid Tolnay-2/+2
2019-11-26Format libcore with rustfmtDavid Tolnay-1294/+1800
This commit applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in `outstanding_files`, the relevant commands were: $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libcore.
2019-11-27Auto merge of #66675 - GuillaumeGomez:support-anchors-intra-doc-links, ↵bors-106/+328
r=kinnison Support anchors intra doc links Fixes #62833 Part of #43466. cc @ollie27 r? @kinnison
2019-11-27Auto merge of #66794 - tmandry:rollup-99qrpr0, r=tmandrybors-402/+441
Rollup of 14 pull requests Successful merges: - #66128 (alloc: Add new_zeroed() versions like new_uninit().) - #66661 (Add riscv64gc-unknown-linux-gnu target) - #66663 (Miri: print leak report even without tracing) - #66711 (Add hardware floating point features to aarch64-pc-windows-msvc) - #66713 (introduce a target to build the kernel of the unikernel HermitCore) - #66717 (tidy: Accommodate rustfmt's preferred layout of stability attributes) - #66719 (Store pointer width as u32 on Config) - #66720 (Move ErrorReported to rustc_errors) - #66737 (Error codes cleanup) - #66754 (Various tweaks to diagnostic output) - #66763 (Minor edit for documentation-tests.md that increases clarity) - #66779 (follow the same function order in the trait) - #66786 (Add wildcard test for const_if_match) - #66788 (Allow `Unreachable` terminators through `min_const_fn` checks) Failed merges: r? @ghost
2019-11-26Rollup merge of #66788 - ecstatic-morse:const-fn-unreachable, r=CentrilTyler Mandry-0/+24
Allow `Unreachable` terminators through `min_const_fn` checks Resolves #66756. This allows `Unreachable` terminators through the `min_const_fn` checks if `#![feature(const_if_match)]` is enabled. We could probably just allow them with no feature flag, but it seems okay to be conservative here. r? @oli-obk
2019-11-26Rollup merge of #66786 - jyn514:const-if-match-tests, r=CentrilTyler Mandry-0/+21
Add wildcard test for const_if_match Closes https://github.com/rust-lang/rust/issues/66758 Many thanks to @Centril for his help getting me started!
2019-11-26Rollup merge of #66779 - guanqun:reorder-funcs, r=Dylan-DPCTyler Mandry-6/+6
follow the same function order in the trait With this change, the function order in both traits and implementation matches. And this fix removes several warnings in IDE.
2019-11-26Rollup merge of #66763 - Parth:patch-2, r=steveklabnikTyler Mandry-1/+1
Minor edit for documentation-tests.md that increases clarity
2019-11-26Rollup merge of #66754 - estebank:rustdoc-capitalization, r=Dylan-DPCTyler Mandry-300/+115
Various tweaks to diagnostic output
2019-11-26Rollup merge of #66737 - GuillaumeGomez:err-codes-cleanup, r=Dylan-DPCTyler Mandry-50/+39
Error codes cleanup r? @Dylan-DPC
2019-11-26Rollup merge of #66720 - Mark-Simulacrum:error-reported, r=CentrilTyler Mandry-5/+8
Move ErrorReported to rustc_errors The new location is more consistent with what this type is for, though we don't remove it from the old location (via a re-export) to avoid changing the dozens of use sites (~139 at this time).
2019-11-26Rollup merge of #66719 - Mark-Simulacrum:int-normalization, r=CentrilTyler Mandry-24/+37
Store pointer width as u32 on Config This removes the dependency on IntTy, UintTy from Session. It's not obviously a win, but it seems a bit odd to store the AST IntTy/UintTy in Session, rather we store the pointer width as an integer and add normalization methods to IntTy and UintTy.
2019-11-26Rollup merge of #66717 - dtolnay:tidy, r=Mark-SimulacrumTyler Mandry-3/+6
tidy: Accommodate rustfmt's preferred layout of stability attributes Previously tidy would require that the `feature = "name_of_feature"` part of the stability attribute was on the same line as the `#[stable(` / `#[unstable(` opening part of the attribute, and that `)]` was on the same line as the last key-value pair. That didn't work with rustfmt's preferred layout of long attributes, which is like: ```rust #[unstable( feature = "c_variadic", reason = "the `c_variadic` feature has not been properly tested on \ all supported platforms", issue = "44930" )] ```
2019-11-26Rollup merge of #66713 - hermitcore:hermit, r=alexcrichtonTyler Mandry-0/+54
introduce a target to build the kernel of the unikernel HermitCore We are developing the unikernel HermitCore, where the kernel is written in Rust and is already supported by the Rust Standard Library. To compile the kernel with the new build flag "-Z build-std", we introduce a new target, which avoids the usage of SSE & AVX within the kernel.
2019-11-26Rollup merge of #66711 - mattico:aarch-msvc-fp, r=nagisaTyler Mandry-0/+1
Add hardware floating point features to aarch64-pc-windows-msvc Fixes #66701
2019-11-26Rollup merge of #66663 - RalfJung:miri-leaks, r=oli-obkTyler Mandry-13/+18
Miri: print leak report even without tracing Currently, the rustup-installed Miri has no way to actually print a leak report (as `trace!` is compiled out). Make it print that per default instead when there is a leak. r? @oli-obk
2019-11-26Rollup merge of #66661 - msizanoen1:riscv-gnu, r=alexcrichtonTyler Mandry-0/+26
Add riscv64gc-unknown-linux-gnu target This PR add the target, but doesn't build std on CI yet. I have a port for `libc` crate and std which I will upstream soon after this target is added. r? @alexcrichton
2019-11-26Rollup merge of #66128 - emilio:new-zeroed, r=SimonSapinTyler Mandry-0/+85
alloc: Add new_zeroed() versions like new_uninit(). MaybeUninit has both uninit() and zeroed(), it seems reasonable to have the same surface on Box/Rc/Arc. Needs tests. cc #63291
2019-11-26Stabilize nested self receiversTaylor Cramer-319/+214
Previously, only Self, &Self, &mut Self, Arc<Self>, Rc<Self>, and Box<Self> were available as stable method receivers. This commit stabilizes nested uses of all the above types. However, nested receivers remain non-object-safe.
2019-11-26Auto merge of #66646 - RalfJung:unwind_to_block, r=oli-obkbors-135/+136
refactor goto_block and also add unwind_to_block r? @oli-obk
2019-11-26Remove test for #66758Dylan MacKenzie-6/+0
2019-11-26Move ErrorReported to rustc_errorsMark Rousskov-5/+8
2019-11-26Add regression test for #66756Dylan MacKenzie-0/+27
2019-11-26Allow `Unreachable` terminators behind `const_if_match`Dylan MacKenzie-0/+3
2019-11-26Test multiple variantsJoshua Nelson-0/+2
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-11-26Auto merge of #66776 - Mark-Simulacrum:revert-try-breakage, r=Mark-Simulacrumbors-10/+59
Revert "DO NOT MERGE: enable windows try builder" This reverts commit 90a37bce44d145715eeac9f1f2f34433fc813ef0.
2019-11-26follow the same function order in the traitGuanqun Lu-6/+6
This removes several warnings in IDE.
2019-11-26Revert "DO NOT MERGE: enable windows try builder"Mark Rousskov-10/+59
This reverts commit 90a37bce44d145715eeac9f1f2f34433fc813ef0.
2019-11-26Auto merge of #66631 - michaelwoerister:additional-pgo-tests, r=alexcrichtonbors-0/+251
Add additional regression tests for PGO This PR adds regression tests for making sure that - instrumentation records the right counts for branches taken and functions called, and that - the indirect call promotion pass actually is able to promote indirect calls. r? @alexcrichton
2019-11-26PGO: Make branch-weights regression test more robust.Michael Woerister-10/+10
2019-11-26Auto merge of #66561 - TimoFreiberg:trait-name-report, r=estebankbors-7/+176
Add version mismatch help message for unimplemented trait Improves issue #22750 The error reporting for E0277 (the trait `X` is not implemented for `Foo`) now checks whether `Foo` implements a trait with the same path as `X`, which probably means that the programmer wanted to actually use only one version of the trait `X` instead of the two. Still open: * the same diagnostic should be added for [the trait method case](https://github.com/rust-lang/rust/issues/22750#issuecomment-372077056) * Showing the real crate versions would be nice, but rustc currently doesn't have that information [according to Esteban](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/diagnostics.20for.20crate.20version.20mismatch/near/180572989)