summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-05-18Auto merge of #97128 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum 1.61.0bors-20/+12
[stable] 1.61 stable rebuild * New version of release notes (from as-yet unmerged https://github.com/rust-lang/rust/pull/96539) * Manual patch to drop clippy's needless_match lint to nursery, per [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/release.201.2E61.2E0/near/282717457) r? `@Mark-Simulacrum`
2022-05-17Drop needless match to clippy's nurseryMark Rousskov-3/+2
This lint has a false positive and there's not an easy backport available, particularly given how late in the cycle we are at this point.
2022-05-17Adjust release notes per upstreamMark Rousskov-17/+10
2022-05-16Auto merge of #97084 - Mark-Simulacrum:stable-next, r=Mark-Simulacrumbors-1/+289
[stable] Rust 1.61 * Cherry-picking release notes from not yet landed #96539. r? `@Mark-Simulacrum`
2022-05-16Switch to stable channelMark Rousskov-1/+1
2022-05-16Add release notesMark Rousskov-0/+288
Cherry-picking from not yet landed PR#96539.
2022-05-14Auto merge of #97040 - cjgillot:no-rpit-hrtb-beta, r=jackh726bors-94/+235
Forbid nested opaque types to reference HRTB from opaque types. Backport version of https://github.com/rust-lang/rust/pull/97039 if useful. r? `@Mark-Simulacrum`
2022-05-14Add a test with both passing and erroneous cases.Camille GILLOT-0/+146
2022-05-14Forbid nested opaque types to reference HRTB from opaque types.Camille GILLOT-94/+89
2022-05-14Auto merge of #97014 - Mark-Simulacrum:beta-next, r=Mark-Simulacrumbors-96/+205
[beta] backports This backports/rolls up: * Quick fix for #96223. #96679 * [beta] Revert #92519 on beta #96556 * [beta] Clippy backport ICE/infinite loop fix #96740 * Revert "Prefer projection candidates instead of param_env candidates for Sized predicates" #96593
2022-05-13Revert #92191 Prefer projection candidates instead of param_env candidates ↵Jack Huey-17/+64
for Sized predicates
2022-05-13Fix UI testMark Rousskov-1/+0
2022-05-13Move only_used_in_recursion to nurseryflip1995-3/+9
2022-05-13Prevent infinite (exponential) recursion in only_used_in_recursionflip1995-31/+16
This simplifies the visitor code a bit and prevents checking expressions multiple times. I still think this lint should be removed for now, because its code isn't really tested.
2022-05-13Taking review hints into account.ricked-twice-9/+8
2022-05-13Quick fix for #96223.ricked-twice-1/+88
2022-05-13Revert "Rollup merge of #92519 - ChrisDenton:command-maybe-verbatim, r=dtolnay"Chris Denton-44/+30
This reverts commit ba2d5ede70ed7e37d7f13a397b9d554e2386a19c, reversing changes made to 9b701e7eaa08c2b2ef8c6e59b8b33436cb10aa45.
2022-05-04Auto merge of #96692 - ehuss:beta-backports, r=ehussbors-449/+110
[beta] Beta backports * Revert diagnostic duplication and accidental stabilization #96516 * Revert "Re-export core::ffi types from std::ffi" #96492 * Make [e]println macros eagerly drop temporaries (for backport) #96490 * Revert "impl From<&[T; N]> and From<&mut [T; N]> for Vec<T>" #96489 * Cargo: * move workspace inheritance unstable docs to the correct place (rust-lang/cargo#10616)
2022-05-03Rollup merge of #96516 - oli-obk:impl_trait_inference_accidental_permitted, ↵Dylan DPC-384/+97
r=jackh726 Revert diagnostic duplication and accidental stabilization fixes #96460 this is an accidental stabilization that we should put into the beta. I believe it is low-risk, because it was literally what we had before #94081 The effect on tests is massive, but mostly deduplication of diagnostics and some minor span changes.
2022-05-03Rollup merge of #96492 - joshtriplett:revert-std-ffi-re-export, r=yaahcDylan DPC-10/+0
Revert "Re-export core::ffi types from std::ffi" This reverts commit 9aed829fe6cdf5eaf278c6c3972f7acd0830887d. Fixes https://github.com/rust-lang/rust/issues/96435 , a regression in crates doing `use std::ffi::*;` and `use std::os::raw::*;`. We can re-add this re-export once the `core::ffi` types are stable, and thus the `std::os::raw` types can become re-exports as well, which will avoid the conflict. (Type aliases to the same type still conflict, but re-exports of the same type don't.)
2022-05-03Auto merge of #96490 - dtolnay:writetmpbackport, r=Mark-Simulacrumbors-13/+13
Make [e]println macros eagerly drop temporaries (for backport) This PR extracts the subset of #96455 which is only the parts necessary for fixing the 1.61-beta regressions in #96434. My larger PR #96455 contains a few other changes relative to the pre-#94868 behavior; those are not necessary to backport into 1.61. argument position | before #94868 | after #94868 | after this PR --- |:---:|:---:|:---: `write!($tmp, "…", …)` | :rage: | :rage: | :rage: `write!(…, "…", $tmp)` | :rage: | :rage: | :rage: `writeln!($tmp, "…", …)` | :rage: | :rage: | :rage: `writeln!(…, "…", $tmp)` | :rage: | :rage: | :rage: `print!("…", $tmp)` | :rage: | :rage: | :rage: `println!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat: `eprint!("…", $tmp)` | :rage: | :rage: | :rage: `eprintln!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat: `panic!("…", $tmp)` | :smiley_cat: | :smiley_cat: | :smiley_cat:
2022-05-03Auto merge of #96489 - shepmaster:revert-vec-from-array-ref, r=yaahcbors-42/+0
Revert "impl From<&[T; N]> and From<&mut [T; N]> for Vec<T>" This reverts commit 5dd702763ae0e112332a4447171adbed51aeee3d.
2022-05-03[beta] Update cargoEric Huss-0/+0
2022-04-25Auto merge of #96367 - Mark-Simulacrum:beta-next, r=Mark-Simulacrumbors-454/+196
[beta] backports rollup * Remove NodeIdHashingMode. #95656 * Check that all hidden types are the same and then deduplicate them. #95731 r? `@Mark-Simulacrum`
2022-04-24Backport fixes -- drop uses of NodeIdHashingModeMark Rousskov-6/+2
2022-04-24Bless tests.Camille GILLOT-30/+30
2022-04-24Remove NodeIdHashingMode.Camille GILLOT-356/+54
2022-04-24Check that all hidden types are the same and then deduplicate them.Oli Scherer-62/+110
2022-04-17Auto merge of #96138 - erikdesjardins:revertinl, r=Mark-Simulacrumbors-2/+2
[beta] Revert: Make TLS __getit #[inline(always)] on non-Windows Fixes #96132 r? `@Mark-Simulacrum`
2022-04-17Revert "Auto merge of #94373 - erikdesjardins:getitinl, r=Mark-Simulacrum"Erik Desjardins-2/+2
This reverts commit 035a717ee8bf548868fb50b5c7ca562fc4a657a7, reversing changes made to 761e8884858759b21f3374ad610494e68c087a38.
2022-04-09Auto merge of #95806 - pietroalbini:pa-1.61.0-beta-stage0, r=Mark-Simulacrumbors-340/+283
[beta] Bump stage0 to 1.60.0 r? `@Mark-Simulacrum`
2022-04-08bump stage0 to 1.60.0Pietro Albini-340/+283
2022-04-05Auto merge of #95641 - pietroalbini:pa-1.61.0-beta, r=pietroalbinibors-3/+3
Prepare 1.61.0 beta release Just a channel and RLS bump this time. r? `@ghost`
2022-04-05bump rlsPietro Albini-2/+2
2022-04-04bump channel to betaPietro Albini-1/+1
2022-04-04Auto merge of #95031 - compiler-errors:param-env-cache, r=Aaron1011bors-12/+20
Do not use `ParamEnv::and` when building a cache key from a param-env and trait eval candidate Do not use `ParamEnv::and` to cache a param-env with a selection/evaluation candidate. This is because if the param-env is `RevealAll` mode, and the candidate looks global (i.e. it has erased regions, which can show up when we normalize a projection type under a binder<sup>1</sup>), then when we use `ParamEnv::and` to pair the candidate and the param-env for use as a cache key, we will throw away the param-env's caller bounds, and we'll end up caching a candidate that we inferred from the param-env with a empty param-env, which may cause cache-hit later when we have an empty param-env, and possibly mess with normalization like we see in the referenced issue during codegen. Not sure how to trigger this with a more structured test, but changing `check-pass` to `build-pass` triggers the case that https://github.com/rust-lang/rust/issues/94903 detected. <sup>1.</sup> That is, we will replace the late-bound region with a placeholder, which gets canonicalized and turned into an infererence variable, which gets erased during region freshening right before we cache the result. Sorry, it's quite a few steps. Fixes #94903 r? `@Aaron1011` (or reassign as you see fit)
2022-04-04Auto merge of #95606 - petrochenkov:linkregr, r=wesleywiserbors-1/+6
linker: Implicitly link native libs as whole-archive in some more cases Partially revert changes from https://github.com/rust-lang/rust/pull/93901 to address regressions like https://github.com/rust-lang/rust/issues/95561. Fixes https://github.com/rust-lang/rust/issues/95561 r? `@wesleywiser`
2022-04-03Auto merge of #95619 - bjorn3:inline_location_caller, r=scottmcmbors-0/+1
Mark Location::caller() as #[inline] This function gets compiled to a single register move as it actually gets it's return value passed in as argument.
2022-04-03Auto merge of #95624 - Dylan-DPC:rollup-r8w7ui3, r=Dylan-DPCbors-1308/+1421
Rollup of 5 pull requests Successful merges: - #95202 (Reduce the cost of loading all built-ins targets) - #95553 (Don't emit non-asm contents error for naked function composed of errors) - #95613 (Fix rustdoc attribute display) - #95617 (Fix &mut invalidation in ptr::swap doctest) - #95618 (core: document that the align_of* functions return the alignment in bytes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-03Rollup merge of #95618 - adamse:master, r=dtolnayDylan DPC-5/+8
core: document that the align_of* functions return the alignment in bytes
2022-04-03Rollup merge of #95617 - saethlin:swap-test-invalidation, r=Dylan-DPCDylan DPC-2/+3
Fix &mut invalidation in ptr::swap doctest Under Stacked Borrows with raw pointer tagging, the previous code was UB because the code which creates the the second pointer borrows the array through a tag in the borrow stacks below the Unique tag that our first pointer is based on, thus invalidating the first pointer. This is not definitely a bug and may never be real UB, but I desperately want people to write code that conforms to SB with raw pointer tagging so that I can write good diagnostics. The alternative aliasing models aren't possible to diagnose well due to state space explosion. Therefore, it would be super cool if the standard library nudged people towards writing code that is valid with respect to SB with raw pointer tagging. The diagnostics that I want to write are implemented in a branch of Miri and the one for this case is below: ``` error: Undefined Behavior: attempting a read access using <2170> at alloc1068[0x0], but that tag does not exist in the borrow stack for this location --> /home/ben/rust/library/core/src/intrinsics.rs:2103:14 | 2103 | unsafe { copy_nonoverlapping(src, dst, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | attempting a read access using <2170> at alloc1068[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at alloc1068[0x0..0x8] | = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: <2170> was created due to a retag at offsets [0x0..0x10] --> ../libcore/src/ptr/mod.rs:640:9 | 8 | let x = array[0..].as_mut_ptr() as *mut [u32; 2]; // this is `array[0..2]` | ^^^^^^^^^^^^^^^^^^^^^^^ help: <2170> was later invalidated due to a retag at offsets [0x0..0x10] --> ../libcore/src/ptr/mod.rs:641:9 | 9 | let y = array[2..].as_mut_ptr() as *mut [u32; 2]; // this is `array[2..4]` | ^^^^^ = note: inside `std::intrinsics::copy_nonoverlapping::<[u32; 2]>` at /home/ben/rust/library/core/src/intrinsics.rs:2103:14 = note: inside `std::ptr::swap::<[u32; 2]>` at /home/ben/rust/library/core/src/ptr/mod.rs:685:9 note: inside `main::_doctest_main____libcore_src_ptr_mod_rs_635_0` at ../libcore/src/ptr/mod.rs:12:5 --> ../libcore/src/ptr/mod.rs:644:5 | 12 | ptr::swap(x, y); | ^^^^^^^^^^^^^^^ note: inside `main` at ../libcore/src/ptr/mod.rs:15:3 --> ../libcore/src/ptr/mod.rs:647:3 | 15 | } _doctest_main____libcore_src_ptr_mod_rs_635_0() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace error: aborting due to previous error ```
2022-04-03Rollup merge of #95613 - GuillaumeGomez:fix-rustdoc-attr-display, r=notriddleDylan DPC-1/+13
Fix rustdoc attribute display Fixes #81482. r? `@notriddle`
2022-04-03Rollup merge of #95553 - jam1garner:naked-function-compile-error, r=tmiaskoDylan DPC-4/+60
Don't emit non-asm contents error for naked function composed of errors ## Motivation For naked functions an error is emitted when they are composed of anything other than a single asm!() block. However, this error triggers in a couple situations in which it adds no additional information or is actively misleading. One example is if you do have an asm!() block but simply one with a syntax error: ```rust #[naked] unsafe extern "C" fn compiler_errors() { asm!(invalid_syntax) } ``` This results in two errors, one for the syntax error itself and another telling you that you need an asm block in your function: ```rust error[E0787]: naked functions must contain a single asm block --> src/main.rs:6:1 | 6 | / unsafe extern "C" fn naked_compile_error() { 7 | | asm!(blah) 8 | | } | |_^ ``` This issue also comes up when [utilizing `compile_error!()` for improving your diagnostics](https://twitter.com/steveklabnik/status/1509538243020218372), such as raising a compiler error when compiling for an unsupported target. ## Implementation The rules this PR implements are as follows: 1. If any non-erroneous non-asm statement is included, an error will still occur 2. If multiple asm statements are included, an error will still occur 3. If 0 or 1 asm statements are present, as well as any non-zero number of erroneous statements, then this error will *not* be raised as it is likely either redundant or incorrect The rule of thumb is effectively "if an error is present and its correction could change things, don't raise an error".
2022-04-03Rollup merge of #95202 - Urgau:check-cfg-perf-well-known-values, r=petrochenkovDylan DPC-1296/+1337
Reduce the cost of loading all built-ins targets This PR started by measuring the exact slowdown of checking of well known conditional values. Than this PR implemented some technics to reduce the cost of loading all built-ins targets. cf. https://github.com/rust-lang/rust/issues/82450#issuecomment-1073992323
2022-04-03Fix &mut invalidation in ptr::swap doctestBen Kimock-2/+3
Under Stacked Borrows with raw pointer tagging, the previous code was UB because the code which creates the the second pointer borrows the array through a tag in the borrow stacks below the Unique tag that our first pointer is based on, thus invalidating the first pointer. This is not definitely a bug and may never be real UB, but I desperately want people to write code that conforms to SB with raw pointer tagging so that I can write good diagnostics. The alternative aliasing models aren't possible to diagnose well due to state space explosion. Therefore, it would be super cool if the standard library nudged people towards writing code that is valid with respect to SB with raw pointer tagging.
2022-04-03Cleanup after some refactoring in rustc_targetLoïc BRANSTETT-112/+79
2022-04-03Replace LinkArgs with Cow<'static, str>Loïc BRANSTETT-11/+12
2022-04-03Replace every Vec in Target(Options) with it's Cow equivalentLoïc BRANSTETT-53/+117
2022-04-03Replace every `String` in Target(Options) with `Cow<'static, str>`Loïc BRANSTETT-1243/+1252
2022-04-03Auto merge of #95610 - createyourpersonalaccount:derefmut-docfix, r=Dylan-DPCbors-1/+1
Improve doc example of DerefMut It is more illustrative, after using `*x` to modify the field, to show in the assertion that the field has indeed been modified.