about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-10-26Auto merge of #2614 - saethlin:stack-inspection-tools, r=RalfJungbors-14/+47
Improve miri_print_borrow_stacks Per post-merge review on https://github.com/rust-lang/miri/pull/2322 * `miri_print_stacks` renamed to `miri_print_borrow_stacks` * A bit more details in docs, clarified how unstable these functions are meant to be * Print an `unknown_bottom` if one exists Open question: Currently `miri_get_alloc_id` gets the expected `AllocId` for `Wildcard` pointers, but for pointers with no provenance, the function reports UB and halts the interpreter. That's definitely wrong. But what _should_ we do? Is it reasonable to check if the pointer has `None` provenance and try to get an `AllocId` for its address? That still leaves us with a failure path, which in this case might be best-handled as an ICE? I'm just not sure that changing the return type of `miri_get_alloc_id` to `Option` is a win because it complicates all normal uses of this.
2022-10-26tweak docsRalf Jung-1/+4
2022-10-25Rename, improve docs, fail betterBen Kimock-14/+44
2022-10-25Auto merge of #2618 - RalfJung:rustup, r=RalfJungbors-10340/+20811
Rustup
2022-10-25bless clippyRalf Jung-34/+34
2022-10-25rustupRalf Jung-1/+1
2022-10-25Merge branch 'master' of ↵Ralf Jung-10305/+20776
http://localhost:8000/rust-lang/rust.git:at_commit=75dd959a3a40eb5b4574f8d2e23aa6efbeb33573[:prefix=src/tools/miri]:/src/tools/miri
2022-10-25Auto merge of #103392 - RalfJung:miri, r=oli-obkbors-470/+1522
update Miri I had to use a hacked version of josh to create this, so let's be careful with merging this and maybe wait a bit to see if the josh issue becomes more clear. But the history looks good to me, we are not adding duplicates of rustc commits that were previously mirrored to Miri. Also I want to add some cross-testing of Miri in x.py.
2022-10-25Miri: disable macOS testing for nowRalf Jung-1/+2
2022-10-25Auto merge of #103513 - Dylan-DPC:rollup-nn3ite2, r=Dylan-DPCbors-118/+203
Rollup of 6 pull requests Successful merges: - #98204 (Stabilize `Option::unzip()`) - #102587 (rustc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`) - #103122 (Remove misc_cast and validate types when casting) - #103379 (Truncate thread names on Linux and Apple targets) - #103482 (Clairify Vec::capacity docs) - #103511 (Codegen tweaks) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-25Rollup merge of #103511 - nnethercote:bb-tweaks, r=bjorn3Dylan DPC-82/+75
Codegen tweaks Best reviewed one commit at a time. r? `@bjorn3`
2022-10-25Rollup merge of #103482 - aDotInTheVoid:vec-cap-docs, r=thomccDylan DPC-2/+3
Clairify Vec::capacity docs Update both the text and example to be clear that the method gives *total*, (not *spare*) capacity Fixes #103326
2022-10-25Rollup merge of #103379 - cuviper:truncate-thread-name, r=thomccDylan DPC-0/+49
Truncate thread names on Linux and Apple targets These targets have system limits on the thread names, 16 and 64 bytes respectively, and `pthread_setname_np` returns an error if the name is longer. However, we're not in a context that can propagate errors when we call this, and we used to implicitly truncate on Linux with `prctl`, so now we manually truncate these names ahead of time. r? ``````@thomcc``````
2022-10-25Rollup merge of #103122 - ouz-a:mir-technical-debt, r=oli-obkDylan DPC-28/+66
Remove misc_cast and validate types when casting Continuing our work in #102675 r? ````@oli-obk````
2022-10-25Rollup merge of #102587 - Enselic:rustc-unix_sigpipe, r=jackh726Dylan DPC-1/+3
rustc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler` This is the first (known) step towards starting to use `unix_sigpipe` in the wild. Eventually, `rustc_driver::set_sigpipe_handler` can be removed and all clients can use `unix_sigpipe` instead. For now we just start using `unix_sigpipe` in one place: `rustc` itself. It is easy to manually verify this change. If you remove `#[unix_sigpipe = "sig_dfl"]` and run `./x.py build` you will get an ICE when you do `./build/x86_64-unknown-linux-gnu/stage1/bin/rustc --help | false`. Add back `#[unix_sigpipe = "sig_dfl"]` and the ICE disappears again. PR that added `set_sigpipe_handler`: https://github.com/rust-lang/rust/pull/49606 Tracking issue for `unix_sigpipe`: #97889 Not sure exactly how to label this PR. Going with T-libs for now since this is a T-libs feature. ````@rustdoc```` labels +T-libs
2022-10-25Rollup merge of #98204 - Kixiron:stable-unzip, r=thomccDylan DPC-5/+7
Stabilize `Option::unzip()` Stabilizes `Option::unzip()`, closes #87800 ```@rustbot``` modify labels: +T-libs-api
2022-10-25Auto merge of #102988 - dpaoliello:inlinerawdylib, r=dpaoliellobors-7/+146
Support raw-dylib functions being used inside inlined functions Fixes #102714 Issue Details: When generating the import library for `raw-dylib` symbols, we currently only use the functions and variables declared within the current crate. This works fine if all crates are static libraries or `rlib`s as the generated import library will be contained in the static library or `rlib` itself, but if a dependency is a dynamic library AND the use of a `raw-dylib` function or variable is inlined or part of a generic instantiation then the current crate won't see its dependency's import library and so linking will fail. Fix Details: Instead, when we generate the import library for a `dylib` or `bin` crate, we will now generate it for the symbols both for the current crate and all upstream crates. We do this in two steps so that the import library for the current crate is passed into the linker first, thus it is preferred if there are any ambiguous symbols.
2022-10-25Simplify `cast_shift_expr_rhs`.Nicholas Nethercote-24/+18
It's only ever used with shift operators.
2022-10-25Inline and remove `cast_shift_rhs`.Nicholas Nethercote-9/+0
It has a single call site.
2022-10-25Auto merge of #103502 - JohnTitor:rollup-o6mhyzq, r=JohnTitorbors-102/+376
Rollup of 11 pull requests Successful merges: - #103333 (Fix assertion failed for break_last_token and trailing token) - #103350 (Change terminology for assoc method suggestions when they are not called) - #103382 (Don't ICE when reporting borrowck errors involving regions from `anonymous_lifetime_in_impl_trait`) - #103409 (Delay span bug when we can't map lifetimes back in `collect_trait_impl_trait_tys`) - #103410 (-Z docs: Add link to unstable book) - #103462 (rustdoc: remove no-op CSS `.source pre.rust { white-space: pre }`) - #103465 (E0210 explanation: remove redundant sentence) - #103486 (Use functions in highlight-colors rustdoc GUI test) - #103493 (rustdoc: remove unused `.sidebar-logo` DOM on source pages) - #103494 (rustdoc: remove redundant CSS `a.test-arrow:hover`) - #103495 (rustdoc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-25Clarify some cleanup stuff.Nicholas Nethercote-6/+10
- Rearrange the match in `llbb_with_landing_pad` so the `(Some,Some)` cases are together. - Add assertions to indicate two MSVC-only paths.
2022-10-25Rename two `TerminatorCodegenHelper` methods.Nicholas Nethercote-13/+16
`TerminatorCodegenHelper` has three methods `llblock`, `llbb`, and `lltarget`. They're all similar, but the names given no indication of the differences. This commit renames `lltarget` as `llbb_with_landing_pad`, and `llblock` as `llbb_with_cleanup`. These aren't fantastic names, but at least it's now clear that `llbb` is the lowest-level of the three and the other two wrap it.
2022-10-25rustc_codegen_ssa: use more consistent naming.Nicholas Nethercote-30/+31
Ensure: - builders always have a `bx` suffix; - backend basic blocks always have an `llbb` suffix, - paired builders and basic blocks have consistent prefixes.
2022-10-24Support raw-dylib functions being used inside inlined functionsDaniel Paoliello-7/+146
2022-10-25Rollup merge of #103495 - Enselic:rustdoc-unix_sigpipe, r=notriddleYuki Okushi-1/+3
rustdoc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler` Do what was already done for `rustc` in #102587, namely start using `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`. After this has been merged, we can completely remove `rustc_driver::set_sigpipe_handler`. PR that added `set_sigpipe_handler`: https://github.com/rust-lang/rust/pull/49606 Tracking issue for `unix_sigpipe`: #97889 Verification of this change --------------------------- 1. Remove `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE 1. Add back `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE fixed ``@rustbot`` labels +T-rustdoc
2022-10-25Rollup merge of #103494 - notriddle:notriddle/test-arrow-hover, r=GuillaumeGomezYuki Okushi-3/+0
rustdoc: remove redundant CSS `a.test-arrow:hover` In 4b402dbe690dd00f567542ca9e41042826a168b5, when this rule was added, it was overriding a rule that made all links in docblock get an underline when hovered. This became redundant when, after reordering the rules, 7585632052298f9c84cc12ac5afcb23786ae1d3d changed the pro-underline rule to exclude the test-arrow link anyway.
2022-10-25Rollup merge of #103493 - notriddle:notriddle/source-sidebar-logo, ↵Yuki Okushi-5/+7
r=GuillaumeGomez rustdoc: remove unused `.sidebar-logo` DOM on source pages
2022-10-25Rollup merge of #103486 - ↵Yuki Okushi-52/+89
GuillaumeGomez:cleanup-rustdoc-gui-highlight-colors, r=notriddle Use functions in highlight-colors rustdoc GUI test r? ``@notriddle``
2022-10-25Rollup merge of #103465 - jruderman:patch-1, r=compiler-errorsYuki Okushi-2/+0
E0210 explanation: remove redundant sentence
2022-10-25Rollup merge of #103462 - notriddle:notriddle/source-pre-rust-white-space, ↵Yuki Okushi-1/+0
r=Dylan-DPC rustdoc: remove no-op CSS `.source pre.rust { white-space: pre }` This rule, added in 49e6db7f3510a99ab3d3723b2430add985629c39, overrode a rule in normalize.css. https://github.com/rust-lang/rust/blob/49e6db7f3510a99ab3d3723b2430add985629c39/src/librustdoc/html/static/normalize.css#L169-L175 When normalize.css was updated, this rule went away. https://github.com/necolas/normalize.css/commit/a8edd0c5aa06b905e8e1550fd6a5c01e46375194
2022-10-25Rollup merge of #103410 - camsteffen:link-unstable-book, r=JohnTitorYuki Okushi-1/+1
-Z docs: Add link to unstable book
2022-10-25Rollup merge of #103409 - compiler-errors:rpitit-signature-mismatch, r=lcnrYuki Okushi-2/+47
Delay span bug when we can't map lifetimes back in `collect_trait_impl_trait_tys` When a lifetime is late-bound in a trait signature, but early-bound in an impl signature, we already emit an error -- however, we also ICE in `collect_trait_impl_trait_tys`, so just delay a bug here. Fixes #103407
2022-10-25Rollup merge of #103382 - compiler-errors:anon-apit-lt-region-ice, r=cjgillotYuki Okushi-8/+120
Don't ICE when reporting borrowck errors involving regions from `anonymous_lifetime_in_impl_trait` The issue here is that when we have: ``` trait Trait<'a> { .. } fn foo(arg: impl Trait) { .. } ``` The anonymous lifetime `'_` that we generate for `arg: impl Trait` doesn't end up in the argument type (which is a param) but in a where-clause of the function, in a predicate whose self type is that param ty. Fixes #101660 r? ``@cjgillot``
2022-10-25Rollup merge of #103350 - clubby789:refer-to-assoc-method, r=wesleywiserYuki Okushi-22/+73
Change terminology for assoc method suggestions when they are not called Fixes #103325 ```@rustbot``` label +A-diagnostics
2022-10-25Rollup merge of #103333 - chenyukang:yukang/fix-103143, r=wesleywiserYuki Okushi-5/+36
Fix assertion failed for break_last_token and trailing token Fixes #103143
2022-10-24Delay span bug when we can't map lifetimes back in collect_trait_impl_trait_tysMichael Goulet-2/+47
2022-10-24rustdoc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`Martin Nordholts-1/+3
Start using `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`. After this has been merged, we can completely remove `rustc_driver::set_sigpipe_handler`. Verification of this change --------------------------- 1. Remove `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE 1. Add back `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE fixed
2022-10-24rustdoc: remove redundant CSS `a.test-arrow:hover`Michael Howell-3/+0
In 4b402dbe690dd00f567542ca9e41042826a168b5, when this rule was added, it was overriding a rule that made all links in docblock get an underline when hovered. This became redundant when, after reordering the rules, 7585632052298f9c84cc12ac5afcb23786ae1d3d changed the pro-underline rule to exclude the test-arrow link anyway.
2022-10-24rustdoc: remove unused `.sidebar-logo` DOM on source pagesMichael Howell-5/+7
2022-10-24Auto merge of #103337 - flip1995:clippyup, r=Manishearthbors-4206/+8511
Update Clippy r? `@Manishearth`
2022-10-24Use functions in highlight-colors rustdoc GUI testGuillaume Gomez-52/+89
2022-10-24Document link to unstable bookCameron Steffen-1/+1
2022-10-24Clairify Vec::capacity docsNixon Enraght-Moony-2/+3
Fixes #103326
2022-10-24Auto merge of #94063 - Aaron1011:pretty-print-rental, r=lcnrbors-117/+361
Only apply `ProceduralMasquerade` hack to older versions of `rental` The latest version of `rental` (v0.5.6) contains a fix that allows it to compile without relying on the pretty-print back-compat hack. Hopefully, there are no longer any crates relying on the affected versions of the (much less popular) `procedural-masquerade` crate. This should allow us to target the pretty-print back-compat hack specifically to older versions of `rental`, and specifically mention upgrading to `rental` v0.5.6 in the lint message.
2022-10-24Auto merge of #103471 - JohnTitor:rollup-tfmy6ab, r=JohnTitorbors-731/+1199
Rollup of 7 pull requests Successful merges: - #99578 (Remove redundant lifetime bound from `impl Borrow for Cow`) - #99939 (Sort tests at compile time, not at startup) - #102271 (Stabilize `duration_checked_float`) - #102766 (Don't link to `libresolv` in libstd on Darwin) - #103277 (Update libstd's libc to 0.2.135 (to make `libstd` no longer pull in `libiconv.dylib` on Darwin)) - #103437 (Sync rustc_codegen_cranelift) - #103466 (Fix grammar in docs for std::io::Read) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-24Rollup merge of #103466 - jruderman:patch-2, r=Dylan-DPCYuki Okushi-2/+2
Fix grammar in docs for std::io::Read Two independent clauses were incorrectly joined by a bare comma. The simplest fix would be to switch to a semicolon, but I think it's slightly better to keep the comma and use the coordinating conjunction "so".
2022-10-24Rollup merge of #103437 - bjorn3:sync_cg_clif-2022-10-23, r=bjorn3Yuki Okushi-638/+1043
Sync rustc_codegen_cranelift r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2022-10-24Rollup merge of #103277 - thomcc:bump-libc-135, r=Mark-SimulacrumYuki Okushi-3/+3
Update libstd's libc to 0.2.135 (to make `libstd` no longer pull in `libiconv.dylib` on Darwin) This is to pull in https://github.com/rust-lang/libc/pull/2944. It's related to https://github.com/rust-lang/rust/pull/102766, in that they both remove unused dylibs from libstd on Darwin platforms. As a result, I'm marking this as relnotes since everybody agreed it was good to add it to the other as well. (The note should be about no longer linking against libiconv -- the libc update is irrelevant). Might as well have the same reviewer too. r? `@Mark-Simulacrum`
2022-10-24Rollup merge of #102766 - thomcc:remove-resolv, r=Mark-SimulacrumYuki Okushi-4/+0
Don't link to `libresolv` in libstd on Darwin Currently we link `libresolv` into every Rust program on apple targets despite never using it (as of https://github.com/rust-lang/rust/pull/44965). I had thought we needed this for `getaddrinfo` or something, but we do not / cannot safely use it. I'd like to fix this for `libiconv` too (the other library we pull in. that's harder since it's coming in through `libc`, which is https://github.com/rust-lang/libc/pull/2944)). --- This may warrant release notes. I'm not sure but I've added the flag regardless -- It's a change to the list of dylibs every Rust program pulls in, so it's worth mentioning. It's pretty unlikely anybody was relying on this being pulled in, and `std` does not guarantee that it will link (and thus transitively provide access to) any particular system library -- anybody relying on that behavior would already be broken when dynamically linking std. That is, there's an outside chance something will fail to link on macOS and iOS because it was accidentally relying on our unnecessary dependency. (If that *does* happen, that project could be easily fixed by linking libresolv explicitly on those platforms, probably via `#[link(name = "resolv")] extern {}`,` -Crustc-link-lib=resolv`, `println!("cargo:rustc-link-lib=resolv")`, or one of several places in `.config/cargo.toml`) --- I'm also going to preemptively add the nomination for discussing this in the libs meeting. Basically: Do we care about programs that assume we will bring libraries in that we do not use. `libresolv` and `libiconv` on macOS/iOS are in this camp (`libresolv` because we used to use it, and `libiconv` because the `libc` crate was unintentionally(?) pulling it in to every Rust program). I'd like to remove them both, but this may cause link issues programs that are relying on `std` to depend on them transitively. (Relying on std for this does not work in all build configurations, so this seems very fragile, and like a use case we should not support). More generally, IMO we should not guarantee the specific set of system-provided libraries we use (beyond what is implied by an OS version requirement), which means we'd be free to remove this cruft.
2022-10-24Rollup merge of #102271 - ↵Yuki Okushi-26/+21
lopopolo:lopopolo/stabilize-duration-try-from-secs-float, r=dtolnay Stabilize `duration_checked_float` ## Stabilization Report This stabilization report is for a stabilization of `duration_checked_float`, tracking issue: https://github.com/rust-lang/rust/issues/83400. ### Implementation History - https://github.com/rust-lang/rust/pull/82179 - https://github.com/rust-lang/rust/pull/90247 - https://github.com/rust-lang/rust/pull/96051 - Changed error type to `FromFloatSecsError` in https://github.com/rust-lang/rust/pull/90247 - https://github.com/rust-lang/rust/pull/96051 changes the rounding mode to round-to-nearest instead of truncate. ## API Summary This stabilization report proposes the following API to be stabilized in `core`, along with their re-exports in `std`: ```rust // core::time impl Duration { pub const fn try_from_secs_f32(secs: f32) -> Result<Duration, TryFromFloatSecsError>; pub const fn try_from_secs_f64(secs: f64) -> Result<Duration, TryFromFloatSecsError>; } #[derive(Debug, Clone, PartialEq, Eq)] pub struct TryFromFloatSecsError { ... } impl core::fmt::Display for TryFromFloatSecsError { ... } impl core::error::Error for TryFromFloatSecsError { ... } ``` These functions are made const unstable under `duration_consts_float`, tracking issue #72440. There is an open question in the tracking issue around what the error type should be called which I was hoping to resolve in the context of an FCP. In this stabilization PR, I have altered the name of the error type to `TryFromFloatSecsError`. In my opinion, the error type shares the name of the method (adjusted to accommodate both types of floats), which is consistent with other error types in `core`, `alloc` and `std` like `TryReserveError` and `TryFromIntError`. ## Experience Report Code such as this is ready to be converted to a checked API to ensure it is panic free: ```rust impl Time { pub fn checked_add_f64(&self, seconds: f64) -> Result<Self, TimeError> { // Fail safely during `f64` conversion to duration if seconds.is_nan() || seconds.is_infinite() { return Err(TzOutOfRangeError::new().into()); } if seconds.is_sign_positive() { self.checked_add(Duration::from_secs_f64(seconds)) } else { self.checked_sub(Duration::from_secs_f64(-seconds)) } } } ``` See: https://github.com/artichoke/artichoke/issues/2194. `@rustbot` label +T-libs-api -T-libs cc `@mbartlett21`