-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 7 pull requests #95938
Rollup of 7 pull requests #95938
Commits on Apr 8, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 4f28344 - Browse repository at this point
Copy the full SHA 4f28344View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8368590 - Browse repository at this point
Copy the full SHA 8368590View commit details -
Configuration menu - View commit details
-
Copy full SHA for e000179 - Browse repository at this point
Copy the full SHA e000179View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fc8676 - Browse repository at this point
Copy the full SHA 5fc8676View commit details -
Configuration menu - View commit details
-
Copy full SHA for 148beaf - Browse repository at this point
Copy the full SHA 148beafView commit details -
Configuration menu - View commit details
-
Copy full SHA for c996bc0 - Browse repository at this point
Copy the full SHA c996bc0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c169f3 - Browse repository at this point
Copy the full SHA 3c169f3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ef4af7 - Browse repository at this point
Copy the full SHA 8ef4af7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14fb427 - Browse repository at this point
Copy the full SHA 14fb427View commit details -
Configuration menu - View commit details
-
Copy full SHA for a5d2c04 - Browse repository at this point
Copy the full SHA a5d2c04View commit details
Commits on Apr 9, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 9745a17 - Browse repository at this point
Copy the full SHA 9745a17View commit details -
Switch to the 'normal' basic block for writing asm outputs if needed.
We may sometimes emit an `invoke` instead of a `call` for inline assembly during the MIR -> LLVM IR lowering. But we failed to update the IR builder's current basic block before writing the results to the outputs. This would result in invalid IR because the basic block would end in a `store` instruction, which isn't a valid terminator.
Configuration menu - View commit details
-
Copy full SHA for bf3ef0d - Browse repository at this point
Copy the full SHA bf3ef0dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0b2f360 - Browse repository at this point
Copy the full SHA 0b2f360View commit details
Commits on Apr 10, 2022
-
Configuration menu - View commit details
-
Copy full SHA for bb3a071 - Browse repository at this point
Copy the full SHA bb3a071View commit details -
Clarify str::from_utf8_unchecked's invariants
Specifically, make it clear that it is immediately UB to pass ill-formed UTF-8 into the function. The previous wording left space to interpret that the UB only occurred when calling another function, which "assumes that `&str`s are valid UTF-8." This does not change whether str being UTF-8 is a safety or a validity invariant. (As per previous discussion, it is a safety invariant, not a validity invariant.) It just makes it clear that valid UTF-8 is a precondition of str::from_utf8_unchecked, and that emitting an Abstract Machine fault (e.g. UB or a sanitizer error) on invalid UTF-8 is a valid thing to do. If user code wants to create an unsafe `&str` pointing to ill-formed UTF-8, it must be done via transmutes. Also, just, don't.
Configuration menu - View commit details
-
Copy full SHA for b92cd1a - Browse repository at this point
Copy the full SHA b92cd1aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 26781c3 - Browse repository at this point
Copy the full SHA 26781c3View commit details -
Remove duplicate aliases for
codegen_{cranelift,gcc}
Bootstrap already allows selecting these in `PathSet::has`, which allows any string that matches the end of a full path. I found these by adding `assert!(path.exists())` in `StepDescription::paths`. I think ideally we wouldn't have any aliases that aren't paths, but I've held off on enforcing that here since it may be controversial, I'll open a separate PR.
Configuration menu - View commit details
-
Copy full SHA for 986c168 - Browse repository at this point
Copy the full SHA 986c168View commit details -
Add
build compiler/rustc_codegen_gcc
as an alias forCodegenBackend
These paths (`_cranelift` and `_gcc`) are somewhat misleading, since they actually tell bootstrap to build *all* codegen backends. But this seems like a useful improvement in the meantime.
Configuration menu - View commit details
-
Copy full SHA for 4c14383 - Browse repository at this point
Copy the full SHA 4c14383View commit details
Commits on Apr 11, 2022
-
Configuration menu - View commit details
-
Copy full SHA for aeb3df7 - Browse repository at this point
Copy the full SHA aeb3df7View commit details -
Rollup merge of rust-lang#95320 - JakobDegen:mir-docs, r=oli-obk
Document the current MIR semantics that are clear from existing code This PR adds documentation to places, operands, rvalues, statementkinds, and terminatorkinds that describes their existing semantics and requirements. In many places the semantics depend on the Rust memory model or other T-Lang decisions - when this is the case, it is just noted as such with links to UCG issues where possible. I'm hopeful that none of the documentation added here can be used to justify optimizations that depend on the memory model. The documentation for places and operands probably comes closest to running afoul of this - if people think that it cannot be merged as is, it can definitely also be taken out. The goal here is to only document parts of MIR that seem to be decided already, or are at least depended on by existing code. That leaves quite a number of open questions - those are marked as "needs clarification." I'm not sure what to do with those in this PR - we obviously can't decide all these questions here. Should I just leave them in as is? Take them out? Keep them in but as `//` instead of `///` comments? If this is too big to review at once, I can split this up. r? rust-lang/mir-opt
Configuration menu - View commit details
-
Copy full SHA for d4a1b19 - Browse repository at this point
Copy the full SHA d4a1b19View commit details -
Rollup merge of rust-lang#95864 - luqmana:inline-asm-unwind-store-mis…
…compile, r=Amanieu Fix miscompilation of inline assembly with outputs in cases where we emit an invoke instead of call instruction. We ran into this bug where rustc would segfault while trying to compile certain uses of inline assembly. Here is a simple repro that demonstrates the issue: ```rust #![feature(asm_unwind)] fn main() { let _x = String::from("string here just cause we need something with a non-trivial drop"); let foo: u64; unsafe { std::arch::asm!( "mov {}, 1", out(reg) foo, options(may_unwind) ); } println!("{}", foo); } ``` ([playground link](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=7d6641e83370d2536a07234aca2498ff)) But crucially `feature(asm_unwind)` is not actually needed and this can be triggered on stable as a result of the way async functions/generators are handled in the compiler. e.g.: ```rust extern crate futures; // 0.3.21 async fn bar() { let foo: u64; unsafe { std::arch::asm!( "mov {}, 1", out(reg) foo, ); } println!("{}", foo); } fn main() { futures::executor::block_on(bar()); } ``` ([playground link](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1c7781c34dd4a3e80ae4bd936a0c82fc)) An example of the incorrect LLVM generated: ```llvm bb1: ; preds = %start %1 = invoke i64 asm sideeffect alignstack inteldialect unwind "mov ${0:q}, 1", "=&r,~{dirflag},~{fpsr},~{flags},~{memory}"() to label %bb2 unwind label %cleanup, !srcloc !9 store i64 %1, i64* %foo, align 8 bb2: [...snip...] ``` The store should not be placed after the asm invoke but rather should be in the normal control flow basic block (`bb2` in this case). [Here](https://gist.github.com/luqmana/be1af5b64d2cda5a533e3e23a7830b44) is a writeup of the investigation that lead to finding this.
Configuration menu - View commit details
-
Copy full SHA for 98cb6e8 - Browse repository at this point
Copy the full SHA 98cb6e8View commit details -
Rollup merge of rust-lang#95894 - nyanpasu64:fix-pin-docs, r=Dylan-DPC
Fix formatting error in pin.rs docs Not sure if there's more formatting issues I missed; I kinda lost interest reading midway through.
Configuration menu - View commit details
-
Copy full SHA for e08c70a - Browse repository at this point
Copy the full SHA e08c70aView commit details -
Rollup merge of rust-lang#95895 - CAD97:patch-2, r=Dylan-DPC
Clarify str::from_utf8_unchecked's invariants Specifically, make it clear that it is immediately UB to pass ill-formed UTF-8 into the function. The previous wording left space to interpret that the UB only occurred when calling another function, which "assumes that `&str`s are valid UTF-8." This does not change whether str being UTF-8 is a safety or a validity invariant. (As per previous discussion, it is a safety invariant, not a validity invariant.) It just makes it clear that valid UTF-8 is a precondition of str::from_utf8_unchecked, and that emitting an Abstract Machine fault (e.g. UB or a sanitizer error) on invalid UTF-8 is a valid thing to do. If user code wants to create an unsafe `&str` pointing to ill-formed UTF-8, it must be done via transmutes. Also, just, don't. Zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/136281-t-lang.2Fwg-unsafe-code-guidelines/topic/str.3A.3Afrom_utf8_unchecked.20Safety.20requirement
Configuration menu - View commit details
-
Copy full SHA for ee9a149 - Browse repository at this point
Copy the full SHA ee9a149View commit details -
Rollup merge of rust-lang#95900 - o01eg:fix-wasm-doc, r=Mark-Simulacrum
Fix documentation for wasm32-unknown-unknown Fixes rust-lang#76526 (comment)
Configuration menu - View commit details
-
Copy full SHA for dd719a7 - Browse repository at this point
Copy the full SHA dd719a7View commit details -
Rollup merge of rust-lang#95901 - jyn514:remove-duplicate-aliases, r=…
…Mark-Simulacrum Remove duplicate aliases for `check codegen_{cranelift,gcc}` and fix `build codegen_gcc` * Remove duplicate aliases Bootstrap already allows selecting these in `PathSet::has`, which allows any string that matches the end of a full path. I found these by adding `assert!(path.exists())` in `StepDescription::paths`. I think ideally we wouldn't have any aliases that aren't paths, but I've held off on enforcing that here since it may be controversial, I'll open a separate PR. * Add `build compiler/rustc_codegen_gcc` as an alias for `CodegenBackend` These paths (`_cranelift` and `_gcc`) are somewhat misleading, since they actually tell bootstrap to build *all* codegen backends. But this seems like a useful improvement in the meantime. cc `@bjorn3` `@antoyo`
Configuration menu - View commit details
-
Copy full SHA for 7450505 - Browse repository at this point
Copy the full SHA 7450505View commit details -
Rollup merge of rust-lang#95927 - Kobzol:ci-pgo-libcore, r=lqd
CI: do not compile libcore twice when performing LLVM PGO I forgot the delete the first compilation when modifying this file in a previous PR. r? `@lqd`
Configuration menu - View commit details
-
Copy full SHA for ba25dc9 - Browse repository at this point
Copy the full SHA ba25dc9View commit details