profile
viewpoint

tmiasko/pyjags 8

PyJAGS: The Python Interface to JAGS

tmiasko/fsb-vorbis-extractor 3

FSB Vorbis Extractor

tmiasko/gabi 0

gobject-introspection ABI validator

tmiasko/rust 0

Empowering everyone to build reliable and efficient software.

PR opened rust-lang/rust

Liveness refactoring continued
  • Move body_owner field from IrMaps to Liveness (the only user of the field).
  • Use upvars instead of FnKind to check for closures (avoids FnKind, will be useful when checking all bodies, not just fns).
  • Use visit_param to add variables corresponding to params.
  • Store upvars_mentioned inside Liveness struct.
  • Inline visitor implementation for IrMaps, avoiding unnecessary indirection.
  • Test interaction with automatically_derived attribute (not covered by any of existing tests).

No functional changes intended.

Includes #77229.

r? @lcnr

+332 -336

0 comment

6 changed files

pr created time in 2 hours

push eventtmiasko/rust

Tomasz Miąsko

commit sha a37886b0cc6dda512768df6ea393ddf62048df9e

liveness: Move body_owner field from IrMaps to Liveness The Liveness struct is the only user of body_owner field. Move the field there.

view details

Tomasz Miąsko

commit sha 57ad7ad79ba8e5dde8fd5dbbc1e465159a74b292

liveness: Use upvars instead of FnKind to check for closures Avoiding FnKind will make it easier to run liveness analysis on all bodies in the future, not just fn-like things.

view details

Tomasz Miąsko

commit sha 3a3784e236d95e6f225f7c203b76843a4d7d22d4

liveness: Use visit_param to add variables corresponding to params

view details

Tomasz Miąsko

commit sha 9ba275603828375424be9f9508f441f024e3b217

liveness: Store upvars_mentioned inside Liveness struct

view details

Tomasz Miąsko

commit sha 6b73b7b8bc728a83eb85e704cd82cfaea09c4740

liveness: Inline visitor implementation for IrMaps

view details

Tomasz Miąsko

commit sha c2bb793257a9d66ff84ae5cbcf088c379b00b42a

liveness: Test interaction with automatically_derived attribute

view details

push time in 2 hours

create barnchtmiasko/rust

branch : liveness-cnd

created branch time in 6 hours

Pull request review commentrust-lang/rust

Small improvements in liveness pass

 impl IrMaps<'tcx> {     }      fn lnk(&self, ln: LiveNode) -> LiveNodeKind {

Done.

tmiasko

comment created time in 11 hours

PullRequestReviewEvent

push eventtmiasko/rust

Tomasz Miąsko

commit sha d68aa227c6b7ab9c1cfa003e752c3600a7269485

liveness: Access live nodes directly through self.lnks[ln]

view details

push time in 11 hours

Pull request review commentrust-lang/rust

Small improvements in liveness pass

 impl IrMaps<'tcx> {     }      fn add_live_node(&mut self, lnk: LiveNodeKind) -> LiveNode {-        let ln = LiveNode(self.num_live_nodes as u32);+        let ln = LiveNode(self.lnks.len() as u32);

I used newtype_index and IndexVec in a few places. I will take a look if INVALID_NODE can be replaced with an Option, especially that newtype_index has a niche for that purpose, but that would be another PR.

tmiasko

comment created time in a day

PullRequestReviewEvent

push eventtmiasko/rust

Tomasz Miąsko

commit sha 49d1ce00f30a10e607dc30506d3e890d1efb6309

liveness: Remove unnecessary local variable exit_ln

view details

Tomasz Miąsko

commit sha 57d38975cc638bcdeb7e9bcd10621615e8f9f3c0

liveness: Use newtype_index for Variable and LiveNode

view details

push time in a day

PR opened rust-lang/rust

Small improvements in liveness pass
  • Remove redundant debug logging (add_variable already contains logging).
  • Remove redundant fields for a number of live nodes and variables.
  • Delay conversion from a symbol to a string until linting.
  • Inline contents of specials struct.

No functional changes intended (except those related to the logging).

+45 -51

0 comment

1 changed file

pr created time in a day

push eventtmiasko/rust

Tomasz Miąsko

commit sha 9b5835ec7973a52f2e9d6f4ed9a2181bebfdc399

liveness: Remove redundant debug logging The IrMaps::add_variable already contains debug logging. Don't duplicate it.

view details

Tomasz Miąsko

commit sha 2fb1564457b47bd31087e2aba1b8eb6f15c000ef

liveness: Remove redundant fields for a number of live nodes and variables

view details

Tomasz Miąsko

commit sha 70f150b51e7d13e3bcd8977ff124a348057cf7ef

liveness: Delay conversion from a symbol to a string until linting

view details

Tomasz Miąsko

commit sha 141b91da6cb756ff5f36eebe9eee65922e295876

liveness: Inline contents of specials struct

view details

push time in a day

create barnchtmiasko/rust

branch : liveness

created branch time in a day

pull request commentrust-lang/rust

Reopen standard file descriptors when they are missing on Unix

The child process spawned in the test case segfaults on arm-android. I don't know why yet, but it is unrelated to the changes in std, since the same issue occurs with them.

tmiasko

comment created time in a day

push eventtmiasko/rust

push time in a day

push eventtmiasko/rust

Tomasz Miąsko

commit sha 9d974a9b4dcdfbb1838bc32ed59383c577c41412

DO NOT MERGE: Add test case

view details

push time in a day

push eventtmiasko/rust

Tomasz Miąsko

commit sha 08e356968ca9d9b3fdb7cda9606c47ec232d7a91

DO NOT MERGE: Enable arm-android on GitHub Actions CI

view details

Tomasz Miąsko

commit sha 3555eccafc9dbea8dce739ee5e2c144b6a1411fc

DO NOT MERGE: Revert "Reopen standard streams when they are closed on Unix" This reverts commit d2c3bb393047ebc5a0d2b746bd9c021955dd2c93.

view details

Tomasz Miąsko

commit sha 435798d4efbe7361e1a3e72b85bdff804d424ab7

DO NOT MERGE: Add test case

view details

push time in a day

push eventtmiasko/rust

Tomasz Miąsko

commit sha 8000f51225bebb6301554f476a46d505efa9d934

DO NOT MERGE: Close only stderr open in test

view details

Tomasz Miąsko

commit sha 029d6d94297016721412d7d138c0d9b751f39a96

DO NOT MERGE: Enable arm-android on GitHub Actions CI

view details

push time in a day

push eventtmiasko/rust

Vali Schneider

commit sha 459969f88ff95c94b7b34043a7f0e13de91de4f8

added restriction lint that prohibits the usage of unimplemented, unreachable or panic in a function of type result or option

view details

Vali Schneider

commit sha ceab1a9167655eba9f9556f8766f8702e49dfef3

removed unnecessary comment

view details

Vali Schneider

commit sha 8462cce96081b87eba7a5bc89130a1a09fe1f6d0

edited documentation

view details

Vali Schneider

commit sha b2d8ca9a766703469178ea37d4d46067bb6fa926

ran cargo dev update lints

view details

Vali Schneider

commit sha b006522393a3c3c2656e1ccdfbb0076ff1bd7e99

added lint for todo and removed option

view details

Vali Schneider

commit sha a424a2c1676a29c147252873037e8943d54941d3

changed check_impl_item to check_fn and added a few more test cases

view details

Vali Schneider

commit sha 73a3288282e733bfc5893e9920d29f1de5a21591

uncommented fn

view details

Erik Desjardins

commit sha d3b9ece4c0028ff7e36e34df2d2b26366f9c0648

add tests related to tuple scalar layout with ZST in last field

view details

Erik Desjardins

commit sha e5d85f917b8965a5e62513c17cbb887366b152bc

allow reordering of the last field of a MaybeUnsized struct if it's a ZST

view details

Erik Desjardins

commit sha e9bc3ddb073f2261ac46832d985efe8db863ed6a

test that we do not change the offset of ZST tuple fields when unsizing

view details

Erik Desjardins

commit sha 68217c9e0f1269d29b4c1c72d08fb1b95bf441cd

ignore zst offsets instead

view details

Erik Desjardins

commit sha 6fc1d8bc13124bb134d7ab54e56237821a55912e

add codegen test

view details

Erik Desjardins

commit sha 24e0913e37cc6fc363b37d13bf519db212f175a2

handle vector layout

view details

Vali Schneider

commit sha f9fcbbea03edb735c22311522b55d7b854bd6ac0

fixed bug

view details

Ricky

commit sha e49a29933be3bd988ccb75b053f480d9c99a7ff5

Working map_err_ignore lint

view details

Ricky

commit sha 202a80c927412a548180eca5990ee764d76ed643

Added tests for map_err, ignored map_err lint on drop_ref tests

view details

Ricky

commit sha 337729137bdec31b55665653ef0cf7dc124b0eaa

Ran cargo dev update_lints

view details

Ricky

commit sha 2387f68e437bf2ff5f117f63936257ce64052cfa

Removed map_err suggestion in lint, and updated lint documentation example

view details

Jane Lusby

commit sha c31d4730b0d40c62934839405d0c25e2ffa3fad1

update example to be more idiomatic

view details

Ricky

commit sha 4f1c4a99d4d98f1acea3c9c7cc55355aa46119aa

Fixed typo in lint and test

view details

push time in a day

delete branch tmiasko/rust

delete branch : simplify-cfg-dup

delete time in 2 days

Pull request review commentrust-lang/rust

Add Linux-specific pidfd process extensions

+//! Linux-specific extensions to primitives in the `std::process` module.++#![unstable(feature = "linux_pidfd", issue = "none")]++use crate::process;+use crate::sys_common::AsInnerMut;+use crate::io::Result;++/// Os-specific extensions to [`process::Child`]+///+/// [`process::Child`]: crate::process::Child+pub trait ChildExt {+    /// Obtains the pidfd created for this child process, if available.+    ///+    /// A pidfd will only ever be available if `create_pidfd(true)` was called+    /// when the corresponding `Command` was created.+    ///+    /// Even if `create_pidfd(true)` is called, a pidfd may not be available+    /// due to an older version of Linux being in use, or if+    /// some other error occured.+    ///+    /// See `man pidfd_open` for more details about pidfds.+    fn pidfd(&self) -> Result<i32>;+}++/// Os-specific extensions to [`process::Command`]+///+/// [`process::Command`]: crate::process::Command+pub trait CommandExt {+    /// Sets whether or this `Command` will attempt to create a pidfd+    /// for the child. If this method is never called, a pidfd will+    /// not be crated.+    ///+    /// The pidfd can be retrieved from the child via [`ChildExt::pidfd`]+    ///+    /// A pidfd will only be created if it is possible to do so+    /// in a guaranteed race-free manner (e.g. if the `clone3` system call is+    /// supported). Otherwise, [`ChildExit::pidfd`] will return an error.+    fn create_pidfd(&mut self, val: bool) -> &mut process::Command;

