about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2020-03-14Use smaller discriminants for generatorsJonas Schievink-28/+31
2020-03-14Auto merge of #69744 - ecstatic-morse:fix-enum-discr-effect-test, r=oli-obkbors-0/+43
Add `mir-opt` test for more precise drop elaboration Depends on #69676. This test should ensure that the problem fixed in that PR does not reoccur. This has been split out from #69676 since the test fails on certain targets where no cleanup blocks are emitted. I have to find the correct `ignore` directives. r? @oli-obk
2020-03-14Auto merge of #69716 - jonas-schievink:generator-size, r=tmandrybors-31/+120
Don't store locals in generators that are immediately overwritten with the resume argument This fixes https://github.com/rust-lang/rust/issues/69672 and makes https://github.com/rust-lang/rust/pull/69033 pass the async fn size tests again (in other words, there will be no size regression of async fn if both this and https://github.com/rust-lang/rust/pull/69033 land). ~~This is a small botch and I'd rather have a more precise analysis, but that seems much harder to pull off, so this special-cases `Yield` terminators that store the resume argument into a simple local (ie. without any field projections) and explicitly marks that local as "not live" in the suspend point of that yield. We know that this local does not need to be stored in the generator for this suspend point because the next resume would immediately overwrite it with the passed-in resume argument anyways. The local might still end up in the state if it is used across another yield.~~ (this now properly updates the dataflow framework to handle this case)
2020-03-13Auto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrumbors-370/+368
Optimize catch_unwind to match C++ try/catch This refactors the implementation of catching unwinds to allow LLVM to inline the "try" closure directly into the happy path, avoiding indirection. This means that the catch_unwind implementation is (after this PR) zero-cost unless a panic is thrown. https://rust.godbolt.org/z/cZcUSB is an example of the current codegen in a simple case. Notably, the codegen is *exactly the same* if `-Cpanic=abort` is passed, which is clearly not great. This PR, on the other hand, generates the following assembly: ```asm # -Cpanic=unwind: push rbx mov ebx,0x2a call QWORD PTR [rip+0x1c53c] # <happy> mov eax,ebx pop rbx ret mov rdi,rax call QWORD PTR [rip+0x1c537] # cleanup function call call QWORD PTR [rip+0x1c539] # <unfortunate> mov ebx,0xd mov eax,ebx pop rbx ret # -Cpanic=abort: push rax call QWORD PTR [rip+0x20a1] # <happy> mov eax,0x2a pop rcx ret ``` Fixes #64224, and resolves #64222.
2020-03-13Auto merge of #69986 - JohnTitor:rollup-h0809mf, r=JohnTitorbors-237/+358
Rollup of 12 pull requests Successful merges: - #69403 (Implement `Copy` for `IoSlice`) - #69460 (Move some `build-pass` tests to `check-pass`) - #69723 (Added doc on keyword Pub.) - #69802 (fix more clippy findings) - #69809 (remove lifetimes that can be elided (clippy::needless_lifetimes)) - #69947 (Clean up E0423 explanation) - #69949 (triagebot.toml: add ping aliases) - #69954 (rename panic_if_ intrinsics to assert_) - #69960 (miri engine: fix treatment of abort intrinsic) - #69966 (Add more regression tests) - #69973 (Update stable-since version for const_int_conversion) - #69974 (Clean up E0434 explanation) Failed merges: r? @ghost
2020-03-14Rollup merge of #69974 - GuillaumeGomez:cleanup-e0434, r=Dylan-DPCYuki Okushi-6/+4
Clean up E0434 explanation r? @Dylan-DPC
2020-03-14Rollup merge of #69973 - tspiteri:const-int-conversion-since, r=dtolnayYuki Okushi-12/+12
Update stable-since version for const_int_conversion Since #69373 was not merged in time for 1.43.0 beta, update to `since = "1.44.0"`.
2020-03-14Rollup merge of #69966 - JohnTitor:more-more-tests, r=CentrilYuki Okushi-0/+128
Add more regression tests Closes #58490, closes #60390, closes #62504, closes #67739, closes #69092 r? @Centril
2020-03-14Rollup merge of #69960 - RalfJung:abort, r=oli-obkYuki Okushi-9/+6
miri engine: fix treatment of abort intrinsic I screwed up in https://github.com/rust-lang/rust/pull/69830 and added `abort` to the wrong block of intrinsics, namely the one that actually has a return place. So that branch was never actually reached. r? @oli-obk
2020-03-14Rollup merge of #69954 - RalfJung:panic_if-assert, r=Centril,eddybYuki Okushi-18/+36
rename panic_if_ intrinsics to assert_ [Suggested by @eddyb](https://github.com/rust-lang/miri/issues/1222#issuecomment-598087523)
2020-03-14Rollup merge of #69949 - rust-lang:triagebot-ping-alias, r=Mark-SimulacrumYuki Okushi-0/+2
triagebot.toml: add ping aliases I think I got the syntax right. Closes https://github.com/rust-lang/triagebot/issues/402. r? @Mark-Simulacrum cc @pnkfelix
2020-03-14Rollup merge of #69947 - GuillaumeGomez:cleanup-e0423, r=Dylan-DPCYuki Okushi-2/+1
Clean up E0423 explanation r? @Dylan-DPC
2020-03-14Rollup merge of #69809 - matthiaskrgr:lifetimes, r=eddybYuki Okushi-50/+50
remove lifetimes that can be elided (clippy::needless_lifetimes)
2020-03-14Rollup merge of #69802 - matthiaskrgr:cl1ppy, r=Dylan-DPCYuki Okushi-118/+78
fix more clippy findings * reduce references on match patterns (clippy::match_ref_pats) * Use writeln!(fmt, "word") instead of write!(fmt, "word\n") (clippy::write_with_newline) * libtest: remove redundant argument to writeln!() (clippy::writeln_empty_string) * remove unneeded mutable references (cippy::unnecessary_mut_passed) * libtest: declare variables as floats instead of casting them (clippy::unnecessary_cast) * rustdoc: remove redundant static lifetimes (clippy::redundant_static_lifetimes) * call .as_deref() instead of .as_ref().map(Deref::deref) (clippy::option_as_ref_deref) * iterate over a maps values directly. (clippy::for_kv_map) * rustdoc: simplify boolean condition (clippy::nonminimal_bool) * Use ?-operator in more places (clippy::question_mark, had some false negatives fixed recently) * rustdoc: Use .any(p) instead of find(p).is_some(). (clippy::search_is_some) * rustdoc: don't call into_iter() on iterator. (clippy::identity_conversion)
2020-03-14Rollup merge of #69723 - sjud:sjud-doc-request, r=Mark-SimulacrumYuki Okushi-2/+8
Added doc on keyword Pub. Hi, this is my first pull request. I hope it's OK. Please let me know if it would benefit from any changes. Thank you.
2020-03-14Rollup merge of #69460 - LeSeulArtichaut:move-compile-pass, r=RalfJungYuki Okushi-20/+23
Move some `build-pass` tests to `check-pass` Helps with #62277. r? @cramertj cc @Centril
2020-03-14Rollup merge of #69403 - LeSeulArtichaut:copy-ioslice, r=sfacklerYuki Okushi-0/+10
Implement `Copy` for `IoSlice` Resolves #69395 r? @sfackler
2020-03-13Auto merge of #69155 - chrissimpkins:llvm-globals, r=eddybbors-7/+10
Add support for LLVM globals corresponding to miri allocations should be named alloc123 Adds support for this request from @eddyb in #69134: > That is, if -Zfewer-names is false (usually only because of --emit=llvm-ir), we should use the same name for LLVM globals we generate out of miri allocs as #67133 does in MIR output (allocN). > >This way, we can easily see the mapping between MIR and LLVM IR (and it shouldn't be any costlier for regular compilation, which would continue to use unnamed globals). r? @eddyb cc @oli-obk
2020-03-13Add documentation for pub keywordsjud-2/+8
2020-03-13Clean up E0434 explanationGuillaume Gomez-6/+4
2020-03-13update stable-since version for const_int_conversionTrevor Spiteri-12/+12
2020-03-13bless testsRalf Jung-1/+1
2020-03-13adjust enum namingRalf Jung-12/+12
2020-03-13Add test for issue-69092Yuki Okushi-0/+21
2020-03-13Add test for issue-67739Yuki Okushi-0/+26
2020-03-13Add test for issue-62504Yuki Okushi-0/+33
2020-03-13Add test for issue-60390Yuki Okushi-0/+8
2020-03-13Add test for issue-58490Yuki Okushi-0/+40
2020-03-12miri engine: fix treatment of abort intrinsicRalf Jung-8/+5
2020-03-12remove lifetimes that can be elided (clippy::needless_lifetimes)Matthias Krüger-50/+50
2020-03-12rename panic_if_ intrinsics to assert_Ralf Jung-9/+27
2020-03-12triagebot.toml: add typo aliasesMazdak Farrokhzad-2/+2
2020-03-12Move some more tests to `check-pass`LeSeulArtichaut-3/+6
2020-03-12Auto merge of #69950 - Centril:rollup-xh0hmvx, r=Centrilbors-431/+543
Rollup of 10 pull requests Successful merges: - #68899 (Add Display and Error impls for proc_macro::LexError) - #69011 (Document unsafe blocks in core::fmt) - #69674 (Rename DefKind::Method and TraitItemKind::Method ) - #69705 (Toolstate: remove redundant beta-week check.) - #69722 (Tweak output for invalid negative impl AST errors) - #69747 (Rename rustc guide) - #69792 (Implement Error for TryReserveError) - #69830 (miri: ICE on invalid terminators) - #69921 (rustdoc: remove unused import) - #69945 (update outdated comment) Failed merges: r? @ghost
2020-03-12Move some const-eval `build-pass` tests to `check-pass`LeSeulArtichaut-20/+20
2020-03-12Rollup merge of #69945 - contrun:fix-outdated-comment, r=petrochenkovMazdak Farrokhzad-1/+1
update outdated comment
2020-03-12Rollup merge of #69921 - matthiaskrgr:rustdoc_import, r=CentrilMazdak Farrokhzad-1/+0
rustdoc: remove unused import ``` Checking rustdoc v0.0.0 (/home/matthias/vcs/github/rust/src/librustdoc) warning: unused import: `rustc_span::symbol::sym` --> src/librustdoc/clean/inline.rs:15:5 | 15 | use rustc_span::symbol::sym; | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default ```
2020-03-12Rollup merge of #69830 - RalfJung:miri-invalid-terminator, r=oli-obkMazdak Farrokhzad-7/+19
miri: ICE on invalid terminators We've run a lot of MIR in Miri (including some generators) and never seen these. @tmandry is it correct that `Yield` and `GeneratorDrop` get lowered away? @eddyb @oli-obk what's with this `Abort` that does not seem to ever actually exist? Codegen *does* seem to handle it, so I wonder why Miri can get away without that. In fact, codegen handles it twice: https://github.com/rust-lang/rust/blob/1d5241c96208ca7d925442b1a5fa45ad18717a6f/src/librustc_codegen_ssa/mir/block.rs#L796 https://github.com/rust-lang/rust/blob/1d5241c96208ca7d925442b1a5fa45ad18717a6f/src/librustc_codegen_ssa/mir/mod.rs#L296
2020-03-12Rollup merge of #69792 - LenaWil:try_reserve_error/impl-error, r=sfacklerMazdak Farrokhzad-0/+21
Implement Error for TryReserveError I noticed that the Error trait wasn't implemented for TryReserveError. (#48043) Not sure if the error messages and code style are 100% correct, it's my first time contributing to the Rust std.
2020-03-12Rollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbiniMazdak Farrokhzad-129/+129
Rename rustc guide This is in preparation for https://github.com/rust-lang/rustc-guide/issues/470 Needs to be merged after we actually rename the guide. Have used this to rename: `git grep -l 'rustc_guide' | xargs sed -i 's/rustc_guide/rustc_dev_guide/g'` `git grep -l 'rustc-guide' | xargs sed -i 's/rustc-guide/rustc-dev-guide/g'` `git grep -l 'rustc guide' | xargs sed -i 's/rustc guide/rustc dev guide/g'`
2020-03-12Rollup merge of #69722 - estebank:negative-impl-span-ast, r=CentrilMazdak Farrokhzad-141/+184
Tweak output for invalid negative impl AST errors Use more accurate spans for negative `impl` errors. r? @Centril
2020-03-12Rollup merge of #69705 - ehuss:toolstate-remove-redundant-beta, ↵Mazdak Farrokhzad-39/+29
r=Mark-Simulacrum Toolstate: remove redundant beta-week check. I made a bit of a mistake in #69624. The "beta regression" doesn't need to be checked twice. I also rolled up #69693 to avoid merge conflicts.
2020-03-12Rollup merge of #69674 - mark-i-m:assoc-fn, r=matthewjasperMazdak Farrokhzad-106/+104
Rename DefKind::Method and TraitItemKind::Method r? @eddyb, @Centril, or @matthewjasper cc #69498 #60163
2020-03-12Rollup merge of #69011 - foeb:document-unsafe-core-fmt, r=Mark-SimulacrumMazdak Farrokhzad-6/+45
Document unsafe blocks in core::fmt r? @RalfJung CC: @rust-lang/wg-unsafe-code-guidelines #66219 Sorry for the hiatus, but here's a few more files with the unsafe blocks documented! I think working on it smaller chunks like this will be easier for everyone.
2020-03-12Rollup merge of #68899 - kinseytamsin:lexerror-error-impl, r=CentrilMazdak Farrokhzad-1/+11
Add Display and Error impls for proc_macro::LexError This should allow LexError to play much nicer with the `?` operator. Fixes #68896. (I'm not sure if I did the stability attributes right, so if I need to change them, please let me know!)
2020-03-12triagebot.toml: add ping aliasesMazdak Farrokhzad-0/+2
2020-03-12support LLVM globals corresponding to miri allocationsChris Simpkins-7/+10
2020-03-12Clean up E0423 explanationGuillaume Gomez-2/+1
2020-03-12update outdated commentYI-1/+1
2020-03-12Auto merge of #68551 - Marwes:allocations_mir, r=ecstatic-morsebors-7/+23
perf: Reuse a Vec in mir simplification Just moves the vec out of the outer loop so it is reused every iteration