master
Name already in use
Commits on Oct 25, 2022
-
Auto merge of #103502 - JohnTitor:rollup-o6mhyzq, r=JohnTitor
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
Commits on Oct 24, 2022
-
Rollup merge of #103495 - Enselic:rustdoc-unix_sigpipe, r=notriddle
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`: #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
-
Rollup merge of #103494 - notriddle:notriddle/test-arrow-hover, r=Gui…
…llaumeGomez rustdoc: remove redundant CSS `a.test-arrow:hover` In 4b402db, 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, 7585632 changed the pro-underline rule to exclude the test-arrow link anyway.
-
Rollup merge of #103493 - notriddle:notriddle/source-sidebar-logo, r=…
…GuillaumeGomez rustdoc: remove unused `.sidebar-logo` DOM on source pages
-
Rollup merge of #103486 - GuillaumeGomez:cleanup-rustdoc-gui-highligh…
…t-colors, r=notriddle Use functions in highlight-colors rustdoc GUI test r? ``@notriddle``
-
Rollup merge of #103465 - jruderman:patch-1, r=compiler-errors
E0210 explanation: remove redundant sentence
-
Rollup merge of #103462 - notriddle:notriddle/source-pre-rust-white-s…
…pace, r=Dylan-DPC rustdoc: remove no-op CSS `.source pre.rust { white-space: pre }` This rule, added in 49e6db7, 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. necolas/normalize.css@a8edd0c -
Rollup merge of #103410 - camsteffen:link-unstable-book, r=JohnTitor
-Z docs: Add link to unstable book
-
Rollup merge of #103409 - compiler-errors:rpitit-signature-mismatch, …
…r=lcnr 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
-
Rollup merge of #103382 - compiler-errors:anon-apit-lt-region-ice, r=…
…cjgillot 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`` -
Rollup merge of #103350 - clubby789:refer-to-assoc-method, r=wesleywiser
Change terminology for assoc method suggestions when they are not called Fixes #103325 ```@rustbot``` label +A-diagnostics
-
Rollup merge of #103333 - chenyukang:yukang/fix-103143, r=wesleywiser
Fix assertion failed for break_last_token and trailing token Fixes #103143
-
rustdoc: Use
unix_sigpipeinstead of `rustc_driver::set_sigpipe_han……dler` 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
-
-
-
Auto merge of #103337 - flip1995:clippyup, r=Manishearth
Update Clippy r? `@Manishearth`
-
-
-
Auto merge of #94063 - Aaron1011:pretty-print-rental, r=lcnr
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.
-
Auto merge of #103471 - JohnTitor:rollup-tfmy6ab, r=JohnTitor
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
-
Rollup merge of #103466 - jruderman:patch-2, r=Dylan-DPC
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".
-
Rollup merge of #103437 - bjorn3:sync_cg_clif-2022-10-23, r=bjorn3
Sync rustc_codegen_cranelift r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
-
Rollup merge of #103277 - thomcc:bump-libc-135, r=Mark-Simulacrum
Update libstd's libc to 0.2.135 (to make `libstd` no longer pull in `libiconv.dylib` on Darwin) This is to pull in rust-lang/libc#2944. It's related to #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`
-
Rollup merge of #102766 - thomcc:remove-resolv, r=Mark-Simulacrum
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 #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 rust-lang/libc#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.
-
Rollup merge of #102271 - lopopolo:lopopolo/stabilize-duration-try-fr…
…om-secs-float, r=dtolnay Stabilize `duration_checked_float` ## Stabilization Report This stabilization report is for a stabilization of `duration_checked_float`, tracking issue: #83400. ### Implementation History - #82179 - #90247 - #96051 - Changed error type to `FromFloatSecsError` in #90247 - #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: artichoke/artichoke#2194. `@rustbot` label +T-libs-api -T-libs cc `@mbartlett21`
-
Rollup merge of #99939 - saethlin:pre-sort-tests, r=thomcc,jackh726
Sort tests at compile time, not at startup Recently, another Miri user was trying to run `cargo miri test` on the crate `iced-x86` with `--features=code_asm,mvex`. This configuration has a startup time of ~18 minutes. That's ~18 minutes before any tests even start to run. The fact that this crate has over 26,000 tests and Miri is slow makes a lot of code which is otherwise a bit sloppy but fine into a huge runtime issue. Sorting the tests when the test harness is created instead of at startup time knocks just under 4 minutes out of those ~18 minutes. I have ways to remove most of the rest of the startup time, but this change requires coordinating changes of both the compiler and libtest, so I'm sending it separately. (except for doctests, because there is no compile-time harness)
-
Rollup merge of #99578 - steffahn:remove_redundant_bound, r=thomcc
Remove redundant lifetime bound from `impl Borrow for Cow` The lifetime bound `B::Owned: 'a` is redundant and doesn't make a difference, because `Cow<'a, B>` comes with an implicit `B: 'a`, and associated types will outlive lifetimes outlived by the `Self` type (and all the trait's generic parameters, of which there are none in this case), so the implicit `B: 'a` implies `B::Owned: 'a` anyway. The explicit lifetime bound here does however [end up in documentation](https://doc.rust-lang.org/std/borrow/enum.Cow.html#impl-Borrow%3CB%3E), and that's confusing in my opinion, so let's remove it ^^ _(Documentation right now, compare to `AsRef`, too:)_ 
-
-
-
Auto merge of #102536 - scottmcm:lookup_line-tweak, r=jackh726
Shorten the `lookup_line` code slightly The `match` looks like it's exactly the same as `checked_sub(1)`, so we might as well see if perf says we can just do that to save a couple lines.
-
rustdoc: remove no-op CSS
.source pre.rust { white-space: pre }This rule, added in 49e6db7, 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. necolas/normalize.css@a8edd0c
-
Auto merge of #100848 - xfix:use-metadata-for-slice-len, r=thomcc
Use ptr::metadata in <[T]>::len implementation This avoids duplication of ptr::metadata code. I believe this is acceptable as the previous approach essentially duplicated `ptr::metadata` because back then `rustc_allow_const_fn_unstable` annotation did not exist. I would like somebody to ping `@rust-lang/wg-const-eval` as the documentation says: > Always ping `@rust-lang/wg-const-eval` if you are adding more rustc_allow_const_fn_unstable attributes to any const fn.
-
-
Auto merge of #103452 - notriddle:rollup-peewevm, r=notriddle
Rollup of 11 pull requests Successful merges: - #100462 (Clarify `array::from_fn` documentation) - #101644 (Document surprising and dangerous fs::Permissions behaviour on Unix) - #103005 (kmc-solid: Handle errors returned by `SOLID_FS_ReadDir`) - #103140 (Add diagnostic for calling a function with the same name with unresolved Macro) - #103254 (rustdoc: do not filter out cross-crate `Self: Sized` bounds) - #103347 (bootstrap: also create rustc-src component in sysroot) - #103402 (Fix wrapped valid-range handling in ty_find_init_error) - #103414 (Pretty print lifetimes captured by RPIT) - #103424 (rustdoc: remove no-op CSS `.code-header { border-bottom: none }`) - #103434 (Use functions for jump-to-def-background rustdoc GUI test) - #103447 (`MaybeUninit`: use `assume_init_drop()` in the partially initialized array example) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup