about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-08-16Update test output.Mara Bos-152/+44
2021-08-16Auto merge of #80357 - c410-f3r:new-hir-let, r=matthewjasperbors-1446/+1420
Introduce `hir::ExprKind::Let` - Take 2 Builds on #68577 and depends on #79328. cc #53667
2021-08-15Auto merge of #87590 - Amanieu:deprecate_llvm_asm, r=nagisabors-132/+177
Deprecate llvm_asm! We would like to remove `llvm_asm!` from the compiler once `asm!` is stabilized. This PR deprecates `llvm_asm!` to encourage any remaining users to migrate to `asm!` (or if `asm!` is not supported for their target, to add this support to rustc). The only remaining user of `llvm_asm!` in the standard library was `black_box`, which has been rewritten to use volatile operations when `asm!` is not available on the current target. cc `@rust-lang/wg-inline-asm` cc `@RalfJung` for the changes to `black_box` which might affect Miri. r? `@nagisa`
2021-08-15Introduce hir::ExprKind::Let - Take 2Caio-1446/+1420
2021-08-15Auto merge of #87982 - m-ou-se:non-fmt-panic-assert-str, r=cjgillotbors-27/+75
Add automatic migration for assert!(.., string). Fixes part of #87313.
2021-08-15Auto merge of #87792 - GuillaumeGomez:ci-fetch, r=pietroalbinibors-4/+6
Remove git fetch from CI https://github.com/rust-lang/rust/pull/86623 added a call to `git fetch`, which is problematic for releases. r? `@pietroalbini`
2021-08-15Fix ui tests for llvm_asm! deprecationAmanieu d'Antras-132/+177
2021-08-15Auto merge of #86692 - dns2utf8:parallelize_rustdoc-gui_tests, r=GuillaumeGomezbors-13/+113
Run rustdoc-gui tests in parallel I hid the passing tests and only show the failed ones in alphabetical order: ![image](https://user-images.githubusercontent.com/739070/123663020-84e63100-d825-11eb-9b35-0a8c30cd219c.png) Also this PR cuts down the execution time from ~40 to ~9 seconds
2021-08-15Auto merge of #87975 - m-ou-se:unused-import-attributes, r=nagisabors-0/+33
Include attributes in removal span for unused imports. Fixes https://github.com/rust-lang/rust/issues/87973
2021-08-14Auto merge of #87581 - Amanieu:asm_clobber_abi, r=nagisabors-77/+310
Add support for clobber_abi to asm! This PR adds the `clobber_abi` feature that was proposed in #81092. Fixes #81092 cc `@rust-lang/wg-inline-asm` r? `@nagisa`
2021-08-14More spacing between the different blocks of resultsStefan Schindler-10/+17
2021-08-14Implement a finish method for the status_bar and some cleanupStefan Schindler-5/+11
2021-08-14Auto merge of #83417 - erikdesjardins:enableremovezsts, r=oli-obkbors-53/+21
Run RemoveZsts pass at mir-opt-level=1 per https://github.com/rust-lang/rust/pull/83177#issuecomment-803942217 This pass removes assignments to ZST places. Perf (from https://github.com/rust-lang/rust/pull/83177#issuecomment-803442557): https://perf.rust-lang.org/compare.html?start=41b315a470d583f6446599984ff9ad3bd61012b2&end=bd5d1b96f0c64c9938feea831789e1b5bb2cd4a2 r? `@oli-obk`
2021-08-14Auto merge of #87324 - asquared31415:named-asm-labels, r=Amanieubors-0/+407
Lint against named asm labels This adds a deny-by-default lint to prevent the use of named labels in inline `asm!`. Without a solution to #81088 about whether the compiler should rewrite named labels or a special syntax for labels, a lint against them should prevent users from writing assembly that could break for internal compiler reasons, such as inlining or anything else that could change the number of actual inline assembly blocks emitted. This does **not** resolve the issue with rewriting labels, that still needs a decision if the compiler should do any more work to try to make them work.
2021-08-14Auto merge of #87375 - fee1-dead:move-constness-to-traitpred, r=oli-obkbors-47/+64
Try filtering out non-const impls when we expect const impls **TL;DR**: Associated types on const impls are now bounded; we now disallow calling a const function with bounds when the specified type param only has a non-const impl. r? `@oli-obk`
2021-08-14Auto merge of #87600 - JohnTitor:classify-ui-tests, r=petrochenkovbors-27/+1
Move some UI tests to more suitable subdirs The classifui result: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427/e06c42226c6038da91e403c33b9947843420cf44 Some notes: - backtrace-debuginfo.rs: previously I skipped this, I'm still not sure what the best dir is. Any ideas? - estr-subtyping.rs: Seems a quite old test so removed, shouldn't? - deref-suggestion.rs: moved to inference as `suggestions` is not an ideal dir. - issue-43023.rs: a bit misclassified, moved to `derives` cc #73494 r? `@petrochenkov`
2021-08-14Auto merge of #85020 - lrh2000:named-upvars, r=tmandrybors-7/+161
Name the captured upvars for closures/generators in debuginfo Previously, debuggers print closures as something like ``` y::main::closure-0 (0x7fffffffdd34) ``` The pointer actually references to an upvar. It is not very obvious, especially for beginners. It's because upvars don't have names before, as they are packed into a tuple. This PR names the upvars, so we can expect to see something like ``` y::main::closure-0 {_captured_ref__b: 0x[...]} ``` r? `@tmandry` Discussed at https://github.com/rust-lang/rust/pull/84752#issuecomment-831639489 .
2021-08-14Auto merge of #88006 - GuillaumeGomez:update-browser-ui-test-dep, r=notriddlebors-1/+1
Update browser-ui-test package version r? `@notriddle`
2021-08-14Auto merge of #87997 - sl4m:update-favicon-order, r=GuillaumeGomezbors-2/+2
Updates favicon order of precedence as it matters to Chrome Hi, this updates #75438 to fix an order of precedence issue for Chrome. Unfortunately, the last favicon defined wins when it comes to Chrome, hence the primary icon being placed last. I [brought it up](https://bugs.chromium.org/p/chromium/issues/detail?id=1104663) with the Chromium team last year, but so far it's a non-issue. I've created an example website that mimics the behaviour in Chrome. https://sl4m.github.io/chrome-favicon/ This is what I'm seeing at the moment when viewing https://doc.rust-lang.org/core/index.html in Chrome. It's falling back to the PNG. <img width="80" alt="Screenshot 2021-08-12 at 21 11 58" src="https://user-images.githubusercontent.com/47347/129304041-b598213e-fcd3-4df1-addb-e6feac6c35b1.png">
2021-08-13Auto merge of #87478 - jackh726:issue-84931, r=estebankbors-4/+105
Point to where clause for GATs to add bound Fixes #84931 r? `@estebank`
2021-08-13Point to where clause for GATsjackh726-4/+105
2021-08-13Auto merge of #86492 - hyd-dev:no-mangle-method, r=petrochenkovbors-202/+805
Associated functions that contain extern indicator or have `#[rustc_std_internal_symbol]` are reachable Previously these fails to link with ``undefined reference to `foo'``: <details> <summary>Example 1</summary> ```rs struct AssocFn; impl AssocFn { #[no_mangle] fn foo() {} } fn main() { extern "Rust" { fn foo(); } unsafe { foo() } } ``` ([Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f1244afcdd26e2a28445f6e82ca46b50)) </details> <details> <summary>Example 2</summary> ```rs #![crate_name = "lib"] #![crate_type = "lib"] struct AssocFn; impl AssocFn { #[no_mangle] fn foo() {} } ``` ```rs extern crate lib; fn main() { extern "Rust" { fn foo(); } unsafe { foo() } } ``` </details> But I believe they should link successfully, because this works: <details> ```rs #[no_mangle] fn foo() {} fn main() { extern "Rust" { fn foo(); } unsafe { foo() } } ``` ([Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=789b3f283ee6126f53939429103ed98d)) </details> This PR fixes the problem, by adding associated functions that have "custom linkage" to `reachable_set`, just like normal functions. I haven't tested whether #76211 and [Miri](https://github.com/rust-lang/miri/issues/1837) are fixed by this PR yet, but I'm submitting this anyway since this fixes the examples above. I added a `run-pass` test that combines my two examples above, but I'm not sure if that's the right way to test this. Maybe I should add / modify an existing codegen test (`src/test/codegen/export-no-mangle.rs`?) instead?
2021-08-13Auto merge of #87984 - m-ou-se:closure-lint-wording, r=Aaron1011bors-280/+280
Closure lint wording Some small changes to the wording of the closure migration lint. r? `@Aaron1011`
2021-08-13Update tests for new closure migration lint wording.Mara Bos-280/+280
2021-08-13Rollup merge of #88005 - GuillaumeGomez:headers-gui-tests, r=notriddleGuillaume Gomez-1/+47
Add rustdoc GUI test for headers Add test for #87861. r? ``@notriddle``
2021-08-13Rollup merge of #87966 - pietroalbini:fix-pidfd-test, r=m-ou-seGuillaume Gomez-1/+12
Fix `command-create-pidfd` test inside unprivileged Docker containers In `src/test/ui/command/command-create-pidfd.rs` (added #81825), the detection code to skip the test on unsupported platforms doesn't account for unprivileged Docker containers (CI uses privileged containers), which leads to a test failure as you can't call the `clone3` syscall in that environment. This PR enhances the detection code to also consider unprivileged containers.
2021-08-13Rollup merge of #87795 - estebank:erase-lifetimes-in-suggestion, r=oli-obkGuillaume Gomez-1/+30
Avoid ICE caused by suggestion When suggesting dereferencing something that can be iterable in a `for` loop, erase lifetimes and use a fresh `ty::ParamEnv` to avoid 'region constraints already solved' panic. Fix #87657, fix #87709, fix #87651.
2021-08-13Update browser-ui-test package versionGuillaume Gomez-1/+1
2021-08-13Add rustdoc GUI test for headersGuillaume Gomez-1/+47
2021-08-13Fix Cargo.lock and ui testDeadbeef-1/+1
2021-08-13Update non-fmt-panic tests.Mara Bos-27/+75
2021-08-13Bless testDeadbeef-4/+4
2021-08-13Make assoc types work with `?const `opt=outDeadbeef-1/+11
2021-08-13Moved ui testDeadbeef-20/+0
2021-08-13Fix testsDeadbeef-2/+4
2021-08-13Fix call-generic-method-nonconst testDeadbeef-3/+15
2021-08-13Fix assoc-type testDeadbeef-5/+20
2021-08-13move Constness into TraitPredicateDeadbeef-14/+12
2021-08-13Auto merge of #87956 - m-ou-se:closure-migration-macro-body, r=Aaron1011bors-0/+56
Fix closure migration suggestion when the body is a macro. Fixes https://github.com/rust-lang/rust/issues/87955 Before: ``` warning: changes to closure capture in Rust 2021 will affect drop order --> src/main.rs:5:13 | 5 | let _ = || panic!(a.0); | ^^^^^^^^^^---^ | | | in Rust 2018, closure captures all of `a`, but in Rust 2021, it only captures `a.0` 6 | } | - in Rust 2018, `a` would be dropped here, but in Rust 2021, only `a.0` would be dropped here alongside the closure | help: add a dummy let to cause `a` to be fully captured | 20~ ($msg:expr $(,)?) => ({ let _ = &a; 21+ $crate::rt::begin_panic($msg) 22~ }), | ``` After: ``` warning: changes to closure capture in Rust 2021 will affect drop order --> src/main.rs:5:13 | 5 | let _ = || panic!(a.0); | ^^^^^^^^^^---^ | | | in Rust 2018, closure captures all of `a`, but in Rust 2021, it only captures `a.0` 6 | } | - in Rust 2018, `a` would be dropped here, but in Rust 2021, only `a.0` would be dropped here alongside the closure | help: add a dummy let to cause `a` to be fully captured | 5 | let _ = || { let _ = &a; panic!(a.0) }; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
2021-08-13Auto merge of #87954 - flip1995:clippyup, r=Manishearthbors-375/+1311
Update Clippy r? `@Manishearth`
2021-08-12Updates favicon order of precedence as it matters to Chromeskim-2/+2
2021-08-12Rollup merge of #87965 - m-ou-se:non-fmt-panic-external, r=estebankManish Goregaokar-12/+6
Silence non_fmt_panic from external macros. This stops the non_fmt_panic lint from triggering if a macro from another crate is entirely responsible. In those cases there's nothing that the current crate can/should do. See also https://github.com/rust-lang/rust/issues/87621#issuecomment-890311054
2021-08-12Rollup merge of #87953 - m-ou-se:closure-migration-multiline-formatting, ↵Manish Goregaokar-81/+108
r=petrochenkov Improve formatting of closure capture migration suggestion for multi-line closures. Fixes https://github.com/rust-lang/rust/issues/87952 Before: ``` help: add a dummy let to cause `a` to be fully captured | 5 ~ let _ = || { let _ = &a; 6 + dbg!(a.0); 7 ~ }; | ``` After: ``` help: add a dummy let to cause `a` to be fully captured | 5 ~ let _ = || { 6 + let _ = &a; 7 + dbg!(a.0); 8 ~ }; | ```
2021-08-12Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddybManish Goregaokar-0/+476
Add c_enum_min_bits target spec field, use for arm-none and thumb-none targets Fixes https://github.com/rust-lang/rust/issues/87917 <s>Haven't tested this yet, still playing around.</s> This seems to fix the issue.
2021-08-12Rollup merge of #87916 - nbdd0121:black_box, r=nagisaManish Goregaokar-1/+1
Implement `black_box` using intrinsic Introduce `black_box` intrinsic, as suggested in https://github.com/rust-lang/rust/pull/87590#discussion_r680468700. This is still codegenned as empty inline assembly for LLVM. For MIR interpretation and cranelift it's treated as identity. cc `@Amanieu` as this is related to inline assembly cc `@bjorn3` for rustc_codegen_cranelift changes cc `@RalfJung` as this affects MIRI r? `@nagisa` I suppose
2021-08-12Add c_enum_min_bits to target specManish Goregaokar-0/+476
2021-08-13Add tests for `#[no_mangle]` in `impl` blocks that looks like generic `impl` ↵hyd-dev-3/+57
blocks but are actually not
2021-08-12Add test or unused import removal suggestion with attributes.Mara Bos-0/+33
2021-08-12Implement `black_box` using intrinsicGary Guo-1/+1
The new implementation allows some `memcpy`s to be optimized away, so the uninit value in ui/sanitize/memory.rs is constructed directly onto the return place. Therefore the sanitizer now says that the value is allocated by `main` rather than `random`.
2021-08-12Adjust `check_no_mangle` and `check_export_name` to warn/error on ↵hyd-dev-184/+234
`#[no_mangle]`/`#[export_name]` on trait methods