The pidfd only exists in the parent process. Once clone3 succeeds, the pidfd is perfectly useable, regardless of what happens in the child process from that point on.

My point was that spawn returns an error in that case, so the user cannot access pidfd.

Aaron1011

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Add Linux-specific pidfd process extensions

+//! Linux-specific extensions to primitives in the `std::process` module.++#![unstable(feature = "linux_pidfd", issue = "none")]++use crate::process;+use crate::sys_common::AsInnerMut;+use crate::io::Result;++/// Os-specific extensions to [`process::Child`]+///+/// [`process::Child`]: crate::process::Child+pub trait ChildExt {+    /// Obtains the pidfd created for this child process, if available.+    ///+    /// A pidfd will only ever be available if `create_pidfd(true)` was called+    /// when the corresponding `Command` was created.+    ///+    /// Even if `create_pidfd(true)` is called, a pidfd may not be available+    /// due to an older version of Linux being in use, or if+    /// some other error occured.+    ///+    /// See `man pidfd_open` for more details about pidfds.+    fn pidfd(&self) -> Result<i32>;+}++/// Os-specific extensions to [`process::Command`]+///+/// [`process::Command`]: crate::process::Command+pub trait CommandExt {+    /// Sets whether or this `Command` will attempt to create a pidfd+    /// for the child. If this method is never called, a pidfd will+    /// not be crated.+    ///+    /// The pidfd can be retrieved from the child via [`ChildExt::pidfd`]+    ///+    /// A pidfd will only be created if it is possible to do so+    /// in a guaranteed race-free manner (e.g. if the `clone3` system call is+    /// supported). Otherwise, [`ChildExit::pidfd`] will return an error.+    fn create_pidfd(&mut self, val: bool) -> &mut process::Command;
  1. Without seeing this discussion, I would presume that Process owns the pidfd and will close it on drop.
  2. The pidfd should be closed when clone3 succeeds but exec fails, since a user has no ability to do so on their own, right?
Aaron1011

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Reopen standard file descriptors when they are missing on Unix

 pub fn init() {         reset_sigpipe();     } +    // In the case when all file descriptors are open, the poll has been+    // observed to perform better than fcntl (on GNU/Linux).+    #[cfg(not(any(+        target_os = "emscripten",+        target_os = "fuchsia",+        // The poll on Darwin doesn't set POLLNVAL for closed fds.+        target_os = "macos",+        target_os = "ios",+        target_os = "redox",+    )))]+    unsafe fn sanitize_standard_fds() {+        use crate::sys::os::errno;+        let pfds: &mut [_] = &mut [+            libc::pollfd { fd: 0, events: 0, revents: 0 },+            libc::pollfd { fd: 1, events: 0, revents: 0 },+            libc::pollfd { fd: 2, events: 0, revents: 0 },+        ];+        while libc::poll(pfds.as_mut_ptr(), 3, 0) == -1 {

Miri should use empty implementation now.

tmiasko

comment created time in 2 days

PullRequestReviewEvent

push eventtmiasko/rust

Tomasz Miąsko

commit sha 257f6e5f745c25b66e432f5222d1b746469fcdb0

Reopen standard streams when they are closed on Unix The syscalls returning a new file descriptors generally use lowest-numbered file descriptor not currently opened, without any exceptions for those corresponding to the standard streams. Previously when any of standard streams has been closed before starting the application, operations on std::io::{stderr,stdin,stdout} objects were likely to operate on other logically unrelated file resources opened afterwards. Avoid the issue by reopening the standard streams when they are closed.

view details

push time in 2 days

delete branch tmiasko/rust

delete branch : arena

delete time in 2 days

Pull request review commentrust-lang/rust

Reopen standard file descriptors when they are missing on Unix

 pub fn init() {         reset_sigpipe();     } +    // In the case when all file descriptors are open, the poll has been+    // observed to perform better than fcntl (on GNU/Linux).+    #[cfg(not(any(+        target_os = "emscripten",+        target_os = "fuchsia",+        // The poll on Darwin doesn't set POLLNVAL for closed fds.+        target_os = "macos",+        target_os = "ios",+        target_os = "redox",+    )))]+    unsafe fn sanitize_standard_fds() {+        use crate::sys::os::errno;+        let pfds: &mut [_] = &mut [+            libc::pollfd { fd: 0, events: 0, revents: 0 },+            libc::pollfd { fd: 1, events: 0, revents: 0 },+            libc::pollfd { fd: 2, events: 0, revents: 0 },+        ];+        while libc::poll(pfds.as_mut_ptr(), 3, 0) == -1 {

Which implementation would you like to use: fcntl(fd, F_GETFD) and open("/dev/null"), or empty one?

tmiasko

comment created time in 2 days

PullRequestReviewEvent

pull request commentrust-lang/rust

Reopen standard file descriptors when they are missing on Unix

I added a comment, but also revised it shortly afterwards so it might need another r+.

tmiasko

comment created time in 3 days

push eventtmiasko/rust

Tomasz Miąsko

commit sha 44e083ec99ec904b170af9795d0112165553dedb

Reopen standard streams when they are closed on Unix The syscalls returning a new file descriptors generally use lowest-numbered file descriptor not currently opened, without any exceptions for those corresponding to the standard streams. Previously when any of standard streams has been closed before starting the application, operations on std::io::{stderr,stdin,stdout} objects were likely to operate on other logically unrelated file resources opened afterwards. Avoid the issue by reopening the standard streams when they are closed.

view details

push time in 3 days

push eventtmiasko/rust

Tomasz Miąsko

commit sha d6d59b17b6795531a70dd60cec69c9292ea1237f

Reopen standard streams when they are closed on Unix The syscalls returning a new file descriptors generally use lowest-numbered file descriptor not currently opened, without any exceptions for those corresponding to the standard streams. Previously when any of standard streams has been closed before starting the application, operations on std::io::{stderr,stdin,stdout} objects were likely to operate on other logically unrelated file resources opened afterwards. Avoid the issue by reopening the standard streams when they are closed.

view details

push time in 3 days

pull request commentrust-lang/rust

Reopen standard file descriptors when they are missing on Unix

I changed the implementation to abort the process when reopening fails. In case of any bug reports with regards to this behaviour, I will revise the implementation to continue execution with Rust objects disabled.

tmiasko

comment created time in 3 days

push eventtmiasko/rust

Ivan Tham

commit sha c5975e9b6c5781b3b7300b7921c14b060086e1c1

Reduce duplicate in liballoc reserve error handling

view details

Federico Ponzi

commit sha 27c90b881df93b53fd3f24dcbfed116379c2fc69

initial implementation of OpenOptions to c_int

view details

Federico Ponzi

commit sha eb3906be4ad375cc6b83cd6a6e0116817db22575

Fix typo get openoptions function name Co-authored-by: Ivan Tham <pickfire@riseup.net>

view details

CDirkx

commit sha 518f1ccb728aa03665e51710c12973a74cc98df5

Stabilize some Result methods as const Stabilize the following methods of `Result` as const: - `is_ok` - `is_err` - `as_ref` Possible because of stabilization of #49146 (Allow if and match in constants).

view details

Federico Ponzi

commit sha 1bc0627607262cc60a7692b16e205f30fc88b89f

Add as_flag function to the OpenOptionsExt struct

view details

Federico Ponzi

commit sha 2c9e27b759a9e9feeb943fb855e32d7383d1dcc6

Merge branch 'convert-openoptions-cint' of github.com:FedericoPonzi/rust into convert-openoptions-cint

view details

Federico Ponzi

commit sha 7c1e5c1dcd25c945f619eda289f639dbe2b002da

Update OpenOptions::as_flags docs, and minor styling

view details

Federico Ponzi

commit sha 321b680fe66d1be04cd67fac75ff7f148fd117fe

Update docs of OpenOptions::as_flags

view details

Federico Ponzi

commit sha 28db5214d2c48e7a58cf79b9e272097260910a33

More implementations of Write for immutable refs Fixes #73836

view details

Christiaan Dirkx

commit sha 787b2707a77fa1a98f512a4905662a1a16daf13c

Move const tests for `Result` to `library\core` Part of #76268

view details

Guillaume Gomez

commit sha 69ffed763d1540c387db3b578848184026da0484

Add error explanation for E0755

view details

Tavian Barnes

commit sha a06edda3ad9abd4f07d07bbe46cb488efeebbbd0

Fix segfault if pthread_getattr_np fails glibc destroys[1] the passed pthread_attr_t if pthread_getattr_np() fails. Destroying it again leads to a segfault. Fix it by only destroying it on success for glibc. [1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_getattr_np.c;h=ce437205e41dc05653e435f6188768cccdd91c99;hb=HEAD#l205

view details

Tavian Barnes

commit sha a684153f2920729f9fc3ea27ddb77d7cc3543214

Only call pthread_attr_destroy() after getattr_np() succeeds on all libcs The calling convention of pthread_getattr_np() is to initialize the pthread_attr_t, so _destroy() is only necessary on success (and _init() isn't necessary beforehand). On the other hand, FreeBSD wants the attr_t to be initialized before pthread_attr_get_np(), and therefore it should always be destroyed afterwards.

view details

Federico Ponzi

commit sha ec7f9b927f1896c7f29c602d6b0f961c891d0941

Deduplicates io::Write implementations

view details

Christiaan Dirkx

commit sha 8f27e3cb1b4140d9124d60df0850ef734e73b884

Make some methods of `Pin` unstable const Make the following methods unstable const under the `const_pin` feature: - `new` - `new_unchecked` - `into_inner` - `into_inner_unchecked` - `get_ref` - `into_ref` Also adds tests for these methods in a const context. Tracking issue: #76654

view details

Simon Vandel Sillesen

commit sha e5447a22222ecc6a650e75282cb9931b910854b2

Fix #76432 Only insert StorageDeads if we actually removed one. Fixes an issue where we added StorageDead to a place with no StorageLive

view details

Manish Goregaokar

commit sha c100e726c10fe9d212a58a5494126409e7d0e10b

Stabilize intra-doc links

view details

Manish Goregaokar

commit sha 63d5beec43ff7721928821cd83f9790188b03276

Move intra-doc-links documentation out of unstable section

view details

Manish Goregaokar

commit sha bc06674774e6457046e41a48dc3e8be8c5496f11

Mention super/crate/self in docs

view details

Manish Goregaokar

commit sha f072e4a7322e8e2b16410e3225e1afc15d132e36

Mention URL fragments

view details

push time in 3 days

pull request commentrust-lang/rust

Reopen standard file descriptors when they are missing on Unix

I am motivated by the cases where we can actually reopen them. I don't have strong opinion what we should do if that fails. Simply continuing or aborting, both seems fine to me.

tmiasko

comment created time in 3 days

PR opened rust-lang/rust

Remove duplicated SimplifyCfg pass
+0 -1

0 comment

1 changed file

pr created time in 3 days

create barnchtmiasko/rust

branch : simplify-cfg-dup

created branch time in 3 days

pull request commentrust-lang/rust

Reopen standard file descriptors when they are missing on Unix

I implemented variant that detected closed fds and disabled corresponding Rust objects (without reopening them). That approached turned out to be insufficient to avoid problems while using various Rust applications in practice. I don't think it is worth the extra complexity.

I would again suggest the approach already taken in this PR.

tmiasko

comment created time in 3 days

Pull request review commentrust-lang/rust

Add regression test for issue #76042

+// run-pass

I would expect that this that would have a few extra compile flags. compile-flags: -Coverflow-checks=off -Ccodegen-units=1 -Copt-level=0 with --target i686-unknown-linux-gnu also being relevant but omitted.

LeSeulArtichaut

comment created time in 3 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

MIR pass to remove unneeded drops on types not needing drop

+//! This pass replaces a drop of a type that does not need dropping, with a goto++use crate::transform::{MirPass, MirSource};+use rustc_hir::def_id::LocalDefId;+use rustc_middle::mir::visit::Visitor;+use rustc_middle::mir::*;+use rustc_middle::ty::TyCtxt;++use super::simplify::simplify_cfg;++pub struct RemoveUnneededDrops;++impl<'tcx> MirPass<'tcx> for RemoveUnneededDrops {+    fn run_pass(&self, tcx: TyCtxt<'tcx>, source: MirSource<'tcx>, body: &mut Body<'tcx>) {+        trace!("Running RemoveUnneededDrops on {:?}", source);+        let mut opt_finder = RemoveUnneededDropsOptimizationFinder {+            tcx,+            body,+            optimizations: vec![],+            def_id: source.def_id().expect_local(),+        };+        opt_finder.visit_body(body);+        let should_simplify = !opt_finder.optimizations.is_empty();+        for (loc, target) in opt_finder.optimizations {+            let terminator = body.basic_blocks_mut()[loc.block].terminator_mut();+            debug!("SUCCESS: replacing `drop` with goto({:?})", target);+            terminator.kind = TerminatorKind::Goto { target };+        }++        // if we applied optimizations, we potentially have some cfg to cleanup to+        // make it easier for further passes+        if should_simplify {+            simplify_cfg(body);+        }+    }+}++impl<'a, 'tcx> Visitor<'tcx> for RemoveUnneededDropsOptimizationFinder<'a, 'tcx> {+    fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location) {+        match terminator.kind {+            TerminatorKind::Drop { place, target, .. }+            | TerminatorKind::DropAndReplace { place, target, .. } => {

The DropAndReplace terminator should never occur in an input to this pass, since it should be removed during drop elaboration. Additionally, its semantics is to drop and assign a new value, so the transformation wouldn't be correct without additional assignment. Either way, I would just remove it from here.

simonvandel

comment created time in 3 days

PullRequestReviewEvent

push eventtmiasko/rust

Manish Goregaokar

commit sha c100e726c10fe9d212a58a5494126409e7d0e10b

Stabilize intra-doc links

view details

Manish Goregaokar

commit sha 63d5beec43ff7721928821cd83f9790188b03276

Move intra-doc-links documentation out of unstable section

view details

Manish Goregaokar

commit sha bc06674774e6457046e41a48dc3e8be8c5496f11

Mention super/crate/self in docs

view details

Manish Goregaokar

commit sha f072e4a7322e8e2b16410e3225e1afc15d132e36

Mention URL fragments

view details

Manish Goregaokar

commit sha 2a98409634ec38547d03512898192b5bdce15f3d

Fill out docs on intra-doc resolution failure lint

view details

Manish Goregaokar

commit sha 4e0eb0b73ba2defaf0f3c2152e9daa5c18d1603f

Update src/doc/rustdoc/src/linking-to-items-by-name.md Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

Manish Goregaokar

commit sha 175e30539d5ee9364a26f89f8a03a60b53690684

Update src/doc/rustdoc/src/linking-to-items-by-name.md Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

Manish Goregaokar

commit sha 51c1351f7b9366a295dce5d63c2fd387170d5c34

Resolve some conflicts

view details

Manish Goregaokar

commit sha 6f1fa2b16376f586285453045788519df527a1b2

Fix lint name in docs

view details

Manish Goregaokar

commit sha 792b2ea5812a06fe3d362ae36025998af66199ee

Update src/doc/rustdoc/src/lints.md Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

Tomasz Miąsko

commit sha ff1a9e406bfccefedb6c4f2cabc0c4d59ac947d4

Fix underflow when calculating the number of no-op jumps folded When removing unwinds to no-op blocks and folding jumps to no-op blocks, remove the unwind target first. Otherwise we cannot determine if target has been already folded or not. Previous implementation incorrectly assumed that all resume targets had been folded already, occasionally resulting in an underflow: remove_noop_landing_pads: removed 18446744073709551613 jumps and 3 landing pads

view details

Manish Goregaokar

commit sha 6928041c0a992093a7752ae3c04090caebcd4515

Update src/doc/rustdoc/src/linking-to-items-by-name.md Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

est31

commit sha f05b47ccdfa63f8b4b9fb47a9aa92381801d3ff1

Don't download/sync llvm-project submodule if download-ci-llvm is set llvm-project takes > 1GB storage space and a long time to download. It's better to not download it unless needed.

view details

Bastian Kauschke

commit sha d4039c55c9ef392261aeaba6c14ae81f5098139a

wip emit errors during AbstractConst building

view details

Bastian Kauschke

commit sha 30cbc9729654c66b9f54779d18f023e47112cdf2

words

view details

yuk1ty

commit sha 16047d46a10813a25e956e659b8861cc67c20cd2

fix typo in docs and comments

view details

Mara Bos

commit sha db74e1f1e3e5c7497bb9af68814497c8df1fd0b8

Add cfg(target_has_atomic_equal_alignment). This is needed for Atomic::from_mut.

view details

Mara Bos

commit sha 9e3f94dabc334586d669f3aba0bded607ac782fc

Don't unwrap but report a fatal error for TargetDataLayout::parse.

view details

Mara Bos

commit sha af56ad7633668a790353f17440586e97b4e6a99b

Add feature gate ui test for cfg(target_has_atomic_load_store).

view details

Mara Bos

commit sha 54fdf54e06e3287958d906d2fb1b905b778d5e38

Add feature gate ui test for cfg(target_has_atomic_equal_alignment).

view details

push time in 3 days

delete branch tmiasko/rust

delete branch : no-op-jumps

delete time in 3 days

pull request commentrust-lang/rust

Reopen standard file descriptors when they are missing on Unix

OK, I see your point. In that case it should be fine to attempt reopening them, but disable when that fails? I generally feel that anything short of reopening them will likely break any real application, although admittedly it will involve unsafe code.

Hmm, it might be also possible go back to earlier suggestion of using pipes, with a slight twist where they are connected wrong way around, so that read / write operations return EBADF. Though, I couldn't really tell what other consequences it could have.

tmiasko

comment created time in 4 days

pull request commentrust-lang/rust

Reopen standard file descriptors when they are missing on Unix

Check if stdin, stdout, stderr are opened and provide no-op substitutes in std::io::{stdin,stdout,stderr} without reopening them directly.

I feel that this is a better solution if it is feasible.

It is definitely possible to detect closed descriptors using the same approach and disable corresponding std::io::{stderr,stdin,stdout} objects. It should avoid issues as far as access through those objects is concerned, but anything that uses file descriptors directly will still cause trouble. While an improvement, to me that still feel like incomplete solution of the problem.

@Amanieu I wonder why would you prefer that approach?

tmiasko

comment created time in 4 days

push eventtmiasko/rust

Ivan Tham

commit sha c5975e9b6c5781b3b7300b7921c14b060086e1c1

Reduce duplicate in liballoc reserve error handling

view details

Federico Ponzi

commit sha 27c90b881df93b53fd3f24dcbfed116379c2fc69

initial implementation of OpenOptions to c_int

view details

Federico Ponzi

commit sha eb3906be4ad375cc6b83cd6a6e0116817db22575

Fix typo get openoptions function name Co-authored-by: Ivan Tham <pickfire@riseup.net>

view details

Federico Ponzi

commit sha 1bc0627607262cc60a7692b16e205f30fc88b89f

Add as_flag function to the OpenOptionsExt struct

view details

Federico Ponzi

commit sha 2c9e27b759a9e9feeb943fb855e32d7383d1dcc6

Merge branch 'convert-openoptions-cint' of github.com:FedericoPonzi/rust into convert-openoptions-cint

view details

Federico Ponzi

commit sha 7c1e5c1dcd25c945f619eda289f639dbe2b002da

Update OpenOptions::as_flags docs, and minor styling

view details

Federico Ponzi

commit sha 321b680fe66d1be04cd67fac75ff7f148fd117fe

Update docs of OpenOptions::as_flags

view details

Federico Ponzi

commit sha 28db5214d2c48e7a58cf79b9e272097260910a33

More implementations of Write for immutable refs Fixes #73836

view details

Guillaume Gomez

commit sha 69ffed763d1540c387db3b578848184026da0484

Add error explanation for E0755

view details

Tavian Barnes

commit sha a06edda3ad9abd4f07d07bbe46cb488efeebbbd0

Fix segfault if pthread_getattr_np fails glibc destroys[1] the passed pthread_attr_t if pthread_getattr_np() fails. Destroying it again leads to a segfault. Fix it by only destroying it on success for glibc. [1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_getattr_np.c;h=ce437205e41dc05653e435f6188768cccdd91c99;hb=HEAD#l205

view details

Tavian Barnes

commit sha a684153f2920729f9fc3ea27ddb77d7cc3543214

Only call pthread_attr_destroy() after getattr_np() succeeds on all libcs The calling convention of pthread_getattr_np() is to initialize the pthread_attr_t, so _destroy() is only necessary on success (and _init() isn't necessary beforehand). On the other hand, FreeBSD wants the attr_t to be initialized before pthread_attr_get_np(), and therefore it should always be destroyed afterwards.

view details

Federico Ponzi

commit sha ec7f9b927f1896c7f29c602d6b0f961c891d0941

Deduplicates io::Write implementations

view details

Christiaan Dirkx

commit sha 8f27e3cb1b4140d9124d60df0850ef734e73b884

Make some methods of `Pin` unstable const Make the following methods unstable const under the `const_pin` feature: - `new` - `new_unchecked` - `into_inner` - `into_inner_unchecked` - `get_ref` - `into_ref` Also adds tests for these methods in a const context. Tracking issue: #76654

view details

Simon Vandel Sillesen

commit sha e5447a22222ecc6a650e75282cb9931b910854b2

Fix #76432 Only insert StorageDeads if we actually removed one. Fixes an issue where we added StorageDead to a place with no StorageLive

view details

Lzu Tao

commit sha eede953c283c7bbe903a0e8abb44c923baf5cfac

Only get ImplKind::Impl once

view details

Federico Ponzi

commit sha 70292d45060ee2b8829e2af0be54d5a76696cd1d

Sets as_flags as unstable

view details

Jethro Beekman

commit sha 1d2290ffb0f8f85c8de56c17e6be748d84dcfb04

Update LLVM

view details

Dylan MacKenzie

commit sha ed6c7efd87f17a7d9282f4bc7341cb5cbda8db4d

Use enum for status of non-const ops

view details

Dylan MacKenzie

commit sha c3607bd7dd323a898b8cc9d2c603dfd14172c73c

Use helper function for searching `allow_internal_unstable`

view details

Dylan MacKenzie

commit sha e4edc161f20ccbc77fffb7ceb60ebb6102cbd747

Give name to extra `Span` in `LiveDrop` error

view details

push time in 4 days

delete branch tmiasko/cargo

delete branch : doc-deps-kinds

delete time in 5 days

PR closed rust-lang/cargo

Document build dependencies and dev dependencies S-waiting-on-author

Add a new --kinds option to cargo doc, which allows to select what kinds of dependencies should be documented: build dependencies, dev dependencies, or normal dependencies. Multiple kinds of dependencies can be specified, e.g., cargo doc --kinds=dev,normal.

When --kinds options is used, the default behaviour of documenting normal dependencies is suppressed unless asked for explicitly with --kinds=normal. The --kinds option also conflicts with --no-deps.

Follow up on proposal from #7077. Resolves #3475.

Open questions:

  1. Should --kinds document normal dependencies by default, obviating the need for normal kind of dependencies? Current answer is no.
  2. Should --kinds interact with --no-deps flag? Current answer is no, but presence or absence of --no-deps could control if dependencies of selected dependencies are also documented.
+155 -18

5 comments

7 changed files

tmiasko

pr closed time in 5 days

pull request commentrust-lang/cargo

Document build dependencies and dev dependencies

After looking at this a bit more, it seems to me it will require completely different approach and more substantial changes. Thanks for reviewing this so far. I will close this for now.

tmiasko

comment created time in 5 days

pull request commentrust-lang/rust

unix: Extend UnixStream and UnixDatagram to send and receive file descriptors

@LinkTed cargo check might be feasible with something like env CC_x86_64-apple-darwin=/usr/bin/true ./x.py check --target x86_64-apple-darwin

LinkTed

comment created time in 5 days

issue commentrust-lang/rust

Miscompilation with mir-opt-level=2

The propagation is disabled only if both locals have their address taken. Changing that to be more conservative does fix this issue.

Minimized:

type M = [i64; 2];

fn f(a: &M) -> M {
    let mut b: M = M::default();
    b[0] = a[0] * a[0];
    b
}

fn main() {
    let mut a: M = [1, 1];
    a = f(&a);
    std::process::exit((a[0] != 1) as i32);
}
leonardo-m

comment created time in 5 days

push eventtmiasko/cargo

Alex Crichton

commit sha 02fc16aece46abcd23d2ade2d969497f07fe26ab

Fix jobserver_exists test on single-cpu systems Closes #8595

view details

Jan Tojnar

commit sha 916b392cdbe4702c7b8f83e4f970cca7d722c553

doc: Qualify GNU licenses in example license field Since SPDX License list 3.0, unqualified GNU licenses are deprecated: https://www.gnu.org/licenses/identify-licenses-clearly.html We use version 3.6 of the list so we should not use the deprecated licenses.

view details

louib

commit sha ff7d328149878aec48f4b6366ada62f58eadf5dd

Fix small typo in reference/profiles.md

view details

bors

commit sha 3bf5ad8ca9d6255b153242ca6d270fe398933ef0

Auto merge of #8605 - louib:patch-1, r=ehuss Fix small typo in reference/profiles.md

view details

Eric Huss

commit sha 5305a3def63603b7e9d03233f216924ca38e2465

Fix typo Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>

view details

bors

commit sha 5de5915ca281b88cc3b8394823261ab33c2f9ab6

Auto merge of #8598 - alexcrichton:fix-test, r=ehuss Fix jobserver_exists test on single-cpu systems Closes #8595

view details

bors

commit sha 20d35ffeb6cea95aecae1ec85cdf36df6944f463

Auto merge of #8604 - jtojnar:patch-1, r=ehuss doc: Qualify GNU licenses in example license field Since SPDX License list 3.0, unqualified GNU licenses are deprecated: https://www.gnu.org/licenses/identify-licenses-clearly.html We use version 3.6 of the list so we should not use the deprecated licenses.

view details

Alex Crichton

commit sha 624acc8e2be3cda315772c388feabf6bc6f69d2e

Build manpage archive deterministically Keep deterministic builds for Cargo! The changes here are: * Sort files being added to the archive to ensure they're added in the same order on all platforms. * Flag the archive builder as "deterministic mode" which means it won't pick up fields like mtime. Closes #8599

view details

bors

commit sha ab32ee88dade1b50c77347599e82ca2de3fb8a51

Auto merge of #8600 - alexcrichton:deterministic, r=ehuss Build manpage archive deterministically Keep deterministic builds for Cargo! Closes #8599

view details

Eric Huss

commit sha fd6a84aa83e6ce4431263a361bb52df12ddaa9dc

Add chapters on dependency resolution and SemVer compatibility.

view details

Eric Huss

commit sha 4d023b1ec5ffce5951d56182cd054bb22a69c02b

Don't check src/doc directory.

view details

Eric Huss

commit sha 1ee38a326e56723b54da2adb8dd7d9af43fae744

Try to fix CI for semver-check.

view details

Eric Huss

commit sha 006023c5827b2288230df51676b69b725b822e86

Update from review comments.

view details

Hanif Bin Ariffin

commit sha 79f351297501b16d3396b6c3b0bdb77a83d8958d

Renames SourceId::into_url -> SourceId::as_url While studying the source code, I am surprised to see that `into_url` does not actually consume the string when a function with such name usually does. Additionally, there are traits in `cargo::util::IntoUrl` with the same and does exactly what you expect, consumes T and yields a `Url`. I hope this is not too nitpicky. Thank you!

view details

Hanif Bin Ariffin

commit sha 3dbac42a57ae8914a9fec765276acac33360305d

Renamed SourceIdIntoUrl -> SourceIdAsUrl

view details

David Pacheco

commit sha ea0709e88a2553a130c5dd6189af6f5358db1e18

Fix typo in SIGQUIT description

view details

bors

commit sha 4de00d2c7fdd961e72eb189a31f8ae677833ed99

Auto merge of #8615 - davepacheco:sigquit-typo, r=ehuss Fix typo in SIGQUIT description This PR fixes a small typo in the SIGQUIT description. (edit: removed my notes about automated tests because the PR bot has a more complete summary.) In terms of manual testing: I had a test that raised `SIGQUIT` using the "coredump" crate. Previously, it emitted: ``` error: test failed, to rerun pass '--test the_test' Caused by: process didn't exit successfully: `/Users/dap/oxide/experiments/rust-coredump/target/debug/deps/the_test-a8a068307be90649 --nocapture` (signal: 3, SIGQUIT: terminal quite signal) ``` Now, it emits: ``` error: test failed, to rerun pass '--test the_test' Caused by: process didn't exit successfully: `/Users/dap/oxide/experiments/rust-coredump/target/debug/deps/the_test-20c8e90133861ece --nocapture` (signal: 3, SIGQUIT: terminal quit signal) ``` which looks correct.

view details

Eric Huss

commit sha 18bc90cd0ed28701e2b64ecfe8ad921ffc80320b

Show full error context on `cargo run` error.

view details

Jake Shadle

commit sha a9a154f783fde8dad9f4ed437fc3e42f7cfe1b63

Fix bug with PathAndArg config values

view details

Jake Shadle

commit sha ddc7090f495afaff48b39ccc74036a1e75c6368c

Remove debug only code

view details

push time in 6 days

delete branch tmiasko/rust

delete branch : issue-76740

delete time in 6 days

issue commentrust-lang/rust

[AVR] SIGSEGV on release build of core crate

llc: llvm/lib/CodeGen/LiveIntervals.cpp:536: bool llvm::LiveIntervals::computeDeadValues(llvm::LiveInterval&, llvm::SmallVectorImpl<llvm::MachineInstr*>*): Assertion `MI && "No instruction defining live value"' failed.

<details><summary>LLVM IR</summary>

; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "llvm-link"
target datalayout = "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8"
target triple = "avr-unknown-unknown"

%0 = type { [0 x i8], i16, [0 x i8], [40 x i32], [0 x i8] }

; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.memcpy.p0i8.p0i8.i16(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i16, i1 immarg) addrspace(1) #0

declare void @_ZN4core3num6bignum8Big32x408mul_pow217h8ca9be035823d302E() unnamed_addr addrspace(1) #1

define void @_ZN4core3num7flt2dec8strategy6dragon15format_shortest17h6b1eacf2bca21fe3E(i16 %0) unnamed_addr addrspace(1) #1 {
  %2 = alloca %0, align 1
  %3 = alloca %0, align 1
  br label %4

4:                                                ; preds = %1
  %5 = load i8, i8* undef, align 1
  br label %6

6:                                                ; preds = %4
  %7 = getelementptr inbounds %0, %0* %3, i16 0, i32 3
  %8 = bitcast [40 x i32]* %7 to i8*
  br label %9

9:                                                ; preds = %6
  %10 = icmp ult i16 undef, 40
  br i1 %10, label %11, label %16

11:                                               ; preds = %9
  store i16 1, i16* undef, align 1
  br label %12

12:                                               ; preds = %11
  call addrspace(1) void @llvm.memcpy.p0i8.p0i8.i16(i8* nonnull align 1 dereferenceable(160) undef, i8* nonnull align 1 dereferenceable(160) %8, i16 160, i1 false) #2
  br i1 undef, label %16, label %13

13:                                               ; preds = %12
  %14 = icmp ugt i16 undef, 40
  br i1 %14, label %16, label %15

15:                                               ; preds = %13
  br i1 undef, label %17, label %16

16:                                               ; preds = %15, %13, %12, %9
  unreachable

17:                                               ; preds = %15
  br i1 undef, label %21, label %18

18:                                               ; preds = %17
  br i1 undef, label %20, label %19

19:                                               ; preds = %18
  unreachable

20:                                               ; preds = %18
  br i1 undef, label %21, label %22

21:                                               ; preds = %20, %17
  unreachable

22:                                               ; preds = %20
  br i1 undef, label %36, label %24

23:                                               ; preds = %24
  br i1 undef, label %36, label %35

24:                                               ; preds = %24, %22
  %25 = phi i32 [ %32, %24 ], [ 0, %22 ]
  %26 = load i32, i32* undef, align 1
  %27 = zext i32 %26 to i64
  %28 = mul nuw nsw i64 %27, 10
  %29 = zext i32 %25 to i64
  %30 = add nuw nsw i64 %28, %29
  %31 = lshr i64 %30, 32
  %32 = trunc i64 %31 to i32
  %33 = trunc i64 %30 to i32
  %34 = icmp eq i32* undef, undef
  br i1 %34, label %23, label %24

35:                                               ; preds = %23
  br i1 undef, label %36, label %36

36:                                               ; preds = %35, %35, %23, %22
  call align 1 addrspace(1) void @_ZN4core3num6bignum8Big32x408mul_pow217h8ca9be035823d302E()
  br i1 undef, label %39, label %37

37:                                               ; preds = %36
  %38 = load i16, i16* undef, align 1
  br label %40

39:                                               ; preds = %36
  unreachable

40:                                               ; preds = %128, %37
  %41 = phi i16 [ 0, %37 ], [ %80, %128 ]
  br label %42

42:                                               ; preds = %43, %40
  br i1 undef, label %44, label %43

43:                                               ; preds = %42
  br i1 false, label %42, label %44

44:                                               ; preds = %43, %42
  %45 = select i1 undef, i16 undef, i16 undef
  %46 = icmp ugt i16 %45, 40
  br i1 %46, label %47, label %48

47:                                               ; preds = %44
  unreachable

48:                                               ; preds = %44
  %49 = getelementptr inbounds %0, %0* %3, i16 0, i32 3, i16 %45
  %50 = bitcast i32* %49 to i8*
  br label %51

51:                                               ; preds = %57, %48
  %52 = phi i8* [ %50, %48 ], [ undef, %57 ]
  %53 = phi i8* [ undef, %48 ], [ %58, %57 ]
  %54 = icmp eq i8* %52, %8
  br i1 %54, label %55, label %57

55:                                               ; preds = %51
  %56 = icmp ne i8* %53, undef
  br label %60

57:                                               ; preds = %51
  %58 = getelementptr inbounds i8, i8* %53, i16 -4
  %59 = icmp eq i8 undef, 0
  br i1 %59, label %51, label %60

60:                                               ; preds = %57, %55
  br i1 undef, label %61, label %68

61:                                               ; preds = %60
  br i1 undef, label %67, label %62

62:                                               ; preds = %62, %61
  %63 = or i1 undef, undef
  store i32 0, i32* undef, align 1
  %64 = icmp ult i16 undef, %45
  br i1 %64, label %62, label %65

65:                                               ; preds = %62
  br i1 %63, label %67, label %66

66:                                               ; preds = %65
  unreachable

67:                                               ; preds = %65, %61
  br label %68

68:                                               ; preds = %67, %60
  br i1 false, label %69, label %70

69:                                               ; preds = %68
  unreachable

70:                                               ; preds = %68
  %71 = select i1 undef, i16 undef, i16 %38
  br i1 false, label %72, label %73

72:                                               ; preds = %70
  unreachable

73:                                               ; preds = %70
  br i1 undef, label %74, label %77

74:                                               ; preds = %73
  br i1 undef, label %77, label %75

75:                                               ; preds = %75, %74
  %76 = icmp ult i16 undef, %71
  br i1 %76, label %75, label %77

77:                                               ; preds = %75, %74, %73
  %78 = icmp ult i16 %41, %0
  br i1 %78, label %79, label %133

79:                                               ; preds = %77
  %80 = add nuw i16 %41, 1
  %81 = load i16, i16* undef, align 1
  %82 = icmp ugt i16 undef, 40
  br i1 %82, label %83, label %84

83:                                               ; preds = %79
  unreachable

84:                                               ; preds = %79
  br label %85

85:                                               ; preds = %87, %84
  br i1 undef, label %86, label %87

86:                                               ; preds = %85
  br label %88

87:                                               ; preds = %85
  br i1 undef, label %85, label %88

88:                                               ; preds = %87, %86
  %89 = icmp slt i8 undef, %5
  %90 = load i16, i16* undef, align 1
  %91 = select i1 undef, i16 undef, i16 %90
  %92 = icmp ugt i16 %91, 40
  br i1 %92, label %93, label %94

93:                                               ; preds = %102, %98, %88
  unreachable

94:                                               ; preds = %88
  %95 = getelementptr inbounds %0, %0* %2, i16 0, i32 3, i16 %91
  br i1 false, label %102, label %96

96:                                               ; preds = %96, %94
  br i1 undef, label %96, label %97

97:                                               ; preds = %96
  br i1 undef, label %98, label %102

98:                                               ; preds = %97
  %99 = icmp ult i16 %91, 40
  br i1 %99, label %100, label %93

100:                                              ; preds = %98
  store i32 1, i32* %95, align 1
  %101 = add nuw nsw i16 %91, 1
  br label %102

102:                                              ; preds = %100, %97, %94
  %103 = phi i16 [ %101, %100 ], [ %91, %97 ], [ 0, %94 ]
  br i1 false, label %93, label %104

104:                                              ; preds = %102
  %105 = getelementptr inbounds %0, %0* %2, i16 0, i32 3, i16 undef
  %106 = bitcast i32* %105 to i8*
  br label %107

107:                                              ; preds = %110, %104
  %108 = phi i8* [ %106, %104 ], [ %111, %110 ]
  br i1 false, label %109, label %110

109:                                              ; preds = %107
  br label %114

110:                                              ; preds = %107
  %111 = getelementptr inbounds i8, i8* %108, i16 -4
  %112 = bitcast i8* %111 to i32*
  %113 = icmp eq i8 undef, 0
  br i1 %113, label %107, label %114

114:                                              ; preds = %110, %109
  %115 = icmp slt i8 undef, %5
  %116 = or i1 %89, %115
  br i1 %116, label %129, label %117

117:                                              ; preds = %114
  %118 = icmp ugt i16 undef, 40
  br i1 %118, label %120, label %119

119:                                              ; preds = %117
  br i1 undef, label %123, label %121

120:                                              ; preds = %117
  unreachable

121:                                              ; preds = %119
  br i1 undef, label %123, label %122

122:                                              ; preds = %121
  unreachable

123:                                              ; preds = %121, %119
  %124 = icmp ugt i16 %81, 40
  br i1 %124, label %125, label %126

125:                                              ; preds = %123
  unreachable

126:                                              ; preds = %123
  %127 = icmp ugt i16 %90, 40
  br i1 %127, label %133, label %128

128:                                              ; preds = %126
  br i1 false, label %130, label %40

129:                                              ; preds = %114
  br i1 %115, label %130, label %132

130:                                              ; preds = %129, %128
  br i1 %89, label %131, label %132

131:                                              ; preds = %130
  unreachable

132:                                              ; preds = %130, %129
  ret void

133:                                              ; preds = %126, %77
  unreachable
}

attributes #0 = { argmemonly nounwind willreturn }
attributes #1 = { "target-cpu"="atmega328" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0}

!0 = !{i32 7, !"PIC Level", i32 2}

</details>

jsen-

comment created time in 6 days

PR opened rust-lang/rust

DroplessArena: Allocate objects from the end of memory chunk

Allocating from the end of memory chunk simplifies the alignment code and reduces the number of checked arithmetic operations.

r? @Mark-Simulacrum

+16 -21

0 comment

1 changed file

pr created time in 6 days

create barnchtmiasko/rust

branch : arena

created branch time in 6 days

push eventtmiasko/rust

Marcel Hellwig

commit sha 73e27b3e18dcbbef3a36620c4a44306e2bbdcd13

deny(unsafe_op_in_unsafe_fn) in libstd/process.rs

view details

Marcel Hellwig

commit sha 00d537dcd03f9ff5ebdf8b86e039dbdb0a7f850c

deny(unsafe_op_in_unsafe_fn) in libstd/path.rs

view details

Ivan Tham

commit sha a7468705cbf0fb551b8b1d8b420123262f7d92b2

Use translated variable for test string Test should be educative, added english translation and pronounciation.

view details

Ivan Tham

commit sha ba4c4988161abbe58e973b792c7e271785b4bc4d

Add more info for Vec Drain doc See its documentation for more

view details

Ivan Tham

commit sha 71484121001b69aefdc41fd7192b7095250517a7

Vec slice example fix style and show type elision

view details

David Wood

commit sha 0f2bd56b29857453835e47abbe96a80b175632d1

lint/ty: move fns to avoid abstraction violation This commit moves `transparent_newtype_field` and `is_zst` to `LateContext` where they are used, rather than being on the `VariantDef` and `TyS` types. Signed-off-by: David Wood <david@davidtw.co>

view details

CDirkx

commit sha 518f1ccb728aa03665e51710c12973a74cc98df5

Stabilize some Result methods as const Stabilize the following methods of `Result` as const: - `is_ok` - `is_err` - `as_ref` Possible because of stabilization of #49146 (Allow if and match in constants).

view details

CDirkx

commit sha ea5dc0909ea1ed4135f1bdecbaa3423051be578d

Make some Ordering methods const Constify the following methods of `core::cmp::Ordering`: - `reverse` - `then` Stabilizes these methods as const under the `const_ordering` feature. Also adds a test for these methods in a const context. Possible because of #49146 (Allow `if` and `match` in constants).

view details

Howard Su

commit sha a80d39041e2d5cd58a846c9ef9e01ee9d691a7ed

Use inline(never) instead of cold inline(never) is better way to avoid optimizer to inline the function instead of cold.

view details

Christiaan Dirkx

commit sha 787b2707a77fa1a98f512a4905662a1a16daf13c

Move const tests for `Result` to `library\core` Part of #76268

view details

Christiaan Dirkx

commit sha 79d563c819483eaf6e67b6aaaef9d0ca6030337d

Move const tests for `Ordering` to `library\core` Part of #76268

view details

Tomasz Miąsko

commit sha b54386ab7a9da8a4f22db3a35a9ec7b0f2b98b6c

Detect overflow in proc_macro_server subspan

view details

Tomasz Miąsko

commit sha d98bac4e4e3cc87ec9b848c173d570ebe2aa30b6

Add tests for overflow in Vec::drain

view details

Tomasz Miąsko

commit sha f8cfb2f5ad847b871399dfef9b8b8ff4e84a75cb

Add tests for overflow in String / VecDeque operations using ranges

view details

Scott McMurray

commit sha 6092828d1f432bb313818e7cfab961c0e494f69e

Add `[T; N]: TryFrom<Vec<T>>` This is very similar to the existing `Box<[T; N]>: TryFrom<Box<[T]>>`, but allows avoiding the `shrink_to_fit` if you have a vector and not a boxed slice.

view details

David Wood

commit sha f8376b59d1391a5191a561c44067355f1a99c7c0

shim: monomorphic `FnPtrShim`s during construction This commit adjusts MIR shim construction so that substitutions are applied to function pointer shims during construction, rather than during codegen (as determined by `substs_for_mir_body`) - as substitutions will no longer occur during codegen, function pointer shims can now be polymorphic without incurring double substitutions. Signed-off-by: David Wood <david@davidtw.co>

view details

kadmin

commit sha 6cb671628393e292d5e68e6367f80488ace46532

Add test for checking if-let or-patterns

view details

Ayush Kumar Mishra

commit sha 941dca8ed238a04a55741127165e9ad80671ed8a

Add Arith Tests in Library

view details

Ayush Kumar Mishra

commit sha dc37b553accd4fb2f8d0c59f69c701b524361cc2

Minor refactoring

view details

Ayush Kumar Mishra

commit sha 7d834c87d2ebb3d8dd4895bc5fabc4d44a1d2b52

Move Various str tests in library

view details

push time in 7 days

delete branch tmiasko/bytes

delete branch : tsan

delete time in 7 days

PR closed tokio-rs/bytes

Reviewers
Make Bytes & BytesMut compatible with ThreadSanitizer

Replace atomic fences with atomic loads for compatibility with ThreadSanitizer.

+10 -6

0 comment

3 changed files

tmiasko

pr closed time in 7 days

push eventtmiasko/rust

Tomasz Miąsko

commit sha 65edf54c256e5369fdf9c0a972cd83d2414d5bb5

Add a regression test for copy propagation miscompilation

view details

push time in 7 days

push eventtmiasko/rust

CDirkx

commit sha 518f1ccb728aa03665e51710c12973a74cc98df5

Stabilize some Result methods as const Stabilize the following methods of `Result` as const: - `is_ok` - `is_err` - `as_ref` Possible because of stabilization of #49146 (Allow if and match in constants).

view details

Christiaan Dirkx

commit sha 787b2707a77fa1a98f512a4905662a1a16daf13c

Move const tests for `Result` to `library\core` Part of #76268

view details

Christiaan Dirkx

commit sha ab4fa215b91491be0a7d2c3630efce7a6edb971d

Update Clippy testcases Update the test `redundant_pattern_matching`: check if `is_ok` and `is_err` are suggested within const contexts. Also removes the `redundant_pattern_matching_const_result` test, as it is no longer needed.

view details

Christiaan Dirkx

commit sha a59d48064931ab860fb065e4ef3a2f5cc4276f96

Remove `can_suggest` check for `is_ok` and `is_err`. `is_ok` and `is_err` are stabilized as const and can thus always be suggested.

view details

CDirkx

commit sha bf70e21a7e48008a8c1d82c3b0376e574f9bc91b

Update src/tools/clippy/clippy_lints/src/matches.rs Co-authored-by: Ralf Jung <post@ralfj.de>

view details

bors

commit sha b873fa6d42cf305131d2583d03b84686e5e40f2e

Auto merge of #76136 - CDirkx:const-result, r=dtolnay Stabilize some Result methods as const Stabilize the following methods of Result as const: - `is_ok` - `is_err` - `as_ref` A test is also included, analogous to the test for `const_option`. These methods are currently const under the unstable feature `const_result` (tracking issue: #67520). I believe these methods to be eligible for stabilization because of the stabilization of #49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](https://github.com/rust-lang/rust/pull/75463) and [PR#76135](https://github.com/rust-lang/rust/pull/76135). Note: these methods are the only methods currently under the `const_result` feature, thus this PR results in the removal of the feature. Related: #76225

view details

Tomasz Miąsko

commit sha fe85a34fcfa867644f64526b058c56b3f6f6377f

Add a regression test for copy propagation miscompilation

view details

push time in 7 days

pull request commentrust-lang/rust

Add a regression test for copy propagation miscompilation

r? @wesleywiser

tmiasko

comment created time in 7 days

push eventtmiasko/rust

Tomasz Miąsko

commit sha 190fe462ab1166ced2d04bacf5c633e70f898418

Add a regression test for copy propagation miscompilation

view details

push time in 7 days

PR opened rust-lang/rust

Add a regression test for copy propagation miscompilation
+32 -0

0 comment

1 changed file

pr created time in 7 days

push eventtmiasko/rust

Tomasz Miąsko

commit sha 5af27adb4c9d0170631bf06a2df888cbf80aa15c

Add a regression test for copy propagation miscompilation

view details

push time in 7 days

create barnchtmiasko/rust

branch : issue-76740

created branch time in 7 days

pull request commentrust-lang/rust

Make RawFd implement the RawFd traits

Thanks for correction. I thought that trait was unsafe to implemented. It is quite disappointing that it is otherwise. The search results from grep.app reveals that pretty much every single use of IntoRawFd as input bound is unsound, e.g., in wastime, nix, wayland-rs, duct.rs ...

withoutboats

comment created time in 7 days

pull request commentrust-lang/rust

Make RawFd implement the RawFd traits

I would generally assume that it is safe to take ownership of file descriptor returned from IntoRawFd. With changes here it would be unsafe, since RawFd is just an integer.

withoutboats

comment created time in 7 days

issue commentrust-lang/rust

Miscompilation introduced by CopyPropagation

The copy propagation incorrectly assumes that a use of a local in Operand::Move will not mutate it.

tmiasko

comment created time in 7 days

push eventtmiasko/rust

Tomasz Miąsko

commit sha 812e0f40acd1f181309de0499a21201688ca8843

Reopen standard file descriptors when they are missing on Unix The syscalls returning a new file descriptors generally return lowest-numbered file descriptor not currently opened, without any exceptions for those corresponding to stdin, sdout, or stderr. Previously when any of standard file descriptors has been closed before starting the application, operations on std::io::{stderr,stdin,stdout} were likely to either succeed while being performed on unrelated file descriptor, or fail with EBADF which is silently ignored. Avoid the issue by using /dev/null as a replacement when the standard file descriptors are missing. The implementation is based on the one found in musl. It was selected among a few others on the basis of the lowest overhead in the case when all descriptors are already present (measured on GNU/Linux).

view details

push time in 7 days

push eventtmiasko/rust

Christiaan Dirkx

commit sha fb64e6dcf0a7ea0518c8f2d499327a2b6974f859

Add test for `Ipv4Addr` methods in a const context

view details

bors

commit sha 130359cb05246fcacdde61baa2613419ef6570c7

Auto merge of #76010 - Aaron1011:fix/cfg-generic-param, r=petrochenkov Run cfg-stripping on generic parameters before invoking derive macros Fixes #75930 This changes the tokens seen by a proc-macro. However, ising a `#[cfg]` attribute on a generic paramter is unusual, and combining it with a proc-macro derive is probably even more unusual. I don't expect this to cause any breakage.

view details

Camelid

commit sha c86d249e94ae45fff1c882c98d85aaf49133f0b6

Use "Fira Sans" for crate list font Fira Sans is what's used for module lists and other item lists. Previously, the default body font, "Source Serif Pro", was used for crate lists, which didn't visually match other item lists.

view details

Leonora Tindall

commit sha d0af12560c9672546a6434e2e1e9ec72ad8f8e70

Rename and expose LoopState as ControlFlow

view details

marmeladema

commit sha bd49eec3d76d5894b539a28309c2fe24f915ee94

interface: use `OnceCell` from standard library

view details

marmeladema

commit sha 1b650d0fea209e0b69407a0a1e04feeb57c4b2d4

datastructures: replace `lazy_static` by `SyncLazy` from std

view details

marmeladema

commit sha 67b8f9491c30cba0e4892f6b5b8bda8b312428da

hir: replace `lazy_static` by `SyncLazy` from std

view details

marmeladema

commit sha 73a7204983a28177b296a3dcd8632540a6fcee1a

feature: replace `lazy_static` by `SyncLazy` from std

view details

marmeladema

commit sha 99c96c5bfe67ccbf7fc379458b8bcf9513bf9b7d

driver: replace `lazy_static` by `SyncLazy` from std

view details

Vadim Petrochenkov

commit sha b1491eacfc2f2ff05ff2a1d3b557c30e15c5f81f

lexer: Tiny improvement to shebang detection Lexer now discerns between regular comments and doc comments, so use that. The change only affects the choice of reported errors.

view details

Christiaan Dirkx

commit sha 0c77257e56a20a81f5b4e4452cae5e460ad30140

Make all remaining methods of `std::net::Ipv4Addr` const Makes the following methods of `std::net::Ipv4Addr` unstable const under the `const_ipv4` feature: - `is_global` - `is_reserved` - `is_broadcast` - `to_ipv6_compatible` - `to_ipv6_mapped` This results in all methods of `Ipv4Addr` being const. Also adds tests for these methods in a const context.

view details

Denis Vasilik

commit sha 07cd4c8778a219f681f78dfb3c8ee123f630b06d

Use intra-doc links

view details

bors

commit sha 48248af6307643072b337db3fe991fd6e638bfdd

Auto merge of #5999 - rail-rain:fix_fp_transmute_ptr_to_ptr_in_consts, r=ebroto Fix a fp in `transmute_ptr_to_ptr` fixes #5959 changelog: Fix a false positive in `transmute_ptr_to_ptr` that the lint fires when `transmute` is used to cast a reference in const contexts although dereferencing raw pointers in consts is unstable.

view details

Camelid

commit sha e5c17bff3514cf951ffb304ddd1d5fe1887cca65

Clean up header in `iter` docs for `for` loops

view details

Tomasz Miąsko

commit sha 6c51ec96bb5b6679645be1651d4ff1d079412af6

inliner: Avoid query cycles when optimizing generators The HIR Id trick is insufficient to prevent query cycles when optimizing generators, since merely requesting a layout of a generator also computes its `optimized_mir`. Make no attempts to inline functions into generators within the same crate to avoid query cycles.

view details

Camelid

commit sha 54a4fd1eb9418e2ea8313e66cde525930cc191ae

Minor improvements Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

Tyler Mandry

commit sha 383da5e1e670c5028731aa3e477578e5e97c6e52

Rollup merge of #74880 - chrisduerr:fix_matches, r=dtolnay Add trailing comma support to matches macro

view details

Tyler Mandry

commit sha 5f28831a40477a0d564368e11fe6c5d6a26cd56f

Rollup merge of #76074 - richkadel:llvm-coverage-map-gen-6b.5.1, r=wesleywiser Add new `-Z dump-mir-spanview` option Similar to `-Z dump-mir-graphviz`, this adds the option to write HTML+CSS files that allow users to analyze the spans associated with MIR elements (by individual statement, just terminator, or overall basic block). This PR was split out from PR #76004, and exposes an API for spanview HTML+CSS files that is also used to analyze code regions chosen for coverage instrumentation (in a follow-on PR). Rust compiler MCP rust-lang/compiler-team#278 Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation r? @tmandry FYI @wesleywiser

view details

Tyler Mandry

commit sha 7c1c7de85f47cd527d1935295e68218857d2d969

Rollup merge of #76088 - hbina:add_example, r=LukasKalbertodt Add more examples to lexicographic cmp on Iterators. Given two arrays of T1 and T2, the most important rule of lexicographical comparison is that two arrays of equal length will be compared until the first difference occured. The examples provided only focuses on the second rule that says that the shorter array will be filled with some T2 that is less than every T1. Which is only possible because of the first rule.

view details

Tyler Mandry

commit sha 34c8b7a92cd2ced1b4aee960a84f69f6b3a56bb6

Rollup merge of #76099 - camelid:patch-8, r=jyn514 Add info about `!` and `impl Trait` Fixes #76094. @rustbot modify labels: T-doc C-enhancement

view details

push time in 7 days

pull request commentrust-lang/rust

Reopen standard file descriptors when they are missing on Unix

r? @Amanieu

tmiasko

comment created time in 8 days

issue commentrust-lang/rust

Deadlocks on NetBSD around fork()

I can reproduce the last issue on daily snapshot from 2020-09-18, usually after just a few seconds of executing program in the loop. If you do reproduce it at some point, I would appreciate if you could report this upstream, since I generally don't use NetBSD.

Simplified reproducer, since it turns out neither fork nor pthread_getattr_np is required, except for the fact that latter is allocating memory:

#include <assert.h>
#include <pthread.h>
#include <stdlib.h>

#define N 4

static pthread_t threads[N];

static void *run(void *arg) {
        return malloc(1024);
}

int main() {
        for (int i = 0; i != N; ++i) assert(pthread_create(&threads[i], NULL, run, NULL) == 0);
        for (int i = 0; i != N; ++i) assert(pthread_join(threads[i], NULL) == 0);
}
he32

comment created time in 8 days

pull request commentrust-lang/rust

[mir-opt] Introduce a new flag to enable experimental/unsound mir opts

Is this option intended only for unsound passes or also that are buggy in other ways e.g., ICE? If the latter I would also include inlining pass. Recently when I evaluated mir-opt-level=2 on a different crates, rustc generally ICEd due to normalization issues in inliner or other issues exposed indirectly by inlining. The attempt to enable inlining in #75495 didn't fare any better.

wesleywiser

comment created time in 8 days

PullRequestReviewEvent

issue openedrust-lang/rust

unreachable_patterns false negative with or_patterns

The match remains exhaustive with highlighted pattern removed, but it does not produce any warnings:

#![feature(or_patterns)]

pub struct A;

pub enum B {
    X,
    Y,
}

pub enum E {
    A(A),
    B(B),
}

pub fn f(e: E) -> () {
    match e {
        E::B(B::X) => (),
        E::B(B::Y | B::X)
        //          ~~~~ 
        | E::A(A) => (),
    }
}

created time in 10 days

issue commentrust-lang/rust

starting from nightly-2020-08-18 rustls can't connect to some websites

It minimized code from rustls <HandshakeMessagePayload as Codec>::encode.

paolobarbolini

comment created time in 11 days

issue commentrust-lang/rust

starting from nightly-2020-08-18 rustls can't connect to some websites

#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Type {
    A = 1,
    B = 7,
}

impl Type {
    fn encode(&self) -> Type {
        match self {
            Type::A => Type::B,
            _ => *self,
        }
    }
}

fn main() {
    assert_eq!(Type::A.encode(), Type::B);
}
$ rustc -Zmir-opt-level=0 b.rs && ./b
$ rustc -Zmir-opt-level=1 b.rs && ./b
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `A`,
 right: `B`', b.rs:18:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
paolobarbolini

comment created time in 11 days

push eventtmiasko/rust

Tomasz Miąsko

commit sha ff1a9e406bfccefedb6c4f2cabc0c4d59ac947d4

Fix underflow when calculating the number of no-op jumps folded When removing unwinds to no-op blocks and folding jumps to no-op blocks, remove the unwind target first. Otherwise we cannot determine if target has been already folded or not. Previous implementation incorrectly assumed that all resume targets had been folded already, occasionally resulting in an underflow: remove_noop_landing_pads: removed 18446744073709551613 jumps and 3 landing pads

view details

push time in 11 days

Pull request review commentrust-lang/rust

Collect statistics about MIR optimizations

+//! # Support for collecting simple statistics+//!+//! Statistics are useful for collecting metrics from optimization passes, like+//! the number of simplifications performed. To avoid introducing overhead, the+//! collection of statistics is enabled only when rustc is compiled with+//! debug-assertions.+//!+//! Statistics are static variables defined in the module they are used, and+//! lazy registered in the global collector on the first use. Once registered,+//! the collector will obtain their values at the end of compilation process+//! when requested with -Zmir-opt-stats option.++use parking_lot::{const_mutex, Mutex};+use std::fmt::Write as _;+use std::io::{self, Write as _};+use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};++static COLLECTOR: Collector = Collector::new();++/// Enables the collection of statistics.+/// To be effective it has to be called before the first use of a statistics.+pub fn try_enable() -> Result<(), ()> {+    COLLECTOR.try_enable()+}++/// Prints all statistics collected so far to the stderr.+pub fn print() {+    COLLECTOR.print();+}++pub struct Statistic {+    category: &'static str,+    name: &'static str,+    initialized: AtomicBool,+    value: AtomicUsize,+}++struct Collector(Mutex<State>);++struct State {+    enabled: bool,+    stats: Vec<&'static Statistic>,+}++#[derive(Eq, PartialEq, Ord, PartialOrd)]+struct Snapshot {+    category: &'static str,+    name: &'static str,+    value: usize,+}++impl Statistic {+    pub const fn new(category: &'static str, name: &'static str) -> Self {+        Statistic {+            category,+            name,+            initialized: AtomicBool::new(false),+            value: AtomicUsize::new(0),+        }+    }++    pub fn name(&self) -> &'static str {+        self.name+    }++    pub fn category(&self) -> &'static str {+        self.category.rsplit("::").next().unwrap()+    }++    #[inline]+    pub fn register(&'static self) {+        if cfg!(debug_assertions) {+            if !self.initialized.load(Ordering::Acquire) {+                COLLECTOR.register(self);+            }+        }+    }++    #[inline]+    pub fn increment(&'static self, value: usize) {+        if cfg!(debug_assertions) {+            self.value.fetch_add(value, Ordering::Relaxed);

That would give a wrong impression that some form of synchronization is required here. Atomicity of RMW operations is sufficient for correctness.

tmiasko

comment created time in 11 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Collect statistics about MIR optimizations

+//! # Support for collecting simple statistics+//!+//! Statistics are useful for collecting metrics from optimization passes, like+//! the number of simplifications performed. To avoid introducing overhead, the+//! collection of statistics is enabled only when rustc is compiled with+//! debug-assertions.+//!+//! Statistics are static variables defined in the module they are used, and+//! lazy registered in the global collector on the first use. Once registered,+//! the collector will obtain their values at the end of compilation process+//! when requested with -Zmir-opt-stats option.++use parking_lot::{const_mutex, Mutex};+use std::fmt::Write as _;+use std::io::{self, Write as _};+use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};++static COLLECTOR: Collector = Collector::new();

I experimented with different implementation approaches:

  1. Statistics definitions are in the context together with their values.
  2. Statistics definitions are in MIR passes, their values are stored in the context.
  3. Statistics definitions and values are stored together with MIR passes.

I strongly prefer variants that put statistics definitions together with MIR passes that uses them. In that approach, adding and removing counters is trivial, additionally any unused counters are detected as such during compilation.

Values can be stored in the context if we want to support multiple rustc sessions in a single process, although is requires passing context to all those places where counters are used. But is there a any real use-case? Why would you use rustc with debug-assertions and MIR optimizations counters inside the RLS?

tmiasko

comment created time in 11 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Collect statistics about MIR optimizations

 fn validate_commandline_args_with_session_available(sess: &Session) {             break;         }     }++    if sess.opts.debugging_opts.mir_opt_stats {+        if let Err(_) = rustc_data_structures::statistics::try_enable() {+            sess.warn(&format!(+                "-Zmir-opt-stats is only available when rustc is compiled with debug-assertions"+            ));

Replaced with an error.

tmiasko

comment created time in 11 days

PullRequestReviewEvent

push eventtmiasko/rust

Tomasz Miąsko

commit sha b0a81f4868dcbf4f4b58fd828ad8defe33b23d75

Collect statistics about MIR optimizations

view details

push time in 11 days

delete branch tmiasko/rust

delete branch : range-overflow

delete time in 12 days

PR opened rust-lang/rust

Collect statistics about MIR optimizations

For example -Zmir-opt-level=3 -Zmir-opt-stats:

 1813 const_prop                   Number of const propagations
  313 copy_prop                    Maximum number of copy propagations in a function
 6424 copy_prop                    Number of constants copy propagated
  927 copy_prop                    Number of locals copy propagated
 3345 inline                       Number of functions inlined
   21 instcombine                  Number of array length operations simplified
 4109 instcombine                  Number of deref-ref operations simplified
   72 instcombine                  Number of equality comparisons with a const bool simplified
   75 match_branches               Number of similar basic blocks merged together
   38 nrvo                         Number of functions eligible for named return value optimization
  207 remove_noop_landing_pads     Number of no-op jumps folded
 4182 remove_noop_landing_pads     Number of no-op landing pads removed
15334 simplify                     Number of basic blocks merged with their only predecessor
36697 simplify                     Number of dead basic blocks removed
  844 simplify                     Number of switch int terminators with identical successors replaced with a goto
 1213 simplify_branches            Number of false edges simplified to a goto
   67 simplify_branches            Number of false unwinds simplified to a goto
   21 simplify_branches            Number of true assertions simplified to a goto
   62 simplify_comparison_integral Number of switches on a result of integer comparison simplified to switches on integers
    5 simplify_try                 Number of arm identities simplified to a move
    0 uninhabited_enum_branching   Number of branches corresponding to uninhabited enum variants removed
  526 unreachable_prop             Number of unreachable terminators propagated
+305 -3

0 comment

18 changed files

pr created time in 12 days

create barnchtmiasko/rust

branch : mir-opt-stats

created branch time in 12 days

pull request commentrust-lang/rust

Detect overflow in proc_macro_server subspan

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

tmiasko

comment created time in 12 days

PR opened rust-lang/rust

Fix underflow when calculating the number of no-op jumps folded

When removing unwinds to no-op blocks and folding jumps to no-op blocks, remove the unwind target first, as otherwise we cannot determine if target has been already folded or not, and the calculation might underflow:

remove_noop_landing_pads: removed 18446744073709551613 jumps and 3 landing pads
+10 -9

0 comment

1 changed file

pr created time in 12 days

create barnchtmiasko/rust

branch : no-op-jumps

created branch time in 12 days

pull request commentrust-lang/rust

Online def-use analysis for copy propagation pass

Does the existing const prop pass handle those propagations?

Last time I looked into it, I was under the impression that constant propagation is in a large part a lint, and has to be quite conservative to avoid introducing spurious warnings, e.g., in a code that is otherwise unreachable.

tmiasko

comment created time in 12 days

delete branch tmiasko/rust

delete branch : online-copy-prop

delete time in 12 days

PR closed rust-lang/rust

Online def-use analysis for copy propagation pass S-waiting-on-author

Implement an online def-use analysis for the copy propagation pass. The analysis is updated in an incremental fashion as changes are made to the MIR body instead of being recomputed from scratch after each change.

The analysis is intended to be functionally equivalent to the previous one, but it also offers a new methods to: remove specific statement, remove storage markers, and replace the uses of a local with another local or a constant, all while keeping the analysis up-to date.

There are two functional changes to the copy propagation pass, but they should have no effect in practice:

  • Each locals is examined only once as a potential destination for copy propagation, since propagation does not introduce new optimization opportunities.

  • The code for self-assignment elimination has been removed, since it not necessary (assignments that are used for the propagation are removed separately).

For def-use analysis changes, I would recommend reading the new version and the old version separately, rather than examining the diff. For the copy propagation changes, I would recommend looking at the diff that ignores whitespace during comparison.

Closes #36673. Closes #73717.

+699 -317

18 comments

4 changed files

tmiasko

pr closed time in 12 days

pull request commentrust-lang/rust

Online def-use analysis for copy propagation pass

There is a pre-existing issue in the copy propagation pass, I opened #76740 to track it.

@jonas-schievink regarding those copy propagations performed after destination propagation, my notes show that roughly 12000 of those were arguments (they could be propagated by dest-prop if it was a little bit more flexible with regards to propagation direction, I suppose?). There were also substantial number of constant propagated as noted before.

Given that copy propagation pass is working incorrectly right now and has a candidate for a replacement, I am going to close this now.

tmiasko

comment created time in 12 days

push eventtmiasko/rust

push time in 12 days

push eventtmiasko/rust

Matthias Krüger

commit sha b4935e07269429e04abe0d6d25f7e3211f4fa3f6

use sort_unstable to sort primitive types It's not important to retain original order if we have &[1, 1, 2, 3] for example. clippy::stable_sort_primitive

view details

Esteban Küber

commit sha 21f8326cec03848368e02936a032103aa24cf6d2

Provide suggestion for missing fields in patterns

view details

Mara Bos

commit sha 458aaba08467dc6b8d04b79f955a46be779d94f1

Add Atomic*::from_mut. The atomic equivalent of Cell::from_mut.

view details

Mara Bos

commit sha 3be40b22c83491e4a4d34e2ad06aa81b804b9fad

Fix AtomicPtr::from_mut align check: Avoid generic arg in const expr. See #76200.

view details

Mara Bos

commit sha 9914c3beed0f4a829e78eafb36bac39d418b71f5

Supress unused_macros error on architectures with no atomics.

view details

Joshua Nelson

commit sha 245f69ad3c16c1f7355c3901e131fa01b588bf36

Refactor `resolve_link` into a separate function

view details

Joshua Nelson

commit sha 7dc0d335bcc819c770320635a055c9cfe076339a

Refactor `resolve_with_disambiguator` into a separate function

view details

Joshua Nelson

commit sha 8a13fc494d4365e57d8f343219f0201458b68591

Require `module_id` param to `resolve` to be non-empty Previously, `resolve` would immediately check that `module_id` was non-empty and give an error if not. This had two downsides: - It introduced `Option`s everywhere, even if the calling function knew it had a valid module, and - It checked the module on each namespace, which is unnecessary: it only needed to be checked once. This makes the caller responsible for checking the module exists, making the code a lot simpler.

view details

Rich Kadel

commit sha 79aa9b15d7403ce2dc40b525a1d16e6c4ad1973c

Optimize behavior of vec.split_off(0) (take all) Optimization improvement to `split_off()` so the performance meets the intuitively expected behavior when `at == 0`, avoiding the current behavior of copying the entire vector. The change honors documented behavior that the method leaves the original vector's "previous capacity unchanged". This improvement better supports the pattern for building and flushing a buffer of elements, such as the following: ```rust let mut vec = Vec::new(); loop { vec.push(something); if condition_is_met { process(vec.split_off(0)); } } ``` `Option` wrapping is the first alternative I thought of, but is much less obvious and more verbose: ```rust let mut capacity = 1; let mut vec: Option<Vec<Stuff>> = None; loop { vec.get_or_insert_with(|| Vec::with_capacity(capacity)).push(something); if condition_is_met { capacity = vec.capacity(); process(vec.take().unwrap()); } } ``` Directly applying `mem::replace()` could work, but `mem::` functions are typically a last resort, when a developer is actively seeking better performance than the standard library provides, for example. The benefit of the approach to this change is it does not change the existing API contract, but improves the peformance of `split_off(0)` for `Vec`, `String` (which delegates `split_off()` to `Vec`), and any other existing use cases. This change adds tests to validate the behavior of `split_off()` with regard to capacity, as originally documented, and confirm that behavior still holds, when `at == 0`. The change is an implementation detail, and does not require a documentation change, but documenting the new behavior as part of its API contract may benefit future users. (Let me know if I should make that documentation update.) Note, for future consideration: I think it would be helpful to introduce an additional method to `Vec` (if not also to `String`): ``` pub fn take_all(&mut self) -> Self { self.split_off(0) } ``` This would make it more clear how `Vec` supports the pattern, and make it easier to find, since the behavior is similar to other `take()` methods in the Rust standard library.

view details

Esteban Küber

commit sha 62effcbd5bfaf74e99def3e9a660dba9728b0b47

Detect turbofish with multiple type params missing leading `::` Fix #76072.

view details

bors

commit sha 9b4154193e8471f36b1a9e781f1ef7d492fc6a6c

Auto merge of #76541 - matthiaskrgr:unstable_sort, r=davidtwco use sort_unstable to sort primitive types It's not important to retain original order if we have &[1, 1, 2, 3] for example. clippy::stable_sort_primitive

view details

bors

commit sha 255ceeb5ff9875b7f525aa101c8adc155f3e0ef8

Auto merge of #76612 - estebank:pat-missing-fields-suggestion, r=davidtwco Provide suggestion for missing fields in patterns

view details

bors

commit sha 715e9340a1006e37aed381e320ddf30311c2c2a6

Auto merge of #74532 - fusion-engineering-forks:atomic-from-mut, r=KodrAus Add Atomic*::from_mut. The atomic equivalent of [`Cell::from_mut`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.from_mut).

view details

bors

commit sha 6cae28165f0450fd3f100374b26841e458b8cfef

Auto merge of #76682 - richkadel:vec-take, r=Mark-Simulacrum Optimize behavior of vec.split_off(0) (take all) Optimization improvement to `split_off()` so the performance meets the intuitively expected behavior when `at == 0`, avoiding the current behavior of copying the entire vector. The change honors documented behavior that the original vector's "previous capacity unchanged". This improvement better supports the pattern for building and flushing a buffer of elements, such as the following: ```rust let mut vec = Vec::new(); loop { vec.push(something); if condition_is_met { process(vec.split_off(0)); } } ``` `Option` wrapping is the first alternative I thought of, but is much less obvious and more verbose: ```rust let mut capacity = 1; let mut vec: Option<Vec<Stuff>> = None; loop { vec.get_or_insert_with(|| Vec::with_capacity(capacity)).push(something); if condition_is_met { capacity = vec.capacity(); process(vec.take().unwrap()); } } ``` Directly using `mem::replace()` (instead of calling`split_off()`) could work, but `mem::replace()` is a more advanced tool for Rust developers, and in this case, I believe developers would assume the standard library should be sufficient for the purpose described here. The benefit of the approach to this change is it does not change the existing API contract, but improves the peformance of `split_off(0)` for `Vec`, `String` (which delegates `split_off()` to `Vec`), and any other existing use cases. This change adds tests to validate the behavior of `split_off()` with regard to capacity, as originally documented, and confirm that behavior still holds, when `at == 0`. The change is an implementation detail, and does not require a documentation change, but documenting the new behavior as part of its API contract may benefit future users. (Let me know if I should make that documentation update.) Note, for future consideration: I think it would be helpful to introduce an additional method to `Vec` (if not also to `String`): ``` pub fn take_all(&mut self) -> Self { self.split_off(0) } ``` This would make it more clear how `Vec` supports the pattern, and make it easier to find, since the behavior is similar to other `take()` methods in the Rust standard library. r? `@wesleywiser` FYI: `@tmandry`

view details

bors

commit sha c1589cc819ba7cf289c3ccbab30c215f0a6ba7d7

Auto merge of #76684 - jyn514:refactor-intra-links, r=manishearth Refactor intra doc link code I got tired of `fold_item` being 500 lines long. This is best reviewed one commit at a time with whitespace changes hidden. There are no logic changes other than the last commit making a parameter checked by the caller instead of the callee. r? `@Manishearth`

view details

bors

commit sha 90b1f5ae59291dd69d72fad41a22277df19dc953

Auto merge of #76171 - estebank:turbofish-the-revenge, r=davidtwco Detect turbofish with multiple type params missing leading `::` Fix #76072.

view details

Tomasz Miąsko

commit sha 63f3dcefb950d9d9f63b8a71de39d990a742b675

copy-prop: Add test case for missed optimization due const prop failure Currently a failure to completely propagate a constant inhibits propagation of any subsequent locals. Add a test case demonstrating the problem before resolving it.

view details

Tomasz Miąsko

commit sha 2ee57d752f3bd1ce3bf386465de9e60b6ebbfa52

copy-prop: Attempt to propagate each local only once The copy propagation as currently implemented does not introduce new copy propagation opportunities. Examine each local for possible optimization only once. Additionally, this also fixes the issue where copy propagation optimization would stop without examining all locals after failing to completely propagate a constant.

view details

Tomasz Miąsko

commit sha 35c8b0e78a02dc1f42a27cf009003be9b86df314

copy-prop: Remove unused self-assignment elimination The assignments that are starting point for the copy propagation are removed separately. The copy propagation does not introduce self-assignments otherwise, so the code for self-assignments elimination is functionally inert. Remove it. No functional changes intended.

view details

Tomasz Miąsko

commit sha 232adee6169ed779faddcf5ddf491c058d93c782

copy-prop: Online def-use analysis for copy propagation pass Implement an online def-use analysis for the copy propagation pass. The analysis is updated in an incremental fashion as changes are made to the MIR body instead of being recomputed from scratch after each change. The analysis is intended to be equivalent to the previous one, but it also offers a new methods to: remove specific statement, remove storage markers, and replace the uses of a local with another local or a constant, all while keeping the analysis up-to date. No functional changes intended.

view details

push time in 12 days

issue openedrust-lang/rust

Miscompilation introduced by CopyPropagation

To reproduce the issue:

  • Checkout 41dc3942eb33e8e882b6e4782a9bd9d2b8970647 (for reproducibility, but might be unnecessary).
  • Enable copy propagation so that it runs on mir-opt-level=1.
  • ./x.py test --stage 2 src/test/ui (disable incremental compilation, so that rustc is rebuild completely).
  • Observe tests failures: "not all trait items implemented, missing ...".

created time in 12 days

more