about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-07-15add `#[must_use]` to `Box::from_raw`rhysd-0/+27
2022-07-15Auto merge of #98203 - kckeiks:gather-body-owners-in-hir-item-queries, ↵bors-309/+301
r=cjgillot gather body owners Issue #96341
2022-07-14Auto merge of #96544 - m-ysk:feature/issue-96358, r=cjgillotbors-147/+300
Stop keeping metadata in memory before writing it to disk Fixes #96358 I created this PR according with the instruction given in the issue except for the following points: - While the issue says "Write metadata into the temporary file in `encode_and_write_metadata` even if `!need_metadata_file`", I could not do that. That is because though I tried to do that and run `x.py test`, I got a lot of test failures as follows. <details> <summary>List of failed tests</summary> <pre> <code> failures: [ui] src/test/ui/json-multiple.rs [ui] src/test/ui/json-options.rs [ui] src/test/ui/rmeta/rmeta-rpass.rs [ui] src/test/ui/save-analysis/emit-notifications.rs [ui] src/test/ui/svh/changing-crates.rs [ui] src/test/ui/svh/svh-change-lit.rs [ui] src/test/ui/svh/svh-change-significant-cfg.rs [ui] src/test/ui/svh/svh-change-trait-bound.rs [ui] src/test/ui/svh/svh-change-type-arg.rs [ui] src/test/ui/svh/svh-change-type-ret.rs [ui] src/test/ui/svh/svh-change-type-static.rs [ui] src/test/ui/svh/svh-use-trait.rs test result: FAILED. 12915 passed; 12 failed; 100 ignored; 0 measured; 0 filtered out; finished in 71.41s Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu Build completed unsuccessfully in 0:01:58 </code> </pre> </details> - I could not resolve the extra tasks about `create_rmeta_file` and `create_compressed_metadata_file` for my lack of ability.
2022-07-14Auto merge of #99252 - lqd:win-dwarf5, r=eddybbors-17/+20
fix dwarf debuginfo being used in addition to CodeView on windows Tackles the debuginfo size increase regression on windows to [unblock clippy](https://github.com/rust-lang/rust/issues/99143#issuecomment-1184638573) -- introduced by the DWARF5 support in #98350 cc `@pcwalton.` r? `@eddyb` Fixes #99143
2022-07-14fix dwarf debuginfo being used in addition to CodeView on windowsRémy Rakic-17/+20
Fixes the debuginfo size increase regression introduced by the DWARF5 support.
2022-07-14Auto merge of #99242 - Dylan-DPC:rollup-34bqdh8, r=Dylan-DPCbors-778/+1320
Rollup of 6 pull requests Successful merges: - #98072 (Add provider API to error trait) - #98580 (Emit warning when named arguments are used positionally in format) - #99000 (Move abstract const to middle) - #99192 (Fix spans for asm diagnostics) - #99222 (Better error message for generic_const_exprs inference failure) - #99236 (solaris: unbreak build on native platform) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-14Rollup merge of #99236 - psumbera:Issue99208, r=Mark-SimulacrumDylan DPC-0/+1
solaris: unbreak build on native platform Fixes: #99208
2022-07-14Rollup merge of #99222 - atsuzaki:generic_const_err, r=lcnrDylan DPC-7/+37
Better error message for generic_const_exprs inference failure Fixes #90531 This code: ```rs #![feature(generic_const_exprs)] fn foo<const N: usize>(_arr: [u64; N + 1]) where [u64; N + 1]: {} fn main() { let arr = [5; 5]; foo(arr); } ``` Will now emit the following error: ```rs warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> test.rs:1:12 | 1 | #![feature(generic_const_exprs)] | ^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information error[E0284]: type annotations needed --> test.rs:8:7 | 8 | foo(arr); | ^^^ cannot infer the value of the const parameter `N` declared on the function `foo` | note: required by a bound in `foo` --> test.rs:3:56 | 3 | fn foo<const N: usize>(_arr: [u64; N + 1]) where [u64; N + 1]: {} | ^^^^^ required by this bound in `foo` help: consider specifying the generic argument | 8 | foo::<N>(arr); | +++++ error: aborting due to previous error; 1 warning emitted ``` cc: `@lcnr` thanks a lot again for the help on this
2022-07-14Rollup merge of #99192 - Amanieu:fix-asm-srcloc, r=petrochenkovDylan DPC-4/+42
Fix spans for asm diagnostics Line spans were incorrect if the first line of an asm statement was an empty string.
2022-07-14Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnrDylan DPC-750/+799
Move abstract const to middle Moves AbstractConst (and all associated methods) to rustc middle for use in `rustc_infer`. This allows for const resolution in infer to use abstract consts to walk consts and check if they are resolvable. This attempts to resolve the issue where `Foo<{ concrete const }, generic T>` is incorrectly marked as conflicting, and is independent from the other issue where nested abstract consts must be resolved. r? `@lcnr`
2022-07-14Rollup merge of #98580 - PrestonFrom:issue_98466, r=estebankDylan DPC-16/+324
Emit warning when named arguments are used positionally in format Addresses Issue 98466 by emitting an error if a named argument is used like a position argument (i.e. the name is not used in the string to be formatted). Fixes rust-lang#98466
2022-07-14Rollup merge of #98072 - yaahc:generic-member-access, r=thomccDylan DPC-1/+117
Add provider API to error trait Implements https://github.com/rust-lang/rfcs/pull/2895
2022-07-14Auto merge of #95956 - yaahc:stable-in-unstable, r=cjgillotbors-33/+304
Support unstable moves via stable in unstable items part of https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/moving.20items.20to.20core.20unstably and a blocker of https://github.com/rust-lang/rust/pull/90328. The libs-api team needs the ability to move an already stable item to a new location unstably, in this case for Error in core. Otherwise these changes are insta-stable making them much harder to merge. This PR attempts to solve the problem by checking the stability of path segments as well as the last item in the path itself, which is currently the only thing checked.
2022-07-14solaris: unbreak build on native platformPetr Sumbera-0/+1
Fixes: #99208
2022-07-14Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPCbors-268/+1021
Rollup of 5 pull requests Successful merges: - #97720 (Always create elided lifetime parameters for functions) - #98315 (Stabilize `core::ffi:c_*` and rexport in `std::ffi`) - #98705 (Implement `for<>` lifetime binder for closures) - #99126 (remove allow(rustc::potential_query_instability) in rustc_span) - #99139 (Give a better error when `x dist` fails for an optional tool) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-14Fix spans for asm diagnosticsAmanieu d'Antras-4/+42
Line spans were incorrect if the first line of an asm statement was an empty string.
2022-07-14Fix overlapping implskadmin-172/+215
2022-07-14Rollup merge of #99139 - jyn514:dist-tool-help, r=Mark-SimulacrumDylan DPC-1/+5
Give a better error when `x dist` fails for an optional tool Before: ``` thread 'main' panicked at 'Unable to build RLS', dist.rs:42:9 ``` After: ``` thread 'main' panicked at 'Unable to build submodule tool RLS (use `missing-tools = true` to ignore this failure) note: not all tools are available on all nightlies help: see https://forge.rust-lang.org/infra/toolstate.html for more information', dist.rs:43:9 ``` Closes https://github.com/rust-lang/rust/issues/85683 by explaining better why the error is expected.
2022-07-14Rollup merge of #99126 - NiklasJonsson:84447/rustc_span, r=petrochenkovDylan DPC-1/+6
remove allow(rustc::potential_query_instability) in rustc_span Also, avoid sorting before debug output as iteration order can now be relied upon. Related #84447
2022-07-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-205/+840
Implement `for<>` lifetime binder for closures This PR implements RFC 3216 ([TI](https://github.com/rust-lang/rust/issues/97362)) and allows code like the following: ```rust let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) }; // ^^^^^^^^^^^--- new! ``` cc ``@Aaron1011`` ``@cjgillot``
2022-07-14Rollup merge of #98315 - joshtriplett:stabilize-core-ffi-c, r=Mark-SimulacrumDylan DPC-5/+7
Stabilize `core::ffi:c_*` and rexport in `std::ffi` This only stabilizes the base types, not the non-zero variants, since those have their own separate tracking issue and have not gone through FCP to stabilize.
2022-07-14Rollup merge of #97720 - cjgillot:all-fresh, r=petrochenkovDylan DPC-56/+163
Always create elided lifetime parameters for functions Anonymous and elided lifetimes in functions are sometimes (async fns) --and sometimes not (regular fns)-- desugared to implicit generic parameters. This difference of treatment makes it some downstream analyses more complicated to handle. This step is a pre-requisite to perform lifetime elision resolution on AST. There is currently an inconsistency in the treatment of argument-position impl-trait for functions and async fns: ```rust trait Foo<'a> {} fn foo(t: impl Foo<'_>) {} //~ ERROR missing lifetime specifier async fn async_foo(t: impl Foo<'_>) {} //~ OK fn bar(t: impl Iterator<Item = &'_ u8>) {} //~ ERROR missing lifetime specifier async fn async_bar(t: impl Iterator<Item = &'_ u8>) {} //~ OK ``` The current implementation reports "missing lifetime specifier" on `foo`, but **accepts it** in `async_foo`. This PR **proposes to accept** the anonymous lifetime in both cases as an extra generic lifetime parameter. This change would be insta-stable, so let's ping t-lang. Anonymous lifetimes in GAT bindings keep being forbidden: ```rust fn foo(t: impl Foo<Assoc<'_> = Bar<'_>>) {} ^^ ^^ forbidden ok ``` I started a discussion here: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Anonymous.20lifetimes.20in.20universal.20impl-trait/near/284968606 r? ``@petrochenkov``
2022-07-14Auto merge of #98975 - jyn514:unstable_opts, r=wesleywiserbors-394/+396
Rename `debugging_opts` to `unstable_opts` This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear. cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Codegen.20options.20.2F.20debugging.20options r? `@Amanieu` cc `@nikic` `@joshtriplett`
2022-07-14Auto merge of #99225 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo 7 commits in b1dd22e668af5279e13a071ad4b17435bd6bfa4c..8827baaa781b37872134c1ba692a6f0aeb37890e 2022-07-09 14:48:50 +0000 to 2022-07-14 02:56:51 +0000 - Add a test for regressions in selecting the correct workspace root (rust-lang/cargo#10862) - clarify profile used for 'cargo install --debug' (rust-lang/cargo#10861) - servers should use 404 (rust-lang/cargo#10860) - test(add): Ensure comments are preserved (rust-lang/cargo#10849) - Fix nested workspace resolution (rust-lang/cargo#10846) - Small tweaks to the future-incompat docs. (rust-lang/cargo#10856) - Fixed extra period typo (rust-lang/cargo#10847)
2022-07-13Update cargoEric Huss-0/+0
2022-07-13Stabilize `core::ffi:c_*` and rexport in `std::ffi`Josh Triplett-5/+7
This only stabilizes the base types, not the non-zero variants, since those have their own separate tracking issue and have not gone through FCP to stabilize.
2022-07-14Auto merge of #98754 - jyn514:non-trivial-drop, r=compiler-errorsbors-35/+369
Fix drop-tracking ICE when a struct containing a field with a significant drop is used across an await Previously, drop-tracking would incorrectly assume the struct would be dropped immediately, which was not true. Fixes #98476. Also fixes https://github.com/rust-lang/rust/issues/98477, I think because the parent HIR node for type variables is the whole function instead of the expression where the variable is used. r? `@eholk`
2022-07-13Update testsKatherine Philip-7/+10
2022-07-13Auto merge of #97995 - RalfJung:union-more-nodrop, r=Mark-Simulacrumbors-529/+507
allow unions with mutable references and tuples of allowed types We currently allow shared references in unions, but not mutable references. That seems somewhat inconsistent. So let's allow all references, and while we are at it, let's make sure the set of allowed types is closed under tuples. This will need T-lang FCP (at least). Then remove the `tagged_unions` feature, since we do not plan to stabilize any more of it. Closes https://github.com/rust-lang/rust/issues/55149
2022-07-13Remove predicate noteKatherine Philip-2/+1
2022-07-13Add checks & fallback branchKatherine Philip-1/+13
2022-07-13Use emit_inference_failure_err for ConstEvaluatable predicatesKatherine Philip-0/+16
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-394/+396
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-13add array tests, cleanup, tidy, and blessRalf Jung-15/+35
2022-07-13assigning to a union field can never drop nowRalf Jung-57/+14
2022-07-13remove untagged_union feature gateRalf Jung-449/+386
2022-07-13also allow arrays of allowed typesRalf Jung-4/+13
2022-07-13allow unions with mutable references and tuples of allowed typesRalf Jung-12/+59
2022-07-13factor 'is this type allowed as union field on stable' into separate functionRalf Jung-3/+11
2022-07-13Emit warning when named arguments are used positionally in formatPreston From-16/+324
Addresses Issue 98466 by emitting a warning if a named argument is used like a position argument (i.e. the name is not used in the string to be formatted). Fixes rust-lang#98466
2022-07-13Auto merge of #99136 - CAD97:layout-faster, r=scottmcmbors-21/+38
Take advantage of known-valid-align in layout.rs An attempt to improve perf by `@nnethercote's` approach suggested in #99117
2022-07-13collect module item-likes in visit_itemsMiguel Guarniz-7/+10
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-13reduce scope of allow(rustc::potential_query_instability) in rustc_spanNiklas Jonsson-1/+6
2022-07-13Auto merge of #99210 - Dylan-DPC:rollup-879cp1t, r=Dylan-DPCbors-830/+830
Rollup of 5 pull requests Successful merges: - #98574 (Lower let-else in MIR) - #99011 (`UnsafeCell` blocks niches inside its nested type from being available outside) - #99030 (diagnostics: error messages when struct literals fail to parse) - #99155 (Keep unstable target features for asm feature checking) - #99199 (Refactor: remove an unnecessary `span_to_snippet`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-13merge visitors in queriesMiguel Guarniz-135/+75
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-13inline associated_bodyMiguel Guarniz-20/+5
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-13use gathered body_owners in par_body_ownersMiguel Guarniz-203/+192
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-13Auto merge of #98145 - ouz-a:some_branch, r=oli-obkbors-227/+401
Pull Derefer before ElaborateDrops _Follow up work to #97025 #96549 #96116 #95887 #95649_ This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`. r? `@oli-obk`
2022-07-13Rollup merge of #99199 - TaKO8Ki:remove-unnecessary-span-to-snippet, r=cjgillotDylan DPC-14/+11
Refactor: remove an unnecessary `span_to_snippet` `span_suggestion_hidden` does not show the suggested code and the suggestion is used just for rustfix, so `span_to_snippet` is unnecessary here.
2022-07-13Rollup merge of #99155 - Amanieu:unstable-target-features, r=davidtwcoDylan DPC-28/+67
Keep unstable target features for asm feature checking Inline assembly uses the target features to determine which registers are available on the current target. However it needs to be able to access unstable target features for this. Fixes #99071